Skip to content

[PW_SID:976146] [v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management#577

Closed
linux-riscv-bot wants to merge 6 commits into
workflow__riscv__fixesfrom
pw976146
Closed

[PW_SID:976146] [v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management#577
linux-riscv-bot wants to merge 6 commits into
workflow__riscv__fixesfrom
pw976146

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 976146 applied to workflow__riscv__fixes

Name: [v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=976146
Version: 7

Linux RISC-V bot and others added 6 commits June 24, 2025 01:05
Update the Imagination PVR DRM driver to leverage the pwrseq framework
for managing the complex power sequence of the GPU on the T-HEAD TH1520
SoC.

To cleanly separate platform specific logic from the generic driver,
this patch introduces a `pwr_power_sequence_ops` struct containing
function pointers for power_on and power_off operations. This allows for
different power management strategies to be selected at probe time based
on the device's compatible string.

A `pvr_device_data` struct, associated with each compatible in the
of_device_id table, points to the appropriate ops table (manual or
pwrseq).

At probe time, the driver inspects the assigned ops struct. If the
pwrseq variant is detected, the driver calls
devm_pwrseq_get("gpu-power"), deferring probe if the sequencer is not
yet available. Otherwise, it falls back to the existing manual clock and
reset handling. The runtime PM callbacks now call the appropriate
functions via the ops table.

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Update the img,powervr-rogue.yaml to include the T-HEAD TH1520 SoC's
specific GPU compatible string.

The thead,th1520-gpu compatible, along with its full chain
img,img-bxm-4-64, and img,img-rogue, is added to the
list of recognized GPU types.

While the BXM-4-64 GPU IP is designed with two distinct power domains,
the TH1520 SoC integrates it with only a single, unified power gate that
is controllable by the kernel.

To model this reality correctly while keeping the binding accurate for
other devices, add conditional constraints to the `allOf` section:
 - If the compatible is "thead,th1520-gpu", enforce a maximum of one
   power domain.
 - For other "img,img-bxm-4-64" and "img,img-bxs-4-64" devices,
   enforce a minimum of two power domains, using a 'not:' clause to
   exclude the TH1520.

This makes the binding strict and correct for both the specific TH1520
implementation and for other SoCs that use the B-series Rogue GPUs.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add the "gpu-clkgen" reset property to the AON device tree node. This
allows the AON power domain driver to detect the capability to power
sequence the GPU and spawn the necessary pwrseq-thead-gpu auxiliary
driver for managing the GPU's complex power sequence.

This commit also adds the prerequisite
dt-bindings/reset/thead,th1520-reset.h include to make the
TH1520_RESET_ID_GPU_CLKGEN available. This include was previously
dropped during a conflict resolution [1].

Link: https://lore.kernel.org/all/aAvfn2mq0Ksi8DF2@x1/ [1]

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Drew Fustini <drew@pdp7.com>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add a device tree node for the IMG BXM-4-64 GPU present in the T-HEAD
TH1520 SoC used by the Lichee Pi 4A board. This node enables support for
the GPU using the drm/imagination driver.

By adding this node, the kernel can recognize and initialize the GPU,
providing graphics acceleration capabilities on the Lichee Pi 4A and
other boards based on the TH1520 SoC.

Add fixed clock gpu_mem_clk, as the MEM clock on the T-HEAD SoC can't be
controlled programatically.

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Drew Fustini <drew@pdp7.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
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.

The RISC-V support is restricted to 64-bit systems (RISCV && 64BIT) as
the driver currently has an implicit dependency on a 64-bit platform.

Add a dependency on MMU to fix a build warning on RISC-V configurations
without an MMU.

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 104.67 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 928.20 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1258.17 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.87 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.96 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.76 seconds
Result: WARNING
Output:

CHECK: Lines should not end with a '('
#87: FILE: drivers/gpu/drm/imagination/pvr_device.c:654:
+			return dev_err_probe(

CHECK: Unbalanced braces around else statement
#91: FILE: drivers/gpu/drm/imagination/pvr_device.c:658:
+	} else

WARNING: DT compatible string "thead,th1520-gpu" appears un-documented -- check ./Documentation/devicetree/bindings/
#173: FILE: drivers/gpu/drm/imagination/pvr_drv.c:1496:
+		.compatible = "thead,th1520-gpu",

total: 0 errors, 1 warnings, 2 checks, 333 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit c37c6513388f ("drm/imagination: Use pwrseq for TH1520 GPU power management") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 2 checks, 333 lines checked
CHECK: Lines should not end with a '('
CHECK: Unbalanced braces around else statement
WARNING: DT compatible string "thead,th1520-gpu" appears un-documented -- check ./Documentation/devicetree/bindings/


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 71.97 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
kdoc
Desc: Detects for kdoc errors
Duration: 0.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v7,1/5] drm/imagination: Use pwrseq for TH1520 GPU power management"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 102.69 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 925.99 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1259.61 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.97 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.16 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.75 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 72.95 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
kdoc
Desc: Detects for kdoc errors
Duration: 0.82 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v7,2/5] dt-bindings: gpu: img,powervr-rogue: Add TH1520 GPU compatible"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v7,3/5] riscv: dts: thead: th1520: Add GPU clkgen reset to AON node"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v7,3/5] riscv: dts: thead: th1520: Add GPU clkgen reset to AON node"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 3: "[v7,3/5] riscv: dts: thead: th1520: Add GPU clkgen reset to AON node"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 103.46 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 985.40 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1328.64 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.98 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.50 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.85 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 71.52 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
kdoc
Desc: Detects for kdoc errors
Duration: 0.86 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 4: "[v7,4/5] riscv: dts: thead: th1520: Add IMG BXM-4-64 GPU node"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 103.50 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 990.73 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1341.11 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.01 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.99 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.67 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 72.37 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
kdoc
Desc: Detects for kdoc errors
Duration: 0.85 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 5: "[v7,5/5] drm/imagination: Enable PowerVR driver for RISC-V"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow__riscv__fixes branch from b5ded79 to a7cb30d Compare June 27, 2025 17:47
@linux-riscv-bot linux-riscv-bot deleted the pw976146 branch June 27, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant