gallium: add CAPs returning PCI device location
authorMarek Olšák <marek.olsak@amd.com>
Mon, 29 Feb 2016 19:22:37 +0000 (20:22 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 9 Mar 2016 14:02:28 +0000 (15:02 +0100)
Reviewed-by: Brian Paul <brianp@vmware.com>
16 files changed:
src/gallium/docs/source/screen.rst
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/ilo/ilo_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/nouveau/nv30/nv30_screen.c
src/gallium/drivers/nouveau/nv50/nv50_screen.c
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_defines.h

index b5d691f4f7e67dca6bf7963775f6c495c5681fc6..46ec3815412aef9619ed1b1f40de2c6a4ad9d329 100644 (file)
@@ -319,6 +319,10 @@ The integer capabilities:
   adjusted appropriately.
 * ``PIPE_CAP_QUERY_BUFFER_OBJECT``: Driver supports
   context::get_query_result_resource callback.
+* ``PIPE_CAP_PCI_GROUP``: Return the PCI segment group number.
+* ``PIPE_CAP_PCI_BUS``: Return the PCI bus number.
+* ``PIPE_CAP_PCI_DEVICE``: Return the PCI device number.
+* ``PIPE_CAP_PCI_FUNCTION``: Return the PCI function number.
 
 
 .. _pipe_capf:
index 1565a1da38d2c0edc13b755f5835182d84b76581..d47cb07f10b0fa23bd27e8607ea430315daa3a80 100644 (file)
@@ -166,6 +166,10 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
        case PIPE_CAP_COMPUTE:
        case PIPE_CAP_QUERY_MEMORY_INFO:
+       case PIPE_CAP_PCI_GROUP:
+       case PIPE_CAP_PCI_BUS:
+       case PIPE_CAP_PCI_DEVICE:
+       case PIPE_CAP_PCI_FUNCTION:
                return 0;
 
        case PIPE_CAP_SM3:
index 8d010f9dc8cd4edfbed463db43061324eadac6e6..f4aa310ecdce35a18fe3bbbbf59fe09683fc24b7 100644 (file)
@@ -265,6 +265,10 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
    case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
    case PIPE_CAP_QUERY_MEMORY_INFO:
+   case PIPE_CAP_PCI_GROUP:
+   case PIPE_CAP_PCI_BUS:
+   case PIPE_CAP_PCI_DEVICE:
+   case PIPE_CAP_PCI_FUNCTION:
       return 0;
 
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index ef9da6b8315ba2c715191d1aa7d491449826f00f..548d215c7185c0247c56ff41c672088f26140586 100644 (file)
@@ -493,6 +493,10 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
    case PIPE_CAP_QUERY_BUFFER_OBJECT:
    case PIPE_CAP_QUERY_MEMORY_INFO:
+   case PIPE_CAP_PCI_GROUP:
+   case PIPE_CAP_PCI_BUS:
+   case PIPE_CAP_PCI_DEVICE:
+   case PIPE_CAP_PCI_FUNCTION:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 2c66bf46332874dca2fb8d4d6792b21dbdcf5004..2529b546564914888e06ec9ec8434565f0cc5911 100644 (file)
@@ -315,6 +315,10 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
    case PIPE_CAP_QUERY_BUFFER_OBJECT:
    case PIPE_CAP_QUERY_MEMORY_INFO:
+   case PIPE_CAP_PCI_GROUP:
+   case PIPE_CAP_PCI_BUS:
+   case PIPE_CAP_PCI_DEVICE:
+   case PIPE_CAP_PCI_FUNCTION:
       return 0;
    }
    /* should only get here on unhandled cases */
index 5be7a3dab7640c23b879f47aa2017642df2c09b8..b105c6aeb80eb4b0f8885bdcaca0de93965070b3 100644 (file)
@@ -188,6 +188,10 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
    case PIPE_CAP_QUERY_BUFFER_OBJECT:
    case PIPE_CAP_QUERY_MEMORY_INFO:
+   case PIPE_CAP_PCI_GROUP:
+   case PIPE_CAP_PCI_BUS:
+   case PIPE_CAP_PCI_DEVICE:
+   case PIPE_CAP_PCI_FUNCTION:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 0bd5de91d1fe9504522d27a3a0b63135e4bf9b55..28e0ed3c225790717a39100abe7398ab44e6bd7a 100644 (file)
@@ -232,6 +232,10 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
    case PIPE_CAP_QUERY_BUFFER_OBJECT:
    case PIPE_CAP_QUERY_MEMORY_INFO:
+   case PIPE_CAP_PCI_GROUP:
+   case PIPE_CAP_PCI_BUS:
+   case PIPE_CAP_PCI_DEVICE:
+   case PIPE_CAP_PCI_FUNCTION:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 37620ea8ba69530a2fa43a17eac9a3b2c94e9d0f..114d868e919dd69f7336b909a6806bac7523ca6b 100644 (file)
@@ -225,6 +225,10 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
    case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
    case PIPE_CAP_QUERY_MEMORY_INFO:
+   case PIPE_CAP_PCI_GROUP:
+   case PIPE_CAP_PCI_BUS:
+   case PIPE_CAP_PCI_DEVICE:
+   case PIPE_CAP_PCI_FUNCTION:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 7fad7ad6a43005ff53bca6f6afce0a78d1720618..1c3bb64f0e4025543f4b8e81787a6c9b2e6b6796 100644 (file)
@@ -259,6 +259,14 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
                 return r300screen->info.vram_size >> 20;
         case PIPE_CAP_UMA:
                 return 0;
+        case PIPE_CAP_PCI_GROUP:
+            return r300screen->info.pci_domain;
+        case PIPE_CAP_PCI_BUS:
+            return r300screen->info.pci_bus;
+        case PIPE_CAP_PCI_DEVICE:
+            return r300screen->info.pci_dev;
+        case PIPE_CAP_PCI_FUNCTION:
+            return r300screen->info.pci_func;
     }
     return 0;
 }
index 7d256dbe0067d1056453a3b7e18d884d2d4a851e..7018088d204531431a421d8b2d4796d54528004b 100644 (file)
@@ -450,6 +450,14 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
                return 0;
        case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
                return rscreen->b.chip_class >= R700;
+       case PIPE_CAP_PCI_GROUP:
+               return rscreen->b.info.pci_domain;
+       case PIPE_CAP_PCI_BUS:
+               return rscreen->b.info.pci_bus;
+       case PIPE_CAP_PCI_DEVICE:
+               return rscreen->b.info.pci_dev;
+       case PIPE_CAP_PCI_FUNCTION:
+               return rscreen->b.info.pci_func;
        }
        return 0;
 }
index 58e7f3acd67c9c56ca0c4300736a6e14405f4417..8b50a49cba06dc863421786f066f829f4e91f236 100644 (file)
@@ -429,6 +429,14 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
                return sscreen->b.info.vram_size >> 20;
        case PIPE_CAP_UMA:
                return 0;
+       case PIPE_CAP_PCI_GROUP:
+               return sscreen->b.info.pci_domain;
+       case PIPE_CAP_PCI_BUS:
+               return sscreen->b.info.pci_bus;
+       case PIPE_CAP_PCI_DEVICE:
+               return sscreen->b.info.pci_dev;
+       case PIPE_CAP_PCI_FUNCTION:
+               return sscreen->b.info.pci_func;
        }
        return 0;
 }
index 097ffe6f9209974e001164dd23d5000ebd0eba9f..bfd3598fc57b1bc6d45605f907b91324cbbb08cf 100644 (file)
@@ -266,6 +266,10 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
    case PIPE_CAP_QUERY_BUFFER_OBJECT:
    case PIPE_CAP_QUERY_MEMORY_INFO:
+   case PIPE_CAP_PCI_GROUP:
+   case PIPE_CAP_PCI_BUS:
+   case PIPE_CAP_PCI_DEVICE:
+   case PIPE_CAP_PCI_FUNCTION:
       return 0;
    }
    /* should only get here on unhandled cases */
index feb5103a3f6bf51305479ad9f46e68b6a093b54c..bcc512041f779c0eb3298bc395306b2c516c386d 100644 (file)
@@ -360,6 +360,10 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_STRING_MARKER:
    case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
    case PIPE_CAP_QUERY_MEMORY_INFO:
+   case PIPE_CAP_PCI_GROUP:
+   case PIPE_CAP_PCI_BUS:
+   case PIPE_CAP_PCI_DEVICE:
+   case PIPE_CAP_PCI_FUNCTION:
       return 0;
    case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
       return 64;
index a4b3efcfda3366efa952e1bb148783eacb0a2d58..92d910ba6a5930137032dc03b108515766b24914 100644 (file)
@@ -203,6 +203,10 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
         case PIPE_CAP_QUERY_BUFFER_OBJECT:
        case PIPE_CAP_QUERY_MEMORY_INFO:
+       case PIPE_CAP_PCI_GROUP:
+        case PIPE_CAP_PCI_BUS:
+        case PIPE_CAP_PCI_DEVICE:
+        case PIPE_CAP_PCI_FUNCTION:
                 return 0;
 
                 /* Stream output. */
index d3f4e259cad48e179ec366bf51c4b8ea700799bc..8126bdec40c960825d8d71957ac7a40add53aca0 100644 (file)
@@ -235,6 +235,10 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_COPY_BETWEEN_COMPRESSED_AND_PLAIN_FORMATS:
    case PIPE_CAP_STRING_MARKER:
    case PIPE_CAP_QUERY_MEMORY_INFO:
+   case PIPE_CAP_PCI_GROUP:
+   case PIPE_CAP_PCI_BUS:
+   case PIPE_CAP_PCI_DEVICE:
+   case PIPE_CAP_PCI_FUNCTION:
       return 0;
    case PIPE_CAP_VENDOR_ID:
       return 0x1af4;
index c9149bea309c8dfb73f7bf32f9246ea423b6702e..a490b3b98ea8b2311d9beda62d56c0892a39f2f6 100644 (file)
@@ -669,6 +669,10 @@ enum pipe_cap
    PIPE_CAP_SURFACE_REINTERPRET_BLOCKS,
    PIPE_CAP_QUERY_BUFFER_OBJECT,
    PIPE_CAP_QUERY_MEMORY_INFO,
+   PIPE_CAP_PCI_GROUP,
+   PIPE_CAP_PCI_BUS,
+   PIPE_CAP_PCI_DEVICE,
+   PIPE_CAP_PCI_FUNCTION,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)