mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "Shawn Sung (宋孝謙)" <Shawn.Sung@mediatek.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
	"angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>
Cc: "linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Bibby Hsieh (謝濟遠)" <Bibby.Hsieh@mediatek.com>,
	"jason-ch.chen@mediatek.corp-partner.google.com"
	<jason-ch.chen@mediatek.corp-partner.google.com>,
	"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
	"daniel@ffwll.ch" <daniel@ffwll.ch>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"sean@poorly.run" <sean@poorly.run>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"fshao@chromium.org" <fshao@chromium.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v6 04/14] drm/mediatek: Add DRM_MODE_ROTATE_0 to rotation property
Date: Mon, 25 Mar 2024 01:52:27 +0000	[thread overview]
Message-ID: <fd3beacfc59f466ab5e51276a3479c0501350a39.camel@mediatek.com> (raw)
In-Reply-To: <a5b00d343b922e726476e4b3c1973d44a05aacb3.camel@mediatek.com>

Hi, Shawn:

On Fri, 2024-03-22 at 17:02 +0800, CK Hu wrote:
> Hi, Shawn:
> 
> On Fri, 2024-03-22 at 13:28 +0800, Shawn Sung wrote:
> > From: Hsiao Chien Sung <shawn.sung@mediatek.com>
> > 
> > Always add DRM_MODE_ROTATE_0 to rotation property to meet
> > IGT's (Intel GPU Tools) requirement.
> 
> Reviewed-by: CK Hu <ck.hu@mediatek.com>
> 
> > 
> > Reviewed-by: AngeloGioacchino Del Regno <
> > angelogioacchino.delregno@collabora.com>
> > Signed-off-by: Hsiao Chien Sung <shawn.sung@mediatek.com>
> > ---
> >  drivers/gpu/drm/mediatek/mtk_ddp_comp.h |  6 +++++-
> >  drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 21 +++++++++------------
> >  drivers/gpu/drm/mediatek/mtk_plane.c    |  2 +-
> >  3 files changed, 15 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/mediatek/mtk_ddp_comp.h
> > b/drivers/gpu/drm/mediatek/mtk_ddp_comp.h
> > index 26236691ce4c2..f7fe2e08dc8e2 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_ddp_comp.h
> > +++ b/drivers/gpu/drm/mediatek/mtk_ddp_comp.h
> > @@ -192,7 +192,11 @@ unsigned int
> > mtk_ddp_comp_supported_rotations(struct mtk_ddp_comp *comp)
> >  	if (comp->funcs && comp->funcs->supported_rotations)
> >  		return comp->funcs->supported_rotations(comp->dev);
> >  
> > -	return 0;
> > +	/*
> > +	 * In order to pass IGT tests, DRM_MODE_ROTATE_0 is required
> > when
> > +	 * rotation is not supported.
> > +	 */
> > +	return DRM_MODE_ROTATE_0;
> >  }
> >  
> >  static inline unsigned int mtk_ddp_comp_layer_nr(struct
> > mtk_ddp_comp
> > *comp)
> > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> > b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> > index 0ebeaf9830d83..2a767a823c83a 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c
> > @@ -288,6 +288,10 @@ unsigned int mtk_ovl_layer_nr(struct device
> > *dev)
> >  
> >  unsigned int mtk_ovl_supported_rotations(struct device *dev)
> >  {
> > +	/*
> > +	 * although currently OVL can only do reflection,
> > +	 * reflect x + reflect y = rotate 180
> > +	 */

Sorry, this comment is not related to DRM_MODE_ROTATE_0, so after
removing this comment,

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

> >  	return DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180 |
> >  	       DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y;
> >  }
> > @@ -296,27 +300,20 @@ int mtk_ovl_layer_check(struct device *dev,
> > unsigned int idx,
> >  			struct mtk_plane_state *mtk_state)
> >  {
> >  	struct drm_plane_state *state = &mtk_state->base;
> > -	unsigned int rotation = 0;
> >  
> > -	rotation = drm_rotation_simplify(state->rotation,
> > -					 DRM_MODE_ROTATE_0 |
> > -					 DRM_MODE_REFLECT_X |
> > -					 DRM_MODE_REFLECT_Y);
> > -	rotation &= ~DRM_MODE_ROTATE_0;
> > -
> > -	/* We can only do reflection, not rotation */
> > -	if ((rotation & DRM_MODE_ROTATE_MASK) != 0)
> > +	/* check if any unsupported rotation is set */
> > +	if (state->rotation & ~mtk_ovl_supported_rotations(dev))
> >  		return -EINVAL;
> >  
> >  	/*
> >  	 * TODO: Rotating/reflecting YUV buffers is not supported at
> > this time.
> >  	 *	 Only RGB[AX] variants are supported.
> > +	 *	 Since DRM_MODE_ROTATE_0 means "no rotation", we
> > should not
> > +	 *	 reject layers with this property.
> >  	 */
> > -	if (state->fb->format->is_yuv && rotation != 0)
> > +	if (state->fb->format->is_yuv && (state->rotation &
> > ~DRM_MODE_ROTATE_0))
> >  		return -EINVAL;
> >  
> > -	state->rotation = rotation;
> > -
> >  	return 0;
> >  }
> >  
> > diff --git a/drivers/gpu/drm/mediatek/mtk_plane.c
> > b/drivers/gpu/drm/mediatek/mtk_plane.c
> > index a74b26d359857..1723d4333f371 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_plane.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_plane.c
> > @@ -338,7 +338,7 @@ int mtk_plane_init(struct drm_device *dev,
> > struct
> > drm_plane *plane,
> >  		return err;
> >  	}
> >  
> > -	if (supported_rotations & ~DRM_MODE_ROTATE_0) {
> > +	if (supported_rotations) {
> >  		err = drm_plane_create_rotation_property(plane,
> >  							 DRM_MODE_ROTAT
> > E_0,
> >  							 supported_rota
> > tions);

  reply	other threads:[~2024-03-25  1:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22  5:28 [PATCH v6 00/14] Support IGT in display driver Shawn Sung
2024-03-22  5:28 ` [PATCH v6 01/14] soc: mediatek: Disable 9-bit alpha in ETHDR Shawn Sung
2024-03-22  5:28 ` [PATCH v6 02/14] drm/mediatek: Add OVL compatible name for MT8195 Shawn Sung
2024-03-22  5:28 ` [PATCH v6 03/14] drm/mediatek: Add missing plane settings when async update Shawn Sung
2024-03-22  5:28 ` [PATCH v6 04/14] drm/mediatek: Add DRM_MODE_ROTATE_0 to rotation property Shawn Sung
2024-03-22  9:02   ` CK Hu (胡俊光)
2024-03-25  1:52     ` CK Hu (胡俊光) [this message]
2024-03-28  2:50       ` Shawn Sung (宋孝謙)
2024-03-22  5:28 ` [PATCH v6 05/14] drm/mediatek: Set DRM mode configs accordingly Shawn Sung
2024-04-25  6:54   ` CK Hu (胡俊光)
2024-03-22  5:28 ` [PATCH v6 06/14] drm/mediatek: Turn off the layers with zero width or height Shawn Sung
2024-03-22  5:28 ` [PATCH v6 07/14] drm/mediatek: Support alpha blending in display driver Shawn Sung
2024-03-22  9:37   ` CK Hu (胡俊光)
2024-03-28  2:52     ` Shawn Sung (宋孝謙)
2024-03-22  5:28 ` [PATCH v6 08/14] drm/mediatek: Support "Pre-multiplied" alpha blending in OVL Shawn Sung
2024-03-22  6:43   ` CK Hu (胡俊光)
2024-03-22  5:28 ` [PATCH v6 09/14] drm/mediatek: Support "Pre-multiplied" alpha blending in Mixer Shawn Sung
2024-03-22  9:26   ` CK Hu (胡俊光)
2024-03-22  5:28 ` [PATCH v6 10/14] drm/mediatek: Support "None" alpha blending in OVL Shawn Sung
2024-03-22  9:32   ` CK Hu (胡俊光)
2024-03-22  5:28 ` [PATCH v6 11/14] drm/mediatek: Support "None" alpha blending in Mixer Shawn Sung
2024-03-25  2:03   ` CK Hu (胡俊光)
2024-03-28  2:56     ` Shawn Sung (宋孝謙)
2024-03-22  5:28 ` [PATCH v6 12/14] drm/mediatek: Support CRC in display driver Shawn Sung
2024-04-01  5:31   ` CK Hu (胡俊光)
2024-03-22  5:28 ` [PATCH v6 13/14] drm/mediatek: Support CRC in OVL Shawn Sung
2024-03-26  6:11   ` CK Hu (胡俊光)
2024-03-28  3:22     ` Shawn Sung (宋孝謙)
2024-03-28  5:21       ` CK Hu (胡俊光)
2024-03-22  5:28 ` [PATCH v6 14/14] drm/mediatek: Support CRC in OVL adaptor Shawn Sung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd3beacfc59f466ab5e51276a3479c0501350a39.camel@mediatek.com \
    --to=ck.hu@mediatek.com \
    --cc=Bibby.Hsieh@mediatek.com \
    --cc=Nancy.Lin@mediatek.com \
    --cc=Shawn.Sung@mediatek.com \
    --cc=airlied@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fshao@chromium.org \
    --cc=jason-ch.chen@mediatek.corp-partner.google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=sean@poorly.run \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®