53
53
#define OVL_CON_AEN BIT(8)
54
54
#define OVL_CON_ALPHA 0xff
55
55
#define OVL_CON_VIRT_FLIP BIT(9)
56
+ #define OVL_CON_HORZ_FLIP BIT(10)
56
57
57
58
struct mtk_disp_ovl_data {
58
59
unsigned int addr ;
@@ -142,7 +143,8 @@ static unsigned int mtk_ovl_layer_nr(struct mtk_ddp_comp *comp)
142
143
143
144
static unsigned int mtk_ovl_supported_rotations (struct mtk_ddp_comp * comp )
144
145
{
145
- return DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_Y ;
146
+ return DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_Y |
147
+ DRM_MODE_REFLECT_X ;
146
148
}
147
149
148
150
static int mtk_ovl_layer_check (struct mtk_ddp_comp * comp , unsigned int idx ,
@@ -153,6 +155,7 @@ static int mtk_ovl_layer_check(struct mtk_ddp_comp *comp, unsigned int idx,
153
155
154
156
rotation = drm_rotation_simplify (state -> rotation ,
155
157
DRM_MODE_ROTATE_0 |
158
+ DRM_MODE_REFLECT_X |
156
159
DRM_MODE_REFLECT_Y );
157
160
rotation &= ~DRM_MODE_ROTATE_0 ;
158
161
@@ -269,6 +272,11 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
269
272
addr += (pending -> height - 1 ) * pending -> pitch ;
270
273
}
271
274
275
+ if (pending -> rotation & DRM_MODE_REFLECT_X ) {
276
+ con |= OVL_CON_HORZ_FLIP ;
277
+ addr += pending -> pitch - 1 ;
278
+ }
279
+
272
280
writel_relaxed (con , comp -> regs + DISP_REG_OVL_CON (idx ));
273
281
writel_relaxed (pitch , comp -> regs + DISP_REG_OVL_PITCH (idx ));
274
282
writel_relaxed (src_size , comp -> regs + DISP_REG_OVL_SRC_SIZE (idx ));
0 commit comments