From: "Kumar, Mahesh" Subject: Re: [PATCH] drm/i915/icl: avoid unclaimed PLANE_NV12_BUF_CFG register Date: Wed, 1 Aug 2018 20:29:22 +0530 Message-ID: <2debd1c4-09c1-7e97-bec1-64353b77a035@intel.com> References: <20180801004614.22149-1-paulo.r.zanoni@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2118041032==" Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTPS id 04DAC6E47D for ; Wed, 1 Aug 2018 14:59:24 +0000 (UTC) In-Reply-To: <20180801004614.22149-1-paulo.r.zanoni@intel.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Paulo Zanoni , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org This is a multi-part message in MIME format. --===============2118041032== Content-Type: multipart/alternative; boundary="------------375C63C6331089E86EAE3372" Content-Language: en-US This is a multi-part message in MIME format. --------------375C63C6331089E86EAE3372 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Reviewed-by: Mahesh Kumar -Mahesh On 8/1/2018 6:16 AM, Paulo Zanoni wrote: > We don't have proper watermark NV12 support on ICL due to differences > in how it should be implemented. In commit 234059da0f33 > ("drm/i915/icl: NV12 y-plane ddb is not in same plane") we avoided > writing the non-existent PLANE_NV12_BUF_CFG registers but we forgot to > also avoid them on the hardware state readout. While the code is still > not correct, at least now we can avoid unclaimed register error > messages when dealing with RGB formats, which makes CI happier. > > Also add some FIXME comments in order to make it even more clear that > there's still work to do. > > References: commit 234059da0f33 ("drm/i915/icl: NV12 y-plane ddb is > not in same plane") > Cc: Mahesh Kumar > Signed-off-by: Paulo Zanoni > --- > drivers/gpu/drm/i915/intel_pm.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c > index 2531eb75bdce..04cef1369e8c 100644 > --- a/drivers/gpu/drm/i915/intel_pm.c > +++ b/drivers/gpu/drm/i915/intel_pm.c > @@ -3909,7 +3909,12 @@ skl_ddb_get_hw_plane_state(struct drm_i915_private *dev_priv, > val & PLANE_CTL_ALPHA_MASK); > > val = I915_READ(PLANE_BUF_CFG(pipe, plane_id)); > - val2 = I915_READ(PLANE_NV12_BUF_CFG(pipe, plane_id)); > + /* > + * FIXME: add proper NV12 support for ICL. Avoid reading unclaimed > + * registers for now. > + */ > + if (INTEL_GEN(dev_priv) < 11) > + val2 = I915_READ(PLANE_NV12_BUF_CFG(pipe, plane_id)); > > if (fourcc == DRM_FORMAT_NV12) { > skl_ddb_entry_init_from_hw(dev_priv, > @@ -4977,6 +4982,7 @@ static void skl_write_plane_wm(struct intel_crtc *intel_crtc, > > skl_ddb_entry_write(dev_priv, PLANE_BUF_CFG(pipe, plane_id), > &ddb->plane[pipe][plane_id]); > + /* FIXME: add proper NV12 support for ICL. */ > if (INTEL_GEN(dev_priv) >= 11) > return skl_ddb_entry_write(dev_priv, > PLANE_BUF_CFG(pipe, plane_id), --------------375C63C6331089E86EAE3372 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

Hi,

Reviewed-by: Mahesh Kumar <mahesh1.kumar@intel.com>

-Mahesh
On 8/1/2018 6:16 AM, Paulo Zanoni wrote:
We don't have proper watermark NV12 support on ICL due to differences
in how it should be implemented. In commit 234059da0f33
("drm/i915/icl: NV12 y-plane ddb is not in same plane") we avoided
writing the non-existent PLANE_NV12_BUF_CFG registers but we forgot to
also avoid them on the hardware state readout. While the code is still
not correct, at least now we can avoid unclaimed register error
messages when dealing with RGB formats, which makes CI happier.

Also add some FIXME comments in order to make it even more clear that
there's still work to do.

References: commit 234059da0f33 ("drm/i915/icl: NV12 y-plane ddb is
 not in same plane")
Cc: Mahesh Kumar <mahesh1.kumar@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 2531eb75bdce..04cef1369e8c 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3909,7 +3909,12 @@ skl_ddb_get_hw_plane_state(struct drm_i915_private *dev_priv,
 				      val & PLANE_CTL_ALPHA_MASK);
 
 	val = I915_READ(PLANE_BUF_CFG(pipe, plane_id));
-	val2 = I915_READ(PLANE_NV12_BUF_CFG(pipe, plane_id));
+	/*
+	 * FIXME: add proper NV12 support for ICL. Avoid reading unclaimed
+	 * registers for now.
+	 */
+	if (INTEL_GEN(dev_priv) < 11)
+		val2 = I915_READ(PLANE_NV12_BUF_CFG(pipe, plane_id));
 
 	if (fourcc == DRM_FORMAT_NV12) {
 		skl_ddb_entry_init_from_hw(dev_priv,
@@ -4977,6 +4982,7 @@ static void skl_write_plane_wm(struct intel_crtc *intel_crtc,
 
 	skl_ddb_entry_write(dev_priv, PLANE_BUF_CFG(pipe, plane_id),
 			    &ddb->plane[pipe][plane_id]);
+	/* FIXME: add proper NV12 support for ICL. */
 	if (INTEL_GEN(dev_priv) >= 11)
 		return skl_ddb_entry_write(dev_priv,
 					   PLANE_BUF_CFG(pipe, plane_id),

--------------375C63C6331089E86EAE3372-- --===============2118041032== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============2118041032==--