From patchwork Wed Oct 18 20:06:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: drm/xe/oa: Use actual Xe2 format sizes From: Ashutosh Dixit X-Patchwork-Id: 563446 Message-Id: <20231018200653.1365009-1-ashutosh.dixit@intel.com> To: intel-gfx-trybot@lists.freedesktop.org Date: Wed, 18 Oct 2023 13:06:53 -0700 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 --- 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; } }