From: Sean Paul <sean@poorly.run> Date: 2020-01-30 19:25:22
From: Sean Paul <redacted>
Currently the cursor is placed on the first overlay plane, which means
it will be at the bottom of the stack when the hw does the compositing
with anything other than primary plane. Since mtk doesn't support plane
zpos, change the cursor location to the top-most plane.
Signed-off-by: Sean Paul <redacted>
---
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
@@ -689,11 +689,12 @@ static int mtk_drm_crtc_num_comp_planes(struct mtk_drm_crtc *mtk_crtc,}staticinline-enumdrm_plane_typemtk_drm_crtc_plane_type(unsignedintplane_idx)+enumdrm_plane_typemtk_drm_crtc_plane_type(unsignedintplane_idx,+unsignedintnum_planes){if(plane_idx==0)returnDRM_PLANE_TYPE_PRIMARY;-elseif(plane_idx==1)+elseif(plane_idx==(num_planes-1))returnDRM_PLANE_TYPE_CURSOR;elsereturnDRM_PLANE_TYPE_OVERLAY;
@@ -712,7 +713,8 @@ static int mtk_drm_crtc_init_comp_planes(struct drm_device *drm_dev,ret=mtk_plane_init(drm_dev,&mtk_crtc->planes[mtk_crtc->layer_nr],BIT(pipe),-mtk_drm_crtc_plane_type(mtk_crtc->layer_nr),+mtk_drm_crtc_plane_type(mtk_crtc->layer_nr,+num_planes),mtk_ddp_comp_supported_rotations(comp));if(ret)returnret;
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Hi, Sean:
On Thu, 2020-01-30 at 14:24 -0500, Sean Paul wrote:
From: Sean Paul <redacted>
Currently the cursor is placed on the first overlay plane, which means
it will be at the bottom of the stack when the hw does the compositing
with anything other than primary plane. Since mtk doesn't support plane
zpos, change the cursor location to the top-most plane.
Reviewed-by: CK Hu <redacted>
quoted hunk
Signed-off-by: Sean Paul <redacted>
---
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
From: Sean Paul <redacted>
Currently the cursor is placed on the first overlay plane, which means
it will be at the bottom of the stack when the hw does the compositing
with anything other than primary plane. Since mtk doesn't support plane
zpos, change the cursor location to the top-most plane.
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Signed-off-by: Sean Paul <redacted>
---
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 29 +++++++++++++++++--------
1 file changed, 20 insertions(+), 9 deletions(-)
Apologies if I have formatted this wrong / sent to the wrong place!
The patch posted had an issue, another place in the driver was
assuming planes[1] still referred to the cursor.
Now search for the cursor before sending (as the plane cannot be
hard-coded, some devices have different numbers of planes).
Thanks
Evan Benn
On Thu, Feb 6, 2020 at 6:00 PM [off-list ref] wrote:
quoted hunk
From: Sean Paul <redacted>
Currently the cursor is placed on the first overlay plane, which means
it will be at the bottom of the stack when the hw does the compositing
with anything other than primary plane. Since mtk doesn't support plane
zpos, change the cursor location to the top-most plane.
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Signed-off-by: Sean Paul <redacted>
---
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 29 +++++++++++++++++--------
1 file changed, 20 insertions(+), 9 deletions(-)
Hi, Evan:
It looks like Sean's version has some problem. So this version is
Reviewed-by: CK Hu <redacted>
On Thu, 2020-02-06 at 17:59 +1100, evanbenn@google.com wrote:
quoted hunk
From: Sean Paul <redacted>
Currently the cursor is placed on the first overlay plane, which means
it will be at the bottom of the stack when the hw does the compositing
with anything other than primary plane. Since mtk doesn't support plane
zpos, change the cursor location to the top-most plane.
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Signed-off-by: Sean Paul <redacted>
---
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 29 +++++++++++++++++--------
1 file changed, 20 insertions(+), 9 deletions(-)
From: Sean Paul <sean@poorly.run> Date: 2020-02-06 14:01:55
On Thu, Feb 06, 2020 at 05:59:51PM +1100, evanbenn@google.com wrote:
From: Sean Paul <redacted>
Currently the cursor is placed on the first overlay plane, which means
it will be at the bottom of the stack when the hw does the compositing
with anything other than primary plane. Since mtk doesn't support plane
zpos, change the cursor location to the top-most plane.
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Hi Evan,
Thanks for spotting the issue! I think this should probably be 2 patches, one to
fix crtc init and then the cursor patch on top of that. We generally try to only
do one thing per patch.
A few other nits below..
quoted hunk
Signed-off-by: Sean Paul <redacted>
---
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 29 +++++++++++++++++--------
1 file changed, 20 insertions(+), 9 deletions(-)
Since we can only have one primary and one cursor, the NULL checks on primary
and cursor are unnecessary, you can just blindly assign them when you hit a
plane of the right type. If the driver creates multiples the behavior is
undefined anyways.
quoted hunk
+ }
ret = drm_crtc_init_with_planes(drm, &mtk_crtc->base, primary, cursor,
&mtk_crtc_funcs, NULL);
@@ -711,11 +722,12 @@ static int mtk_drm_crtc_num_comp_planes(struct mtk_drm_crtc *mtk_crtc, } static inline-enum drm_plane_type mtk_drm_crtc_plane_type(unsigned int plane_idx)+enum drm_plane_type mtk_drm_crtc_plane_type(unsigned int plane_idx,+ unsigned int num_planes) { if (plane_idx == 0) return DRM_PLANE_TYPE_PRIMARY;- else if (plane_idx == 1)+ else if (plane_idx == (num_planes - 1)) return DRM_PLANE_TYPE_CURSOR; else return DRM_PLANE_TYPE_OVERLAY;
@@ -734,7 +746,8 @@ static int mtk_drm_crtc_init_comp_planes(struct drm_device *drm_dev, ret = mtk_plane_init(drm_dev, &mtk_crtc->planes[mtk_crtc->layer_nr], BIT(pipe),- mtk_drm_crtc_plane_type(mtk_crtc->layer_nr),+ mtk_drm_crtc_plane_type(mtk_crtc->layer_nr,+ num_planes), mtk_ddp_comp_supported_rotations(comp)); if (ret) return ret;
@@ -830,9 +843,7 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev, return ret; }- ret = mtk_drm_crtc_init(drm_dev, mtk_crtc, &mtk_crtc->planes[0],- mtk_crtc->layer_nr > 1 ? &mtk_crtc->planes[1] :- NULL, pipe);+ ret = mtk_drm_crtc_init(drm_dev, mtk_crtc, pipe); if (ret < 0) return ret;
The cursor and primary planes were hard coded.
Now search for them for passing to drm_crtc_init_with_planes
Signed-off-by: Evan Benn <evanbenn@chromium.org>
---
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
Apologies for the confusing thread. Please apply the above patch:
'drm/mediatek: Find the cursor plane instead of hard coding it'
before Sean Paul's original patch:
'drm/mediatek: Ensure the cursor plane is on top of other overlays'
This way authorship is correctly preserved, but we do not introduce the bug.
Thanks
On Fri, Feb 7, 2020 at 3:23 PM Evan Benn [off-list ref] wrote:
quoted hunk
The cursor and primary planes were hard coded.
Now search for them for passing to drm_crtc_init_with_planes
Signed-off-by: Evan Benn <evanbenn@chromium.org>
---
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
From: Sean Paul <sean@poorly.run> Date: 2020-02-07 17:29:03
On Thu, Feb 6, 2020 at 11:24 PM Evan Benn [off-list ref] wrote:
The cursor and primary planes were hard coded.
Now search for them for passing to drm_crtc_init_with_planes
Signed-off-by: Evan Benn <evanbenn@chromium.org>
Hi, Sean:
On Fri, 2020-01-31 at 11:27 +0800, CK Hu wrote:
Hi, Sean:
On Thu, 2020-01-30 at 14:24 -0500, Sean Paul wrote:
quoted
From: Sean Paul <redacted>
Currently the cursor is placed on the first overlay plane, which means
it will be at the bottom of the stack when the hw does the compositing
with anything other than primary plane. Since mtk doesn't support plane
zpos, change the cursor location to the top-most plane.
From: Sean Paul <sean@poorly.run> Date: 2020-02-10 14:11:20
On Sun, Feb 9, 2020 at 9:53 PM CK Hu [off-list ref] wrote:
Hi, Evan:
On Fri, 2020-02-07 at 16:34 +0800, CK Hu wrote:
quoted
Hi, Evan:
On Fri, 2020-02-07 at 15:23 +1100, Evan Benn wrote:
quoted
The cursor and primary planes were hard coded.
Now search for them for passing to drm_crtc_init_with_planes
Reviewed-by: CK Hu <redacted>
Applied to mediatek-drm-fixes-5.6 [1], thanks.
Hi CK,
Thanks for picking this up. Before you send the pull, could you please
reverse the order of these 2 patches? Evan's should come before mine
to prevent a regression.
Sean
On Mon, 2020-02-10 at 09:10 -0500, Sean Paul wrote:
On Sun, Feb 9, 2020 at 9:53 PM CK Hu [off-list ref] wrote:
quoted
Hi, Evan:
On Fri, 2020-02-07 at 16:34 +0800, CK Hu wrote:
quoted
Hi, Evan:
On Fri, 2020-02-07 at 15:23 +1100, Evan Benn wrote:
quoted
The cursor and primary planes were hard coded.
Now search for them for passing to drm_crtc_init_with_planes
Reviewed-by: CK Hu <redacted>
Applied to mediatek-drm-fixes-5.6 [1], thanks.
Hi CK,
Thanks for picking this up. Before you send the pull, could you please
reverse the order of these 2 patches? Evan's should come before mine
to prevent a regression.
Sean
Hi, Sean:
Thanks for your notice. I've reversed the order.
Regards,
CK