Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] drm/i915/ddi: uninitialized dedicated_external check in
  intel_ddi_init() [1]
--

commit 29c999b99f6cbc9e2b633d5c497aefc1594c72cf
Author: Baoli Zhang <[email protected]>

drm/i915/display: Tear down encoder hardware state in a separate hook

This commit introduces an intel_encoder ->remove() callback to separate
hardware and userspace-visible encoder teardown on driver remove from
memory deallocation in ->destroy().

> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c 
> b/drivers/gpu/drm/i915/display/intel_ddi.c
> index a0aff087fafa8..01fbb5ab038fd 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c

[ ... ]

> @@ -5353,6 +5358,7 @@ void intel_ddi_init(struct intel_display *display,
>       encoder->initial_fastset_check = intel_ddi_initial_fastset_check;
>       encoder->suspend = intel_ddi_encoder_suspend;
>       encoder->shutdown = intel_ddi_encoder_shutdown;
> +     encoder->remove = intel_ddi_encoder_remove;
>       encoder->get_power_domains = intel_ddi_get_power_domains;
>  
>       encoder->type = INTEL_OUTPUT_DDI;

[Severity: High]
This problem wasn't introduced by this patch, but doesn't intel_ddi_init()
call intel_encoder_is_tc() before dig_port->dedicated_external is
initialized [1]?

intel_encoder_is_tc() returns false when dig_port->dedicated_external is
set, yet intel_ddi_init() only populates dedicated_external from VBT after
querying intel_encoder_is_tc() to select encoder->get_config and check
need_aux_ch():

drivers/gpu/drm/i915/display/intel_ddi.c:intel_ddi_init() {
        ...
        if (HAS_LT_PHY(display)) {
                ...
                if (intel_encoder_is_tc(encoder))
                        encoder->get_config = mtl_ddi_tc_phy_get_config;
                else
                        encoder->get_config = mtl_ddi_non_tc_phy_get_config;
        } else if (DISPLAY_VER(display) >= 14) {
                ...
                if (intel_encoder_is_tc(encoder))
                        encoder->get_config = mtl_ddi_tc_phy_get_config;
                else
                        encoder->get_config = mtl_ddi_non_tc_phy_get_config;
        }
        ...
        if (intel_bios_encoder_is_dedicated_external(devdata))
                dig_port->dedicated_external = true;
        ...
}

On DISPLAY_VER() >= 14 or HAS_LT_PHY() platforms where the VBT marks a
Type-C PHY port as a dedicated external port, encoder->get_config is
assigned mtl_ddi_tc_phy_get_config() instead of
mtl_ddi_non_tc_phy_get_config(). Once dedicated_external is set to true,
subsequent intel_encoder_is_tc() calls return false, so atomic DPLL
computation uses the non-TC path (ICL_PORT_DPLL_DEFAULT) while hardware
state readout via mtl_ddi_tc_phy_get_config() populates
ICL_PORT_DPLL_MG_PHY, causing DPLL state verification mismatches and
failing fastset checks.

[1] https://sashiko.dev/#/bug/linux-4f65a789-b335-4420-aca7-1aaf9a2f9779

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to