2019-12-10 05:08:16

by Bibby Hsieh

[permalink] [raw]
Subject: [PATCH v5 0/7] drm/mediatek: fix cursor issue and apply CMDQ in MTK DRM

The CMDQ (Command Queue) in MT8183 is used to help update all
relevant display controller registers with critical time limation.
This patch add cmdq interface in ddp_comp interface, let all
ddp_comp interface can support cpu/cmdq function at the same time.

These patches also can fixup cursor moving is not smooth
when heavy load in webgl.

This patch depends on ptach:
add drm support for MT8183
(https://patchwork.kernel.org/cover/11121519/)
support gce on mt8183 platform
(https://patchwork.kernel.org/cover/11255147/)
drm/mediatek: Check return value of mtk_drm_ddp_comp_for_plane
(https://lore.kernel.org/patchwork/patch/1154517/)

Changes since v4:
- rebase to Linux 5.5-rc1
- add fixes tag

Changes since v3:
- remove redundant code and variable

Changes since v2:
- move some changes to another patch
- disable layer in atomic_disable()

Changes since v1:
- remove redundant code
- merge the duplicate code
- use async instead of cursor

Changes since v0:
- remove redundant code
- remove patch
"drm/mediatek: fix atomic_state reference counting"
After remove this patch, the issue we met before is gone.
So I do not add any extra code to do something.

Bibby Hsieh (7):
drm/mediatek: use DRM core's atomic commit helper
drm/mediatek: handle events when enabling/disabling crtc
drm/mediatek: update cursors by using async atomic update
drm/mediatek: disable all the planes in atomic_disable
drm/mediatek: remove unused external function
drm/mediatek: support CMDQ interface in ddp component
drm/mediatek: apply CMDQ control flow

drivers/gpu/drm/mediatek/mtk_disp_color.c | 7 +-
drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 67 ++++----
drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 43 ++---
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 165 ++++++++++++++++----
drivers/gpu/drm/mediatek/mtk_drm_crtc.h | 2 +
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 131 ++++++++++++----
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 47 +++---
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 86 +---------
drivers/gpu/drm/mediatek/mtk_drm_drv.h | 7 -
drivers/gpu/drm/mediatek/mtk_drm_plane.c | 47 ++++++
drivers/gpu/drm/mediatek/mtk_drm_plane.h | 2 +
11 files changed, 380 insertions(+), 224 deletions(-)

--
2.18.0


2019-12-10 05:09:01

by Bibby Hsieh

[permalink] [raw]
Subject: [PATCH v5 5/7] drm/mediatek: remove unused external function

layer_on and layer_off both are unused external function,
remove them from mtk_ddp_comp_funcs structure.

Signed-off-by: Bibby Hsieh <[email protected]>
Reviewed-by: CK Hu <[email protected]>
---
drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 2 --
drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 16 ----------------
2 files changed, 18 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
index 722a5adb79dc..8a32248671c3 100644
--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
+++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
@@ -314,8 +314,6 @@ static const struct mtk_ddp_comp_funcs mtk_disp_ovl_funcs = {
.disable_vblank = mtk_ovl_disable_vblank,
.supported_rotations = mtk_ovl_supported_rotations,
.layer_nr = mtk_ovl_layer_nr,
- .layer_on = mtk_ovl_layer_on,
- .layer_off = mtk_ovl_layer_off,
.layer_check = mtk_ovl_layer_check,
.layer_config = mtk_ovl_layer_config,
.bgclr_in_on = mtk_ovl_bgclr_in_on,
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
index 19a955ab0748..dbfb90e9b9cf 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
+++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h
@@ -81,8 +81,6 @@ struct mtk_ddp_comp_funcs {
void (*unprepare)(struct mtk_ddp_comp *comp);
unsigned int (*supported_rotations)(struct mtk_ddp_comp *comp);
unsigned int (*layer_nr)(struct mtk_ddp_comp *comp);
- void (*layer_on)(struct mtk_ddp_comp *comp, unsigned int idx);
- void (*layer_off)(struct mtk_ddp_comp *comp, unsigned int idx);
int (*layer_check)(struct mtk_ddp_comp *comp,
unsigned int idx,
struct mtk_plane_state *state);
@@ -165,20 +163,6 @@ static inline unsigned int mtk_ddp_comp_layer_nr(struct mtk_ddp_comp *comp)
return 0;
}

-static inline void mtk_ddp_comp_layer_on(struct mtk_ddp_comp *comp,
- unsigned int idx)
-{
- if (comp->funcs && comp->funcs->layer_on)
- comp->funcs->layer_on(comp, idx);
-}
-
-static inline void mtk_ddp_comp_layer_off(struct mtk_ddp_comp *comp,
- unsigned int idx)
-{
- if (comp->funcs && comp->funcs->layer_off)
- comp->funcs->layer_off(comp, idx);
-}
-
static inline int mtk_ddp_comp_layer_check(struct mtk_ddp_comp *comp,
unsigned int idx,
struct mtk_plane_state *state)
--
2.18.0

2019-12-20 08:30:00

by CK Hu (胡俊光)

[permalink] [raw]
Subject: Re: [PATCH v5 0/7] drm/mediatek: fix cursor issue and apply CMDQ in MTK DRM

Hi, Bibby:

For this series, applied to mediatek-drm-next-5.6 [1], thanks.

[1]
https://github.com/ckhu-mediatek/linux.git-tags/commits/mediatek-drm-next-5.6

Regards,
CK

On Tue, 2019-12-10 at 13:05 +0800, Bibby Hsieh wrote:
> The CMDQ (Command Queue) in MT8183 is used to help update all
> relevant display controller registers with critical time limation.
> This patch add cmdq interface in ddp_comp interface, let all
> ddp_comp interface can support cpu/cmdq function at the same time.
>
> These patches also can fixup cursor moving is not smooth
> when heavy load in webgl.
>
> This patch depends on ptach:
> add drm support for MT8183
> (https://patchwork.kernel.org/cover/11121519/)
> support gce on mt8183 platform
> (https://patchwork.kernel.org/cover/11255147/)
> drm/mediatek: Check return value of mtk_drm_ddp_comp_for_plane
> (https://lore.kernel.org/patchwork/patch/1154517/)
>
> Changes since v4:
> - rebase to Linux 5.5-rc1
> - add fixes tag
>
> Changes since v3:
> - remove redundant code and variable
>
> Changes since v2:
> - move some changes to another patch
> - disable layer in atomic_disable()
>
> Changes since v1:
> - remove redundant code
> - merge the duplicate code
> - use async instead of cursor
>
> Changes since v0:
> - remove redundant code
> - remove patch
> "drm/mediatek: fix atomic_state reference counting"
> After remove this patch, the issue we met before is gone.
> So I do not add any extra code to do something.
>
> Bibby Hsieh (7):
> drm/mediatek: use DRM core's atomic commit helper
> drm/mediatek: handle events when enabling/disabling crtc
> drm/mediatek: update cursors by using async atomic update
> drm/mediatek: disable all the planes in atomic_disable
> drm/mediatek: remove unused external function
> drm/mediatek: support CMDQ interface in ddp component
> drm/mediatek: apply CMDQ control flow
>
> drivers/gpu/drm/mediatek/mtk_disp_color.c | 7 +-
> drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 67 ++++----
> drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 43 ++---
> drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 165 ++++++++++++++++----
> drivers/gpu/drm/mediatek/mtk_drm_crtc.h | 2 +
> drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 131 ++++++++++++----
> drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h | 47 +++---
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 86 +---------
> drivers/gpu/drm/mediatek/mtk_drm_drv.h | 7 -
> drivers/gpu/drm/mediatek/mtk_drm_plane.c | 47 ++++++
> drivers/gpu/drm/mediatek/mtk_drm_plane.h | 2 +
> 11 files changed, 380 insertions(+), 224 deletions(-)
>