From: Lucas De Marchi <lucas.demarchi@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@freedesktop.org, Rodrigo Vivi <rodrigo.vivi@intel.com>,
dri-devel@freedesktop.org,
Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH libdrm 1/4] intel: add IS_GENX() generic macro
Date: Tue, 28 Aug 2018 09:16:21 -0700 [thread overview]
Message-ID: <20180828161620.GA5459@ldmartin-desk.jf.intel.com> (raw)
In-Reply-To: <153544553966.28857.4692391764954668356@skylake-alporthouse-com>
On Tue, Aug 28, 2018 at 09:38:59AM +0100, Chris Wilson wrote:
> Quoting Lucas De Marchi (2018-08-28 02:00:27)
> > On Sat, Aug 25, 2018 at 10:35:23AM +0100, Chris Wilson wrote:
> > > Quoting Lucas De Marchi (2018-08-25 00:56:46)
> > > > diff --git a/intel/intel_chipset.h b/intel/intel_chipset.h
> > > > index 4a34b7be..8a0e3e76 100644
> > > > --- a/intel/intel_chipset.h
> > > > +++ b/intel/intel_chipset.h
> > > > @@ -568,6 +568,26 @@
> > > >
> > > > #define IS_GEN11(devid) (IS_ICELAKE_11(devid))
> > > >
> > > > +/* New platforms use kernel pci ids */
> > > > +#include "i915_pciids.h"
> > > > +
> > > > +struct pci_device_id {
> > >
> > > Don't call it pci_device_id, depending on caller that name may already
> > > be taken by libpciaccess.
> > >
> > > > + uint32_t unused0, device;
> > > > + uint32_t unused1, unused2;
> > > > + uint32_t unused3, unused4;
> > > These are all uint16_t.
> >
> > more on this:
> >
> > I can make the first 2 uint16_t, but not the rest due to the way they
> > are declared in INTEL_VGA_DEVICE: (~0 has int type by default), unused3
> > and unused4 are clearly not uint16_t
>
> I had it in my mind that we did have one extra level of macro in there
> that would allow us to drop unused fields. We could redef
we don't have right now, that needs to be added. And for any extra level
of macro we need to redef INTEL_VGA_DEVICE nonetheless because it
expands to "{ ... }". I don't know any cpp trick to remove the extra
fields if it keeps the braces.
> INTEL_VGA_DEVICE() and INTEL_QUANTA_VGA_DEVICE() but one extra level of
> macro would be easier for future.
So... I don't see a way out except to redef it. This works today for
libdrm (on top of my unsent version of this patch):
[ NO CI ] diff --git a/intel/intel_chipset.c b/intel/intel_chipset.c
[ NO CI ] index 79581819..8ea24194 100644
[ NO CI ] --- a/intel/intel_chipset.c
[ NO CI ] +++ b/intel/intel_chipset.c
@@ -27,11 +27,12 @@
#include "i915_pciids.h"
+#undef INTEL_VGA_DEVICE
+#define INTEL_VGA_DEVICE(id, gen) { id, gen }
+
static const struct pci_device {
- uint16_t unused0, device;
- uint32_t unused1, unused2;
- uint32_t unused3, unused4;
- int gen;
+ uint16_t device;
+ uint16_t gen;
} pciids[] = {
INTEL_ICL_11_IDS(11),
INTEL_CNL_IDS(10),
>
> And then while you are there, add the missing 'u' to ~0u
> -Chris.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-08-28 16:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-24 23:56 [PATCH libdrm 0/4] intel: rework how we add PCI IDs Lucas De Marchi
2018-08-24 23:56 ` [PATCH libdrm 1/4] intel: add IS_GENX() generic macro Lucas De Marchi
2018-08-25 9:35 ` Chris Wilson
2018-08-27 21:19 ` Lucas De Marchi
2018-08-27 21:40 ` Chris Wilson
2018-08-27 23:15 ` Lucas De Marchi
2018-08-28 1:00 ` Lucas De Marchi
2018-08-28 8:38 ` Chris Wilson
2018-08-28 16:16 ` Lucas De Marchi [this message]
2018-08-24 23:56 ` [PATCH libdrm 2/4] intel: make gen11 use generic gen macro Lucas De Marchi
2018-08-24 23:56 ` [PATCH libdrm 3/4] intel: make gen10 " Lucas De Marchi
2018-08-24 23:56 ` [PATCH libdrm 4/4] intel: make gen9 " Lucas De Marchi
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=20180828161620.GA5459@ldmartin-desk.jf.intel.com \
--to=lucas.demarchi@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=dri-devel@freedesktop.org \
--cc=intel-gfx@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).