[PATCH v8 09/39] drm/display: hdmi-state-helper: Add fallback TMDS rate validation

Cristian Ciocaltea cristian.ciocaltea at collabora.com
Wed Jul 8 03:39:07 PDT 2026


On 7/7/26 2:23 PM, Maxime Ripard wrote:
> Hi,
> 
> On Thu, Jul 02, 2026 at 05:46:22PM +0300, Cristian Ciocaltea wrote:
>> Validate the computed TMDS character rate against
>> connector->hdmi.max_tmds_char_rate when no driver-specific
>> tmds_char_rate_valid() hook is provided.
>>
>> This gives HDMI connectors a common fallback for rejecting modes whose
>> TMDS character rate exceeds the connector limit, while still allowing
>> drivers with custom validation requirements to implement their own
>> tmds_char_rate_valid() callback.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea at collabora.com>
>> ---
>>  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>> index ce17eeefc2da..db76699093e8 100644
>> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
>> @@ -566,6 +566,9 @@ hdmi_clock_valid(const struct drm_connector *connector,
>>  		status = funcs->tmds_char_rate_valid(connector, mode, clock);
>>  		if (status != MODE_OK)
>>  			return status;
>> +	} else if (connector->hdmi.max_tmds_char_rate) {
>> +		if (clock > connector->hdmi.max_tmds_char_rate)
>> +			return MODE_CLOCK_HIGH;
> 
> I think we should handle this the same way we do for
> info->max_tmds_clock: if it's set, we always check that before calling
> the driver.
> 
> It reduces the boilerplate in drivers, and it's always a relevant check
> anyway.
Ack.

Thanks,
Cristian



More information about the Linux-rockchip mailing list