From: Matthew Brost <matthew.brost@intel.com>
To: Oak Zeng <oak.zeng@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
<Thomas.Hellstrom@linux.intel.com>, <jonathan.cavitt@intel.com>
Subject: Re: [PATCH 1/3] drm/xe: Introduced needs_scratch bit in device descriptor
Date: Tue, 25 Feb 2025 14:13:09 -0800 [thread overview]
Message-ID: <Z75AdSXMB5i6MzZj@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20250213022331.265424-1-oak.zeng@intel.com>
On Wed, Feb 12, 2025 at 09:23:29PM -0500, Oak Zeng wrote:
Again, replied to wrong version earilier. Please include version number
in patches.
Copy / pasting my reply here.
> On some platform, scratch page is needed for out of bound prefetch
> to work. Introduce a bit in device descriptor to specify whether
> this device needs scratch page to work.
>
> v2: introduce a needs_scratch bit in device info (Thomas, Jonathan)
>
> Signed-off-by: Oak Zeng <oak.zeng@intel.com>
> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> ---
> drivers/gpu/drm/xe/xe_device_types.h | 3 +++
> drivers/gpu/drm/xe/xe_pci.c | 5 +++++
> 2 files changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
> index 833c29fed3a3..a5ba9e4e470f 100644
> --- a/drivers/gpu/drm/xe/xe_device_types.h
> +++ b/drivers/gpu/drm/xe/xe_device_types.h
> @@ -46,6 +46,7 @@ struct xe_pxp;
> #define GRAPHICS_VERx100(xe) ((xe)->info.graphics_verx100)
> #define MEDIA_VERx100(xe) ((xe)->info.media_verx100)
> #define IS_DGFX(xe) ((xe)->info.is_dgfx)
> +#define NEEDS_SCRATCH(xe) ((xe)->info.needs_scratch)
>
I'd drop this macro. These are leftovers from the i915 code and I see
little value in a macro rather than looking directly at a field. In the
existing cases these macros are used all over the code so they make a
little more sense so if change the variable we only have change this
macro, but in this new case the macro is used 2 places in the code so
I'd say just look at the variable.
Matt
> #define XE_VRAM_FLAGS_NEED64K BIT(0)
>
> @@ -318,6 +319,8 @@ struct xe_device {
> u8 has_usm:1;
> /** @info.is_dgfx: is discrete device */
> u8 is_dgfx:1;
> + /** @info.needs_scratch: needs scratch page for oob prefetch to work */
> + u8 needs_scratch:1;
> /**
> * @info.probe_display: Probe display hardware. If set to
> * false, the driver will behave as if there is no display
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 6a8e82aff385..c614f673efa5 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -67,6 +67,7 @@ struct xe_device_desc {
> u8 has_llc:1;
> u8 has_pxp:1;
> u8 has_sriov:1;
> + u8 needs_scratch:1;
> u8 skip_guc_pc:1;
> u8 skip_mtcfg:1;
> u8 skip_pcode:1;
> @@ -353,6 +354,7 @@ static const struct xe_device_desc lnl_desc = {
> .dma_mask_size = 46,
> .has_display = true,
> .has_pxp = true,
> + .needs_scratch = true,
> };
>
> static const struct xe_device_desc bmg_desc = {
> @@ -361,6 +363,7 @@ static const struct xe_device_desc bmg_desc = {
> .dma_mask_size = 46,
> .has_display = true,
> .has_heci_cscfi = 1,
> + .needs_scratch = true,
> };
>
> static const struct xe_device_desc ptl_desc = {
> @@ -369,6 +372,7 @@ static const struct xe_device_desc ptl_desc = {
> .has_display = true,
> .has_sriov = true,
> .require_force_probe = true,
> + .needs_scratch = true,
> };
>
> #undef PLATFORM
> @@ -644,6 +648,7 @@ static int xe_info_init_early(struct xe_device *xe,
> xe->info.skip_guc_pc = desc->skip_guc_pc;
> xe->info.skip_mtcfg = desc->skip_mtcfg;
> xe->info.skip_pcode = desc->skip_pcode;
> + xe->info.needs_scratch = desc->needs_scratch;
>
> xe->info.probe_display = IS_ENABLED(CONFIG_DRM_XE_DISPLAY) &&
> xe_modparam.probe_display &&
> --
> 2.26.3
>
next prev parent reply other threads:[~2025-02-25 22:12 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 2:23 [PATCH 1/3] drm/xe: Introduced needs_scratch bit in device descriptor Oak Zeng
2025-02-13 2:16 ` ✓ CI.Patch_applied: success for series starting with [1/3] " Patchwork
2025-02-13 2:16 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-13 2:18 ` ✓ CI.KUnit: success " Patchwork
2025-02-13 2:23 ` [PATCH 2/3] drm/xe: Clear scratch page on vm_bind Oak Zeng
2025-02-19 17:47 ` Matthew Brost
2025-02-19 20:19 ` Zeng, Oak
2025-02-19 20:46 ` Matthew Brost
2025-02-20 21:09 ` Matthew Brost
2025-02-25 22:54 ` Matthew Brost
2025-02-26 18:49 ` Zeng, Oak
2025-02-26 21:44 ` Matthew Brost
2025-02-13 2:23 ` [PATCH 3/3] drm/xe: Allow scratch page under fault mode for certain platform Oak Zeng
2025-02-25 22:10 ` Matthew Brost
2025-02-26 22:12 ` Zeng, Oak
2025-02-27 0:22 ` Matthew Brost
2025-02-13 2:34 ` ✓ CI.Build: success for series starting with [1/3] drm/xe: Introduced needs_scratch bit in device descriptor Patchwork
2025-02-13 2:37 ` ✓ CI.Hooks: " Patchwork
2025-02-13 2:38 ` ✓ CI.checksparse: " Patchwork
2025-02-13 2:58 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-13 14:56 ` ✗ Xe.CI.Full: failure " Patchwork
2025-02-24 15:40 ` [PATCH 1/3] " Zeng, Oak
2025-02-24 17:27 ` Matthew Brost
2025-02-25 22:13 ` Matthew Brost [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-02-06 21:38 Oak Zeng
2025-02-06 2:11 Oak Zeng
2025-02-04 18:45 Oak Zeng
2025-02-05 13:16 ` Thomas Hellström
2025-02-25 21:37 ` Matthew Brost
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=Z75AdSXMB5i6MzZj@lstrano-desk.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=Thomas.Hellstrom@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jonathan.cavitt@intel.com \
--cc=oak.zeng@intel.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