From: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
To: "Das, Nirmoy" <nirmoy.das@linux.intel.com>,
<intel-gfx@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>
Cc: Thomas Hellstr_m <thomas.hellstrom@linux.intel.com>,
michael.cheng@intel.com, Jani Nikula <jani.nikula@intel.com>,
lucas.demarchi@intel.com, Chris Wilson <chris.p.wilson@intel.com>,
siva.mullati@intel.com, David Airlie <airlied@linux.ie>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [Intel-gfx] [PATCH 0/7] drm/i915: Use the memcpy_from_wc function from drm
Date: Wed, 23 Feb 2022 16:38:57 +0530 [thread overview]
Message-ID: <YhYVyZM3TsC5wtL5@bvivekan-mobl.gar.corp.intel.com> (raw)
In-Reply-To: <02d3850b-5481-d142-f1d4-b408ea2b2431@linux.intel.com>
On 23.02.2022 10:02, Das, Nirmoy wrote:
>
> On 22/02/2022 15:51, Balasubramani Vivekanandan wrote:
> > drm_memcpy_from_wc() performs fast copy from WC memory type using
> > non-temporal instructions. Now there are two similar implementations of
> > this function. One exists in drm_cache.c as drm_memcpy_from_wc() and
> > another implementation in i915/i915_memcpy.c as i915_memcpy_from_wc().
> > drm_memcpy_from_wc() was the recent addition through the series
> > https://patchwork.freedesktop.org/patch/436276/?series=90681&rev=6
> >
> > The goal of this patch series is to change all users of
> > i915_memcpy_from_wc() to drm_memcpy_from_wc() and a have common
> > implementation in drm and eventually remove the copy from i915.
> >
> > Another benefit of using memcpy functions from drm is that
> > drm_memcpy_from_wc() is available for non-x86 architectures.
> > i915_memcpy_from_wc() is implemented only for x86 and prevents building
> > i915 for ARM64.
> > drm_memcpy_from_wc() does fast copy using non-temporal instructions for
> > x86 and for other architectures makes use of memcpy() family of
> > functions as fallback.
> >
> > Another major difference is unlike i915_memcpy_from_wc(),
> > drm_memcpy_from_wc() will not fail if the passed address argument is not
> > alignment to be used with non-temporal load instructions or if the
> > platform lacks support for those instructions (non-temporal load
> > instructions are provided through SSE4.1 instruction set extension).
> > Instead drm_memcpy_from_wc() continues with fallback functions to
> > complete the copy.
> > This relieves the caller from checking the return value of
> > i915_memcpy_from_wc() and explicitly using a fallback.
> >
> > Follow up series will be created to remove the memcpy_from_wc functions
> > from i915 once the dependency is completely removed.
>
> Overall the series looks good to me but I think you can add another patch to
> remove
>
> i915_memcpy_from_wc() as I don't see any other usages left after this series, may be I
> am missing something?
I have changed all users of i915_memcpy_from_wc() to drm function. But
this is another function i915_unaligned_memcpy_from_wc() in
i915_memcpy.c which is blocking completely eliminating the i915_memcpy.c
file from i915.
This function accepts unaligned source address and does fast copy only
for the aligned region of memory and remaining part is copied using
memcpy function.
Either I can move i915_unaligned_memcpy_from_wc() also to drm but I am
concerned since it is more a platform specific handling, does it make
sense to keep it in drm.
Else I have retain to i915_unaligned_memcpy_from_wc() inside i915 and
refactor the function to use drm_memcpy_from_wc() instead of the
__memcpy_ntdqu().
But before I could do more changes, I wanted feedback on the current
change. So I decided to go ahead with creating series for review.
Regards,
Bala
>
> Regards,
> Nirmoy
>
> >
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Chris Wilson <chris.p.wilson@intel.com>
> > Cc: Thomas Hellstr_m <thomas.hellstrom@linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> >
> > Balasubramani Vivekanandan (7):
> > drm: Relax alignment constraint for destination address
> > drm: Add drm_memcpy_from_wc() variant which accepts destination
> > address
> > drm/i915: use the memcpy_from_wc call from the drm
> > drm/i915/guc: use the memcpy_from_wc call from the drm
> > drm/i915/selftests: use the memcpy_from_wc call from the drm
> > drm/i915/gt: Avoid direct dereferencing of io memory
> > drm/i915: Avoid dereferencing io mapped memory
> >
> > drivers/gpu/drm/drm_cache.c | 98 +++++++++++++++++--
> > drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 +-
> > drivers/gpu/drm/i915/gt/selftest_reset.c | 21 ++--
> > drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 11 ++-
> > drivers/gpu/drm/i915/i915_gpu_error.c | 45 +++++----
> > .../drm/i915/selftests/intel_memory_region.c | 8 +-
> > include/drm/drm_cache.h | 3 +
> > 7 files changed, 148 insertions(+), 46 deletions(-)
> >
next prev parent reply other threads:[~2022-02-23 11:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 14:51 [Intel-gfx] [PATCH 0/7] drm/i915: Use the memcpy_from_wc function from drm Balasubramani Vivekanandan
2022-02-22 14:52 ` [Intel-gfx] [PATCH 1/7] drm: Relax alignment constraint for destination address Balasubramani Vivekanandan
2022-03-01 7:28 ` Lucas De Marchi
2022-02-22 14:52 ` [Intel-gfx] [PATCH 2/7] drm: Add drm_memcpy_from_wc() variant which accepts " Balasubramani Vivekanandan
2022-03-01 7:48 ` Lucas De Marchi
2022-03-01 7:55 ` Lucas De Marchi
2022-02-22 14:52 ` [Intel-gfx] [PATCH 3/7] drm/i915: use the memcpy_from_wc call from the drm Balasubramani Vivekanandan
2022-03-01 7:52 ` Lucas De Marchi
2022-02-22 14:52 ` [Intel-gfx] [PATCH 4/7] drm/i915/guc: " Balasubramani Vivekanandan
2022-03-01 8:07 ` Lucas De Marchi
2022-02-22 14:52 ` [Intel-gfx] [PATCH 5/7] drm/i915/selftests: " Balasubramani Vivekanandan
2022-03-01 8:13 ` Lucas De Marchi
2022-02-22 14:52 ` [Intel-gfx] [PATCH 6/7] drm/i915/gt: Avoid direct dereferencing of io memory Balasubramani Vivekanandan
2022-02-22 14:52 ` [Intel-gfx] [PATCH 7/7] drm/i915: Avoid dereferencing io mapped memory Balasubramani Vivekanandan
2022-02-22 23:42 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Use the memcpy_from_wc function from drm Patchwork
2022-02-22 23:43 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-23 0:12 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-02-23 9:02 ` [Intel-gfx] [PATCH 0/7] " Das, Nirmoy
2022-02-23 11:08 ` Balasubramani Vivekanandan [this message]
2022-02-23 13:21 ` Das, Nirmoy
2022-02-23 13:12 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " Patchwork
2022-02-23 23:15 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Use the memcpy_from_wc function from drm (rev2) Patchwork
2022-02-23 23:15 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-23 23:50 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-02-24 11:25 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=YhYVyZM3TsC5wtL5@bvivekan-mobl.gar.corp.intel.com \
--to=balasubramani.vivekanandan@intel.com \
--cc=airlied@linux.ie \
--cc=chris.p.wilson@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=lucas.demarchi@intel.com \
--cc=michael.cheng@intel.com \
--cc=nirmoy.das@linux.intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=siva.mullati@intel.com \
--cc=thomas.hellstrom@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