aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wood <thomas.wood@intel.com>2014-08-20 09:45:00 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-20 11:19:27 -0400
commit3a5f87c286515c54ff5c52c3e64d0c522b7570c0 (patch)
treeea53c5a3dccac1e556bc008270b85230fe07b064
parentfd639ac6dcbcbae4f2131bf1390a032df659ffb7 (diff)
drm: fix plane rotation when restoring fbdev configuration
Make sure plane rotation is reset correctly when restoring the fbdev configuration by using drm_mode_plane_set_obj_prop which calls the driver's set_property callback. The rotation reset feature was introduced in commit 9783de2 (drm: Resetting rotation property) and the callback issue was originally addressed in a previous version of the patch, but the fix was not present in the final version. v2: Fix documentation warning Add some more details to the commit message (Daniel Vetter) Testcase: igt/kms_rotation_crc Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82236 Cc: Sonika Jindal <sonika.jindal@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Dave Airlie <airlied@gmail.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_crtc.c25
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c6
-rw-r--r--include/drm/drm_crtc.h3
3 files changed, 26 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 3c4a62169f28..d7e4c0e2e796 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -4156,12 +4156,25 @@ static int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj,
4156 return ret; 4156 return ret;
4157} 4157}
4158 4158
4159static int drm_mode_plane_set_obj_prop(struct drm_mode_object *obj, 4159/**
4160 struct drm_property *property, 4160 * drm_mode_plane_set_obj_prop - set the value of a property
4161 uint64_t value) 4161 * @plane: drm plane object to set property value for
4162 * @property: property to set
4163 * @value: value the property should be set to
4164 *
4165 * This functions sets a given property on a given plane object. This function
4166 * calls the driver's ->set_property callback and changes the software state of
4167 * the property if the callback succeeds.
4168 *
4169 * Returns:
4170 * Zero on success, error code on failure.
4171 */
4172int drm_mode_plane_set_obj_prop(struct drm_plane *plane,
4173 struct drm_property *property,
4174 uint64_t value)
4162{ 4175{
4163 int ret = -EINVAL; 4176 int ret = -EINVAL;
4164 struct drm_plane *plane = obj_to_plane(obj); 4177 struct drm_mode_object *obj = &plane->base;
4165 4178
4166 if (plane->funcs->set_property) 4179 if (plane->funcs->set_property)
4167 ret = plane->funcs->set_property(plane, property, value); 4180 ret = plane->funcs->set_property(plane, property, value);
@@ -4170,6 +4183,7 @@ static int drm_mode_plane_set_obj_prop(struct drm_mode_object *obj,
4170 4183
4171 return ret; 4184 return ret;
4172} 4185}
4186EXPORT_SYMBOL(drm_mode_plane_set_obj_prop);
4173 4187
4174/** 4188/**
4175 * drm_mode_getproperty_ioctl - get the current value of a object's property 4189 * drm_mode_getproperty_ioctl - get the current value of a object's property
@@ -4308,7 +4322,8 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
4308 ret = drm_mode_crtc_set_obj_prop(arg_obj, property, arg->value); 4322 ret = drm_mode_crtc_set_obj_prop(arg_obj, property, arg->value);
4309 break; 4323 break;
4310 case DRM_MODE_OBJECT_PLANE: 4324 case DRM_MODE_OBJECT_PLANE:
4311 ret = drm_mode_plane_set_obj_prop(arg_obj, property, arg->value); 4325 ret = drm_mode_plane_set_obj_prop(obj_to_plane(arg_obj),
4326 property, arg->value);
4312 break; 4327 break;
4313 } 4328 }
4314 4329
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index d139eddb3d61..99569ee5adee 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -350,9 +350,9 @@ static bool restore_fbdev_mode(struct drm_fb_helper *fb_helper)
350 drm_plane_force_disable(plane); 350 drm_plane_force_disable(plane);
351 351
352 if (dev->mode_config.rotation_property) { 352 if (dev->mode_config.rotation_property) {
353 drm_object_property_set_value(&plane->base, 353 drm_mode_plane_set_obj_prop(plane,
354 dev->mode_config.rotation_property, 354 dev->mode_config.rotation_property,
355 BIT(DRM_ROTATE_0)); 355 BIT(DRM_ROTATE_0));
356 } 356 }
357 } 357 }
358 358
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 62f73bdbcc47..38fae5d9ad73 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1121,6 +1121,9 @@ extern int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
1121 struct drm_file *file_priv); 1121 struct drm_file *file_priv);
1122extern int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data, 1122extern int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
1123 struct drm_file *file_priv); 1123 struct drm_file *file_priv);
1124extern int drm_mode_plane_set_obj_prop(struct drm_plane *plane,
1125 struct drm_property *property,
1126 uint64_t value);
1124 1127
1125extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth, 1128extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
1126 int *bpp); 1129 int *bpp);