[Mesa-dev] [PATCH v3 2/8] gallium-loader: Don't worry about PCI IDs in gallium-loader

Kristian Høgsberg krh at bitplanet.net
Wed Feb 5 02:18:12 CET 2014


There's no reason to look this up in the gallium loader code now that
the generic loader handles all this.  This allows us to not export
loader_get_pci_id_for_fd() from loader.c.

Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
---
 src/gallium/auxiliary/pipe-loader/pipe_loader.h     | 16 ----------------
 src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c | 10 +---------
 src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c  |  1 -
 src/loader/loader.c                                 |  2 +-
 src/loader/loader.h                                 |  3 ---
 5 files changed, 2 insertions(+), 30 deletions(-)

diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.h b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
index e0525df..68aacf9 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.h
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.h
@@ -41,26 +41,10 @@ extern "C" {
 
 struct pipe_screen;
 
-enum pipe_loader_device_type {
-   PIPE_LOADER_DEVICE_SOFTWARE,
-   PIPE_LOADER_DEVICE_PCI,
-   PIPE_LOADER_DEVICE_PLATFORM,
-   NUM_PIPE_LOADER_DEVICE_TYPES
-};
-
 /**
  * A device known to the pipe loader.
  */
 struct pipe_loader_device {
-   enum pipe_loader_device_type type;
-
-   union {
-      struct {
-         int vendor_id;
-         int chip_id;
-      } pci;
-   } u; /**< Discriminated by \a type */
-
    const char *driver_name;
    const struct pipe_loader_ops *ops;
 };
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index d6869fd..b201bc0 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -116,15 +116,7 @@ boolean
 pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd)
 {
    struct pipe_loader_drm_device *ddev = CALLOC_STRUCT(pipe_loader_drm_device);
-   int vendor_id, chip_id;
-
-   if (loader_get_pci_id_for_fd(fd, &vendor_id, &chip_id)) {
-      ddev->base.type = PIPE_LOADER_DEVICE_PCI;
-      ddev->base.u.pci.vendor_id = vendor_id;
-      ddev->base.u.pci.chip_id = chip_id;
-   } else {
-      ddev->base.type = PIPE_LOADER_DEVICE_PLATFORM;
-   }
+
    ddev->base.ops = &pipe_loader_drm_ops;
    ddev->fd = fd;
 
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
index 95a4f84..c1d5f66 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c
@@ -59,7 +59,6 @@ pipe_loader_sw_probe(struct pipe_loader_device **devs, int ndev)
       if (i < ndev) {
          struct pipe_loader_sw_device *sdev = CALLOC_STRUCT(pipe_loader_sw_device);
 
-         sdev->base.type = PIPE_LOADER_DEVICE_SOFTWARE;
          sdev->base.driver_name = "swrast";
          sdev->base.ops = &pipe_loader_sw_ops;
          sdev->ws = backends[i]();
diff --git a/src/loader/loader.c b/src/loader/loader.c
index 4119f77..51bac3e 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -157,7 +157,7 @@ udev_device_new_from_fd(struct udev *udev, int fd)
    return device;
 }
 
-int
+static int
 loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id, char **driver)
 {
    struct udev *udev = NULL;
diff --git a/src/loader/loader.h b/src/loader/loader.h
index 5771280..30fa26e 100644
--- a/src/loader/loader.h
+++ b/src/loader/loader.h
@@ -32,9 +32,6 @@
 #define _LOADER_DRI          (1 << 0)
 #define _LOADER_GALLIUM      (1 << 1)
 
-int
-loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id, char **driver);
-
 char *
 loader_get_driver_for_fd(int fd, unsigned driver_types);
 
-- 
1.8.4.2



More information about the mesa-dev mailing list