summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2006-09-29 00:35:21 +0300
committerDaniel Stone <daniels@endtroducing.fooishbar.org>2006-09-29 00:35:21 +0300
commit518db35ca3f569e7cb95dbddeddb93f3691de498 (patch)
tree266e3cdbf418e52b31a7b5b9f63780c5cb1927ee /hw
parent5d99e05f05a42a82a9f02844df9bfebaa673759d (diff)
parent84eb2c0a06de60e88e14bb03fabe661d7cd8f1d3 (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into input-hotplug
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/dixmods/Makefile.am6
-rw-r--r--hw/xfree86/dixmods/fbmodule.c6
-rw-r--r--hw/xfree86/dri/dri.c22
-rw-r--r--hw/xfree86/os-support/drm/xf86drm.c16
-rw-r--r--hw/xfree86/os-support/xf86drm.h3
5 files changed, 50 insertions, 3 deletions
diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am
index 65dad8a86..c34ddd6e3 100644
--- a/hw/xfree86/dixmods/Makefile.am
+++ b/hw/xfree86/dixmods/Makefile.am
@@ -18,6 +18,7 @@ module_LTLIBRARIES = libafb.la \
libcfb.la \
libcfb32.la \
libfb.la \
+ libwfb.la \
libmfb.la \
libshadow.la
@@ -66,6 +67,11 @@ libfb_la_LIBADD = $(top_builddir)/fb/libfb.la
libfb_la_SOURCES = $(top_builddir)/fb/fbcmap.c fbmodule.c
libfb_la_CFLAGS = -DXFree86Server $(AM_CFLAGS)
+libwfb_la_LDFLAGS = -avoid-version
+libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la
+libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap.c fbmodule.c
+libwfb_la_CFLAGS = -DXFree86Server $(AM_CFLAGS) -DFB_ACCESS_WRAPPER
+
libglx_la_LDFLAGS = -avoid-version
if AIGLX
GLXDRI_LIBRARY = $(top_builddir)/GL/glx/libglxdri.la
diff --git a/hw/xfree86/dixmods/fbmodule.c b/hw/xfree86/dixmods/fbmodule.c
index e8e6cd7c6..4df2646dd 100644
--- a/hw/xfree86/dixmods/fbmodule.c
+++ b/hw/xfree86/dixmods/fbmodule.c
@@ -33,7 +33,11 @@
static XF86ModuleVersionInfo VersRec =
{
+#ifdef FB_ACCESS_WRAPPER
+ "wfb",
+#else
"fb",
+#endif
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
@@ -45,4 +49,4 @@ static XF86ModuleVersionInfo VersRec =
{0,0,0,0} /* signature, to be patched into the file by a tool */
};
-_X_EXPORT XF86ModuleData fbModuleData = { &VersRec, NULL, NULL };
+_X_EXPORT XF86ModuleData FBPREFIX(ModuleData) = { &VersRec, NULL, NULL };
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 7b4d5bda4..9e52e6146 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -992,6 +992,10 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id,
pWin = (WindowPtr)pDrawable;
if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
pDRIDrawablePriv->refCount++;
+
+ if (!pDRIDrawablePriv->hwDrawable) {
+ drmCreateDrawable(pDRIPriv->drmFD, &pDRIDrawablePriv->hwDrawable);
+ }
}
else {
/* allocate a DRI Window Private record */
@@ -1000,13 +1004,13 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id,
}
/* Only create a drm_drawable_t once */
- if (drmCreateDrawable(pDRIPriv->drmFD, hHWDrawable)) {
+ if (drmCreateDrawable(pDRIPriv->drmFD,
+ &pDRIDrawablePriv->hwDrawable)) {
xfree(pDRIDrawablePriv);
return FALSE;
}
/* add it to the list of DRI drawables for this screen */
- pDRIDrawablePriv->hwDrawable = *hHWDrawable;
pDRIDrawablePriv->pScreen = pScreen;
pDRIDrawablePriv->refCount = 1;
pDRIDrawablePriv->drawableIndex = -1;
@@ -1029,6 +1033,15 @@ DRICreateDrawable(ScreenPtr pScreen, Drawable id,
/* track this in case this window is destroyed */
AddResource(id, DRIDrawablePrivResType, (pointer)pWin);
}
+
+ if (pDRIDrawablePriv->hwDrawable) {
+ drmUpdateDrawableInfo(pDRIPriv->drmFD,
+ pDRIDrawablePriv->hwDrawable,
+ DRM_DRAWABLE_CLIPRECTS,
+ REGION_NUM_RECTS(&pWin->clipList),
+ REGION_RECTS(&pWin->clipList));
+ *hHWDrawable = pDRIDrawablePriv->hwDrawable;
+ }
}
else { /* pixmap (or for GLX 1.3, a PBuffer) */
/* NOT_DONE */
@@ -1813,6 +1826,11 @@ DRIClipNotify(WindowPtr pWin, int dx, int dy)
pDRIPriv->pSAREA->drawableTable[pDRIDrawablePriv->drawableIndex].stamp
= DRIDrawableValidationStamp++;
+
+ drmUpdateDrawableInfo(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable,
+ DRM_DRAWABLE_CLIPRECTS,
+ REGION_NUM_RECTS(&pWin->clipList),
+ REGION_RECTS(&pWin->clipList));
}
/* call lower wrapped functions */
diff --git a/hw/xfree86/os-support/drm/xf86drm.c b/hw/xfree86/os-support/drm/xf86drm.c
index 3759920c2..214e58ba7 100644
--- a/hw/xfree86/os-support/drm/xf86drm.c
+++ b/hw/xfree86/os-support/drm/xf86drm.c
@@ -1388,6 +1388,22 @@ int drmDestroyDrawable(int fd, drm_drawable_t handle)
return 0;
}
+int drmUpdateDrawableInfo(int fd, drm_drawable_t handle,
+ drm_drawable_info_type_t type, unsigned int num,
+ void *data)
+{
+ drm_update_draw_t update;
+
+ update.handle = handle;
+ update.type = type;
+ update.num = num;
+ update.data = (unsigned long long)(unsigned long)data;
+
+ if (ioctl(fd, DRM_IOCTL_UPDATE_DRAW, &update)) return -errno;
+
+ return 0;
+}
+
/**
* Acquire the AGP device.
*
diff --git a/hw/xfree86/os-support/xf86drm.h b/hw/xfree86/os-support/xf86drm.h
index 88f5e0ffc..107670672 100644
--- a/hw/xfree86/os-support/xf86drm.h
+++ b/hw/xfree86/os-support/xf86drm.h
@@ -543,6 +543,9 @@ extern int drmSwitchToContext(int fd, drm_context_t context);
extern int drmDestroyContext(int fd, drm_context_t handle);
extern int drmCreateDrawable(int fd, drm_drawable_t * handle);
extern int drmDestroyDrawable(int fd, drm_drawable_t handle);
+extern int drmUpdateDrawableInfo(int fd, drm_drawable_t handle,
+ drm_drawable_info_type_t type,
+ unsigned int num, void *data);
extern int drmCtlInstHandler(int fd, int irq);
extern int drmCtlUninstHandler(int fd);
extern int drmInstallSIGIOHandler(int fd,