public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/gem: stop using PAGE_KERNEL_IO
@ 2021-10-20  9:06 Lucas De Marchi
  2021-10-20 10:11 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lucas De Marchi @ 2021-10-20  9:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, Chris Wilson, dri-devel

PAGE_KERNEL_IO is only defined for x86 and is the same as PAGE_KERNEL.
Use the latter since that is also available on other archs, which should
help us getting i915 there.

This is the same that was done done in commit 80c33624e472 ("io-mapping:
Fixup for different names of writecombine"). Later the commit
80c33624e472 ("io-mapping: Fixup for different names of writecombine")
added a "Fixes" tag to the first one, but that is actually fixing a
separate issue:  the different names for pgprot_writecombine().

Fast-forward today, it seems the only 2 archs that define
pgprot_noncached_wc() are microblaze and powerpc. Microblaze has the
same definition for pgprot_writecombine() since commit
97ccedd793ac ("microblaze: Provide pgprot_device/writecombine macros for
nommu"). Powerpc has 3 variants and all of them have the same behavior
for pgprot_writecombine() and pgprot_noncached_wc(). From the commit message
and linked issue, the fallback was needed for arm, but apparently today
all the variants there also have pgprot_writecombine().

So, just use PAGE_KERNEL, and just use pgprot_writecombine().

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_pages.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pages.c b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
index 8eb1c3a6fc9c..68fe1837ef54 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_pages.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_pages.c
@@ -289,7 +289,7 @@ static void *i915_gem_object_map_page(struct drm_i915_gem_object *obj,
 		pgprot = PAGE_KERNEL;
 		break;
 	case I915_MAP_WC:
-		pgprot = pgprot_writecombine(PAGE_KERNEL_IO);
+		pgprot = pgprot_writecombine(PAGE_KERNEL);
 		break;
 	}
 
@@ -333,7 +333,7 @@ static void *i915_gem_object_map_pfn(struct drm_i915_gem_object *obj,
 	i = 0;
 	for_each_sgt_daddr(addr, iter, obj->mm.pages)
 		pfns[i++] = (iomap + addr) >> PAGE_SHIFT;
-	vaddr = vmap_pfn(pfns, n_pfn, pgprot_writecombine(PAGE_KERNEL_IO));
+	vaddr = vmap_pfn(pfns, n_pfn, pgprot_writecombine(PAGE_KERNEL));
 	if (pfns != stack)
 		kvfree(pfns);
 
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-21 11:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-20  9:06 [Intel-gfx] [PATCH] drm/i915/gem: stop using PAGE_KERNEL_IO Lucas De Marchi
2021-10-20 10:11 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-10-20 10:45 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-10-21 11:51 ` [Intel-gfx] [PATCH] " Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox