On Thu, 29 Oct 2026, Dmytro Malovanyi <[email protected]> wrote:
> Use the helper instead of open coding the check, so enhanced framing is
> used for all DPCD r1.2+ sinks as the spec requires.
>
> The helper takes DP_RECEIVER_CAP_SIZE bytes and gcc warns about reading
> past dpcd[4] (-Wstringop-overread), so read the full receiver caps like
> the other drivers do. That is 15 bytes, it fits in one AUX transfer.
>
> Compile tested only.
>
> Signed-off-by: Dmytro Malovanyi <[email protected]>

Reviewed-by: Jani Nikula <[email protected]>

Ditto about drm_dp_read_dpcd_caps() usage.

> ---
>  drivers/gpu/drm/gma500/cdv_intel_dp.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c 
> b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> index 8d0626ddf..0973598c7 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> @@ -262,7 +262,7 @@ struct cdv_intel_dp {
>       uint32_t color_range;
>       uint8_t link_bw;
>       uint8_t lane_count;
> -     uint8_t dpcd[4];
> +     uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
>       struct gma_encoder *encoder;
>       struct i2c_adapter adapter;
>       struct i2c_algo_dp_aux_data algo;
> @@ -1070,11 +1070,7 @@ cdv_intel_dp_mode_set(struct drm_encoder *encoder, 
> struct drm_display_mode *mode
>       intel_dp->link_configuration[0] = intel_dp->link_bw;
>       intel_dp->link_configuration[1] = intel_dp->lane_count;
>  
> -     /*
> -      * Check for DPCD version > 1.1 and enhanced framing support
> -      */
> -     if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&
> -         (intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP)) {
> +     if (drm_dp_enhanced_frame_cap(intel_dp->dpcd)) {
>               intel_dp->link_configuration[1] |= 
> DP_LANE_COUNT_ENHANCED_FRAME_EN;
>               intel_dp->DP |= DP_ENHANCED_FRAMING;
>       }

-- 
Jani Nikula, Intel

Reply via email to