linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/imagination: Fix build on 32bit systems
@ 2025-11-06 23:24 Marek Vasut
  0 siblings, 0 replies; only message in thread
From: Marek Vasut @ 2025-11-06 23:24 UTC (permalink / raw)
  To: dri-devel
  Cc: Marek Vasut, David Airlie, Frank Binns, Maarten Lankhorst,
	Matt Coster, Maxime Ripard, Simona Vetter, Thomas Zimmermann,
	linux-renesas-soc

Fix support for build on 32bit systems. Include linux/io-64-nonatomic-hi-lo.h
to provide non-atomic readq()/writeq()/ioread64()/iowrite64() accessors, and
use __ffs64() instead of plain ffs() on 64bit number SZ_1T.

This allows this driver to bind on Renesas R-Car H2 which contains
Rogue G6400 BVNC 1.39.4.1 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: David Airlie <airlied@gmail.com>
Cc: Frank Binns <frank.binns@imgtec.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Matt Coster <matt.coster@imgtec.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org
---
 drivers/gpu/drm/imagination/Kconfig      | 2 +-
 drivers/gpu/drm/imagination/pvr_device.h | 1 +
 drivers/gpu/drm/imagination/pvr_mmu.h    | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/imagination/Kconfig b/drivers/gpu/drm/imagination/Kconfig
index 0482bfcefdde..6d177f0568cd 100644
--- a/drivers/gpu/drm/imagination/Kconfig
+++ b/drivers/gpu/drm/imagination/Kconfig
@@ -3,7 +3,7 @@
 
 config DRM_POWERVR
 	tristate "Imagination Technologies PowerVR (Series 6 and later) & IMG Graphics"
-	depends on (ARM64 || RISCV && 64BIT)
+	depends on ARM || ARM64 || RISCV
 	depends on DRM
 	depends on MMU
 	depends on PM
diff --git a/drivers/gpu/drm/imagination/pvr_device.h b/drivers/gpu/drm/imagination/pvr_device.h
index ab8f56ae15df..efdd355005c0 100644
--- a/drivers/gpu/drm/imagination/pvr_device.h
+++ b/drivers/gpu/drm/imagination/pvr_device.h
@@ -20,6 +20,7 @@
 #include <linux/compiler_types.h>
 #include <linux/device.h>
 #include <linux/io.h>
+#include <linux/io-64-nonatomic-hi-lo.h>
 #include <linux/iopoll.h>
 #include <linux/kernel.h>
 #include <linux/math.h>
diff --git a/drivers/gpu/drm/imagination/pvr_mmu.h b/drivers/gpu/drm/imagination/pvr_mmu.h
index a8ecd460168d..6431e4314735 100644
--- a/drivers/gpu/drm/imagination/pvr_mmu.h
+++ b/drivers/gpu/drm/imagination/pvr_mmu.h
@@ -85,7 +85,7 @@ struct sg_table;
  *    notes on that constant apply here.
  */
 #define PVR_PAGE_TABLE_ADDR_SPACE_SIZE SZ_1T
-#define PVR_PAGE_TABLE_ADDR_BITS __ffs(PVR_PAGE_TABLE_ADDR_SPACE_SIZE)
+#define PVR_PAGE_TABLE_ADDR_BITS __ffs64(PVR_PAGE_TABLE_ADDR_SPACE_SIZE)
 #define PVR_PAGE_TABLE_ADDR_MASK (PVR_PAGE_TABLE_ADDR_SPACE_SIZE - 1)
 
 void pvr_mmu_flush_request_all(struct pvr_device *pvr_dev);
-- 
2.51.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-06 23:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06 23:24 [PATCH] drm/imagination: Fix build on 32bit systems Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).