summaryrefslogtreecommitdiff
path: root/lib/i915
diff options
context:
space:
mode:
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>2020-12-25 22:29:43 +0200
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>2021-01-08 11:13:40 +0200
commit659d88fff7f0babcd691e0afe84a79d7c6744b66 (patch)
treef2baa340702de4c059c47310f42cf3d008c9acda /lib/i915
parentd0401443edbd8e645a45d39ea60dfb1e61062278 (diff)
lib/i915/perf: fill up reader devinfo default field
A bunch of fields were left to 0... We can just copy the one in the intel_perf object which contains exactly what we need. v2: Just copy the devinfo from intel_perf Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Fixes: 43116ee368585d ("lib/i915-perf: add i915 perf data reader") Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Diffstat (limited to 'lib/i915')
-rw-r--r--lib/i915/perf_data_reader.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/lib/i915/perf_data_reader.c b/lib/i915/perf_data_reader.c
index 3b05a2e5..a846b78c 100644
--- a/lib/i915/perf_data_reader.c
+++ b/lib/i915/perf_data_reader.c
@@ -117,23 +117,11 @@ find_metric_set(struct intel_perf *perf, const char *symbol_name)
return NULL;
}
-static void
-init_devinfo(struct intel_perf_devinfo *perf_devinfo,
- const struct intel_device_info *devinfo,
- uint32_t devid,
- uint64_t timestamp_frequency)
-{
- perf_devinfo->devid = devid;
- perf_devinfo->gen = devinfo->gen;
- perf_devinfo->timestamp_frequency = timestamp_frequency;
-}
-
static bool
parse_data(struct intel_perf_data_reader *reader)
{
const struct intel_perf_record_device_info *record_info;
const struct intel_perf_record_device_topology *record_topology;
- const struct intel_device_info *devinfo;
const uint8_t *end = reader->mmap_data + reader->mmap_size;
const uint8_t *iter = reader->mmap_data;
@@ -195,23 +183,20 @@ parse_data(struct intel_perf_data_reader *reader)
record_info = reader->record_info;
record_topology = reader->record_topology;
- devinfo = intel_get_device_info(record_info->device_id);
- if (!devinfo) {
- snprintf(reader->error_msg, sizeof(reader->error_msg),
- "Recording occured on unsupported device (0x%x)",
- record_info->device_id);
- return false;
- }
-
- init_devinfo(&reader->devinfo, devinfo,
- record_info->device_id,
- record_info->timestamp_frequency);
reader->perf = intel_perf_for_devinfo(record_info->device_id,
record_info->device_revision,
record_info->timestamp_frequency,
record_info->gt_min_frequency,
record_info->gt_max_frequency,
&record_topology->topology);
+ if (!reader->perf) {
+ snprintf(reader->error_msg, sizeof(reader->error_msg),
+ "Recording occured on unsupported device (0x%x)",
+ record_info->device_id);
+ return false;
+ }
+
+ reader->devinfo = reader->perf->devinfo;
reader->metric_set_name = record_info->metric_set_name;
reader->metric_set_uuid = record_info->metric_set_uuid;