Re: [PATCH v2 1/5] drm/i915: Initialize dig_port->aux_ch to NONE to be sure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 20 Jun 2023, Ville Syrjala <ville.syrjala@xxxxxxxxxxxxxxx> wrote:
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
>
> Make sure dig_port->aux_ch is trustworthy by initializing it
> to NONE (-1) at the start. The encoder init will later fill in
> the actual value, if appropriate.

Smells like we could add intel_dig_port_alloc() and shove this
there. But that's for another patch.

Reviewed-by: Jani Nikula <jani.nikula@xxxxxxxxx>

>
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/display/g4x_dp.c    | 2 ++
>  drivers/gpu/drm/i915/display/g4x_hdmi.c  | 2 ++
>  drivers/gpu/drm/i915/display/intel_ddi.c | 2 ++
>  3 files changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/g4x_dp.c b/drivers/gpu/drm/i915/display/g4x_dp.c
> index c58a3f249a01..0cab5992e3da 100644
> --- a/drivers/gpu/drm/i915/display/g4x_dp.c
> +++ b/drivers/gpu/drm/i915/display/g4x_dp.c
> @@ -1273,6 +1273,8 @@ bool g4x_dp_init(struct drm_i915_private *dev_priv,
>  	if (!dig_port)
>  		return false;
>  
> +	dig_port->aux_ch = AUX_CH_NONE;
> +
>  	intel_connector = intel_connector_alloc();
>  	if (!intel_connector)
>  		goto err_connector_alloc;
> diff --git a/drivers/gpu/drm/i915/display/g4x_hdmi.c b/drivers/gpu/drm/i915/display/g4x_hdmi.c
> index 8c71e3ede680..c1fd13bdc9d2 100644
> --- a/drivers/gpu/drm/i915/display/g4x_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/g4x_hdmi.c
> @@ -698,6 +698,8 @@ void g4x_hdmi_init(struct drm_i915_private *dev_priv,
>  	if (!dig_port)
>  		return;
>  
> +	dig_port->aux_ch = AUX_CH_NONE;
> +
>  	intel_connector = intel_connector_alloc();
>  	if (!intel_connector) {
>  		kfree(dig_port);
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 61722556bb47..6cb24a472a9b 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -4747,6 +4747,8 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>  	if (!dig_port)
>  		return;
>  
> +	dig_port->aux_ch = AUX_CH_NONE;
> +
>  	encoder = &dig_port->base;
>  	encoder->devdata = devdata;

-- 
Jani Nikula, Intel Open Source Graphics Center




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux