Skip to content

Commit eef3ede

Browse files
aradhyab7lucasdemarchi
authored andcommitted
drm/xe/oa: Refactor WAs to use XE_WA() macro
Refactor Wa_18013179988, Wa_14015568240, Wa_1508761755, and Wa_1509372804, to use the proper workaround-check implementation for out-of-band workarounds, XE_WA(), and drop the use of the platform based WA selection. Reviewed-by: Tejas Upadhyay <[email protected]> Reviewed-by: Lucas De Marchi <[email protected]> Signed-off-by: Aradhya Bhatia <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 8c5fe7d commit eef3ede

File tree

2 files changed

+14
-21
lines changed

2 files changed

+14
-21
lines changed

drivers/gpu/drm/xe/xe_oa.c

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <drm/drm_managed.h>
1313
#include <uapi/drm/xe_drm.h>
1414

15+
#include <generated/xe_wa_oob.h>
16+
1517
#include "abi/guc_actions_slpc_abi.h"
1618
#include "instructions/xe_mi_commands.h"
1719
#include "regs/xe_engine_regs.h"
@@ -35,6 +37,7 @@
3537
#include "xe_sched_job.h"
3638
#include "xe_sriov.h"
3739
#include "xe_sync.h"
40+
#include "xe_wa.h"
3841

3942
#define DEFAULT_POLL_FREQUENCY_HZ 200
4043
#define DEFAULT_POLL_PERIOD_NS (NSEC_PER_SEC / DEFAULT_POLL_FREQUENCY_HZ)
@@ -812,11 +815,8 @@ static void xe_oa_disable_metric_set(struct xe_oa_stream *stream)
812815
struct xe_mmio *mmio = &stream->gt->mmio;
813816
u32 sqcnt1;
814817

815-
/*
816-
* Wa_1508761755:xehpsdv, dg2
817-
* Enable thread stall DOP gating and EU DOP gating.
818-
*/
819-
if (stream->oa->xe->info.platform == XE_DG2) {
818+
/* Enable thread stall DOP gating and EU DOP gating. */
819+
if (XE_WA(stream->gt, 1508761755)) {
820820
xe_gt_mcr_multicast_write(stream->gt, ROW_CHICKEN,
821821
_MASKED_BIT_DISABLE(STALL_DOP_GATING_DISABLE));
822822
xe_gt_mcr_multicast_write(stream->gt, ROW_CHICKEN2,
@@ -1065,11 +1065,10 @@ static int xe_oa_enable_metric_set(struct xe_oa_stream *stream)
10651065
int ret;
10661066

10671067
/*
1068-
* Wa_1508761755:xehpsdv, dg2
10691068
* EU NOA signals behave incorrectly if EU clock gating is enabled.
10701069
* Disable thread stall DOP gating and EU DOP gating.
10711070
*/
1072-
if (stream->oa->xe->info.platform == XE_DG2) {
1071+
if (XE_WA(stream->gt, 1508761755)) {
10731072
xe_gt_mcr_multicast_write(stream->gt, ROW_CHICKEN,
10741073
_MASKED_BIT_ENABLE(STALL_DOP_GATING_DISABLE));
10751074
xe_gt_mcr_multicast_write(stream->gt, ROW_CHICKEN2,
@@ -1720,12 +1719,10 @@ static int xe_oa_stream_init(struct xe_oa_stream *stream,
17201719
}
17211720

17221721
/*
1723-
* Wa_1509372804:pvc
1724-
*
17251722
* GuC reset of engines causes OA to lose configuration
17261723
* state. Prevent this by overriding GUCRC mode.
17271724
*/
1728-
if (stream->oa->xe->info.platform == XE_PVC) {
1725+
if (XE_WA(stream->gt, 1509372804)) {
17291726
ret = xe_guc_pc_override_gucrc_mode(&gt->uc.guc.pc,
17301727
SLPC_GUCRC_MODE_GUCRC_NO_RC6);
17311728
if (ret)
@@ -1857,23 +1854,14 @@ u32 xe_oa_timestamp_frequency(struct xe_gt *gt)
18571854
{
18581855
u32 reg, shift;
18591856

1860-
/*
1861-
* Wa_18013179988:dg2
1862-
* Wa_14015568240:pvc
1863-
* Wa_14015846243:mtl
1864-
*/
1865-
switch (gt_to_xe(gt)->info.platform) {
1866-
case XE_DG2:
1867-
case XE_PVC:
1868-
case XE_METEORLAKE:
1857+
if (XE_WA(gt, 18013179988) || XE_WA(gt, 14015568240)) {
18691858
xe_pm_runtime_get(gt_to_xe(gt));
18701859
reg = xe_mmio_read32(&gt->mmio, RPM_CONFIG0);
18711860
xe_pm_runtime_put(gt_to_xe(gt));
18721861

18731862
shift = REG_FIELD_GET(RPM_CONFIG0_CTC_SHIFT_PARAMETER_MASK, reg);
18741863
return gt->info.reference_clock << (3 - shift);
1875-
1876-
default:
1864+
} else {
18771865
return gt->info.reference_clock;
18781866
}
18791867
}

drivers/gpu/drm/xe/xe_wa_oob.rules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,8 @@ no_media_l3 MEDIA_VERSION(3000)
4747
MEDIA_VERSION(1300)
4848
14016712196 GRAPHICS_VERSION(1255)
4949
GRAPHICS_VERSION_RANGE(1270, 1274)
50+
14015568240 GRAPHICS_VERSION_RANGE(1255, 1260)
51+
18013179988 GRAPHICS_VERSION(1255)
52+
GRAPHICS_VERSION_RANGE(1270, 1274)
53+
1508761755 GRAPHICS_VERSION(1255)
54+
GRAPHICS_VERSION(1260), GRAPHICS_STEP(A0, B0)

0 commit comments

Comments
 (0)