diff options
author | Dave Airlie <airlied@redhat.com> | 2025-06-27 09:57:43 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2025-06-27 09:58:05 +1000 |
commit | f41830c57bb8e70e283b9db251c95f1270a8279d (patch) | |
tree | a35c093992319992949074c8adf627fb9a4e1eec | |
parent | 36c52fb703e90388285963fc8f03cf60f76cbe4c (diff) | |
parent | d6b93bfa5d1eba452e494d3a05d6bef65bc569b7 (diff) |
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 <airlied@redhat.com>
From: Maxime Ripard <mripard@redhat.com>
Link: https://lore.kernel.org/r/20250626-sincere-loon-of-effort-6dbdf9@houat
-rw-r--r-- | Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml | 5 | ||||
-rw-r--r-- | arch/arm64/boot/dts/mediatek/mt8370.dtsi | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/bridge/tc358767.c | 56 | ||||
-rw-r--r-- | drivers/gpu/drm/ci/check-devicetrees.yml | 50 | ||||
-rwxr-xr-x | drivers/gpu/drm/ci/dt-binding-check.sh | 19 | ||||
-rwxr-xr-x | drivers/gpu/drm/ci/dtbs-check.sh | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/ci/gitlab-ci.yml | 4 | ||||
-rwxr-xr-x | drivers/gpu/drm/ci/kunit.sh | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/ci/kunit.yml | 37 | ||||
-rwxr-xr-x | drivers/gpu/drm/ci/setup-llvm-links.sh | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/display/drm_hdmi_helper.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_connector.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 19 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_display.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_drv.c | 61 | ||||
-rw-r--r-- | drivers/gpu/drm/tiny/bochs.c | 19 | ||||
-rw-r--r-- | include/drm/drm_connector.h | 8 |
18 files changed, 292 insertions, 61 deletions
diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml index b8d659d272d0..7e947016dee9 100644 --- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml +++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml @@ -42,6 +42,7 @@ properties: - enum: - mediatek,mt8188-mali - mediatek,mt8192-mali + - mediatek,mt8370-mali - const: arm,mali-valhall-jm # Mali Valhall GPU model/revision is fully discoverable reg: @@ -225,7 +226,9 @@ allOf: properties: compatible: contains: - const: mediatek,mt8186-mali + enum: + - mediatek,mt8186-mali + - mediatek,mt8370-mali then: properties: power-domains: diff --git a/arch/arm64/boot/dts/mediatek/mt8370.dtsi b/arch/arm64/boot/dts/mediatek/mt8370.dtsi index cf1a3759451f..7ac8b8d03494 100644 --- a/arch/arm64/boot/dts/mediatek/mt8370.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8370.dtsi @@ -59,6 +59,22 @@ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; }; +/* + * Please note that overriding compatibles is a discouraged practice and is a + * clear indication of nodes not being, well, compatible! + * + * This is a special case, where the GPU is the same as MT8188, but with one + * of the cores fused out in this lower-binned SoC. + */ +&gpu { + compatible = "mediatek,mt8370-mali", "arm,mali-valhall-jm"; + + power-domains = <&spm MT8188_POWER_DOMAIN_MFG2>, + <&spm MT8188_POWER_DOMAIN_MFG3>; + + power-domain-names = "core0", "core1"; +}; + &ppi_cluster0 { affinity = <&cpu0 &cpu1 &cpu2 &cpu3>; }; diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 7e5449fb86a3..61559467e2d2 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -344,6 +344,14 @@ #define COLOR_BAR_MODE_BARS 2 #define PLL_DBG 0x0a04 +enum tc_mode { + mode_dpi_to_edp = BIT(1) | BIT(2), + mode_dpi_to_dp = BIT(1), + mode_dsi_to_edp = BIT(0) | BIT(2), + mode_dsi_to_dp = BIT(0), + mode_dsi_to_dpi = BIT(0) | BIT(1), +}; + static bool tc_test_pattern; module_param_named(test, tc_test_pattern, bool, 0644); @@ -2327,7 +2335,6 @@ static int tc_probe_dpi_bridge_endpoint(struct tc_data *tc) if (bridge) { tc->panel_bridge = bridge; tc->bridge.type = DRM_MODE_CONNECTOR_DPI; - tc->bridge.funcs = &tc_dpi_bridge_funcs; return 0; } @@ -2360,7 +2367,6 @@ static int tc_probe_edp_bridge_endpoint(struct tc_data *tc) tc->bridge.type = DRM_MODE_CONNECTOR_DisplayPort; } - tc->bridge.funcs = &tc_edp_bridge_funcs; if (tc->hpd_pin >= 0) tc->bridge.ops |= DRM_BRIDGE_OP_DETECT; tc->bridge.ops |= DRM_BRIDGE_OP_EDID; @@ -2368,17 +2374,11 @@ static int tc_probe_edp_bridge_endpoint(struct tc_data *tc) return 0; } -static int tc_probe_bridge_endpoint(struct tc_data *tc) +static enum tc_mode tc_probe_get_mode(struct device *dev) { - struct device *dev = tc->dev; struct of_endpoint endpoint; struct device_node *node = NULL; - const u8 mode_dpi_to_edp = BIT(1) | BIT(2); - const u8 mode_dpi_to_dp = BIT(1); - const u8 mode_dsi_to_edp = BIT(0) | BIT(2); - const u8 mode_dsi_to_dp = BIT(0); - const u8 mode_dsi_to_dpi = BIT(0) | BIT(1); - u8 mode = 0; + enum tc_mode mode = 0; /* * Determine bridge configuration. @@ -2401,7 +2401,27 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc) return -EINVAL; } mode |= BIT(endpoint.port); + } + + if (mode != mode_dpi_to_edp && + mode != mode_dpi_to_dp && + mode != mode_dsi_to_dpi && + mode != mode_dsi_to_edp && + mode != mode_dsi_to_dp) { + dev_warn(dev, "Invalid mode (0x%x) is not supported!\n", mode); + return -EINVAL; + } + + return mode; +} +static int tc_probe_bridge_endpoint(struct tc_data *tc, enum tc_mode mode) +{ + struct device *dev = tc->dev; + struct of_endpoint endpoint; + struct device_node *node = NULL; + + for_each_endpoint_of_node(dev->of_node, node) { if (endpoint.port == 2) { of_property_read_u8_array(node, "toshiba,pre-emphasis", tc->pre_emphasis, @@ -2427,24 +2447,28 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc) return tc_probe_edp_bridge_endpoint(tc); } - dev_warn(dev, "Invalid mode (0x%x) is not supported!\n", mode); - + /* Should never happen, mode was validated by tc_probe_get_mode() */ return -EINVAL; } static int tc_probe(struct i2c_client *client) { struct device *dev = &client->dev; + const struct drm_bridge_funcs *funcs; struct tc_data *tc; + int mode; int ret; - tc = devm_kzalloc(dev, sizeof(*tc), GFP_KERNEL); - if (!tc) - return -ENOMEM; + mode = tc_probe_get_mode(dev); + funcs = (mode == mode_dsi_to_dpi) ? &tc_dpi_bridge_funcs : &tc_edp_bridge_funcs; + + tc = devm_drm_bridge_alloc(dev, struct tc_data, bridge, funcs); + if (IS_ERR(tc)) + return PTR_ERR(tc); tc->dev = dev; - ret = tc_probe_bridge_endpoint(tc); + ret = tc_probe_bridge_endpoint(tc, mode); if (ret) return ret; diff --git a/drivers/gpu/drm/ci/check-devicetrees.yml b/drivers/gpu/drm/ci/check-devicetrees.yml new file mode 100644 index 000000000000..727bd56018b8 --- /dev/null +++ b/drivers/gpu/drm/ci/check-devicetrees.yml @@ -0,0 +1,50 @@ +.dt-check-base: + stage: static-checks + timeout: "30m" + variables: + GIT_DEPTH: 1 + FF_USE_NEW_BASH_EVAL_STRATEGY: 'true' + SCHEMA: "display:gpu" + VENV_PATH: "/tmp/dtcheck-venv" + before_script: + - apt-get update -qq + # Minimum supported version of LLVM for building x86 kernels is 15.0.0. + # In mesa-ci containers, LLVM_VERSION is defined as a container-level property and is currently set to 19. + - apt-get install -y --no-install-recommends clang-${LLVM_VERSION} lld-${LLVM_VERSION} llvm-${LLVM_VERSION} python3-dev python3-venv python3-pip yamllint + - python3 -m venv "${VENV_PATH}" + - source "${VENV_PATH}/bin/activate" + - pip3 install dtschema + script: + - drivers/gpu/drm/ci/${SCRIPT_NAME} + artifacts: + when: on_failure + paths: + - ${ARTIFACT_FILE} + allow_failure: + exit_codes: + - 102 + +dtbs-check:arm32: + extends: + - .build:arm32 + - .dt-check-base + variables: + SCRIPT_NAME: "dtbs-check.sh" + ARTIFACT_FILE: "dtbs-check.log" + +dtbs-check:arm64: + extends: + - .build:arm64 + - .dt-check-base + variables: + SCRIPT_NAME: "dtbs-check.sh" + ARTIFACT_FILE: "dtbs-check.log" + +dt-binding-check: + extends: + - .build + - .use-debian/x86_64_build + - .dt-check-base + variables: + SCRIPT_NAME: "dt-binding-check.sh" + ARTIFACT_FILE: "dt-binding-check.log" diff --git a/drivers/gpu/drm/ci/dt-binding-check.sh b/drivers/gpu/drm/ci/dt-binding-check.sh new file mode 100755 index 000000000000..99e1c0df84b7 --- /dev/null +++ b/drivers/gpu/drm/ci/dt-binding-check.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT + +set -euxo pipefail + +VENV_PATH="${VENV_PATH:-/tmp/dtschema-venv}" +source "${VENV_PATH}/bin/activate" + +if ! make -j"${FDO_CI_CONCURRENT:-4}" dt_binding_check \ + DT_SCHEMA_FILES="${SCHEMA:-}" 2>dt-binding-check.log; then + echo "ERROR: 'make dt_binding_check' failed. Please check dt-binding-check.log for details." + exit 1 +fi + +if [[ -s dt-binding-check.log ]]; then + echo "WARNING: dt_binding_check reported warnings. Please check dt-binding-check.log" \ + "for details." + exit 102 +fi diff --git a/drivers/gpu/drm/ci/dtbs-check.sh b/drivers/gpu/drm/ci/dtbs-check.sh new file mode 100755 index 000000000000..57842c452439 --- /dev/null +++ b/drivers/gpu/drm/ci/dtbs-check.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT + +set -euxo pipefail + +: "${KERNEL_ARCH:?ERROR: KERNEL_ARCH must be set}" +: "${LLVM_VERSION:?ERROR: LLVM_VERSION must be set}" + +./drivers/gpu/drm/ci/setup-llvm-links.sh + +make LLVM=1 ARCH="${KERNEL_ARCH}" defconfig + +if ! make -j"${FDO_CI_CONCURRENT:-4}" ARCH="${KERNEL_ARCH}" LLVM=1 dtbs_check \ + DT_SCHEMA_FILES="${SCHEMA:-}" 2>dtbs-check.log; then + echo "ERROR: 'make dtbs_check' failed. Please check dtbs-check.log for details." + exit 1 +fi + +if [[ -s dtbs-check.log ]]; then + echo "WARNING: dtbs_check reported warnings. Please check dtbs-check.log for details." + exit 102 +fi diff --git a/drivers/gpu/drm/ci/gitlab-ci.yml b/drivers/gpu/drm/ci/gitlab-ci.yml index ba75b3a7eca4..9a32cd736f2f 100644 --- a/drivers/gpu/drm/ci/gitlab-ci.yml +++ b/drivers/gpu/drm/ci/gitlab-ci.yml @@ -110,6 +110,8 @@ include: - drivers/gpu/drm/ci/static-checks.yml - drivers/gpu/drm/ci/build.yml - drivers/gpu/drm/ci/test.yml + - drivers/gpu/drm/ci/check-devicetrees.yml + - drivers/gpu/drm/ci/kunit.yml - 'https://gitlab.freedesktop.org/gfx-ci/lab-status/-/raw/main/lab-status.yml' @@ -119,6 +121,8 @@ stages: - git-archive - build-for-tests - build-only + - static-checks + - kunit - code-validation - amdgpu - i915 diff --git a/drivers/gpu/drm/ci/kunit.sh b/drivers/gpu/drm/ci/kunit.sh new file mode 100755 index 000000000000..7a1052fd3f17 --- /dev/null +++ b/drivers/gpu/drm/ci/kunit.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT + +set -euxo pipefail + +: "${KERNEL_ARCH:?ERROR: KERNEL_ARCH must be set}" +: "${LLVM_VERSION:?ERROR: LLVM_VERSION must be set}" + +./drivers/gpu/drm/ci/setup-llvm-links.sh + +export PATH="/usr/bin:$PATH" + +./tools/testing/kunit/kunit.py run \ + --arch "${KERNEL_ARCH}" \ + --make_options LLVM=1 \ + --kunitconfig=drivers/gpu/drm/tests diff --git a/drivers/gpu/drm/ci/kunit.yml b/drivers/gpu/drm/ci/kunit.yml new file mode 100644 index 000000000000..0d5b2c4433d2 --- /dev/null +++ b/drivers/gpu/drm/ci/kunit.yml @@ -0,0 +1,37 @@ +.kunit-packages: &kunit-packages + - apt-get update -qq + # Minimum supported version of LLVM for building x86 kernels is 15.0.0. + # In mesa-ci containers, LLVM_VERSION is defined as a container-level property and is currently set to 19. + - apt-get install -y --no-install-recommends clang-${LLVM_VERSION} lld-${LLVM_VERSION} llvm-${LLVM_VERSION} + +.kunit-base: + stage: kunit + timeout: "30m" + variables: + GIT_DEPTH: 1 + script: + - drivers/gpu/drm/ci/kunit.sh + +kunit:arm32: + extends: + - .build:arm32 + - .kunit-base + before_script: + - *kunit-packages + - apt-get install -y --no-install-recommends qemu-system-arm + +kunit:arm64: + extends: + - .build:arm64 + - .kunit-base + before_script: + - *kunit-packages + - apt-get install -y --no-install-recommends qemu-system-aarch64 + +kunit:x86_64: + extends: + - .build:x86_64 + - .kunit-base + before_script: + - *kunit-packages + - apt-get install -y --no-install-recommends qemu-system-x86 diff --git a/drivers/gpu/drm/ci/setup-llvm-links.sh b/drivers/gpu/drm/ci/setup-llvm-links.sh new file mode 100755 index 000000000000..ace33af82a3f --- /dev/null +++ b/drivers/gpu/drm/ci/setup-llvm-links.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MIT +set -euo pipefail + +ln -svf "$(which clang++-${LLVM_VERSION})" /usr/bin/clang++ +ln -svf "$(which clang-${LLVM_VERSION})" /usr/bin/clang +ln -svf "$(which ld.lld-${LLVM_VERSION})" /usr/bin/ld.lld +ln -svf "$(which lld-${LLVM_VERSION})" /usr/bin/lld +ln -svf "$(which llvm-ar-${LLVM_VERSION})" /usr/bin/llvm-ar +ln -svf "$(which llvm-nm-${LLVM_VERSION})" /usr/bin/llvm-nm +ln -svf "$(which llvm-objcopy-${LLVM_VERSION})" /usr/bin/llvm-objcopy +ln -svf "$(which llvm-readelf-${LLVM_VERSION})" /usr/bin/llvm-readelf +ln -svf "$(which llvm-strip-${LLVM_VERSION})" /usr/bin/llvm-strip diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c index 6063c155bdea..a237dc55805d 100644 --- a/drivers/gpu/drm/display/drm_hdmi_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_helper.c @@ -45,7 +45,7 @@ int drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame, /* Sink EOTF is Bit map while infoframe is absolute values */ if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf, - connector->hdr_sink_metadata.hdmi_type1.eotf)) + connector->display_info.hdr_sink_metadata.hdmi_type1.eotf)) DRM_DEBUG_KMS("Unknown EOTF %d\n", hdr_metadata->hdmi_metadata_type1.eotf); err = hdmi_drm_infoframe_init(frame); diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 0167e0e0d425..272d6254ea47 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1687,7 +1687,7 @@ EXPORT_SYMBOL(drm_hdmi_connector_get_output_format_name); * structure from userspace. This is received as blob and stored in * &drm_connector_state.hdr_output_metadata. It parses EDID and saves the * sink metadata in &struct hdr_sink_metadata, as - * &drm_connector.hdr_sink_metadata. Driver uses + * &drm_connector.display_info.hdr_sink_metadata. Driver uses * drm_hdmi_infoframe_set_hdr_metadata() helper to set the HDR metadata, * hdmi_drm_infoframe_pack() to pack the infoframe as per spec, in case of * HDMI encoder. diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index a876d7ef252b..e2e85345aa9a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -5394,7 +5394,8 @@ static void fixup_detailed_cea_mode_clock(struct drm_connector *connector, static void drm_calculate_luminance_range(struct drm_connector *connector) { - struct hdr_static_metadata *hdr_metadata = &connector->hdr_sink_metadata.hdmi_type1; + const struct hdr_static_metadata *hdr_metadata = + &connector->display_info.hdr_sink_metadata.hdmi_type1; struct drm_luminance_range_info *luminance_range = &connector->display_info.luminance_range; static const u8 pre_computed_values[] = { @@ -5455,21 +5456,21 @@ static uint8_t hdr_metadata_type(const u8 *edid_ext) static void drm_parse_hdr_metadata_block(struct drm_connector *connector, const u8 *db) { + struct hdr_static_metadata *hdr_metadata = + &connector->display_info.hdr_sink_metadata.hdmi_type1; u16 len; len = cea_db_payload_len(db); - connector->hdr_sink_metadata.hdmi_type1.eotf = - eotf_supported(db); - connector->hdr_sink_metadata.hdmi_type1.metadata_type = - hdr_metadata_type(db); + hdr_metadata->eotf = eotf_supported(db); + hdr_metadata->metadata_type = hdr_metadata_type(db); if (len >= 4) - connector->hdr_sink_metadata.hdmi_type1.max_cll = db[4]; + hdr_metadata->max_cll = db[4]; if (len >= 5) - connector->hdr_sink_metadata.hdmi_type1.max_fall = db[5]; + hdr_metadata->max_fall = db[5]; if (len >= 6) { - connector->hdr_sink_metadata.hdmi_type1.min_cll = db[6]; + hdr_metadata->min_cll = db[6]; /* Calculate only when all values are available */ drm_calculate_luminance_range(connector); @@ -6617,7 +6618,7 @@ static void drm_reset_display_info(struct drm_connector *connector) info->has_hdmi_infoframe = false; info->rgb_quant_range_selectable = false; memset(&info->hdmi, 0, sizeof(info->hdmi)); - memset(&connector->hdr_sink_metadata, 0, sizeof(connector->hdr_sink_metadata)); + memset(&info->hdr_sink_metadata, 0, sizeof(info->hdr_sink_metadata)); info->edid_hdmi_rgb444_dc_modes = 0; info->edid_hdmi_ycbcr444_dc_modes = 0; diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c index 271b27c9de51..5537136c367a 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c @@ -145,7 +145,7 @@ intel_dp_aux_supports_hdr_backlight(struct intel_connector *connector) * ranges for such panels. */ if (display->params.enable_dpcd_backlight != INTEL_DP_AUX_BACKLIGHT_FORCE_INTEL && - !(connector->base.hdr_sink_metadata.hdmi_type1.metadata_type & + !(connector->base.display_info.hdr_sink_metadata.hdmi_type1.metadata_type & BIT(HDMI_STATIC_METADATA_TYPE1))) { drm_info(display->drm, "[CONNECTOR:%d:%s] Panel is missing HDR static metadata. Possible support for Intel HDR backlight interface is not used. If your backlight controls don't work try booting with i915.enable_dpcd_backlight=%d.\n", diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index add006fc8d81..c50ec347b30a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -495,7 +495,7 @@ nouveau_display_hpd_work(struct work_struct *work) if (first_changed_connector) drm_connector_put(first_changed_connector); - pm_runtime_mark_last_busy(drm->dev->dev); + pm_runtime_mark_last_busy(dev->dev); noop: pm_runtime_put_autosuspend(dev->dev); } diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 842239b43cdf..1ea6c509a5d5 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -866,6 +866,8 @@ static const struct panfrost_compatible amlogic_data = { .vendor_quirk = panfrost_gpu_amlogic_quirk, }; +static const char * const mediatek_pm_domains[] = { "core0", "core1", "core2", + "core3", "core4" }; /* * The old data with two power supplies for MT8183 is here only to * keep retro-compatibility with older devicetrees, as DVFS will @@ -874,51 +876,53 @@ static const struct panfrost_compatible amlogic_data = { * On new devicetrees please use the _b variant with a single and * coupled regulators instead. */ -static const char * const mediatek_mt8183_supplies[] = { "mali", "sram", NULL }; -static const char * const mediatek_mt8183_pm_domains[] = { "core0", "core1", "core2" }; +static const char * const legacy_supplies[] = { "mali", "sram", NULL }; static const struct panfrost_compatible mediatek_mt8183_data = { - .num_supplies = ARRAY_SIZE(mediatek_mt8183_supplies) - 1, - .supply_names = mediatek_mt8183_supplies, - .num_pm_domains = ARRAY_SIZE(mediatek_mt8183_pm_domains), - .pm_domain_names = mediatek_mt8183_pm_domains, + .num_supplies = ARRAY_SIZE(legacy_supplies) - 1, + .supply_names = legacy_supplies, + .num_pm_domains = 3, + .pm_domain_names = mediatek_pm_domains, }; -static const char * const mediatek_mt8183_b_supplies[] = { "mali", NULL }; static const struct panfrost_compatible mediatek_mt8183_b_data = { - .num_supplies = ARRAY_SIZE(mediatek_mt8183_b_supplies) - 1, - .supply_names = mediatek_mt8183_b_supplies, - .num_pm_domains = ARRAY_SIZE(mediatek_mt8183_pm_domains), - .pm_domain_names = mediatek_mt8183_pm_domains, + .num_supplies = ARRAY_SIZE(default_supplies) - 1, + .supply_names = default_supplies, + .num_pm_domains = 3, + .pm_domain_names = mediatek_pm_domains, .pm_features = BIT(GPU_PM_CLK_DIS) | BIT(GPU_PM_VREG_OFF), }; -static const char * const mediatek_mt8186_pm_domains[] = { "core0", "core1" }; static const struct panfrost_compatible mediatek_mt8186_data = { - .num_supplies = ARRAY_SIZE(mediatek_mt8183_b_supplies) - 1, - .supply_names = mediatek_mt8183_b_supplies, - .num_pm_domains = ARRAY_SIZE(mediatek_mt8186_pm_domains), - .pm_domain_names = mediatek_mt8186_pm_domains, + .num_supplies = ARRAY_SIZE(default_supplies) - 1, + .supply_names = default_supplies, + .num_pm_domains = 2, + .pm_domain_names = mediatek_pm_domains, .pm_features = BIT(GPU_PM_CLK_DIS) | BIT(GPU_PM_VREG_OFF), }; -/* MT8188 uses the same power domains and power supplies as MT8183 */ static const struct panfrost_compatible mediatek_mt8188_data = { - .num_supplies = ARRAY_SIZE(mediatek_mt8183_b_supplies) - 1, - .supply_names = mediatek_mt8183_b_supplies, - .num_pm_domains = ARRAY_SIZE(mediatek_mt8183_pm_domains), - .pm_domain_names = mediatek_mt8183_pm_domains, + .num_supplies = ARRAY_SIZE(default_supplies) - 1, + .supply_names = default_supplies, + .num_pm_domains = 3, + .pm_domain_names = mediatek_pm_domains, .pm_features = BIT(GPU_PM_CLK_DIS) | BIT(GPU_PM_VREG_OFF), .gpu_quirks = BIT(GPU_QUIRK_FORCE_AARCH64_PGTABLE), }; -static const char * const mediatek_mt8192_supplies[] = { "mali", NULL }; -static const char * const mediatek_mt8192_pm_domains[] = { "core0", "core1", "core2", - "core3", "core4" }; static const struct panfrost_compatible mediatek_mt8192_data = { - .num_supplies = ARRAY_SIZE(mediatek_mt8192_supplies) - 1, - .supply_names = mediatek_mt8192_supplies, - .num_pm_domains = ARRAY_SIZE(mediatek_mt8192_pm_domains), - .pm_domain_names = mediatek_mt8192_pm_domains, + .num_supplies = ARRAY_SIZE(default_supplies) - 1, + .supply_names = default_supplies, + .num_pm_domains = 5, + .pm_domain_names = mediatek_pm_domains, + .pm_features = BIT(GPU_PM_CLK_DIS) | BIT(GPU_PM_VREG_OFF), + .gpu_quirks = BIT(GPU_QUIRK_FORCE_AARCH64_PGTABLE), +}; + +static const struct panfrost_compatible mediatek_mt8370_data = { + .num_supplies = ARRAY_SIZE(default_supplies) - 1, + .supply_names = default_supplies, + .num_pm_domains = 2, + .pm_domain_names = mediatek_pm_domains, .pm_features = BIT(GPU_PM_CLK_DIS) | BIT(GPU_PM_VREG_OFF), .gpu_quirks = BIT(GPU_QUIRK_FORCE_AARCH64_PGTABLE), }; @@ -945,6 +949,7 @@ static const struct of_device_id dt_match[] = { { .compatible = "mediatek,mt8186-mali", .data = &mediatek_mt8186_data }, { .compatible = "mediatek,mt8188-mali", .data = &mediatek_mt8188_data }, { .compatible = "mediatek,mt8192-mali", .data = &mediatek_mt8192_data }, + { .compatible = "mediatek,mt8370-mali", .data = &mediatek_mt8370_data }, { .compatible = "allwinner,sun50i-h616-mali", .data = &allwinner_h616_data }, {} }; diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c index 8706763af8fb..8d3b7c4fa6a4 100644 --- a/drivers/gpu/drm/tiny/bochs.c +++ b/drivers/gpu/drm/tiny/bochs.c @@ -19,6 +19,7 @@ #include <drm/drm_gem_shmem_helper.h> #include <drm/drm_managed.h> #include <drm/drm_module.h> +#include <drm/drm_panic.h> #include <drm/drm_plane_helper.h> #include <drm/drm_probe_helper.h> @@ -469,10 +470,28 @@ static void bochs_primary_plane_helper_atomic_update(struct drm_plane *plane, bochs_hw_setformat(bochs, fb->format); } +static int bochs_primary_plane_helper_get_scanout_buffer(struct drm_plane *plane, + struct drm_scanout_buffer *sb) +{ + struct bochs_device *bochs = to_bochs_device(plane->dev); + struct iosys_map map = IOSYS_MAP_INIT_VADDR_IOMEM(bochs->fb_map); + + if (plane->state && plane->state->fb) { + sb->format = plane->state->fb->format; + sb->width = plane->state->fb->width; + sb->height = plane->state->fb->height; + sb->pitch[0] = plane->state->fb->pitches[0]; + sb->map[0] = map; + return 0; + } + return -ENODEV; +} + static const struct drm_plane_helper_funcs bochs_primary_plane_helper_funcs = { DRM_GEM_SHADOW_PLANE_HELPER_FUNCS, .atomic_check = bochs_primary_plane_helper_atomic_check, .atomic_update = bochs_primary_plane_helper_atomic_update, + .get_scanout_buffer = bochs_primary_plane_helper_get_scanout_buffer, }; static const struct drm_plane_funcs bochs_primary_plane_funcs = { diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 137773dd138e..8f34f4b8183d 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -800,6 +800,11 @@ struct drm_display_info { struct drm_hdmi_info hdmi; /** + * @hdr_sink_metadata: HDR Metadata Information read from sink + */ + struct hdr_sink_metadata hdr_sink_metadata; + + /** * @non_desktop: Non desktop display (HMD). */ bool non_desktop; @@ -2286,9 +2291,6 @@ struct drm_connector { */ struct llist_node free_node; - /** @hdr_sink_metadata: HDR Metadata Information read from sink */ - struct hdr_sink_metadata hdr_sink_metadata; - /** * @hdmi: HDMI-related variable and properties. */ |