diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-08-09 14:10:22 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-08-09 15:13:14 -0400 |
commit | 0ad72863ea426d46b2786cba9430e122a40aad0b (patch) | |
tree | bbb9346e53a5e0c16674f4e43807cad013c6cc25 /drivers/gpu/drm/nouveau/nouveau_sysfs.c | |
parent | 967e7bde8739fe3b215f7537e8f1f39c044902af (diff) |
drm/nouveau: port to nvif client/device/objects
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_sysfs.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_sysfs.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_sysfs.c b/drivers/gpu/drm/nouveau/nouveau_sysfs.c index 29b6606abeaa..80f30d7c2c02 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sysfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_sysfs.c | |||
@@ -48,7 +48,8 @@ nouveau_sysfs_pstate_get(struct device *d, struct device_attribute *a, char *b) | |||
48 | char *buf = b; | 48 | char *buf = b; |
49 | int ret, i; | 49 | int ret, i; |
50 | 50 | ||
51 | ret = nv_exec(sysfs->ctrl, NV_CONTROL_PSTATE_INFO, &info, sizeof(info)); | 51 | ret = nvif_exec(&sysfs->ctrl, NV_CONTROL_PSTATE_INFO, |
52 | &info, sizeof(info)); | ||
52 | if (ret) | 53 | if (ret) |
53 | return ret; | 54 | return ret; |
54 | 55 | ||
@@ -60,8 +61,8 @@ nouveau_sysfs_pstate_get(struct device *d, struct device_attribute *a, char *b) | |||
60 | .index = 0, | 61 | .index = 0, |
61 | }; | 62 | }; |
62 | 63 | ||
63 | ret = nv_exec(sysfs->ctrl, NV_CONTROL_PSTATE_ATTR, | 64 | ret = nvif_exec(&sysfs->ctrl, NV_CONTROL_PSTATE_ATTR, |
64 | &attr, sizeof(attr)); | 65 | &attr, sizeof(attr)); |
65 | if (ret) | 66 | if (ret) |
66 | return ret; | 67 | return ret; |
67 | 68 | ||
@@ -75,8 +76,8 @@ nouveau_sysfs_pstate_get(struct device *d, struct device_attribute *a, char *b) | |||
75 | attr.index = 0; | 76 | attr.index = 0; |
76 | do { | 77 | do { |
77 | attr.state = state; | 78 | attr.state = state; |
78 | ret = nv_exec(sysfs->ctrl, NV_CONTROL_PSTATE_ATTR, | 79 | ret = nvif_exec(&sysfs->ctrl, NV_CONTROL_PSTATE_ATTR, |
79 | &attr, sizeof(attr)); | 80 | &attr, sizeof(attr)); |
80 | if (ret) | 81 | if (ret) |
81 | return ret; | 82 | return ret; |
82 | 83 | ||
@@ -139,7 +140,8 @@ nouveau_sysfs_pstate_set(struct device *d, struct device_attribute *a, | |||
139 | args.ustate = value; | 140 | args.ustate = value; |
140 | } | 141 | } |
141 | 142 | ||
142 | ret = nv_exec(sysfs->ctrl, NV_CONTROL_PSTATE_USER, &args, sizeof(args)); | 143 | ret = nvif_exec(&sysfs->ctrl, NV_CONTROL_PSTATE_USER, |
144 | &args, sizeof(args)); | ||
143 | if (ret < 0) | 145 | if (ret < 0) |
144 | return ret; | 146 | return ret; |
145 | 147 | ||
@@ -156,9 +158,9 @@ nouveau_sysfs_fini(struct drm_device *dev) | |||
156 | struct nouveau_drm *drm = nouveau_drm(dev); | 158 | struct nouveau_drm *drm = nouveau_drm(dev); |
157 | struct nvif_device *device = &drm->device; | 159 | struct nvif_device *device = &drm->device; |
158 | 160 | ||
159 | if (sysfs->ctrl) { | 161 | if (sysfs->ctrl.priv) { |
160 | device_remove_file(nv_device_base(nvkm_device(device)), &dev_attr_pstate); | 162 | device_remove_file(nv_device_base(nvkm_device(device)), &dev_attr_pstate); |
161 | nouveau_object_del(nv_object(drm), NVDRM_DEVICE, NVDRM_CONTROL); | 163 | nvif_object_fini(&sysfs->ctrl); |
162 | } | 164 | } |
163 | 165 | ||
164 | drm->sysfs = NULL; | 166 | drm->sysfs = NULL; |
@@ -177,8 +179,8 @@ nouveau_sysfs_init(struct drm_device *dev) | |||
177 | if (!sysfs) | 179 | if (!sysfs) |
178 | return -ENOMEM; | 180 | return -ENOMEM; |
179 | 181 | ||
180 | ret = nouveau_object_new(nv_object(drm), NVDRM_DEVICE, NVDRM_CONTROL, | 182 | ret = nvif_object_init(nvif_object(&drm->device), NULL, NVDRM_CONTROL, |
181 | NV_CONTROL_CLASS, NULL, 0, &sysfs->ctrl); | 183 | NV_CONTROL_CLASS, NULL, 0, &sysfs->ctrl); |
182 | if (ret == 0) | 184 | if (ret == 0) |
183 | device_create_file(nv_device_base(nvkm_device(device)), &dev_attr_pstate); | 185 | device_create_file(nv_device_base(nvkm_device(device)), &dev_attr_pstate); |
184 | 186 | ||