aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2014-12-16 18:05:31 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-12-17 14:23:25 -0500
commit22b8b13b6f436ffbb6e540f5f8039b1084a72794 (patch)
treeaaef2aa15dad4b80f27a5a2e41d1f0d984347b80
parentb17cd757a3f61e4519b70b4673f0467ec0153a10 (diff)
drm: get rid of direct property value access
For atomic drivers, we won't use the values array but instead shunt things off to obj->atomic_get_property(). So to simplify things make all read/write of properties values go through the accessors. Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_crtc.c19
-rw-r--r--include/drm/drm_crtc.h3
2 files changed, 18 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 2780a088051e..481bb2598b62 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -2106,12 +2106,17 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
2106 prop_values = (uint64_t __user *)(unsigned long)(out_resp->prop_values_ptr); 2106 prop_values = (uint64_t __user *)(unsigned long)(out_resp->prop_values_ptr);
2107 for (i = 0; i < connector->properties.count; i++) { 2107 for (i = 0; i < connector->properties.count; i++) {
2108 struct drm_property *prop = connector->properties.properties[i]; 2108 struct drm_property *prop = connector->properties.properties[i];
2109 uint64_t val;
2110
2111 ret = drm_object_property_get_value(&connector->base, prop, &val);
2112 if (ret)
2113 goto out;
2114
2109 if (put_user(prop->base.id, prop_ptr + copied)) { 2115 if (put_user(prop->base.id, prop_ptr + copied)) {
2110 ret = -EFAULT; 2116 ret = -EFAULT;
2111 goto out; 2117 goto out;
2112 } 2118 }
2113 if (put_user(connector->properties.values[i], 2119 if (put_user(val, prop_values + copied)) {
2114 prop_values + copied)) {
2115 ret = -EFAULT; 2120 ret = -EFAULT;
2116 goto out; 2121 goto out;
2117 } 2122 }
@@ -4413,12 +4418,18 @@ int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
4413 (arg->prop_values_ptr); 4418 (arg->prop_values_ptr);
4414 for (i = 0; i < props_count; i++) { 4419 for (i = 0; i < props_count; i++) {
4415 struct drm_property *prop = obj->properties->properties[i]; 4420 struct drm_property *prop = obj->properties->properties[i];
4421 uint64_t val;
4422
4423 ret = drm_object_property_get_value(obj, prop, &val);
4424 if (ret)
4425 goto out;
4426
4416 if (put_user(prop->base.id, props_ptr + copied)) { 4427 if (put_user(prop->base.id, props_ptr + copied)) {
4417 ret = -EFAULT; 4428 ret = -EFAULT;
4418 goto out; 4429 goto out;
4419 } 4430 }
4420 if (put_user(obj->properties->values[i], 4431
4421 prop_values_ptr + copied)) { 4432 if (put_user(val, prop_values_ptr + copied)) {
4422 ret = -EFAULT; 4433 ret = -EFAULT;
4423 goto out; 4434 goto out;
4424 } 4435 }
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 265f90afcac4..f7c0b7bb9d5f 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -70,6 +70,9 @@ struct drm_object_properties {
70 * dangling property pointers: 70 * dangling property pointers:
71 */ 71 */
72 struct drm_property *properties[DRM_OBJECT_MAX_PROPERTY]; 72 struct drm_property *properties[DRM_OBJECT_MAX_PROPERTY];
73 /* do not read/write values directly, but use drm_object_property_get_value()
74 * and drm_object_property_set_value():
75 */
73 uint64_t values[DRM_OBJECT_MAX_PROPERTY]; 76 uint64_t values[DRM_OBJECT_MAX_PROPERTY];
74}; 77};
75 78