diff options
| author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-02-23 09:55:56 -0500 |
|---|---|---|
| committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-03-03 09:16:29 -0500 |
| commit | 48596d502e93a62fd1adab42b0a923709cd1c115 (patch) | |
| tree | ebdcee92cb8e7b989b311543355d3658a977c908 /drivers/gpu/drm/rcar-du | |
| parent | 52055bafa1ffcd24525f72f5bc35bc14eae1c449 (diff) | |
drm: rcar-du: Move group locking inside rcar_du_crtc_update_planes()
Only the planes to CRTCs association control register DPTSR needs to be
protected by custom locking, don't hold the mutex around the whole code.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/rcar-du')
| -rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index 29bbb44eecc9..8459aaee8add 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c | |||
| @@ -252,8 +252,6 @@ static void rcar_du_crtc_update_planes(struct rcar_du_crtc *rcrtc) | |||
| 252 | * with superposition controller 2. | 252 | * with superposition controller 2. |
| 253 | */ | 253 | */ |
| 254 | if (rcrtc->index % 2) { | 254 | if (rcrtc->index % 2) { |
| 255 | u32 value = rcar_du_group_read(rcrtc->group, DPTSR); | ||
| 256 | |||
| 257 | /* The DPTSR register is updated when the display controller is | 255 | /* The DPTSR register is updated when the display controller is |
| 258 | * stopped. We thus need to restart the DU. Once again, sorry | 256 | * stopped. We thus need to restart the DU. Once again, sorry |
| 259 | * for the flicker. One way to mitigate the issue would be to | 257 | * for the flicker. One way to mitigate the issue would be to |
| @@ -261,11 +259,13 @@ static void rcar_du_crtc_update_planes(struct rcar_du_crtc *rcrtc) | |||
| 261 | * split, or through a module parameter). Flicker would then | 259 | * split, or through a module parameter). Flicker would then |
| 262 | * occur only if we need to break the pre-association. | 260 | * occur only if we need to break the pre-association. |
| 263 | */ | 261 | */ |
| 264 | if (value != dptsr) { | 262 | mutex_lock(&rcrtc->group->planes.lock); |
| 263 | if (rcar_du_group_read(rcrtc->group, DPTSR) != dptsr) { | ||
| 265 | rcar_du_group_write(rcrtc->group, DPTSR, dptsr); | 264 | rcar_du_group_write(rcrtc->group, DPTSR, dptsr); |
| 266 | if (rcrtc->group->used_crtcs) | 265 | if (rcrtc->group->used_crtcs) |
| 267 | rcar_du_group_restart(rcrtc->group); | 266 | rcar_du_group_restart(rcrtc->group); |
| 268 | } | 267 | } |
| 268 | mutex_unlock(&rcrtc->group->planes.lock); | ||
| 269 | } | 269 | } |
| 270 | 270 | ||
| 271 | rcar_du_group_write(rcrtc->group, rcrtc->index % 2 ? DS2PR : DS1PR, | 271 | rcar_du_group_write(rcrtc->group, rcrtc->index % 2 ? DS2PR : DS1PR, |
| @@ -435,9 +435,7 @@ void rcar_du_crtc_resume(struct rcar_du_crtc *rcrtc) | |||
| 435 | rcar_du_plane_setup(plane); | 435 | rcar_du_plane_setup(plane); |
| 436 | } | 436 | } |
| 437 | 437 | ||
| 438 | mutex_lock(&rcrtc->group->planes.lock); | ||
| 439 | rcar_du_crtc_update_planes(rcrtc); | 438 | rcar_du_crtc_update_planes(rcrtc); |
| 440 | mutex_unlock(&rcrtc->group->planes.lock); | ||
| 441 | } | 439 | } |
| 442 | 440 | ||
| 443 | /* ----------------------------------------------------------------------------- | 441 | /* ----------------------------------------------------------------------------- |
| @@ -501,9 +499,7 @@ static void rcar_du_crtc_atomic_flush(struct drm_crtc *crtc) | |||
| 501 | { | 499 | { |
| 502 | struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc); | 500 | struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc); |
| 503 | 501 | ||
| 504 | mutex_lock(&rcrtc->group->planes.lock); | ||
| 505 | rcar_du_crtc_update_planes(rcrtc); | 502 | rcar_du_crtc_update_planes(rcrtc); |
| 506 | mutex_unlock(&rcrtc->group->planes.lock); | ||
| 507 | } | 503 | } |
| 508 | 504 | ||
| 509 | static const struct drm_crtc_helper_funcs crtc_helper_funcs = { | 505 | static const struct drm_crtc_helper_funcs crtc_helper_funcs = { |
