From: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com> To: <intel-gfx@lists.freedesktop.org>, <dri-devel@lists.freedesktop.org> Cc: siva.mullati@intel.com, lucas.demarchi@intel.com, Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>, Nirmoy Das <nirmoy.das@intel.com> Subject: [PATCH v3 3/7] drm/i915: use the memcpy_from_wc call from the drm Date: Tue, 26 Apr 2022 22:21:44 +0530 [thread overview] Message-ID: <20220426165148.1784-4-balasubramani.vivekanandan@intel.com> (raw) In-Reply-To: <20220426165148.1784-1-balasubramani.vivekanandan@intel.com> memcpy_from_wc functions in i915_memcpy.c will be removed and replaced by the implementation in drm_cache.c. Updated to use the functions provided by drm_cache.c. v2: Pass newly added src offset argument to the modified drm_memcpy_from_wc_vaddr() function. Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c index 06b1b188ce5a..c1ff0a591a24 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c @@ -438,16 +438,16 @@ static void i915_gem_object_read_from_page_iomap(struct drm_i915_gem_object *obj, u64 offset, void *dst, int size) { void __iomem *src_map; - void __iomem *src_ptr; + struct iosys_map src; + dma_addr_t dma = i915_gem_object_get_dma_address(obj, offset >> PAGE_SHIFT); src_map = io_mapping_map_wc(&obj->mm.region->iomap, dma - obj->mm.region->region.start, PAGE_SIZE); - src_ptr = src_map + offset_in_page(offset); - if (!i915_memcpy_from_wc(dst, (void __force *)src_ptr, size)) - memcpy_fromio(dst, src_ptr, size); + iosys_map_set_vaddr_iomem(&src, src_map); + drm_memcpy_from_wc_vaddr(dst, &src, offset_in_page(offset), size); io_mapping_unmap(src_map); } -- 2.25.1
WARNING: multiple messages have this Message-ID (diff)
From: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com> To: <intel-gfx@lists.freedesktop.org>, <dri-devel@lists.freedesktop.org> Cc: siva.mullati@intel.com, lucas.demarchi@intel.com, Nirmoy Das <nirmoy.das@intel.com> Subject: [Intel-gfx] [PATCH v3 3/7] drm/i915: use the memcpy_from_wc call from the drm Date: Tue, 26 Apr 2022 22:21:44 +0530 [thread overview] Message-ID: <20220426165148.1784-4-balasubramani.vivekanandan@intel.com> (raw) In-Reply-To: <20220426165148.1784-1-balasubramani.vivekanandan@intel.com> memcpy_from_wc functions in i915_memcpy.c will be removed and replaced by the implementation in drm_cache.c. Updated to use the functions provided by drm_cache.c. v2: Pass newly added src offset argument to the modified drm_memcpy_from_wc_vaddr() function. Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c index 06b1b188ce5a..c1ff0a591a24 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c @@ -438,16 +438,16 @@ static void i915_gem_object_read_from_page_iomap(struct drm_i915_gem_object *obj, u64 offset, void *dst, int size) { void __iomem *src_map; - void __iomem *src_ptr; + struct iosys_map src; + dma_addr_t dma = i915_gem_object_get_dma_address(obj, offset >> PAGE_SHIFT); src_map = io_mapping_map_wc(&obj->mm.region->iomap, dma - obj->mm.region->region.start, PAGE_SIZE); - src_ptr = src_map + offset_in_page(offset); - if (!i915_memcpy_from_wc(dst, (void __force *)src_ptr, size)) - memcpy_fromio(dst, src_ptr, size); + iosys_map_set_vaddr_iomem(&src, src_map); + drm_memcpy_from_wc_vaddr(dst, &src, offset_in_page(offset), size); io_mapping_unmap(src_map); } -- 2.25.1
next prev parent reply other threads:[~2022-04-26 16:50 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-26 16:51 [PATCH v3 0/7] drm/i915: Use the memcpy_from_wc function from drm Balasubramani Vivekanandan 2022-04-26 16:51 ` [Intel-gfx] " Balasubramani Vivekanandan 2022-04-26 16:51 ` [PATCH v3 1/7] drm: Relax alignment constraint for destination address Balasubramani Vivekanandan 2022-04-26 16:51 ` [Intel-gfx] " Balasubramani Vivekanandan 2022-04-26 16:51 ` [PATCH v3 2/7] drm: Add drm_memcpy_from_wc() variant which accepts " Balasubramani Vivekanandan 2022-04-26 16:51 ` [Intel-gfx] " Balasubramani Vivekanandan 2022-07-13 15:47 ` Lucas De Marchi 2022-07-13 15:47 ` Lucas De Marchi 2022-07-14 11:20 ` Christian König 2022-07-14 11:20 ` Christian König 2022-04-26 16:51 ` Balasubramani Vivekanandan [this message] 2022-04-26 16:51 ` [Intel-gfx] [PATCH v3 3/7] drm/i915: use the memcpy_from_wc call from the drm Balasubramani Vivekanandan 2022-04-26 16:51 ` [PATCH v3 4/7] drm/i915/guc: use iosys_map abstraction to access GuC log Balasubramani Vivekanandan 2022-04-26 16:51 ` [Intel-gfx] " Balasubramani Vivekanandan 2022-04-26 16:51 ` [PATCH v3 5/7] drm/i915/selftests: use the memcpy_from_wc call from the drm Balasubramani Vivekanandan 2022-04-26 16:51 ` [Intel-gfx] " Balasubramani Vivekanandan 2022-04-26 16:51 ` [PATCH v3 6/7] drm/i915/gt: Avoid direct dereferencing of io memory Balasubramani Vivekanandan 2022-04-26 16:51 ` [Intel-gfx] " Balasubramani Vivekanandan 2022-04-26 16:51 ` [PATCH v3 7/7] drm/i915: Avoid dereferencing io mapped memory Balasubramani Vivekanandan 2022-04-26 16:51 ` [Intel-gfx] " Balasubramani Vivekanandan 2022-04-26 17:57 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Use the memcpy_from_wc function from drm (rev4) Patchwork 2022-04-26 20:16 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20220426165148.1784-4-balasubramani.vivekanandan@intel.com \ --to=balasubramani.vivekanandan@intel.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=intel-gfx@lists.freedesktop.org \ --cc=lucas.demarchi@intel.com \ --cc=nirmoy.das@intel.com \ --cc=siva.mullati@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.