mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 08:10:09 +01:00
intel/dev: Apply settings from hwconfig if devinfo::apply_hwconfig is set
During debug builds, if apply_hwconfig is not set, then the devinfo value will be compared with the hwconfig value. If they don't match then a warning message will be logged to stderr. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13866>
This commit is contained in:
parent
59f32c62c7
commit
ab22fb488b
2 changed files with 142 additions and 0 deletions
|
|
@ -29,6 +29,14 @@
|
|||
#include "intel_hwconfig_types.h"
|
||||
#include "intel/common/intel_gem.h"
|
||||
|
||||
#include "util/log.h"
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define DEBUG_BUILD false
|
||||
#else
|
||||
#define DEBUG_BUILD true
|
||||
#endif
|
||||
|
||||
struct hwconfig {
|
||||
uint32_t key;
|
||||
uint32_t len;
|
||||
|
|
@ -143,6 +151,135 @@ intel_process_hwconfig_table(struct intel_device_info *devinfo,
|
|||
assert(current == end);
|
||||
}
|
||||
|
||||
/* If devinfo->apply_hwconfig is true, then we apply the hwconfig value.
|
||||
*
|
||||
* For debug builds, if devinfo->apply_hwconfig is false, we will compare the
|
||||
* hwconfig value with the current value in the devinfo and log a warning
|
||||
* message if they differ. This should help to make sure the values in our
|
||||
* devinfo structures match what hwconfig is specified.
|
||||
*/
|
||||
#define DEVINFO_HWCONFIG(F, V) \
|
||||
do { \
|
||||
if (devinfo->apply_hwconfig) \
|
||||
devinfo->F = V; \
|
||||
else if (DEBUG_BUILD && devinfo->F != (V)) \
|
||||
mesa_logw("%s (%u) != devinfo->%s (%u)", \
|
||||
key_to_name(item->key), (V), #F, \
|
||||
devinfo->F); \
|
||||
} while (0)
|
||||
|
||||
static void
|
||||
apply_hwconfig_item(struct intel_device_info *devinfo,
|
||||
const struct hwconfig *item)
|
||||
{
|
||||
switch (item->key) {
|
||||
case INTEL_HWCONFIG_MAX_SLICES_SUPPORTED:
|
||||
case INTEL_HWCONFIG_MAX_DUAL_SUBSLICES_SUPPORTED:
|
||||
case INTEL_HWCONFIG_NUM_PIXEL_PIPES:
|
||||
case INTEL_HWCONFIG_DEPRECATED_MAX_NUM_GEOMETRY_PIPES:
|
||||
case INTEL_HWCONFIG_DEPRECATED_L3_CACHE_SIZE_IN_KB:
|
||||
case INTEL_HWCONFIG_DEPRECATED_L3_BANK_COUNT:
|
||||
case INTEL_HWCONFIG_L3_CACHE_WAYS_SIZE_IN_BYTES:
|
||||
case INTEL_HWCONFIG_L3_CACHE_WAYS_PER_SECTOR:
|
||||
case INTEL_HWCONFIG_MAX_MEMORY_CHANNELS:
|
||||
case INTEL_HWCONFIG_MEMORY_TYPE:
|
||||
case INTEL_HWCONFIG_CACHE_TYPES:
|
||||
case INTEL_HWCONFIG_LOCAL_MEMORY_PAGE_SIZES_SUPPORTED:
|
||||
case INTEL_HWCONFIG_DEPRECATED_SLM_SIZE_IN_KB:
|
||||
break; /* ignore */
|
||||
case INTEL_HWCONFIG_MAX_NUM_EU_PER_DSS:
|
||||
DEVINFO_HWCONFIG(max_eus_per_subslice, item->val[0]);
|
||||
break;
|
||||
case INTEL_HWCONFIG_NUM_THREADS_PER_EU:
|
||||
DEVINFO_HWCONFIG(num_thread_per_eu, item->val[0]);
|
||||
break;
|
||||
case INTEL_HWCONFIG_TOTAL_VS_THREADS:
|
||||
DEVINFO_HWCONFIG(max_vs_threads, item->val[0]);
|
||||
break;
|
||||
case INTEL_HWCONFIG_TOTAL_GS_THREADS:
|
||||
DEVINFO_HWCONFIG(max_gs_threads, item->val[0]);
|
||||
break;
|
||||
case INTEL_HWCONFIG_TOTAL_HS_THREADS:
|
||||
DEVINFO_HWCONFIG(max_tcs_threads, item->val[0]);
|
||||
break;
|
||||
case INTEL_HWCONFIG_TOTAL_DS_THREADS:
|
||||
DEVINFO_HWCONFIG(max_tes_threads, item->val[0]);
|
||||
break;
|
||||
case INTEL_HWCONFIG_TOTAL_VS_THREADS_POCS:
|
||||
break; /* ignore */
|
||||
case INTEL_HWCONFIG_TOTAL_PS_THREADS:
|
||||
DEVINFO_HWCONFIG(max_threads_per_psd, item->val[0] / 2);
|
||||
break;
|
||||
case INTEL_HWCONFIG_URB_SIZE_PER_SLICE_IN_KB:
|
||||
DEVINFO_HWCONFIG(urb.size, item->val[0]);
|
||||
break;
|
||||
case INTEL_HWCONFIG_DEPRECATED_MAX_FILL_RATE:
|
||||
case INTEL_HWCONFIG_MAX_RCS:
|
||||
case INTEL_HWCONFIG_MAX_CCS:
|
||||
case INTEL_HWCONFIG_MAX_VCS:
|
||||
case INTEL_HWCONFIG_MAX_VECS:
|
||||
case INTEL_HWCONFIG_MAX_COPY_CS:
|
||||
case INTEL_HWCONFIG_DEPRECATED_URB_SIZE_IN_KB:
|
||||
case INTEL_HWCONFIG_MIN_VS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_MAX_VS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_MIN_PCS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_MAX_PCS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_MIN_HS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_MAX_HS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_MIN_GS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_MAX_GS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_MIN_DS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_MAX_DS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_PUSH_CONSTANT_URB_RESERVED_SIZE:
|
||||
case INTEL_HWCONFIG_POCS_PUSH_CONSTANT_URB_RESERVED_SIZE:
|
||||
case INTEL_HWCONFIG_URB_REGION_ALIGNMENT_SIZE_IN_BYTES:
|
||||
case INTEL_HWCONFIG_URB_ALLOCATION_SIZE_UNITS_IN_BYTES:
|
||||
case INTEL_HWCONFIG_MAX_URB_SIZE_CCS_IN_BYTES:
|
||||
case INTEL_HWCONFIG_VS_MIN_DEREF_BLOCK_SIZE_HANDLE_COUNT:
|
||||
case INTEL_HWCONFIG_DS_MIN_DEREF_BLOCK_SIZE_HANDLE_COUNT:
|
||||
case INTEL_HWCONFIG_NUM_RT_STACKS_PER_DSS:
|
||||
case INTEL_HWCONFIG_MAX_URB_STARTING_ADDRESS:
|
||||
case INTEL_HWCONFIG_MIN_CS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_MAX_CS_URB_ENTRIES:
|
||||
case INTEL_HWCONFIG_L3_ALLOC_PER_BANK_URB:
|
||||
case INTEL_HWCONFIG_L3_ALLOC_PER_BANK_REST:
|
||||
case INTEL_HWCONFIG_L3_ALLOC_PER_BANK_DC:
|
||||
case INTEL_HWCONFIG_L3_ALLOC_PER_BANK_RO:
|
||||
case INTEL_HWCONFIG_L3_ALLOC_PER_BANK_Z:
|
||||
case INTEL_HWCONFIG_L3_ALLOC_PER_BANK_COLOR:
|
||||
case INTEL_HWCONFIG_L3_ALLOC_PER_BANK_UNIFIED_TILE_CACHE:
|
||||
case INTEL_HWCONFIG_L3_ALLOC_PER_BANK_COMMAND_BUFFER:
|
||||
case INTEL_HWCONFIG_L3_ALLOC_PER_BANK_RW:
|
||||
case INTEL_HWCONFIG_MAX_NUM_L3_CONFIGS:
|
||||
case INTEL_HWCONFIG_BINDLESS_SURFACE_OFFSET_BIT_COUNT:
|
||||
case INTEL_HWCONFIG_RESERVED_CCS_WAYS:
|
||||
case INTEL_HWCONFIG_CSR_SIZE_IN_MB:
|
||||
case INTEL_HWCONFIG_GEOMETRY_PIPES_PER_SLICE:
|
||||
case INTEL_HWCONFIG_L3_BANK_SIZE_IN_KB:
|
||||
case INTEL_HWCONFIG_SLM_SIZE_PER_DSS:
|
||||
case INTEL_HWCONFIG_MAX_PIXEL_FILL_RATE_PER_SLICE:
|
||||
case INTEL_HWCONFIG_MAX_PIXEL_FILL_RATE_PER_DSS:
|
||||
case INTEL_HWCONFIG_URB_SIZE_PER_L3_BANK_COUNT_IN_KB:
|
||||
case INTEL_HWCONFIG_MAX_SUBSLICE:
|
||||
case INTEL_HWCONFIG_MAX_EU_PER_SUBSLICE:
|
||||
case INTEL_HWCONFIG_RAMBO_L3_BANK_SIZE_IN_KB:
|
||||
case INTEL_HWCONFIG_SLM_SIZE_PER_SS_IN_KB:
|
||||
break; /* ignore */
|
||||
default:
|
||||
fprintf(stderr, "hwconfig key %d (%s) unhandled!\n", item->key,
|
||||
key_to_name(item->key));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
intel_apply_hwconfig_table(struct intel_device_info *devinfo,
|
||||
const struct hwconfig *hwconfig,
|
||||
int32_t hwconfig_len)
|
||||
{
|
||||
intel_process_hwconfig_table(devinfo, hwconfig, hwconfig_len,
|
||||
apply_hwconfig_item);
|
||||
}
|
||||
|
||||
static void
|
||||
print_hwconfig_item(struct intel_device_info *devinfo,
|
||||
const struct hwconfig *item)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,12 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
struct hwconfig;
|
||||
struct intel_device_info;
|
||||
|
||||
void
|
||||
intel_apply_hwconfig_table(struct intel_device_info *devinfo,
|
||||
const struct hwconfig *hwconfig,
|
||||
int32_t hwconfig_len);
|
||||
void
|
||||
intel_print_hwconfig_table(const struct hwconfig *hwconfig,
|
||||
int32_t hwconfig_len);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue