From: "Souza, Jose" <jose.souza@intel.com>
To: "Roper, Matthew D" <matthew.d.roper@intel.com>
Cc: "Nikula, Jani" <jani.nikula@intel.com>,
"dev@lankhorst.se" <dev@lankhorst.se>,
"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v3 1/6] drm/xe: Add functions to convert regular address to canonical address and back
Date: Mon, 29 Jan 2024 21:24:02 +0000 [thread overview]
Message-ID: <c6d6715dac41865d1fb3f730e70c433ff8ec5d0f.camel@intel.com> (raw)
In-Reply-To: <20240129211334.GK5506@mdroper-desk1.amr.corp.intel.com>
On Mon, 2024-01-29 at 13:13 -0800, Matt Roper wrote:
> On Mon, Jan 29, 2024 at 10:17:37AM -0800, José Roberto de Souza wrote:
> > Some instructions requires canonical address like
> > MI_BATCH_BUFFER_START(UMDs must call xe_exec with a canonical address
> > for Xe2+).
> >
> > So here adding functions to convert regular address to canonical
> > address and back, the first user of this functions will be added
> > in the next patches.
> >
> > v3:
> > - inline removed
> > - rename highest_address_bit_get() to ppgtt_msb_get()
> >
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Maarten Lankhorst <dev@lankhorst.se>
> > Cc: Stuart Summers <stuart.summers@intel.com>
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> > drivers/gpu/drm/xe/xe_device.c | 15 +++++++++++++++
> > drivers/gpu/drm/xe/xe_device.h | 3 +++
> > 2 files changed, 18 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> > index 6faa7865b1aab..6172d4f987937 100644
> > --- a/drivers/gpu/drm/xe/xe_device.c
> > +++ b/drivers/gpu/drm/xe/xe_device.c
> > @@ -747,3 +747,18 @@ void xe_device_snapshot_print(struct xe_device *xe, struct drm_printer *p)
> > drm_printf(p, "\tCS reference clock: %u\n", gt->info.reference_clock);
> > }
> > }
> > +
> > +static int ppgtt_msb_get(struct xe_device *xe)
> > +{
> > + return xe->info.dma_mask_size > 48 ? 57 : 47;
>
> Can we just use (xe->info.va_bits - 1)? As far as I can tell, what we
> really care about for canonical form is the size of the PPGTT virtual
> address space, not the DMA mask, right? That also matches platforms
> like Xe_LP better where:
>
> .dma_mask_size = 39,
> .va_bits = 48,
>
ouch, missed va_bits while rebasing this patch.
thanks for pointing out.
>
>
>
> Matt
>
> > +}
> > +
> > +u64 xe_device_canonicalize_addr(struct xe_device *xe, u64 address)
> > +{
> > + return sign_extend64(address, ppgtt_msb_get(xe));
> > +}
> > +
> > +u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address)
> > +{
> > + return address & GENMASK_ULL(ppgtt_msb_get(xe), 0);
> > +}
> > diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
> > index 270124da1e00e..462f59e902b12 100644
> > --- a/drivers/gpu/drm/xe/xe_device.h
> > +++ b/drivers/gpu/drm/xe/xe_device.h
> > @@ -177,4 +177,7 @@ u32 xe_device_ccs_bytes(struct xe_device *xe, u64 size);
> >
> > void xe_device_snapshot_print(struct xe_device *xe, struct drm_printer *p);
> >
> > +u64 xe_device_canonicalize_addr(struct xe_device *xe, u64 address);
> > +u64 xe_device_uncanonicalize_addr(struct xe_device *xe, u64 address);
> > +
> > #endif
> > --
> > 2.43.0
> >
>
prev parent reply other threads:[~2024-01-29 21:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-29 18:17 [PATCH v3 1/6] drm/xe: Add functions to convert regular address to canonical address and back José Roberto de Souza
2024-01-29 18:17 ` [PATCH v3 2/6] drm/xe: Add batch buffer addresses to devcoredump José Roberto de Souza
2024-01-29 18:17 ` [PATCH v3 3/6] drm/xe: Store xe_he_engine in xe_hw_engine_snapshot José Roberto de Souza
2024-01-29 21:16 ` Matt Roper
2024-01-29 21:20 ` Souza, Jose
2024-01-29 18:17 ` [PATCH v3 4/6] drm/xe: Add misc functions to support read of specific DSS registers José Roberto de Souza
2024-01-29 21:24 ` Matt Roper
2024-01-30 14:42 ` Souza, Jose
2024-01-30 15:54 ` Dong, Zhanjun
2024-01-30 16:14 ` Souza, Jose
2024-01-30 16:52 ` Dong, Zhanjun
2024-01-29 18:17 ` [PATCH v3 5/6] drm/xe: Move XE_MAX_EU_FUSE_BITS to xe_gt_types.h José Roberto de Souza
2024-01-29 18:17 ` [PATCH v3 6/6] drm/xe: Add INSTDONE registers to devcoredump José Roberto de Souza
2024-01-29 18:21 ` ✓ CI.Patch_applied: success for series starting with [v3,1/6] drm/xe: Add functions to convert regular address to canonical address and back Patchwork
2024-01-29 18:21 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-29 18:22 ` ✓ CI.KUnit: success " Patchwork
2024-01-29 18:29 ` ✓ CI.Build: " Patchwork
2024-01-29 18:30 ` ✗ CI.Hooks: failure " Patchwork
2024-01-29 18:31 ` ✓ CI.checksparse: success " Patchwork
2024-01-29 18:55 ` ✓ CI.BAT: " Patchwork
2024-01-29 21:13 ` [PATCH v3 1/6] " Matt Roper
2024-01-29 21:24 ` Souza, Jose [this message]
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=c6d6715dac41865d1fb3f730e70c433ff8ec5d0f.camel@intel.com \
--to=jose.souza@intel.com \
--cc=dev@lankhorst.se \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=rodrigo.vivi@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