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/amd/display: missing fused_io and hdcp_lc_force_fw_enable
  checks in dc_is_dmub_outbox_supported() [1]
--

commit c8a21aad95119e6c5fca592bbd2394b8b1a780d9
Author: Dave Airlie <[email protected]>

drm/amd/display: Replace dc_get_caps with purpose-built capability queries

This commit replaces the dc_get_caps() view accessor with dedicated
capability query functions so callers outside DC no longer access struct
dc_caps directly.

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c 
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
> index 73b56e078cbed..c71adc10c67ee 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
[ ... ]
> @@ -677,7 +677,7 @@ void update_config(void *handle, struct 
> cp_psp_stream_config *config)
>       link->adjust.retry_limit = MAX_NUM_OF_ATTEMPTS;
>       link->adjust.hdcp1.disable = 0;
>       link->adjust.hdcp2.use_fw_locality_check =
> -             (dc_get_caps(dc)->fused_io_supported ||
> +             (dc_get_fused_io_support(dc) ||
>                dc_get_debug_options(dc)->hdcp_lc_force_fw_enable);
>       link->adjust.hdcp2.use_sw_locality_fallback =
>               dc_get_debug_options(dc)->hdcp_lc_enable_sw_fallback;

[Severity: High]
This problem wasn't introduced by this patch, but can enabling
use_fw_locality_check here cause a NULL pointer dereference in
execute_fused_io() [1]?

amdgpu_dm_init() only initializes adev->dm.fused_io[].replied and enables
the DMUB outbox when dc_is_dmub_outbox_supported() returns true:

drivers/gpu/drm/amd/display/dc/core/dc.c:dc_is_dmub_outbox_supported() {
        if (!dc->caps.dmcub_support)
                return false;

        switch (dc->ctx->asic_id.chip_family) {
        ...
        }

        /* dmub aux needs dmub notifications to be enabled */
        return dc->debug.enable_dmub_aux_for_legacy_ddc;
}

Because dc_is_dmub_outbox_supported() does not check fused_io_supported or
hdcp_lc_force_fw_enable, it returns false on ASICs such as
AMDGPU_FAMILY_GC_13_0_1 where Fused IO is supported without DPIA or legacy
DDC DMUB AUX notifications. When an HDCP2 locality check runs,
execute_fused_io() calls wait_for_completion_timeout() on the
uninitialized completion.

[1] https://sashiko.dev/#/bug/linux-dc486f6b-5c5b-43d8-842b-cdc1ed0770b0

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

Reply via email to