Skip to content

Commit f41830c

Browse files
committed
Merge tag 'drm-misc-next-2025-06-26' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
drm-misc-next for 6.17: UAPI Changes: Cross-subsystem Changes: Core Changes: - ci: Add Device tree validation and kunit - connector: Move HDR sink metadat to drm_display_info Driver Changes: - bochs: drm_panic Support - panfrost: MT8370 Support - bridge: - tc358767: Convert to devm_drm_bridge_alloc() Signed-off-by: Dave Airlie <[email protected]> From: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/20250626-sincere-loon-of-effort-6dbdf9@houat
2 parents 36c52fb + d6b93bf commit f41830c

File tree

18 files changed

+292
-61
lines changed

18 files changed

+292
-61
lines changed

Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ properties:
4242
- enum:
4343
- mediatek,mt8188-mali
4444
- mediatek,mt8192-mali
45+
- mediatek,mt8370-mali
4546
- const: arm,mali-valhall-jm # Mali Valhall GPU model/revision is fully discoverable
4647

4748
reg:
@@ -225,7 +226,9 @@ allOf:
225226
properties:
226227
compatible:
227228
contains:
228-
const: mediatek,mt8186-mali
229+
enum:
230+
- mediatek,mt8186-mali
231+
- mediatek,mt8370-mali
229232
then:
230233
properties:
231234
power-domains:

arch/arm64/boot/dts/mediatek/mt8370.dtsi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@
5959
<&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
6060
};
6161

62+
/*
63+
* Please note that overriding compatibles is a discouraged practice and is a
64+
* clear indication of nodes not being, well, compatible!
65+
*
66+
* This is a special case, where the GPU is the same as MT8188, but with one
67+
* of the cores fused out in this lower-binned SoC.
68+
*/
69+
&gpu {
70+
compatible = "mediatek,mt8370-mali", "arm,mali-valhall-jm";
71+
72+
power-domains = <&spm MT8188_POWER_DOMAIN_MFG2>,
73+
<&spm MT8188_POWER_DOMAIN_MFG3>;
74+
75+
power-domain-names = "core0", "core1";
76+
};
77+
6278
&ppi_cluster0 {
6379
affinity = <&cpu0 &cpu1 &cpu2 &cpu3>;
6480
};

drivers/gpu/drm/bridge/tc358767.c

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,14 @@
344344
#define COLOR_BAR_MODE_BARS 2
345345
#define PLL_DBG 0x0a04
346346

347+
enum tc_mode {
348+
mode_dpi_to_edp = BIT(1) | BIT(2),
349+
mode_dpi_to_dp = BIT(1),
350+
mode_dsi_to_edp = BIT(0) | BIT(2),
351+
mode_dsi_to_dp = BIT(0),
352+
mode_dsi_to_dpi = BIT(0) | BIT(1),
353+
};
354+
347355
static bool tc_test_pattern;
348356
module_param_named(test, tc_test_pattern, bool, 0644);
349357

@@ -2327,7 +2335,6 @@ static int tc_probe_dpi_bridge_endpoint(struct tc_data *tc)
23272335
if (bridge) {
23282336
tc->panel_bridge = bridge;
23292337
tc->bridge.type = DRM_MODE_CONNECTOR_DPI;
2330-
tc->bridge.funcs = &tc_dpi_bridge_funcs;
23312338

23322339
return 0;
23332340
}
@@ -2360,25 +2367,18 @@ static int tc_probe_edp_bridge_endpoint(struct tc_data *tc)
23602367
tc->bridge.type = DRM_MODE_CONNECTOR_DisplayPort;
23612368
}
23622369

2363-
tc->bridge.funcs = &tc_edp_bridge_funcs;
23642370
if (tc->hpd_pin >= 0)
23652371
tc->bridge.ops |= DRM_BRIDGE_OP_DETECT;
23662372
tc->bridge.ops |= DRM_BRIDGE_OP_EDID;
23672373

23682374
return 0;
23692375
}
23702376

2371-
static int tc_probe_bridge_endpoint(struct tc_data *tc)
2377+
static enum tc_mode tc_probe_get_mode(struct device *dev)
23722378
{
2373-
struct device *dev = tc->dev;
23742379
struct of_endpoint endpoint;
23752380
struct device_node *node = NULL;
2376-
const u8 mode_dpi_to_edp = BIT(1) | BIT(2);
2377-
const u8 mode_dpi_to_dp = BIT(1);
2378-
const u8 mode_dsi_to_edp = BIT(0) | BIT(2);
2379-
const u8 mode_dsi_to_dp = BIT(0);
2380-
const u8 mode_dsi_to_dpi = BIT(0) | BIT(1);
2381-
u8 mode = 0;
2381+
enum tc_mode mode = 0;
23822382

23832383
/*
23842384
* Determine bridge configuration.
@@ -2401,7 +2401,27 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc)
24012401
return -EINVAL;
24022402
}
24032403
mode |= BIT(endpoint.port);
2404+
}
2405+
2406+
if (mode != mode_dpi_to_edp &&
2407+
mode != mode_dpi_to_dp &&
2408+
mode != mode_dsi_to_dpi &&
2409+
mode != mode_dsi_to_edp &&
2410+
mode != mode_dsi_to_dp) {
2411+
dev_warn(dev, "Invalid mode (0x%x) is not supported!\n", mode);
2412+
return -EINVAL;
2413+
}
2414+
2415+
return mode;
2416+
}
24042417

2418+
static int tc_probe_bridge_endpoint(struct tc_data *tc, enum tc_mode mode)
2419+
{
2420+
struct device *dev = tc->dev;
2421+
struct of_endpoint endpoint;
2422+
struct device_node *node = NULL;
2423+
2424+
for_each_endpoint_of_node(dev->of_node, node) {
24052425
if (endpoint.port == 2) {
24062426
of_property_read_u8_array(node, "toshiba,pre-emphasis",
24072427
tc->pre_emphasis,
@@ -2427,24 +2447,28 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc)
24272447
return tc_probe_edp_bridge_endpoint(tc);
24282448
}
24292449

2430-
dev_warn(dev, "Invalid mode (0x%x) is not supported!\n", mode);
2431-
2450+
/* Should never happen, mode was validated by tc_probe_get_mode() */
24322451
return -EINVAL;
24332452
}
24342453

24352454
static int tc_probe(struct i2c_client *client)
24362455
{
24372456
struct device *dev = &client->dev;
2457+
const struct drm_bridge_funcs *funcs;
24382458
struct tc_data *tc;
2459+
int mode;
24392460
int ret;
24402461

2441-
tc = devm_kzalloc(dev, sizeof(*tc), GFP_KERNEL);
2442-
if (!tc)
2443-
return -ENOMEM;
2462+
mode = tc_probe_get_mode(dev);
2463+
funcs = (mode == mode_dsi_to_dpi) ? &tc_dpi_bridge_funcs : &tc_edp_bridge_funcs;
2464+
2465+
tc = devm_drm_bridge_alloc(dev, struct tc_data, bridge, funcs);
2466+
if (IS_ERR(tc))
2467+
return PTR_ERR(tc);
24442468

24452469
tc->dev = dev;
24462470

2447-
ret = tc_probe_bridge_endpoint(tc);
2471+
ret = tc_probe_bridge_endpoint(tc, mode);
24482472
if (ret)
24492473
return ret;
24502474

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
.dt-check-base:
2+
stage: static-checks
3+
timeout: "30m"
4+
variables:
5+
GIT_DEPTH: 1
6+
FF_USE_NEW_BASH_EVAL_STRATEGY: 'true'
7+
SCHEMA: "display:gpu"
8+
VENV_PATH: "/tmp/dtcheck-venv"
9+
before_script:
10+
- apt-get update -qq
11+
# Minimum supported version of LLVM for building x86 kernels is 15.0.0.
12+
# In mesa-ci containers, LLVM_VERSION is defined as a container-level property and is currently set to 19.
13+
- apt-get install -y --no-install-recommends clang-${LLVM_VERSION} lld-${LLVM_VERSION} llvm-${LLVM_VERSION} python3-dev python3-venv python3-pip yamllint
14+
- python3 -m venv "${VENV_PATH}"
15+
- source "${VENV_PATH}/bin/activate"
16+
- pip3 install dtschema
17+
script:
18+
- drivers/gpu/drm/ci/${SCRIPT_NAME}
19+
artifacts:
20+
when: on_failure
21+
paths:
22+
- ${ARTIFACT_FILE}
23+
allow_failure:
24+
exit_codes:
25+
- 102
26+
27+
dtbs-check:arm32:
28+
extends:
29+
- .build:arm32
30+
- .dt-check-base
31+
variables:
32+
SCRIPT_NAME: "dtbs-check.sh"
33+
ARTIFACT_FILE: "dtbs-check.log"
34+
35+
dtbs-check:arm64:
36+
extends:
37+
- .build:arm64
38+
- .dt-check-base
39+
variables:
40+
SCRIPT_NAME: "dtbs-check.sh"
41+
ARTIFACT_FILE: "dtbs-check.log"
42+
43+
dt-binding-check:
44+
extends:
45+
- .build
46+
- .use-debian/x86_64_build
47+
- .dt-check-base
48+
variables:
49+
SCRIPT_NAME: "dt-binding-check.sh"
50+
ARTIFACT_FILE: "dt-binding-check.log"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: MIT
3+
4+
set -euxo pipefail
5+
6+
VENV_PATH="${VENV_PATH:-/tmp/dtschema-venv}"
7+
source "${VENV_PATH}/bin/activate"
8+
9+
if ! make -j"${FDO_CI_CONCURRENT:-4}" dt_binding_check \
10+
DT_SCHEMA_FILES="${SCHEMA:-}" 2>dt-binding-check.log; then
11+
echo "ERROR: 'make dt_binding_check' failed. Please check dt-binding-check.log for details."
12+
exit 1
13+
fi
14+
15+
if [[ -s dt-binding-check.log ]]; then
16+
echo "WARNING: dt_binding_check reported warnings. Please check dt-binding-check.log" \
17+
"for details."
18+
exit 102
19+
fi

drivers/gpu/drm/ci/dtbs-check.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: MIT
3+
4+
set -euxo pipefail
5+
6+
: "${KERNEL_ARCH:?ERROR: KERNEL_ARCH must be set}"
7+
: "${LLVM_VERSION:?ERROR: LLVM_VERSION must be set}"
8+
9+
./drivers/gpu/drm/ci/setup-llvm-links.sh
10+
11+
make LLVM=1 ARCH="${KERNEL_ARCH}" defconfig
12+
13+
if ! make -j"${FDO_CI_CONCURRENT:-4}" ARCH="${KERNEL_ARCH}" LLVM=1 dtbs_check \
14+
DT_SCHEMA_FILES="${SCHEMA:-}" 2>dtbs-check.log; then
15+
echo "ERROR: 'make dtbs_check' failed. Please check dtbs-check.log for details."
16+
exit 1
17+
fi
18+
19+
if [[ -s dtbs-check.log ]]; then
20+
echo "WARNING: dtbs_check reported warnings. Please check dtbs-check.log for details."
21+
exit 102
22+
fi

drivers/gpu/drm/ci/gitlab-ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ include:
110110
- drivers/gpu/drm/ci/static-checks.yml
111111
- drivers/gpu/drm/ci/build.yml
112112
- drivers/gpu/drm/ci/test.yml
113+
- drivers/gpu/drm/ci/check-devicetrees.yml
114+
- drivers/gpu/drm/ci/kunit.yml
113115
- 'https://gitlab.freedesktop.org/gfx-ci/lab-status/-/raw/main/lab-status.yml'
114116

115117

@@ -119,6 +121,8 @@ stages:
119121
- git-archive
120122
- build-for-tests
121123
- build-only
124+
- static-checks
125+
- kunit
122126
- code-validation
123127
- amdgpu
124128
- i915

drivers/gpu/drm/ci/kunit.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: MIT
3+
4+
set -euxo pipefail
5+
6+
: "${KERNEL_ARCH:?ERROR: KERNEL_ARCH must be set}"
7+
: "${LLVM_VERSION:?ERROR: LLVM_VERSION must be set}"
8+
9+
./drivers/gpu/drm/ci/setup-llvm-links.sh
10+
11+
export PATH="/usr/bin:$PATH"
12+
13+
./tools/testing/kunit/kunit.py run \
14+
--arch "${KERNEL_ARCH}" \
15+
--make_options LLVM=1 \
16+
--kunitconfig=drivers/gpu/drm/tests

drivers/gpu/drm/ci/kunit.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.kunit-packages: &kunit-packages
2+
- apt-get update -qq
3+
# Minimum supported version of LLVM for building x86 kernels is 15.0.0.
4+
# In mesa-ci containers, LLVM_VERSION is defined as a container-level property and is currently set to 19.
5+
- apt-get install -y --no-install-recommends clang-${LLVM_VERSION} lld-${LLVM_VERSION} llvm-${LLVM_VERSION}
6+
7+
.kunit-base:
8+
stage: kunit
9+
timeout: "30m"
10+
variables:
11+
GIT_DEPTH: 1
12+
script:
13+
- drivers/gpu/drm/ci/kunit.sh
14+
15+
kunit:arm32:
16+
extends:
17+
- .build:arm32
18+
- .kunit-base
19+
before_script:
20+
- *kunit-packages
21+
- apt-get install -y --no-install-recommends qemu-system-arm
22+
23+
kunit:arm64:
24+
extends:
25+
- .build:arm64
26+
- .kunit-base
27+
before_script:
28+
- *kunit-packages
29+
- apt-get install -y --no-install-recommends qemu-system-aarch64
30+
31+
kunit:x86_64:
32+
extends:
33+
- .build:x86_64
34+
- .kunit-base
35+
before_script:
36+
- *kunit-packages
37+
- apt-get install -y --no-install-recommends qemu-system-x86
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
# SPDX-License-Identifier: MIT
3+
set -euo pipefail
4+
5+
ln -svf "$(which clang++-${LLVM_VERSION})" /usr/bin/clang++
6+
ln -svf "$(which clang-${LLVM_VERSION})" /usr/bin/clang
7+
ln -svf "$(which ld.lld-${LLVM_VERSION})" /usr/bin/ld.lld
8+
ln -svf "$(which lld-${LLVM_VERSION})" /usr/bin/lld
9+
ln -svf "$(which llvm-ar-${LLVM_VERSION})" /usr/bin/llvm-ar
10+
ln -svf "$(which llvm-nm-${LLVM_VERSION})" /usr/bin/llvm-nm
11+
ln -svf "$(which llvm-objcopy-${LLVM_VERSION})" /usr/bin/llvm-objcopy
12+
ln -svf "$(which llvm-readelf-${LLVM_VERSION})" /usr/bin/llvm-readelf
13+
ln -svf "$(which llvm-strip-${LLVM_VERSION})" /usr/bin/llvm-strip

0 commit comments

Comments
 (0)