aboutsummaryrefslogtreecommitdiff
path: root/x11-drivers
diff options
context:
space:
mode:
authorNiclas Zeising <zeising@FreeBSD.org>2013-09-29 17:01:41 +0000
committerNiclas Zeising <zeising@FreeBSD.org>2013-09-29 17:01:41 +0000
commit5a4c543c2b0f538631aea8379ce384d5defee89d (patch)
tree108a55d148b3bc801facab0fb03b8666659c1136 /x11-drivers
parent7231ff2710fcc89472994d2e2d235e74e9c8704c (diff)
downloadports-5a4c543c2b0f538631aea8379ce384d5defee89d.tar.gz
ports-5a4c543c2b0f538631aea8379ce384d5defee89d.zip
Notes
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/xf86-input-mouse/files/patch-src-bsd_mouse.c826
-rw-r--r--x11-drivers/xf86-input-mouse/files/patch-src_mouse.c25
-rw-r--r--x11-drivers/xf86-input-synaptics/Makefile2
-rw-r--r--x11-drivers/xf86-video-ati/Makefile17
-rw-r--r--x11-drivers/xf86-video-ati/distinfo2
-rw-r--r--x11-drivers/xf86-video-ati/files/extra-src__radeon_kms.c20
-rw-r--r--x11-drivers/xf86-video-ati/files/patch-src__radeon_dri2.c11
-rw-r--r--x11-drivers/xf86-video-ati/pkg-plist14
-rw-r--r--x11-drivers/xf86-video-fbdev/Makefile2
-rw-r--r--x11-drivers/xf86-video-fbdev/distinfo4
-rw-r--r--x11-drivers/xf86-video-intel/Makefile10
-rw-r--r--x11-drivers/xf86-video-intel/distinfo4
-rw-r--r--x11-drivers/xf86-video-intel/files/extra-clang60
-rw-r--r--x11-drivers/xf86-video-intel/files/extra-i915kms24
-rw-r--r--x11-drivers/xf86-video-intel/files/extra-src_sna_compiler.h18
-rw-r--r--x11-drivers/xf86-video-intel/files/extra-src_sna_kgem.c44
-rw-r--r--x11-drivers/xf86-video-vesa/Makefile2
-rw-r--r--x11-drivers/xf86-video-vesa/distinfo4
-rw-r--r--x11-drivers/xorg-drivers/Makefile2
19 files changed, 965 insertions, 126 deletions
diff --git a/x11-drivers/xf86-input-mouse/files/patch-src-bsd_mouse.c b/x11-drivers/xf86-input-mouse/files/patch-src-bsd_mouse.c
index 078d52a28128..1996722fd2eb 100644
--- a/x11-drivers/xf86-input-mouse/files/patch-src-bsd_mouse.c
+++ b/x11-drivers/xf86-input-mouse/files/patch-src-bsd_mouse.c
@@ -1,13 +1,65 @@
---- src/bsd_mouse.c.orig 2012-07-27 08:10:56.000000000 +0200
-+++ src/bsd_mouse.c 2012-07-30 00:49:09.000000000 +0200
-@@ -71,15 +71,20 @@
- static const char *FindDevice(InputInfoPtr, const char *, int);
+--- src/bsd_mouse.c.orig 2012-10-08 03:40:07.000000000 +0200
++++ src/bsd_mouse.c 2013-07-03 01:00:50.897361950 +0200
+@@ -26,6 +26,24 @@
+ * authorization from the copyright holder(s) and author(s).
+ */
- #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
++
++/*
++ * XXX - Should this be autoconf'd instead?
++ */
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
++
++#if !defined(USBMOUSE_SUPPORT)
++#define USBMOUSE_SUPPORT
++#endif
++#if !defined(HAS_LIB_USB_HID)
++#define HAS_LIB_USB_HID
++#endif
+#if !defined(XPS2_SUPPORT)
+#define XPS2_SUPPORT
+#endif
- /* These are for FreeBSD and DragonFly */
++
++#endif /* defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) */
++
+ #include <xorg-server.h>
+
+ #include <X11/X.h>
+@@ -33,9 +51,23 @@
+ #include "xf86Priv.h"
+ #include "xf86_OSlib.h"
+ #include "xf86Xinput.h"
++#include <exevents.h>
+ #include "mouse.h"
+ #include "xisb.h"
+ #include "mipointer.h"
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
++#define HAVE_PROPERTIES 1
++#endif
++#ifdef HAVE_PROPERTIES
++#include <X11/Xatom.h>
++#include <xserver-properties.h>
++/* 1.6 has properties, but no labels */
++#ifdef AXIS_LABEL_PROP
++#define HAVE_LABELS
++#else
++#undef HAVE_LABELS
++#endif
++#endif
+ #ifdef WSCONS_SUPPORT
+ #include <dev/wscons/wsconsio.h>
+ #endif
+@@ -47,9 +79,6 @@
+ #endif
+
+ #include <dev/usb/usb.h>
+-#ifdef USB_GET_REPORT_ID
+-#define USB_NEW_HID
+-#endif
+
+ #define HUP_GENERIC_DESKTOP 0x0001
+ #define HUP_BUTTON 0x0009
+@@ -75,11 +104,13 @@
#define DEFAULT_MOUSE_DEV "/dev/mouse"
#define DEFAULT_SYSMOUSE_DEV "/dev/sysmouse"
#define DEFAULT_PS2_DEV "/dev/psm0"
@@ -21,7 +73,7 @@
NULL
};
#elif (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
-@@ -100,7 +105,11 @@
+@@ -100,7 +131,11 @@
#if defined(__NetBSD__)
return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_AUTO;
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
@@ -34,14 +86,14 @@
#else
return MSE_SERIAL | MSE_BUS | MSE_PS2 | MSE_XPS2 | MSE_AUTO | MSE_MISC;
#endif
-@@ -180,9 +189,30 @@
+@@ -180,9 +215,30 @@
{ MOUSE_PROTO_SYSMOUSE, "SysMouse" }
};
+#ifdef XPS2_SUPPORT
+static struct {
+ int dmodel;
-+ char *name;
++ const char *name;
+} ps2proto[] = {
+ { MOUSE_MODEL_NETSCROLL, "NetScrollPS/2" },
+ { MOUSE_MODEL_NET, "NetMousePS/2" },
@@ -59,13 +111,13 @@
SetupAuto(InputInfoPtr pInfo, int *protoPara)
{
+#ifdef XPS2_SUPPORT
-+ char *dev;
++ const char *dev;
+#endif
+ const char *proto;
int i;
mousehw_t hw;
mousemode_t mode;
-@@ -190,7 +220,13 @@
+@@ -190,7 +246,13 @@
if (pInfo->fd == -1)
return NULL;
@@ -79,7 +131,7 @@
i = 1;
ioctl(pInfo->fd, MOUSE_SETLEVEL, &i);
-@@ -209,9 +245,18 @@
+@@ -209,9 +271,18 @@
protoPara[0] = mode.syncmask[0];
protoPara[1] = mode.syncmask[1];
}
@@ -100,7 +152,7 @@
}
}
}
-@@ -234,41 +279,41 @@
+@@ -234,41 +305,41 @@
(protocol && xf86NameCmp(protocol, "SysMouse") == 0)) {
/*
* As the FreeBSD sysmouse driver defaults to protocol level 0
@@ -159,7 +211,7 @@
}
return FALSE;
}
-@@ -276,17 +321,17 @@
+@@ -276,17 +347,17 @@
static const char *
FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
{
@@ -181,7 +233,7 @@
#endif
} else {
/*
-@@ -295,28 +340,32 @@
+@@ -295,28 +366,32 @@
* the test for whether /dev/sysmouse is usable can be made.
*/
if (!strcmp(*pdev, DEFAULT_MOUSE_DEV)) {
@@ -227,7 +279,749 @@
break;
}
}
-@@ -764,7 +813,9 @@
+@@ -468,30 +543,78 @@
+
+ #if defined(USBMOUSE_SUPPORT)
+
++#define MAXRIDS 64
++#define MAXACOLS 8
++#define MAXLCOLS 16
+ typedef struct _UsbMseRec {
+ int packetSize;
+- int iid;
+- hid_item_t loc_x; /* x locator item */
+- hid_item_t loc_y; /* y locator item */
+- hid_item_t loc_z; /* z (wheel) locator item */
+- hid_item_t loc_w; /* z (wheel) locator item */
+- hid_item_t loc_btn[MSE_MAXBUTTONS]; /* buttons locator items */
+- unsigned char *buffer;
++ int iid, nrids, nacols, opened;
++ struct {
++ int32_t rid;
++ int size;
++ } rids[MAXRIDS];
++ struct UsbMseAcol {
++ InputInfoPtr pInfo;
++ int nlcols, nbuttons, hasZ, hasW;
++ int xmin, xmax, ymin, ymax, pmin, pmax, px, py;
++ int cxmin, cxmax, cymin, cymax, cpmin, cpmax;
++ struct UsbMseLcol {
++ hid_item_t loc_x; /* x locator item */
++ hid_item_t loc_y; /* y locator item */
++ hid_item_t loc_z; /* z (wheel) locator item */
++ hid_item_t loc_w; /* w (hwheel) locator item */
++ hid_item_t loc_p; /* Tip Pressure */
++ hid_item_t loc_valid; /* Touch Valid */
++ hid_item_t loc_in_range; /* In Range */
++ hid_item_t loc_btn[MSE_MAXBUTTONS]; /* buttons locator items */
++ } lcols[MAXLCOLS];
++ hid_item_t loc_cc; /* contact count */
++ } acols[MAXACOLS];
++ unsigned char *buffer;
+ } UsbMseRec, *UsbMsePtr;
+
++static int *
++usbGetReportSizePtr(UsbMsePtr pUsbMse, int32_t rid)
++{
++ int i;
++
++ for (i = 0; i < pUsbMse->nrids; i++) {
++ if (pUsbMse->rids[i].rid == rid)
++ return (&pUsbMse->rids[i].size);
++ }
++ for (i = 0; i < MAXRIDS; i++) {
++ if (pUsbMse->rids[i].size == 0) {
++ pUsbMse->rids[i].rid = rid;
++ pUsbMse->nrids = max(pUsbMse->nrids, i + 1);
++ return (&pUsbMse->rids[i].size);
++ }
++ }
++ return (NULL);
++}
++
+ static int
+ usbMouseProc(DeviceIntPtr pPointer, int what)
+ {
+ InputInfoPtr pInfo;
+ MouseDevPtr pMse;
+ UsbMsePtr pUsbMse;
++ struct UsbMseAcol *acol;
+ unsigned char map[MSE_MAXBUTTONS + 1];
+- int nbuttons;
++ int nacol, nbuttons;
++#ifdef HAVE_LABELS
++ Atom btn_labels[MSE_MAXBUTTONS] = {0};
++ Atom axes_labels[3] = { 0, 0, 0 };
++#endif
+
+ pInfo = pPointer->public.devicePrivate;
+ pMse = pInfo->private;
+ pMse->device = pPointer;
+ pUsbMse = pMse->mousePriv;
++ for (nacol = 0; nacol < (pUsbMse->nacols - 1); nacol++) {
++ if (pUsbMse->acols[nacol].pInfo == pInfo)
++ break;
++ }
++ acol = &pUsbMse->acols[nacol];
+
+ switch (what) {
+ case DEVICE_INIT:
+@@ -500,38 +623,96 @@
+ for (nbuttons = 0; nbuttons < MSE_MAXBUTTONS; ++nbuttons)
+ map[nbuttons + 1] = nbuttons + 1;
+
+- InitPointerDeviceStruct((DevicePtr)pPointer,
+- map,
+- min(pMse->buttons, MSE_MAXBUTTONS),
+- miPointerGetMotionEvents,
+- pMse->Ctrl,
+- miPointerGetMotionBufferSize());
++#ifdef HAVE_LABELS
++ btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
++ btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
++ btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
++ axes_labels[0] = XIGetKnownProperty((acol->xmin != acol->xmax)
++ ? AXIS_LABEL_PROP_ABS_X : AXIS_LABEL_PROP_REL_X);
++ axes_labels[1] = XIGetKnownProperty((acol->xmin != acol->xmax)
++ ? AXIS_LABEL_PROP_ABS_Y : AXIS_LABEL_PROP_REL_Y);
++ axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE);
++#endif
++
++ InitButtonClassDeviceStruct(pPointer, min(pMse->buttons, MSE_MAXBUTTONS),
++#ifdef HAVE_LABELS
++ btn_labels,
++#endif
++ map);
++ InitValuatorClassDeviceStruct(pPointer, (acol->pmin != acol->pmax) ? 3 : 2,
++#ifdef HAVE_LABELS
++ axes_labels,
++#endif
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
++ miPointerGetMotionEvents,
++#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
++ GetMotionHistory,
++#endif
++ GetMotionHistorySize(),
++ (acol->xmin != acol->xmax || acol->ymin != acol->ymax) ?
++ Absolute : Relative);
++ InitPtrFeedbackClassDeviceStruct(pPointer, pMse->Ctrl);
+
+ /* X valuator */
+- xf86InitValuatorAxisStruct(pPointer, 0, 0, -1, 1, 0, 1);
++ xf86InitValuatorAxisStruct(pPointer, 0,
++#ifdef HAVE_LABELS
++ axes_labels[0],
++#endif
++ (acol->xmin != acol->xmax) ? acol->xmin : -1,
++ (acol->xmin != acol->xmax) ? acol->xmax : -1,
++ 1, 0, 1
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++ , (acol->xmin != acol->xmax) ? Absolute : Relative
++#endif
++ );
+ xf86InitValuatorDefaults(pPointer, 0);
+ /* Y valuator */
+- xf86InitValuatorAxisStruct(pPointer, 1, 0, -1, 1, 0, 1);
++ xf86InitValuatorAxisStruct(pPointer, 1,
++#ifdef HAVE_LABELS
++ axes_labels[1],
++#endif
++ (acol->ymin != acol->ymax) ? acol->ymin : -1,
++ (acol->ymin != acol->ymax) ? acol->ymax : -1,
++ 1, 0, 1
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++ , (acol->ymin != acol->ymax) ? Absolute : Relative
++#endif
++ );
+ xf86InitValuatorDefaults(pPointer, 1);
++ /* Pressure valuator */
++ if (acol->pmin != acol->pmax) {
++ xf86InitValuatorAxisStruct(pPointer, 2,
++#ifdef HAVE_LABELS
++ axes_labels[2],
++#endif
++ acol->pmin, acol->pmax, 1, 0, 1
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++ , Absolute
++#endif
++ );
++ xf86InitValuatorDefaults(pPointer, 2);
++ }
+ xf86MotionHistoryAllocate(pInfo);
+ break;
+
+ case DEVICE_ON:
+- pInfo->fd = xf86OpenSerial(pInfo->options);
+- if (pInfo->fd == -1)
+- xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
+- else {
+- pMse->buffer = XisbNew(pInfo->fd, pUsbMse->packetSize);
+- if (!pMse->buffer) {
+- free(pMse);
+- xf86CloseSerial(pInfo->fd);
+- pInfo->fd = -1;
+- } else {
+- xf86FlushInput(pInfo->fd);
+- if (!xf86InstallSIGIOHandler (pInfo->fd, usbSigioReadInput,
+- pInfo))
+- AddEnabledDevice(pInfo->fd);
+- }
++ if (pUsbMse->opened++ == 0) {
++ pInfo->fd = xf86OpenSerial(pInfo->options);
++ if (pInfo->fd == -1)
++ xf86Msg(X_WARNING, "%s: cannot open input device\n", pInfo->name);
++ else {
++ pMse->buffer = XisbNew(pInfo->fd, pUsbMse->packetSize);
++ if (!pMse->buffer) {
++ free(pMse);
++ xf86CloseSerial(pInfo->fd);
++ pInfo->fd = -1;
++ } else {
++ xf86FlushInput(pInfo->fd);
++ if (!xf86InstallSIGIOHandler (pInfo->fd, usbSigioReadInput,
++ pInfo))
++ AddEnabledDevice(pInfo->fd);
++ }
++ }
+ }
+ pMse->lastButtons = 0;
+ pMse->lastMappedButtons = 0;
+@@ -553,6 +734,7 @@
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+ }
++ pUsbMse->opened--;
+ pPointer->public.on = FALSE;
+ usleep(300000);
+ break;
+@@ -568,45 +750,154 @@
+ {
+ MouseDevPtr pMse;
+ UsbMsePtr pUsbMse;
+- int buttons = pMse->lastButtons;
+- int dx = 0, dy = 0, dz = 0, dw = 0;
+- int n, c;
++ int buttons, cc;
++ int dx, dy, dz, dw, dp, upd, v, nx, ny, np, in_range;
++ int n, c, rid, *sizep, nacol, nlcol;
+ unsigned char *pBuf;
++ struct UsbMseAcol *acol;
++ struct UsbMseLcol *lcol;
+
+ pMse = pInfo->private;
+ pUsbMse = pMse->mousePriv;
+
+ XisbBlockDuration(pMse->buffer, -1);
++next:
+ pBuf = pUsbMse->buffer;
+ n = 0;
+- while ((c = XisbRead(pMse->buffer)) >= 0 && n < pUsbMse->packetSize) {
++ if (pUsbMse->iid) {
++ rid = XisbRead(pMse->buffer);
++ if (rid < 0)
++ return;
++ pBuf[n++] = (unsigned char)rid;
++ } else
++ rid = 0;
++ sizep = usbGetReportSizePtr(pUsbMse, rid);
++ if (sizep == NULL || *sizep == 0) {
++ xf86Msg(X_WARNING, "%s: unknown report ID %d\n", pInfo->name, rid);
++ goto next;
++ }
++ while (n < *sizep && (c = XisbRead(pMse->buffer)) >= 0) {
+ pBuf[n++] = (unsigned char)c;
+ }
+ if (n == 0)
+ return;
+- if (n != pUsbMse->packetSize) {
++// xf86MsgVerb(X_INFO, 3, "pkt: %d %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
++// n, pBuf[0], pBuf[1], pBuf[2], pBuf[3], pBuf[4], pBuf[5], pBuf[6], pBuf[7], pBuf[8], pBuf[9]);
++ if (n != *sizep) {
+ LogMessageVerbSigSafe(X_WARNING, -1,
+ "%s: incomplete packet, size %d\n",
+ pInfo->name, n);
+ }
+- /* discard packets with an id that don't match the mouse */
+- /* XXX this is probably not the right thing */
+- if (pUsbMse->iid != 0) {
+- if (*pBuf++ != pUsbMse->iid)
+- return;
+- }
+- dx = hid_get_data(pBuf, &pUsbMse->loc_x);
+- dy = hid_get_data(pBuf, &pUsbMse->loc_y);
+- dz = hid_get_data(pBuf, &pUsbMse->loc_z);
+- dw = hid_get_data(pBuf, &pUsbMse->loc_w);
+-
+- buttons = 0;
+- for (n = 0; n < pMse->buttons; n++) {
+- if (hid_get_data(pBuf, &pUsbMse->loc_btn[n]))
+- buttons |= (1 << UMS_BUT(n));
++ for (nacol = 0; nacol < pUsbMse->nacols; nacol++) {
++ acol = &pUsbMse->acols[nacol];
++ if (acol->pInfo == NULL)
++ continue;
++ nx = ny = np = upd = 0;
++ buttons = cc = 0;
++ dx = dy = dz = dw = dp = 0;
++ for (nlcol = 0; nlcol < pUsbMse->acols[nacol].nlcols; nlcol++) {
++ lcol = &acol->lcols[nlcol];
++
++ if (lcol->loc_valid.usage != 0 && rid == lcol->loc_valid.report_ID &&
++ hid_get_data(pBuf, &lcol->loc_valid) == 0)
++ continue;
++ if (lcol->loc_in_range.usage != 0 && rid == lcol->loc_in_range.report_ID)
++ in_range = hid_get_data(pBuf, &lcol->loc_in_range);
++ else
++ in_range = 1;
++ if (in_range && lcol->loc_x.usage != 0 && rid == lcol->loc_x.report_ID && nx == 0) {
++ v = hid_get_data(pBuf, &lcol->loc_x);
++ if (acol->xmin != acol->xmax) {
++ v = xf86ScaleAxis(v, acol->xmax, acol->xmin,
++ lcol->loc_x.logical_maximum, lcol->loc_x.logical_minimum);
++ if (acol->cxmin != acol->cxmax)
++ v = xf86ScaleAxis(v, acol->xmax, acol->xmin,
++ acol->cxmax, acol->cxmin);
++ }
++ dx += v;
++ nx++;
++ }
++ if (in_range && lcol->loc_y.usage != 0 && rid == lcol->loc_y.report_ID && ny == 0) {
++ v = hid_get_data(pBuf, &lcol->loc_y);
++ if (acol->xmin != acol->xmax) {
++ v = xf86ScaleAxis(v, acol->ymax, acol->ymin,
++ lcol->loc_y.logical_maximum, lcol->loc_y.logical_minimum);
++ if (acol->cymin != acol->cymax)
++ v = xf86ScaleAxis(v, acol->ymax, acol->ymin,
++ acol->cymax, acol->cymin);
++ }
++ dy += v;
++ ny++;
++ }
++ if (lcol->loc_z.usage != 0 && rid == lcol->loc_z.report_ID) {
++ dz -= hid_get_data(pBuf, &lcol->loc_z);
++ upd = 1;
++ }
++ if (lcol->loc_w.usage != 0 && rid == lcol->loc_w.report_ID) {
++ dw += hid_get_data(pBuf, &lcol->loc_w);
++ upd = 1;
++ }
++ if (lcol->loc_p.usage != 0 && rid == lcol->loc_p.report_ID && np == 0) {
++ v = hid_get_data(pBuf, &lcol->loc_p);
++ v = xf86ScaleAxis(v, acol->pmax, acol->pmin,
++ lcol->loc_p.logical_maximum, lcol->loc_p.logical_minimum);
++ if (acol->cpmin != acol->cpmax)
++ v = xf86ScaleAxis(v, acol->pmax, acol->pmin,
++ acol->cpmax, acol->cpmin);
++ dp += v;
++ np++;
++ }
++
++ for (n = 0; n < acol->nbuttons; n++) {
++ if (lcol->loc_btn[n].usage != 0 && rid == lcol->loc_btn[n].report_ID) {
++ if (hid_get_data(pBuf, &lcol->loc_btn[n]))
++ buttons |= (1 << UMS_BUT(n));
++ upd = 1;
++ }
++ }
++ }
++ if (acol->loc_cc.usage != 0 && rid == acol->loc_cc.report_ID)
++ cc = hid_get_data(pBuf, &acol->loc_cc);
++ else
++ cc = (nx || ny) ? 1 : 0;
++ if (cc > 1)
++ buttons = (1 << UMS_BUT(1));
++ if (nx != 0 && acol->xmin != acol->xmax)
++ dx /= nx;
++ if (ny != 0 && acol->ymin != acol->ymax)
++ dy /= ny;
++ if (np != 0 && acol->pmin != acol->pmax)
++ dp /= np;
++// if (upd || nx || ny || np)
++// xf86MsgVerb(X_INFO, 3, "%d cc %d dx %d dy %d dz %d dw %d press %d buttons %02x\n",
++// nacol, cc, dx, dy, dz, dw, dp, buttons);
++ if (nx != 0 || ny != 0) {
++ if (acol->pmin != acol->pmax) {
++ xf86PostMotionEvent(acol->pInfo->dev,
++ /* is_absolute: */ TRUE,
++ /* first_valuator: */ 0,
++ /* num_valuators: */ 3,
++ dx, dy, dp);
++ } else if (acol->xmin != acol->xmax || acol->ymin != acol->ymax) {
++ xf86PostMotionEvent(acol->pInfo->dev,
++ /* is_absolute: */ TRUE,
++ /* first_valuator: */ 0,
++ /* num_valuators: */ 2,
++ dx, dy);
++ }
++ }
++ if (upd || (nx != 0) || (ny != 0)) {
++ ((MouseDevPtr)acol->pInfo->private)->PostEvent(acol->pInfo, buttons,
++ ((acol->xmin != acol->xmax) ? dx - acol->px : dx),
++ ((acol->ymin != acol->ymax) ? dy - acol->py : dy),
++ dz, dw);
++ }
++ if (nx > 0)
++ acol->px = dx;
++ if (ny > 0)
++ acol->py = dy;
+ }
+- pMse->PostEvent(pInfo, buttons, dx, dy, dz, dw);
+- return;
++ goto next;
+ }
+
+ static void
+@@ -615,14 +906,17 @@
+ usbReadInput ((InputInfoPtr) closure);
+ }
+
+-/* This function is called when the protocol is "usb". */
+ static Bool
+-usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
++usbInitFirst(InputInfoPtr pInfo)
+ {
+ MouseDevPtr pMse = pInfo->private;
+ UsbMsePtr pUsbMse;
+ report_desc_t reportDesc;
+- int i;
++ hid_data_t d;
++ hid_item_t h;
++ struct UsbMseAcol *acol;
++ struct UsbMseLcol *lcol;
++ int mdepth, rsize, *rsizep, acolused, lcolused, used;
+
+ pUsbMse = malloc(sizeof(UsbMseRec));
+ if (pUsbMse == NULL) {
+@@ -631,12 +925,7 @@
+ return FALSE;
+ }
+
+- pMse->protocol = protocol;
+- xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
+-
+- /* Collect the options, and process the common options. */
+- COLLECT_INPUT_OPTIONS(pInfo, NULL);
+- xf86ProcessCommonOptions(pInfo, pInfo->options);
++ bzero(pUsbMse, sizeof(UsbMseRec));
+
+ /* Check if the device can be opened. */
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+@@ -652,19 +941,134 @@
+ }
+ /* Get USB informations */
+ reportDesc = hid_get_report_desc(pInfo->fd);
+- /* Get packet size & iid */
+-#ifdef USB_NEW_HID
+- if (ioctl(pInfo->fd, USB_GET_REPORT_ID, &pUsbMse->iid) == -1) {
+- xf86Msg(X_ERROR, "Error ioctl USB_GET_REPORT_ID on %s : %s\n",
+- pInfo->name, strerror(errno));
+- return FALSE;
+- }
+- pUsbMse->packetSize = hid_report_size(reportDesc, hid_input,
+- pUsbMse->iid);
+-#else
+- pUsbMse->packetSize = hid_report_size(reportDesc, hid_input,
+- &pUsbMse->iid);
+-#endif
++ mdepth = 0;
++ pUsbMse->nacols = 0;
++ acol = &pUsbMse->acols[pUsbMse->nacols];
++ lcol = &acol->lcols[acol->nlcols];
++ acolused = 0;
++ lcolused = 0;
++ d = hid_start_parse(reportDesc, (1 << hid_input) |
++ (1 << hid_collection) | (1 << hid_endcollection), -1);
++ while (hid_get_item(d, &h)) {
++ switch (h.kind) {
++ case hid_collection:
++ if (mdepth != 0)
++ mdepth++;
++ else if (h.collection == 1 &&
++ (h.usage == 0x00010001 || h.usage == 0x00010002 ||
++ (h.usage >= 0x000d0001 && h.usage <= 0x000d000d))) {
++ mdepth++;
++ if (acolused) {
++ if (lcolused) {
++ acol->nlcols++;
++ lcolused = 0;
++ }
++ pUsbMse->nacols++;
++ acolused = 0;
++ acol = &pUsbMse->acols[pUsbMse->nacols];
++ lcol = &acol->lcols[acol->nlcols];
++ }
++ }
++ if (lcolused && (h.collection == 0 ||
++ h.collection == 2 || h.collection == 3)) {
++ acol->nlcols++;
++ lcolused = 0;
++ lcol = &acol->lcols[acol->nlcols];
++ }
++ break;
++ case hid_endcollection:
++ if (mdepth != 0)
++ mdepth--;
++ break;
++ case hid_input:
++ if (h.report_ID != 0)
++ pUsbMse->iid = 1;
++ rsize = pUsbMse->iid +
++ (h.pos + (h.report_size * h.report_count) + 7) / 8;
++ if ((rsizep = usbGetReportSizePtr(pUsbMse, h.report_ID)) != NULL)
++ *rsizep = max(*rsizep, rsize);
++ pUsbMse->packetSize = max(pUsbMse->packetSize, rsize);
++ if (mdepth == 0)
++ break;
++ used = 1;
++ if (h.usage == 0x00010030) { /* X */
++ lcol->loc_x = h;
++ if ((h.flags & 0x04) == 0) {
++ if (acol->xmin == acol->xmax) {
++ acol->xmin = h.logical_minimum;
++ acol->xmax = h.logical_maximum;
++ } else {
++ acol->xmin = min(acol->xmin, h.logical_minimum);
++ acol->xmax = max(acol->xmax, h.logical_maximum);
++ }
++ }
++ } else if (h.usage == 0x00010031) { /* Y */
++ lcol->loc_y = h;
++ if ((h.flags & 0x04) == 0) {
++ if (acol->ymin == acol->ymax) {
++ acol->ymin = h.logical_minimum;
++ acol->ymax = h.logical_maximum;
++ } else {
++ acol->ymin = min(acol->ymin, h.logical_minimum);
++ acol->ymax = max(acol->ymax, h.logical_maximum);
++ }
++ }
++ } else if (h.usage == 0x00010038) { /* Z */
++ lcol->loc_z = h;
++ acol->hasZ = 1;
++ } else if (h.usage == 0x000c0238) { /* W */
++ lcol->loc_w = h;
++ acol->hasW = 1;
++ } else if (h.usage == 0x000d0030) { /* Press */
++ lcol->loc_p = h;
++ if ((h.flags & 0x04) == 0) {
++ if (acol->pmin == acol->pmax) {
++ acol->pmin = h.logical_minimum;
++ acol->pmax = h.logical_maximum;
++ } else {
++ acol->pmin = min(acol->pmin, h.logical_minimum);
++ acol->pmax = max(acol->pmax, h.logical_maximum);
++ }
++ }
++ } else if (h.usage == 0x000d0032) /* In Range */
++ lcol->loc_in_range = h;
++ else if (h.usage == 0x000d0047) /* Valid */
++ lcol->loc_valid = h;
++ else if (h.usage > 0x00090000 &&
++ h.usage <= 0x00090000 + MSE_MAXBUTTONS) { /* Buttons */
++ lcol->loc_btn[(h.usage & 0xffff) - 1] = h;
++ acol->nbuttons = max(acol->nbuttons, h.usage & 0xffff);
++ } else if (h.usage == 0x000d0042) { /* Tip Switch */
++ lcol->loc_btn[0] = h;
++ acol->nbuttons = max(acol->nbuttons, 1);
++ } else if (h.usage == 0x000d0044) { /* Barrel Switch */
++ lcol->loc_btn[1] = h;
++ acol->nbuttons = max(acol->nbuttons, 2);
++ } else if (h.usage == 0x000d0045) { /* Eraser */
++ lcol->loc_btn[3] = h;
++ acol->nbuttons = max(acol->nbuttons, 4);
++ } else if (h.usage == 0x000d0046) { /* Tablet Pick */
++ lcol->loc_btn[2] = h;
++ acol->nbuttons = max(acol->nbuttons, 3);
++ } else if (h.usage == 0x000d0054) /* Contact Count */
++ acol->loc_cc = h;
++ else
++ used = 0;
++ lcolused += used;
++ acolused += used;
++ break;
++ default:
++ break;
++ }
++ }
++ if (lcolused)
++ acol->nlcols++;
++ if (acolused)
++ pUsbMse->nacols++;
++ hid_end_parse(d);
++ xf86Msg(X_DEFAULT, "%s: Found %d usable logical collections\n",
++ pInfo->name, pUsbMse->nacols);
++
+ /* Allocate buffer */
+ if (pUsbMse->packetSize <= 8) {
+ pUsbMse->buffer = pMse->protoBuf;
+@@ -674,56 +1078,129 @@
+ if (pUsbMse->buffer == NULL) {
+ xf86Msg(X_ERROR, "%s: cannot allocate buffer\n", pInfo->name);
+ free(pUsbMse);
+- free(pMse);
+ xf86CloseSerial(pInfo->fd);
+ return FALSE;
+ }
+-#ifdef USB_NEW_HID
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
+- hid_input, &pUsbMse->loc_x, pUsbMse->iid) < 0) {
+- xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name);
+- }
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
+- hid_input, &pUsbMse->loc_y, pUsbMse->iid) < 0) {
+- xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name);
+- }
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
+- hid_input, &pUsbMse->loc_z, pUsbMse->iid) < 0) {
+- }
+-#else
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X),
+- hid_input, &pUsbMse->loc_x) < 0) {
+- xf86Msg(X_WARNING, "%s: no x locator\n", pInfo->name);
+- }
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y),
+- hid_input, &pUsbMse->loc_y) < 0) {
+- xf86Msg(X_WARNING, "%s: no y locator\n", pInfo->name);
+- }
+- if (hid_locate(reportDesc, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_WHEEL),
+- hid_input, &pUsbMse->loc_z) < 0) {
+- }
+-#endif
+- /* Probe for number of buttons */
+- for (i = 1; i <= MSE_MAXBUTTONS; i++) {
+- if (!hid_locate(reportDesc, HID_USAGE2(HUP_BUTTON, i),
+- hid_input, &pUsbMse->loc_btn[i-1]
+-#ifdef USB_NEW_HID
+- , pUsbMse->iid
+-#endif
+- ))
+- break;
+- }
+- pMse->buttons = i-1;
+
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
+
+ /* Private structure */
+ pMse->mousePriv = pUsbMse;
++ return TRUE;
++}
++
++/* This function is called when the protocol is "usb". */
++static Bool
++usbPreInit(InputInfoPtr pInfo, const char *protocol, int flags)
++{
++ InputInfoPtr pMatch;
++ MouseDevPtr pMse = pInfo->private;
++ UsbMsePtr pUsbMse;
++ struct UsbMseAcol *acol;
++ char *str;
++ int i, colopt;
++
++ pMse->protocol = protocol;
++ xf86Msg(X_CONFIG, "%s: Protocol: %s\n", pInfo->name, protocol);
++
++ /* Collect the options, and process the common options. */
++ COLLECT_INPUT_OPTIONS(pInfo, NULL);
++ xf86ProcessCommonOptions(pInfo, pInfo->options);
++
++ /* Check if this HID device is already opened. */
++ for (pMatch = xf86FirstLocalDevice(); pMatch != NULL; pMatch = pMatch->next) {
++ if ((pInfo != pMatch) && strstr(pMatch->drv->driverName, "mouse")) {
++ char *dev1, *dev2;
++
++ dev1 = xf86SetStrOption(pInfo->options, "Device", NULL);
++ dev2 = xf86SetStrOption(pMatch->options, "Device", NULL);
++ if (strcmp(dev1, dev2) == 0) {
++ free(dev1);
++ free(dev2);
++ break;
++ }
++ free(dev1);
++ free(dev2);
++ }
++ }
++ if (pMatch == NULL) {
++ xf86Msg(X_DEFAULT, "%s: Opening new HID device\n", pInfo->name);
++ if (!usbInitFirst(pInfo)) {
++ free(pMse);
++ return FALSE;
++ }
++ } else {
++ pMse->mousePriv = ((MouseDevPtr)pMatch->private)->mousePriv;
++ xf86Msg(X_DEFAULT, "%s: Attaching to already opened HID device\n",
++ pInfo->name);
++ }
++ pUsbMse = pMse->mousePriv;
++
++ /* Attach to collection, respecting "Collection" option. */
++ colopt = xf86SetIntOption(pInfo->options, "Collection", 0);
++ for (i = 0; i < pUsbMse->nacols; i++) {
++ if (pUsbMse->acols[i].pInfo == NULL &&
++ (colopt == 0 || i == colopt - 1)) {
++ pUsbMse->acols[i].pInfo = pInfo;
++ break;
++ }
++ }
++ xf86Msg(colopt == 0 ? X_DEFAULT : X_CONFIG,
++ "%s: Collection: %d\n", pInfo->name,
++ i == pUsbMse->nacols ? colopt : i + 1);
++ if (i == pUsbMse->nacols) {
++ xf86Msg(X_ERROR,
++ "%s: Application collection not found or already handled\n",
++ pInfo->name);
++ free(pMse);
++ return FALSE;
++ }
++
++ acol = &pUsbMse->acols[i];
++ pMse->buttons = acol->nbuttons;
++ if (pMse->buttons == 2)
++ pMse->buttons = 3;
++ if (acol->xmin != acol->xmax || acol->ymin != acol->ymax)
++ pMse->disableXY = TRUE;
++ pMse->hasZ = acol->hasZ;
++ pMse->hasW = acol->hasW;
+
+ /* Process common mouse options (like Emulate3Buttons, etc). */
+ pMse->CommonOptions(pInfo);
+
++ /* Process "Calibration" option. */
++ str = xf86CheckStrOption(pInfo->options, "Calibration", NULL);
++ if (str != NULL && (acol->xmin != acol->xmax || acol->ymin != acol->ymax)) {
++ int j, xmin, xmax, ymin, ymax, pmin, pmax;
++
++ j = sscanf(str, "%d %d %d %d %d %d", &xmin, &xmax, &ymin, &ymax, &pmin, &pmax);
++ if (j == 4) {
++ xf86Msg(X_CONFIG, "%s: Calibration: %d %d %d %d\n",
++ pInfo->name, xmin, xmax, ymin, ymax);
++ acol->cxmin = xmin;
++ acol->cxmax = xmax;
++ acol->cymin = ymin;
++ acol->cymax = ymax;
++ } else if (j == 6) {
++ xf86Msg(X_CONFIG, "%s: Calibration: %d %d %d %d %d %d\n",
++ pInfo->name, xmin, xmax, ymin, ymax, pmin, pmax);
++ acol->cxmin = xmin;
++ acol->cxmax = xmax;
++ acol->cymin = ymin;
++ acol->cymax = ymax;
++ acol->cpmin = pmin;
++ acol->cpmax = pmax;
++ } else
++ xf86Msg(X_WARNING, "%s: Calibration: Invalid arguments\n",
++ pInfo->name);
++ free(str);
++ } else if (acol->xmin != acol->xmax || acol->ymin != acol->ymax) {
++ xf86Msg(X_DEFAULT, "%s: Calibration: %d %d %d %d %d %d\n",
++ pInfo->name, acol->xmin, acol->xmax, acol->ymin, acol->ymax,
++ acol->pmin, acol->pmax);
++ }
++
+ /* Setup the local procs. */
+ pInfo->device_control = usbMouseProc;
+ pInfo->read_input = usbReadInput;
+@@ -766,7 +1243,9 @@
p->CheckProtocol = CheckProtocol;
#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)) && defined(MOUSE_PROTO_SYSMOUSE)
p->SetupAuto = SetupAuto;
diff --git a/x11-drivers/xf86-input-mouse/files/patch-src_mouse.c b/x11-drivers/xf86-input-mouse/files/patch-src_mouse.c
index 2d363d50c7b2..27118de48943 100644
--- a/x11-drivers/xf86-input-mouse/files/patch-src_mouse.c
+++ b/x11-drivers/xf86-input-mouse/files/patch-src_mouse.c
@@ -1,5 +1,5 @@
---- src/mouse.c.orig 2012-07-27 08:10:56.000000000 +0200
-+++ src/mouse.c 2012-07-30 00:31:48.000000000 +0200
+--- src/mouse.c.orig 2012-10-08 03:40:07.000000000 +0200
++++ src/mouse.c 2013-07-03 01:04:45.398343993 +0200
@@ -280,13 +280,39 @@
pMse = pInfo->private;
@@ -135,7 +135,7 @@
protocol = MousePickProtocol(pInfo, device, protocol, &protocolID);
-@@ -2137,7 +2148,7 @@
+@@ -2136,7 +2147,7 @@
if (pMse->emulateWheel) {
/* Emulate wheel button handling */
@@ -144,7 +144,7 @@
wheelButtonMask = 0;
else
wheelButtonMask = 1 << (pMse->wheelButton - 1);
-@@ -2221,6 +2232,9 @@
+@@ -2220,6 +2231,9 @@
}
}
}
@@ -154,7 +154,7 @@
}
/* Absorb the mouse movement while the wheel button is pressed. */
-@@ -2238,7 +2252,7 @@
+@@ -2237,7 +2251,7 @@
if (pMse->emulate3ButtonsSoft && pMse->emulate3Pending && (dx || dy))
buttonTimer(pInfo);
@@ -163,7 +163,20 @@
xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
if (change) {
-@@ -2448,11 +2462,11 @@
+@@ -2349,12 +2363,10 @@
+ int dx, int dy, int dz, int dw)
+ {
+ MouseDevPtr pMse;
+- mousePrivPtr mousepriv;
+ int zbutton = 0, wbutton = 0, zbuttoncount = 0, wbuttoncount = 0;
+ int i, b, buttons = 0;
+
+ pMse = pInfo->private;
+- mousepriv = (mousePrivPtr)pMse->mousePriv;
+
+ if (pMse->protocolID == PROT_MMHIT)
+ b = reverseBits(hitachMap, truebuttons);
+@@ -2447,11 +2459,11 @@
/* Accumulate the scaled dx, dy in the private variables
fracdx,fracdy and return the integer number part */
diff --git a/x11-drivers/xf86-input-synaptics/Makefile b/x11-drivers/xf86-input-synaptics/Makefile
index 882e44bb8b80..9434c1eee5e2 100644
--- a/x11-drivers/xf86-input-synaptics/Makefile
+++ b/x11-drivers/xf86-input-synaptics/Makefile
@@ -17,7 +17,7 @@ NO_STAGE= yes
.include <bsd.port.options.mk>
USES= pathfix
-USE_XORG= x11
+USE_XORG= x11 xtst
XORG_CAT= driver
.if ${PORT_OPTIONS:MHAL}
diff --git a/x11-drivers/xf86-video-ati/Makefile b/x11-drivers/xf86-video-ati/Makefile
index 8c2c583bb91d..d5e31957aa1a 100644
--- a/x11-drivers/xf86-video-ati/Makefile
+++ b/x11-drivers/xf86-video-ati/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PORTNAME= xf86-video-ati
-PORTVERSION= 6.14.6
+PORTVERSION= ${ATI_VERSION}
CATEGORIES= x11-drivers
MAINTAINER= x11@FreeBSD.org
@@ -12,7 +12,18 @@ XORG_CAT= driver
USE_XORG= xf86driproto xineramaproto xf86miscproto glproto
MAN4= ati.4x radeon.4x
+NO_STAGE= yes
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 1000051
+ATI_VERSION= 6.14.6
CONFIGURE_ARGS+=--disable-kms
+PLIST_SUB+= OLD=""
+.else
+ATI_VERSION= 7.2.0
+CONFIGURE_ARGS+=--disable-udev
+EXTRA_PATCHES+= ${FILESDIR}/extra-src__radeon_kms.c
+PLIST_SUB+= OLD="@comment "
+.endif
-NO_STAGE= yes
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/x11-drivers/xf86-video-ati/distinfo b/x11-drivers/xf86-video-ati/distinfo
index baa6ed57a8e1..08cd56201512 100644
--- a/x11-drivers/xf86-video-ati/distinfo
+++ b/x11-drivers/xf86-video-ati/distinfo
@@ -1,2 +1,4 @@
SHA256 (xorg/driver/xf86-video-ati-6.14.6.tar.bz2) = aa5286b3e4f0187d7df14785c06dd800255d9405205dbf061da5d77df86bec36
SIZE (xorg/driver/xf86-video-ati-6.14.6.tar.bz2) = 1139495
+SHA256 (xorg/driver/xf86-video-ati-7.2.0.tar.bz2) = f30f5efdc8d7d18d06eda7ef2f91a8b7290f1cfbf6ff26362cd47ab8969daec4
+SIZE (xorg/driver/xf86-video-ati-7.2.0.tar.bz2) = 824613
diff --git a/x11-drivers/xf86-video-ati/files/extra-src__radeon_kms.c b/x11-drivers/xf86-video-ati/files/extra-src__radeon_kms.c
new file mode 100644
index 000000000000..c8ed5680a9ef
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/files/extra-src__radeon_kms.c
@@ -0,0 +1,20 @@
+--- src/radeon_kms.c.orig 2013-08-07 10:44:09.000000000 +0200
++++ src/radeon_kms.c 2013-08-31 01:20:44.370468797 +0200
+@@ -270,7 +270,7 @@
+ radeon_dirty_update(ScreenPtr screen)
+ {
+ RegionPtr region;
+- PixmapDirtyUpdatePtr ent;
++ PixmapDirtyUpdatePtr ent = NULL;
+
+ if (xorg_list_is_empty(&screen->pixmap_dirty_list))
+ return;
+@@ -606,7 +606,7 @@
+ dev->domain, dev->bus, dev->dev, dev->func);
+ #endif
+
+- info->dri2.drm_fd = drmOpen("radeon", busid);
++ info->dri2.drm_fd = drmOpen("radeonkms", busid);
+ if (info->dri2.drm_fd == -1) {
+
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
diff --git a/x11-drivers/xf86-video-ati/files/patch-src__radeon_dri2.c b/x11-drivers/xf86-video-ati/files/patch-src__radeon_dri2.c
new file mode 100644
index 000000000000..3de34a1b60ae
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/files/patch-src__radeon_dri2.c
@@ -0,0 +1,11 @@
+--- src/radeon_dri2.c.orig 2013-02-22 19:31:34.000000000 +0000
++++ src/radeon_dri2.c 2013-02-22 19:31:47.000000000 +0000
+@@ -578,7 +578,7 @@
+ radeon_dri2_client_state_changed(CallbackListPtr *ClientStateCallback, pointer data, pointer calldata)
+ {
+ DRI2ClientEventsPtr pClientEventsPriv;
+- DRI2FrameEventPtr ref;
++ DRI2FrameEventPtr ref = NULL;
+ NewClientInfoRec *clientinfo = calldata;
+ ClientPtr pClient = clientinfo->client;
+ pClientEventsPriv = GetDRI2ClientEvents(pClient);
diff --git a/x11-drivers/xf86-video-ati/pkg-plist b/x11-drivers/xf86-video-ati/pkg-plist
index 52b142182bbd..1c0799ff6e61 100644
--- a/x11-drivers/xf86-video-ati/pkg-plist
+++ b/x11-drivers/xf86-video-ati/pkg-plist
@@ -2,13 +2,13 @@ lib/xorg/modules/drivers/ati_drv.la
lib/xorg/modules/drivers/ati_drv.so
lib/xorg/modules/drivers/radeon_drv.la
lib/xorg/modules/drivers/radeon_drv.so
-lib/xorg/modules/multimedia/theatre200_drv.la
-lib/xorg/modules/multimedia/theatre200_drv.so
-lib/xorg/modules/multimedia/theatre_detect_drv.la
-lib/xorg/modules/multimedia/theatre_detect_drv.so
-lib/xorg/modules/multimedia/theatre_drv.la
-lib/xorg/modules/multimedia/theatre_drv.so
+%%OLD%%lib/xorg/modules/multimedia/theatre200_drv.la
+%%OLD%%lib/xorg/modules/multimedia/theatre200_drv.so
+%%OLD%%lib/xorg/modules/multimedia/theatre_detect_drv.la
+%%OLD%%lib/xorg/modules/multimedia/theatre_detect_drv.so
+%%OLD%%lib/xorg/modules/multimedia/theatre_drv.la
+%%OLD%%lib/xorg/modules/multimedia/theatre_drv.so
@dirrmtry lib/xorg/modules/drivers
-@dirrmtry lib/xorg/modules/multimedia
+%%OLD%%@dirrmtry lib/xorg/modules/multimedia
@dirrmtry lib/xorg/modules
@dirrmtry lib/xorg
diff --git a/x11-drivers/xf86-video-fbdev/Makefile b/x11-drivers/xf86-video-fbdev/Makefile
index fee856eee920..3cc799f694ae 100644
--- a/x11-drivers/xf86-video-fbdev/Makefile
+++ b/x11-drivers/xf86-video-fbdev/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PORTNAME= xf86-video-fbdev
-PORTVERSION= 0.4.3
+PORTVERSION= 0.4.4
PORTREVISION= 1
CATEGORIES= x11-drivers
diff --git a/x11-drivers/xf86-video-fbdev/distinfo b/x11-drivers/xf86-video-fbdev/distinfo
index 603c5cede855..cfb76539df1f 100644
--- a/x11-drivers/xf86-video-fbdev/distinfo
+++ b/x11-drivers/xf86-video-fbdev/distinfo
@@ -1,2 +1,2 @@
-SHA256 (xorg/driver/xf86-video-fbdev-0.4.3.tar.bz2) = ff7b037ad110040a4e2db5c84e9741125dbbaf3a08107db47760f3e11f9c4831
-SIZE (xorg/driver/xf86-video-fbdev-0.4.3.tar.bz2) = 289056
+SHA256 (xorg/driver/xf86-video-fbdev-0.4.4.tar.bz2) = 9dd4b326498223abbfdf786089a46ea3db4fa6bbd341308eb48a9e00bc3fd51b
+SIZE (xorg/driver/xf86-video-fbdev-0.4.4.tar.bz2) = 293545
diff --git a/x11-drivers/xf86-video-intel/Makefile b/x11-drivers/xf86-video-intel/Makefile
index e3675aa1d708..f34c93f32e26 100644
--- a/x11-drivers/xf86-video-intel/Makefile
+++ b/x11-drivers/xf86-video-intel/Makefile
@@ -29,20 +29,20 @@ NO_STAGE= yes
.include <bsd.port.options.mk>
.if defined(WITH_NEW_XORG)
-INTEL_VERSION= 2.21.9
+INTEL_VERSION= 2.21.15
INTEL_REVISION= 0
+CONFIGURE_ENV+= xorg_cv_cc_flag__Wno_maybe_uninitialized=no
CONFIGURE_ARGS+= --enable-sna
MAKE_JOBS_UNSAFE=yes
PLIST_SUB+= OLD="@comment "
-EXTRA_PATCHES+= ${PATCHDIR}/extra-clang \
- ${PATCHDIR}/extra-src_sna_compiler.h \
+EXTRA_PATCHES+= ${PATCHDIR}/extra-src__sna__sna_threads.c \
${PATCHDIR}/extra-src_sna_kgem.c \
- ${PATCHDIR}/extra-src__sna__sna_threads.c \
+ ${PATCHDIR}/extra-clang \
${PATCHDIR}/extra-i915kms
LIB_DEPENDS+= xcb-util:${PORTSDIR}/x11/xcb-util
.else
INTEL_VERSION= 2.7.1
-INTEL_REVISION= 4
+INTEL_REVISION= 5
PLIST_SUB+= OLD=""
EXTRA_PATCHES+= ${PATCHDIR}/extra-src_ch7017_ch7017.c \
diff --git a/x11-drivers/xf86-video-intel/distinfo b/x11-drivers/xf86-video-intel/distinfo
index 79dca8e997e0..e1360d7a8ea0 100644
--- a/x11-drivers/xf86-video-intel/distinfo
+++ b/x11-drivers/xf86-video-intel/distinfo
@@ -1,4 +1,4 @@
SHA256 (xorg/driver/xf86-video-intel-2.7.1.tar.bz2) = 255c0d54249cc0132f743254a43c21fac695fab2139c8ed96a07cf3c628e5f42
SIZE (xorg/driver/xf86-video-intel-2.7.1.tar.bz2) = 780625
-SHA256 (xorg/driver/xf86-video-intel-2.21.9.tar.bz2) = 1359cbc9e494a284faa52d1db83e7388cb8ab590b660e29e78e6e7f5ee7ff189
-SIZE (xorg/driver/xf86-video-intel-2.21.9.tar.bz2) = 1735037
+SHA256 (xorg/driver/xf86-video-intel-2.21.15.tar.bz2) = 7d5a140f82a72fd1cbc8a664d66c3d4eca47ee240ca4927b8a98d7af6f65d6fc
+SIZE (xorg/driver/xf86-video-intel-2.21.15.tar.bz2) = 1977431
diff --git a/x11-drivers/xf86-video-intel/files/extra-clang b/x11-drivers/xf86-video-intel/files/extra-clang
index bb499458d41e..924f27d48cef 100644
--- a/x11-drivers/xf86-video-intel/files/extra-clang
+++ b/x11-drivers/xf86-video-intel/files/extra-clang
@@ -1,27 +1,15 @@
---- src/intel_display.c.orig 2012-12-11 20:33:06.000000000 +0100
-+++ src/intel_display.c 2012-12-11 20:33:45.000000000 +0100
-@@ -1691,7 +1691,7 @@
- static drmModeEncoderPtr
- intel_get_kencoder(struct intel_mode *mode, int num)
+--- src/sna/sna_cpu.c.orig 2013-08-14 12:04:40.231041285 +0200
++++ src/sna/sna_cpu.c 2013-08-14 12:05:51.237030719 +0200
+@@ -41,6 +41,7 @@
{
-- struct intel_output *iterator;
-+ struct intel_output *iterator = NULL;
- int id = mode->mode_res->encoders[num];
+ unsigned max = __get_cpuid_max(BASIC_CPUID, NULL);
+ unsigned int eax, ebx, ecx, edx;
++ eax = ebx = ecx = edx = 0;
+ unsigned features = 0;
+ unsigned extra = 0;
- list_for_each_entry(iterator, &mode->outputs, link)
---- src/intel_batchbuffer.c.orig 2012-12-11 20:34:55.000000000 +0100
-+++ src/intel_batchbuffer.c 2012-12-11 20:35:19.000000000 +0100
-@@ -119,7 +119,7 @@
- static void intel_batch_do_flush(ScrnInfoPtr scrn)
- {
- intel_screen_private *intel = intel_get_screen_private(scrn);
-- struct intel_pixmap *priv;
-+ struct intel_pixmap *priv = NULL;
-
- list_for_each_entry(priv, &intel->batch_pixmaps, batch)
- priv->dirty = 0;
---- src/sna/sna_damage.c.orig 2012-12-11 20:41:38.000000000 +0100
-+++ src/sna/sna_damage.c 2012-12-11 20:42:23.000000000 +0100
+--- src/sna/sna_damage.c.orig 2013-08-14 12:06:26.381036854 +0200
++++ src/sna/sna_damage.c 2013-08-14 12:07:23.684023065 +0200
@@ -410,7 +410,7 @@
int n, nboxes;
BoxPtr boxes, free_boxes = NULL;
@@ -31,7 +19,7 @@
assert(damage->mode != DAMAGE_ALL);
assert(damage->dirty);
-@@ -1671,7 +1671,7 @@
+@@ -1709,7 +1709,7 @@
{
int n, nboxes;
BoxPtr boxes;
@@ -40,8 +28,30 @@
RegionCopy(r, &damage->region);
if (!damage->dirty)
---- uxa/uxa-accel.c.orig 2012-12-11 20:50:56.000000000 +0100
-+++ uxa/uxa-accel.c 2012-12-11 20:51:14.000000000 +0100
+--- src/uxa/intel_batchbuffer.c.orig 2013-08-14 12:08:14.323028320 +0200
++++ src/uxa/intel_batchbuffer.c 2013-08-14 12:08:37.202016923 +0200
+@@ -141,7 +141,7 @@
+ static void intel_batch_do_flush(ScrnInfoPtr scrn)
+ {
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+- struct intel_pixmap *priv;
++ struct intel_pixmap *priv = NULL;
+
+ list_for_each_entry(priv, &intel->batch_pixmaps, batch)
+ priv->dirty = 0;
+--- src/uxa/intel_display.c.orig 2013-08-14 12:09:25.802015629 +0200
++++ src/uxa/intel_display.c 2013-08-14 12:09:51.034009844 +0200
+@@ -1753,7 +1753,7 @@
+ static drmModeEncoderPtr
+ intel_get_kencoder(struct intel_mode *mode, int num)
+ {
+- struct intel_output *iterator;
++ struct intel_output *iterator = NULL;
+ int id = mode->mode_res->encoders[num];
+
+ list_for_each_entry(iterator, &mode->outputs, link)
+--- src/uxa/uxa-accel.c.orig 2013-08-14 12:02:11.898048975 +0200
++++ src/uxa/uxa-accel.c 2013-08-14 12:03:39.336042139 +0200
@@ -944,7 +944,7 @@
if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
diff --git a/x11-drivers/xf86-video-intel/files/extra-i915kms b/x11-drivers/xf86-video-intel/files/extra-i915kms
index c900909f7747..b5d43c6deecd 100644
--- a/x11-drivers/xf86-video-intel/files/extra-i915kms
+++ b/x11-drivers/xf86-video-intel/files/extra-i915kms
@@ -1,13 +1,13 @@
---- src/intel_module.c.orig 2012-09-27 23:31:20.000000000 +0300
-+++ src/intel_module.c 2012-11-02 17:32:00.819723398 +0200
-@@ -393,8 +393,8 @@
- dev->domain, dev->bus, dev->dev, dev->func);
+--- src/intel_device.c.orig 2013-06-30 16:03:51.000000000 +0200
++++ src/intel_device.c 2013-07-02 14:08:34.903060688 +0200
+@@ -94,8 +94,8 @@
+ pci->domain, pci->bus, pci->dev, pci->func);
- ret = drmCheckModesettingSupported(id);
-- if (ret) {
-- if (xf86LoadKernelModule("i915"))
-+ if (ret || 1) {
-+ if (xf86LoadKernelModule("i915kms"))
- ret = drmCheckModesettingSupported(id);
- if (ret)
- return FALSE;
+ ret = drmCheckModesettingSupported(id);
+- if (ret) {
+- if (xf86LoadKernelModule("i915"))
++ if (ret || 1) {
++ if (xf86LoadKernelModule("i915kms"))
+ ret = drmCheckModesettingSupported(id);
+ if (ret)
+ return -1;
diff --git a/x11-drivers/xf86-video-intel/files/extra-src_sna_compiler.h b/x11-drivers/xf86-video-intel/files/extra-src_sna_compiler.h
deleted file mode 100644
index 47131740bc6c..000000000000
--- a/x11-drivers/xf86-video-intel/files/extra-src_sna_compiler.h
+++ /dev/null
@@ -1,18 +0,0 @@
---- src/sna/compiler.h.orig 2013-03-12 12:48:29.745101779 +0100
-+++ src/sna/compiler.h 2013-03-12 12:48:52.857102997 +0100
-@@ -37,7 +37,6 @@
- #define must_check __attribute__((warn_unused_result))
- #define constant __attribute__((const))
- #define pure __attribute__((pure))
--#define __packed__ __attribute__((__packed__))
- #define flatten __attribute__((flatten))
- #else
- #define likely(expr) (expr)
-@@ -48,7 +47,6 @@
- #define must_check
- #define constant
- #define pure
--#define __packed__
- #define flatten
- #endif
-
diff --git a/x11-drivers/xf86-video-intel/files/extra-src_sna_kgem.c b/x11-drivers/xf86-video-intel/files/extra-src_sna_kgem.c
index 9771d08562b3..39f3729e83be 100644
--- a/x11-drivers/xf86-video-intel/files/extra-src_sna_kgem.c
+++ b/x11-drivers/xf86-video-intel/files/extra-src_sna_kgem.c
@@ -1,18 +1,14 @@
---- src/sna/kgem.c.orig 2013-03-11 11:19:02.000000000 +0100
-+++ src/sna/kgem.c 2013-03-12 12:56:49.452065668 +0100
-@@ -658,7 +658,11 @@
- if (file) {
- size_t len = 0;
- char *line = NULL;
-+#ifdef __GLIBC__
- while (getline(&line, &len, file) != -1) {
-+#else
-+ while ((line = fgetln(file, &len)) != (char *) NULL) {
-+#endif
- int mb;
- if (sscanf(line, "cache size : %d KB", &mb) == 1) {
- /* Paranoid check against gargantuan caches */
-@@ -1666,7 +1670,8 @@
+--- src/sna/kgem.c.orig 2013-08-04 11:10:59.000000000 +0200
++++ src/sna/kgem.c 2013-08-14 11:59:14.787060294 +0200
+@@ -25,6 +25,7 @@
+ *
+ */
+
++#define _WITH_GETLINE
+ #ifdef HAVE_CONFIG_H
+ #include "config.h"
+ #endif
+@@ -1890,7 +1891,8 @@
static struct kgem_bo *
search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
{
@@ -22,7 +18,7 @@
DBG(("%s: num_pages=%d, flags=%x\n", __FUNCTION__, num_pages, flags));
-@@ -1868,7 +1873,8 @@
+@@ -2104,7 +2106,8 @@
static bool kgem_retire__flushing(struct kgem *kgem)
{
@@ -32,7 +28,7 @@
bool retired = false;
list_for_each_entry_safe(bo, next, &kgem->flushing, request) {
-@@ -2073,7 +2079,8 @@
+@@ -2309,7 +2312,8 @@
static void kgem_commit(struct kgem *kgem)
{
struct kgem_request *rq = kgem->next_request;
@@ -42,7 +38,7 @@
list_for_each_entry_safe(bo, next, &rq->buffers, request) {
assert(next->request.prev == &bo->request);
-@@ -2154,7 +2161,8 @@
+@@ -2390,7 +2394,8 @@
static void kgem_finish_buffers(struct kgem *kgem)
{
@@ -51,8 +47,8 @@
+ struct kgem_buffer *next;
list_for_each_entry_safe(bo, next, &kgem->batch_buffers, base.list) {
- DBG(("%s: buffer handle=%d, used=%d, exec?=%d, write=%d, mmapped=%d\n",
-@@ -2963,7 +2971,8 @@
+ DBG(("%s: buffer handle=%d, used=%d, exec?=%d, write=%d, mmapped=%s\n",
+@@ -3252,7 +3257,8 @@
static struct kgem_bo *
search_linear_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
{
@@ -62,7 +58,7 @@
bool use_active = (flags & CREATE_INACTIVE) == 0;
struct list *cache;
-@@ -3521,7 +3530,7 @@
+@@ -3855,7 +3861,7 @@
uint32_t flags)
{
struct list *cache;
@@ -71,7 +67,7 @@
uint32_t pitch, tiled_height, size;
uint32_t handle;
int i, bucket, retry;
-@@ -4834,7 +4843,7 @@
+@@ -5302,7 +5308,7 @@
void kgem_clear_dirty(struct kgem *kgem)
{
struct list * const buffers = &kgem->next_request->buffers;
@@ -79,8 +75,8 @@
+ struct kgem_bo *bo = NULL;
list_for_each_entry(bo, buffers, request) {
- if (!bo->dirty)
-@@ -5072,7 +5081,7 @@
+ if (!bo->gpu_dirty)
+@@ -5578,7 +5584,7 @@
uint32_t size, uint32_t flags,
void **ret)
{
diff --git a/x11-drivers/xf86-video-vesa/Makefile b/x11-drivers/xf86-video-vesa/Makefile
index 97ef2045de98..3b80a5c8e154 100644
--- a/x11-drivers/xf86-video-vesa/Makefile
+++ b/x11-drivers/xf86-video-vesa/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PORTNAME= xf86-video-vesa
-PORTVERSION= 2.3.2
+PORTVERSION= 2.3.3
CATEGORIES= x11-drivers
MAINTAINER= x11@FreeBSD.org
diff --git a/x11-drivers/xf86-video-vesa/distinfo b/x11-drivers/xf86-video-vesa/distinfo
index f9dbf13a418e..f973eae2fb52 100644
--- a/x11-drivers/xf86-video-vesa/distinfo
+++ b/x11-drivers/xf86-video-vesa/distinfo
@@ -1,2 +1,2 @@
-SHA256 (xorg/driver/xf86-video-vesa-2.3.2.tar.bz2) = 144a17ffae3c86603ddc4ae33521a52813498ee1f8213faa662dc4a8d6490ee3
-SIZE (xorg/driver/xf86-video-vesa-2.3.2.tar.bz2) = 298186
+SHA256 (xorg/driver/xf86-video-vesa-2.3.3.tar.bz2) = ce8b75e5a40e9dae76f2ac9e2880f7f73a848653ca2eed5880f52dc2c0d3aef8
+SIZE (xorg/driver/xf86-video-vesa-2.3.3.tar.bz2) = 300571
diff --git a/x11-drivers/xorg-drivers/Makefile b/x11-drivers/xorg-drivers/Makefile
index 4f7071eb029d..a8f0921183f4 100644
--- a/x11-drivers/xorg-drivers/Makefile
+++ b/x11-drivers/xorg-drivers/Makefile
@@ -10,7 +10,7 @@ EXTRACT_ONLY= # none
MAINTAINER= x11@FreeBSD.org
COMMENT= X.org drivers meta-port
-.MAKE.FreeBSD_UL= yes
+.MAKE.FreeBSD_UL= yes
VIDEODIR= ${PREFIX}/lib/xorg/modules/drivers
INPUTDIR= ${PREFIX}/lib/xorg/modules/input