[PATCH v8 31/39] drm/vc4: hdmi: Convert to common SCDC scrambling infrastructure

Maxime Ripard mripard at kernel.org
Tue Jul 7 08:36:02 PDT 2026


Hi,

On Thu, Jul 02, 2026 at 05:46:44PM +0300, Cristian Ciocaltea wrote:
> @@ -416,10 +281,11 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
>  			status = connector_status_connected;
>  	}
>
> -	vc4_hdmi_handle_hotplug(vc4_hdmi, ctx, status);
> +	ret = drm_atomic_helper_connector_hdmi_hotplug(connector, status, ctx);
> +
>  	pm_runtime_put(&vc4_hdmi->pdev->dev);
>
> -	return status;
> +	return ret == -EDEADLK ? ret : status;
>  }

This looks like a change that should have its own patch and explanation.


> @@ -778,32 +658,14 @@ static int vc4_hdmi_write_spd_infoframe(struct drm_connector *connector,
>  					buffer, len);
>  }
>  
> -#define SCRAMBLING_POLLING_DELAY_MS	1000
> -
> -static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
> +static int vc4_hdmi_scrambler_enable(struct drm_connector *connector)
>  {
> -	struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
> -	struct drm_connector *connector = &vc4_hdmi->connector;
> -	struct drm_device *drm = connector->dev;

If you don't remove this line....

> -	const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
> +	struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
>  	unsigned long flags;
>  	int idx;
>  
> -	lockdep_assert_held(&vc4_hdmi->mutex);
> -
> -	if (!vc4_hdmi_supports_scrambling(vc4_hdmi))
> -		return;
> -
> -	if (!drm_hdmi_mode_needs_scrambling(mode,
> -					    vc4_hdmi->output_bpc,
> -					    vc4_hdmi->output_format))
> -		return;
> -
> -	if (!drm_dev_enter(drm, &idx))

Then you don't need to change this one either

[...]

> -		return;
> -
> -	drm_scdc_set_high_tmds_clock_ratio(connector, true);
> -	drm_scdc_set_scrambling(connector, true);
> +	if (!drm_dev_enter(connector->dev, &idx))
> +		return -ENODEV;
>
>  	spin_lock_irqsave(&vc4_hdmi->hw_lock, flags);
>  	HDMI_WRITE(HDMI_SCRAMBLER_CTL, HDMI_READ(HDMI_SCRAMBLER_CTL) |

> @@ -812,59 +674,26 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
>  
>  	drm_dev_exit(idx);
>  
> -	vc4_hdmi->scdc_enabled = true;
> -
> -	queue_delayed_work(system_percpu_wq, &vc4_hdmi->scrambling_work,
> -			   msecs_to_jiffies(SCRAMBLING_POLLING_DELAY_MS));
> +	return 0;
>  }
>  
> -static void vc4_hdmi_disable_scrambling(struct drm_encoder *encoder)
> +static int vc4_hdmi_scrambler_disable(struct drm_connector *connector)
>  {
> -	struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
> -	struct drm_connector *connector = &vc4_hdmi->connector;
> -	struct drm_device *drm = connector->dev;
> +	struct vc4_hdmi *vc4_hdmi = connector_to_vc4_hdmi(connector);
>  	unsigned long flags;
>  	int idx;
>  
> -	lockdep_assert_held(&vc4_hdmi->mutex);
> -
> -	if (!vc4_hdmi->scdc_enabled)
> -		return;
> -
> -	vc4_hdmi->scdc_enabled = false;
> -
> -	if (delayed_work_pending(&vc4_hdmi->scrambling_work))
> -		cancel_delayed_work_sync(&vc4_hdmi->scrambling_work);
> -
> -	if (!drm_dev_enter(drm, &idx))
> -		return;
> +	if (!drm_dev_enter(connector->dev, &idx))

Ditto

Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260707/f4cc6fe1/attachment.sig>


More information about the linux-arm-kernel mailing list