Skip to content

Commit 8a734b9

Browse files
committed
drm/xe: Fix PVC RPe and RPa information
A simple lazy buggy copy and paste of the PVC comment has brought the attention to the incorrect masks of the PVC register for RPa and RPe. So, let's fix them all. Cc: Lucas De Marchi <[email protected]> Cc: Vinay Belgaumkar <[email protected]> Reviewed-by: Vinay Belgaumkar <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent dac328d commit 8a734b9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

drivers/gpu/drm/xe/xe_guc_pc.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -363,16 +363,17 @@ static void tgl_update_rpa_value(struct xe_guc_pc *pc)
363363
u32 reg;
364364

365365
/*
366-
* For PVC we still need to use fused RP1 as the approximation for RPe
367-
* For other platforms than PVC we get the resolved RPe directly from
366+
* For PVC we still need to use fused RP0 as the approximation for RPa
367+
* For other platforms than PVC we get the resolved RPa directly from
368368
* PCODE at a different register
369369
*/
370-
if (xe->info.platform == XE_PVC)
370+
if (xe->info.platform == XE_PVC) {
371371
reg = xe_mmio_read32(&gt->mmio, PVC_RP_STATE_CAP);
372-
else
372+
pc->rpa_freq = REG_FIELD_GET(RP0_MASK, reg) * GT_FREQUENCY_MULTIPLIER;
373+
} else {
373374
reg = xe_mmio_read32(&gt->mmio, FREQ_INFO_REC);
374-
375-
pc->rpa_freq = REG_FIELD_GET(RPA_MASK, reg) * GT_FREQUENCY_MULTIPLIER;
375+
pc->rpa_freq = REG_FIELD_GET(RPA_MASK, reg) * GT_FREQUENCY_MULTIPLIER;
376+
}
376377
}
377378

378379
static void tgl_update_rpe_value(struct xe_guc_pc *pc)
@@ -386,12 +387,13 @@ static void tgl_update_rpe_value(struct xe_guc_pc *pc)
386387
* For other platforms than PVC we get the resolved RPe directly from
387388
* PCODE at a different register
388389
*/
389-
if (xe->info.platform == XE_PVC)
390+
if (xe->info.platform == XE_PVC) {
390391
reg = xe_mmio_read32(&gt->mmio, PVC_RP_STATE_CAP);
391-
else
392+
pc->rpe_freq = REG_FIELD_GET(RP1_MASK, reg) * GT_FREQUENCY_MULTIPLIER;
393+
} else {
392394
reg = xe_mmio_read32(&gt->mmio, FREQ_INFO_REC);
393-
394-
pc->rpe_freq = REG_FIELD_GET(RPE_MASK, reg) * GT_FREQUENCY_MULTIPLIER;
395+
pc->rpe_freq = REG_FIELD_GET(RPE_MASK, reg) * GT_FREQUENCY_MULTIPLIER;
396+
}
395397
}
396398

397399
static void pc_update_rp_values(struct xe_guc_pc *pc)

0 commit comments

Comments
 (0)