aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/dri/dri.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-07-25 19:39:46 +0000
committermarha <marha@users.sourceforge.net>2009-07-25 19:39:46 +0000
commit4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (patch)
treec1e02b9d3509aa97703aa4b540d4cd22ec4600ed /xorg-server/hw/xfree86/dri/dri.c
parentdc3c299dd0995549e2a6973ca0f25b254afd38a5 (diff)
downloadvcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.gz
vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.bz2
vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.zip
Added xorg-server-1.6.2.tar.gz
Diffstat (limited to 'xorg-server/hw/xfree86/dri/dri.c')
-rw-r--r--xorg-server/hw/xfree86/dri/dri.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/xorg-server/hw/xfree86/dri/dri.c b/xorg-server/hw/xfree86/dri/dri.c
index 79934a1c5..bddb6510e 100644
--- a/xorg-server/hw/xfree86/dri/dri.c
+++ b/xorg-server/hw/xfree86/dri/dri.c
@@ -70,6 +70,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "mi.h"
#include "mipointer.h"
#include "xf86_OSproc.h"
+#include "inputstr.h"
#define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
@@ -78,8 +79,10 @@ extern Bool noPanoramiXExtension;
#endif
static int DRIEntPrivIndex = -1;
-static DevPrivateKey DRIScreenPrivKey = &DRIScreenPrivKey;
-static DevPrivateKey DRIWindowPrivKey = &DRIWindowPrivKey;
+static int DRIScreenPrivKeyIndex;
+static DevPrivateKey DRIScreenPrivKey = &DRIScreenPrivKeyIndex;
+static int DRIWindowPrivKeyIndex;
+static DevPrivateKey DRIWindowPrivKey = &DRIWindowPrivKeyIndex;
static unsigned long DRIGeneration = 0;
static unsigned int DRIDrawableValidationStamp = 0;
@@ -299,6 +302,18 @@ DRIOpenDRMMaster(ScrnInfoPtr pScrn,
return FALSE;
}
+static void
+DRIClipNotifyAllDrawables(ScreenPtr pScreen);
+
+static void
+dri_crtc_notify(ScreenPtr pScreen)
+{
+ DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
+ DRIClipNotifyAllDrawables(pScreen);
+ xf86_unwrap_crtc_notify(pScreen, pDRIPriv->xf86_crtc_notify);
+ xf86_crtc_notify(pScreen);
+ pDRIPriv->xf86_crtc_notify = xf86_wrap_crtc_notify(pScreen, dri_crtc_notify);
+}
Bool
DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
@@ -342,7 +357,6 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
pDRIEntPriv = DRI_ENT_PRIV(pScrn);
- DRIScreenPrivKey = &DRIScreenPrivKey;
if (DRIGeneration != serverGeneration)
DRIGeneration = serverGeneration;
@@ -603,6 +617,9 @@ DRIFinishScreenInit(ScreenPtr pScreen)
pDRIPriv->DestroyWindow = pScreen->DestroyWindow;
pScreen->DestroyWindow = DRIDestroyWindow;
+ pDRIPriv->xf86_crtc_notify = xf86_wrap_crtc_notify(pScreen,
+ dri_crtc_notify);
+
if (pDRIInfo->wrap.CopyWindow) {
pDRIPriv->wrap.CopyWindow = pScreen->CopyWindow;
pScreen->CopyWindow = pDRIInfo->wrap.CopyWindow;
@@ -656,6 +673,9 @@ DRICloseScreen(ScreenPtr pScreen)
pScreen->DestroyWindow = pDRIPriv->DestroyWindow;
pDRIPriv->DestroyWindow = NULL;
}
+
+ xf86_unwrap_crtc_notify(pScreen, pDRIPriv->xf86_crtc_notify);
+
if (pDRIInfo->wrap.CopyWindow) {
pScreen->CopyWindow = pDRIPriv->wrap.CopyWindow;
pDRIPriv->wrap.CopyWindow = NULL;
@@ -669,6 +689,7 @@ DRICloseScreen(ScreenPtr pScreen)
pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame;
pDRIPriv->wrap.AdjustFrame = NULL;
}
+
pDRIPriv->wrapped = FALSE;
}
@@ -1270,7 +1291,7 @@ DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable,
*hHWDrawable = pDRIDrawablePriv->hwDrawable;
}
}
- else { /* pixmap (or for GLX 1.3, a PBuffer) */
+ else if (pDrawable->type != DRAWABLE_PIXMAP) { /* PBuffer */
/* NOT_DONE */
return FALSE;
}
@@ -2298,12 +2319,12 @@ DRIAdjustFrame(int scrnIndex, int x, int y, int flags)
pScrn->frameY1 = pScrn->frameY0 + pDRIPriv->pSAREA->frame.height - 1;
/* Fix up cursor */
- miPointerPosition(&px, &py);
+ miPointerGetPosition(inputInfo.pointer, &px, &py);
if (px < pScrn->frameX0) px = pScrn->frameX0;
if (px > pScrn->frameX1) px = pScrn->frameX1;
if (py < pScrn->frameY0) py = pScrn->frameY0;
if (py > pScrn->frameY1) py = pScrn->frameY1;
- pScreen->SetCursorPosition(pScreen, px, py, TRUE);
+ pScreen->SetCursorPosition(inputInfo.pointer, pScreen, px, py, TRUE);
return;
}
@@ -2434,7 +2455,7 @@ static void drmSIGIOHandler(int interrupt, void *closure)
#if 0
fprintf(stderr, "Trying %d\n", entry->fd);
#endif
- if ((count = read(entry->fd, buf, sizeof(buf))) > 0) {
+ if ((count = read(entry->fd, buf, sizeof(buf) - 1)) > 0) {
buf[count] = '\0';
#if 0
fprintf(stderr, "Got %s\n", buf);