drm/i915: Fix MST oops due to MSA changes
diff mbox series

Message ID 20191015190538.27539-1-ville.syrjala@linux.intel.com
State New
Headers show
Series
  • drm/i915: Fix MST oops due to MSA changes
Related show

Commit Message

Ville Syrjälä Oct. 15, 2019, 7:05 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The MSA MISC computation now depends on the connector state, and
we do it from the DDI .pre_enable() hook. All that is fine for
DP SST but with MST we don't actually pass the connector state
to the dig port's .pre_enable() hook which leads to an oops.

Need to think more how to solve this in a cleaner fashion, but
for now let's just add a NULL check to stop the oopsing.

Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Fixes: 0c06fa156006 ("drm/i915/dp: Add support of BT.2020 Colorimetry to DP MSA")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Shankar, Uma Oct. 16, 2019, 2:59 p.m. UTC | #1
>-----Original Message-----
>From: Ville Syrjala <ville.syrjala@linux.intel.com>
>Sent: Wednesday, October 16, 2019 12:36 AM
>To: intel-gfx@lists.freedesktop.org
>Cc: Mun, Gwan-gyeong <gwan-gyeong.mun@intel.com>; Shankar, Uma
><uma.shankar@intel.com>
>Subject: [PATCH] drm/i915: Fix MST oops due to MSA changes
>
>From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
>The MSA MISC computation now depends on the connector state, and we do it from
>the DDI .pre_enable() hook. All that is fine for DP SST but with MST we don't actually
>pass the connector state to the dig port's .pre_enable() hook which leads to an oops.
>
>Need to think more how to solve this in a cleaner fashion, but for now let's just add a
>NULL check to stop the oopsing.

Looks good to me. We will have to handle colorspaces for MST properly. But that can be
done later. Thanks for identifying and fixing this.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

>Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
>Cc: Uma Shankar <uma.shankar@intel.com>
>Fixes: 0c06fa156006 ("drm/i915/dp: Add support of BT.2020 Colorimetry to DP MSA")
>Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>---
> drivers/gpu/drm/i915/display/intel_ddi.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
>b/drivers/gpu/drm/i915/display/intel_ddi.c
>index 80f8e2698be0..4c81449ec144 100644
>--- a/drivers/gpu/drm/i915/display/intel_ddi.c
>+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
>@@ -1794,8 +1794,10 @@ void intel_ddi_set_dp_msa(const struct intel_crtc_state
>*crtc_state,
> 	 * of Color Encoding Format and Content Color Gamut] while sending
> 	 * YCBCR 420, HDR BT.2020 signals we should program MSA MISC1 fields
> 	 * which indicate VSC SDP for the Pixel Encoding/Colorimetry Format.
>+	 *
>+	 * FIXME MST doesn't pass in the conn_state
> 	 */
>-	if (intel_dp_needs_vsc_sdp(crtc_state, conn_state))
>+	if (conn_state && intel_dp_needs_vsc_sdp(crtc_state, conn_state))
> 		temp |= DP_MSA_MISC_COLOR_VSC_SDP;
>
> 	I915_WRITE(TRANS_MSA_MISC(cpu_transcoder), temp);
>--
>2.21.0
Mun, Gwan-gyeong Oct. 16, 2019, 6:24 p.m. UTC | #2
On Tue, 2019-10-15 at 22:05 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The MSA MISC computation now depends on the connector state, and
> we do it from the DDI .pre_enable() hook. All that is fine for
> DP SST but with MST we don't actually pass the connector state
> to the dig port's .pre_enable() hook which leads to an oops.
> 
> Need to think more how to solve this in a cleaner fashion, but
> for now let's just add a NULL check to stop the oopsing.
> 
> Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> Cc: Uma Shankar <uma.shankar@intel.com>
> Fixes: 0c06fa156006 ("drm/i915/dp: Add support of BT.2020 Colorimetry
> to DP MSA")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 80f8e2698be0..4c81449ec144 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -1794,8 +1794,10 @@ void intel_ddi_set_dp_msa(const struct
> intel_crtc_state *crtc_state,
>  	 * of Color Encoding Format and Content Color Gamut] while
> sending
>  	 * YCBCR 420, HDR BT.2020 signals we should program MSA MISC1
> fields
>  	 * which indicate VSC SDP for the Pixel Encoding/Colorimetry
> Format.
> +	 *
> +	 * FIXME MST doesn't pass in the conn_state
>  	 */
> -	if (intel_dp_needs_vsc_sdp(crtc_state, conn_state))
> +	if (conn_state && intel_dp_needs_vsc_sdp(crtc_state,
> conn_state))
>  		temp |= DP_MSA_MISC_COLOR_VSC_SDP;
>  
>  	I915_WRITE(TRANS_MSA_MISC(cpu_transcoder), temp);

Sorry for making of a regression with my commit.
And thank you for fixing oops.
For now this seems good to me for without flow changing of setting of
MSA register.
But as you comments, as a next step we need to think more how to solve
this in a cleaner fashion on SST and MST.

Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Ville Syrjälä Oct. 17, 2019, 12:12 p.m. UTC | #3
On Wed, Oct 16, 2019 at 02:59:45PM +0000, Shankar, Uma wrote:
> 
> 
> >-----Original Message-----
> >From: Ville Syrjala <ville.syrjala@linux.intel.com>
> >Sent: Wednesday, October 16, 2019 12:36 AM
> >To: intel-gfx@lists.freedesktop.org
> >Cc: Mun, Gwan-gyeong <gwan-gyeong.mun@intel.com>; Shankar, Uma
> ><uma.shankar@intel.com>
> >Subject: [PATCH] drm/i915: Fix MST oops due to MSA changes
> >
> >From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> >The MSA MISC computation now depends on the connector state, and we do it from
> >the DDI .pre_enable() hook. All that is fine for DP SST but with MST we don't actually
> >pass the connector state to the dig port's .pre_enable() hook which leads to an oops.
> >
> >Need to think more how to solve this in a cleaner fashion, but for now let's just add a
> >NULL check to stop the oopsing.
> 
> Looks good to me. We will have to handle colorspaces for MST properly.

Yeah, in fact just realized that this is a transcoder register so we're
no longer configuring MSA MISC for anything but the first MST stream.
The other streams will leave TRANS_MSA_MISC untouched. So I guess we
need to move this into the MST code proper, and if it needs to be left
in ddi_pre_enable() for SST we probably want to exclude it getting
programming there for MST there. Any volunteers?

Pushed. Thanks for the reviews.

> But that can be
> done later. Thanks for identifying and fixing this.
> Reviewed-by: Uma Shankar <uma.shankar@intel.com>
> 
> >Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> >Cc: Uma Shankar <uma.shankar@intel.com>
> >Fixes: 0c06fa156006 ("drm/i915/dp: Add support of BT.2020 Colorimetry to DP MSA")
> >Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >---
> > drivers/gpu/drm/i915/display/intel_ddi.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> >diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> >b/drivers/gpu/drm/i915/display/intel_ddi.c
> >index 80f8e2698be0..4c81449ec144 100644
> >--- a/drivers/gpu/drm/i915/display/intel_ddi.c
> >+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> >@@ -1794,8 +1794,10 @@ void intel_ddi_set_dp_msa(const struct intel_crtc_state
> >*crtc_state,
> > 	 * of Color Encoding Format and Content Color Gamut] while sending
> > 	 * YCBCR 420, HDR BT.2020 signals we should program MSA MISC1 fields
> > 	 * which indicate VSC SDP for the Pixel Encoding/Colorimetry Format.
> >+	 *
> >+	 * FIXME MST doesn't pass in the conn_state
> > 	 */
> >-	if (intel_dp_needs_vsc_sdp(crtc_state, conn_state))
> >+	if (conn_state && intel_dp_needs_vsc_sdp(crtc_state, conn_state))
> > 		temp |= DP_MSA_MISC_COLOR_VSC_SDP;
> >
> > 	I915_WRITE(TRANS_MSA_MISC(cpu_transcoder), temp);
> >--
> >2.21.0
>

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 80f8e2698be0..4c81449ec144 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -1794,8 +1794,10 @@  void intel_ddi_set_dp_msa(const struct intel_crtc_state *crtc_state,
 	 * of Color Encoding Format and Content Color Gamut] while sending
 	 * YCBCR 420, HDR BT.2020 signals we should program MSA MISC1 fields
 	 * which indicate VSC SDP for the Pixel Encoding/Colorimetry Format.
+	 *
+	 * FIXME MST doesn't pass in the conn_state
 	 */
-	if (intel_dp_needs_vsc_sdp(crtc_state, conn_state))
+	if (conn_state && intel_dp_needs_vsc_sdp(crtc_state, conn_state))
 		temp |= DP_MSA_MISC_COLOR_VSC_SDP;
 
 	I915_WRITE(TRANS_MSA_MISC(cpu_transcoder), temp);