Commit f22aa143 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Use & instead if == to check for rotations

Using == to check for 180 degree rotation only works as long as the
reflection bits aren't set. That will change soon enough for CHV, so
let's stop doing things the wrong way.

v2: Drop the BIT()
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1479142440-25283-2-git-send-email-ville.syrjala@linux.intel.com
parent 5697d60f
...@@ -3084,7 +3084,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, ...@@ -3084,7 +3084,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary,
intel_crtc->dspaddr_offset = intel_crtc->dspaddr_offset =
intel_compute_tile_offset(&x, &y, plane_state, 0); intel_compute_tile_offset(&x, &y, plane_state, 0);
if (rotation == DRM_ROTATE_180) { if (rotation & DRM_ROTATE_180) {
dspcntr |= DISPPLANE_ROTATE_180; dspcntr |= DISPPLANE_ROTATE_180;
x += (crtc_state->pipe_src_w - 1); x += (crtc_state->pipe_src_w - 1);
...@@ -3188,7 +3188,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary, ...@@ -3188,7 +3188,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,
intel_crtc->dspaddr_offset = intel_crtc->dspaddr_offset =
intel_compute_tile_offset(&x, &y, plane_state, 0); intel_compute_tile_offset(&x, &y, plane_state, 0);
if (rotation == DRM_ROTATE_180) { if (rotation & DRM_ROTATE_180) {
dspcntr |= DISPPLANE_ROTATE_180; dspcntr |= DISPPLANE_ROTATE_180;
if (!IS_HASWELL(dev_priv) && !IS_BROADWELL(dev_priv)) { if (!IS_HASWELL(dev_priv) && !IS_BROADWELL(dev_priv)) {
...@@ -10881,7 +10881,7 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base, ...@@ -10881,7 +10881,7 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base,
if (HAS_DDI(dev_priv)) if (HAS_DDI(dev_priv))
cntl |= CURSOR_PIPE_CSC_ENABLE; cntl |= CURSOR_PIPE_CSC_ENABLE;
if (plane_state->base.rotation == DRM_ROTATE_180) if (plane_state->base.rotation & DRM_ROTATE_180)
cntl |= CURSOR_ROTATE_180; cntl |= CURSOR_ROTATE_180;
} }
...@@ -10927,7 +10927,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc, ...@@ -10927,7 +10927,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
/* ILK+ do this automagically */ /* ILK+ do this automagically */
if (HAS_GMCH_DISPLAY(dev_priv) && if (HAS_GMCH_DISPLAY(dev_priv) &&
plane_state->base.rotation == DRM_ROTATE_180) { plane_state->base.rotation & DRM_ROTATE_180) {
base += (plane_state->base.crtc_h * base += (plane_state->base.crtc_h *
plane_state->base.crtc_w - 1) * 4; plane_state->base.crtc_w - 1) * 4;
} }
......
...@@ -436,7 +436,7 @@ vlv_update_plane(struct drm_plane *dplane, ...@@ -436,7 +436,7 @@ vlv_update_plane(struct drm_plane *dplane,
intel_add_fb_offsets(&x, &y, plane_state, 0); intel_add_fb_offsets(&x, &y, plane_state, 0);
sprsurf_offset = intel_compute_tile_offset(&x, &y, plane_state, 0); sprsurf_offset = intel_compute_tile_offset(&x, &y, plane_state, 0);
if (rotation == DRM_ROTATE_180) { if (rotation & DRM_ROTATE_180) {
sprctl |= SP_ROTATE_180; sprctl |= SP_ROTATE_180;
x += src_w; x += src_w;
...@@ -566,7 +566,7 @@ ivb_update_plane(struct drm_plane *plane, ...@@ -566,7 +566,7 @@ ivb_update_plane(struct drm_plane *plane,
intel_add_fb_offsets(&x, &y, plane_state, 0); intel_add_fb_offsets(&x, &y, plane_state, 0);
sprsurf_offset = intel_compute_tile_offset(&x, &y, plane_state, 0); sprsurf_offset = intel_compute_tile_offset(&x, &y, plane_state, 0);
if (rotation == DRM_ROTATE_180) { if (rotation & DRM_ROTATE_180) {
sprctl |= SPRITE_ROTATE_180; sprctl |= SPRITE_ROTATE_180;
/* HSW and BDW does this automagically in hardware */ /* HSW and BDW does this automagically in hardware */
...@@ -700,7 +700,7 @@ ilk_update_plane(struct drm_plane *plane, ...@@ -700,7 +700,7 @@ ilk_update_plane(struct drm_plane *plane,
intel_add_fb_offsets(&x, &y, plane_state, 0); intel_add_fb_offsets(&x, &y, plane_state, 0);
dvssurf_offset = intel_compute_tile_offset(&x, &y, plane_state, 0); dvssurf_offset = intel_compute_tile_offset(&x, &y, plane_state, 0);
if (rotation == DRM_ROTATE_180) { if (rotation & DRM_ROTATE_180) {
dvscntr |= DVS_ROTATE_180; dvscntr |= DVS_ROTATE_180;
x += src_w; x += src_w;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment