summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@armlinux.org.uk>2017-02-25 12:26:31 +0000
committerRussell King <rmk@armlinux.org.uk>2017-02-25 17:16:15 +0000
commit585f4c24a466783bc1dca10e5b221b1d82ec4644 (patch)
tree488bc942c6a42e8ffa962269091520d412c012e3
parent6caca375b8eb57d6eeaf2e417676004f5db45005 (diff)
src: Xv: simplify plane disable in armada_drm_check_plane()
armada_drm_check_plane() does not need to clear the clip boxes; move the plane disable out of armada_drm_plane_StopVideo() and call it directly from armada_drm_check_plane(). Signed-off-by: Russell King <rmk@armlinux.org.uk>
-rw-r--r--src/armada_drm_xv.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/armada_drm_xv.c b/src/armada_drm_xv.c
index 9cb62f8..44b56a0 100644
--- a/src/armada_drm_xv.c
+++ b/src/armada_drm_xv.c
@@ -780,22 +780,28 @@ armada_drm_plane_fbid(ScrnInfoPtr pScrn, struct drm_xv *drmxv, int image,
return Success;
}
+static void armada_drm_plane_disable(ScrnInfoPtr pScrn, struct drm_xv *drmxv,
+ drmModePlanePtr mode_plane)
+{
+ int ret;
+
+ ret = drmModeSetPlane(drmxv->fd, mode_plane->plane_id,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+ if (ret)
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "[drm] unable to disable plane %u: %s\n",
+ mode_plane->plane_id, strerror(errno));
+}
+
static void
armada_drm_plane_StopVideo(ScrnInfoPtr pScrn, pointer data, Bool cleanup)
{
struct drm_xv *drmxv = data;
if (drmxv->overlay_plane) {
- int ret;
-
RegionEmpty(&drmxv->clipBoxes);
-
- ret = drmModeSetPlane(drmxv->fd, drmxv->overlay_plane->plane_id,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
- if (ret)
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
- "[drm] unable to stop overlay: %s\n",
- strerror(errno));
+ armada_drm_plane_disable(pScrn, drmxv, drmxv->overlay_plane);
+ drmxv->overlay_plane = NULL;
}
if (cleanup) {
@@ -821,7 +827,7 @@ static Bool armada_drm_check_plane(ScrnInfoPtr pScrn, struct drm_xv *drmxv,
if (drmxv->overlay_plane &&
!(drmxv->overlay_plane->possible_crtcs & crtc_mask)) {
/* Moved on to a different CRTC */
- armada_drm_plane_StopVideo(pScrn, drmxv, FALSE);
+ armada_drm_plane_disable(pScrn, drmxv, drmxv->overlay_plane);
drmxv->overlay_plane = NULL;
}