Re: [PATCH 5/7] drm/i915/selftests: use the memcpy_from_wc call from the drm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 22, 2022 at 08:22:04PM +0530, Balasubramani Vivekanandan wrote:
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.

Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@xxxxxxxxx>
---
drivers/gpu/drm/i915/selftests/intel_memory_region.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/intel_memory_region.c b/drivers/gpu/drm/i915/selftests/intel_memory_region.c
index 7acba1d2135e..d7531aa6965a 100644
--- a/drivers/gpu/drm/i915/selftests/intel_memory_region.c
+++ b/drivers/gpu/drm/i915/selftests/intel_memory_region.c
@@ -7,6 +7,7 @@
#include <linux/sort.h>

#include <drm/drm_buddy.h>
+#include <drm/drm_cache.h>

#include "../i915_selftest.h"

@@ -1033,7 +1034,10 @@ static inline void igt_memcpy(void *dst, const void *src, size_t size)

static inline void igt_memcpy_from_wc(void *dst, const void *src, size_t size)
{
-	i915_memcpy_from_wc(dst, src, size);
+	struct iosys_map src_map;
+
+	iosys_map_set_vaddr(&src_map, (void *)src);

src is not guaranteed to be system memory. See
perf_memcpy():

        for_each_memory_region(src_mr, i915, src_id) {
                for_each_memory_region(dst_mr, i915, dst_id) {
			...

Lucas De Marchi

+	drm_memcpy_from_wc_vaddr(dst, &src_map, size);
}

static int _perf_memcpy(struct intel_memory_region *src_mr,
@@ -1057,7 +1061,7 @@ static int _perf_memcpy(struct intel_memory_region *src_mr,
		{
			"memcpy_from_wc",
			igt_memcpy_from_wc,
-			!i915_has_memcpy_from_wc(),
+			!drm_memcpy_fastcopy_supported(),
		},
	};
	struct drm_i915_gem_object *src, *dst;
--
2.25.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux