Skip to content

[PW_SID:992127] drm/etnaviv: add support for GC620 on T-Head TH1520 - #786

Closed
linux-riscv-bot wants to merge 7 commits into
workflow__riscv__fixesfrom
pw992127
Closed

[PW_SID:992127] drm/etnaviv: add support for GC620 on T-Head TH1520#786
linux-riscv-bot wants to merge 7 commits into
workflow__riscv__fixesfrom
pw992127

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 992127 applied to workflow__riscv__fixes

Name: drm/etnaviv: add support for GC620 on T-Head TH1520
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=992127
Version: 1

This is the 2D GPU found on the T-Head TH1520 SoC. Feature bits taken
from the downstream kernel driver 6.4.6.9.354872.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
In the GC620 on T-Head TH1520 SoC, the SECURITY feature flag isn't set
but the SECURITY_AHB feature flag is set.

In this situation, the VIVS_MMUv2_AHB_CONTROL register isn't available,
but the GPU otherwise behave like secure ones and require commands to
load PTA.

The 6.4.6.9.354872 driver from T-Head asserts SECURITY_AHB feature flag
is set when SECURITY one is set, so it could be assumed that the
situation that only SECURITY is set do not exist.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The GC620 r5552 GPU found on T-Head TH1520 features (and requires) a
DEC400EX buffer compressor that needs to be set up. In addition, some
quirk exist for the DEC400 part that needs to be handled during GPU
reset, otherwise the reset will not happen.

Set the DEC400EX up and add the quirk code to the GPU reset codepath.

Currently the DEC400EX setup is gated by this specific GPU identity,
however in future we should add a feature flag for it.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
As we are forced to use a global shared context on some
PTA-equipped-but-broken GPUs, the fine-grained mutex locking in the
current implemtnation of etnaviv_iommuv2_context_alloc() won't be
meaningful any more.

Make the whole function to be protected by the global lock, in order to
prevent reentrance when allocating global shared context.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
As we have some unfortunate GPUs with IOMMUv2 but broken PTA (reloading
a different page table at runtime always fails), shared_context is now
not a v1-only thing.

Move it out of the v1 struct in the union.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Unfortunately the GC620 GPU seems to have broken PTA capibility, and
switching page table ID in command stream after it's running won't work.
As directly switching mtlb isn't working either, there will be no
reliable way to switch page table in the command stream, and a shared
context, like iommuv1, is needed.

Add support for this shared context situation. Shared context is set
when the broken PTA is known, and the context allocation code will be
made short circuit when a shared context is set.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The T-Head TH1520 SoC contains a GC620 2D graphics accelerator.

Enable it in the devicetree to allow using etnaviv driver with it.

This patch is currently very dirty because it relies on the bootloader
leaving the clocks enabled, and the core clock is a fake one.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 106.66 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1070.68 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1384.06 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.54 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.77 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 76.41 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
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 1: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
kdoc
Desc: Detects for kdoc errors
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
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: "[1/7] drm/etnaviv: add HWDB entry for GC620 r5552 c20b"
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: "[2/7] drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 105.44 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/7] drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1068.40 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/7] drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1395.83 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/7] drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/7] drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.91 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/7] drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 40.65 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/7] drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 76.00 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/7] drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag"
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: "[2/7] drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag"
kdoc
Desc: Detects for kdoc errors
Duration: 0.93 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/7] drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[2/7] drm/etnaviv: add handle for GPUs with only SECURITY_AHB flag"
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: "[5/7] drm/etnaviv: prepare for shared_context support for iommuv2"
kdoc
Desc: Detects for kdoc errors
Duration: 0.92 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[5/7] drm/etnaviv: prepare for shared_context support for iommuv2"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[5/7] drm/etnaviv: prepare for shared_context support for iommuv2"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 5: "[5/7] drm/etnaviv: prepare for shared_context support for iommuv2"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 105.56 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1069.38 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1388.52 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.35 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.44 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 4.35 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 76.01 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
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 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 6: "[6/7] drm/etnaviv: add shared context support for iommuv2"
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 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 104.88 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1099.79 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1412.84 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.15 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 22.89 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 3.39 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 75.88 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
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 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
kdoc
Desc: Detects for kdoc errors
Duration: 0.86 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 7: "[7/7,NOT,FOR,UPSTREAM] riscv: dts: thead: enable GC620 G2D on TH1520"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot deleted the pw992127 branch August 16, 2025 23:47
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.

2 participants