intel/dev: Call intel_device_info_update_after_hwconfig() from common code
Avoid backends duplication. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33585>
This commit is contained in:
committed by
Marge Bot
parent
e170252d97
commit
7d4c91efef
@@ -579,8 +579,7 @@ bool intel_device_info_i915_get_info_from_fd(int fd, struct intel_device_info *d
|
||||
|
||||
hwconfig_blob = intel_device_info_i915_query_hwconfig(fd, &len);
|
||||
if (hwconfig_blob) {
|
||||
if (intel_hwconfig_process_table(devinfo, hwconfig_blob, len))
|
||||
intel_device_info_update_after_hwconfig(devinfo);
|
||||
intel_hwconfig_process_table(devinfo, hwconfig_blob, len);
|
||||
|
||||
free(hwconfig_blob);
|
||||
}
|
||||
|
||||
@@ -1849,6 +1849,16 @@ intel_device_info_calc_engine_prefetch(const struct intel_device_info *devinfo,
|
||||
return 512;
|
||||
}
|
||||
|
||||
static void
|
||||
intel_device_info_update_after_hwconfig(struct intel_device_info *devinfo)
|
||||
{
|
||||
/* After applying hwconfig values, some items need to be recalculated. */
|
||||
devinfo->max_cs_threads =
|
||||
devinfo->max_eus_per_subslice * devinfo->num_thread_per_eu;
|
||||
|
||||
intel_device_info_update_cs_workgroup_threads(devinfo);
|
||||
}
|
||||
|
||||
bool
|
||||
intel_get_device_info_from_fd(int fd, struct intel_device_info *devinfo, int min_ver, int max_ver)
|
||||
{
|
||||
@@ -1943,6 +1953,8 @@ intel_get_device_info_from_fd(int fd, struct intel_device_info *devinfo, int min
|
||||
return false;
|
||||
}
|
||||
|
||||
if (intel_hwconfig_is_required(devinfo))
|
||||
intel_device_info_update_after_hwconfig(devinfo);
|
||||
intel_device_info_adjust_memory(devinfo);
|
||||
|
||||
/* Gfx7 and older do not support EU/Subslice info */
|
||||
@@ -1984,16 +1996,6 @@ bool intel_device_info_update_memory_info(struct intel_device_info *devinfo, int
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
intel_device_info_update_after_hwconfig(struct intel_device_info *devinfo)
|
||||
{
|
||||
/* After applying hwconfig values, some items need to be recalculated. */
|
||||
devinfo->max_cs_threads =
|
||||
devinfo->max_eus_per_subslice * devinfo->num_thread_per_eu;
|
||||
|
||||
intel_device_info_update_cs_workgroup_threads(devinfo);
|
||||
}
|
||||
|
||||
enum intel_wa_steppings
|
||||
intel_device_info_wa_stepping(struct intel_device_info *devinfo)
|
||||
{
|
||||
|
||||
@@ -199,7 +199,6 @@ void intel_device_info_update_l3_banks(struct intel_device_info *devinfo);
|
||||
uint32_t intel_device_info_get_eu_count_first_subslice(const struct intel_device_info *devinfo);
|
||||
void intel_device_info_update_cs_workgroup_threads(struct intel_device_info *devinfo);
|
||||
bool intel_device_info_compute_system_memory(struct intel_device_info *devinfo, bool update);
|
||||
void intel_device_info_update_after_hwconfig(struct intel_device_info *devinfo);
|
||||
|
||||
#ifdef GFX_VERx10
|
||||
#define intel_needs_workaround(devinfo, id) \
|
||||
|
||||
@@ -147,8 +147,8 @@ process_hwconfig_table(struct intel_device_info *devinfo,
|
||||
assert(current == end);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
apply_hwconfig(const struct intel_device_info *devinfo)
|
||||
bool
|
||||
intel_hwconfig_is_required(const struct intel_device_info *devinfo)
|
||||
{
|
||||
/* returns is true when the platform should apply hwconfig values */
|
||||
return devinfo->verx10 >= 125;
|
||||
@@ -172,7 +172,7 @@ should_apply_hwconfig_item(uint16_t always_apply_verx10,
|
||||
const struct intel_device_info *devinfo,
|
||||
uint32_t devinfo_val)
|
||||
{
|
||||
assert(apply_hwconfig(devinfo));
|
||||
assert(intel_hwconfig_is_required(devinfo));
|
||||
if ((devinfo->verx10 >= always_apply_verx10 || devinfo_val == 0))
|
||||
return true;
|
||||
|
||||
@@ -337,10 +337,10 @@ bool
|
||||
intel_hwconfig_process_table(struct intel_device_info *devinfo,
|
||||
void *data, int32_t len)
|
||||
{
|
||||
if (apply_hwconfig(devinfo))
|
||||
if (intel_hwconfig_is_required(devinfo))
|
||||
process_hwconfig_table(devinfo, data, len, apply_hwconfig_item);
|
||||
|
||||
return apply_hwconfig(devinfo);
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -42,6 +42,9 @@ intel_check_hwconfig_items(int fd, struct intel_device_info *devinfo);
|
||||
void
|
||||
intel_get_and_print_hwconfig_table(int fd, struct intel_device_info *devinfo);
|
||||
|
||||
bool
|
||||
intel_hwconfig_is_required(const struct intel_device_info *devinfo);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -346,8 +346,8 @@ intel_device_info_xe_get_info_from_fd(int fd, struct intel_device_info *devinfo)
|
||||
if (!xe_query_topology(fd, devinfo))
|
||||
return false;
|
||||
|
||||
if (xe_query_process_hwconfig(fd, devinfo))
|
||||
intel_device_info_update_after_hwconfig(devinfo);
|
||||
if (!xe_query_process_hwconfig(fd, devinfo))
|
||||
return false;
|
||||
|
||||
devinfo->has_context_isolation = true;
|
||||
devinfo->has_mmap_offset = true;
|
||||
|
||||
Reference in New Issue
Block a user