Several RISC-V boards feature Imagination GPUs that are compatible with
the PowerVR driver. An example is the IMG BXM-4-64 GPU on the Lichee Pi
4A board. This commit adjusts the driver's Kconfig dependencies to allow
the PowerVR driver to be compiled on the RISC-V architecture.
By enabling compilation on RISC-V, we expand support for these GPUs,
providing graphics acceleration capabilities and enhancing hardware
compatibility on RISC-V platforms.
Add a dependency on MMU to fix a build warning on RISC-V configurations
without an MMU and enable COMPILE_TEST to improve build coverage.
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
---
drivers/gpu/drm/imagination/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/imagination/Kconfig b/drivers/gpu/drm/imagination/Kconfig
index 5f9fff43d6baadc42ebf48d91729bfbf27e06caa..48fd31c031628c70b1e0952271baccf7f4694810 100644
--- a/drivers/gpu/drm/imagination/Kconfig
+++ b/drivers/gpu/drm/imagination/Kconfig
@@ -3,9 +3,10 @@
config DRM_POWERVR
tristate "Imagination Technologies PowerVR (Series 6 and later) & IMG Graphics"
- depends on ARM64
+ depends on (ARM64 || RISCV) || COMPILE_TEST
depends on DRM
depends on PM
+ depends on MMU
select DRM_EXEC
select DRM_GEM_SHMEM_HELPER
select DRM_SCHED
--
2.34.1
Hi Michal, kernel test robot noticed the following build warnings: [auto build test WARNING on 4774cfe3543abb8ee98089f535e28ebfd45b975a] url: https://github.com/intel-lab-lkp/linux/commits/Michal-Wilczynski/power-sequencing-Add-T-HEAD-TH1520-GPU-power-sequencer-driver/20250618-182429 base: 4774cfe3543abb8ee98089f535e28ebfd45b975a patch link: https://lore.kernel.org/r/20250618-apr_14_for_sending-v5-8-27ed33ea5c6f%40samsung.com patch subject: [PATCH v5 8/8] drm/imagination: Enable PowerVR driver for RISC-V config: sparc64-randconfig-r121-20250620 (https://download.01.org/0day-ci/archive/20250620/202506201103.GX6DA9Gx-lkp@intel.com/config) compiler: sparc64-linux-gcc (GCC) 8.5.0 reproduce: (https://download.01.org/0day-ci/archive/20250620/202506201103.GX6DA9Gx-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202506201103.GX6DA9Gx-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/gpu/drm/imagination/pvr_mmu.c:57:3: error: #error Unsupported device page size PVR_DEVICE_PAGE_SIZE # error Unsupported device page size PVR_DEVICE_PAGE_SIZE ^~~~~ In file included from ./arch/sparc/include/generated/asm/rwonce.h:1, from include/linux/compiler.h:390, from include/linux/dev_printk.h:14, from include/linux/device.h:15, from include/linux/node.h:18, from include/linux/memory.h:19, from drivers/gpu/drm/imagination/pvr_mmu.h:7, from drivers/gpu/drm/imagination/pvr_mmu.c:4: drivers/gpu/drm/imagination/pvr_mmu.c: In function 'pvr_page_table_l1_entry_raw_set': drivers/gpu/drm/imagination/pvr_mmu.c:577:50: error: 'ROGUE_MMUCTRL_PAGE_SIZE_X' undeclared (first use in this function); did you mean 'ROGUE_MMUCTRL_PAGE_SIZE_1MB'? PVR_PAGE_TABLE_FIELD_PREP(1, PD, PAGE_SIZE, ROGUE_MMUCTRL_PAGE_SIZE_X) | ^~~~~~~~~~~~~~~~~~~~~~~~~ include/asm-generic/rwonce.h:55:33: note: in definition of macro '__WRITE_ONCE' *(volatile typeof(x) *)&(x) = (val); \ ^~~ drivers/gpu/drm/imagination/pvr_mmu.c:574:2: note: in expansion of macro 'WRITE_ONCE' WRITE_ONCE(entry->val, ^~~~~~~~~~ drivers/gpu/drm/imagination/pvr_mmu.c:577:6: note: in expansion of macro 'PVR_PAGE_TABLE_FIELD_PREP' PVR_PAGE_TABLE_FIELD_PREP(1, PD, PAGE_SIZE, ROGUE_MMUCTRL_PAGE_SIZE_X) | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/imagination/pvr_mmu.c:577:50: note: each undeclared identifier is reported only once for each function it appears in PVR_PAGE_TABLE_FIELD_PREP(1, PD, PAGE_SIZE, ROGUE_MMUCTRL_PAGE_SIZE_X) | ^~~~~~~~~~~~~~~~~~~~~~~~~ include/asm-generic/rwonce.h:55:33: note: in definition of macro '__WRITE_ONCE' *(volatile typeof(x) *)&(x) = (val); \ ^~~ drivers/gpu/drm/imagination/pvr_mmu.c:574:2: note: in expansion of macro 'WRITE_ONCE' WRITE_ONCE(entry->val, ^~~~~~~~~~ drivers/gpu/drm/imagination/pvr_mmu.c:577:6: note: in expansion of macro 'PVR_PAGE_TABLE_FIELD_PREP' PVR_PAGE_TABLE_FIELD_PREP(1, PD, PAGE_SIZE, ROGUE_MMUCTRL_PAGE_SIZE_X) | ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/imagination/pvr_mmu.c: In function 'pvr_page_table_l0_entry_raw_set': drivers/gpu/drm/imagination/pvr_mmu.c:741:24: error: 'ROGUE_MMUCTRL_PAGE_X_RANGE_CLRMSK' undeclared (first use in this function); did you mean 'ROGUE_MMUCTRL_PAGE_1MB_RANGE_CLRMSK'? (dma_addr & ~ROGUE_MMUCTRL_PAGE_X_RANGE_CLRMSK) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/asm-generic/rwonce.h:55:33: note: in definition of macro '__WRITE_ONCE' *(volatile typeof(x) *)&(x) = (val); \ ^~~ drivers/gpu/drm/imagination/pvr_mmu.c:739:2: note: in expansion of macro 'WRITE_ONCE' WRITE_ONCE(entry->val, PVR_PAGE_TABLE_FIELD_PREP(0, PT, VALID, true) | ^~~~~~~~~~ drivers/gpu/drm/imagination/pvr_mmu.c: In function 'pvr_page_table_l0_idx': drivers/gpu/drm/imagination/pvr_mmu.c:1713:9: error: 'ROGUE_MMUCTRL_PAGE_X_RANGE_SHIFT' undeclared (first use in this function); did you mean 'ROGUE_MMUCTRL_PAGE_4KB_RANGE_SHIFT'? ROGUE_MMUCTRL_PAGE_X_RANGE_SHIFT; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ROGUE_MMUCTRL_PAGE_4KB_RANGE_SHIFT >> drivers/gpu/drm/imagination/pvr_mmu.c:1714:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ vim +1714 drivers/gpu/drm/imagination/pvr_mmu.c ff5f643de0bf27 Donald Robson 2023-11-22 1696 ff5f643de0bf27 Donald Robson 2023-11-22 1697 /** ff5f643de0bf27 Donald Robson 2023-11-22 1698 * pvr_page_table_l0_idx() - Calculate the level 0 page table index for a ff5f643de0bf27 Donald Robson 2023-11-22 1699 * device-virtual address. ff5f643de0bf27 Donald Robson 2023-11-22 1700 * @device_addr: Target device-virtual address. ff5f643de0bf27 Donald Robson 2023-11-22 1701 * ff5f643de0bf27 Donald Robson 2023-11-22 1702 * This function does not perform any bounds checking - it is the caller's ff5f643de0bf27 Donald Robson 2023-11-22 1703 * responsibility to ensure that @device_addr is valid before interpreting ff5f643de0bf27 Donald Robson 2023-11-22 1704 * the result. ff5f643de0bf27 Donald Robson 2023-11-22 1705 * ff5f643de0bf27 Donald Robson 2023-11-22 1706 * Return: ff5f643de0bf27 Donald Robson 2023-11-22 1707 * The index into a level 0 page table corresponding to @device_addr. ff5f643de0bf27 Donald Robson 2023-11-22 1708 */ ff5f643de0bf27 Donald Robson 2023-11-22 1709 static u16 ff5f643de0bf27 Donald Robson 2023-11-22 1710 pvr_page_table_l0_idx(u64 device_addr) ff5f643de0bf27 Donald Robson 2023-11-22 1711 { ff5f643de0bf27 Donald Robson 2023-11-22 1712 return (device_addr & ~ROGUE_MMUCTRL_VADDR_PT_INDEX_CLRMSK) >> ff5f643de0bf27 Donald Robson 2023-11-22 1713 ROGUE_MMUCTRL_PAGE_X_RANGE_SHIFT; ff5f643de0bf27 Donald Robson 2023-11-22 @1714 } ff5f643de0bf27 Donald Robson 2023-11-22 1715 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
On 6/20/25 05:32, kernel test robot wrote: > Hi Michal, > > kernel test robot noticed the following build warnings: > > [auto build test WARNING on 4774cfe3543abb8ee98089f535e28ebfd45b975a] > > url: https://protect2.fireeye.com/v1/url?k=459f4078-1a047974-459ecb37-000babff3563-f67f8714258a7e91&q=1&e=0474f2bc-b688-4260-ae67-33e26f33bf90&u=https%3A%2F%2Fgithub.com%2Fintel-lab-lkp%2Flinux%2Fcommits%2FMichal-Wilczynski%2Fpower-sequencing-Add-T-HEAD-TH1520-GPU-power-sequencer-driver%2F20250618-182429 > base: 4774cfe3543abb8ee98089f535e28ebfd45b975a > patch link: https://lore.kernel.org/r/20250618-apr_14_for_sending-v5-8-27ed33ea5c6f%40samsung.com > patch subject: [PATCH v5 8/8] drm/imagination: Enable PowerVR driver for RISC-V > config: sparc64-randconfig-r121-20250620 (https://download.01.org/0day-ci/archive/20250620/202506201103.GX6DA9Gx-lkp@intel.com/config) > compiler: sparc64-linux-gcc (GCC) 8.5.0 > reproduce: (https://download.01.org/0day-ci/archive/20250620/202506201103.GX6DA9Gx-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot <lkp@intel.com> > | Closes: https://lore.kernel.org/oe-kbuild-all/202506201103.GX6DA9Gx-lkp@intel.com/ > > All warnings (new ones prefixed by >>): > > drivers/gpu/drm/imagination/pvr_mmu.c:57:3: error: #error Unsupported device page size PVR_DEVICE_PAGE_SIZE > # error Unsupported device page size PVR_DEVICE_PAGE_SIZE > ^~~~~ > In file included from ./arch/sparc/include/generated/asm/rwonce.h:1, > from include/linux/compiler.h:390, > from include/linux/dev_printk.h:14, > from include/linux/device.h:15, > from include/linux/node.h:18, > from include/linux/memory.h:19, > from drivers/gpu/drm/imagination/pvr_mmu.h:7, > from drivers/gpu/drm/imagination/pvr_mmu.c:4: > drivers/gpu/drm/imagination/pvr_mmu.c: In function 'pvr_page_table_l1_entry_raw_set': > drivers/gpu/drm/imagination/pvr_mmu.c:577:50: error: 'ROGUE_MMUCTRL_PAGE_SIZE_X' undeclared (first use in this function); did you mean 'ROGUE_MMUCTRL_PAGE_SIZE_1MB'? > PVR_PAGE_TABLE_FIELD_PREP(1, PD, PAGE_SIZE, ROGUE_MMUCTRL_PAGE_SIZE_X) | > ^~~~~~~~~~~~~~~~~~~~~~~~~ > include/asm-generic/rwonce.h:55:33: note: in definition of macro '__WRITE_ONCE' > *(volatile typeof(x) *)&(x) = (val); \ > ^~~ > drivers/gpu/drm/imagination/pvr_mmu.c:574:2: note: in expansion of macro 'WRITE_ONCE' > WRITE_ONCE(entry->val, > ^~~~~~~~~~ > drivers/gpu/drm/imagination/pvr_mmu.c:577:6: note: in expansion of macro 'PVR_PAGE_TABLE_FIELD_PREP' > PVR_PAGE_TABLE_FIELD_PREP(1, PD, PAGE_SIZE, ROGUE_MMUCTRL_PAGE_SIZE_X) | > ^~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/gpu/drm/imagination/pvr_mmu.c:577:50: note: each undeclared identifier is reported only once for each function it appears in > PVR_PAGE_TABLE_FIELD_PREP(1, PD, PAGE_SIZE, ROGUE_MMUCTRL_PAGE_SIZE_X) | > ^~~~~~~~~~~~~~~~~~~~~~~~~ > include/asm-generic/rwonce.h:55:33: note: in definition of macro '__WRITE_ONCE' > *(volatile typeof(x) *)&(x) = (val); \ > ^~~ > drivers/gpu/drm/imagination/pvr_mmu.c:574:2: note: in expansion of macro 'WRITE_ONCE' > WRITE_ONCE(entry->val, > ^~~~~~~~~~ > drivers/gpu/drm/imagination/pvr_mmu.c:577:6: note: in expansion of macro 'PVR_PAGE_TABLE_FIELD_PREP' > PVR_PAGE_TABLE_FIELD_PREP(1, PD, PAGE_SIZE, ROGUE_MMUCTRL_PAGE_SIZE_X) | > ^~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/gpu/drm/imagination/pvr_mmu.c: In function 'pvr_page_table_l0_entry_raw_set': > drivers/gpu/drm/imagination/pvr_mmu.c:741:24: error: 'ROGUE_MMUCTRL_PAGE_X_RANGE_CLRMSK' undeclared (first use in this function); did you mean 'ROGUE_MMUCTRL_PAGE_1MB_RANGE_CLRMSK'? > (dma_addr & ~ROGUE_MMUCTRL_PAGE_X_RANGE_CLRMSK) | > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/asm-generic/rwonce.h:55:33: note: in definition of macro '__WRITE_ONCE' > *(volatile typeof(x) *)&(x) = (val); \ > ^~~ > drivers/gpu/drm/imagination/pvr_mmu.c:739:2: note: in expansion of macro 'WRITE_ONCE' > WRITE_ONCE(entry->val, PVR_PAGE_TABLE_FIELD_PREP(0, PT, VALID, true) | > ^~~~~~~~~~ > drivers/gpu/drm/imagination/pvr_mmu.c: In function 'pvr_page_table_l0_idx': > drivers/gpu/drm/imagination/pvr_mmu.c:1713:9: error: 'ROGUE_MMUCTRL_PAGE_X_RANGE_SHIFT' undeclared (first use in this function); did you mean 'ROGUE_MMUCTRL_PAGE_4KB_RANGE_SHIFT'? > ROGUE_MMUCTRL_PAGE_X_RANGE_SHIFT; > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ROGUE_MMUCTRL_PAGE_4KB_RANGE_SHIFT >>> drivers/gpu/drm/imagination/pvr_mmu.c:1714:1: warning: control reaches end of non-void function [-Wreturn-type] > } It's clear from the build log that enabling COMPILE_TEST has exposed some pre existing portability issues in pvr_mmu.c. Fixing these underlying MMU issues seem to be outside the scope of this patch series, which is focused on enabling the TH1520 SoC GPU. To keep this work focused on its original goal, I will remove the COMPILE_TEST addition for now. The addition of COMPILE_TEST support can be revisited in a separate, dedicated series. Best regards, -- Michal Wilczynski <m.wilczynski@samsung.com>
Hi Michal, kernel test robot noticed the following build errors: [auto build test ERROR on 4774cfe3543abb8ee98089f535e28ebfd45b975a] url: https://github.com/intel-lab-lkp/linux/commits/Michal-Wilczynski/power-sequencing-Add-T-HEAD-TH1520-GPU-power-sequencer-driver/20250618-182429 base: 4774cfe3543abb8ee98089f535e28ebfd45b975a patch link: https://lore.kernel.org/r/20250618-apr_14_for_sending-v5-8-27ed33ea5c6f%40samsung.com patch subject: [PATCH v5 8/8] drm/imagination: Enable PowerVR driver for RISC-V config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20250619/202506191323.zD1fszQb-lkp@intel.com/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250619/202506191323.zD1fszQb-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202506191323.zD1fszQb-lkp@intel.com/ All error/warnings (new ones prefixed by >>): In file included from drivers/gpu/drm/imagination/pvr_ccb.c:5: drivers/gpu/drm/imagination/pvr_device.h: In function 'pvr_cr_read64': drivers/gpu/drm/imagination/pvr_device.h:580:16: error: implicit declaration of function 'ioread64'; did you mean 'ioread32'? [-Werror=implicit-function-declaration] 580 | return ioread64(pvr_dev->regs + reg); | ^~~~~~~~ | ioread32 drivers/gpu/drm/imagination/pvr_device.h: In function 'pvr_cr_write64': drivers/gpu/drm/imagination/pvr_device.h:604:9: error: implicit declaration of function 'iowrite64'; did you mean 'iowrite32'? [-Werror=implicit-function-declaration] 604 | iowrite64(val, pvr_dev->regs + reg); | ^~~~~~~~~ | iowrite32 In file included from drivers/gpu/drm/imagination/pvr_device.h:23: drivers/gpu/drm/imagination/pvr_device.h: In function 'pvr_cr_poll_reg64': >> include/linux/iopoll.h:176:28: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration] 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~ include/linux/iopoll.h:46:25: note: in definition of macro 'read_poll_timeout' 46 | (val) = op(args); \ | ^~ include/linux/iopoll.h:176:9: note: in expansion of macro 'readx_poll_timeout' 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~~~~~~~~~~~~~~ drivers/gpu/drm/imagination/pvr_device.h:649:16: note: in expansion of macro 'readq_poll_timeout' 649 | return readq_poll_timeout(pvr_dev->regs + reg_addr, value, | ^~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors -- In file included from drivers/gpu/drm/imagination/pvr_context.h:17, from drivers/gpu/drm/imagination/pvr_drv.c:4: drivers/gpu/drm/imagination/pvr_device.h: In function 'pvr_cr_read64': drivers/gpu/drm/imagination/pvr_device.h:580:16: error: implicit declaration of function 'ioread64'; did you mean 'ioread32'? [-Werror=implicit-function-declaration] 580 | return ioread64(pvr_dev->regs + reg); | ^~~~~~~~ | ioread32 drivers/gpu/drm/imagination/pvr_device.h: In function 'pvr_cr_write64': drivers/gpu/drm/imagination/pvr_device.h:604:9: error: implicit declaration of function 'iowrite64'; did you mean 'iowrite32'? [-Werror=implicit-function-declaration] 604 | iowrite64(val, pvr_dev->regs + reg); | ^~~~~~~~~ | iowrite32 In file included from drivers/gpu/drm/imagination/pvr_device.h:23: drivers/gpu/drm/imagination/pvr_device.h: In function 'pvr_cr_poll_reg64': >> include/linux/iopoll.h:176:28: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration] 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~ include/linux/iopoll.h:46:25: note: in definition of macro 'read_poll_timeout' 46 | (val) = op(args); \ | ^~ include/linux/iopoll.h:176:9: note: in expansion of macro 'readx_poll_timeout' 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~~~~~~~~~~~~~~ drivers/gpu/drm/imagination/pvr_device.h:649:16: note: in expansion of macro 'readq_poll_timeout' 649 | return readq_poll_timeout(pvr_dev->regs + reg_addr, value, | ^~~~~~~~~~~~~~~~~~ In file included from include/linux/init.h:5, from include/linux/printk.h:6, from include/asm-generic/bug.h:22, from arch/x86/include/asm/bug.h:103, from arch/x86/include/asm/alternative.h:9, from arch/x86/include/asm/atomic.h:7, from include/linux/atomic.h:7, from include/drm/spsc_queue.h:27, from include/drm/gpu_scheduler.h:27, from drivers/gpu/drm/imagination/pvr_context.h:7: drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h: At top level: >> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct rogue_fwif_cmd_compute, regs) incorrect" 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) | ^~~~~~~~~~~~~~ include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert' 77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr) | ^~~~~~~~~~~~~~~ drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h:10:9: note: in expansion of macro 'static_assert' 10 | static_assert(offsetof(type, member) == (offset), \ | ^~~~~~~~~~~~~ drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h:97:1: note: in expansion of macro 'OFFSET_CHECK' 97 | OFFSET_CHECK(struct rogue_fwif_cmd_compute, regs, 8); | ^~~~~~~~~~~~ cc1: some warnings being treated as errors -- In file included from include/linux/bits.h:32, from drivers/gpu/drm/imagination/pvr_rogue_fwif_client.h:7, from drivers/gpu/drm/imagination/pvr_stream_defs.c:5: >> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct rogue_fwif_cmd_compute, regs) incorrect" 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) | ^~~~~~~~~~~~~~ include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert' 77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr) | ^~~~~~~~~~~~~~~ drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h:10:9: note: in expansion of macro 'static_assert' 10 | static_assert(offsetof(type, member) == (offset), \ | ^~~~~~~~~~~~~ drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h:97:1: note: in expansion of macro 'OFFSET_CHECK' 97 | OFFSET_CHECK(struct rogue_fwif_cmd_compute, regs, 8); | ^~~~~~~~~~~~ -- In file included from drivers/gpu/drm/imagination/pvr_vm.c:6: drivers/gpu/drm/imagination/pvr_device.h: In function 'pvr_cr_read64': drivers/gpu/drm/imagination/pvr_device.h:580:16: error: implicit declaration of function 'ioread64'; did you mean 'ioread32'? [-Werror=implicit-function-declaration] 580 | return ioread64(pvr_dev->regs + reg); | ^~~~~~~~ | ioread32 drivers/gpu/drm/imagination/pvr_device.h: In function 'pvr_cr_write64': drivers/gpu/drm/imagination/pvr_device.h:604:9: error: implicit declaration of function 'iowrite64'; did you mean 'iowrite32'? [-Werror=implicit-function-declaration] 604 | iowrite64(val, pvr_dev->regs + reg); | ^~~~~~~~~ | iowrite32 In file included from drivers/gpu/drm/imagination/pvr_device.h:23: drivers/gpu/drm/imagination/pvr_device.h: In function 'pvr_cr_poll_reg64': >> include/linux/iopoll.h:176:28: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration] 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~ include/linux/iopoll.h:46:25: note: in definition of macro 'read_poll_timeout' 46 | (val) = op(args); \ | ^~ include/linux/iopoll.h:176:9: note: in expansion of macro 'readx_poll_timeout' 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~~~~~~~~~~~~~~ drivers/gpu/drm/imagination/pvr_device.h:649:16: note: in expansion of macro 'readq_poll_timeout' 649 | return readq_poll_timeout(pvr_dev->regs + reg_addr, value, | ^~~~~~~~~~~~~~~~~~ In file included from include/linux/bitops.h:67, from include/linux/kernel.h:23, from drivers/gpu/drm/imagination/pvr_rogue_fwif.h:10, from drivers/gpu/drm/imagination/pvr_ccb.h:7, from drivers/gpu/drm/imagination/pvr_device.h:7: drivers/gpu/drm/imagination/pvr_vm.c: In function 'pvr_vm_create_context': >> include/uapi/linux/const.h:20:25: warning: conversion from 'long long unsigned int' to 'long unsigned int' changes value from '1099511627776' to '0' [-Woverflow] 20 | #define __AC(X,Y) (X##Y) | ^~~~~~ arch/x86/include/asm/bitops.h:265:40: note: in definition of macro '__ffs' 265 | (unsigned long)__builtin_ctzl(word) : \ | ^~~~ include/uapi/linux/const.h:21:25: note: in expansion of macro '__AC' 21 | #define _AC(X,Y) __AC(X,Y) | ^~~~ include/linux/sizes.h:63:41: note: in expansion of macro '_AC' 63 | #define SZ_1T _AC(0x10000000000, ULL) | ^~~ drivers/gpu/drm/imagination/pvr_mmu.h:87:40: note: in expansion of macro 'SZ_1T' 87 | #define PVR_PAGE_TABLE_ADDR_SPACE_SIZE SZ_1T | ^~~~~ drivers/gpu/drm/imagination/pvr_mmu.h:88:40: note: in expansion of macro 'PVR_PAGE_TABLE_ADDR_SPACE_SIZE' 88 | #define PVR_PAGE_TABLE_ADDR_BITS __ffs(PVR_PAGE_TABLE_ADDR_SPACE_SIZE) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/imagination/pvr_vm.c:556:33: note: in expansion of macro 'PVR_PAGE_TABLE_ADDR_BITS' 556 | if (device_addr_bits != PVR_PAGE_TABLE_ADDR_BITS) { | ^~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors -- In file included from pvr_ccb.c:5: pvr_device.h: In function 'pvr_cr_read64': pvr_device.h:580:16: error: implicit declaration of function 'ioread64'; did you mean 'ioread32'? [-Werror=implicit-function-declaration] 580 | return ioread64(pvr_dev->regs + reg); | ^~~~~~~~ | ioread32 pvr_device.h: In function 'pvr_cr_write64': pvr_device.h:604:9: error: implicit declaration of function 'iowrite64'; did you mean 'iowrite32'? [-Werror=implicit-function-declaration] 604 | iowrite64(val, pvr_dev->regs + reg); | ^~~~~~~~~ | iowrite32 In file included from pvr_device.h:23: pvr_device.h: In function 'pvr_cr_poll_reg64': >> include/linux/iopoll.h:176:28: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration] 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~ include/linux/iopoll.h:46:25: note: in definition of macro 'read_poll_timeout' 46 | (val) = op(args); \ | ^~ include/linux/iopoll.h:176:9: note: in expansion of macro 'readx_poll_timeout' 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~~~~~~~~~~~~~~ pvr_device.h:649:16: note: in expansion of macro 'readq_poll_timeout' 649 | return readq_poll_timeout(pvr_dev->regs + reg_addr, value, | ^~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors -- In file included from pvr_context.h:17, from pvr_drv.c:4: pvr_device.h: In function 'pvr_cr_read64': pvr_device.h:580:16: error: implicit declaration of function 'ioread64'; did you mean 'ioread32'? [-Werror=implicit-function-declaration] 580 | return ioread64(pvr_dev->regs + reg); | ^~~~~~~~ | ioread32 pvr_device.h: In function 'pvr_cr_write64': pvr_device.h:604:9: error: implicit declaration of function 'iowrite64'; did you mean 'iowrite32'? [-Werror=implicit-function-declaration] 604 | iowrite64(val, pvr_dev->regs + reg); | ^~~~~~~~~ | iowrite32 In file included from pvr_device.h:23: pvr_device.h: In function 'pvr_cr_poll_reg64': >> include/linux/iopoll.h:176:28: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration] 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~ include/linux/iopoll.h:46:25: note: in definition of macro 'read_poll_timeout' 46 | (val) = op(args); \ | ^~ include/linux/iopoll.h:176:9: note: in expansion of macro 'readx_poll_timeout' 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~~~~~~~~~~~~~~ pvr_device.h:649:16: note: in expansion of macro 'readq_poll_timeout' 649 | return readq_poll_timeout(pvr_dev->regs + reg_addr, value, | ^~~~~~~~~~~~~~~~~~ In file included from include/linux/init.h:5, from include/linux/printk.h:6, from include/asm-generic/bug.h:22, from arch/x86/include/asm/bug.h:103, from arch/x86/include/asm/alternative.h:9, from arch/x86/include/asm/atomic.h:7, from include/linux/atomic.h:7, from include/drm/spsc_queue.h:27, from include/drm/gpu_scheduler.h:27, from pvr_context.h:7: pvr_rogue_fwif_client_check.h: At top level: >> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct rogue_fwif_cmd_compute, regs) incorrect" 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) | ^~~~~~~~~~~~~~ include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert' 77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr) | ^~~~~~~~~~~~~~~ pvr_rogue_fwif_client_check.h:10:9: note: in expansion of macro 'static_assert' 10 | static_assert(offsetof(type, member) == (offset), \ | ^~~~~~~~~~~~~ pvr_rogue_fwif_client_check.h:97:1: note: in expansion of macro 'OFFSET_CHECK' 97 | OFFSET_CHECK(struct rogue_fwif_cmd_compute, regs, 8); | ^~~~~~~~~~~~ cc1: some warnings being treated as errors -- In file included from include/linux/bits.h:32, from pvr_rogue_fwif_client.h:7, from pvr_stream_defs.c:5: >> include/linux/build_bug.h:78:41: error: static assertion failed: "offsetof(struct rogue_fwif_cmd_compute, regs) incorrect" 78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg) | ^~~~~~~~~~~~~~ include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert' 77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr) | ^~~~~~~~~~~~~~~ pvr_rogue_fwif_client_check.h:10:9: note: in expansion of macro 'static_assert' 10 | static_assert(offsetof(type, member) == (offset), \ | ^~~~~~~~~~~~~ pvr_rogue_fwif_client_check.h:97:1: note: in expansion of macro 'OFFSET_CHECK' 97 | OFFSET_CHECK(struct rogue_fwif_cmd_compute, regs, 8); | ^~~~~~~~~~~~ -- In file included from pvr_vm.c:6: pvr_device.h: In function 'pvr_cr_read64': pvr_device.h:580:16: error: implicit declaration of function 'ioread64'; did you mean 'ioread32'? [-Werror=implicit-function-declaration] 580 | return ioread64(pvr_dev->regs + reg); | ^~~~~~~~ | ioread32 pvr_device.h: In function 'pvr_cr_write64': pvr_device.h:604:9: error: implicit declaration of function 'iowrite64'; did you mean 'iowrite32'? [-Werror=implicit-function-declaration] 604 | iowrite64(val, pvr_dev->regs + reg); | ^~~~~~~~~ | iowrite32 In file included from pvr_device.h:23: pvr_device.h: In function 'pvr_cr_poll_reg64': >> include/linux/iopoll.h:176:28: error: implicit declaration of function 'readq'; did you mean 'readl'? [-Werror=implicit-function-declaration] 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~ include/linux/iopoll.h:46:25: note: in definition of macro 'read_poll_timeout' 46 | (val) = op(args); \ | ^~ include/linux/iopoll.h:176:9: note: in expansion of macro 'readx_poll_timeout' 176 | readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) | ^~~~~~~~~~~~~~~~~~ pvr_device.h:649:16: note: in expansion of macro 'readq_poll_timeout' 649 | return readq_poll_timeout(pvr_dev->regs + reg_addr, value, | ^~~~~~~~~~~~~~~~~~ In file included from include/linux/bitops.h:67, from include/linux/kernel.h:23, from pvr_rogue_fwif.h:10, from pvr_ccb.h:7, from pvr_device.h:7: pvr_vm.c: In function 'pvr_vm_create_context': >> include/uapi/linux/const.h:20:25: warning: conversion from 'long long unsigned int' to 'long unsigned int' changes value from '1099511627776' to '0' [-Woverflow] 20 | #define __AC(X,Y) (X##Y) | ^~~~~~ arch/x86/include/asm/bitops.h:265:40: note: in definition of macro '__ffs' 265 | (unsigned long)__builtin_ctzl(word) : \ | ^~~~ include/uapi/linux/const.h:21:25: note: in expansion of macro '__AC' 21 | #define _AC(X,Y) __AC(X,Y) | ^~~~ include/linux/sizes.h:63:41: note: in expansion of macro '_AC' 63 | #define SZ_1T _AC(0x10000000000, ULL) | ^~~ pvr_mmu.h:87:40: note: in expansion of macro 'SZ_1T' 87 | #define PVR_PAGE_TABLE_ADDR_SPACE_SIZE SZ_1T | ^~~~~ pvr_mmu.h:88:40: note: in expansion of macro 'PVR_PAGE_TABLE_ADDR_SPACE_SIZE' 88 | #define PVR_PAGE_TABLE_ADDR_BITS __ffs(PVR_PAGE_TABLE_ADDR_SPACE_SIZE) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pvr_vm.c:556:33: note: in expansion of macro 'PVR_PAGE_TABLE_ADDR_BITS' 556 | if (device_addr_bits != PVR_PAGE_TABLE_ADDR_BITS) { | ^~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +176 include/linux/iopoll.h 57a29df341466b Kai-Heng Feng 2020-04-25 115 54c523127bcca9 Matt Wagantall 2014-12-15 116 /** 54c523127bcca9 Matt Wagantall 2014-12-15 117 * readx_poll_timeout - Periodically poll an address until a condition is met or a timeout occurs 54c523127bcca9 Matt Wagantall 2014-12-15 118 * @op: accessor function (takes @addr as its only argument) 54c523127bcca9 Matt Wagantall 2014-12-15 119 * @addr: Address to poll 54c523127bcca9 Matt Wagantall 2014-12-15 120 * @val: Variable to read the value into 54c523127bcca9 Matt Wagantall 2014-12-15 121 * @cond: Break condition (usually involving @val) 89124747f096fc Anna-Maria Behnsen 2024-10-14 122 * @sleep_us: Maximum time to sleep between reads in us (0 tight-loops). Please 89124747f096fc Anna-Maria Behnsen 2024-10-14 123 * read usleep_range() function description for details and 89124747f096fc Anna-Maria Behnsen 2024-10-14 124 * limitations. 54c523127bcca9 Matt Wagantall 2014-12-15 125 * @timeout_us: Timeout in us, 0 means never timeout 54c523127bcca9 Matt Wagantall 2014-12-15 126 * 54c523127bcca9 Matt Wagantall 2014-12-15 127 * When available, you'll probably want to use one of the specialized 54c523127bcca9 Matt Wagantall 2014-12-15 128 * macros defined below rather than this macro directly. 89124747f096fc Anna-Maria Behnsen 2024-10-14 129 * 89124747f096fc Anna-Maria Behnsen 2024-10-14 130 * Returns: 0 on success and -ETIMEDOUT upon a timeout. In either 89124747f096fc Anna-Maria Behnsen 2024-10-14 131 * case, the last read value at @addr is stored in @val. Must not 89124747f096fc Anna-Maria Behnsen 2024-10-14 132 * be called from atomic context if sleep_us or timeout_us are used. 54c523127bcca9 Matt Wagantall 2014-12-15 133 */ 54c523127bcca9 Matt Wagantall 2014-12-15 134 #define readx_poll_timeout(op, addr, val, cond, sleep_us, timeout_us) \ eaa6b01024a74a Dejin Zheng 2020-03-23 135 read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr) 54c523127bcca9 Matt Wagantall 2014-12-15 136 54c523127bcca9 Matt Wagantall 2014-12-15 137 /** 54c523127bcca9 Matt Wagantall 2014-12-15 138 * readx_poll_timeout_atomic - Periodically poll an address until a condition is met or a timeout occurs 54c523127bcca9 Matt Wagantall 2014-12-15 139 * @op: accessor function (takes @addr as its only argument) 54c523127bcca9 Matt Wagantall 2014-12-15 140 * @addr: Address to poll 54c523127bcca9 Matt Wagantall 2014-12-15 141 * @val: Variable to read the value into 54c523127bcca9 Matt Wagantall 2014-12-15 142 * @cond: Break condition (usually involving @val) 89124747f096fc Anna-Maria Behnsen 2024-10-14 143 * @delay_us: Time to udelay between reads in us (0 tight-loops). Please 89124747f096fc Anna-Maria Behnsen 2024-10-14 144 * read udelay() function description for details and 89124747f096fc Anna-Maria Behnsen 2024-10-14 145 * limitations. 54c523127bcca9 Matt Wagantall 2014-12-15 146 * @timeout_us: Timeout in us, 0 means never timeout 54c523127bcca9 Matt Wagantall 2014-12-15 147 * 54c523127bcca9 Matt Wagantall 2014-12-15 148 * When available, you'll probably want to use one of the specialized 54c523127bcca9 Matt Wagantall 2014-12-15 149 * macros defined below rather than this macro directly. 89124747f096fc Anna-Maria Behnsen 2024-10-14 150 * 89124747f096fc Anna-Maria Behnsen 2024-10-14 151 * Returns: 0 on success and -ETIMEDOUT upon a timeout. In either 89124747f096fc Anna-Maria Behnsen 2024-10-14 152 * case, the last read value at @addr is stored in @val. 54c523127bcca9 Matt Wagantall 2014-12-15 153 */ 54c523127bcca9 Matt Wagantall 2014-12-15 154 #define readx_poll_timeout_atomic(op, addr, val, cond, delay_us, timeout_us) \ 57a29df341466b Kai-Heng Feng 2020-04-25 155 read_poll_timeout_atomic(op, val, cond, delay_us, timeout_us, false, addr) 54c523127bcca9 Matt Wagantall 2014-12-15 156 54c523127bcca9 Matt Wagantall 2014-12-15 157 #define readb_poll_timeout(addr, val, cond, delay_us, timeout_us) \ 54c523127bcca9 Matt Wagantall 2014-12-15 158 readx_poll_timeout(readb, addr, val, cond, delay_us, timeout_us) 54c523127bcca9 Matt Wagantall 2014-12-15 159 54c523127bcca9 Matt Wagantall 2014-12-15 160 #define readb_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ 54c523127bcca9 Matt Wagantall 2014-12-15 161 readx_poll_timeout_atomic(readb, addr, val, cond, delay_us, timeout_us) 54c523127bcca9 Matt Wagantall 2014-12-15 162 54c523127bcca9 Matt Wagantall 2014-12-15 163 #define readw_poll_timeout(addr, val, cond, delay_us, timeout_us) \ 54c523127bcca9 Matt Wagantall 2014-12-15 164 readx_poll_timeout(readw, addr, val, cond, delay_us, timeout_us) 54c523127bcca9 Matt Wagantall 2014-12-15 165 54c523127bcca9 Matt Wagantall 2014-12-15 166 #define readw_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ 54c523127bcca9 Matt Wagantall 2014-12-15 167 readx_poll_timeout_atomic(readw, addr, val, cond, delay_us, timeout_us) 54c523127bcca9 Matt Wagantall 2014-12-15 168 54c523127bcca9 Matt Wagantall 2014-12-15 169 #define readl_poll_timeout(addr, val, cond, delay_us, timeout_us) \ 54c523127bcca9 Matt Wagantall 2014-12-15 170 readx_poll_timeout(readl, addr, val, cond, delay_us, timeout_us) 54c523127bcca9 Matt Wagantall 2014-12-15 171 54c523127bcca9 Matt Wagantall 2014-12-15 172 #define readl_poll_timeout_atomic(addr, val, cond, delay_us, timeout_us) \ 54c523127bcca9 Matt Wagantall 2014-12-15 173 readx_poll_timeout_atomic(readl, addr, val, cond, delay_us, timeout_us) 54c523127bcca9 Matt Wagantall 2014-12-15 174 54c523127bcca9 Matt Wagantall 2014-12-15 175 #define readq_poll_timeout(addr, val, cond, delay_us, timeout_us) \ 54c523127bcca9 Matt Wagantall 2014-12-15 @176 readx_poll_timeout(readq, addr, val, cond, delay_us, timeout_us) 54c523127bcca9 Matt Wagantall 2014-12-15 177 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
On Wed, Jun 18, 2025 at 12:22 PM Michal Wilczynski <m.wilczynski@samsung.com> wrote: > > Several RISC-V boards feature Imagination GPUs that are compatible with > the PowerVR driver. An example is the IMG BXM-4-64 GPU on the Lichee Pi > 4A board. This commit adjusts the driver's Kconfig dependencies to allow > the PowerVR driver to be compiled on the RISC-V architecture. > > By enabling compilation on RISC-V, we expand support for these GPUs, > providing graphics acceleration capabilities and enhancing hardware > compatibility on RISC-V platforms. > > Add a dependency on MMU to fix a build warning on RISC-V configurations > without an MMU and enable COMPILE_TEST to improve build coverage. > > Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> > Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com> > --- > drivers/gpu/drm/imagination/Kconfig | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/imagination/Kconfig b/drivers/gpu/drm/imagination/Kconfig > index 5f9fff43d6baadc42ebf48d91729bfbf27e06caa..48fd31c031628c70b1e0952271baccf7f4694810 100644 > --- a/drivers/gpu/drm/imagination/Kconfig > +++ b/drivers/gpu/drm/imagination/Kconfig > @@ -3,9 +3,10 @@ > > config DRM_POWERVR > tristate "Imagination Technologies PowerVR (Series 6 and later) & IMG Graphics" > - depends on ARM64 > + depends on (ARM64 || RISCV) || COMPILE_TEST Some maintainers could say that the COMPILE_TEST bit should be a separate commit but it's typically fine with me. > depends on DRM > depends on PM > + depends on MMU > select DRM_EXEC > select DRM_GEM_SHMEM_HELPER > select DRM_SCHED > > -- > 2.34.1 > Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
© 2016 - 2025 Red Hat, Inc.