Re: [PATCH v3 3/9] drm/i915/edp: always add fixed mode to probed modes in ->get_modes()

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

 




> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Jani Nikula
> Sent: Thursday, February 11, 2021 8:22 PM
> To: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: Nikula, Jani <jani.nikula@xxxxxxxxx>; Varide, Nischal <nischal.varide@xxxxxxxxx>
> Subject:  [PATCH v3 3/9] drm/i915/edp: always add fixed mode to probed
> modes in ->get_modes()
> 
> Unconditionally add fixed mode to probed modes even if EDID is present and has
> modes. Prepare for cases where the fixed mode is not present in EDID (such as eDP
> MSO).

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@xxxxxxxxx>

> Cc: Nischal Varide <nischal.varide@xxxxxxxxx>
> Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index 169b44c8ebbc..8d7ca03453e5 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -5547,19 +5547,18 @@ static int intel_dp_get_modes(struct drm_connector
> *connector)  {
>  	struct intel_connector *intel_connector = to_intel_connector(connector);
>  	struct edid *edid;
> +	int num_modes = 0;
> 
>  	edid = intel_connector->detect_edid;
>  	if (edid) {
> -		int ret = intel_connector_update_modes(connector, edid);
> +		num_modes = intel_connector_update_modes(connector, edid);
> 
>  		if (intel_vrr_is_capable(connector))
>  			drm_connector_set_vrr_capable_property(connector,
>  							       true);
> -		if (ret)
> -			return ret;
>  	}
> 
> -	/* if eDP has no EDID, fall back to fixed mode */
> +	/* Also add fixed mode, which may or may not be present in EDID */
>  	if (intel_dp_is_edp(intel_attached_dp(intel_connector)) &&
>  	    intel_connector->panel.fixed_mode) {
>  		struct drm_display_mode *mode;
> @@ -5568,10 +5567,13 @@ static int intel_dp_get_modes(struct drm_connector
> *connector)
>  					  intel_connector->panel.fixed_mode);
>  		if (mode) {
>  			drm_mode_probed_add(connector, mode);
> -			return 1;
> +			num_modes++;
>  		}
>  	}
> 
> +	if (num_modes)
> +		return num_modes;
> +
>  	if (!edid) {
>  		struct intel_dp *intel_dp = intel_attached_dp(intel_connector);
>  		struct drm_display_mode *mode;
> @@ -5581,11 +5583,11 @@ static int intel_dp_get_modes(struct drm_connector
> *connector)
>  					      intel_dp->downstream_ports);
>  		if (mode) {
>  			drm_mode_probed_add(connector, mode);
> -			return 1;
> +			num_modes++;
>  		}
>  	}
> 
> -	return 0;
> +	return num_modes;
>  }
> 
>  static int
> --
> 2.20.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



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

  Powered by Linux