aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2016-10-21 15:22:45 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-10-22 04:42:11 -0400
commit6686df8cf1cf589c54343372e3524bf52cda038e (patch)
treebd58c8614dffe0c5ee3c1f1e825deae46c99ee4c
parent574a37b1bb07499778e6f46b56b6dda18151ad04 (diff)
drm: RIP mode_config->rotation_property
Now that all drivers have been converted over to the per-plane rotation property, we can just nuke the global rotation property. v2: Rebase due to BIT(),__builtin_ffs() & co. Deal with superfluous code shuffling Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1477077768-4274-4-git-send-email-ville.syrjala@linux.intel.com
-rw-r--r--drivers/gpu/drm/drm_atomic.c6
-rw-r--r--drivers/gpu/drm/drm_blend.c32
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c7
-rw-r--r--include/drm/drm_blend.h2
-rw-r--r--include/drm/drm_crtc.h5
5 files changed, 7 insertions, 45 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index f81706387889..1b5a32df9a9a 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -705,8 +705,7 @@ int drm_atomic_plane_set_property(struct drm_plane *plane,
705 state->src_w = val; 705 state->src_w = val;
706 } else if (property == config->prop_src_h) { 706 } else if (property == config->prop_src_h) {
707 state->src_h = val; 707 state->src_h = val;
708 } else if (property == config->rotation_property || 708 } else if (property == plane->rotation_property) {
709 property == plane->rotation_property) {
710 if (!is_power_of_2(val & DRM_ROTATE_MASK)) 709 if (!is_power_of_2(val & DRM_ROTATE_MASK))
711 return -EINVAL; 710 return -EINVAL;
712 state->rotation = val; 711 state->rotation = val;
@@ -766,8 +765,7 @@ drm_atomic_plane_get_property(struct drm_plane *plane,
766 *val = state->src_w; 765 *val = state->src_w;
767 } else if (property == config->prop_src_h) { 766 } else if (property == config->prop_src_h) {
768 *val = state->src_h; 767 *val = state->src_h;
769 } else if (property == config->rotation_property || 768 } else if (property == plane->rotation_property) {
770 property == plane->rotation_property) {
771 *val = state->rotation; 769 *val = state->rotation;
772 } else if (property == plane->zpos_property) { 770 } else if (property == plane->zpos_property) {
773 *val = state->zpos; 771 *val = state->zpos;
diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c
index e52aece30900..1f2412c7ccfd 100644
--- a/drivers/gpu/drm/drm_blend.c
+++ b/drivers/gpu/drm/drm_blend.c
@@ -89,7 +89,7 @@
89 * On top of this basic transformation additional properties can be exposed by 89 * On top of this basic transformation additional properties can be exposed by
90 * the driver: 90 * the driver:
91 * 91 *
92 * - Rotation is set up with drm_mode_create_rotation_property(). It adds a 92 * - Rotation is set up with drm_plane_create_rotation_property(). It adds a
93 * rotation and reflection step between the source and destination rectangles. 93 * rotation and reflection step between the source and destination rectangles.
94 * Without this property the rectangle is only scaled, but not rotated or 94 * Without this property the rectangle is only scaled, but not rotated or
95 * reflected. 95 * reflected.
@@ -105,18 +105,12 @@
105 */ 105 */
106 106
107/** 107/**
108 * drm_mode_create_rotation_property - create a new rotation property 108 * drm_plane_create_rotation_property - create a new rotation property
109 * @dev: DRM device 109 * @plane: drm plane
110 * @rotation: initial value of the rotation property
110 * @supported_rotations: bitmask of supported rotations and reflections 111 * @supported_rotations: bitmask of supported rotations and reflections
111 * 112 *
112 * This creates a new property with the selected support for transformations. 113 * This creates a new property with the selected support for transformations.
113 * The resulting property should be stored in @rotation_property in
114 * &drm_mode_config. It then must be attached to each plane which supports
115 * rotations using drm_object_attach_property().
116 *
117 * FIXME: Probably better if the rotation property is created on each plane,
118 * like the zpos property. Otherwise it's not possible to allow different
119 * rotation modes on different planes.
120 * 114 *
121 * Since a rotation by 180° degress is the same as reflecting both along the x 115 * Since a rotation by 180° degress is the same as reflecting both along the x
122 * and the y axis the rotation property is somewhat redundant. Drivers can use 116 * and the y axis the rotation property is somewhat redundant. Drivers can use
@@ -144,24 +138,6 @@
144 * rotation. After reflection, the rotation is applied to the image sampled from 138 * rotation. After reflection, the rotation is applied to the image sampled from
145 * the source rectangle, before scaling it to fit the destination rectangle. 139 * the source rectangle, before scaling it to fit the destination rectangle.
146 */ 140 */
147struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev,
148 unsigned int supported_rotations)
149{
150 static const struct drm_prop_enum_list props[] = {
151 { __builtin_ffs(DRM_ROTATE_0) - 1, "rotate-0" },
152 { __builtin_ffs(DRM_ROTATE_90) - 1, "rotate-90" },
153 { __builtin_ffs(DRM_ROTATE_180) - 1, "rotate-180" },
154 { __builtin_ffs(DRM_ROTATE_270) - 1, "rotate-270" },
155 { __builtin_ffs(DRM_REFLECT_X) - 1, "reflect-x" },
156 { __builtin_ffs(DRM_REFLECT_Y) - 1, "reflect-y" },
157 };
158
159 return drm_property_create_bitmask(dev, 0, "rotation",
160 props, ARRAY_SIZE(props),
161 supported_rotations);
162}
163EXPORT_SYMBOL(drm_mode_create_rotation_property);
164
165int drm_plane_create_rotation_property(struct drm_plane *plane, 141int drm_plane_create_rotation_property(struct drm_plane *plane,
166 unsigned int rotation, 142 unsigned int rotation,
167 unsigned int supported_rotations) 143 unsigned int supported_rotations)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index e0d428f9d1cb..83dbae0fabcf 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -392,15 +392,10 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)
392 if (plane->type != DRM_PLANE_TYPE_PRIMARY) 392 if (plane->type != DRM_PLANE_TYPE_PRIMARY)
393 drm_plane_force_disable(plane); 393 drm_plane_force_disable(plane);
394 394
395 if (plane->rotation_property) { 395 if (plane->rotation_property)
396 drm_mode_plane_set_obj_prop(plane, 396 drm_mode_plane_set_obj_prop(plane,
397 plane->rotation_property, 397 plane->rotation_property,
398 DRM_ROTATE_0); 398 DRM_ROTATE_0);
399 } else if (dev->mode_config.rotation_property) {
400 drm_mode_plane_set_obj_prop(plane,
401 dev->mode_config.rotation_property,
402 DRM_ROTATE_0);
403 }
404 } 399 }
405 400
406 for (i = 0; i < fb_helper->crtc_count; i++) { 401 for (i = 0; i < fb_helper->crtc_count; i++) {
diff --git a/include/drm/drm_blend.h b/include/drm/drm_blend.h
index fd351924e1c5..13221cf9b3eb 100644
--- a/include/drm/drm_blend.h
+++ b/include/drm/drm_blend.h
@@ -52,8 +52,6 @@ static inline bool drm_rotation_90_or_270(unsigned int rotation)
52 return rotation & (DRM_ROTATE_90 | DRM_ROTATE_270); 52 return rotation & (DRM_ROTATE_90 | DRM_ROTATE_270);
53} 53}
54 54
55struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev,
56 unsigned int supported_rotations);
57int drm_plane_create_rotation_property(struct drm_plane *plane, 55int drm_plane_create_rotation_property(struct drm_plane *plane,
58 unsigned int rotation, 56 unsigned int rotation,
59 unsigned int supported_rotations); 57 unsigned int supported_rotations);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 284c1b3aec10..bc860cfc67ca 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1156,11 +1156,6 @@ struct drm_mode_config {
1156 */ 1156 */
1157 struct drm_property *plane_type_property; 1157 struct drm_property *plane_type_property;
1158 /** 1158 /**
1159 * @rotation_property: Optional property for planes or CRTCs to specifiy
1160 * rotation.
1161 */
1162 struct drm_property *rotation_property;
1163 /**
1164 * @prop_src_x: Default atomic plane property for the plane source 1159 * @prop_src_x: Default atomic plane property for the plane source
1165 * position in the connected &drm_framebuffer. 1160 * position in the connected &drm_framebuffer.
1166 */ 1161 */