intel/perf: Replace drm_i915_perf_record_header by intel_perf_record_header

drm_i915_perf_record_header requires i915_drm.h but we want to remove
all i915_drm.h includes from common code, so replacing it by
intel_perf_record_header.

No changes in behavior expected as the structs and enums are identical.

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/29421>
This commit is contained in:
José Roberto de Souza
2024-05-15 09:43:46 -07:00
committed by Marge Bot
parent da43bf3f2e
commit 2f128b2ba5
4 changed files with 28 additions and 15 deletions
+13
View File
@@ -416,6 +416,19 @@ struct intel_perf_counter_pass {
struct intel_perf_query_counter *counter;
};
enum intel_perf_record_type {
INTEL_PERF_RECORD_TYPE_SAMPLE = 1,
INTEL_PERF_RECORD_TYPE_OA_REPORT_LOST = 2,
INTEL_PERF_RECORD_TYPE_OA_BUFFER_LOST = 3,
INTEL_PERF_RECORD_TYPE_MAX,
};
struct intel_perf_record_header {
uint32_t type; /* enum intel_perf_record_type */
uint16_t pad;
uint16_t size;
};
/** Initialize the intel_perf_config object for a given device.
*
* include_pipeline_statistics : Whether to add a pipeline statistic query
+10 -10
View File
@@ -1010,11 +1010,11 @@ read_oa_samples_until(struct intel_perf_context *perf_ctx,
/* Go through the reports and update the last timestamp. */
offset = 0;
while (offset < buf->len) {
const struct drm_i915_perf_record_header *header =
(const struct drm_i915_perf_record_header *) &buf->buf[offset];
const struct intel_perf_record_header *header =
(const struct intel_perf_record_header *) &buf->buf[offset];
uint32_t *report = (uint32_t *) (header + 1);
if (header->type == DRM_I915_PERF_RECORD_SAMPLE)
if (header->type == INTEL_PERF_RECORD_TYPE_SAMPLE)
last_timestamp = report[1];
offset += header->size;
@@ -1281,8 +1281,8 @@ accumulate_oa_reports(struct intel_perf_context *perf_ctx,
int offset = 0;
while (offset < buf->len) {
const struct drm_i915_perf_record_header *header =
(const struct drm_i915_perf_record_header *)(buf->buf + offset);
const struct intel_perf_record_header *header =
(const struct intel_perf_record_header *)(buf->buf + offset);
assert(header->size != 0);
assert(header->size <= buf->len);
@@ -1290,7 +1290,7 @@ accumulate_oa_reports(struct intel_perf_context *perf_ctx,
offset += header->size;
switch (header->type) {
case DRM_I915_PERF_RECORD_SAMPLE: {
case INTEL_PERF_RECORD_TYPE_SAMPLE: {
uint32_t *report = (uint32_t *)(header + 1);
bool report_ctx_match = true;
bool add = true;
@@ -1365,11 +1365,11 @@ accumulate_oa_reports(struct intel_perf_context *perf_ctx,
break;
}
case DRM_I915_PERF_RECORD_OA_BUFFER_LOST:
DBG("i915 perf: OA error: all reports lost\n");
case INTEL_PERF_RECORD_TYPE_OA_BUFFER_LOST:
DBG("perf: OA error: all reports lost\n");
goto error;
case DRM_I915_PERF_RECORD_OA_REPORT_LOST:
DBG("i915 perf: OA report lost\n");
case INTEL_PERF_RECORD_TYPE_OA_REPORT_LOST:
DBG("perf: OA report lost\n");
break;
}
}