aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm
diff options
context:
space:
mode:
authorJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2016-07-29 01:50:05 -0400
committerSean Paul <seanpaul@chromium.org>2016-08-08 14:17:56 -0400
commit31ad61e4afa53a7b2e364f7c021546fbc6ce0d85 (patch)
treef08d7ac2be97f1d6c961553f0027e4b0e5310423 /drivers/gpu/drm/omapdrm
parentfcc60b413d14dd06ddbd79ec50e83c4fb2a097ba (diff)
drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
Only property creation uses the rotation as an index, so convert the to figure the index when needed. v2: Use the new defines to build the _MASK defines (Sean) Cc: intel-gfx@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Cc: malidp@foss.arm.com Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Liviu Dudau <Liviu.Dudau@arm.com> Cc: Sean Paul <seanpaul@chromium.org> Acked-by: Liviu Dudau <Liviu.Dudau@arm.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v1) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1469771405-17653-1-git-send-email-joonas.lahtinen@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/omapdrm')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c6
-rw-r--r--drivers/gpu/drm/omapdrm/omap_fb.c14
-rw-r--r--drivers/gpu/drm/omapdrm/omap_plane.c10
3 files changed, 15 insertions, 15 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 26c6134eb744..3dd78f2045f9 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -295,9 +295,9 @@ static int omap_modeset_init_properties(struct drm_device *dev)
295 if (priv->has_dmm) { 295 if (priv->has_dmm) {
296 dev->mode_config.rotation_property = 296 dev->mode_config.rotation_property =
297 drm_mode_create_rotation_property(dev, 297 drm_mode_create_rotation_property(dev,
298 BIT(DRM_ROTATE_0) | BIT(DRM_ROTATE_90) | 298 DRM_ROTATE_0 | DRM_ROTATE_90 |
299 BIT(DRM_ROTATE_180) | BIT(DRM_ROTATE_270) | 299 DRM_ROTATE_180 | DRM_ROTATE_270 |
300 BIT(DRM_REFLECT_X) | BIT(DRM_REFLECT_Y)); 300 DRM_REFLECT_X | DRM_REFLECT_Y);
301 if (!dev->mode_config.rotation_property) 301 if (!dev->mode_config.rotation_property)
302 return -ENOMEM; 302 return -ENOMEM;
303 } 303 }
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index 31f5178c22c7..5f3337f1e9aa 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -179,24 +179,24 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
179 (uint32_t)win->rotation); 179 (uint32_t)win->rotation);
180 /* fallthru to default to no rotation */ 180 /* fallthru to default to no rotation */
181 case 0: 181 case 0:
182 case BIT(DRM_ROTATE_0): 182 case DRM_ROTATE_0:
183 orient = 0; 183 orient = 0;
184 break; 184 break;
185 case BIT(DRM_ROTATE_90): 185 case DRM_ROTATE_90:
186 orient = MASK_XY_FLIP | MASK_X_INVERT; 186 orient = MASK_XY_FLIP | MASK_X_INVERT;
187 break; 187 break;
188 case BIT(DRM_ROTATE_180): 188 case DRM_ROTATE_180:
189 orient = MASK_X_INVERT | MASK_Y_INVERT; 189 orient = MASK_X_INVERT | MASK_Y_INVERT;
190 break; 190 break;
191 case BIT(DRM_ROTATE_270): 191 case DRM_ROTATE_270:
192 orient = MASK_XY_FLIP | MASK_Y_INVERT; 192 orient = MASK_XY_FLIP | MASK_Y_INVERT;
193 break; 193 break;
194 } 194 }
195 195
196 if (win->rotation & BIT(DRM_REFLECT_X)) 196 if (win->rotation & DRM_REFLECT_X)
197 orient ^= MASK_X_INVERT; 197 orient ^= MASK_X_INVERT;
198 198
199 if (win->rotation & BIT(DRM_REFLECT_Y)) 199 if (win->rotation & DRM_REFLECT_Y)
200 orient ^= MASK_Y_INVERT; 200 orient ^= MASK_Y_INVERT;
201 201
202 /* adjust x,y offset for flip/invert: */ 202 /* adjust x,y offset for flip/invert: */
@@ -213,7 +213,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
213 } else { 213 } else {
214 switch (win->rotation & DRM_ROTATE_MASK) { 214 switch (win->rotation & DRM_ROTATE_MASK) {
215 case 0: 215 case 0:
216 case BIT(DRM_ROTATE_0): 216 case DRM_ROTATE_0:
217 /* OK */ 217 /* OK */
218 break; 218 break;
219 219
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 5252ab720e70..4c7727e6be7c 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -109,8 +109,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
109 win.src_y = state->src_y >> 16; 109 win.src_y = state->src_y >> 16;
110 110
111 switch (state->rotation & DRM_ROTATE_MASK) { 111 switch (state->rotation & DRM_ROTATE_MASK) {
112 case BIT(DRM_ROTATE_90): 112 case DRM_ROTATE_90:
113 case BIT(DRM_ROTATE_270): 113 case DRM_ROTATE_270:
114 win.src_w = state->src_h >> 16; 114 win.src_w = state->src_h >> 16;
115 win.src_h = state->src_w >> 16; 115 win.src_h = state->src_w >> 16;
116 break; 116 break;
@@ -149,7 +149,7 @@ static void omap_plane_atomic_disable(struct drm_plane *plane,
149 struct omap_plane_state *omap_state = to_omap_plane_state(plane->state); 149 struct omap_plane_state *omap_state = to_omap_plane_state(plane->state);
150 struct omap_plane *omap_plane = to_omap_plane(plane); 150 struct omap_plane *omap_plane = to_omap_plane(plane);
151 151
152 plane->state->rotation = BIT(DRM_ROTATE_0); 152 plane->state->rotation = DRM_ROTATE_0;
153 omap_state->zorder = plane->type == DRM_PLANE_TYPE_PRIMARY 153 omap_state->zorder = plane->type == DRM_PLANE_TYPE_PRIMARY
154 ? 0 : omap_plane->id; 154 ? 0 : omap_plane->id;
155 155
@@ -178,7 +178,7 @@ static int omap_plane_atomic_check(struct drm_plane *plane,
178 return -EINVAL; 178 return -EINVAL;
179 179
180 if (state->fb) { 180 if (state->fb) {
181 if (state->rotation != BIT(DRM_ROTATE_0) && 181 if (state->rotation != DRM_ROTATE_0 &&
182 !omap_framebuffer_supports_rotation(state->fb)) 182 !omap_framebuffer_supports_rotation(state->fb))
183 return -EINVAL; 183 return -EINVAL;
184 } 184 }
@@ -269,7 +269,7 @@ static void omap_plane_reset(struct drm_plane *plane)
269 */ 269 */
270 omap_state->zorder = plane->type == DRM_PLANE_TYPE_PRIMARY 270 omap_state->zorder = plane->type == DRM_PLANE_TYPE_PRIMARY
271 ? 0 : omap_plane->id; 271 ? 0 : omap_plane->id;
272 omap_state->base.rotation = BIT(DRM_ROTATE_0); 272 omap_state->base.rotation = DRM_ROTATE_0;
273 273
274 plane->state = &omap_state->base; 274 plane->state = &omap_state->base;
275 plane->state->plane = plane; 275 plane->state->plane = plane;