From 4de15bb6efbb91a6512ce214202d9ddbf14a50d5 Mon Sep 17 00:00:00 2001 From: Samantha Tran Date: Fri, 25 Oct 2019 14:27:04 -0700 Subject: [PATCH] disp: msm: sde: check all dirty properties during plane update Previously when updating a plane's dirty features, if the dirty all flag was set, the optimization was to break early. This optimization left out color property updates for that plane. This fix removes the mutex locks in the msm_prop function so the break optimization is no longer needed. Function callers will now need to acquire the lock and unlock the property lock when done. Now the plane will iterate through all dirty properties. Change-Id: I3114ac44d62ac0f0633897d757b6fd9a5b1f5d2e Signed-off-by: Samantha Tran --- msm/msm_prop.c | 4 ++-- msm/msm_prop.h | 4 +++- msm/sde/sde_connector.c | 2 ++ msm/sde/sde_plane.c | 5 ++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/msm/msm_prop.c b/msm/msm_prop.c index eb17f5f72e..d7c9eb0f84 100644 --- a/msm/msm_prop.c +++ b/msm/msm_prop.c @@ -77,7 +77,8 @@ int msm_property_pop_dirty(struct msm_property_info *info, return -EINVAL; } - mutex_lock(&info->property_lock); + WARN_ON(!mutex_is_locked(&info->property_lock)); + if (list_empty(&property_state->dirty_list)) { rc = -EAGAIN; } else { @@ -87,7 +88,6 @@ int msm_property_pop_dirty(struct msm_property_info *info, - property_state->values; DRM_DEBUG_KMS("property %d dirty\n", rc); } - mutex_unlock(&info->property_lock); return rc; } diff --git a/msm/msm_prop.h b/msm/msm_prop.h index db2ad988d0..6069aaaa50 100644 --- a/msm/msm_prop.h +++ b/msm/msm_prop.h @@ -162,7 +162,9 @@ bool msm_property_get_is_active(struct msm_property_info *info) /** * msm_property_pop_dirty - determine next dirty property and clear - * its dirty flag + * its dirty flag. Caller needs to acquire property + * lock before calling this function and release + * the lock when finished. * @info: Pointer to property info container struct * @property_state: Pointer to property state container struct * Returns: Valid msm property index on success, diff --git a/msm/sde/sde_connector.c b/msm/sde/sde_connector.c index 7da379b92c..dd1744db46 100644 --- a/msm/sde/sde_connector.c +++ b/msm/sde/sde_connector.c @@ -701,6 +701,7 @@ static int _sde_connector_update_dirty_properties( c_conn = to_sde_connector(connector); c_state = to_sde_connector_state(connector->state); + mutex_lock(&c_conn->property_info.property_lock); while ((idx = msm_property_pop_dirty(&c_conn->property_info, &c_state->property_state)) >= 0) { switch (idx) { @@ -723,6 +724,7 @@ static int _sde_connector_update_dirty_properties( break; } } + mutex_unlock(&c_conn->property_info.property_lock); /* if colorspace needs to be updated do it first */ if (c_conn->colorspace_updated) { diff --git a/msm/sde/sde_plane.c b/msm/sde/sde_plane.c index e9c3a0cf8c..c078317026 100644 --- a/msm/sde/sde_plane.c +++ b/msm/sde/sde_plane.c @@ -3182,14 +3182,13 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane, } /* determine what needs to be refreshed */ + mutex_lock(&psde->property_info.property_lock); while ((idx = msm_property_pop_dirty(&psde->property_info, &pstate->property_state)) >= 0) { dirty_prop_flag = plane_prop_array[idx]; pstate->dirty |= dirty_prop_flag; - - if (dirty_prop_flag == SDE_PLANE_DIRTY_ALL) - break; } + mutex_unlock(&psde->property_info.property_lock); /** * since plane_atomic_check is invoked before crtc_atomic_check