summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_guc.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2023-04-17 09:54:14 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-20 02:31:46 +0300
commite8178f8076dedf8526f8dc78f8fb9b3017991641 (patch)
treeda35cb918e2865df6528216e80bda10d97207676 /drivers/gpu/drm/xe/xe_guc.c
parent56492dacee943dd8241e29fe6a2d698d0029035c (diff)
downloadlinux-e8178f8076dedf8526f8dc78f8fb9b3017991641.tar.xz
drm/xe/guc: Rename GEN11_SOFT_SCRATCH for clarity
That register is a completely different register, it's not the same as SOFT_SCRATCH for GEN11 and beyond. Rename to to the same name as the bspec uses, including the new variant for media. Also, move the definitions to the guc header. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_guc.c')
-rw-r--r--drivers/gpu/drm/xe/xe_guc.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
index ee71b969bcbf..ff2df4f30e97 100644
--- a/drivers/gpu/drm/xe/xe_guc.c
+++ b/drivers/gpu/drm/xe/xe_guc.c
@@ -622,9 +622,6 @@ int xe_guc_auth_huc(struct xe_guc *guc, u32 rsa_addr)
return xe_guc_ct_send_block(&guc->ct, action, ARRAY_SIZE(action));
}
-#define MEDIA_SOFT_SCRATCH(n) _MMIO(0x190310 + (n) * 4)
-#define MEDIA_SOFT_SCRATCH_COUNT 4
-
int xe_guc_mmio_send_recv(struct xe_guc *guc, const u32 *request,
u32 len, u32 *response_buf)
{
@@ -632,15 +629,17 @@ int xe_guc_mmio_send_recv(struct xe_guc *guc, const u32 *request,
struct xe_gt *gt = guc_to_gt(guc);
u32 header, reply;
u32 reply_reg = xe_gt_is_media_type(gt) ?
- MEDIA_SOFT_SCRATCH(0).reg : GEN11_SOFT_SCRATCH(0).reg;
+ MED_VF_SW_FLAG(0).reg : VF_SW_FLAG(0).reg;
+ const u32 LAST_INDEX = VF_SW_FLAG_COUNT;
int ret;
int i;
- BUILD_BUG_ON(GEN11_SOFT_SCRATCH_COUNT != MEDIA_SOFT_SCRATCH_COUNT);
+ BUILD_BUG_ON(VF_SW_FLAG_COUNT != MED_VF_SW_FLAG_COUNT);
+
XE_BUG_ON(guc->ct.enabled);
XE_BUG_ON(!len);
- XE_BUG_ON(len > GEN11_SOFT_SCRATCH_COUNT);
- XE_BUG_ON(len > MEDIA_SOFT_SCRATCH_COUNT);
+ XE_BUG_ON(len > VF_SW_FLAG_COUNT);
+ XE_BUG_ON(len > MED_VF_SW_FLAG_COUNT);
XE_BUG_ON(FIELD_GET(GUC_HXG_MSG_0_ORIGIN, request[0]) !=
GUC_HXG_ORIGIN_HOST);
XE_BUG_ON(FIELD_GET(GUC_HXG_MSG_0_TYPE, request[0]) !=
@@ -650,17 +649,14 @@ retry:
/* Not in critical data-path, just do if else for GT type */
if (xe_gt_is_media_type(gt)) {
for (i = 0; i < len; ++i)
- xe_mmio_write32(gt, MEDIA_SOFT_SCRATCH(i).reg,
+ xe_mmio_write32(gt, MED_VF_SW_FLAG(i).reg,
request[i]);
-#define LAST_INDEX MEDIA_SOFT_SCRATCH_COUNT - 1
- xe_mmio_read32(gt, MEDIA_SOFT_SCRATCH(LAST_INDEX).reg);
+ xe_mmio_read32(gt, MED_VF_SW_FLAG(LAST_INDEX).reg);
} else {
for (i = 0; i < len; ++i)
- xe_mmio_write32(gt, GEN11_SOFT_SCRATCH(i).reg,
+ xe_mmio_write32(gt, VF_SW_FLAG(i).reg,
request[i]);
-#undef LAST_INDEX
-#define LAST_INDEX GEN11_SOFT_SCRATCH_COUNT - 1
- xe_mmio_read32(gt, GEN11_SOFT_SCRATCH(LAST_INDEX).reg);
+ xe_mmio_read32(gt, VF_SW_FLAG(LAST_INDEX).reg);
}
xe_guc_notify(guc);
@@ -724,7 +720,7 @@ proto:
if (response_buf) {
response_buf[0] = header;
- for (i = 1; i < GEN11_SOFT_SCRATCH_COUNT; i++)
+ for (i = 1; i < VF_SW_FLAG_COUNT; i++)
response_buf[i] =
xe_mmio_read32(gt, reply_reg + i * sizeof(u32));
}