All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 1/3] i915/perf: Store a mask of valid OA formats for a platform
Date: Tue, 02 Feb 2021 20:44:01 +0000	[thread overview]
Message-ID: <161229864133.28247.5042397934712917550@build.alporthouse.com> (raw)
In-Reply-To: <20210202201044.GE66899@orsosgc001.ra.intel.com>

Quoting Umesh Nerlige Ramappa (2021-02-02 20:10:44)
> On Tue, Feb 02, 2021 at 08:24:15AM +0000, Chris Wilson wrote:
> >Ok, this looks as compact and readable as writing it as a bunch of
> >tables. I presume there's a reason you didn't just use generation rather
> >than platform.
> >
> >switch (gen) {
> >case 7:
> >       haswell();
> >       break;
> >case 8 .. 11:
> >       broadwell();
> >       break;
> >case 12:
> >       tigerlake();
> >       break;
> >}
> >if you wanted to stick with a switch rather than an if-else tree for the
> >ranges.
> 
> only haswell is supported on gen7 and gen12 may define new formats that 
> are platform specific.
> 
> How about a mix? -
> 
> if (gen == 7 && haswell)
>         haswell();
> else if (gen >= 8 && gen <= 11)
>         broadwell;
> else
>         gen12_formats();
> 
> gen12_formats can choose to use the switch if formats vary between 
> platforms.

I didn't mind the platform switch too much, so no need to change at the
moment. I just worry that it's more typing to maintain :)

What I thought you were going to do (from the subject) were tables with
a platform_mask for applicability,  but that I feell would be just as
much typing, now and in the future.


I thought support started at Haswell, so the other gen7 were not a
concern? But yes, if we look at how we end up doing it else where it's a
mix of gen and platform

if (gen >= 12)
	gen12_formats;
else if (gen >= 8)
	gen8_formats;
else if (IS_HSW)
	hsw_formats;
else
	MISSING_CASE(gen)

At the end of the day, you're the person who is typing this, so it's up
to you how much effort you want to spend now to save later. :)
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-02-02 20:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02  7:54 [Intel-gfx] [PATCH 1/3] i915/perf: Store a mask of valid OA formats for a platform Umesh Nerlige Ramappa
2021-02-02  7:54 ` [Intel-gfx] [PATCH 2/3] i915/perf: Move OA formats to single array Umesh Nerlige Ramappa
2021-02-02  7:54 ` [Intel-gfx] [PATCH 3/3] i915/perf: Add additional OA formats for gen12 Umesh Nerlige Ramappa
2021-02-02  8:24 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/3] i915/perf: Store a mask of valid OA formats for a platform Patchwork
2021-02-02  8:24 ` [Intel-gfx] [PATCH 1/3] " Chris Wilson
2021-02-02 20:10   ` Umesh Nerlige Ramappa
2021-02-02 20:44     ` Chris Wilson [this message]
2021-02-02  8:52 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/3] " Patchwork
2021-02-02 11:32 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-02-03  9:55 ` [Intel-gfx] [PATCH 1/3] " Lionel Landwerlin
2021-02-08 17:40 Umesh Nerlige Ramappa

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=161229864133.28247.5042397934712917550@build.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=umesh.nerlige.ramappa@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.