Bläddra i källkod

disp: msm: sde: set force dirty for UCSC range/enum msm properties

Install volatile enum and range properties for UCSC IGC, GC, UNMULT
and ALPHA_DITHER. This will mark the force dirty property data as
true, and will avoid caching in driver by always applying the
property values set by userspace, rather than checking for modified
values.

Change-Id: Ib8132165fb58ddc829bf8610657e302e0798d72f
Signed-off-by: Alisha Thapaliya <[email protected]>
Alisha Thapaliya 2 år sedan
förälder
incheckning
6567abf76c
3 ändrade filer med 67 tillägg och 7 borttagningar
  1. 38 3
      msm/msm_prop.c
  2. 25 0
      msm/msm_prop.h
  3. 4 4
      msm/sde/sde_plane.c

+ 38 - 3
msm/msm_prop.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -200,10 +201,26 @@ void msm_property_install_volatile_range(struct msm_property_info *info,
 			min, max, init, property_idx, true);
 }
 
-void msm_property_install_enum(struct msm_property_info *info,
+/**
+ * msm_property_install_enum_helper - install standard drm enum/bitmask property
+ *  This function is added as a helper function called within msm_property_install_enum
+ *  or msm_property_install_volatile_enum depending on whether we want to set the
+ *  enum property as dirty or not dirty.
+ * @info: Pointer to property info container struct
+ * @name: Property name
+ * @flags: Other property type flags, e.g. DRM_MODE_PROP_IMMUTABLE
+ * @is_bitmask: Set to non-zero to create a bitmask property, rather than an
+ *              enumeration one
+ * @values: Array of allowable enumeration/bitmask values
+ * @num_values: Size of values array
+ * @init_idx: index of the values array entry to initialize the property
+ * @property_idx: Property index
+ * @force_dirty: Whether or not to filter 'dirty' status on unchanged values
+ */
+void msm_property_install_enum_helper(struct msm_property_info *info,
 		const char *name, int flags, int is_bitmask,
 		const struct drm_prop_enum_list *values, int num_values,
-		u32 init_idx, uint32_t property_idx)
+		u32 init_idx, uint32_t property_idx, bool force_dirty)
 {
 	struct drm_property **prop;
 
@@ -237,7 +254,7 @@ void msm_property_install_enum(struct msm_property_info *info,
 
 		/* save init value for later */
 		info->property_data[property_idx].default_value = 0;
-		info->property_data[property_idx].force_dirty = false;
+		info->property_data[property_idx].force_dirty = force_dirty;
 
 		/* initialize with the given idx if valid */
 		if (!is_bitmask && init_idx && (init_idx < num_values))
@@ -254,6 +271,24 @@ void msm_property_install_enum(struct msm_property_info *info,
 	}
 }
 
+void msm_property_install_volatile_enum(struct msm_property_info *info,
+		const char *name, int flags, int is_bitmask,
+		const struct drm_prop_enum_list *values, int num_values,
+		u32 init_idx, uint32_t property_idx)
+{
+	msm_property_install_enum_helper(info, name, flags, is_bitmask,
+	    values, num_values, init_idx, property_idx, true);
+}
+
+void msm_property_install_enum(struct msm_property_info *info,
+		const char *name, int flags, int is_bitmask,
+		const struct drm_prop_enum_list *values, int num_values,
+		u32 init_idx, uint32_t property_idx)
+{
+	msm_property_install_enum_helper(info, name, flags, is_bitmask,
+		values, num_values, init_idx, property_idx, false);
+}
+
 void msm_property_install_blob(struct msm_property_info *info,
 		const char *name, int flags, uint32_t property_idx)
 {

+ 25 - 0
msm/msm_prop.h

@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
  */
 
@@ -262,6 +263,30 @@ void msm_property_install_enum(struct msm_property_info *info,
 		u32 init_idx,
 		uint32_t property_idx);
 
+/**
+ * msm_property_install_volatile_enum - install standard drm enum/bitmask property
+ *  This function is similar to msm_property_install_enum, but assumes
+ *  that the property is meant for holding user pointers or descriptors
+ *  that may reference volatile data without having an updated value.
+ * @info: Pointer to property info container struct
+ * @name: Property name
+ * @flags: Other property type flags, e.g. DRM_MODE_PROP_IMMUTABLE
+ * @is_bitmask: Set to non-zero to create a bitmask property, rather than an
+ *              enumeration one
+ * @values: Array of allowable enumeration/bitmask values
+ * @num_values: Size of values array
+ * @init_idx: index of the values array entry to initialize the property
+ * @property_idx: Property index
+ */
+void msm_property_install_volatile_enum(struct msm_property_info *info,
+		const char *name,
+		int flags,
+		int is_bitmask,
+		const struct drm_prop_enum_list *values,
+		int num_values,
+		u32 init_idx,
+		uint32_t property_idx);
+
 /**
  * msm_property_install_blob - install standard drm blob property
  * @info: Pointer to property info container struct

+ 4 - 4
msm/sde/sde_plane.c

@@ -3901,7 +3901,7 @@ static void _sde_plane_install_colorproc_properties(struct sde_plane *psde,
 		snprintf(feature_name, sizeof(feature_name), "%s%d",
 			"SDE_SSPP_UCSC_IGC_V",
 			psde->pipe_sblk->ucsc_igc_blk[0].version >> 16);
-		msm_property_install_enum(&psde->property_info, feature_name,
+		msm_property_install_volatile_enum(&psde->property_info, feature_name,
 				0x0, 0, ucsc_igc, ARRAY_SIZE(ucsc_igc), 0, PLANE_PROP_UCSC_IGC);
 	}
 
@@ -3909,7 +3909,7 @@ static void _sde_plane_install_colorproc_properties(struct sde_plane *psde,
 		snprintf(feature_name, sizeof(feature_name), "%s%d",
 			"SDE_SSPP_UCSC_GC_V",
 			psde->pipe_sblk->ucsc_gc_blk[0].version >> 16);
-		msm_property_install_enum(&psde->property_info, feature_name,
+		msm_property_install_volatile_enum(&psde->property_info, feature_name,
 		0x0, 0, ucsc_gc, ARRAY_SIZE(ucsc_gc), 0, PLANE_PROP_UCSC_GC);
 	}
 
@@ -3925,7 +3925,7 @@ static void _sde_plane_install_colorproc_properties(struct sde_plane *psde,
 		snprintf(feature_name, sizeof(feature_name), "%s%d",
 			"SDE_SSPP_UCSC_UNMULT_V",
 			psde->pipe_sblk->ucsc_unmult_blk[0].version >> 16);
-		msm_property_install_range(&psde->property_info, feature_name,
+		msm_property_install_volatile_range(&psde->property_info, feature_name,
 			0x0, 0, 1, 0, PLANE_PROP_UCSC_UNMULT);
 	}
 
@@ -3933,7 +3933,7 @@ static void _sde_plane_install_colorproc_properties(struct sde_plane *psde,
 		snprintf(feature_name, sizeof(feature_name), "%s%d",
 			"SDE_SSPP_UCSC_ALPHA_DITHER_V",
 			psde->pipe_sblk->ucsc_alpha_dither_blk[0].version >> 16);
-		msm_property_install_range(&psde->property_info, feature_name,
+		msm_property_install_volatile_range(&psde->property_info, feature_name,
 			0x0, 0, 1, 0, PLANE_PROP_UCSC_ALPHA_DITHER);
 	}
 }