functions->NewTransformFeedback = brw_new_transform_feedback;
functions->DeleteTransformFeedback = brw_delete_transform_feedback;
- if (brw->screen->has_mi_math_and_lrr) {
+ if (can_do_mi_math_and_lrr(brw->screen)) {
functions->BeginTransformFeedback = hsw_begin_transform_feedback;
functions->EndTransformFeedback = hsw_end_transform_feedback;
functions->PauseTransformFeedback = hsw_pause_transform_feedback;
BRW_MAX_SOL_BINDINGS / BRW_MAX_SOL_BUFFERS;
ctx->Const.AlwaysUseGetTransformFeedbackVertexCount =
- !brw->screen->has_mi_math_and_lrr;
+ !can_do_mi_math_and_lrr(brw->screen);
int max_samples;
const int *msaa_modes = intel_supported_msaa_modes(brw->screen);
ADVANCE_BATCH();
- if (brw->is_haswell && brw->screen->cmd_parser_version >= 4) {
+ if (can_do_hsw_l3_atomics(brw->screen)) {
/* Enable L3 atomics on HSW if we have a DC partition, otherwise keep
* them disabled to avoid crashing the system hard.
*/
ctx->Extensions.ARB_transform_feedback3 = true;
ctx->Extensions.ARB_transform_feedback_instanced = true;
- if ((brw->gen >= 8 || brw->screen->cmd_parser_version >= 5) &&
+ if (can_do_compute_dispatch(brw->screen) &&
ctx->Const.MaxComputeWorkGroupSize[0] >= 1024) {
ctx->Extensions.ARB_compute_shader = true;
ctx->Extensions.ARB_ES3_1_compatibility =
brw->gen >= 8 || brw->is_haswell;
}
- if (brw->screen->cmd_parser_version >= 2)
+ if (can_do_predicate_writes(brw->screen))
brw->predicate.supported = true;
}
}
ctx->Extensions.ARB_robust_buffer_access_behavior = true;
}
- if (brw->screen->has_mi_math_and_lrr) {
+ if (can_do_mi_math_and_lrr(brw->screen)) {
ctx->Extensions.ARB_query_buffer_object = true;
}
}
if (intel_detect_pipelined_so(screen))
- screen->hw_has_pipelined_register |= HW_HAS_PIPELINED_SOL_OFFSET;
+ screen->kernel_features |= KERNEL_ALLOWS_SOL_OFFSET_WRITES;
const char *force_msaa = getenv("INTEL_FORCE_MSAA");
if (force_msaa) {
screen->cmd_parser_version = 0;
}
+ if (screen->cmd_parser_version >= 2)
+ screen->kernel_features |= KERNEL_ALLOWS_PREDICATE_WRITES;
+
+ /* Haswell requires command parser version 4 in order to have L3
+ * atomic scratch1 and chicken3 bits
+ */
+ if (screen->devinfo.is_haswell && screen->cmd_parser_version >= 4) {
+ screen->kernel_features |=
+ KERNEL_ALLOWS_HSW_SCRATCH1_AND_ROW_CHICKEN3;
+ }
+
/* Haswell requires command parser version 6 in order to write to the
* MI_MATH GPR registers, and version 7 in order to use
* MI_LOAD_REGISTER_REG (which all users of MI_MATH use).
*/
- screen->has_mi_math_and_lrr = screen->devinfo.gen >= 8 ||
- (screen->devinfo.is_haswell &&
- screen->cmd_parser_version >= 7);
+ if (screen->devinfo.gen >= 8 ||
+ (screen->devinfo.is_haswell && screen->cmd_parser_version >= 7)) {
+ screen->kernel_features |= KERNEL_ALLOWS_MI_MATH_AND_LRR;
+ }
+
+ /* Gen7 needs at least command parser version 5 to support compute */
+ if (screen->devinfo.gen >= 8 || screen->cmd_parser_version >= 5)
+ screen->kernel_features |= KERNEL_ALLOWS_COMPUTE_DISPATCH;
dri_screen->extensions = !screen->has_context_reset_notification
? screenExtensions : intelRobustScreenExtensions;
*/
bool has_resource_streamer;
- /**
- * Does the current hardware and kernel support MI_MATH and
- * MI_LOAD_REGISTER_REG?
- */
- bool has_mi_math_and_lrr;
-
/**
* Does the kernel support context reset notifications?
*/
bool has_context_reset_notification;
/**
- * Does the kernel support pipelined register access?
- * Due to whitelisting we need to do seperate checks
- * for each register.
+ * Does the kernel support features such as pipelined register access to
+ * specific registers?
*/
- unsigned hw_has_pipelined_register;
-#define HW_HAS_PIPELINED_SOL_OFFSET (1<<0)
+ unsigned kernel_features;
+#define KERNEL_ALLOWS_SOL_OFFSET_WRITES (1<<0)
+#define KERNEL_ALLOWS_PREDICATE_WRITES (1<<1)
+#define KERNEL_ALLOWS_MI_MATH_AND_LRR (1<<2)
+#define KERNEL_ALLOWS_HSW_SCRATCH1_AND_ROW_CHICKEN3 (1<<3)
+#define KERNEL_ALLOWS_COMPUTE_DISPATCH (1<<4)
dri_bufmgr *bufmgr;
static inline bool
can_do_pipelined_register_writes(const struct intel_screen *screen)
{
- return screen->hw_has_pipelined_register & HW_HAS_PIPELINED_SOL_OFFSET;
+ return screen->kernel_features & KERNEL_ALLOWS_SOL_OFFSET_WRITES;
+}
+
+static inline bool
+can_do_hsw_l3_atomics(const struct intel_screen *screen)
+{
+ return screen->kernel_features & KERNEL_ALLOWS_HSW_SCRATCH1_AND_ROW_CHICKEN3;
+}
+
+static inline bool
+can_do_mi_math_and_lrr(const struct intel_screen *screen)
+{
+ return screen->kernel_features & KERNEL_ALLOWS_MI_MATH_AND_LRR;
+}
+
+static inline bool
+can_do_compute_dispatch(const struct intel_screen *screen)
+{
+ return screen->kernel_features & KERNEL_ALLOWS_COMPUTE_DISPATCH;
+}
+
+static inline bool
+can_do_predicate_writes(const struct intel_screen *screen)
+{
+ return screen->kernel_features & KERNEL_ALLOWS_PREDICATE_WRITES;
}
#endif