All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 5/5] drm/i915: Simplify modifier lookup in watermark code
Date: Fri, 30 Sep 2022 14:31:41 +0300	[thread overview]
Message-ID: <YzbTnZFZdFUM5REm@intel.com> (raw)
In-Reply-To: <e6c027ff-0cd4-ef3d-0f12-13d31015ba60@gmail.com>

On Fri, Sep 30, 2022 at 02:22:08PM +0300, Juha-Pekka Heikkila wrote:
> I had earlier this patch which look like it does mostly the same 
> https://patchwork.freedesktop.org/patch/444010/?series=92491&rev=4
> 
> With exception to mc ccs, earlier Imre said mc ccs must not be 
> considered here.

For the rc_surface thing? Doesn't actually matter what we put there
on glk+ since it's only used in skl/bxt code.

> 
> /Juha-Pekka
> 
> On 30.9.2022 13.43, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Replace the huge modifier lists in the watermark code with
> > a few calls to intel_fb.c.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >   drivers/gpu/drm/i915/display/intel_fb.c      | 13 ++++++++++++
> >   drivers/gpu/drm/i915/display/intel_fb.h      |  1 +
> >   drivers/gpu/drm/i915/display/skl_watermark.c | 22 +++-----------------
> >   3 files changed, 17 insertions(+), 19 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
> > index eefa33c555ac..63137ae5ab21 100644
> > --- a/drivers/gpu/drm/i915/display/intel_fb.c
> > +++ b/drivers/gpu/drm/i915/display/intel_fb.c
> > @@ -300,6 +300,19 @@ static bool plane_caps_contain_all(u8 caps, u8 mask)
> >   	return (caps & mask) == mask;
> >   }
> >   
> > +/**
> > + * intel_fb_is_tiled_modifier: Check if a modifier is a tiled modifier type
> > + * @modifier: Modifier to check
> > + *
> > + * Returns:
> > + * Returns %true if @modifier is a tiled modifier.
> > + */
> > +bool intel_fb_is_tiled_modifier(u64 modifier)
> > +{
> > +	return plane_caps_contain_any(lookup_modifier(modifier)->plane_caps,
> > +				      INTEL_PLANE_CAP_TILING_MASK);
> > +}
> > +
> >   /**
> >    * intel_fb_is_ccs_modifier: Check if a modifier is a CCS modifier type
> >    * @modifier: Modifier to check
> > diff --git a/drivers/gpu/drm/i915/display/intel_fb.h b/drivers/gpu/drm/i915/display/intel_fb.h
> > index 12386f13a4e0..4662b812b934 100644
> > --- a/drivers/gpu/drm/i915/display/intel_fb.h
> > +++ b/drivers/gpu/drm/i915/display/intel_fb.h
> > @@ -29,6 +29,7 @@ struct intel_plane_state;
> >   #define INTEL_PLANE_CAP_TILING_Yf	BIT(5)
> >   #define INTEL_PLANE_CAP_TILING_4	BIT(6)
> >   
> > +bool intel_fb_is_tiled_modifier(u64 modifier);
> >   bool intel_fb_is_ccs_modifier(u64 modifier);
> >   bool intel_fb_is_rc_ccs_cc_modifier(u64 modifier);
> >   bool intel_fb_is_mc_ccs_modifier(u64 modifier);
> > diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
> > index 18178b01375e..0715bb308989 100644
> > --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> > +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> > @@ -1706,26 +1706,10 @@ skl_compute_wm_params(const struct intel_crtc_state *crtc_state,
> >   		return -EINVAL;
> >   	}
> >   
> > -	wp->y_tiled = modifier == I915_FORMAT_MOD_Y_TILED ||
> > -		      modifier == I915_FORMAT_MOD_4_TILED ||
> > -		      modifier == I915_FORMAT_MOD_Yf_TILED ||
> > -		      modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
> > -		      modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
> > -		      modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS ||
> > -		      modifier == I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS ||
> > -		      modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC ||
> > -		      modifier == I915_FORMAT_MOD_4_TILED_DG2_RC_CCS ||
> > -		      modifier == I915_FORMAT_MOD_4_TILED_DG2_MC_CCS ||
> > -		      modifier == I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC;
> >   	wp->x_tiled = modifier == I915_FORMAT_MOD_X_TILED;
> > -	wp->rc_surface = modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
> > -			 modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
> > -			 modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS ||
> > -			 modifier == I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS ||
> > -			 modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC ||
> > -			 modifier == I915_FORMAT_MOD_4_TILED_DG2_RC_CCS ||
> > -			 modifier == I915_FORMAT_MOD_4_TILED_DG2_MC_CCS ||
> > -			 modifier == I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC;
> > +	wp->y_tiled = modifier != I915_FORMAT_MOD_X_TILED &&
> > +		intel_fb_is_tiled_modifier(modifier);
> > +	wp->rc_surface = intel_fb_is_ccs_modifier(modifier);
> 
> I had earlier this patch which look like it did mostly the same 
> https://patchwork.freedesktop.org/patch/444010/?series=92491&rev=4
> 
> With exception to mc ccs, earlier Imre said mc ccs must not be 
> considered here.
> 
> /Juha-Pekka
> 
> >   	wp->is_planar = intel_format_info_is_yuv_semiplanar(format, modifier);
> >   
> >   	wp->width = width;

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-09-30 11:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30 10:42 [Intel-gfx] [PATCH 0/5] drm/i915: Fix watermark calculations with various CCS modifiers Ville Syrjala
2022-09-30 10:42 ` [Intel-gfx] [PATCH 1/5] drm/i915: Fix watermark calculations for gen12+ " Ville Syrjala
2022-09-30 10:42   ` Ville Syrjala
2022-09-30 10:42 ` [Intel-gfx] [PATCH 2/5] drm/i915: Fix watermark calculations for gen12+ CCS+CC modifier Ville Syrjala
2022-09-30 10:42   ` Ville Syrjala
2022-09-30 10:43 ` [Intel-gfx] [PATCH 3/5] drm/i915: Fix watermark calculations for DG2 CCS modifiers Ville Syrjala
2022-09-30 10:43   ` Ville Syrjala
2022-09-30 10:43 ` [Intel-gfx] [PATCH 4/5] drm/i915: Fix watermark calculations for DG2 CCS+CC modifier Ville Syrjala
2022-09-30 10:43   ` Ville Syrjala
2022-09-30 10:43 ` [Intel-gfx] [PATCH 5/5] drm/i915: Simplify modifier lookup in watermark code Ville Syrjala
2022-09-30 11:22   ` Juha-Pekka Heikkila
2022-09-30 11:31     ` Ville Syrjälä [this message]
2022-09-30 11:47       ` Juha-Pekka Heikkila
2022-09-30 12:13         ` Ville Syrjälä
2022-09-30 11:33 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Fix watermark calculations with various CCS modifiers Patchwork
2022-10-01  8:37 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=YzbTnZFZdFUM5REm@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=juhapekka.heikkila@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.