Skip to contentSkip to conversation

drm/mediatek: add plane check in async_check function

PATCH Applied Bibby Hsieh 3 participants 7 messages Feb 13, 2020 – Feb 18, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/mediatek: add plane check in async_check function

MTK do rotation checking and transferring in layer check function, but we do not check that in atomic_check,
so add back in atomic_check function.

Fixes 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/mediatek/mtk_drm_plane.c +6 -0
index 189744d34f53..d32b494ff1de 100644
@@ -81,6 +81,7 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane,
 					struct drm_plane_state *state)
 {
 	struct drm_crtc_state *crtc_state;
+	int ret;
 
 	if (plane != state->crtc->cursor)
 		return -EINVAL;
@@ -91,6 +92,11 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane,
 	if (!plane->state->fb)
 		return -EINVAL;
 
+	ret = mtk_drm_crtc_plane_check(state->crtc, plane,
+				       to_mtk_plane_state(state));
+	if (ret)
+		return ret;
+
 	if (state->state)
 		crtc_state = drm_atomic_get_existing_crtc_state(state->state,
 								state->crtc);
Signature · 1 line
2.18.0
#1 lore raw

PATCH 2/2 drm/mediatek: add fb swap in async_update

Besides x, y position, width and height,
fb also need updating in async update.

Fixes 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/mediatek/mtk_drm_plane.c +1 -0
index d32b494ff1de..e084c36fdd8a 100644
@@ -122,6 +122,7 @@ static void mtk_plane_atomic_async_update(struct drm_plane *plane,
 	plane->state->src_y = new_state->src_y;
 	plane->state->src_h = new_state->src_h;
 	plane->state->src_w = new_state->src_w;
+	swap(plane->state->fb, new_state->fb);
 	state->pending.async_dirty = true;
 
 	mtk_drm_crtc_async_update(new_state->crtc, plane, new_state);
Signature · 1 line
2.18.0
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/mediatek: add fb swap in async_update

Hi, Bibby:

Quoted 3 lines · Bibby Hsieh

Besides x, y position, width and height,
fb also need updating in async update.

Quoted 19 lines
Fixes 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/mediatek/mtk_drm_plane.c +1 -0
index d32b494ff1de..e084c36fdd8a 100644
@@ -122,6 +122,7 @@ static void mtk_plane_atomic_async_update(struct drm_plane *plane,
 	plane->state->src_y = new_state->src_y;
 	plane->state->src_h = new_state->src_h;
 	plane->state->src_w = new_state->src_w;
+	swap(plane->state->fb, new_state->fb);
 	state->pending.async_dirty = true;
 
 	mtk_drm_crtc_async_update(new_state->crtc, plane, new_state);
Signature · 1 line
CK Hu <[email protected]>
Tested-by Enric Balletbo i Serra
#3 lore raw

Re: [PATCH 2/2] drm/mediatek: add fb swap in async_update

Hi,

Missatge de CK Hu <[email protected]> del dia dj., 13 de febr. 2020 a les 5:06:

Quoted 14 lines

Hi, Bibby:

Quoted 3 lines · Bibby Hsieh

Besides x, y position, width and height,
fb also need updating in async update.

Quoted 4 lines
Fixes 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")

---

This patch actually fixes two issues as explained in [1], I send the patch without seeing that another one was already sent. Both do the same thing. So,

[1] https://lkml.org/lkml/2020/2/13/286

Quoted 22 lines
Quoted 8 lines
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/mediatek/mtk_drm_plane.c +0 -0
index d32b494ff1de..e084c36fdd8a 100644

drivers/gpu/drm/mediatek/mtk_drm_plane.c static void mtk_plane_atomic_async_update(struct drm_plane *plane, · line 128

Quoted 7 lines
drivers/gpu/drm/mediatek/mtk_drm_plane.c +1 -0
@@ -122,6 +122,7 @@ static void mtk_plane_atomic_async_update(struct drm_plane *plane,
      plane->state->src_y = new_state->src_y;
      plane->state->src_h = new_state->src_h;
      plane->state->src_w = new_state->src_w;
+     swap(plane->state->fb, new_state->fb);
      state->pending.async_dirty = true;
 
      mtk_drm_crtc_async_update(new_state->crtc, plane, new_state);

--
CK Hu <[email protected]>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Applied
#4 lore raw

Re: [PATCH 2/2] drm/mediatek: add fb swap in async_update

In reply to CK Hu

Hi, Bibby:

Quoted 9 lines · CK Hu

Hi, Bibby:

Quoted 3 lines · Bibby Hsieh

Besides x, y position, width and height,
fb also need updating in async update.

Applied to mediatek-drm-fixes-5.6 [1], thanks.

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

Regards,
CK

Quoted 18 lines
Quoted 18 lines
Fixes 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/mediatek/mtk_drm_plane.c +1 -0
index d32b494ff1de..e084c36fdd8a 100644
@@ -122,6 +122,7 @@ static void mtk_plane_atomic_async_update(struct drm_plane *plane,
 	plane->state->src_y = new_state->src_y;
 	plane->state->src_h = new_state->src_h;
 	plane->state->src_w = new_state->src_w;
+	swap(plane->state->fb, new_state->fb);
 	state->pending.async_dirty = true;
 
Quoted 2 lines

drivers/gpu/drm/mediatek/mtk_drm_plane.c static void mtk_plane_atomic_async_update(struct drm_plane *plane, · line 128

Quoted 1 line
drivers/gpu/drm/mediatek/mtk_drm_plane.c +0 -0
 	mtk_drm_crtc_async_update(new_state->crtc, plane, new_state);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by on v1 1/2
#5 lore raw
In reply to Bibby Hsieh

Hi, Bibby:

Quoted 4 lines · Bibby Hsieh

MTK do rotation checking and transferring in layer check function, but we do not check that in atomic_check,
so add back in atomic_check function.

Quoted 21 lines
Fixes 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/mediatek/mtk_drm_plane.c +1 -0
index 189744d34f53..d32b494ff1de 100644
@@ -81,6 +81,7 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane,
 					struct drm_plane_state *state)
 {
 	struct drm_crtc_state *crtc_state;
+	int ret;
 
 	if (plane != state->crtc->cursor)
 		return -EINVAL;
@@ -91,6 +92,11 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane,
 	if (!plane->state->fb)

drivers/gpu/drm/mediatek/mtk_drm_plane.c static int mtk_plane_atomic_async_check(struct drm_plane *plane, · line 102

Quoted 10 lines
drivers/gpu/drm/mediatek/mtk_drm_plane.c +5 -0
 		return -EINVAL;
 
+	ret = mtk_drm_crtc_plane_check(state->crtc, plane,
+				       to_mtk_plane_state(state));
+	if (ret)
+		return ret;
+
 	if (state->state)
 		crtc_state = drm_atomic_get_existing_crtc_state(state->state,
 								state->crtc);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Applied
#6 lore raw

Hi, Bibby:

Quoted 10 lines · CK Hu

Hi, Bibby:

Quoted 4 lines · Bibby Hsieh

MTK do rotation checking and transferring in layer check function, but we do not check that in atomic_check,
so add back in atomic_check function.

Applied to mediatek-drm-fixes-5.6 [1], thanks.

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

Regards,
CK

Quoted 23 lines
Quoted 23 lines
Fixes 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/mediatek/mtk_drm_plane.c +1 -0
index 189744d34f53..d32b494ff1de 100644
@@ -81,6 +81,7 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane,
 					struct drm_plane_state *state)
 {
 	struct drm_crtc_state *crtc_state;
+	int ret;
 
 	if (plane != state->crtc->cursor)
 		return -EINVAL;
@@ -91,6 +92,11 @@ static int mtk_plane_atomic_async_check(struct drm_plane *plane,
 	if (!plane->state->fb)
 		return -EINVAL;
 
Quoted 9 lines

drivers/gpu/drm/mediatek/mtk_drm_plane.c static int mtk_plane_atomic_async_check(struct drm_plane *plane, · line 102

Quoted 8 lines
drivers/gpu/drm/mediatek/mtk_drm_plane.c +5 -0
+	ret = mtk_drm_crtc_plane_check(state->crtc, plane,
+				       to_mtk_plane_state(state));
+	if (ret)
+		return ret;
+
 	if (state->state)
 		crtc_state = drm_atomic_get_existing_crtc_state(state->state,
 								state->crtc);

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel