mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-17 03:58:36 +00:00
drm/mediatek: Support reflect-x plane rotation
Add support for REFLECT_X rotations. Cc: Fritz Koenig <frkoenig@chromium.org> Cc: Daniele Castagna <dcastagna@chromium.org> Cc: Miguel Casas <mcasas@chromium.org> Cc: Mark Yacoub <markyacoub@google.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: CK Hu <ck.hu@mediatek.com>
This commit is contained in:
parent
84d8057539
commit
b368d3ecab
1 changed files with 9 additions and 1 deletions
|
@ -53,6 +53,7 @@
|
||||||
#define OVL_CON_AEN BIT(8)
|
#define OVL_CON_AEN BIT(8)
|
||||||
#define OVL_CON_ALPHA 0xff
|
#define OVL_CON_ALPHA 0xff
|
||||||
#define OVL_CON_VIRT_FLIP BIT(9)
|
#define OVL_CON_VIRT_FLIP BIT(9)
|
||||||
|
#define OVL_CON_HORZ_FLIP BIT(10)
|
||||||
|
|
||||||
struct mtk_disp_ovl_data {
|
struct mtk_disp_ovl_data {
|
||||||
unsigned int addr;
|
unsigned int addr;
|
||||||
|
@ -142,7 +143,8 @@ static unsigned int mtk_ovl_layer_nr(struct mtk_ddp_comp *comp)
|
||||||
|
|
||||||
static unsigned int mtk_ovl_supported_rotations(struct mtk_ddp_comp *comp)
|
static unsigned int mtk_ovl_supported_rotations(struct mtk_ddp_comp *comp)
|
||||||
{
|
{
|
||||||
return DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_Y;
|
return DRM_MODE_ROTATE_0 | DRM_MODE_REFLECT_Y |
|
||||||
|
DRM_MODE_REFLECT_X;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mtk_ovl_layer_check(struct mtk_ddp_comp *comp, unsigned int idx,
|
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,
|
||||||
|
|
||||||
rotation = drm_rotation_simplify(state->rotation,
|
rotation = drm_rotation_simplify(state->rotation,
|
||||||
DRM_MODE_ROTATE_0 |
|
DRM_MODE_ROTATE_0 |
|
||||||
|
DRM_MODE_REFLECT_X |
|
||||||
DRM_MODE_REFLECT_Y);
|
DRM_MODE_REFLECT_Y);
|
||||||
rotation &= ~DRM_MODE_ROTATE_0;
|
rotation &= ~DRM_MODE_ROTATE_0;
|
||||||
|
|
||||||
|
@ -269,6 +272,11 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx,
|
||||||
addr += (pending->height - 1) * pending->pitch;
|
addr += (pending->height - 1) * pending->pitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pending->rotation & DRM_MODE_REFLECT_X) {
|
||||||
|
con |= OVL_CON_HORZ_FLIP;
|
||||||
|
addr += pending->pitch - 1;
|
||||||
|
}
|
||||||
|
|
||||||
writel_relaxed(con, comp->regs + DISP_REG_OVL_CON(idx));
|
writel_relaxed(con, comp->regs + DISP_REG_OVL_CON(idx));
|
||||||
writel_relaxed(pitch, comp->regs + DISP_REG_OVL_PITCH(idx));
|
writel_relaxed(pitch, comp->regs + DISP_REG_OVL_PITCH(idx));
|
||||||
writel_relaxed(src_size, comp->regs + DISP_REG_OVL_SRC_SIZE(idx));
|
writel_relaxed(src_size, comp->regs + DISP_REG_OVL_SRC_SIZE(idx));
|
||||||
|
|
Loading…
Add table
Reference in a new issue