summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLloyd Atkinson <latkinso@codeaurora.org>2016-08-16 16:10:31 -0400
committerLloyd Atkinson <latkinso@codeaurora.org>2016-09-06 08:39:40 -0400
commitf3033ccae43819b704866569a63541bc125addbb (patch)
tree425a50b2661f64b4d48af88ab4500be8f187a61f
parent558b82b5c7794d64e5ab3303423e3ba4ae2a79a0 (diff)
drm/msm: internal property updates should update cached value
Need to update the driver-side cached value of properties when they are updated via the internal set_property helpers, especially for driver-generated read-only immutable properties. Change-Id: If9a2c04d867eea41c1fa3ee2eb02964bc71afc06 Signed-off-by: Lloyd Atkinson <latkinso@codeaurora.org>
-rw-r--r--drivers/gpu/drm/msm/msm_prop.c22
-rw-r--r--drivers/gpu/drm/msm/msm_prop.h2
-rw-r--r--drivers/gpu/drm/msm/sde/sde_connector.h8
-rw-r--r--drivers/gpu/drm/msm/sde/sde_rm.c2
4 files changed, 31 insertions, 3 deletions
diff --git a/drivers/gpu/drm/msm/msm_prop.c b/drivers/gpu/drm/msm/msm_prop.c
index e9550f580b11..3edf4b93f5d3 100644
--- a/drivers/gpu/drm/msm/msm_prop.c
+++ b/drivers/gpu/drm/msm/msm_prop.c
@@ -590,21 +590,37 @@ exit:
}
int msm_property_set_property(struct msm_property_info *info,
+ uint64_t *property_values,
uint32_t property_idx,
uint64_t val)
{
int rc = -EINVAL;
if (!info || (property_idx >= info->property_count) ||
- property_idx < info->blob_count) {
+ property_idx < info->blob_count || !property_values) {
DRM_ERROR("invalid argument(s)\n");
} else {
+ struct drm_property *drm_prop;
+
+ mutex_lock(&info->property_lock);
+
+ /* update cached value */
+ if (property_values)
+ property_values[property_idx] = val;
+
+ /* update the new default value for immutables */
+ drm_prop = info->property_array[property_idx];
+ if (drm_prop->flags & DRM_MODE_PROP_IMMUTABLE)
+ info->property_data[property_idx].default_value = val;
+
+ mutex_unlock(&info->property_lock);
+
/* update drm object */
- rc = drm_object_property_set_value(info->base,
- info->property_array[property_idx], val);
+ rc = drm_object_property_set_value(info->base, drm_prop, val);
if (rc)
DRM_ERROR("failed set property value, idx %d rc %d\n",
property_idx, rc);
+
}
return rc;
diff --git a/drivers/gpu/drm/msm/msm_prop.h b/drivers/gpu/drm/msm/msm_prop.h
index 9a4879854bbd..f065cbffda09 100644
--- a/drivers/gpu/drm/msm/msm_prop.h
+++ b/drivers/gpu/drm/msm/msm_prop.h
@@ -353,11 +353,13 @@ int msm_property_set_blob(struct msm_property_info *info,
* DRM_MODE_PROP_IMMUTABLE flag set.
* Note: This function cannot be called on a blob.
* @info: Pointer to property info container struct
+ * @property_values: Pointer to property values cache array
* @property_idx: Property index
* @val: value of the property to set
* Returns: Zero on success
*/
int msm_property_set_property(struct msm_property_info *info,
+ uint64_t *property_values,
uint32_t property_idx,
uint64_t val);
diff --git a/drivers/gpu/drm/msm/sde/sde_connector.h b/drivers/gpu/drm/msm/sde/sde_connector.h
index f47d3b01de29..403160c85ae2 100644
--- a/drivers/gpu/drm/msm/sde/sde_connector.h
+++ b/drivers/gpu/drm/msm/sde/sde_connector.h
@@ -223,6 +223,14 @@ struct sde_connector_state {
(to_sde_connector_state((S))->property_values[(X)]) : 0)
/**
+ * sde_connector_get_property_values - retrieve property values cache
+ * @S: Pointer to drm connector state
+ * Returns: Integer value of requested property
+ */
+#define sde_connector_get_property_values(S) \
+ ((S) ? (to_sde_connector_state((S))->property_values) : 0)
+
+/**
* sde_connector_get_out_fb - query out_fb value from sde connector state
* @S: Pointer to drm connector state
* Returns: Output fb associated with specified connector state
diff --git a/drivers/gpu/drm/msm/sde/sde_rm.c b/drivers/gpu/drm/msm/sde/sde_rm.c
index a8e0e89d9720..54f0e3a5d65c 100644
--- a/drivers/gpu/drm/msm/sde/sde_rm.c
+++ b/drivers/gpu/drm/msm/sde/sde_rm.c
@@ -996,6 +996,7 @@ void sde_rm_release(struct sde_rm *rm, struct drm_encoder *enc)
_sde_rm_release_rsvp(rm, rsvp);
(void) msm_property_set_property(
sde_connector_get_propinfo(conn),
+ sde_connector_get_property_values(conn->state),
CONNECTOR_PROP_TOPOLOGY_NAME,
SDE_RM_TOPOLOGY_UNKNOWN);
}
@@ -1011,6 +1012,7 @@ static int _sde_rm_commit_rsvp(
ret = msm_property_set_property(
sde_connector_get_propinfo(conn_state->connector),
+ sde_connector_get_property_values(conn_state),
CONNECTOR_PROP_TOPOLOGY_NAME,
rsvp->topology);
if (ret)