diff options
| author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2016-09-26 12:30:46 -0400 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-10-21 12:21:33 -0400 |
| commit | bd2ef25d921c0d937e4bc4f5a4f98f534424c6aa (patch) | |
| tree | 79890cbbe96fd0d494c5240d64e0c47b24850d77 /drivers/gpu/drm/atmel-hlcdc | |
| parent | 30cd85dd6edc86ea8d8589efb813f1fad41ef233 (diff) | |
drm: Add drm_rotation_90_or_270()
We have intel_rotation_90_or_270() in i915 to check if the rotation is
90 or 270 degrees. Similar checks are elsewhere in drm, so let's move
the helper into a central place and use it everwhere.
v2: Drop the BIT()
Convert all new intel_rotation_90_or_270() calls
Deal with superfluous code shuffling
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
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/1474907460-10717-2-git-send-email-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/atmel-hlcdc')
| -rw-r--r-- | drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 9d4c030672f0..b380179d4013 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | |||
| @@ -393,7 +393,7 @@ static void atmel_hlcdc_plane_update_format(struct atmel_hlcdc_plane *plane, | |||
| 393 | 393 | ||
| 394 | if ((state->base.fb->pixel_format == DRM_FORMAT_YUV422 || | 394 | if ((state->base.fb->pixel_format == DRM_FORMAT_YUV422 || |
| 395 | state->base.fb->pixel_format == DRM_FORMAT_NV61) && | 395 | state->base.fb->pixel_format == DRM_FORMAT_NV61) && |
| 396 | (state->base.rotation & (DRM_ROTATE_90 | DRM_ROTATE_270))) | 396 | drm_rotation_90_or_270(state->base.rotation)) |
| 397 | cfg |= ATMEL_HLCDC_YUV422ROT; | 397 | cfg |= ATMEL_HLCDC_YUV422ROT; |
| 398 | 398 | ||
| 399 | atmel_hlcdc_layer_update_cfg(&plane->layer, | 399 | atmel_hlcdc_layer_update_cfg(&plane->layer, |
| @@ -628,7 +628,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, | |||
| 628 | /* | 628 | /* |
| 629 | * Swap width and size in case of 90 or 270 degrees rotation | 629 | * Swap width and size in case of 90 or 270 degrees rotation |
| 630 | */ | 630 | */ |
| 631 | if (state->base.rotation & (DRM_ROTATE_90 | DRM_ROTATE_270)) { | 631 | if (drm_rotation_90_or_270(state->base.rotation)) { |
| 632 | tmp = state->crtc_w; | 632 | tmp = state->crtc_w; |
| 633 | state->crtc_w = state->crtc_h; | 633 | state->crtc_w = state->crtc_h; |
| 634 | state->crtc_h = tmp; | 634 | state->crtc_h = tmp; |
