From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Dave Airlie <airlied@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
dri-devel@lists.sourceforge.net,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm: Fix support for PCI domains
Date: Thu, 12 Aug 2010 16:45:57 -0700 [thread overview]
Message-ID: <20100812164557.5f2513a6@virtuousgeek.org> (raw)
In-Reply-To: <AANLkTi=BowHspOUSDmwkdN3o9qhh6rJtEZwCnTRP-VrS@mail.gmail.com>
On Fri, 13 Aug 2010 09:33:35 +1000
Dave Airlie <airlied@gmail.com> wrote:
> On Fri, Aug 13, 2010 at 7:30 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > On Fri, Aug 6, 2010 at 05:55, Benjamin Herrenschmidt
> > <benh@kernel.crashing.org> wrote:
> >> (For some reason I thought that went in ages ago ...)
> >>
> >> This fixes support for PCI domains in what should hopefully be a backward
> >> compatible way along with a change to libdrm.
> >>
> >> When the interface version is set to 1.4, we assume userspace understands
> >> domains and the world is at peace. We thus pass proper domain numbers
> >> instead of 0 to userspace.
> >>
> >> The newer libdrm will then try 1.4 first, and fallback to 1.1, along with
> >> ignoring domains in the later case (well, except on alpha of course)
> >>
> >> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> >> ---
> >> drivers/gpu/drm/drm_ioctl.c | 1 +
> >> include/drm/drmP.h | 18 +++++++++++++-----
> >> include/drm/drm_core.h | 2 +-
> >> 3 files changed, 15 insertions(+), 6 deletions(-)
> >
> >> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> >> index c1b9871..6d4bad5 100644
> >> --- a/include/drm/drmP.h
> >> +++ b/include/drm/drmP.h
> >> @@ -1071,11 +1071,19 @@ static __inline__ int drm_core_check_feature(struct drm_device *dev,
> >> return ((dev->driver->driver_features & feature) ? 1 : 0);
> >> }
> >>
> >> -#ifdef __alpha__
> >> -#define drm_get_pci_domain(dev) dev->hose->index
> >> -#else
> >> -#define drm_get_pci_domain(dev) 0
> >> -#endif
> >> +static inline int drm_get_pci_domain(struct drm_device *dev)
> >> +{
> >> +#ifndef __alpha__
> >> + /* For historical reasons, drm_get_pci_domain() is busticated
> >> + * on most archs and has to remain so for userspace interface
> >> + * < 1.4, except on alpha which was right from the beginning
> >> + */
> >> + if (dev->if_version < 0x10004)
> >> + return 0;
> >> +#endif /* __alpha__ */
> >> +
> >> + return pci_domain_nr(dev->pdev->bus);
> >
> > error: implicit declaration of function ‘pci_domain_nr’
> > on m68k without PCI.
>
> I don't think I want to add an ifdef CONFIG_PCI into the drm layer for
> this, since we seem to be okay everywhere else,
>
> lets ask jbarnes, not sure if its safe to just add this to the
> !CONFIG_PCI section of the linux/pci.h
Hm, so pci_domain_nr should just return 0 on platforms where
CONFIG_PCI_DOMAINS isn't set. I'd expect that to be the case when
CONFIG_PCI=n... Maybe we just need to shuffle the definition around?
--
Jesse Barnes, Intel Open Source Technology Center
next prev parent reply other threads:[~2010-08-12 23:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-06 3:55 [PATCH] drm: Fix support for PCI domains Benjamin Herrenschmidt
2010-08-06 7:11 ` Michel Dänzer
2010-08-06 7:11 ` Michel Dänzer
2010-08-12 21:30 ` Geert Uytterhoeven
2010-08-12 21:30 ` Geert Uytterhoeven
2010-08-12 23:33 ` Dave Airlie
2010-08-12 23:33 ` Dave Airlie
2010-08-12 23:45 ` Jesse Barnes [this message]
2010-08-13 0:22 ` Dave Airlie
2010-08-13 0:35 ` Jesse Barnes
2010-08-13 0:35 ` Jesse Barnes
2010-08-13 0:22 ` Dave Airlie
2010-08-12 23:45 ` Jesse Barnes
-- strict thread matches above, loose matches on Subject: below --
2010-08-06 3:55 Benjamin Herrenschmidt
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=20100812164557.5f2513a6@virtuousgeek.org \
--to=jbarnes@virtuousgeek.org \
--cc=airlied@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=dri-devel@lists.sourceforge.net \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
/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.