Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v9 07/15] drm: Add a prefetching memcpy_from_wc
Date: Wed, 2 Jun 2021 19:26:15 +0200	[thread overview]
Message-ID: <1aa312f7-2c02-c92b-7a71-335a6baea796@linux.intel.com> (raw)
In-Reply-To: <87im2xrcqu.fsf@intel.com>


On 6/1/21 2:27 PM, Jani Nikula wrote:
> On Tue, 01 Jun 2021, Thomas Hellström <thomas.hellstrom@linux.intel.com> wrote:
>> Reading out of write-combining mapped memory is typically very slow
>> since the CPU doesn't prefetch. However some archs have special
>> instructions to do this.
>>
>> So add a best-effort memcpy_from_wc taking dma-buf-map pointer
>> arguments that attempts to use a fast prefetching memcpy and
>> otherwise falls back to ordinary memcopies, taking the iomem tagging
>> into account.
>>
>> The code is largely copied from i915_memcpy_from_wc.
>>
>> Cc: Daniel Vetter <daniel@ffwll.ch>
>> Cc: Christian König <christian.koenig@amd.com>
>> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
>> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>> Acked-by: Christian König <christian.koenig@amd.com>
>> Acked-by: Daniel Vetter <daniel@ffwll.ch>
>> ---
>> v7:
>> - Perform a memcpy even if warning with in_interrupt(). Suggested by
>>    Christian König.
>> - Fix compilation failure on !X86 (Reported by kernel test robot
>>    lkp@intel.com)
>> v8:
>> - Skip kerneldoc for drm_memcpy_init_early()
>> - Export drm_memcpy_from_wc() also for non-x86.
>> ---
>>   Documentation/gpu/drm-mm.rst |   2 +-
>>   drivers/gpu/drm/drm_cache.c  | 148 +++++++++++++++++++++++++++++++++++
>>   drivers/gpu/drm/drm_drv.c    |   2 +
>>   include/drm/drm_cache.h      |   7 ++
>>   4 files changed, 158 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst
>> index 21be6deadc12..c66058c5bce7 100644
>> --- a/Documentation/gpu/drm-mm.rst
>> +++ b/Documentation/gpu/drm-mm.rst
>> @@ -469,7 +469,7 @@ DRM MM Range Allocator Function References
>>   .. kernel-doc:: drivers/gpu/drm/drm_mm.c
>>      :export:
>>   
>> -DRM Cache Handling
>> +DRM Cache Handling and Fast WC memcpy()
>>   ==================
> The title underline needs to be as long as the title.
>
> BR,
> Jani.

Thanks, Jani.

I think Daniel was trying to point this out to me as well with limited 
success. It's fixed now.

/Thomas


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-06-02 17:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01  7:46 [Intel-gfx] [PATCH v9 00/15] Move LMEM (VRAM) management over to TTM Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 01/15] drm/i915: Untangle the vma pages_mutex Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 02/15] drm/i915: Don't free shared locks while shared Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 03/15] drm/i915: Fix i915_sg_page_sizes to record dma segments rather than physical pages Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 04/15] drm/i915/ttm Initialize the ttm device and memory managers Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 05/15] drm/i915/ttm: Embed a ttm buffer object in the i915 gem object Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 06/15] drm/ttm: Add a generic TTM memcpy move for page-based iomem Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 07/15] drm: Add a prefetching memcpy_from_wc Thomas Hellström
2021-06-01 12:27   ` Jani Nikula
2021-06-02 17:26     ` Thomas Hellström [this message]
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 08/15] drm/ttm: Use drm_memcpy_from_wc for TTM bo moves Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 09/15] drm/ttm: Document and optimize ttm_bo_pipeline_gutting() Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 10/15] drm/ttm, drm/amdgpu: Allow the driver some control over swapping Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 11/15] drm/i915/ttm: Introduce a TTM i915 gem object backend Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 12/15] drm/i915/lmem: Verify checks for lmem residency Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 13/15] drm/i915: Disable mmap ioctl for gen12+ Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 14/15] drm/vma: Add a driver_private member to vma_node Thomas Hellström
2021-06-01  7:46 ` [Intel-gfx] [PATCH v9 15/15] drm/i915: Use ttm mmap handling for ttm bo's Thomas Hellström
2021-06-01  8:13 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Move LMEM (VRAM) management over to TTM (rev5) Patchwork
2021-06-01  8:16 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-06-01  8:43 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-06-01 10:21 ` [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=1aa312f7-2c02-c92b-7a71-335a6baea796@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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