aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_fb.c
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2017-05-19 16:50:17 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-05-22 03:49:48 -0400
commitc2c446ad29437bb92b157423c632286608ebd3ec (patch)
tree4556c8a5cb182538c3388ec5d38e07527828e952 /drivers/gpu/drm/omapdrm/omap_fb.c
parente8fa49b5d974846d367b103edc026c4d2b90ebfd (diff)
drm: Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ to UAPI
Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ defines to the UAPI as a convenience. Ideally the DRM_ROTATE_ and DRM_REFLECT_ property ids are looked up through the atomic API, but realizing that userspace is likely to take shortcuts and assume that the enum values are what is sent over the wire. As a result these defines are provided purely as a convenience to userspace applications. Changes since v3: - Switched away from past tense in comments - Add define name change to previously mis-spelled DRM_REFLECT_X comment - Improved the comment for the DRM_MODE_REFLECT_<axis> comment Changes since v2: - Changed define prefix from DRM_MODE_PROP_ to DRM_MODE_ - Fix compilation errors - Changed comment formatting - Deduplicated comment lines - Clarified DRM_MODE_PROP_REFLECT_ comment Changes since v1: - Moved defines from drm.h to drm_mode.h - Changed define prefix from DRM_ to DRM_MODE_PROP_ - Updated uses of the defines to the new prefix - Removed include from drm_rect.c - Stopped using the BIT() macro Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Acked-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170519205017.23307-2-robert.foss@collabora.com
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_fb.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_fb.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index 29dc677dd4d3..5ca0537bb427 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -167,30 +167,30 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
167 uint32_t w = win->src_w; 167 uint32_t w = win->src_w;
168 uint32_t h = win->src_h; 168 uint32_t h = win->src_h;
169 169
170 switch (win->rotation & DRM_ROTATE_MASK) { 170 switch (win->rotation & DRM_MODE_ROTATE_MASK) {
171 default: 171 default:
172 dev_err(fb->dev->dev, "invalid rotation: %02x", 172 dev_err(fb->dev->dev, "invalid rotation: %02x",
173 (uint32_t)win->rotation); 173 (uint32_t)win->rotation);
174 /* fallthru to default to no rotation */ 174 /* fallthru to default to no rotation */
175 case 0: 175 case 0:
176 case DRM_ROTATE_0: 176 case DRM_MODE_ROTATE_0:
177 orient = 0; 177 orient = 0;
178 break; 178 break;
179 case DRM_ROTATE_90: 179 case DRM_MODE_ROTATE_90:
180 orient = MASK_XY_FLIP | MASK_X_INVERT; 180 orient = MASK_XY_FLIP | MASK_X_INVERT;
181 break; 181 break;
182 case DRM_ROTATE_180: 182 case DRM_MODE_ROTATE_180:
183 orient = MASK_X_INVERT | MASK_Y_INVERT; 183 orient = MASK_X_INVERT | MASK_Y_INVERT;
184 break; 184 break;
185 case DRM_ROTATE_270: 185 case DRM_MODE_ROTATE_270:
186 orient = MASK_XY_FLIP | MASK_Y_INVERT; 186 orient = MASK_XY_FLIP | MASK_Y_INVERT;
187 break; 187 break;
188 } 188 }
189 189
190 if (win->rotation & DRM_REFLECT_X) 190 if (win->rotation & DRM_MODE_REFLECT_X)
191 orient ^= MASK_X_INVERT; 191 orient ^= MASK_X_INVERT;
192 192
193 if (win->rotation & DRM_REFLECT_Y) 193 if (win->rotation & DRM_MODE_REFLECT_Y)
194 orient ^= MASK_Y_INVERT; 194 orient ^= MASK_Y_INVERT;
195 195
196 /* adjust x,y offset for flip/invert: */ 196 /* adjust x,y offset for flip/invert: */
@@ -205,9 +205,9 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
205 info->rotation_type = OMAP_DSS_ROT_TILER; 205 info->rotation_type = OMAP_DSS_ROT_TILER;
206 info->screen_width = omap_gem_tiled_stride(plane->bo, orient); 206 info->screen_width = omap_gem_tiled_stride(plane->bo, orient);
207 } else { 207 } else {
208 switch (win->rotation & DRM_ROTATE_MASK) { 208 switch (win->rotation & DRM_MODE_ROTATE_MASK) {
209 case 0: 209 case 0:
210 case DRM_ROTATE_0: 210 case DRM_MODE_ROTATE_0:
211 /* OK */ 211 /* OK */
212 break; 212 break;
213 213