Selaa lähdekoodia

drm: msm: re-enable driver disabled color features

When encoder is disabled, demura is disabled since pipes
are disabled internally.
Change marks the features which were active and disabled
by driver as dirty so that it can be applied in the next commit.

Change-Id: I805d17d673a8ff41f9bdb18ba7f2fd185b5ccb5a
Signed-off-by: Gopikrishnaiah Anandan <[email protected]>
Gopikrishnaiah Anandan 2 vuotta sitten
vanhempi
sitoutus
4ee3a1a5e2
1 muutettua tiedostoa jossa 39 lisäystä ja 0 poistoa
  1. 39 0
      msm/sde/sde_color_processing.c

+ 39 - 0
msm/sde/sde_color_processing.c

@@ -112,6 +112,8 @@ static int _sde_cp_crtc_cache_property(struct drm_crtc *crtc,
 				struct drm_property *property,
 				uint64_t val);
 
+static void _sde_cp_mark_active_dirty_internal(struct sde_crtc *crtc);
+
 #define setup_dspp_prop_install_funcs(func) \
 do { \
 	func[SDE_DSPP_PCC] = _dspp_pcc_install_property; \
@@ -2824,6 +2826,7 @@ void sde_cp_disable_features(struct drm_crtc *crtc)
 
 		mutex_unlock(&sde_crtc->crtc_cp_lock);
 	}
+	_sde_cp_mark_active_dirty_internal(sde_crtc);
 }
 
 void sde_cp_crtc_clear(struct drm_crtc *crtc)
@@ -4751,6 +4754,19 @@ static bool _sde_cp_feature_in_activelist(u32 feature, struct list_head *list)
 	return false;
 }
 
+/* this func needs to be called within crtc_cp_lock mutex */
+static struct sde_cp_node *_sde_cp_feature_getnode_activelist(u32 feature, struct list_head *list)
+{
+	struct sde_cp_node *node = NULL;
+
+	list_for_each_entry(node, list, cp_active_list) {
+		if (feature == node->feature)
+			return node;
+	}
+
+	return NULL;
+}
+
 void sde_cp_crtc_vm_primary_handoff(struct drm_crtc *crtc)
 {
 	struct sde_crtc *sde_crtc = NULL;
@@ -5012,3 +5028,26 @@ void sde_cp_set_skip_blend_plane_info(struct drm_crtc *drm_crtc,
 	mutex_unlock(&crtc->crtc_cp_lock);
 }
 
+void _sde_cp_mark_active_dirty_internal(struct sde_crtc *crtc)
+{
+	struct sde_cp_node *prop_node;
+	u32 i;
+	enum sde_cp_crtc_features features[] = {
+		SDE_CP_CRTC_DSPP_DEMURA_INIT,
+	};
+
+	mutex_lock(&crtc->crtc_cp_lock);
+
+	for (i = 0; i < ARRAY_SIZE(features); i++) {
+		if (_sde_cp_feature_in_dirtylist(features[i],
+							 &crtc->cp_dirty_list))
+			continue;
+		prop_node = _sde_cp_feature_getnode_activelist(features[i],
+				&crtc->cp_active_list);
+		if (prop_node) {
+			_sde_cp_update_list(prop_node, crtc, true);
+			list_del_init(&prop_node->cp_active_list);
+		}
+	}
+	mutex_unlock(&crtc->crtc_cp_lock);
+}