diff options
author | Iago Toral Quiroga <[email protected]> | 2017-01-04 10:46:08 +0100 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2017-01-05 08:43:46 +0100 |
commit | a98f2e53e1c669dee3114badcce261e564748af4 (patch) | |
tree | 9afbfd07ffa4863f7085247752d5a92389fe9c1a /src/mesa/drivers/dri/i965/intel_screen.h | |
parent | e3123c8ca22e9a9337af6179dfd8383259f3ccc6 (diff) |
i965: add a kernel_features bitfield to intel screen
We can use this to track various features that may or may not be supported
by the hw / kernel. Currently, we usually do this by checking the generation
and supported command parser versions in various places thoughtout the driver
code. With this patch, we centralize all these checks in just once place at
screen creation time, then we just query the bitfield wherever we need to
check if a particular feature is supported.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_screen.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.h | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.h b/src/mesa/drivers/dri/i965/intel_screen.h index 2cbff14f306..890dd9044b1 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.h +++ b/src/mesa/drivers/dri/i965/intel_screen.h @@ -58,23 +58,20 @@ struct intel_screen 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; @@ -130,7 +127,31 @@ intel_supported_msaa_modes(const struct intel_screen *screen); 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 |