Re: [PATCH] drm: Fix support for PCI domains

From: Geert Uytterhoeven
Date: Thu Aug 12 2010 - 17:30:45 EST


On Fri, Aug 6, 2010 at 05:55, Benjamin Herrenschmidt
<benh@xxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx>
> ---
> Â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.

Gr{oetje,eeting}s,

            Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
             Â Â -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/