aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2014-12-16 18:05:30 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-12-17 14:23:24 -0500
commitb17cd757a3f61e4519b70b4673f0467ec0153a10 (patch)
tree80ca0fb8278f020faf64db835ac04b4010845bc9 /drivers/gpu/drm/drm_crtc.c
parent3843e71f9882c9e2e965cf025f3a7d4de19ce823 (diff)
drm: store property instead of id in obj attachment
Keep property pointer, instead of id, in per mode-object attachments. This will simplify things in later patches. 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>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 5ee4b8806aca..2780a088051e 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -2105,12 +2105,11 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
2105 prop_ptr = (uint32_t __user *)(unsigned long)(out_resp->props_ptr); 2105 prop_ptr = (uint32_t __user *)(unsigned long)(out_resp->props_ptr);
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 if (put_user(connector->properties.ids[i], 2108 struct drm_property *prop = connector->properties.properties[i];
2109 prop_ptr + copied)) { 2109 if (put_user(prop->base.id, prop_ptr + copied)) {
2110 ret = -EFAULT; 2110 ret = -EFAULT;
2111 goto out; 2111 goto out;
2112 } 2112 }
2113
2114 if (put_user(connector->properties.values[i], 2113 if (put_user(connector->properties.values[i],
2115 prop_values + copied)) { 2114 prop_values + copied)) {
2116 ret = -EFAULT; 2115 ret = -EFAULT;
@@ -3822,7 +3821,7 @@ void drm_object_attach_property(struct drm_mode_object *obj,
3822 return; 3821 return;
3823 } 3822 }
3824 3823
3825 obj->properties->ids[count] = property->base.id; 3824 obj->properties->properties[count] = property;
3826 obj->properties->values[count] = init_val; 3825 obj->properties->values[count] = init_val;
3827 obj->properties->count++; 3826 obj->properties->count++;
3828} 3827}
@@ -3847,7 +3846,7 @@ int drm_object_property_set_value(struct drm_mode_object *obj,
3847 int i; 3846 int i;
3848 3847
3849 for (i = 0; i < obj->properties->count; i++) { 3848 for (i = 0; i < obj->properties->count; i++) {
3850 if (obj->properties->ids[i] == property->base.id) { 3849 if (obj->properties->properties[i] == property) {
3851 obj->properties->values[i] = val; 3850 obj->properties->values[i] = val;
3852 return 0; 3851 return 0;
3853 } 3852 }
@@ -3877,7 +3876,7 @@ int drm_object_property_get_value(struct drm_mode_object *obj,
3877 int i; 3876 int i;
3878 3877
3879 for (i = 0; i < obj->properties->count; i++) { 3878 for (i = 0; i < obj->properties->count; i++) {
3880 if (obj->properties->ids[i] == property->base.id) { 3879 if (obj->properties->properties[i] == property) {
3881 *val = obj->properties->values[i]; 3880 *val = obj->properties->values[i];
3882 return 0; 3881 return 0;
3883 } 3882 }
@@ -4413,8 +4412,8 @@ int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
4413 prop_values_ptr = (uint64_t __user *)(unsigned long) 4412 prop_values_ptr = (uint64_t __user *)(unsigned long)
4414 (arg->prop_values_ptr); 4413 (arg->prop_values_ptr);
4415 for (i = 0; i < props_count; i++) { 4414 for (i = 0; i < props_count; i++) {
4416 if (put_user(obj->properties->ids[i], 4415 struct drm_property *prop = obj->properties->properties[i];
4417 props_ptr + copied)) { 4416 if (put_user(prop->base.id, props_ptr + copied)) {
4418 ret = -EFAULT; 4417 ret = -EFAULT;
4419 goto out; 4418 goto out;
4420 } 4419 }
@@ -4472,7 +4471,7 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
4472 goto out; 4471 goto out;
4473 4472
4474 for (i = 0; i < arg_obj->properties->count; i++) 4473 for (i = 0; i < arg_obj->properties->count; i++)
4475 if (arg_obj->properties->ids[i] == arg->prop_id) 4474 if (arg_obj->properties->properties[i]->base.id == arg->prop_id)
4476 break; 4475 break;
4477 4476
4478 if (i == arg_obj->properties->count) 4477 if (i == arg_obj->properties->count)