diff options
author | Ben Widawsky <[email protected]> | 2016-02-08 12:42:29 -0800 |
---|---|---|
committer | Ben Widawsky <[email protected]> | 2016-03-11 11:17:28 -0800 |
commit | d1ab544bb883d040576f0bd7f28ad3cda4c8ae05 (patch) | |
tree | 18b767fbfa6d3f9724486124e6d06b23aaa3c574 /src/mesa | |
parent | 5e6a43a001db0bb333deb3d003df11ab8ef96a21 (diff) |
i965/chv: Display proper branding
"Braswell" is a Cherryview based *thing*. It unfortunately requires extra
information to determine its marketing name. Unlike all previous products, and
hopefully all future ones, there is no unique 1:1 mapping of PCI device ID to
brand string.
I put up a fight about adding any complexity to our GL renderer string code for
a very long time. However, a wise man made a comment to me that I couldn't argue
with: if a user installs Windows on their hardware, the brand string should be
the same as what we display in Linux. The Windows driver apparently does this
check, so we should too.
Note that I did manage to find a good use for this info anyway in the compute
shader thread counts.
v2: memcpy instead of strncpy, and some minor changes (Matt)
Signed-off-by: Ben Widawsky <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Jordan Justen <[email protected]
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 31 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.h | 3 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 2 |
3 files changed, 31 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index defcae521a8..2d480d02366 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -77,13 +77,27 @@ const char *const brw_vendor_string = "Intel Open Source Technology Center"; +static const char * +get_bsw_model(const struct intel_screen *intelScreen) +{ + switch (intelScreen->eu_total) { + case 16: + return "405"; + case 12: + return "400"; + default: + return " "; + } +} + const char * -brw_get_renderer_string(unsigned deviceID) +brw_get_renderer_string(const struct intel_screen *intelScreen) { const char *chipset; static char buffer[128]; + char *bsw = NULL; - switch (deviceID) { + switch (intelScreen->deviceID) { #undef CHIPSET #define CHIPSET(id, symbol, str) case id: chipset = str; break; #include "pci_ids/i965_pci_ids.h" @@ -92,7 +106,18 @@ brw_get_renderer_string(unsigned deviceID) break; } + /* Braswell branding is funny, so we have to fix it up here */ + if (intelScreen->deviceID == 0x22B1) { + bsw = strdup(chipset); + char *needle = strstr(bsw, "XXX"); + if (needle) { + memcpy(needle, get_bsw_model(intelScreen), 3); + chipset = bsw; + } + } + (void) driGetRendererString(buffer, chipset, 0); + free(bsw); return buffer; } @@ -107,7 +132,7 @@ intel_get_string(struct gl_context * ctx, GLenum name) case GL_RENDERER: return - (GLubyte *) brw_get_renderer_string(brw->intelScreen->deviceID); + (GLubyte *) brw_get_renderer_string(brw->intelScreen); default: return NULL; diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 88f0d49a5ff..a953745b114 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -1341,7 +1341,8 @@ extern void intelInitClearFuncs(struct dd_function_table *functions); */ extern const char *const brw_vendor_string; -extern const char *brw_get_renderer_string(unsigned deviceID); +extern const char * +brw_get_renderer_string(const struct intel_screen *intelScreen); enum { DRI_CONF_BO_REUSE_DISABLED, diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 64b8524c64b..c6eb50aaba8 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -891,7 +891,7 @@ brw_query_renderer_string(__DRIscreen *psp, int param, const char **value) value[0] = brw_vendor_string; return 0; case __DRI2_RENDERER_DEVICE_ID: - value[0] = brw_get_renderer_string(intelScreen->deviceID); + value[0] = brw_get_renderer_string(intelScreen); return 0; default: break; |