open-src/driver/xf86-video-nv/pci-match.patch
changeset 705 24ca414edbff
parent 704 f9b973ecc909
child 706 43bb5cf562a2
equal deleted inserted replaced
704:f9b973ecc909 705:24ca414edbff
     1 From e387bf31aae78d4447b4af555a8d09f79f72e6e7 Mon Sep 17 00:00:00 2001
       
     2 From: Aaron Plattner <[email protected]>
       
     3 Date: Fri, 17 Oct 2008 20:45:18 -0700
       
     4 Subject: [PATCH] Only match PCI display devices in our display driver.
       
     5 
       
     6 Apparently the server needs the driver to tell it that no, we really don't want
       
     7 screen sections on our NIC, USB hubs, bridge devices, etc.
       
     8 
       
     9 Stop whining about PROBE_DETECT in G80 PreInit and just bail out instead.
       
    10 
       
    11 Bug #18099: Xorg -configure tries to create a screen for every nvidia device.
       
    12 ---
       
    13  src/g80_driver.c |    7 ++-----
       
    14  src/nv_driver.c  |   19 +++++++++++++++----
       
    15  2 files changed, 17 insertions(+), 9 deletions(-)
       
    16 
       
    17 diff --git a/src/g80_driver.c b/src/g80_driver.c
       
    18 index 50d55a0..ad8a424 100644
       
    19 --- a/src/g80_driver.c
       
    20 +++ b/src/g80_driver.c
       
    21 @@ -206,11 +206,8 @@ #endif
       
    22      CARD32 tmp;
       
    23      memType BAR1sizeKB;
       
    24  
       
    25 -    if(flags & PROBE_DETECT) {
       
    26 -        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
       
    27 -                "G80 PROBE_DETECT unimplemented\n");
       
    28 -        return FALSE;
       
    29 -    }
       
    30 +    if(flags & PROBE_DETECT)
       
    31 +        return TRUE;
       
    32  
       
    33      /* Check the number of entities, and fail if it isn't one. */
       
    34      if(pScrn->numEntities != 1)
       
    35 diff --git a/src/nv_driver.c b/src/nv_driver.c
       
    36 index 831e90b..faf73a9 100644
       
    37 --- a/src/nv_driver.c
       
    38 +++ b/src/nv_driver.c
       
    39 @@ -77,11 +77,22 @@ static Bool	NVModeInit(ScrnInfoPtr pScrn
       
    40  static Bool	NVSetModeVBE(ScrnInfoPtr pScrn, DisplayModePtr pMode);
       
    41  
       
    42  #if XSERVER_LIBPCIACCESS
       
    43 -/* For now, just match any NVIDIA PCI device and sort through them in the probe
       
    44 - * routine */
       
    45 +/* For now, just match any NVIDIA display device and sort through them in the
       
    46 + * probe routine */
       
    47 +
       
    48 +/*
       
    49 + * libpciaccess's masks are shifted by 8 bits compared to the ones in xf86Pci.h.
       
    50 + */
       
    51 +#define LIBPCIACCESS_CLASS_SHIFT (PCI_CLASS_SHIFT - 8)
       
    52 +#define LIBPCIACCESS_CLASS_MASK (PCI_CLASS_MASK >> 8)
       
    53 +
       
    54  static const struct pci_id_match NVPciIdMatchList[] = {
       
    55 -    { PCI_VENDOR_NVIDIA, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0 },
       
    56 -    { PCI_VENDOR_NVIDIA_SGS, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0},
       
    57 +    { PCI_VENDOR_NVIDIA, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
       
    58 +      PCI_CLASS_DISPLAY << LIBPCIACCESS_CLASS_SHIFT, LIBPCIACCESS_CLASS_MASK, 0 },
       
    59 +
       
    60 +    { PCI_VENDOR_NVIDIA_SGS, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
       
    61 +      PCI_CLASS_DISPLAY << LIBPCIACCESS_CLASS_SHIFT, LIBPCIACCESS_CLASS_MASK, 0 },
       
    62 +
       
    63      { 0, 0, 0 }
       
    64  };
       
    65  #endif
       
    66 -- 
       
    67 1.4.1
       
    68