Browse Source

disp: msm: sde: add new function for updating the cp feature lists only

When sde_crtc_atomic_begin is called before crtc is enabled, all the
color processing features need to be moved from active_list to
dirty_list after sde_cp_crtc_apply_properties(). However, the
ltm_hist_en flag doesn't need to be set to false in this case.
Setting ltm_hist_en to false in this case will result LTM merge_en bit
being cleared incorrectly. This change replaces sde_cp_crtc_suspend()
with a new function that only updates the color processing feature lists
in sde_crtc_atomic_begin().

Change-Id: I75d7874899838855bda05a1e8eca0cb9523417e9
Signed-off-by: Ping Li <[email protected]>
Ping Li 3 năm trước cách đây
mục cha
commit
4d27e37beb

+ 22 - 5
msm/sde/sde_color_processing.c

@@ -2612,12 +2612,11 @@ void sde_cp_crtc_destroy_properties(struct drm_crtc *crtc)
 	INIT_LIST_HEAD(&sde_crtc->ltm_buf_busy);
 	INIT_LIST_HEAD(&sde_crtc->ltm_buf_busy);
 }
 }
 
 
-void sde_cp_crtc_suspend(struct drm_crtc *crtc)
+void sde_cp_crtc_mark_features_dirty(struct drm_crtc *crtc)
 {
 {
 	struct sde_crtc *sde_crtc = NULL;
 	struct sde_crtc *sde_crtc = NULL;
 	struct sde_cp_node *prop_node = NULL, *n = NULL;
 	struct sde_cp_node *prop_node = NULL, *n = NULL;
 	bool ad_suspend = false;
 	bool ad_suspend = false;
-	unsigned long irq_flags;
 
 
 	if (!crtc) {
 	if (!crtc) {
 		DRM_ERROR("crtc %pK\n", crtc);
 		DRM_ERROR("crtc %pK\n", crtc);
@@ -2644,12 +2643,30 @@ void sde_cp_crtc_suspend(struct drm_crtc *crtc)
 	}
 	}
 	mutex_unlock(&sde_crtc->crtc_cp_lock);
 	mutex_unlock(&sde_crtc->crtc_cp_lock);
 
 
+	if (ad_suspend)
+		_sde_cp_ad_set_prop(sde_crtc, AD_SUSPEND);
+}
+
+void sde_cp_crtc_suspend(struct drm_crtc *crtc)
+{
+	struct sde_crtc *sde_crtc = NULL;
+	unsigned long irq_flags;
+
+	if (!crtc) {
+		DRM_ERROR("crtc %pK\n", crtc);
+		return;
+	}
+	sde_crtc = to_sde_crtc(crtc);
+	if (!sde_crtc) {
+		DRM_ERROR("sde_crtc %pK\n", sde_crtc);
+		return;
+	}
+
+	sde_cp_crtc_mark_features_dirty(crtc);
+
 	spin_lock_irqsave(&sde_crtc->ltm_lock, irq_flags);
 	spin_lock_irqsave(&sde_crtc->ltm_lock, irq_flags);
 	sde_crtc->ltm_hist_en = false;
 	sde_crtc->ltm_hist_en = false;
 	spin_unlock_irqrestore(&sde_crtc->ltm_lock, irq_flags);
 	spin_unlock_irqrestore(&sde_crtc->ltm_lock, irq_flags);
-
-	if (ad_suspend)
-		_sde_cp_ad_set_prop(sde_crtc, AD_SUSPEND);
 }
 }
 
 
 void sde_cp_crtc_resume(struct drm_crtc *crtc)
 void sde_cp_crtc_resume(struct drm_crtc *crtc)

+ 6 - 0
msm/sde/sde_color_processing.h

@@ -228,6 +228,12 @@ void sde_cp_crtc_apply_properties(struct drm_crtc *crtc);
 int sde_cp_crtc_get_property(struct drm_crtc *crtc,
 int sde_cp_crtc_get_property(struct drm_crtc *crtc,
 				struct drm_property *property, uint64_t *val);
 				struct drm_property *property, uint64_t *val);
 
 
+/**
+ * sde_cp_crtc_mark_features_dirty: Move the cp features from active list to dirty list
+ * @crtc: Pointer to crtc.
+ */
+void sde_cp_crtc_mark_features_dirty(struct drm_crtc *crtc);
+
 /**
 /**
  * sde_cp_crtc_suspend: Suspend the crtc features
  * sde_cp_crtc_suspend: Suspend the crtc features
  * @crtc: Pointer to crtc.
  * @crtc: Pointer to crtc.

+ 1 - 1
msm/sde/sde_crtc.c

@@ -3620,7 +3620,7 @@ static void sde_crtc_atomic_begin(struct drm_crtc *crtc,
 		sde_cp_crtc_apply_properties(crtc);
 		sde_cp_crtc_apply_properties(crtc);
 
 
 	if (!sde_crtc->enabled)
 	if (!sde_crtc->enabled)
-		sde_cp_crtc_suspend(crtc);
+		sde_cp_crtc_mark_features_dirty(crtc);
 
 
 	/*
 	/*
 	 * PP_DONE irq is only used by command mode for now.
 	 * PP_DONE irq is only used by command mode for now.