summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86xv.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@nokia.com>2010-10-29 16:51:24 +0300
committerVille Syrjälä <ville.syrjala@nokia.com>2010-11-26 18:01:05 +0200
commit38987aae199982f17eae664f3a28ff5941d3ee73 (patch)
treef1f47e6658dfaf0b507e74cec0c5b43ff57131e6 /hw/xfree86/common/xf86xv.c
parent0178173f0579c4b9dd0cf60b9cd3e5d264f86ae4 (diff)
xfree86/xv: Factor out the meat of xf86XVWindowExposures for later reuse
No fucntional change. Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com> Reviewed-by: Luc Verhaegen <luc.verhaegen@basyskom.de>
Diffstat (limited to 'hw/xfree86/common/xf86xv.c')
-rw-r--r--hw/xfree86/common/xf86xv.c53
1 files changed, 28 insertions, 25 deletions
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index f9b3d93ed..581e8a7a3 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1004,6 +1004,33 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
portPriv->pDraw = NULL;
}
+static void
+xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv,
+ WindowPtr pWin,
+ Bool AreasExposed)
+{
+ switch (pPriv->type) {
+ case XvInputMask:
+ xf86XVReputVideo(pPriv);
+ break;
+ case XvOutputMask:
+ xf86XVRegetVideo(pPriv);
+ break;
+ default: /* overlaid still/image*/
+ if (pPriv->AdaptorRec->ReputImage)
+ xf86XVReputImage(pPriv);
+ else if (AreasExposed) {
+ if (pPriv->isOn == XV_ON) {
+ (*pPriv->AdaptorRec->StopVideo)(pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
+ pPriv->isOn = XV_PENDING;
+ }
+
+ xf86XVRemovePortFromWindow(pWin, pPriv);
+ }
+ break;
+ }
+}
+
/**** ScreenRec fields ****/
static Bool
@@ -1063,32 +1090,8 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
while(WinPriv) {
pPriv = WinPriv->PortRec;
- /* Reput anyone with a reput function */
-
- switch(pPriv->type) {
- case XvInputMask:
- xf86XVReputVideo(pPriv);
- break;
- case XvOutputMask:
- xf86XVRegetVideo(pPriv);
- break;
- default: /* overlaid still/image*/
- if (pPriv->AdaptorRec->ReputImage)
- xf86XVReputImage(pPriv);
- else if(AreasExposed) {
- if (pPriv->isOn == XV_ON) {
- (*pPriv->AdaptorRec->StopVideo)(
- pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
- pPriv->isOn = XV_PENDING;
- }
-
- WinPriv = WinPriv->next;
- xf86XVRemovePortFromWindow(pWin, pPriv);
- continue;
- }
- break;
- }
WinPriv = WinPriv->next;
+ xf86XVReputOrStopPort(pPriv, pWin, AreasExposed);
}
}