Loading drivers/gpu/drm/nouveau/include/nvif/user.h +1 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ struct nvif_user { struct nvif_user_func { void (*doorbell)(struct nvif_user *, u32 token); u64 (*time)(struct nvif_user *); }; int nvif_user_init(struct nvif_device *); Loading drivers/gpu/drm/nouveau/nvif/device.c +9 −5 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ u64 nvif_device_time(struct nvif_device *device) { if (!device->user.func) { struct nv_device_time_v0 args = {}; int ret = nvif_object_mthd(&device->object, NV_DEVICE_V0_TIME, &args, sizeof(args)); Loading @@ -34,6 +35,9 @@ nvif_device_time(struct nvif_device *device) return args.time; } return device->user.func->time(&device->user); } void nvif_device_fini(struct nvif_device *device) { Loading drivers/gpu/drm/nouveau/nvif/userc361.c +14 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,19 @@ */ #include <nvif/user.h> static u64 nvif_userc361_time(struct nvif_user *user) { u32 hi, lo; do { hi = nvif_rd32(&user->object, 0x084); lo = nvif_rd32(&user->object, 0x080); } while (hi != nvif_rd32(&user->object, 0x084)); return ((u64)hi << 32 | lo); } static void nvif_userc361_doorbell(struct nvif_user *user, u32 token) { Loading @@ -30,4 +43,5 @@ nvif_userc361_doorbell(struct nvif_user *user, u32 token) const struct nvif_user_func nvif_userc361 = { .doorbell = nvif_userc361_doorbell, .time = nvif_userc361_time, }; Loading
drivers/gpu/drm/nouveau/include/nvif/user.h +1 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ struct nvif_user { struct nvif_user_func { void (*doorbell)(struct nvif_user *, u32 token); u64 (*time)(struct nvif_user *); }; int nvif_user_init(struct nvif_device *); Loading
drivers/gpu/drm/nouveau/nvif/device.c +9 −5 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ u64 nvif_device_time(struct nvif_device *device) { if (!device->user.func) { struct nv_device_time_v0 args = {}; int ret = nvif_object_mthd(&device->object, NV_DEVICE_V0_TIME, &args, sizeof(args)); Loading @@ -34,6 +35,9 @@ nvif_device_time(struct nvif_device *device) return args.time; } return device->user.func->time(&device->user); } void nvif_device_fini(struct nvif_device *device) { Loading
drivers/gpu/drm/nouveau/nvif/userc361.c +14 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,19 @@ */ #include <nvif/user.h> static u64 nvif_userc361_time(struct nvif_user *user) { u32 hi, lo; do { hi = nvif_rd32(&user->object, 0x084); lo = nvif_rd32(&user->object, 0x080); } while (hi != nvif_rd32(&user->object, 0x084)); return ((u64)hi << 32 | lo); } static void nvif_userc361_doorbell(struct nvif_user *user, u32 token) { Loading @@ -30,4 +43,5 @@ nvif_userc361_doorbell(struct nvif_user *user, u32 token) const struct nvif_user_func nvif_userc361 = { .doorbell = nvif_userc361_doorbell, .time = nvif_userc361_time, };