Browse Source

disp: msm: sde: fix crtc client type checks for WB

CRTC client type is wrongly identified as RT_CLIENT
for WB as the API considers only RT and RT_RSC. Resolve
it by adding a new API to check for RT CTRC.

Change-Id: I1f216f60a18215426e594d0f8b09852af376799d
Signed-off-by: Veera Sundaram Sankaran <[email protected]>
Veera Sundaram Sankaran 6 years ago
parent
commit
f61e5545d7
2 changed files with 7 additions and 17 deletions
  1. 5 11
      msm/sde/sde_crtc.h
  2. 2 6
      msm/sde/sde_plane.c

+ 5 - 11
msm/sde/sde_crtc.h

@@ -620,21 +620,15 @@ static inline enum sde_crtc_client_type sde_crtc_get_client_type(
 }
 
 /**
- * sde_crtc_get_client_type_for_qos - check the crtc type- rt, nrt, rsc_rt, etc.
+ * sde_crtc_is_rt_client - check if real-time client or not
  * @crtc: Pointer to crtc
  */
-static inline enum sde_crtc_client_type sde_crtc_get_client_type_for_qos(
-						struct drm_crtc *crtc)
+static inline bool sde_crtc_is_rt_client(struct drm_crtc *crtc)
 {
-	struct sde_crtc_state *cstate =
-			crtc ? to_sde_crtc_state(crtc->state) : NULL;
-
-	if (!cstate)
-		return NRT_CLIENT;
+	if (!crtc || !crtc->state)
+		return true;
 
-	return sde_crtc_get_intf_mode(crtc) ==
-			INTF_MODE_WB_LINE ? NRT_CLIENT :
-			(cstate->rsc_client ? RT_RSC_CLIENT : RT_CLIENT);
+	return (sde_crtc_get_intf_mode(crtc) != INTF_MODE_WB_LINE);
 }
 
 /**

+ 2 - 6
msm/sde/sde_plane.c

@@ -2416,10 +2416,7 @@ static int _sde_atomic_check_decimation_scaler(struct drm_plane_state *state,
 	max_linewidth = psde->pipe_sblk->maxlinewidth;
 
 	crtc = state->crtc;
-	if (crtc)
-		rt_client = (sde_crtc_get_client_type(crtc) != NRT_CLIENT);
-	else
-		rt_client = true;
+	rt_client = sde_crtc_is_rt_client(crtc);
 
 	max_downscale_denom = 1;
 	/* inline rotation RT clients have a different max downscaling limit */
@@ -3196,8 +3193,7 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
 		return 0;
 	pstate->pending = true;
 
-	psde->is_rt_pipe =
-		(sde_crtc_get_client_type_for_qos(crtc) != NRT_CLIENT);
+	psde->is_rt_pipe = sde_crtc_is_rt_client(crtc);
 	_sde_plane_set_qos_ctrl(plane, false, SDE_PLANE_QOS_PANIC_CTRL);
 
 	_sde_plane_update_properties(plane, crtc, fb);