From: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>,
Oded Gabbay <ogabbay@kernel.org>,
Jeffrey Hugo <quic_jhugo@quicinc.com>,
Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>,
Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Subject: [PATCH 3/7] accel/ivpu: Do not use SSID 1
Date: Wed, 22 Mar 2023 10:18:56 +0100 [thread overview]
Message-ID: <20230322091900.1982453-4-stanislaw.gruszka@linux.intel.com> (raw)
In-Reply-To: <20230322091900.1982453-1-stanislaw.gruszka@linux.intel.com>
The SSID=1 is used by the firmware as default value in
case SSID mapping is not initialized. This allows
detecting use of miss-configured memory contexts.
The future FW versions may not allow using SSID=1.
Co-developed-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
---
drivers/accel/ivpu/ivpu_drv.c | 4 ++--
drivers/accel/ivpu/ivpu_drv.h | 5 ++++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c
index d9e311b40348..70245cf84593 100644
--- a/drivers/accel/ivpu/ivpu_drv.c
+++ b/drivers/accel/ivpu/ivpu_drv.c
@@ -474,8 +474,8 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
vdev->hw->ops = &ivpu_hw_mtl_ops;
vdev->platform = IVPU_PLATFORM_INVALID;
- vdev->context_xa_limit.min = IVPU_GLOBAL_CONTEXT_MMU_SSID + 1;
- vdev->context_xa_limit.max = IVPU_CONTEXT_LIMIT;
+ vdev->context_xa_limit.min = IVPU_USER_CONTEXT_MIN_SSID;
+ vdev->context_xa_limit.max = IVPU_USER_CONTEXT_MAX_SSID;
atomic64_set(&vdev->unique_id_counter, 0);
xa_init_flags(&vdev->context_xa, XA_FLAGS_ALLOC);
xa_init_flags(&vdev->submitted_jobs_xa, XA_FLAGS_ALLOC1);
diff --git a/drivers/accel/ivpu/ivpu_drv.h b/drivers/accel/ivpu/ivpu_drv.h
index 1b2aa05840ad..ef12a38e06e1 100644
--- a/drivers/accel/ivpu/ivpu_drv.h
+++ b/drivers/accel/ivpu/ivpu_drv.h
@@ -25,7 +25,10 @@
#define PCI_DEVICE_ID_MTL 0x7d1d
#define IVPU_GLOBAL_CONTEXT_MMU_SSID 0
-#define IVPU_CONTEXT_LIMIT 64
+/* SSID 1 is used by the VPU to represent invalid context */
+#define IVPU_USER_CONTEXT_MIN_SSID 2
+#define IVPU_USER_CONTEXT_MAX_SSID (IVPU_USER_CONTEXT_MIN_SSID + 63)
+
#define IVPU_NUM_ENGINES 2
#define IVPU_PLATFORM_SILICON 0
--
2.25.1
next prev parent reply other threads:[~2023-03-22 9:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 9:18 [PATCH 0/7] acell/ivpu: Fixes for 6.3 Stanislaw Gruszka
2023-03-22 9:18 ` [PATCH 1/7] accel/ivpu: Do not access HW registers after unbind Stanislaw Gruszka
2023-03-22 14:16 ` Jeffrey Hugo
2023-03-22 9:18 ` [PATCH 2/7] accel/ivpu: Cancel recovery work Stanislaw Gruszka
2023-03-22 14:21 ` Jeffrey Hugo
2023-03-22 14:55 ` Stanislaw Gruszka
2023-03-22 9:18 ` Stanislaw Gruszka [this message]
2023-03-22 14:25 ` [PATCH 3/7] accel/ivpu: Do not use SSID 1 Jeffrey Hugo
2023-03-22 15:10 ` Stanislaw Gruszka
2023-03-22 9:18 ` [PATCH 4/7] accel/ivpu: Fix power down sequence Stanislaw Gruszka
2023-03-22 14:28 ` Jeffrey Hugo
2023-03-22 9:18 ` [PATCH 5/7] accel/ivpu: Disable buttress on device removal Stanislaw Gruszka
2023-03-22 14:33 ` Jeffrey Hugo
2023-03-22 9:18 ` [PATCH 6/7] accel/ivpu: Remove support for 1 tile SKUs Stanislaw Gruszka
2023-03-22 14:36 ` Jeffrey Hugo
2023-03-22 9:19 ` [PATCH 7/7] accel/ivpu: Fix VPU clock calculation Stanislaw Gruszka
2023-03-22 14:52 ` Jeffrey Hugo
2023-03-22 16:28 ` Stanislaw Gruszka
2023-03-23 11:00 ` Stanislaw Gruszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230322091900.1982453-4-stanislaw.gruszka@linux.intel.com \
--to=stanislaw.gruszka@linux.intel.com \
--cc=andrzej.kacprowski@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jacek.lawrynowicz@linux.intel.com \
--cc=ogabbay@kernel.org \
--cc=quic_jhugo@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox