Linux-mediatek Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/2] drm/mediatek: add plane check in async_check function
@ 2020-02-13  1:23 Bibby Hsieh
  2020-02-13  1:23 ` [PATCH 2/2] drm/mediatek: add fb swap in async_update Bibby Hsieh
  2020-02-13  3:54 ` [PATCH 1/2] drm/mediatek: add plane check in async_check function CK Hu
  0 siblings, 2 replies; 7+ messages in thread
From: Bibby Hsieh @ 2020-02-13  1:23 UTC (permalink / raw)
  To: David Airlie, Matthias Brugger, Daniel Vetter, dri-devel, linux-mediatek
  Cc: drinkcat, Bibby Hsieh, srv_heupstream, linux-kernel, tfiga,
	CK Hu, Thierry Reding, Philipp Zabel, linux-arm-kernel

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")

Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
index 189744d34f53..d32b494ff1de 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
@@ -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);
-- 
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] drm/mediatek: add fb swap in async_update
  2020-02-13  1:23 [PATCH 1/2] drm/mediatek: add plane check in async_check function Bibby Hsieh
@ 2020-02-13  1:23 ` Bibby Hsieh
  2020-02-13  4:06   ` CK Hu
  2020-02-13  3:54 ` [PATCH 1/2] drm/mediatek: add plane check in async_check function CK Hu
  1 sibling, 1 reply; 7+ messages in thread
From: Bibby Hsieh @ 2020-02-13  1:23 UTC (permalink / raw)
  To: David Airlie, Matthias Brugger, Daniel Vetter, dri-devel, linux-mediatek
  Cc: drinkcat, Bibby Hsieh, srv_heupstream, linux-kernel, tfiga,
	CK Hu, Thierry Reding, Philipp Zabel, linux-arm-kernel

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")

Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
index d32b494ff1de..e084c36fdd8a 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
@@ -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);
-- 
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] drm/mediatek: add plane check in async_check function
  2020-02-13  1:23 [PATCH 1/2] drm/mediatek: add plane check in async_check function Bibby Hsieh
  2020-02-13  1:23 ` [PATCH 2/2] drm/mediatek: add fb swap in async_update Bibby Hsieh
@ 2020-02-13  3:54 ` CK Hu
  2020-02-18  7:45   ` CK Hu
  1 sibling, 1 reply; 7+ messages in thread
From: CK Hu @ 2020-02-13  3:54 UTC (permalink / raw)
  To: Bibby Hsieh
  Cc: drinkcat, srv_heupstream, David Airlie, Daniel Vetter,
	linux-kernel, dri-devel, tfiga, Thierry Reding, linux-mediatek,
	Philipp Zabel, Matthias Brugger, linux-arm-kernel

Hi, Bibby:

On Thu, 2020-02-13 at 09:23 +0800, Bibby Hsieh wrote:
> 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.
> 

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> Fixes: 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
> 
> Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> index 189744d34f53..d32b494ff1de 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> @@ -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);

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] drm/mediatek: add fb swap in async_update
  2020-02-13  1:23 ` [PATCH 2/2] drm/mediatek: add fb swap in async_update Bibby Hsieh
@ 2020-02-13  4:06   ` CK Hu
  2020-02-13 14:00     ` Enric Balletbo Serra
  2020-02-18  7:46     ` CK Hu
  0 siblings, 2 replies; 7+ messages in thread
From: CK Hu @ 2020-02-13  4:06 UTC (permalink / raw)
  To: Bibby Hsieh
  Cc: drinkcat, srv_heupstream, David Airlie, Daniel Vetter,
	linux-kernel, dri-devel, tfiga, Thierry Reding, linux-mediatek,
	Philipp Zabel, Matthias Brugger, linux-arm-kernel

Hi, Bibby:

On Thu, 2020-02-13 at 09:23 +0800, Bibby Hsieh wrote:
> Besides x, y position, width and height,
> fb also need updating in async update.
> 

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> Fixes: 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
> 
> Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> index d32b494ff1de..e084c36fdd8a 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> @@ -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 <ck.hu@mediatek.com>
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] drm/mediatek: add fb swap in async_update
  2020-02-13  4:06   ` CK Hu
@ 2020-02-13 14:00     ` Enric Balletbo Serra
  2020-02-18  7:46     ` CK Hu
  1 sibling, 0 replies; 7+ messages in thread
From: Enric Balletbo Serra @ 2020-02-13 14:00 UTC (permalink / raw)
  To: CK Hu
  Cc: Nicolas Boichat, srv_heupstream, David Airlie, Daniel Vetter,
	linux-kernel, dri-devel, Tomasz Figa, Thierry Reding,
	moderated list:ARM/Mediatek SoC support, Bibby Hsieh,
	Matthias Brugger, Linux ARM

Hi,

Missatge de CK Hu <ck.hu@mediatek.com> del dia dj., 13 de febr. 2020 a les 5:06:
>
> Hi, Bibby:
>
> On Thu, 2020-02-13 at 09:23 +0800, Bibby Hsieh wrote:
> > Besides x, y position, width and height,
> > fb also need updating in async update.
> >
>
> Reviewed-by: CK Hu <ck.hu@mediatek.com>
>
> > Fixes: 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
> >
> > Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
> > ---

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,

Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

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

> >  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > index d32b494ff1de..e084c36fdd8a 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > @@ -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 <ck.hu@mediatek.com>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] drm/mediatek: add plane check in async_check function
  2020-02-13  3:54 ` [PATCH 1/2] drm/mediatek: add plane check in async_check function CK Hu
@ 2020-02-18  7:45   ` CK Hu
  0 siblings, 0 replies; 7+ messages in thread
From: CK Hu @ 2020-02-18  7:45 UTC (permalink / raw)
  To: Bibby Hsieh
  Cc: drinkcat, srv_heupstream, David Airlie, Daniel Vetter,
	linux-kernel, dri-devel, tfiga, Thierry Reding, linux-mediatek,
	Philipp Zabel, Matthias Brugger, linux-arm-kernel

Hi, Bibby:

On Thu, 2020-02-13 at 11:54 +0800, CK Hu wrote:
> Hi, Bibby:
> 
> On Thu, 2020-02-13 at 09:23 +0800, Bibby Hsieh wrote:
> > 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.
> > 
> 
> Reviewed-by: CK Hu <ck.hu@mediatek.com>
> 

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

> > Fixes: 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
> > 
> > Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
> > ---
> >  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > index 189744d34f53..d32b494ff1de 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > @@ -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);
> 

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] drm/mediatek: add fb swap in async_update
  2020-02-13  4:06   ` CK Hu
  2020-02-13 14:00     ` Enric Balletbo Serra
@ 2020-02-18  7:46     ` CK Hu
  1 sibling, 0 replies; 7+ messages in thread
From: CK Hu @ 2020-02-18  7:46 UTC (permalink / raw)
  To: Bibby Hsieh
  Cc: drinkcat, srv_heupstream, David Airlie, Daniel Vetter,
	linux-kernel, dri-devel, tfiga, Thierry Reding, linux-mediatek,
	Philipp Zabel, Matthias Brugger, linux-arm-kernel

Hi, Bibby:

On Thu, 2020-02-13 at 12:06 +0800, CK Hu wrote:
> Hi, Bibby:
> 
> On Thu, 2020-02-13 at 09:23 +0800, Bibby Hsieh wrote:
> > Besides x, y position, width and height,
> > fb also need updating in async update.
> > 
> 
> Reviewed-by: CK Hu <ck.hu@mediatek.com>
> 

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

> > Fixes: 920fffcc8912 ("drm/mediatek: update cursors by using async atomic update")
> > 
> > Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com>
> > ---
> >  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > index d32b494ff1de..e084c36fdd8a 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > @@ -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);
> 

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13  1:23 [PATCH 1/2] drm/mediatek: add plane check in async_check function Bibby Hsieh
2020-02-13  1:23 ` [PATCH 2/2] drm/mediatek: add fb swap in async_update Bibby Hsieh
2020-02-13  4:06   ` CK Hu
2020-02-13 14:00     ` Enric Balletbo Serra
2020-02-18  7:46     ` CK Hu
2020-02-13  3:54 ` [PATCH 1/2] drm/mediatek: add plane check in async_check function CK Hu
2020-02-18  7:45   ` CK Hu

Linux-mediatek Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mediatek/0 linux-mediatek/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mediatek linux-mediatek/ https://lore.kernel.org/linux-mediatek \
		linux-mediatek@lists.infradead.org
	public-inbox-index linux-mediatek

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-mediatek


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git