diff options
author | Nanley Chery <nanley.g.chery@intel.com> | 2021-07-21 16:50:32 -0700 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-08-24 00:12:47 +0000 |
commit | 2944f49610e7f0d627a257216210afa668eb7a88 (patch) | |
tree | cc91ac41b0f2013f4ebf7b199b9c59dde107871e /src/mesa/drivers | |
parent | 7d59a66e3a4d011880faa44aca662514ccf5fdd8 (diff) |
intel: Parse INTEL_NO_HW for devinfo construction
This commit does several things:
* Unify code common to several drivers by evaluating INTEL_NO_HW within
intel_get_device_info_from_fd (suggested by Jordan).
* For drivers that keep a copy of the intel_device_info struct, a
separate copy of the no_hw field is now unnecessary. Remove them.
* Minimize kernel queries when INTEL_NO_HW is true. This is done for
code simplification, but we may find reason to undo this later on.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12007>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_batch.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_screen.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_screen.h | 1 |
3 files changed, 2 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_batch.c b/src/mesa/drivers/dri/i965/brw_batch.c index c3c1267b0ad..b51704f54e8 100644 --- a/src/mesa/drivers/dri/i965/brw_batch.c +++ b/src/mesa/drivers/dri/i965/brw_batch.c @@ -791,7 +791,7 @@ submit_batch(struct brw_context *brw, int in_fence_fd, int *out_fence_fd) brw_bo_unmap(batch->batch.bo); brw_bo_unmap(batch->state.bo); - if (!brw->screen->no_hw) { + if (!brw->screen->devinfo.no_hw) { /* The requirement for using I915_EXEC_NO_RELOC are: * * The addresses written in the objects must match the corresponding diff --git a/src/mesa/drivers/dri/i965/brw_screen.c b/src/mesa/drivers/dri/i965/brw_screen.c index 8d032797e8f..08f86ab7e3b 100644 --- a/src/mesa/drivers/dri/i965/brw_screen.c +++ b/src/mesa/drivers/dri/i965/brw_screen.c @@ -1889,8 +1889,6 @@ brw_init_bufmgr(struct brw_screen *screen) { __DRIscreen *dri_screen = screen->driScrnPriv; - screen->no_hw = env_var_as_boolean("INTEL_NO_HW", false); - bool bo_reuse = false; int bo_reuse_mode = driQueryOptioni(&screen->optionCache, "bo_reuse"); switch (bo_reuse_mode) { @@ -2003,7 +2001,7 @@ static bool brw_detect_pipelined_register(struct brw_screen *screen, int reg, uint32_t expected_value, bool reset) { - if (screen->no_hw) + if (screen->devinfo.no_hw) return false; struct brw_bo *results, *bo; @@ -2553,7 +2551,6 @@ __DRIconfig **brw_init_screen(__DRIscreen *dri_screen) const struct intel_device_info *devinfo = &screen->devinfo; screen->deviceID = devinfo->chipset_id; - screen->no_hw = devinfo->no_hw; if (devinfo->ver >= 12) { fprintf(stderr, "gfx12 and newer are not supported on i965\n"); diff --git a/src/mesa/drivers/dri/i965/brw_screen.h b/src/mesa/drivers/dri/i965/brw_screen.h index cb3d34f148e..9ee24d06a11 100644 --- a/src/mesa/drivers/dri/i965/brw_screen.h +++ b/src/mesa/drivers/dri/i965/brw_screen.h @@ -59,7 +59,6 @@ struct brw_screen /** DRM fd associated with this screen. Not owned by this object. Do not close. */ int fd; - bool no_hw; bool hw_has_swizzling; bool has_exec_fence; /**< I915_PARAM_HAS_EXEC_FENCE */ |