diff mbox series

[5/6] drm/i915: Move the TMDS clock division into intel_hdmi_mode_clock_valid()

Message ID 20210511160532.21446-6-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Check HDMI sink deep color capabilities during .mode_valid() | expand

Commit Message

Ville Syrjälä May 11, 2021, 4:05 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Now that we have to tell intel_hdmi_mode_clock_valid() whether
we're asking about 4:4:4 or 4:2:0 output it can take care of
the dotclock->TMDS clock conversion.

Cc: Werner Sembach <wse@tuxedocomputers.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Souza, Jose May 14, 2021, 5:28 p.m. UTC | #1
On Tue, 2021-05-11 at 19:05 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Now that we have to tell intel_hdmi_mode_clock_valid() whether
> we're asking about 4:4:4 or 4:2:0 output it can take care of
> the dotclock->TMDS clock conversion.
> 
> Cc: Werner Sembach <wse@tuxedocomputers.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdmi.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 874fb897005a..80e2ae652f6e 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -1907,6 +1907,9 @@ intel_hdmi_mode_clock_valid(struct drm_connector *connector, int clock,
>  	struct intel_hdmi *hdmi = intel_attached_hdmi(to_intel_connector(connector));
>  	enum drm_mode_status status;
>  
> +	if (ycbcr420_output)
> +		clock /= 2;
> +
>  	/* check if we can do 8bpc */
>  	status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 8),
>  				       true, has_hdmi_sink);
> @@ -1957,8 +1960,6 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
>  	}
>  
>  	ycbcr_420_only = drm_mode_is_420_only(&connector->display_info, mode);
> -	if (ycbcr_420_only)
> -		clock /= 2;
>  
>  	status = intel_hdmi_mode_clock_valid(connector, clock, has_hdmi_sink, ycbcr_420_only);
>  	if (status != MODE_OK) {
> @@ -1967,7 +1968,6 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
>  		    !drm_mode_is_420_also(&connector->display_info, mode))
>  			return status;
>  
> -		clock /= 2;

The clock intel_hdmi_mode_clock_valid() call will be clock/2 not clock/4 as previous.

>  		status = intel_hdmi_mode_clock_valid(connector, clock, has_hdmi_sink, true);
>  		if (status != MODE_OK)
>  			return status;
Ville Syrjälä May 14, 2021, 5:36 p.m. UTC | #2
On Fri, May 14, 2021 at 05:28:40PM +0000, Souza, Jose wrote:
> On Tue, 2021-05-11 at 19:05 +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Now that we have to tell intel_hdmi_mode_clock_valid() whether
> > we're asking about 4:4:4 or 4:2:0 output it can take care of
> > the dotclock->TMDS clock conversion.
> > 
> > Cc: Werner Sembach <wse@tuxedocomputers.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_hdmi.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> > index 874fb897005a..80e2ae652f6e 100644
> > --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> > @@ -1907,6 +1907,9 @@ intel_hdmi_mode_clock_valid(struct drm_connector *connector, int clock,
> >  	struct intel_hdmi *hdmi = intel_attached_hdmi(to_intel_connector(connector));
> >  	enum drm_mode_status status;
> >  
> > +	if (ycbcr420_output)
> > +		clock /= 2;
> > +
> >  	/* check if we can do 8bpc */
> >  	status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 8),
> >  				       true, has_hdmi_sink);
> > @@ -1957,8 +1960,6 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
> >  	}
> >  
> >  	ycbcr_420_only = drm_mode_is_420_only(&connector->display_info, mode);
> > -	if (ycbcr_420_only)
> > -		clock /= 2;
> >  
> >  	status = intel_hdmi_mode_clock_valid(connector, clock, has_hdmi_sink, ycbcr_420_only);
> >  	if (status != MODE_OK) {
> > @@ -1967,7 +1968,6 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
> >  		    !drm_mode_is_420_also(&connector->display_info, mode))
> >  			return status;
> >  
> > -		clock /= 2;
> 
> The clock intel_hdmi_mode_clock_valid() call will be clock/2 not clock/4 as previous.

It's never clock/4.
Souza, Jose May 14, 2021, 5:44 p.m. UTC | #3
On Fri, 2021-05-14 at 20:36 +0300, Ville Syrjälä wrote:
> On Fri, May 14, 2021 at 05:28:40PM +0000, Souza, Jose wrote:
> > On Tue, 2021-05-11 at 19:05 +0300, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > Now that we have to tell intel_hdmi_mode_clock_valid() whether
> > > we're asking about 4:4:4 or 4:2:0 output it can take care of
> > > the dotclock->TMDS clock conversion.
> > > 
> > > Cc: Werner Sembach <wse@tuxedocomputers.com>
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_hdmi.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> > > index 874fb897005a..80e2ae652f6e 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> > > @@ -1907,6 +1907,9 @@ intel_hdmi_mode_clock_valid(struct drm_connector *connector, int clock,
> > >  	struct intel_hdmi *hdmi = intel_attached_hdmi(to_intel_connector(connector));
> > >  	enum drm_mode_status status;
> > >  
> > > +	if (ycbcr420_output)
> > > +		clock /= 2;
> > > +
> > >  	/* check if we can do 8bpc */
> > >  	status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 8),
> > >  				       true, has_hdmi_sink);
> > > @@ -1957,8 +1960,6 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
> > >  	}
> > >  
> > >  	ycbcr_420_only = drm_mode_is_420_only(&connector->display_info, mode);
> > > -	if (ycbcr_420_only)
> > > -		clock /= 2;
> > >  
> > >  	status = intel_hdmi_mode_clock_valid(connector, clock, has_hdmi_sink, ycbcr_420_only);
> > >  	if (status != MODE_OK) {
> > > @@ -1967,7 +1968,6 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
> > >  		    !drm_mode_is_420_also(&connector->display_info, mode))
> > >  			return status;
> > >  
> > > -		clock /= 2;
> > 
> > The clock intel_hdmi_mode_clock_valid() call will be clock/2 not clock/4 as previous.
> 
> It's never clock/4.

Found the "if (ycbcr_420_only ||" that I missed.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>

>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 874fb897005a..80e2ae652f6e 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -1907,6 +1907,9 @@  intel_hdmi_mode_clock_valid(struct drm_connector *connector, int clock,
 	struct intel_hdmi *hdmi = intel_attached_hdmi(to_intel_connector(connector));
 	enum drm_mode_status status;
 
+	if (ycbcr420_output)
+		clock /= 2;
+
 	/* check if we can do 8bpc */
 	status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 8),
 				       true, has_hdmi_sink);
@@ -1957,8 +1960,6 @@  intel_hdmi_mode_valid(struct drm_connector *connector,
 	}
 
 	ycbcr_420_only = drm_mode_is_420_only(&connector->display_info, mode);
-	if (ycbcr_420_only)
-		clock /= 2;
 
 	status = intel_hdmi_mode_clock_valid(connector, clock, has_hdmi_sink, ycbcr_420_only);
 	if (status != MODE_OK) {
@@ -1967,7 +1968,6 @@  intel_hdmi_mode_valid(struct drm_connector *connector,
 		    !drm_mode_is_420_also(&connector->display_info, mode))
 			return status;
 
-		clock /= 2;
 		status = intel_hdmi_mode_clock_valid(connector, clock, has_hdmi_sink, true);
 		if (status != MODE_OK)
 			return status;