All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
	"Ville Syrjälä" <ville.syrjala@intel.com>
Subject: Re: [Intel-gfx] [PATCH v3 6/6] drm/i915/display: Simplify GLK display version tests
Date: Tue, 23 Mar 2021 19:40:58 +0200	[thread overview]
Message-ID: <YFooKuVqPeZrLWM3@intel.com> (raw)
In-Reply-To: <20210323172734.GU3422723@mdroper-desk1.amr.corp.intel.com>

On Tue, Mar 23, 2021 at 10:27:34AM -0700, Matt Roper wrote:
> On Tue, Mar 23, 2021 at 07:25:57PM +0200, Ville Syrjälä wrote:
> > On Mon, Mar 22, 2021 at 04:38:40PM -0700, Matt Roper wrote:
> > > GLK has always been a bit of a special case since it reports INTEL_GEN()
> > > as 9, but has version 10 display IP.  Now we can properly represent the
> > > display version as 10 and simplify the display generation tests
> > > throughout the display code.
> > > 
> > > Aside from manually adding the version to the glk_info structure, the
> > > rest of this patch is generated with a Coccinelle semantic patch.  Note
> > > that we also need to switch any code that matches gen10 today but *not*
> > > GLK to be CNL-specific:
> > > 
> > >         @@ expression dev_priv; @@
> > >         - DISPLAY_VER(dev_priv) > 9
> > >         + DISPLAY_VER(dev_priv) >= 10
> > > 
> > >         @@ expression dev_priv, E; @@
> > >         (
> > >         - DISPLAY_VER(dev_priv) >= 10 && E
> > >         + (DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)) && E
> > >         |
> > >         - DISPLAY_VER(dev_priv) >= 10
> > >         + DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)
> > >         |
> > >         - IS_DISPLAY_RANGE(dev_priv, 10, E)
> > >         + IS_DISPLAY_RANGE(dev_priv, 11, E) || IS_CANNONLAKE(dev_priv)
> > >         )
> > > 
> > >         @@ expression dev_priv, E, E2; @@
> > >         (
> > >         - (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv))
> > >         + IS_DISPLAY_VER(dev_priv, 10)
> > >         |
> > >         - E || IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)
> > >         + E || IS_DISPLAY_VER(dev_priv, 10)
> > >         |
> > >         - (IS_GEMINILAKE(dev_priv) || IS_CANNONLAKE(dev_priv))
> > >         + IS_DISPLAY_VER(dev_priv, 10)
> > >         |
> > >         - IS_GEMINILAKE(dev_priv) || E || IS_CANNONLAKE(dev_priv)
> > >         + E || IS_DISPLAY_VER(dev_priv, 10)
> > >         |
> > >         - E || IS_GEMINILAKE(dev_priv) || E2 || IS_CANNONLAKE(dev_priv)
> > >         + E || E2 || IS_DISPLAY_VER(dev_priv, 10)
> > >         |
> > >         - (IS_DISPLAY_VER(dev_priv, 10) || IS_GEMINILAKE(dev_priv))
> > >         + IS_DISPLAY_VER(dev_priv, 10)
> > >         |
> > >         - (IS_GEMINILAKE(dev_priv) || IS_DISPLAY_VER(dev_priv, 10))
> > >         + IS_DISPLAY_VER(dev_priv, 10)
> > >         )
> > > 
> > >         @@ expression dev_priv; @@
> > >         - (IS_DISPLAY_VER(dev_priv, 9) && !IS_GEMINILAKE(dev_priv))
> > >         + IS_DISPLAY_VER(dev_priv, 9)
> > > 
> > >         @@ expression dev_priv; @@
> > >         (
> > >         - !(DISPLAY_VER(dev_priv) >= 11 || IS_DISPLAY_VER(dev_priv, 10))
> > >         + DISPLAY_VER(dev_priv) < 10
> > >         |
> > >         - (DISPLAY_VER(dev_priv) >= 11 || IS_DISPLAY_VER(dev_priv, 10))
> > >         + DISPLAY_VER(dev_priv) >= 10
> > >         )
> > > 
> > >         @@ expression dev_priv, E; @@
> > >         - E || DISPLAY_VER(dev_priv) >= 11 || IS_DISPLAY_VER(dev_priv, 10)
> > >         + E || DISPLAY_VER(dev_priv) >= 10
> > > 
> > >         @@ expression dev_priv, E; @@
> > >         - (IS_DISPLAY_RANGE(dev_priv, 11, E) || IS_DISPLAY_VER(dev_priv, 10))
> > >         + IS_DISPLAY_RANGE(dev_priv, 10, E)
> > > 
> > >         @@ expression dev_priv; @@
> > >         (
> > >         - DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv) || IS_GEN9_LP(dev_priv)
> > >         + DISPLAY_VER(dev_priv) >= 10 || IS_GEN9_LP(dev_priv)
> > >         |
> > >         - IS_GEN9_LP(dev_priv) || DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv)
> > >         + IS_GEN9_LP(dev_priv) || DISPLAY_VER(dev_priv) >= 10
> > >         )
> > > 
> > >         @@ expression dev_priv, E; @@
> > >         - !(DISPLAY_VER(dev_priv) >= E)
> > >         + DISPLAY_VER(dev_priv) < E
> > > 
> > > v2:
> > >  - Convert gen10 conditions that don't include GLK into CNL conditions.
> > >    (Ville)
> > > 
> > > v3:
> > >  - Rework coccinelle rules so that "ver>=10" turns into "ver>=11||is_cnl." (Ville)
> > > 
> > > v3.1:
> > >  - Manually re-add the ".display.version = 10" to glk_info after
> > >    regenerating patch via Coccinelle.
> > > 
> > > v4:
> > >  - Also apply cocci rules to intel_pm.c and i915_irq.c!  (CI)
> > 
> > Ugh. One thing that occurred to me when looking at i915_irq.c is that
> > IS_GEN9_LP() is now maybe broken on glk? So seems to me all uses of
> > IS_GEN9_LP() need to be reviewed and potentially changed.
> 
> Broken how?  That macro still uses the gen/gt version instead of the
> display number, so I think it still behaves the same as before?

Oh you're not changng it to to use display ver? I guess it still kinda
works then. But it's going to be pretty confusing to use that for
display stuff now. Ie. we should probably stop using it.

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-03-23 17:41 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-20  4:42 [Intel-gfx] [PATCH 0/6] Disassociate display version from INTEL_GEN() Matt Roper
2021-03-20  4:42 ` [Intel-gfx] [PATCH 1/6] drm/i915/display: Convert gen5/gen6 tests to IS_IRONLAKE/IS_SANDYBRIDGE Matt Roper
2021-03-20  4:42 ` [Intel-gfx] [PATCH 2/6] drm/i915: Add DISPLAY_VER() and related macros Matt Roper
2021-03-23  5:37   ` Lucas De Marchi
2021-03-20  4:42 ` [Intel-gfx] [PATCH 3/6] drm/i915/display: Eliminate most usage of INTEL_GEN() Matt Roper
2021-03-23  5:45   ` Lucas De Marchi
2021-03-20  4:42 ` [Intel-gfx] [PATCH 4/6] drm/i915: Convert INTEL_GEN() to DISPLAY_VER() as appropriate in intel_pm.c Matt Roper
2021-03-20  4:42 ` [Intel-gfx] [PATCH 5/6] drm/i915: Convert INTEL_GEN() to DISPLAY_VER() as appropriate in i915_irq.c Matt Roper
2021-03-20  4:42 ` [Intel-gfx] [PATCH 6/6] drm/i915/display: Simplify GLK display version tests Matt Roper
2021-03-22 15:19   ` Ville Syrjälä
2021-03-22 19:48     ` [Intel-gfx] [PATCH v2 " Matt Roper
2021-03-22 19:50       ` [Intel-gfx] [PATCH v2.1 " Matt Roper
2021-03-22 21:16         ` Ville Syrjälä
2021-03-22 21:25           ` Matt Roper
2021-03-22 21:34             ` Ville Syrjälä
2021-03-22 23:38           ` [Intel-gfx] [PATCH v3 " Matt Roper
2021-03-23 17:25             ` Ville Syrjälä
2021-03-23 17:27               ` Matt Roper
2021-03-23 17:40                 ` Ville Syrjälä [this message]
2021-03-23 18:00                   ` Matt Roper
2021-03-20  5:09 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Disassociate display version from INTEL_GEN() Patchwork
2021-03-20  5:10 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-03-20  5:43 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-03-20  6:56 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-03-22 22:13 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Disassociate display version from INTEL_GEN() (rev3) Patchwork
2021-03-22 22:15 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-03-22 22:43 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-03-23  0:25 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Disassociate display version from INTEL_GEN() (rev4) Patchwork
2021-03-23  0:27 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-03-23  0:54 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-03-23  1:27 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Disassociate display version from INTEL_GEN() (rev5) Patchwork
2021-03-23  1:28 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-03-23  1:55 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-03-23 22:59 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-03-23 23:55   ` Matt Roper

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=YFooKuVqPeZrLWM3@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=ville.syrjala@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 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.