intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH 1/6] drm/xe: Fix meteorlake stolen memory
Date: Tue, 4 Apr 2023 10:42:35 -0700	[thread overview]
Message-ID: <20230404174235.34qocr4sg4f2essm@ldmartin-desk2.lan> (raw)
In-Reply-To: <20230331102419.521392-2-maarten.lankhorst@linux.intel.com>

On Fri, Mar 31, 2023 at 12:24:14PM +0200, Maarten Lankhorst wrote:
>MTL should use bar2 to access stolen memory, not the physical addresses
>directly. Correct the GPU address to point to stolen base, and set the
>VRAM flag to indicate it's in device memory.

humn... shouldn't the commit message point that for integrated the
address for stolen is an offset from the base rather than the physical
address?  It was already using bar2, but with the wrong address.

>
>Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>


Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

thanks
Lucas De Marchi

>---
> drivers/gpu/drm/xe/xe_bo.c             | 3 ++-
> drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 3 ++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
>index e4d079b61d52..9b2f95f3ce49 100644
>--- a/drivers/gpu/drm/xe/xe_bo.c
>+++ b/drivers/gpu/drm/xe/xe_bo.c
>@@ -47,7 +47,8 @@ bool mem_type_is_vram(u32 mem_type)
>
> static bool resource_is_stolen_vram(struct xe_device *xe, struct ttm_resource *res)
> {
>-	return res->mem_type == XE_PL_STOLEN && IS_DGFX(xe);
>+	return res->mem_type == XE_PL_STOLEN &&
>+	       (IS_DGFX(xe) || !xe_ttm_stolen_cpu_access_needs_ggtt(xe));
> }
>
> static bool resource_is_vram(struct ttm_resource *res)
>diff --git a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>index 31887fec1073..bd1b73fa84a5 100644
>--- a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>+++ b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>@@ -94,7 +94,8 @@ static u32 detect_bar2_integrated(struct xe_device *xe, struct xe_ttm_stolen_mgr
> 	if (drm_WARN_ON(&xe->drm, (ggc & GGMS_MASK) != GGMS_MASK))
> 		return 0;
>
>-	mgr->stolen_base = mgr->io_base = pci_resource_start(pdev, 2) + SZ_8M;
>+	mgr->io_base = pci_resource_start(pdev, 2) + SZ_8M;
>+	mgr->stolen_base = SZ_8M;
>
> 	/* return valid GMS value, -EIO if invalid */
> 	gms = REG_FIELD_GET(GMS_MASK, ggc);
>-- 
>2.34.1
>

  reply	other threads:[~2023-04-04 17:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 10:24 [Intel-xe] [PATCH 0/6] drm/xe: Meteorlake fixes Maarten Lankhorst
2023-03-31 10:24 ` [Intel-xe] [PATCH 1/6] drm/xe: Fix meteorlake stolen memory Maarten Lankhorst
2023-04-04 17:42   ` Lucas De Marchi [this message]
2023-03-31 10:24 ` [Intel-xe] [PATCH 2/6] drm/xe: Use full_gt batchbuffer allocation for media tiles Maarten Lankhorst
2023-04-03 20:27   ` Matt Roper
2023-04-04  6:59     ` Maarten Lankhorst
2023-04-06 14:17       ` Matt Roper
2023-03-31 10:24 ` [Intel-xe] [PATCH 3/6] drm/i915: Fix comparison in intel_dram Maarten Lankhorst
2023-04-03 20:35   ` Matt Roper
2023-04-03 20:48     ` [Intel-xe] [Intel-gfx] " Ville Syrjälä
2023-04-04  6:51     ` [Intel-xe] " Maarten Lankhorst
2023-04-04  0:10   ` [Intel-xe] [Intel-gfx] " Lucas De Marchi
2023-03-31 10:24 ` [Intel-xe] [PATCH 4/6] drm/xe: Fix XE_LPDP and meteorlake display info Maarten Lankhorst
2023-04-04 17:57   ` Lucas De Marchi
2023-03-31 10:24 ` [Intel-xe] [PATCH 5/6] drm/xe: Build soc files directly Maarten Lankhorst
2023-03-31 11:49   ` Jani Nikula
2023-03-31 12:01     ` Maarten Lankhorst
2023-04-03  8:12       ` Jani Nikula
2023-04-03 10:28         ` [Intel-xe] [PATCH v2 " Maarten Lankhorst
2023-04-19 14:43           ` Jani Nikula
2023-03-31 10:24 ` [Intel-xe] [PATCH 6/6] drm/xe: Fixup __intel_de_wait_for_register macro Maarten Lankhorst
2023-04-04 18:05   ` Lucas De Marchi
2023-03-31 10:26 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: Meteorlake fixes Patchwork
2023-03-31 10:27 ` [Intel-xe] ✗ CI.KUnit: failure " Patchwork
2023-04-03 10:31 ` [Intel-xe] ✗ CI.Patch_applied: failure for drm/xe: Meteorlake fixes. (rev2) Patchwork

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=20230404174235.34qocr4sg4f2essm@ldmartin-desk2.lan \
    --to=lucas.demarchi@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.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;
as well as URLs for NNTP newsgroup(s).