mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-06 13:09:58 +00:00
drm/xe/lnl: Enable GuC Wa_14019882105
Enable GuC Wa_14019882105 to block interrupts during C6 flow when the memory path has been blocked v2: Make helper function generic and name it as guc_waklv_enable_simple (John Harrison) v3: Make warning descriptive (John Harrison) v4: s/drm_WARN/xe_gt_WARN/ (Michal) Cc: John Harrison <john.harrison@intel.com> Signed-off-by: Badal Nilawar <badal.nilawar@intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240405084231.3620848-3-badal.nilawar@intel.com
This commit is contained in:
parent
d6da81a478
commit
c151ff5c90
@ -319,4 +319,11 @@ enum {
|
|||||||
#define GUC_KLV_VF_CFG_BEGIN_CONTEXT_ID_KEY 0x8a0b
|
#define GUC_KLV_VF_CFG_BEGIN_CONTEXT_ID_KEY 0x8a0b
|
||||||
#define GUC_KLV_VF_CFG_BEGIN_CONTEXT_ID_LEN 1u
|
#define GUC_KLV_VF_CFG_BEGIN_CONTEXT_ID_LEN 1u
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Workaround keys:
|
||||||
|
*/
|
||||||
|
enum xe_guc_klv_ids {
|
||||||
|
GUC_WORKAROUND_KLV_BLOCK_INTERRUPTS_WHEN_MGSR_BLOCKED = 0x9002,
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
#include <drm/drm_managed.h>
|
#include <drm/drm_managed.h>
|
||||||
|
|
||||||
|
#include <generated/xe_wa_oob.h>
|
||||||
|
|
||||||
#include "regs/xe_engine_regs.h"
|
#include "regs/xe_engine_regs.h"
|
||||||
#include "regs/xe_gt_regs.h"
|
#include "regs/xe_gt_regs.h"
|
||||||
#include "regs/xe_guc_regs.h"
|
#include "regs/xe_guc_regs.h"
|
||||||
@ -19,6 +21,7 @@
|
|||||||
#include "xe_map.h"
|
#include "xe_map.h"
|
||||||
#include "xe_mmio.h"
|
#include "xe_mmio.h"
|
||||||
#include "xe_platform_types.h"
|
#include "xe_platform_types.h"
|
||||||
|
#include "xe_wa.h"
|
||||||
|
|
||||||
/* Slack of a few additional entries per engine */
|
/* Slack of a few additional entries per engine */
|
||||||
#define ADS_REGSET_EXTRA_MAX 8
|
#define ADS_REGSET_EXTRA_MAX 8
|
||||||
@ -279,21 +282,42 @@ static size_t calculate_golden_lrc_size(struct xe_guc_ads *ads)
|
|||||||
return total_size;
|
return total_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void guc_waklv_enable_simple(struct xe_guc_ads *ads,
|
||||||
|
enum xe_guc_klv_ids klv_id, u32 *offset, u32 *remain)
|
||||||
|
{
|
||||||
|
u32 klv_entry[] = {
|
||||||
|
/* 16:16 key/length */
|
||||||
|
FIELD_PREP(GUC_KLV_0_KEY, klv_id) |
|
||||||
|
FIELD_PREP(GUC_KLV_0_LEN, 0),
|
||||||
|
/* 0 dwords data */
|
||||||
|
};
|
||||||
|
u32 size;
|
||||||
|
|
||||||
|
size = sizeof(klv_entry);
|
||||||
|
|
||||||
|
if (xe_gt_WARN(ads_to_gt(ads), *remain < size,
|
||||||
|
"w/a klv buffer too small to add klv id %d\n", klv_id))
|
||||||
|
return;
|
||||||
|
|
||||||
|
xe_map_memcpy_to(ads_to_xe(ads), ads_to_map(ads), *offset,
|
||||||
|
klv_entry, size);
|
||||||
|
*offset += size;
|
||||||
|
*remain -= size;
|
||||||
|
}
|
||||||
|
|
||||||
static void guc_waklv_init(struct xe_guc_ads *ads)
|
static void guc_waklv_init(struct xe_guc_ads *ads)
|
||||||
{
|
{
|
||||||
|
struct xe_gt *gt = ads_to_gt(ads);
|
||||||
u64 addr_ggtt;
|
u64 addr_ggtt;
|
||||||
u32 offset, remain, size;
|
u32 offset, remain, size;
|
||||||
|
|
||||||
offset = guc_ads_waklv_offset(ads);
|
offset = guc_ads_waklv_offset(ads);
|
||||||
remain = guc_ads_waklv_size(ads);
|
remain = guc_ads_waklv_size(ads);
|
||||||
|
|
||||||
/* Add workarounds here
|
if (XE_WA(gt, 14019882105))
|
||||||
*
|
guc_waklv_enable_simple(ads,
|
||||||
* if (XE_WA(gt, wa_id))
|
GUC_WORKAROUND_KLV_BLOCK_INTERRUPTS_WHEN_MGSR_BLOCKED,
|
||||||
* guc_waklv_enable_simple(ads,
|
&offset, &remain);
|
||||||
* wa_klv_id,
|
|
||||||
* &offset, &remain);
|
|
||||||
*/
|
|
||||||
|
|
||||||
size = guc_ads_waklv_size(ads) - remain;
|
size = guc_ads_waklv_size(ads) - remain;
|
||||||
if (!size)
|
if (!size)
|
||||||
|
@ -20,3 +20,4 @@
|
|||||||
MEDIA_VERSION(1300)
|
MEDIA_VERSION(1300)
|
||||||
PLATFORM(DG2)
|
PLATFORM(DG2)
|
||||||
14018094691 GRAPHICS_VERSION(2004)
|
14018094691 GRAPHICS_VERSION(2004)
|
||||||
|
14019882105 GRAPHICS_VERSION(2004), GRAPHICS_STEP(A0, B0)
|
||||||
|
Loading…
Reference in New Issue
Block a user