diff options
author | Ben Widawsky <[email protected]> | 2016-04-07 10:53:13 -0700 |
---|---|---|
committer | Ben Widawsky <[email protected]> | 2016-04-08 11:52:29 -0700 |
commit | cc01b63d730d151097dd6c3d2030a4731e09a393 (patch) | |
tree | abd6f5d367bfabd260ab246d9c8b1154b7170241 /src/mesa | |
parent | 4213b00e30d4d70823dca25e299e7b034c91d94c (diff) |
i965: Fix eu/subslice warning
Older gen platforms do not actually return a value for sublice and eu total
(IMO, confusingly) they return -ENODEV. This patch defers the SSEU setup until
we have the actual GPU generation to avoid useless warnings when running on
older platforms with older kernels.
Reported-by: Mark Janes <[email protected]>
Signed-off-by: Ben Widawsky <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 8c687b3ae1c..b596017c654 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -1081,13 +1081,21 @@ intelDestroyBuffer(__DRIdrawable * driDrawPriv) static void intel_detect_sseu(struct intel_screen *intelScreen) { + assert(intelScreen->devinfo->gen >= 8); + int ret; + intelScreen->subslice_total = -1; intelScreen->eu_total = -1; - intel_get_param(intelScreen->driScrnPriv, I915_PARAM_SUBSLICE_TOTAL, - &intelScreen->subslice_total); - intel_get_param(intelScreen->driScrnPriv, - I915_PARAM_EU_TOTAL, &intelScreen->eu_total); + ret = intel_get_param(intelScreen->driScrnPriv, I915_PARAM_SUBSLICE_TOTAL, + &intelScreen->subslice_total); + if (ret != -EINVAL) + goto err_out; + + ret = intel_get_param(intelScreen->driScrnPriv, + I915_PARAM_EU_TOTAL, &intelScreen->eu_total); + if (ret != -EINVAL) + goto err_out; /* Without this information, we cannot get the right Braswell brandstrings, * and we have to use conservative numbers for GPGPU on many platforms, but @@ -1096,13 +1104,19 @@ intel_detect_sseu(struct intel_screen *intelScreen) if (intelScreen->subslice_total == -1 || intelScreen->eu_total == -1) _mesa_warning(NULL, "Kernel 4.1 required to properly query GPU properties.\n"); + + return; + +err_out: + intelScreen->subslice_total = -1; + intelScreen->eu_total = -1; + _mesa_warning(NULL, "Failed to query GPU properties.\n"); } static bool intel_init_bufmgr(struct intel_screen *intelScreen) { __DRIscreen *spriv = intelScreen->driScrnPriv; - bool devid_override = getenv("INTEL_DEVID_OVERRIDE") != NULL; intelScreen->no_hw = getenv("INTEL_NO_HW") != NULL; @@ -1120,12 +1134,6 @@ intel_init_bufmgr(struct intel_screen *intelScreen) return false; } - /* Everything below this is for real hardware only */ - if (intelScreen->no_hw || devid_override) - return true; - - intel_detect_sseu(intelScreen); - return true; } @@ -1480,6 +1488,10 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) intelScreen->hw_has_swizzling = intel_detect_swizzling(intelScreen); intelScreen->hw_has_timestamp = intel_detect_timestamp(intelScreen); + /* GENs prior to 8 do not support EU/Subslice info */ + if (intelScreen->devinfo->gen >= 8) + intel_detect_sseu(intelScreen); + const char *force_msaa = getenv("INTEL_FORCE_MSAA"); if (force_msaa) { intelScreen->winsys_msaa_samples_override = |