From: Imre Deak <imre.deak@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 09/11] drm/i915: Add a platform independent way to check for CCS control planes
Date: Thu, 14 Oct 2021 00:32:55 +0300 [thread overview]
Message-ID: <20211013213255.GD19061@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <YWdFbXzbqHCPK4uK@intel.com>
On Wed, Oct 13, 2021 at 11:45:33PM +0300, Ville Syrjälä wrote:
> On Wed, Oct 13, 2021 at 11:27:02PM +0300, Ville Syrjälä wrote:
> > On Thu, Oct 07, 2021 at 11:35:15PM +0300, Imre Deak wrote:
> > > Future platforms change the location of CCS control planes in CCS
> > > framebuffers, so add intel_fb_is_rc_ccs_ctrl_plane() to query for these
> >
> > Don't we use the term 'ccs_plane' everywhere else?
> >
> > > planes independently of the platform. This function can be used
> > > everywhere instead of is_ccs_plane() (or is_ccs_plane() && !cc_plane()),
> > > since all the callers are only interested in control planes (and not CCS
> > > color-clear planes).
>
> Hmm. I guess you're changing the terminology across the board?
> If it's used consistently then no objections from me.
ccs_plane has been used as a generic term for both the "control" and the
cc plane, or at least I thought of it as such. I'm not sure if control
is a good name, but couldn't think of a better one. In any case I
thought calling the control plane ccs_plane is too generic, and would
make things clearer to use a more explicit term.
Function params and variables still use the ccs_plane name, though all
or most just handle ccs control planes.
main_to_ccs_plane() and skl_ccs_to_main_plane() should be renamed to
intel_fb_main_to_ccs_ctrl_plane() and intel_fb_ccs_ctrl_to_main_plane()
and change the latter one to assert that a control plane was passed.
IGT would also need the corresponding renames.
If you agree with the rational I can follow up with the above renames.
Otherwise we could just continue calling the control plane ccs_plane and
the cc plane ccs_cc_plane.
> > > Add the corresponding intel_fb_is_gen12_ccs_ctrl_plane(), which can be
> > > used everywhere instead of is_gen12_ccs_plane(), based on the above
> > > explanation.
> > >
> > > This change also unexports the is_gen12_ccs_modifier(),
> > > is_gen12_ccs_plane(), is_gen12_ccs_cc_plane() functions as they are only
> > > used in intel_fb.c
> > >
> > > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > > ---
> > > .../drm/i915/display/intel_display_types.h | 7 --
> > > drivers/gpu/drm/i915/display/intel_fb.c | 73 ++++++++++++++-----
> > > drivers/gpu/drm/i915/display/intel_fb.h | 5 +-
> > > .../drm/i915/display/skl_universal_plane.c | 3 +-
> > > 4 files changed, 56 insertions(+), 32 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > index bb53b01f07aee..b4b6a31caf4e3 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> > > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > @@ -2050,11 +2050,4 @@ static inline bool is_ccs_modifier(u64 modifier)
> > > modifier == I915_FORMAT_MOD_Yf_TILED_CCS;
> > > }
> > >
> > > -static inline bool is_gen12_ccs_modifier(u64 modifier)
> > > -{
> > > - return modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS ||
> > > - modifier == I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC ||
> > > - modifier == I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS;
> > > -}
> > > -
> > > #endif /* __INTEL_DISPLAY_TYPES_H__ */
> > > diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
> > > index e8fe198b1b6a1..392f89e659eb6 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_fb.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_fb.c
> > > @@ -125,6 +125,8 @@ const struct intel_modifier_desc {
> > > #define INTEL_CCS_ANY (INTEL_CCS_RC | INTEL_CCS_RC_CC | INTEL_CCS_MC)
> > > u8 type:3;
> > > u8 cc_planes:3;
> > > + u8 packed_ctrl_planes:4;
> > > + u8 planar_ctrl_planes:4;
> > > } ccs;
> > > } intel_modifiers[] = {
> > > {
> > > @@ -151,6 +153,7 @@ const struct intel_modifier_desc {
> > > .tiling = I915_TILING_Y,
> > >
> > > .ccs.type = INTEL_CCS_RC,
> > > + .ccs.packed_ctrl_planes = BIT(1),
> > >
> > > FORMAT_OVERRIDE(skl_ccs_formats),
> > > },
> > > @@ -159,6 +162,7 @@ const struct intel_modifier_desc {
> > > .display_versions = DISPLAY_VER_MASK(9, 11),
> > >
> > > .ccs.type = INTEL_CCS_RC,
> > > + .ccs.packed_ctrl_planes = BIT(1),
> > >
> > > FORMAT_OVERRIDE(skl_ccs_formats),
> > > },
> > > @@ -168,6 +172,7 @@ const struct intel_modifier_desc {
> > > .tiling = I915_TILING_Y,
> > >
> > > .ccs.type = INTEL_CCS_RC,
> > > + .ccs.packed_ctrl_planes = BIT(1),
> > >
> > > FORMAT_OVERRIDE(gen12_ccs_formats),
> > > },
> > > @@ -177,6 +182,7 @@ const struct intel_modifier_desc {
> > > .tiling = I915_TILING_Y,
> > >
> > > .ccs.type = INTEL_CCS_RC_CC,
> > > + .ccs.packed_ctrl_planes = BIT(1),
> > > .ccs.cc_planes = BIT(2),
> > >
> > > FORMAT_OVERRIDE(gen12_ccs_cc_formats),
> > > @@ -187,6 +193,8 @@ const struct intel_modifier_desc {
> > > .tiling = I915_TILING_Y,
> > >
> > > .ccs.type = INTEL_CCS_MC,
> > > + .ccs.packed_ctrl_planes = BIT(1),
> > > + .ccs.planar_ctrl_planes = BIT(2) | BIT(3),
> > >
> > > FORMAT_OVERRIDE(gen12_ccs_formats),
> > > },
> > > @@ -385,17 +393,44 @@ bool intel_format_info_is_yuv_semiplanar(const struct drm_format_info *info,
> > > return format_is_yuv_semiplanar(lookup_modifier(modifier), info);
> > > }
> > >
> > > -bool is_ccs_plane(const struct drm_framebuffer *fb, int plane)
> > > +static u8 ccs_ctrl_plane_mask(const struct intel_modifier_desc *md,
> > > + const struct drm_format_info *format)
> > > {
> > > - if (!is_ccs_modifier(fb->modifier))
> > > - return false;
> > > + if (format_is_yuv_semiplanar(md, format))
> > > + return md->ccs.planar_ctrl_planes;
> > > + else
> > > + return md->ccs.packed_ctrl_planes;
> > > +}
> > > +
> > > +/**
> > > + * intel_fb_is_ccs_ctrl_plane: Check if a framebuffer color plane is a CCS control plane
> > > + * @fb: Framebuffer
> > > + * @plane: color plane index to check
> > > + *
> > > + * Returns:
> > > + * Returns %true if @fb's color plane at index @plane is a CCS control plane.
> > > + */
> > > +bool intel_fb_is_ccs_ctrl_plane(const struct drm_framebuffer *fb, int plane)
> > > +{
> > > + const struct intel_modifier_desc *md = lookup_modifier(fb->modifier);
> > >
> > > - return plane >= fb->format->num_planes / 2;
> > > + return ccs_ctrl_plane_mask(md, fb->format) & BIT(plane);
> > > }
> > >
> > > -bool is_gen12_ccs_plane(const struct drm_framebuffer *fb, int plane)
> > > +/**
> > > + * intel_fb_is_gen12_ccs_ctrl_plane: Check if a framebuffer color plane is a GEN12 CCS control plane
> > > + * @fb: Framebuffer
> > > + * @plane: color plane index to check
> > > + *
> > > + * Returns:
> > > + * Returns %true if @fb's color plane at index @plane is a GEN12 CCS control plane.
> > > + */
> > > +static bool intel_fb_is_gen12_ccs_ctrl_plane(const struct drm_framebuffer *fb, int plane)
> > > {
> > > - return is_gen12_ccs_modifier(fb->modifier) && is_ccs_plane(fb, plane);
> > > + const struct intel_modifier_desc *md = lookup_modifier(fb->modifier);
> > > +
> > > + return md->display_versions & (DISPLAY_VER_MASK(12, 13)) &&
>
> Aha! No RPN here ;)
>
> --
> Ville Syrjälä
> Intel
next prev parent reply other threads:[~2021-10-13 21:33 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-07 20:35 [Intel-gfx] [PATCH 00/11] drm/i915: Simplify handling of modifiers Imre Deak
2021-10-07 20:35 ` [Intel-gfx] [PATCH 01/11] drm/i915: Add a table with a descriptor for all i915 modifiers Imre Deak
2021-10-07 21:10 ` Ville Syrjälä
2021-10-07 21:26 ` Imre Deak
2021-10-07 21:32 ` Ville Syrjälä
2021-10-07 22:00 ` Imre Deak
2021-10-08 9:41 ` Ville Syrjälä
2021-10-08 0:19 ` [Intel-gfx] [PATCH v2 " Imre Deak
2021-10-13 20:14 ` Ville Syrjälä
2021-10-13 21:01 ` Imre Deak
2021-10-13 21:34 ` Ville Syrjälä
2021-10-13 20:40 ` Ville Syrjälä
2021-10-14 10:07 ` Imre Deak
2021-10-14 14:07 ` [Intel-gfx] [PATCH " Jani Nikula
2021-10-14 14:16 ` Jani Nikula
2021-10-14 15:03 ` Imre Deak
2021-10-14 15:48 ` Jani Nikula
2021-10-07 20:35 ` [Intel-gfx] [PATCH 02/11] drm/i915: Move intel_get_format_info() to intel_fb.c Imre Deak
2021-10-08 0:19 ` [Intel-gfx] [PATCH v2 " Imre Deak
2021-10-13 20:17 ` Ville Syrjälä
2021-10-13 21:06 ` Imre Deak
2021-10-07 20:35 ` [Intel-gfx] [PATCH 03/11] drm/i915: Add tiling attribute to the modifier descriptor Imre Deak
2021-10-08 0:19 ` [Intel-gfx] [PATCH v2 " Imre Deak
2021-10-13 20:18 ` [Intel-gfx] [PATCH " Ville Syrjälä
2021-10-13 21:08 ` Imre Deak
2021-10-07 20:35 ` [Intel-gfx] [PATCH 04/11] drm/i915: Simplify the modifier check for interlaced scanout support Imre Deak
2021-10-07 20:35 ` [Intel-gfx] [PATCH 05/11] drm/i915: Unexport is_semiplanar_uv_plane() Imre Deak
2021-10-08 0:19 ` [Intel-gfx] [PATCH v2 " Imre Deak
2021-10-07 20:35 ` [Intel-gfx] [PATCH 06/11] drm/i915: Move intel_format_info_is_yuv_semiplanar() to intel_fb.c Imre Deak
2021-10-07 20:35 ` [Intel-gfx] [PATCH 07/11] drm/i915: Add a platform independent way to get the RC CCS CC plane Imre Deak
2021-10-08 0:19 ` [Intel-gfx] [PATCH v2 " Imre Deak
2021-10-07 20:35 ` [Intel-gfx] [PATCH 08/11] drm/i915: Handle CCS CC planes separately from CCS control planes Imre Deak
2021-10-07 20:35 ` [Intel-gfx] [PATCH 09/11] drm/i915: Add a platform independent way to check for " Imre Deak
2021-10-08 0:19 ` [Intel-gfx] [PATCH v2 " Imre Deak
2021-10-13 20:27 ` [Intel-gfx] [PATCH " Ville Syrjälä
2021-10-13 20:45 ` Ville Syrjälä
2021-10-13 21:32 ` Imre Deak [this message]
2021-10-13 21:54 ` Ville Syrjälä
2021-10-13 22:28 ` Imre Deak
2021-10-13 22:38 ` Ville Syrjälä
2021-10-14 10:10 ` Imre Deak
2021-10-07 20:35 ` [Intel-gfx] [PATCH 10/11] drm/i915: Move is_ccs_modifier() to intel_fb.c Imre Deak
2021-10-08 0:19 ` [Intel-gfx] [PATCH v2 " Imre Deak
2021-10-07 20:35 ` [Intel-gfx] [PATCH 11/11] drm/i915: Add functions to check for RC CCS CC and MC CCS modifiers Imre Deak
2021-10-08 0:19 ` [Intel-gfx] [PATCH v2 " Imre Deak
2021-10-07 21:33 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Simplify handling of modifiers Patchwork
2021-10-07 21:35 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-10-07 21:50 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-10-08 0:34 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Simplify handling of modifiers (rev9) Patchwork
2021-10-08 0:35 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-10-08 1:06 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-10-08 2:15 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-10-13 19:41 ` [Intel-gfx] [PATCH 00/11] drm/i915: Simplify handling of modifiers Juha-Pekka Heikkila
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=20211013213255.GD19061@ideak-desk.fi.intel.com \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox