Re: [PATCH 13/20] drm/i915/dp: Reorder intel_dp_compute_config() a bit

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

 



On Wed, Oct 27, 2021 at 12:36:17PM +0530, Nautiyal, Ankit K wrote:
> 
> On 10/15/2021 7:09 PM, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> >
> > Consolidate the double pfit call, and reorder things so that
> > intel_dp_output_format() and intel_dp_compute_link_config() are
> > back-to-back. They are intimately related, and will need to be
> > called twice to properly handle the "4:2:0 also" modes.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> > ---
> >   drivers/gpu/drm/i915/display/intel_dp.c | 23 ++++++++++-------------
> >   1 file changed, 10 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> > index 2440a6a2e4fc..de2b3d33a726 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > @@ -1764,25 +1764,12 @@ intel_dp_compute_config(struct intel_encoder *encoder,
> >   	if (HAS_PCH_SPLIT(dev_priv) && !HAS_DDI(dev_priv) && encoder->port != PORT_A)
> >   		pipe_config->has_pch_encoder = true;
> >   
> > -	pipe_config->output_format = intel_dp_output_format(&intel_connector->base,
> > -							    adjusted_mode);
> > -
> > -	if (pipe_config->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) {
> > -		ret = intel_panel_fitting(pipe_config, conn_state);
> > -		if (ret)
> > -			return ret;
> > -	}
> > -
> >   	pipe_config->has_audio = intel_dp_has_audio(encoder, pipe_config, conn_state);
> >   
> >   	if (intel_dp_is_edp(intel_dp) && intel_connector->panel.fixed_mode) {
> >   		ret = intel_panel_compute_config(intel_connector, adjusted_mode);
> >   		if (ret)
> >   			return ret;
> > -
> > -		ret = intel_panel_fitting(pipe_config, conn_state);
> > -		if (ret)
> > -			return ret;
> >   	}
> >   
> >   	if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)
> > @@ -1798,10 +1785,20 @@ intel_dp_compute_config(struct intel_encoder *encoder,
> >   	if (intel_dp_hdisplay_bad(dev_priv, adjusted_mode->crtc_hdisplay))
> >   		return -EINVAL;
> >   
> > +	pipe_config->output_format = intel_dp_output_format(&intel_connector->base,
> > +							    adjusted_mode);
> > +
> >   	ret = intel_dp_compute_link_config(encoder, pipe_config, conn_state);
> >   	if (ret < 0)
> >   		return ret;
> >   
> > +	if ((intel_dp_is_edp(intel_dp) && intel_connector->panel.fixed_mode) ||
> > +	    pipe_config->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) {
> > +		ret = intel_panel_fitting(pipe_config, conn_state);
> 
> Panel fitting code will perhaps need handling for Big joiner.
> 
> In case of bigjoiner, we might need to set the pch_pfit->dest width 
> halved, otherwise we might have scaler width going out of bound.

Yes pfit vs. bigjoiner is known to be 100% broken.

> 
> Now that we already have pipe_config->bigjoiner set, we can use it in 
> pch_panel_fitting( ) to tweak dest width.
> 
> Something like 
> https://github.com/aknautiyal/drm-tip/commit/c15060be2eca81738f8f0d3431e04215777edfc9

Hmm. I gues that would be sufficient for the fullscreen case.
And we should probably just -EINVAL the other cases for now.

Actually doing borders correctly with bigjoiner would involve
doing this after/during the bigjoiner state copy.

-- 
Ville Syrjälä
Intel



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

  Powered by Linux