drm/i915/skl: Add 180 degree HW rotation support
Subsystems (2)
PATCH 1/1 drm/i915/skl: Add 180 degree HW rotation support
From: Sonika Jindal <[email protected]>
Add support for 180 degree rotation for primary and sprite planes
Signed-off-by Sonika Jindal <[email protected]>
--- drivers/gpu/drm/i915/i915_reg.h | 3 +++ drivers/gpu/drm/i915/intel_display.c | 2 ++ drivers/gpu/drm/i915/intel_sprite.c | 3 +++ 3 files changed, 8 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +3 -0
@@ -4579,6 +4579,9 @@ enum punit_power_well {#define PLANE_CTL_ALPHA_DISABLE ( 0 << 4)#define PLANE_CTL_ALPHA_SW_PREMULTIPLY ( 2 << 4)#define PLANE_CTL_ALPHA_HW_PREMULTIPLY ( 3 << 4) +#define PLANE_CTL_ROTATE_MASK 0x3 +#define PLANE_CTL_ROTATE_0 0x0 +#define PLANE_CTL_ROTATE_180 0x2#define _PLANE_STRIDE_1_A 0x70188#define _PLANE_STRIDE_2_A 0x70288#define _PLANE_STRIDE_3_A 0x70388
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -2697,6 +2697,8 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc, } plane_ctl |=PLANE_CTL_PLANE_GAMMA_DISABLE ; +if (to_intel_plane (crtc->primary)->rotation ==BIT (DRM_ROTATE_180 )) + plane_ctl |=PLANE_CTL_ROTATE_180 ;I915_WRITE (PLANE_CTL (pipe,0 ), plane_ctl);
drivers/gpu/drm/i915/intel_sprite.c +3 -0
@@ -162,6 +162,7 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc, plane_ctl &= ~PLANE_CTL_YUV422_ORDER_MASK ; plane_ctl &= ~PLANE_CTL_TILED_MASK ; plane_ctl &= ~PLANE_CTL_ALPHA_MASK ; + plane_ctl &= ~PLANE_CTL_ROTATE_MASK ;/* Trickle feed has to be enabled */ plane_ctl &= ~PLANE_CTL_TRICKLE_FEED_DISABLE ;
@@ -217,6 +218,8 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,default :BUG (); } +if (intel_plane->rotation ==BIT (DRM_ROTATE_180 )) + plane_ctl |=PLANE_CTL_ROTATE_180 ; plane_ctl |=PLANE_CTL_ENABLE ; plane_ctl |=PLANE_CTL_PIPE_CSC_ENABLE ;
Signature · 1 line
1.8.3.1
Quoted 5 lines · Damien Lespiau
From: Sonika Jindal <[email protected]>
Add support for 180 degree rotation for primary and sprite planes
Signed-off-by Sonika Jindal <[email protected]>
Reviewed-by Damien Lespiau <[email protected]>
Signature · 1 line
Damien
Quoted 61 lines
--- drivers/gpu/drm/i915/i915_reg.h | 3 +++ drivers/gpu/drm/i915/intel_display.c | 2 ++ drivers/gpu/drm/i915/intel_sprite.c | 3 +++ 3 files changed, 8 insertions(+)drivers/gpu/drm/i915/i915_reg.h +3
-0@@ -4579,6 +4579,9 @@ enum punit_power_well {#define PLANE_CTL_ALPHA_DISABLE ( 0 << 4)#define PLANE_CTL_ALPHA_SW_PREMULTIPLY ( 2 << 4)#define PLANE_CTL_ALPHA_HW_PREMULTIPLY ( 3 << 4) +#define PLANE_CTL_ROTATE_MASK 0x3 +#define PLANE_CTL_ROTATE_0 0x0 +#define PLANE_CTL_ROTATE_180 0x2#define _PLANE_STRIDE_1_A 0x70188#define _PLANE_STRIDE_2_A 0x70288#define _PLANE_STRIDE_3_A 0x70388drivers/gpu/drm/i915/intel_display.c +2
-0@@ -2697,6 +2697,8 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc, } plane_ctl |=PLANE_CTL_PLANE_GAMMA_DISABLE ; +if (to_intel_plane (crtc->primary)->rotation ==BIT (DRM_ROTATE_180 )) + plane_ctl |=PLANE_CTL_ROTATE_180 ;I915_WRITE (PLANE_CTL (pipe,0 ), plane_ctl);drivers/gpu/drm/i915/intel_sprite.c +3
-0@@ -162,6 +162,7 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc, plane_ctl &= ~PLANE_CTL_YUV422_ORDER_MASK ; plane_ctl &= ~PLANE_CTL_TILED_MASK ; plane_ctl &= ~PLANE_CTL_ALPHA_MASK ; + plane_ctl &= ~PLANE_CTL_ROTATE_MASK ;/* Trickle feed has to be enabled */ plane_ctl &= ~PLANE_CTL_TRICKLE_FEED_DISABLE ;@@ -217,6 +218,8 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,default :BUG (); } +if (intel_plane->rotation ==BIT (DRM_ROTATE_180 )) + plane_ctl |=PLANE_CTL_ROTATE_180 ; plane_ctl |=PLANE_CTL_ENABLE ; plane_ctl |=PLANE_CTL_PIPE_CSC_ENABLE ;Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx