summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@armlinux.org.uk>2017-02-25 12:19:25 +0000
committerRussell King <rmk@armlinux.org.uk>2017-02-25 17:16:15 +0000
commit6caca375b8eb57d6eeaf2e417676004f5db45005 (patch)
treebde83418ef71d1fb5a81c55913902ed221289685
parent2c2adca387a45be7eaeae4193685803680bb08f7 (diff)
src: Xv: cleanup armada_drm_check_plane()
Cleanup armada_drm_check_plane() a little. Signed-off-by: Russell King <rmk@armlinux.org.uk>
-rw-r--r--src/armada_drm_xv.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/armada_drm_xv.c b/src/armada_drm_xv.c
index 1e2eaf4..9cb62f8 100644
--- a/src/armada_drm_xv.c
+++ b/src/armada_drm_xv.c
@@ -807,7 +807,7 @@ armada_drm_plane_StopVideo(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
static Bool armada_drm_check_plane(ScrnInfoPtr pScrn, struct drm_xv *drmxv,
xf86CrtcPtr crtc)
{
- drmModePlanePtr plane;
+ unsigned int i;
uint32_t crtc_mask;
if (!crtc) {
@@ -818,28 +818,21 @@ static Bool armada_drm_check_plane(ScrnInfoPtr pScrn, struct drm_xv *drmxv,
crtc_mask = 1 << common_crtc(crtc)->num;
- plane = drmxv->overlay_plane;
- if (plane && !(plane->possible_crtcs & crtc_mask)) {
+ if (drmxv->overlay_plane &&
+ !(drmxv->overlay_plane->possible_crtcs & crtc_mask)) {
/* Moved on to a different CRTC */
armada_drm_plane_StopVideo(pScrn, drmxv, FALSE);
- plane = NULL;
+ drmxv->overlay_plane = NULL;
}
- if (!plane) {
- unsigned i;
-
+ if (!drmxv->overlay_plane)
for (i = 0; i < drmxv->num_planes; i++)
- if (drmxv->mode_planes[i]->possible_crtcs & crtc_mask)
- plane = drmxv->mode_planes[i];
-
- /* Our new plane */
- drmxv->overlay_plane = plane;
-
- if (!plane)
- return FALSE;
- }
+ if (drmxv->mode_planes[i]->possible_crtcs & crtc_mask) {
+ drmxv->overlay_plane = drmxv->mode_planes[i];
+ break;
+ }
- return TRUE;
+ return drmxv->overlay_plane != NULL;
}
/*