Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Murthy, Arun R" <arun.r.murthy@intel.com>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v3 4/5] drm/i915/display: Populate list of async supported formats/modifiers
Date: Tue, 21 Jan 2025 15:40:23 +0200	[thread overview]
Message-ID: <Z4-jxyzDQfE3hzxY@intel.com> (raw)
In-Reply-To: <IA0PR11MB7307C0119A52004DC634EC00BAE62@IA0PR11MB7307.namprd11.prod.outlook.com>

On Tue, Jan 21, 2025 at 03:34:20AM +0000, Murthy, Arun R wrote:
> > On Wed, Jan 08, 2025 at 11:09:02AM +0530, Arun R Murthy wrote:
> > > Populate the list of formats/modifiers supported by async flip.
> > > Register a async property and expose the same to user through blob.
> > >
> > > Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/skl_universal_plane.c | 51
> > > ++++++++++++++++++++++
> > >  1 file changed, 51 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > > b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > > index
> > >
> > ff9764cac1e71959e56283f61b5192ea261cec7a..e5e47f2219dae62e76cbde2e
> > fb40
> > > 266b047ab2b2 100644
> > > --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > > +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > > @@ -170,6 +170,44 @@ static const u32 icl_hdr_plane_formats[] = {
> > >  	DRM_FORMAT_XVYU16161616,
> > >  };
> > >
> > > +static u64 tgl_asyn_modifiers[] = {
> > > +	DRM_FORMAT_MOD_LINEAR,
> > > +	I915_FORMAT_MOD_X_TILED,
> > > +	I915_FORMAT_MOD_Y_TILED,
> > > +	I915_FORMAT_MOD_4_TILED,
> > > +	I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS,
> > > +	I915_FORMAT_MOD_4_TILED_MTL_RC_CCS,
> > > +	I915_FORMAT_MOD_4_TILED_DG2_RC_CCS,
> > > +	I915_FORMAT_MOD_4_TILED_BMG_CCS,
> > > +	I915_FORMAT_MOD_4_TILED_LNL_CCS,
> > > +};
> > > +
> > > +static u64 icl_async_modifiers[] = {
> > > +	I915_FORMAT_MOD_X_TILED,
> > > +	I915_FORMAT_MOD_Y_TILED,
> > > +	I915_FORMAT_MOD_Yf_TILED,
> > > +	I915_FORMAT_MOD_Y_TILED_CCS,
> > > +	I915_FORMAT_MOD_Yf_TILED_CCS,
> > > +};
> > > +
> > > +static u64 skl_async_modifiers[] = {
> > > +	I915_FORMAT_MOD_X_TILED,
> > > +	I915_FORMAT_MOD_Y_TILED,
> > > +	I915_FORMAT_MOD_Yf_TILED,
> > > +};
> > > +
> > > +static u32 intel_async_formats[] = {
> > > +	DRM_FORMAT_RGB565,
> > > +	DRM_FORMAT_XRGB8888,
> > > +	DRM_FORMAT_XBGR8888,
> > > +	DRM_FORMAT_ARGB8888,
> > > +	DRM_FORMAT_ABGR8888,
> > > +	DRM_FORMAT_XRGB2101010,
> > > +	DRM_FORMAT_XBGR2101010,
> > > +	DRM_FORMAT_XRGB16161616F,
> > > +	DRM_FORMAT_XBGR16161616F,
> > > +};
> > 
> > I've just pushed my .can_async_flip() thing. I'm thinking with that all this can
> > just disappear and we can have a completely generic implementation. Eg
> > something like:
> > 
> Thanks, will rebase and push!
> 
> Thanks and Regards,
> Arun R Murthy
> --------------------
> > intel_plane_format_mod_supported_async()
> > {
> > 	// some generic checks here (eg. reject planar formats)
> > 
> > 	return plane->format_mod_supported() &&
> > 		plane->can_async_flip();
> > }

Actually for this one I think it'd probably make sense to call the 
normal format_mod_supported() before doing any other checks, just 
in case we ever get situations where the parameters come directly
from userspace. It's better to filter out completely bogus values
as early as possible, and the normal format_mod_supported() already
has to be prepared for garbage values.

> > 
> > > +
> > >  int skl_format_to_fourcc(int format, bool rgb_order, bool alpha)  {
> > >  	switch (format) {
> > > @@ -2613,6 +2651,7 @@ skl_universal_plane_create(struct
> > drm_i915_private *dev_priv,
> > >  	unsigned int supported_rotations;
> > >  	unsigned int supported_csc;
> > >  	const u64 *modifiers;
> > > +	u64 *async_modifiers;
> > >  	const u32 *formats;
> > >  	int num_formats;
> > >  	int ret;
> > > @@ -2715,6 +2754,18 @@ skl_universal_plane_create(struct
> > drm_i915_private *dev_priv,
> > >  	if (ret)
> > >  		goto fail;
> > >
> > > +	if (DISPLAY_VER(dev_priv) >= 12)
> > > +		async_modifiers = tgl_asyn_modifiers;
> > > +	else if (DISPLAY_VER(dev_priv) == 11)
> > > +		async_modifiers = icl_async_modifiers;
> > > +	else
> > > +		async_modifiers = skl_async_modifiers;
> > > +
> > > +	drm_plane_create_format_blob(&dev_priv->drm, &plane->base,
> > > +				     async_modifiers, sizeof(async_modifiers),
> > > +				     intel_async_formats,
> > > +				     sizeof(intel_async_formats), true);
> > > +
> > >  	if (DISPLAY_VER(dev_priv) >= 13)
> > >  		supported_rotations = DRM_MODE_ROTATE_0 |
> > DRM_MODE_ROTATE_180;
> > >  	else
> > >
> > > --
> > > 2.25.1
> > 
> > --
> > Ville Syrjälä
> > Intel

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-01-21 13:40 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08  5:38 [PATCH v3 0/5] Expose modifiers/formats supported by async flips Arun R Murthy
2025-01-08  5:38 ` [PATCH v3 1/5] drm/plane: Add new plane property IN_FORMATS_ASYNC Arun R Murthy
2025-01-12  7:59   ` Borah, Chaitanya Kumar
2025-01-13  8:22     ` Murthy, Arun R
2025-01-13 17:38       ` Borah, Chaitanya Kumar
2025-01-16  9:54         ` Murthy, Arun R
2025-02-17  6:30           ` Kumar, Naveen1
2025-01-08  5:39 ` [PATCH v3 2/5] drm/plane: Expose function to create format/modifier blob Arun R Murthy
2025-01-12  8:00   ` Borah, Chaitanya Kumar
2025-01-13  8:22     ` Murthy, Arun R
2025-01-13 18:44       ` Borah, Chaitanya Kumar
2025-01-16  9:54         ` Murthy, Arun R
2025-01-20 20:42   ` Ville Syrjälä
2025-01-22  9:27     ` Murthy, Arun R
2025-01-23  7:47       ` Murthy, Arun R
2025-01-24 11:25         ` Ville Syrjälä
2025-01-25  6:55           ` Murthy, Arun R
2025-01-27  7:25             ` Borah, Chaitanya Kumar
2025-01-27 19:13               ` Ville Syrjälä
2025-01-28  5:32                 ` Borah, Chaitanya Kumar
2025-01-08  5:39 ` [PATCH v3 3/5] drm/plane: Function to check async supported modifier/format Arun R Murthy
2025-01-12  8:01   ` Borah, Chaitanya Kumar
2025-01-08  5:39 ` [PATCH v3 4/5] drm/i915/display: Populate list of async supported formats/modifiers Arun R Murthy
2025-01-12  8:02   ` Borah, Chaitanya Kumar
2025-01-20 20:47   ` Ville Syrjälä
2025-01-21  3:34     ` Murthy, Arun R
2025-01-21 13:40       ` Ville Syrjälä [this message]
2025-01-08  5:39 ` [PATCH v3 5/5] drm/i915/display: Add function for format_mod_supported_async Arun R Murthy
2025-01-12  8:02   ` Borah, Chaitanya Kumar
2025-01-08  5:58 ` ✓ CI.Patch_applied: success for Expose modifiers/formats supported by async flips (rev2) Patchwork
2025-01-08  5:58 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-08  6:00 ` ✓ CI.KUnit: success " Patchwork
2025-01-08  6:20 ` ✓ CI.Hooks: " Patchwork
2025-01-08  6:22 ` ✗ CI.checksparse: warning " Patchwork
2025-01-08  6:49 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-01-09 22:08 ` ✗ Xe.CI.Full: " Patchwork

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=Z4-jxyzDQfE3hzxY@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=arun.r.murthy@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /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