pipe-loader: add support for non-pci (platform) devices
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 11 Jan 2014 05:19:36 +0000 (05:19 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sat, 18 Jan 2014 18:52:07 +0000 (18:52 +0000)
Culled out of the "loader: refactor duplicated code into loader util lib"
patch by Rob Clark.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/gallium/auxiliary/pipe-loader/pipe_loader.h
src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
src/gallium/state_trackers/clover/core/device.cpp

index 34e257e34418153b969f9f6afa1a432087fcc8be..e0525dfbe02a1b27675d75ae0f46c04c8f812bdd 100644 (file)
@@ -44,6 +44,7 @@ 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
 };
 
index 2a50236e27cb779ba6698bf8e75899be62cd20e3..d70a428b910a50e9e4eef43b2d52a220fe286c4e 100644 (file)
@@ -121,6 +121,8 @@ pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd)
       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;
index e5e429a44714436548112137588d633f077a76e8..76a49d0fd7cf6c0a15d70726f8d567ab7aab7d1f 100644 (file)
@@ -63,6 +63,7 @@ device::type() const {
    case PIPE_LOADER_DEVICE_SOFTWARE:
       return CL_DEVICE_TYPE_CPU;
    case PIPE_LOADER_DEVICE_PCI:
+   case PIPE_LOADER_DEVICE_PLATFORM:
       return CL_DEVICE_TYPE_GPU;
    default:
       assert(0);
@@ -74,6 +75,7 @@ cl_uint
 device::vendor_id() const {
    switch (ldev->type) {
    case PIPE_LOADER_DEVICE_SOFTWARE:
+   case PIPE_LOADER_DEVICE_PLATFORM:
       return 0;
    case PIPE_LOADER_DEVICE_PCI:
       return ldev->u.pci.vendor_id;