mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
intel/perf: fix querying of configurations
Using the unsized data field is incorrect. The data is located behind
the entire drm_i915_query_perf_config structure.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26285>
(cherry picked from commit f9bab3566b)
This commit is contained in:
parent
16361af817
commit
4e9ef47839
2 changed files with 7 additions and 6 deletions
|
|
@ -1394,7 +1394,7 @@
|
||||||
"description": "intel/perf: fix querying of configurations",
|
"description": "intel/perf: fix querying of configurations",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 0,
|
"nomination_type": 0,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": null,
|
"because_sha": null,
|
||||||
"notes": null
|
"notes": null
|
||||||
|
|
|
||||||
|
|
@ -280,18 +280,19 @@ i915_query_perf_config_data(struct intel_perf_config *perf,
|
||||||
{
|
{
|
||||||
char data[sizeof(struct drm_i915_query_perf_config) +
|
char data[sizeof(struct drm_i915_query_perf_config) +
|
||||||
sizeof(struct drm_i915_perf_oa_config)] = {};
|
sizeof(struct drm_i915_perf_oa_config)] = {};
|
||||||
struct drm_i915_query_perf_config *query = (void *)data;
|
struct drm_i915_query_perf_config *i915_query = (void *)data;
|
||||||
|
struct drm_i915_perf_oa_config *i915_config = (void *)data + sizeof(*i915_query);
|
||||||
|
|
||||||
memcpy(query->uuid, guid, sizeof(query->uuid));
|
memcpy(i915_query->uuid, guid, sizeof(i915_query->uuid));
|
||||||
memcpy(query->data, config, sizeof(*config));
|
memcpy(i915_config, config, sizeof(*config));
|
||||||
|
|
||||||
int32_t item_length = sizeof(data);
|
int32_t item_length = sizeof(data);
|
||||||
if (intel_i915_query_flags(fd, DRM_I915_QUERY_PERF_CONFIG,
|
if (intel_i915_query_flags(fd, DRM_I915_QUERY_PERF_CONFIG,
|
||||||
DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID,
|
DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID,
|
||||||
query, &item_length))
|
i915_query, &item_length))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
memcpy(config, query->data, sizeof(*config));
|
memcpy(config, i915_config, sizeof(*config));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue