diff options
author | Luc Verhaegen <libv@skynet.be> | 2010-12-06 16:49:30 +0100 |
---|---|---|
committer | Luc Verhaegen <libv@skynet.be> | 2010-12-06 16:49:30 +0100 |
commit | 3e2dd0afb9719295454d8d879d6f5ffde0755253 (patch) | |
tree | ac3f0bd9acfa79ac50e9b572575b0543f98ee5f6 | |
parent | 71f2a864d7e9dd58f4f01f36587c765def9d2a97 (diff) |
xorg: update to new XvReputImage API
Now we might get called not only for changing frame or clipping,
but also for changing modes. Handle this accordingly.
Signed-off-by: Luc Verhaegen <libv@skynet.be>
-rw-r--r-- | configure.ac | 17 | ||||
-rw-r--r-- | src/via_video.c | 45 |
2 files changed, 58 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index d7fcb01..f30691d 100644 --- a/configure.ac +++ b/configure.ac @@ -129,6 +129,23 @@ fi AC_MSG_RESULT([$have_xv]) AM_CONDITIONAL(XV, test x$have_xv = xyes) +# check whether reputimage gained some extra arguments +if test "x$have_xv" = xyes; then + SAVED_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $XORG_CFLAGS" + + AC_CHECK_MEMBER([ScrnInfoRec.ModeSet], + [SCRNINFO_HAS_MODESET=yes], [SCRNINFO_HAS_MODESET=no], + [#include "${sdkdir}/xf86str.h"]) + if test "x$SCRNINFO_HAS_MODESET" = xyes; then + AC_DEFINE(XV_NEW_REPUT, 1, + [XvReputImage takes more all coordinates]) + fi + + CFLAGS="$SAVED_CFLAGS" +fi +AM_CONDITIONAL(XV_NEW_REPUT, test x$XV_NEW_REPUT = xyes) + # Check what parts of XvMC are around. AC_MSG_CHECKING([XvMC protocol headers directory]) xvmcprotodir=$(pkg-config --variable=includedir xvmc) diff --git a/src/via_video.c b/src/via_video.c index fc8670d..6c27683 100644 --- a/src/via_video.c +++ b/src/via_video.c @@ -2130,12 +2130,22 @@ viaPutImage(ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, } /* - * This doesn't fix the case where the overlay window was not - * in the visible frame when switching away. That one requires - * some DIX poking. + * For the code inside XV_NEW_REPUT: + * A modeset might have happened, without updating the clients, so without + * updating fb contents. This is why this code is different. The scaling might + * have changed, forcing us to recalculate drw_ values. The src_ values are + * unchanged for reputimage (atm), and for our hardware we only need to + * recalculate the scaling. */ static int -ViaSwovReputImage(ScrnInfoPtr pScrn, short drw_x, short drw_y, +ViaSwovReputImage(ScrnInfoPtr pScrn, +#ifdef XV_NEW_REPUT + short src_x, short src_y, +#endif + short drw_x, short drw_y, +#ifdef XV_NEW_REPUT + short src_w, short src_h, short drw_w, short drw_h, +#endif RegionPtr clipBoxes, pointer data #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 1 , DrawablePtr pDraw @@ -2161,6 +2171,32 @@ ViaSwovReputImage(ScrnInfoPtr pScrn, short drw_x, short drw_y, ViaHQVIdle(Swov); +#ifdef XV_NEW_REPUT + /* Handle CRTC scaling */ + if (pVia->VisibleWidth < pVia->ScaledWidth) { + drw_w = (drw_w * pVia->ScaledWidth) / pVia->VisibleWidth; + drw_x = (drw_x * pVia->ScaledWidth) / pVia->VisibleWidth; + } + if (pVia->VisibleHeight < pVia->ScaledHeight) { + drw_h = (drw_h * pVia->ScaledHeight) / pVia->VisibleHeight; + drw_y = (drw_y * pVia->ScaledHeight) / pVia->VisibleHeight; + } + + /* FrameAdjust is usually in only a single direction */ + if ((pScrn->frameX0 != Swov->frameX0) || (drw_x != Port->Drw_X) || + (drw_w != Port->Drw_W)) { + Port->Drw_X = drw_x; + Port->Drw_W = drw_w; + HVisible = ViaSwovVisibleH(pScrn, Swov->Port); + } + + if ((pScrn->frameY0 != Swov->frameY0) || (drw_y != Port->Drw_Y) || + (drw_h != Port->Drw_H)) { + Port->Drw_Y = drw_y; + Port->Drw_H = drw_h; + VVisible = ViaSwovVisibleV(pScrn, Swov->Port); + } +#else /* Handle CRTC scaling */ if (pVia->VisibleWidth < pVia->ScaledWidth) drw_x = (drw_x * pVia->ScaledWidth) / pVia->VisibleWidth; @@ -2177,6 +2213,7 @@ ViaSwovReputImage(ScrnInfoPtr pScrn, short drw_x, short drw_y, Port->Drw_Y = drw_y; VVisible = ViaSwovVisibleV(pScrn, Swov->Port); } +#endif if (HVisible && VVisible) { ViaSwovStartAddress(Swov, Swov->Port); |