Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38ad8c90 authored by Lloyd Atkinson's avatar Lloyd Atkinson Committed by Narendra Muppalla
Browse files

drm/msm: allow flags to be set in property helpers



Expand API for property helper functions to allow passing in
more DRM flags, specifically to allow DRM_MODE_PROP_IMMUTABLE
to be declared.

Change-Id: I17b48412488f8ca7e32d6bda9e5089c560d1f711
Signed-off-by: default avatarLloyd Atkinson <latkinso@codeaurora.org>
parent 3ab9ef7b
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -73,8 +73,8 @@ void msm_property_destroy(struct msm_property_info *info)
}

void msm_property_install_range(struct msm_property_info *info,
		const char *name, uint64_t min, uint64_t max, uint64_t init,
		uint32_t property_idx)
		const char *name, int flags, uint64_t min, uint64_t max,
		uint64_t init, uint32_t property_idx)
{
	struct drm_property **prop;

@@ -93,7 +93,7 @@ void msm_property_install_range(struct msm_property_info *info,
		 */
		if (*prop == 0) {
			*prop = drm_property_create_range(info->dev,
					0 /* flags */, name, min, max);
					flags, name, min, max);
			if (*prop == 0)
				DRM_ERROR("create %s property failed\n", name);
		}
@@ -146,7 +146,7 @@ void msm_property_install_rotation(struct msm_property_info *info,
}

void msm_property_install_enum(struct msm_property_info *info,
		const char *name, int is_bitmask,
		const char *name, int flags, int is_bitmask,
		const struct drm_prop_enum_list *values, int num_values,
		uint32_t property_idx)
{
@@ -170,12 +170,12 @@ void msm_property_install_enum(struct msm_property_info *info,
			/* 'bitmask' is a special type of 'enum' */
			if (is_bitmask)
				*prop = drm_property_create_bitmask(info->dev,
						DRM_MODE_PROP_BITMASK, name,
						values, num_values, -1);
						DRM_MODE_PROP_BITMASK | flags,
						name, values, num_values, -1);
			else
				*prop = drm_property_create_enum(info->dev,
						DRM_MODE_PROP_ENUM, name,
						values, num_values);
						DRM_MODE_PROP_ENUM | flags,
						name, values, num_values);
			if (*prop == 0)
				DRM_ERROR("create %s property failed\n", name);
		}
+4 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ void msm_property_destroy(struct msm_property_info *info);
 * msm_property_install_range - install standard drm range property
 * @info: Pointer to property info container struct
 * @name: Property name
 * @flags: Other property type flags, e.g. DRM_MODE_PROP_IMMUTABLE
 * @min: Min property value
 * @max: Max property value
 * @init: Default property value
@@ -122,6 +123,7 @@ void msm_property_destroy(struct msm_property_info *info);
 */
void msm_property_install_range(struct msm_property_info *info,
		const char *name,
		int flags,
		uint64_t min,
		uint64_t max,
		uint64_t init,
@@ -142,6 +144,7 @@ void msm_property_install_rotation(struct msm_property_info *info,
 * msm_property_install_enum - install standard drm enum/bitmask property
 * @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
@@ -150,6 +153,7 @@ void msm_property_install_rotation(struct msm_property_info *info,
 */
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,
+1 −1
Original line number Diff line number Diff line
@@ -552,7 +552,7 @@ struct drm_connector *sde_connector_init(struct drm_device *dev,
	}

	msm_property_install_range(&c_conn->property_info, "RETIRE_FENCE",
			0, ~0, ~0, CONNECTOR_PROP_RETIRE_FENCE);
			0x0, 0, ~0, ~0, CONNECTOR_PROP_RETIRE_FENCE);

	rc = msm_property_install_get_status(&c_conn->property_info);
	if (rc) {
+2 −2
Original line number Diff line number Diff line
@@ -1048,11 +1048,11 @@ static void sde_crtc_install_properties(struct drm_crtc *crtc)
	/* range properties */
	msm_property_install_range(&sde_crtc->property_info,
			"input_fence_timeout",
			0, ~0, SDE_CRTC_INPUT_FENCE_TIMEOUT,
			0x0, 0, ~0, SDE_CRTC_INPUT_FENCE_TIMEOUT,
			CRTC_PROP_INPUT_FENCE_TIMEOUT);
	msm_property_install_range(&sde_crtc->property_info,
			"output_fence",
			0, ~0, ~0,
			0x0, 0, ~0, ~0,
			CRTC_PROP_OUTPUT_FENCE);
}

+7 −7
Original line number Diff line number Diff line
@@ -1136,21 +1136,21 @@ static void _sde_plane_install_properties(struct drm_plane *plane)
	}

	/* range properties */
	msm_property_install_range(&psde->property_info, "zpos", 0, 255,
	msm_property_install_range(&psde->property_info, "zpos", 0x0, 0, 255,
			plane->type == DRM_PLANE_TYPE_PRIMARY ?
				STAGE_BASE : STAGE0 + drm_plane_index(plane),
			PLANE_PROP_ZPOS);

	msm_property_install_range(&psde->property_info, "alpha", 0, 255, 255,
			PLANE_PROP_ALPHA);
	msm_property_install_range(&psde->property_info, "alpha",
			0x0, 0, 255, 255, PLANE_PROP_ALPHA);

	if (psde->pipe_hw->ops.setup_solidfill)
		msm_property_install_range(&psde->property_info, "color_fill",
				0, 0xFFFFFFFF, 0,
				0, 0, 0xFFFFFFFF, 0,
				PLANE_PROP_COLOR_FILL);

	msm_property_install_range(&psde->property_info, "input_fence",
			0, ~0, ~0,
			0x0, 0, ~0, ~0,
			PLANE_PROP_INPUT_FENCE);

	/* standard properties */
@@ -1159,10 +1159,10 @@ static void _sde_plane_install_properties(struct drm_plane *plane)
			PLANE_PROP_ROTATION);

	/* enum/bitmask properties */
	msm_property_install_enum(&psde->property_info, "blend_op", 0,
	msm_property_install_enum(&psde->property_info, "blend_op", 0x0, 0,
			e_blend_op, ARRAY_SIZE(e_blend_op),
			PLANE_PROP_BLEND_OP);
	msm_property_install_enum(&psde->property_info, "src_config", 1,
	msm_property_install_enum(&psde->property_info, "src_config", 0x0, 1,
			e_src_config, ARRAY_SIZE(e_src_config),
			PLANE_PROP_SRC_CONFIG);

Loading