gallium: implement get_device_vendor() for existing drivers
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 22 Mar 2015 06:21:01 +0000 (07:21 +0100)
committerTom Stellard <thomas.stellard@amd.com>
Mon, 23 Mar 2015 13:25:34 +0000 (13:25 +0000)
The only hackish ones are llvmpipe and softpipe, which currently return
the same string as for get_vendor(), while ideally they should return
the CPU vendor.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
13 files changed:
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/noop/noop_pipe.c
src/gallium/drivers/nouveau/nouveau_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/rbug/rbug_screen.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/drivers/trace/tr_screen.c
src/gallium/drivers/vc4/vc4_screen.c

index cdcc0daf2fbd8e4ff5d91660e6e1ab772826b6d9..1e4708935ff6668a7eb646185364c510b6f146ba 100644 (file)
@@ -95,6 +95,13 @@ fd_screen_get_vendor(struct pipe_screen *pscreen)
        return "freedreno";
 }
 
+static const char *
+fd_screen_get_device_vendor(struct pipe_screen *pscreen)
+{
+       return "Qualcomm";
+}
+
+
 static uint64_t
 fd_screen_get_timestamp(struct pipe_screen *pscreen)
 {
@@ -531,6 +538,7 @@ fd_screen_create(struct fd_device *dev)
 
        pscreen->get_name = fd_screen_get_name;
        pscreen->get_vendor = fd_screen_get_vendor;
+       pscreen->get_device_vendor = fd_screen_get_device_vendor;
 
        pscreen->get_timestamp = fd_screen_get_timestamp;
 
index 50847e2b42a97d0f2637cf7c895fc227a3f40443..7216160bb22674a825d33f3d0d9da0ab7e47f09e 100644 (file)
@@ -54,6 +54,12 @@ i915_get_vendor(struct pipe_screen *screen)
    return "Mesa Project";
 }
 
+static const char *
+i915_get_device_vendor(struct pipe_screen *screen)
+{
+   return "Intel";
+}
+
 static const char *
 i915_get_name(struct pipe_screen *screen)
 {
@@ -548,6 +554,7 @@ i915_screen_create(struct i915_winsys *iws)
 
    is->base.get_name = i915_get_name;
    is->base.get_vendor = i915_get_vendor;
+   is->base.get_device_vendor = i915_get_device_vendor;
    is->base.get_param = i915_get_param;
    is->base.get_shader_param = i915_get_shader_param;
    is->base.get_paramf = i915_get_paramf;
index bf0a84a44eb4ae95f1a7762419e0157c2a2e7265..80ea4c75241dac27d3a52e6ecff87ba76d2409df 100644 (file)
@@ -514,6 +514,12 @@ ilo_get_vendor(struct pipe_screen *screen)
    return "LunarG, Inc.";
 }
 
+static const char *
+ilo_get_device_vendor(struct pipe_screen *screen)
+{
+   return "Intel";
+}
+
 static const char *
 ilo_get_name(struct pipe_screen *screen)
 {
@@ -844,6 +850,7 @@ ilo_screen_create(struct intel_winsys *ws)
    is->base.destroy = ilo_screen_destroy;
    is->base.get_name = ilo_get_name;
    is->base.get_vendor = ilo_get_vendor;
+   is->base.get_device_vendor = ilo_get_device_vendor;
    is->base.get_param = ilo_get_param;
    is->base.get_paramf = ilo_get_paramf;
    is->base.get_shader_param = ilo_get_shader_param;
index 3387d3a047fd0296362d1b5297e688b689cbbf15..4b4572587e59d221979e4f7b9ccd0781ca14d3e5 100644 (file)
@@ -589,6 +589,7 @@ llvmpipe_create_screen(struct sw_winsys *winsys)
 
    screen->base.get_name = llvmpipe_get_name;
    screen->base.get_vendor = llvmpipe_get_vendor;
+   screen->base.get_device_vendor = llvmpipe_get_vendor; // TODO should be the CPU vendor
    screen->base.get_param = llvmpipe_get_param;
    screen->base.get_shader_param = llvmpipe_get_shader_param;
    screen->base.get_paramf = llvmpipe_get_paramf;
index 8cb8c702c0ea1924991d8cba892558a95a76e001..6fb22773c69ff1963cddf2972686b3b971c1fdc6 100644 (file)
@@ -305,6 +305,11 @@ static const char *noop_get_vendor(struct pipe_screen* pscreen)
        return "X.Org";
 }
 
+static const char *noop_get_device_vendor(struct pipe_screen* pscreen)
+{
+       return "NONE";
+}
+
 static const char *noop_get_name(struct pipe_screen* pscreen)
 {
        return "NOOP";
@@ -376,6 +381,7 @@ struct pipe_screen *noop_screen_create(struct pipe_screen *oscreen)
        screen->destroy = noop_destroy_screen;
        screen->get_name = noop_get_name;
        screen->get_vendor = noop_get_vendor;
+       screen->get_device_vendor = noop_get_device_vendor;
        screen->get_param = noop_get_param;
        screen->get_shader_param = noop_get_shader_param;
        screen->get_paramf = noop_get_paramf;
index 517978d885884807e9e16699c4f2a0a78f7e7369..b4f1413fd8badb6ccdc08adc61a8a4c18962040b 100644 (file)
@@ -43,6 +43,12 @@ nouveau_screen_get_vendor(struct pipe_screen *pscreen)
        return "nouveau";
 }
 
+static const char *
+nouveau_screen_get_device_vendor(struct pipe_screen *pscreen)
+{
+       return "NVIDIA";
+}
+
 static uint64_t
 nouveau_screen_get_timestamp(struct pipe_screen *pscreen)
 {
@@ -182,6 +188,7 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
 
        pscreen->get_name = nouveau_screen_get_name;
        pscreen->get_vendor = nouveau_screen_get_vendor;
+       pscreen->get_device_vendor = nouveau_screen_get_device_vendor;
 
        pscreen->get_timestamp = nouveau_screen_get_timestamp;
 
index 752d7e59fd5f60100a58e11461d1753016b273e0..a7b59d8bfbbafe8462b62a2f3a0ec09e0cebf665 100644 (file)
@@ -47,6 +47,11 @@ static const char* r300_get_vendor(struct pipe_screen* pscreen)
     return "X.Org R300 Project";
 }
 
+static const char* r300_get_device_vendor(struct pipe_screen* pscreen)
+{
+    return "ATI";
+}
+
 static const char* chip_families[] = {
     "unknown",
     "ATI R300",
@@ -695,6 +700,7 @@ struct pipe_screen* r300_screen_create(struct radeon_winsys *rws)
     r300screen->screen.destroy = r300_destroy_screen;
     r300screen->screen.get_name = r300_get_name;
     r300screen->screen.get_vendor = r300_get_vendor;
+    r300screen->screen.get_device_vendor = r300_get_device_vendor;
     r300screen->screen.get_param = r300_get_param;
     r300screen->screen.get_shader_param = r300_get_shader_param;
     r300screen->screen.get_paramf = r300_get_paramf;
index dabe53c60a721a1cc860f534e8cb3206592fd1c3..0ef5fc24d997feb17e0ebed89e44f807eddc5aae 100644 (file)
@@ -332,6 +332,11 @@ static const char* r600_get_vendor(struct pipe_screen* pscreen)
        return "X.Org";
 }
 
+static const char* r600_get_device_vendor(struct pipe_screen* pscreen)
+{
+       return "AMD";
+}
+
 static const char* r600_get_name(struct pipe_screen* pscreen)
 {
        struct r600_common_screen *rscreen = (struct r600_common_screen*)pscreen;
@@ -825,6 +830,7 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
 
        rscreen->b.get_name = r600_get_name;
        rscreen->b.get_vendor = r600_get_vendor;
+       rscreen->b.get_device_vendor = r600_get_device_vendor;
        rscreen->b.get_compute_param = r600_get_compute_param;
        rscreen->b.get_paramf = r600_get_paramf;
        rscreen->b.get_driver_query_info = r600_get_driver_query_info;
index 731cc60047ac053a59677f4330318584e8eb49b9..d5a3164e2178511a23839fe7b21891b7c4273a28 100644 (file)
@@ -68,6 +68,15 @@ rbug_screen_get_vendor(struct pipe_screen *_screen)
    return screen->get_vendor(screen);
 }
 
+static const char *
+rbug_screen_get_device_vendor(struct pipe_screen *_screen)
+{
+   struct rbug_screen *rb_screen = rbug_screen(_screen);
+   struct pipe_screen *screen = rb_screen->screen;
+
+   return screen->get_device_vendor(screen);
+}
+
 static int
 rbug_screen_get_param(struct pipe_screen *_screen,
                       enum pipe_cap param)
@@ -267,6 +276,7 @@ rbug_screen_create(struct pipe_screen *screen)
    rb_screen->base.destroy = rbug_screen_destroy;
    rb_screen->base.get_name = rbug_screen_get_name;
    rb_screen->base.get_vendor = rbug_screen_get_vendor;
+   rb_screen->base.get_device_vendor = rbug_screen_get_device_vendor;
    rb_screen->base.get_param = rbug_screen_get_param;
    rb_screen->base.get_shader_param = rbug_screen_get_shader_param;
    rb_screen->base.get_paramf = rbug_screen_get_paramf;
index a269328aff8704e5c21aa8276ca7131bd369ec49..d289e28a6f8ff462f0c28afc66a92dc9acca3acb 100644 (file)
@@ -427,6 +427,7 @@ softpipe_create_screen(struct sw_winsys *winsys)
 
    screen->base.get_name = softpipe_get_name;
    screen->base.get_vendor = softpipe_get_vendor;
+   screen->base.get_device_vendor = softpipe_get_vendor; // TODO should be the CPU vendor
    screen->base.get_param = softpipe_get_param;
    screen->base.get_shader_param = softpipe_get_shader_param;
    screen->base.get_paramf = softpipe_get_paramf;
index 7b01d35a93a9326b5f08347f415b3584ed385f78..ab26413064eb8812b4c339ee1bd44b31d660abba 100644 (file)
@@ -635,6 +635,7 @@ svga_screen_create(struct svga_winsys_screen *sws)
    screen->destroy = svga_destroy_screen;
    screen->get_name = svga_get_name;
    screen->get_vendor = svga_get_vendor;
+   screen->get_device_vendor = svga_get_vendor; // TODO actual device vendor
    screen->get_param = svga_get_param;
    screen->get_shader_param = svga_get_shader_param;
    screen->get_paramf = svga_get_paramf;
index 3a82cc4d56c58fd8ab4b619e078389d11b0b73f7..266626defa88154470ab0ad88514f221e801b10c 100644 (file)
@@ -82,6 +82,27 @@ trace_screen_get_vendor(struct pipe_screen *_screen)
 }
 
 
+static const char *
+trace_screen_get_device_vendor(struct pipe_screen *_screen)
+{
+   struct trace_screen *tr_scr = trace_screen(_screen);
+   struct pipe_screen *screen = tr_scr->screen;
+   const char *result;
+
+   trace_dump_call_begin("pipe_screen", "get_device_vendor");
+
+   trace_dump_arg(ptr, screen);
+
+   result = screen->get_device_vendor(screen);
+
+   trace_dump_ret(string, result);
+
+   trace_dump_call_end();
+
+   return result;
+}
+
+
 static int
 trace_screen_get_param(struct pipe_screen *_screen,
                        enum pipe_cap param)
@@ -470,6 +491,7 @@ trace_screen_create(struct pipe_screen *screen)
    tr_scr->base.destroy = trace_screen_destroy;
    tr_scr->base.get_name = trace_screen_get_name;
    tr_scr->base.get_vendor = trace_screen_get_vendor;
+   tr_scr->base.get_device_vendor = trace_screen_get_device_vendor;
    tr_scr->base.get_param = trace_screen_get_param;
    tr_scr->base.get_shader_param = trace_screen_get_shader_param;
    tr_scr->base.get_paramf = trace_screen_get_paramf;
index 0be8ec2c980a11a57a3e0ac0a363fd23610a7f55..03dd865463109e61062e741c4f52dbf059d1b85b 100644 (file)
@@ -472,6 +472,7 @@ vc4_screen_create(int fd)
 
         pscreen->get_name = vc4_screen_get_name;
         pscreen->get_vendor = vc4_screen_get_vendor;
+        pscreen->get_device_vendor = vc4_screen_get_vendor;
 
         return pscreen;
 }