[PATCH] drm/xe/oa: Use actual Xe2 format sizes

Ashutosh Dixit ashutosh.dixit at intel.com
Wed Oct 18 20:06:53 UTC 2023


Use actual, not expected from Bspec, format sizes and also print where the
tail pointer gets stuck which prevents it from rewinding.

Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
---
 drivers/gpu/drm/xe/xe_oa.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index 4065f0f0a450f..46b17bd47b292 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -57,15 +57,15 @@ static const struct xe_oa_format oa_formats[] = {
 	[XE_OA_FORMAT_A24u40_A14u32_B8_C8]	= { 5, 256 },
 	[XE_OAM_FORMAT_MPEC8u64_B8_C8]		= { 1, 192, XE_OA_FMT_TYPE_OAM_MPEC, HDR_64_BIT },
 	[XE_OAM_FORMAT_MPEC8u32_B8_C8]		= { 2, 128, XE_OA_FMT_TYPE_OAM_MPEC, HDR_64_BIT },
-	[XE_OA_FORMAT_PEC64u64]			= { 1, 576, 0, HDR_64_BIT, 1, 0 },
-	[XE_OA_FORMAT_PEC64u64_B8_C8]		= { 1, 640, 0, HDR_64_BIT, 1, 1 },
+	[XE_OA_FORMAT_PEC64u64]			= { 1, 320, 0, HDR_64_BIT, 1, 0 },
+	[XE_OA_FORMAT_PEC64u64_B8_C8]		= { 1, 320, 0, HDR_64_BIT, 1, 1 },
 	[XE_OA_FORMAT_PEC64u32]			= { 1, 320, 0, HDR_64_BIT },
-	[XE_OA_FORMAT_PEC32u64_G1]		= { 5, 320, 0, HDR_64_BIT, 1, 0 },
+	[XE_OA_FORMAT_PEC32u64_G1]		= { 5, 192, 0, HDR_64_BIT, 1, 0 },
 	[XE_OA_FORMAT_PEC32u32_G1]		= { 5, 192, 0, HDR_64_BIT },
-	[XE_OA_FORMAT_PEC32u64_G2]		= { 6, 320, 0, HDR_64_BIT, 1, 0 },
+	[XE_OA_FORMAT_PEC32u64_G2]		= { 6, 192, 0, HDR_64_BIT, 1, 0 },
 	[XE_OA_FORMAT_PEC32u32_G2]		= { 6, 192, 0, HDR_64_BIT },
-	[XE_OA_FORMAT_PEC36u64_G1_32_G2_4]	= { 3, 320, 0, HDR_64_BIT, 1, 0 },
-	[XE_OA_FORMAT_PEC36u64_G1_4_G2_32]	= { 4, 320, 0, HDR_64_BIT, 1, 0 },
+	[XE_OA_FORMAT_PEC36u64_G1_32_G2_4]	= { 3, 64, 0, HDR_64_BIT, 1, 0 },
+	[XE_OA_FORMAT_PEC36u64_G1_4_G2_32]	= { 4, 64, 0, HDR_64_BIT, 1, 0 },
 };
 
 struct xe_oa_derived_params {
@@ -200,6 +200,7 @@ static bool xe_oa_buffer_check_unlocked(struct xe_oa_stream *stream)
 	unsigned long flags;
 	bool pollin;
 	u32 partial_report_size;
+	static int nn;
 
 	/*
 	 * We have to consider the (unlikely) possibility that read() errors could result
@@ -242,14 +243,17 @@ static bool xe_oa_buffer_check_unlocked(struct xe_oa_stream *stream)
 
 		tail = OA_TAKEN(tail, report_size);
 	}
-
+#if 0
 	if (OA_TAKEN(hw_tail, tail) > report_size)
 		drm_dbg(&stream->oa->xe->drm,
 			"unlanded report(s) head=0x%x tail=0x%x hw_tail=0x%x\n",
 			stream->oa_buffer.head, tail, hw_tail);
-
+#endif
 	stream->oa_buffer.tail = tail;
 
+	if (!(nn++ & 0x3f))
+		pr_err("head %#x tail %#x\n", stream->oa_buffer.head, stream->oa_buffer.tail);
+
 	pollin = OA_TAKEN(stream->oa_buffer.tail,
 			  stream->oa_buffer.head) >= report_size;
 
@@ -1497,6 +1501,7 @@ static int decode_oa_format(struct xe_oa *oa, u64 fmt, enum xe_oa_format_name *n
 		if (counter_size == f->counter_size && bc_report == f->bc_report &&
 		    type == f->type && counter_sel == f->format) {
 			*name = idx;
+			pr_err("idx %d size %d\n", idx, oa_formats[idx].size);
 			return 0;
 		}
 	}
-- 
2.41.0



More information about the Intel-gfx-trybot mailing list