Skip to content

Commit 82a4be8

Browse files
committed
drm/xe/oa: Enable OAM latency measurement
Enable OAM latency measurement for Xe3+ platforms. Bspec: 58840 v2: Introduce DRM_XE_OA_UNIT_TYPE_OAM_SAG v3: Also add LNCF_MISC_CONFIG_REGISTER0 needed by MDAPI Signed-off-by: Ashutosh Dixit <[email protected]> Reviewed-by: Umesh Nerlige Ramappa <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 10d42ef commit 82a4be8

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

drivers/gpu/drm/xe/regs/xe_oa_regs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,7 @@
9797
#define OAM_STATUS(base) XE_REG((base) + OAM_STATUS_OFFSET)
9898
#define OAM_MMIO_TRG(base) XE_REG((base) + OAM_MMIO_TRG_OFFSET)
9999

100+
#define OAM_COMPRESSION_T3_CONTROL XE_REG(0x1c2e00)
101+
#define OAM_LAT_MEASURE_ENABLE REG_BIT(4)
102+
100103
#endif

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,11 @@ static void xe_oa_disable_metric_set(struct xe_oa_stream *stream)
844844

845845
/* Reset PMON Enable to save power. */
846846
xe_mmio_rmw32(mmio, XELPMP_SQCNT1, sqcnt1, 0);
847+
848+
if ((stream->oa_unit->type == DRM_XE_OA_UNIT_TYPE_OAM ||
849+
stream->oa_unit->type == DRM_XE_OA_UNIT_TYPE_OAM_SAG) &&
850+
GRAPHICS_VER(stream->oa->xe) >= 30)
851+
xe_mmio_rmw32(mmio, OAM_COMPRESSION_T3_CONTROL, OAM_LAT_MEASURE_ENABLE, 0);
847852
}
848853

849854
static void xe_oa_stream_destroy(struct xe_oa_stream *stream)
@@ -1111,9 +1116,13 @@ static int xe_oa_enable_metric_set(struct xe_oa_stream *stream)
11111116
*/
11121117
sqcnt1 = SQCNT1_PMON_ENABLE |
11131118
(HAS_OA_BPC_REPORTING(stream->oa->xe) ? SQCNT1_OABPC : 0);
1114-
11151119
xe_mmio_rmw32(mmio, XELPMP_SQCNT1, 0, sqcnt1);
11161120

1121+
if ((stream->oa_unit->type == DRM_XE_OA_UNIT_TYPE_OAM ||
1122+
stream->oa_unit->type == DRM_XE_OA_UNIT_TYPE_OAM_SAG) &&
1123+
GRAPHICS_VER(stream->oa->xe) >= 30)
1124+
xe_mmio_rmw32(mmio, OAM_COMPRESSION_T3_CONTROL, 0, OAM_LAT_MEASURE_ENABLE);
1125+
11171126
/* Configure OAR/OAC */
11181127
if (stream->exec_q) {
11191128
ret = xe_oa_configure_oa_context(stream, true);
@@ -2190,6 +2199,7 @@ static const struct xe_mmio_range gen12_oa_mux_regs[] = {
21902199
static const struct xe_mmio_range xe2_oa_mux_regs[] = {
21912200
{ .start = 0x5194, .end = 0x5194 }, /* SYS_MEM_LAT_MEASURE_MERTF_GRP_3D */
21922201
{ .start = 0x8704, .end = 0x8704 }, /* LMEM_LAT_MEASURE_MCFG_GRP */
2202+
{ .start = 0xB01C, .end = 0xB01C }, /* LNCF_MISC_CONFIG_REGISTER0 */
21932203
{ .start = 0xB1BC, .end = 0xB1BC }, /* L3_BANK_LAT_MEASURE_LBCF_GFX */
21942204
{ .start = 0xD0E0, .end = 0xD0F4 }, /* VISACTL */
21952205
{ .start = 0xE18C, .end = 0xE18C }, /* SAMPLER_MODE */

0 commit comments

Comments
 (0)