drm/i915: Add horizontal mirroring support for CHV pipe B planes
The primary and sprite planes on CHV pipe B support horizontal mirroring. Expose it to the world. Sadly the hardware ignores the mirror bit when the rotate bit is set, so we'll have to reject the 180+X case. v2: Drop the BIT() v3: Pass dev_priv instead of dev to IS_CHERRYVIEW() Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1479142440-25283-4-git-send-email-ville.syrjala@linux.intel.com
This commit is contained in:
@@ -430,6 +430,9 @@ vlv_update_plane(struct drm_plane *dplane,
|
||||
if (rotation & DRM_ROTATE_180)
|
||||
sprctl |= SP_ROTATE_180;
|
||||
|
||||
if (rotation & DRM_REFLECT_X)
|
||||
sprctl |= SP_MIRROR;
|
||||
|
||||
/* Sizes are 0 based */
|
||||
src_w--;
|
||||
src_h--;
|
||||
@@ -442,6 +445,8 @@ vlv_update_plane(struct drm_plane *dplane,
|
||||
if (rotation & DRM_ROTATE_180) {
|
||||
x += src_w;
|
||||
y += src_h;
|
||||
} else if (rotation & DRM_REFLECT_X) {
|
||||
x += src_w;
|
||||
}
|
||||
|
||||
linear_offset = intel_fb_xy_to_linear(x, y, plane_state, 0);
|
||||
@@ -1121,6 +1126,10 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
|
||||
supported_rotations =
|
||||
DRM_ROTATE_0 | DRM_ROTATE_90 |
|
||||
DRM_ROTATE_180 | DRM_ROTATE_270;
|
||||
} else if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
|
||||
supported_rotations =
|
||||
DRM_ROTATE_0 | DRM_ROTATE_180 |
|
||||
DRM_REFLECT_X;
|
||||
} else {
|
||||
supported_rotations =
|
||||
DRM_ROTATE_0 | DRM_ROTATE_180;
|
||||
|
Reference in New Issue
Block a user