[PATCH v2 04/15] xfree86/xv: Allow xf86XVReputOrStopPort() to stop PutVideo/GetVideo ports
ville.syrjala at nokia.com
ville.syrjala at nokia.com
Tue Nov 2 11:05:50 PDT 2010
From: Ville Syrjälä <ville.syrjala at nokia.com>
Modify xf86XVReputOrStopPort() to allow stopping of all types of ports.
Will be useful later.
No functional change.
Signed-off-by: Ville Syrjälä <ville.syrjala at nokia.com>
---
hw/xfree86/common/xf86xv.c | 33 +++++++++++++++++++++++----------
1 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index c31b15b..06fa341 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -1010,8 +1010,20 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
static void
xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv,
WindowPtr pWin,
- Bool AreasExposed)
+ Bool visible)
{
+ if (!visible) {
+ if (pPriv->isOn == XV_ON) {
+ (*pPriv->AdaptorRec->StopVideo)(pPriv->pScrn, pPriv->DevPriv.ptr, FALSE);
+ pPriv->isOn = XV_PENDING;
+ }
+
+ if (!pPriv->type) /* overlaid still/image*/
+ xf86XVRemovePortFromWindow(pWin, pPriv);
+
+ return;
+ }
+
switch (pPriv->type) {
case XvInputMask:
xf86XVReputVideo(pPriv);
@@ -1022,14 +1034,6 @@ xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv,
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;
}
}
@@ -1091,10 +1095,19 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
if (!pWin->valdata) return;
while(WinPriv) {
+ Bool visible = TRUE;
+
pPriv = WinPriv->PortRec;
+ /*
+ * Stop and remove still/images if areas were exposed and
+ * ReputImage isn't supported.
+ */
+ if (!pPriv->type && !pPriv->AdaptorRec->ReputImage)
+ visible = !AreasExposed;
+
WinPriv = WinPriv->next;
- xf86XVReputOrStopPort(pPriv, pWin, AreasExposed);
+ xf86XVReputOrStopPort(pPriv, pWin, visible);
}
}
--
1.7.2.2
More information about the xorg-devel
mailing list