Check first if the hardware and kernel supports resource streamer. If this
is allowed, tell the kernel to enable the resource streamer enable bit on
MI_BATCHBUFFER_START by specifying I915_EXEC_RESOURCE_STREAMER
execbuffer flags.
v2: - Use new I915_PARAM_HAS_RESOURCE_STREAMER ioctl to check if kernel
supports RS (Ken).
- Add brw_device_info::has_resource_streamer and toggle it for
Haswell, Broadwell, Cherryview, Skylake, and Broxton (Ken).
v3: - Update I915_PARAM_HAS_RESOURCE_STREAMER to match updated kernel.
v4: - Always inspect the getparam.value (Chris Wilson).
v5: - Fold redundant devinfo->has_resource_streamer check in context create
into init screen.
Cc: kenneth@whitecape.org
Cc: chris@chris-wilson.co.uk
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
brw->predicate.state = BRW_PREDICATE_STATE_RENDER;
brw->predicate.state = BRW_PREDICATE_STATE_RENDER;
+ brw->use_resource_streamer = screen->has_resource_streamer &&
+ (brw_env_var_as_boolean("INTEL_USE_HW_BT", false) ||
+ brw_env_var_as_boolean("INTEL_USE_GATHER", false));
+
ctx->VertexProgram._MaintainTnlProgram = true;
ctx->FragmentProgram._MaintainTexEnvProgram = true;
ctx->VertexProgram._MaintainTnlProgram = true;
ctx->FragmentProgram._MaintainTexEnvProgram = true;
bool has_pln;
bool no_simd8;
bool use_rep_send;
bool has_pln;
bool no_simd8;
bool use_rep_send;
+ bool use_resource_streamer;
/**
* Some versions of Gen hardware don't do centroid interpolation correctly
/**
* Some versions of Gen hardware don't do centroid interpolation correctly
#define HSW_FEATURES \
GEN7_FEATURES, \
.is_haswell = true, \
#define HSW_FEATURES \
GEN7_FEATURES, \
.is_haswell = true, \
- .supports_simd16_3src = true
+ .supports_simd16_3src = true, \
+ .has_resource_streamer = true
static const struct brw_device_info brw_device_info_hsw_gt1 = {
HSW_FEATURES, .gt = 1,
static const struct brw_device_info brw_device_info_hsw_gt1 = {
HSW_FEATURES, .gt = 1,
#define GEN8_FEATURES \
.gen = 8, \
.has_hiz_and_separate_stencil = true, \
#define GEN8_FEATURES \
.gen = 8, \
.has_hiz_and_separate_stencil = true, \
+ .has_resource_streamer = true, \
.must_use_separate_stencil = true, \
.has_llc = true, \
.has_pln = true, \
.must_use_separate_stencil = true, \
.has_llc = true, \
.has_pln = true, \
#define GEN9_FEATURES \
.gen = 9, \
.has_hiz_and_separate_stencil = true, \
#define GEN9_FEATURES \
.gen = 9, \
.has_hiz_and_separate_stencil = true, \
+ .has_resource_streamer = true, \
.must_use_separate_stencil = true, \
.has_llc = true, \
.has_pln = true, \
.must_use_separate_stencil = true, \
.has_llc = true, \
.has_pln = true, \
bool has_compr4;
bool has_surface_tile_offset;
bool supports_simd16_3src;
bool has_compr4;
bool has_surface_tile_offset;
bool supports_simd16_3src;
+ bool has_resource_streamer;
+/* Drop when RS headers get pulled to libdrm */
+#ifndef I915_EXEC_RESOURCE_STREAMER
+#define I915_EXEC_RESOURCE_STREAMER (1<<15)
+#endif
+
/* TODO: Push this whole function into bufmgr.
*/
static int
/* TODO: Push this whole function into bufmgr.
*/
static int
if (brw->gen >= 6 && batch->ring == BLT_RING) {
flags = I915_EXEC_BLT;
} else {
if (brw->gen >= 6 && batch->ring == BLT_RING) {
flags = I915_EXEC_BLT;
} else {
- flags = I915_EXEC_RENDER;
+ flags = I915_EXEC_RENDER |
+ (brw->use_resource_streamer ? I915_EXEC_RESOURCE_STREAMER : 0);
}
if (batch->needs_sol_reset)
flags |= I915_EXEC_GEN7_SOL_RESET;
}
if (batch->needs_sol_reset)
flags |= I915_EXEC_GEN7_SOL_RESET;
+/* Drop when RS headers get pulled to libdrm */
+#ifndef I915_PARAM_HAS_RESOURCE_STREAMER
+#define I915_PARAM_HAS_RESOURCE_STREAMER 36
+#endif
+
/**
* This is the driver specific part of the createNewScreen entry point.
* Called when using DRI2.
/**
* This is the driver specific part of the createNewScreen entry point.
* Called when using DRI2.
intelScreen->compiler = brw_compiler_create(intelScreen,
intelScreen->devinfo);
intelScreen->compiler = brw_compiler_create(intelScreen,
intelScreen->devinfo);
+ if (intelScreen->devinfo->has_resource_streamer) {
+ int val = -1;
+ getparam.param = I915_PARAM_HAS_RESOURCE_STREAMER;
+ getparam.value = &val;
+
+ drmIoctl(psp->fd, DRM_IOCTL_I915_GETPARAM, &getparam);
+ intelScreen->has_resource_streamer = val > 0;
+ }
+
return (const __DRIconfig**) intel_screen_make_configs(psp);
}
return (const __DRIconfig**) intel_screen_make_configs(psp);
}
+ /**
+ * Does the kernel support resource streamer?
+ */
+ bool has_resource_streamer;
+
/**
* Does the kernel support context reset notifications?
*/
/**
* Does the kernel support context reset notifications?
*/