All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Slusarz <marcin.slusarz@gmail.com>
To: "Marcin Kościelnicki" <koriakin@0x04.net>
Cc: mesa-dev@lists.freedesktop.org, nouveau@lists.freedesktop.org
Subject: Re: [Nouveau] [PATCH v3 2/2] xorg/nouveau: blacklist all pre NV30 cards
Date: Mon, 6 Jun 2011 07:51:07 +0200	[thread overview]
Message-ID: <20110606055107.GA3758@joi.lan> (raw)
In-Reply-To: <4d561b116bfdafa4db7ebc389d712b9d@0x04.net>

On Sun, Jun 05, 2011 at 11:43:15PM +0200, Marcin Kościelnicki wrote:
> > ---
> > From: Marcin Slusarz <marcin.slusarz@gmail.com>
> > Subject: [PATCH] xorg/nouveau: blacklist all pre NV30 cards
> >
> > Bail out early in probe, so other driver (xf86-video-nouveau) can
> > take control
> > of the card. Doing it in screen_create would be too late.
> > ---
> >  src/gallium/targets/xorg-nouveau/Makefile       |    3 +
> >  src/gallium/targets/xorg-nouveau/nouveau_xorg.c |   63
> > +++++++++++++++++++---
> >  2 files changed, 57 insertions(+), 9 deletions(-)
> >
> > diff --git a/src/gallium/targets/xorg-nouveau/Makefile
> > b/src/gallium/targets/xorg-nouveau/Makefile
> > index 16ac954..755969c 100644
> > --- a/src/gallium/targets/xorg-nouveau/Makefile
> > +++ b/src/gallium/targets/xorg-nouveau/Makefile
> > @@ -23,4 +23,7 @@ DRIVER_PIPES = \
> >  DRIVER_LINKS = \
> >  	$(shell pkg-config --libs libdrm libdrm_nouveau)
> >
> > +DRIVER_INCLUDES = \
> > +	$(shell pkg-config --cflags-only-I libdrm libdrm_nouveau 
> > xf86driproto)
> > +
> >  include ../Makefile.xorg
> > diff --git a/src/gallium/targets/xorg-nouveau/nouveau_xorg.c
> > b/src/gallium/targets/xorg-nouveau/nouveau_xorg.c
> > index a25254a..43470a1 100644
> > --- a/src/gallium/targets/xorg-nouveau/nouveau_xorg.c
> > +++ b/src/gallium/targets/xorg-nouveau/nouveau_xorg.c
> > @@ -29,6 +29,9 @@
> >   */
> >
> >  #include "../../state_trackers/xorg/xorg_winsys.h"
> > +#include <nouveau_drmif.h>
> > +#include <xorg/dri.h>
> > +#include <xf86drmMode.h>
> >
> >  static void nouveau_xorg_identify(int flags);
> >  static Bool nouveau_xorg_pci_probe(DriverPtr driver, int entity_num,
> > @@ -38,16 +41,9 @@ static Bool nouveau_xorg_pci_probe(DriverPtr
> > driver, int entity_num,
> >  static const struct pci_id_match nouveau_xorg_device_match[] = {
> >      { 0x10de, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
> >        0x00030000, 0x00ffffff, 0 },
> > -    { 0x12d2, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
> > -      0x00030000, 0x00ffffff, 0 },
> >      {0, 0, 0},
> >  };
> >
> > -static SymTabRec nouveau_xorg_chipsets[] = {
> > -    {PCI_MATCH_ANY, "NVIDIA Graphics Device"},
> > -    {-1, NULL}
> > -};
> > -
> >  static PciChipsets nouveau_xorg_pci_devices[] = {
> >      {PCI_MATCH_ANY, PCI_MATCH_ANY, NULL},
> >      {-1, -1, NULL}
> > @@ -121,8 +117,7 @@ nouveau_xorg_setup(pointer module, pointer opts,
> > int *errmaj, int *errmin)
> >  static void
> >  nouveau_xorg_identify(int flags)
> >  {
> > -    xf86PrintChipsets("nouveau2", "Driver for Modesetting Kernel 
> > Drivers",
> > -		      nouveau_xorg_chipsets);
> > +    xf86DrvMsg(0, X_INFO, "nouveau2: Gallium3D based 2D driver for
> > NV30+ NVIDIA chipsets\n");
> >  }
> >
> >  static Bool
> > @@ -131,6 +126,56 @@ nouveau_xorg_pci_probe(DriverPtr driver,
> >  {
> >      ScrnInfoPtr scrn = NULL;
> >      EntityInfoPtr entity;
> > +    struct nouveau_device *dev = NULL;
> > +    char *busid;
> > +    int chipset, ret;
> > +
> > +    if (device->vendor_id != 0x10DE)
> > +	return FALSE;
> > +
> > +    if (!xf86LoaderCheckSymbol("DRICreatePCIBusID")) {
> > +	xf86DrvMsg(-1, X_ERROR, "[drm] No DRICreatePCIBusID symbol\n");
> > +	return FALSE;
> > +    }
> > +    busid = DRICreatePCIBusID(device);
> > +
> > +    ret = nouveau_device_open(&dev, busid);
> > +    if (ret) {
> > +	xf86DrvMsg(-1, X_ERROR, "[drm] failed to open device\n");
> > +	free(busid);
> > +	return FALSE;
> > +    }
> > +
> > +    chipset = dev->chipset;
> > +    nouveau_device_close(&dev);
> > +
> > +    ret = drmCheckModesettingSupported(busid);
> > +    free(busid);
> > +    if (ret) {
> > +	xf86DrvMsg(-1, X_ERROR, "[drm] KMS not enabled\n");
> > +	return FALSE;
> > +    }
> > +
> > +    switch (chipset & 0xf0) {
> > +    case 0x00:
> > +    case 0x10:
> > +    case 0x20:
> > +	xf86DrvMsg(-1, X_NOTICE, "Too old chipset: NV%02x\n", chipset);
> > +	return FALSE;
> > +    case 0x30:
> > +    case 0x40:
> > +    case 0x60:
> > +    case 0x50:
> > +    case 0x80:
> > +    case 0x90:
> > +    case 0xa0:
> > +    case 0xc0:
> 0xd0 should be added here, there's NVD9 already.

There's no point in adding it now - mesa does not support it...
(see nouveau_drm_screen_create in src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c)

> > +	xf86DrvMsg(-1, X_INFO, "Detected chipset: NV%02x\n", chipset);
> > +	break;
> > +    default:
> > +	xf86DrvMsg(-1, X_ERROR, "Unknown chipset: NV%02x\n", chipset);
> > +	return FALSE;
> > +    }
> >
> >      scrn = xf86ConfigPciEntity(scrn, 0, entity_num,
> > nouveau_xorg_pci_devices,
> >  			       NULL, NULL, NULL, NULL, NULL);
> 
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

  reply	other threads:[~2011-06-06  5:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16 19:51 [PATCH 2/2] xorg/nouveau: blacklist all pre NV30 cards Marcin Slusarz
2011-05-16 22:20 ` [PATCH v2 " Marcin Slusarz
     [not found]   ` <20110516222014.GH5456-OI9uyE9O0yo@public.gmane.org>
2011-06-05 19:06     ` Marcin Slusarz
2011-06-05 19:10       ` [Nouveau] " Stéphane Marchesin
2011-06-05 19:15         ` Maarten Maathuis
2011-06-05 19:46           ` Marcin Slusarz
2011-06-05 19:54             ` Maarten Maathuis
2011-06-05 20:31               ` [PATCH v3 " Marcin Slusarz
     [not found]                 ` <20110605203159.GA26259-OI9uyE9O0yo@public.gmane.org>
2011-06-05 21:43                   ` Marcin Kościelnicki
2011-06-06  5:51                     ` Marcin Slusarz [this message]
2011-06-19 22:28                   ` Marcin Slusarz
2011-06-05 19:22       ` [PATCH v2 " Patrick Baggett
2011-06-05 19:23         ` Maarten Maathuis
2011-06-05 20:35         ` Marcin Slusarz

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=20110606055107.GA3758@joi.lan \
    --to=marcin.slusarz@gmail.com \
    --cc=koriakin@0x04.net \
    --cc=mesa-dev@lists.freedesktop.org \
    --cc=nouveau@lists.freedesktop.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.