dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@freedesktop.org,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH libdrm v2 5/5] intel: get gen once for gen >= 9
Date: Wed, 5 Sep 2018 11:01:47 -0700	[thread overview]
Message-ID: <20180905180147.GA13933@ldmartin-desk.jf.intel.com> (raw)
In-Reply-To: <153555307119.29873.7893410247060067539@skylake-alporthouse-com>

On Wed, Aug 29, 2018 at 03:31:11PM +0100, Chris Wilson wrote:
> Quoting Lucas De Marchi (2018-08-29 01:35:32)
> > We don't need to call IS_GEN() for each gen >= 9: we can rather use the
> > new intel_is_genx() helper to iterate the pciids array once.
> > 
> > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> > ---
> >  intel/intel_bufmgr_gem.c | 8 +-------
> >  intel/intel_decode.c     | 8 ++------
> >  2 files changed, 3 insertions(+), 13 deletions(-)
> > 
> > diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
> > index 8c3a4b20..d6587b76 100644
> > --- a/intel/intel_bufmgr_gem.c
> > +++ b/intel/intel_bufmgr_gem.c
> > @@ -3656,13 +3656,7 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
> >                 bufmgr_gem->gen = 7;
> >         else if (IS_GEN8(bufmgr_gem->pci_device))
> >                 bufmgr_gem->gen = 8;
> > -       else if (IS_GEN9(bufmgr_gem->pci_device))
> > -               bufmgr_gem->gen = 9;
> > -       else if (IS_GEN10(bufmgr_gem->pci_device))
> > -               bufmgr_gem->gen = 10;
> > -       else if (IS_GEN11(bufmgr_gem->pci_device))
> > -               bufmgr_gem->gen = 11;
> > -       else {
> > +       else if (!intel_get_genx(bufmgr_gem->pci_device, &bufmgr_gem->gen)) {
> >                 free(bufmgr_gem);
> >                 bufmgr_gem = NULL;
> >                 goto exit;
> 
> And while you are here, don't exit for an unknown gen, just pretend it's
> a future one. i915_pciids.h should contain *all* ids, even reserved, for
> exactly this reason. (The same behaviour is relied on elsewhere so that
> we don't get caught out by some one retrospectively introducing a new
> chip. Don't even get started on the abuse of pci-id for sub-gen
> encoding...)

This can be done as a separate series, otherwise we will just start
shoving a lot of things on top of this series and never get it merged.

Lucas De Marchi
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2018-09-05 18:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29  0:35 [PATCH libdrm v2 0/5] intel: rework how we add PCI IDs Lucas De Marchi
2018-08-29  0:35 ` [PATCH libdrm v2 1/5] intel: add generic functions to check PCI ID Lucas De Marchi
2018-08-31  8:16   ` Chris Wilson
2018-08-31 16:06     ` Lucas De Marchi
2018-08-31 16:13       ` Chris Wilson
2018-08-29  0:35 ` [PATCH libdrm v2 2/5] intel: make gen11 use generic gen macro Lucas De Marchi
2018-08-29  0:35 ` [PATCH libdrm v2 3/5] intel: make gen10 " Lucas De Marchi
2018-08-29  0:35 ` [PATCH libdrm v2 4/5] intel: make gen9 " Lucas De Marchi
2018-08-29 10:32   ` Chris Wilson
2018-08-29 16:01     ` Lucas De Marchi
2018-08-31  8:20       ` Chris Wilson
2018-08-31  8:21   ` Chris Wilson
2018-08-31 16:14     ` Lucas De Marchi
2018-08-29  0:35 ` [PATCH libdrm v2 5/5] intel: get gen once for gen >= 9 Lucas De Marchi
2018-08-29 14:31   ` Chris Wilson
2018-09-05 18:01     ` Lucas De Marchi [this message]

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=20180905180147.GA13933@ldmartin-desk.jf.intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    --cc=rodrigo.vivi@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;
as well as URLs for NNTP newsgroup(s).