diff mbox series

drm/i915/icl: Fix setting 10 bit deep color mode

Message ID 20190430000028.4690-1-aditya.swarup@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/icl: Fix setting 10 bit deep color mode | expand

Commit Message

Aditya Swarup April 30, 2019, midnight UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

There is a bug in hdmi_deep_color_possible() - we compare pipe_bpp
<= 8*3 which returns true every time for hdmi_deep_color_possible 12 bit
deep color mode test in intel_hdmi_compute_config().(Even when the
requested color mode is 10 bit through max bpc property)

Comparing pipe_bpp with bpc * 3 takes care of this condition where
requested max bpc is 10 bit, so hdmi_deep_color_possible with 12 bit
returns false when requested max bpc is 10.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Manasi Navare <manasi.d.navare@intel.com>
Cc: Clinton Taylor <Clinton.A.Taylor@intel.com>
---
 drivers/gpu/drm/i915/intel_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ville Syrjälä April 30, 2019, 3:05 p.m. UTC | #1
On Mon, Apr 29, 2019 at 05:00:28PM -0700, Aditya Swarup wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> There is a bug in hdmi_deep_color_possible() - we compare pipe_bpp
> <= 8*3 which returns true every time for hdmi_deep_color_possible 12 bit
> deep color mode test in intel_hdmi_compute_config().(Even when the
> requested color mode is 10 bit through max bpc property)
> 
> Comparing pipe_bpp with bpc * 3 takes care of this condition where
> requested max bpc is 10 bit, so hdmi_deep_color_possible with 12 bit
> returns false when requested max bpc is 10.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

How did my sob appear on this? Pretty sure I didn't actually put it
here.

> Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Manasi Navare <manasi.d.navare@intel.com>
> Cc: Clinton Taylor <Clinton.A.Taylor@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hdmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 991eb362ef4f..74f2dcb8b1ad 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -2159,7 +2159,7 @@ static bool hdmi_deep_color_possible(const struct intel_crtc_state *crtc_state,
>  	if (bpc == 10 && INTEL_GEN(dev_priv) < 11)
>  		return false;
>  
> -	if (crtc_state->pipe_bpp <= 8*3)
> +	if (crtc_state->pipe_bpp < bpc * 3)
>  		return false;
>  
>  	if (!crtc_state->has_hdmi_sink)
> -- 
> 2.17.1
Aditya Swarup April 30, 2019, 9:12 p.m. UTC | #2
On Tue, Apr 30, 2019 at 06:05:18PM +0300, Ville Syrjälä wrote:
> On Mon, Apr 29, 2019 at 05:00:28PM -0700, Aditya Swarup wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > There is a bug in hdmi_deep_color_possible() - we compare pipe_bpp
> > <= 8*3 which returns true every time for hdmi_deep_color_possible 12 bit
> > deep color mode test in intel_hdmi_compute_config().(Even when the
> > requested color mode is 10 bit through max bpc property)
> > 
> > Comparing pipe_bpp with bpc * 3 takes care of this condition where
> > requested max bpc is 10 bit, so hdmi_deep_color_possible with 12 bit
> > returns false when requested max bpc is 10.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> How did my sob appear on this? Pretty sure I didn't actually put it
> here.
I added it, since you are the author of this patch and came up with the
change. Imre and I have tested your patch and it is required. 
> 
> > Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Cc: Manasi Navare <manasi.d.navare@intel.com>
> > Cc: Clinton Taylor <Clinton.A.Taylor@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_hdmi.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> > index 991eb362ef4f..74f2dcb8b1ad 100644
> > --- a/drivers/gpu/drm/i915/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> > @@ -2159,7 +2159,7 @@ static bool hdmi_deep_color_possible(const struct intel_crtc_state *crtc_state,
> >  	if (bpc == 10 && INTEL_GEN(dev_priv) < 11)
> >  		return false;
> >  
> > -	if (crtc_state->pipe_bpp <= 8*3)
> > +	if (crtc_state->pipe_bpp < bpc * 3)
> >  		return false;
> >  
> >  	if (!crtc_state->has_hdmi_sink)
> > -- 
> > 2.17.1
> 
> -- 
> Ville Syrjälä
> Intel

Regards,
Aditya Swarup
Ville Syrjälä May 7, 2019, 10:12 a.m. UTC | #3
On Tue, Apr 30, 2019 at 02:12:39PM -0700, Aditya Swarup wrote:
> On Tue, Apr 30, 2019 at 06:05:18PM +0300, Ville Syrjälä wrote:
> > On Mon, Apr 29, 2019 at 05:00:28PM -0700, Aditya Swarup wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > There is a bug in hdmi_deep_color_possible() - we compare pipe_bpp
> > > <= 8*3 which returns true every time for hdmi_deep_color_possible 12 bit
> > > deep color mode test in intel_hdmi_compute_config().(Even when the
> > > requested color mode is 10 bit through max bpc property)
> > > 
> > > Comparing pipe_bpp with bpc * 3 takes care of this condition where
> > > requested max bpc is 10 bit, so hdmi_deep_color_possible with 12 bit
> > > returns false when requested max bpc is 10.
> > > 
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > How did my sob appear on this? Pretty sure I didn't actually put it
> > here.
> I added it, since you are the author of this patch and came up with the
> change. Imre and I have tested your patch and it is required. 

You can't add sob for other people without explicit permission
since it has some actual meaning (see
Documentation/process/submitting-patches.rst).

In this case I was expecting you would put yourself as the author
and just use something like 'Suggested-by: me' to indicate I gave
the idea for the patch.

> > 
> > > Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
> > > Cc: Jani Nikula <jani.nikula@intel.com>
> > > Cc: Manasi Navare <manasi.d.navare@intel.com>
> > > Cc: Clinton Taylor <Clinton.A.Taylor@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/intel_hdmi.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> > > index 991eb362ef4f..74f2dcb8b1ad 100644
> > > --- a/drivers/gpu/drm/i915/intel_hdmi.c
> > > +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> > > @@ -2159,7 +2159,7 @@ static bool hdmi_deep_color_possible(const struct intel_crtc_state *crtc_state,
> > >  	if (bpc == 10 && INTEL_GEN(dev_priv) < 11)
> > >  		return false;
> > >  
> > > -	if (crtc_state->pipe_bpp <= 8*3)
> > > +	if (crtc_state->pipe_bpp < bpc * 3)
> > >  		return false;
> > >  
> > >  	if (!crtc_state->has_hdmi_sink)
> > > -- 
> > > 2.17.1
> > 
> > -- 
> > Ville Syrjälä
> > Intel
> 
> Regards,
> Aditya Swarup
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 991eb362ef4f..74f2dcb8b1ad 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -2159,7 +2159,7 @@  static bool hdmi_deep_color_possible(const struct intel_crtc_state *crtc_state,
 	if (bpc == 10 && INTEL_GEN(dev_priv) < 11)
 		return false;
 
-	if (crtc_state->pipe_bpp <= 8*3)
+	if (crtc_state->pipe_bpp < bpc * 3)
 		return false;
 
 	if (!crtc_state->has_hdmi_sink)