msm: sde: fix deadlock issue in concurrency test

When enabling early display, disabling weston service and launching
DRM_test, system looks to hang when DRM_test wants to open drm node.
The hang is caused by mutex deadlock.
So refine the code and remove the mutex lock to fix the problem.

Change-Id: I91d0c4e4418afde38c98a6294e49491403cdfe74
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
Signed-off-by: Yujun Zhang <yujunzhang@codeaurora.org>
This commit is contained in:
Guchun Chen 2017-07-04 10:29:58 +08:00 committed by Gerrit - the friendly Code Review server
parent 8aedd70842
commit c2beb40851
2 changed files with 24 additions and 26 deletions

View file

@ -16,6 +16,7 @@
#include "sde_kms.h"
#include "sde_connector.h"
#include "sde_backlight.h"
#include "sde_splash.h"
#define SDE_DEBUG_CONN(c, fmt, ...) SDE_DEBUG("conn%d " fmt,\
(c) ? (c)->base.base.id : -1, ##__VA_ARGS__)
@ -501,13 +502,35 @@ void sde_connector_prepare_fence(struct drm_connector *connector)
void sde_connector_complete_commit(struct drm_connector *connector)
{
struct drm_device *dev;
struct msm_drm_private *priv;
struct sde_connector *c_conn;
struct sde_kms *sde_kms;
if (!connector) {
SDE_ERROR("invalid connector\n");
return;
}
dev = connector->dev;
priv = dev->dev_private;
sde_kms = to_sde_kms(priv->kms);
/* signal connector's retire fence */
sde_fence_signal(&to_sde_connector(connector)->retire_fence, 0);
/* after first vsync comes,
* early splash resource should start to be released.
*/
if (sde_splash_get_lk_complete_status(&sde_kms->splash_info)) {
c_conn = to_sde_connector(connector);
sde_splash_clean_up_free_resource(priv->kms,
&priv->phandle,
c_conn->connector_type,
c_conn->display);
}
}
static void sde_connector_update_hdr_props(struct drm_connector *connector)

View file

@ -600,23 +600,14 @@ void sde_crtc_complete_commit(struct drm_crtc *crtc,
{
struct sde_crtc *sde_crtc;
struct sde_crtc_state *cstate;
struct drm_connector *conn;
struct sde_connector *c_conn;
struct drm_device *dev;
struct msm_drm_private *priv;
struct sde_kms *sde_kms;
int i;
if (!crtc || !crtc->state || !crtc->dev) {
if (!crtc || !crtc->state) {
SDE_ERROR("invalid crtc\n");
return;
}
dev = crtc->dev;
priv = dev->dev_private;
sde_crtc = to_sde_crtc(crtc);
sde_kms = _sde_crtc_get_kms(crtc);
cstate = to_sde_crtc_state(crtc->state);
SDE_EVT32(DRMID(crtc));
@ -625,22 +616,6 @@ void sde_crtc_complete_commit(struct drm_crtc *crtc,
for (i = 0; i < cstate->num_connectors; ++i)
sde_connector_complete_commit(cstate->connectors[i]);
if (sde_splash_get_lk_complete_status(&sde_kms->splash_info)) {
mutex_lock(&dev->mode_config.mutex);
drm_for_each_connector(conn, crtc->dev) {
if (conn->state->crtc != crtc)
continue;
c_conn = to_sde_connector(conn);
sde_splash_clean_up_free_resource(priv->kms,
&priv->phandle,
c_conn->connector_type,
c_conn->display);
}
mutex_unlock(&dev->mode_config.mutex);
}
}
/**