angstrom: prefer udev 171
[openembedded.git] / recipes / xorg-xserver / xserver-xorg-1.10.1.902 / randr-support.patch
blob258deb3eb46670c9d8f40ea89b1383fcab8924ff
1 diff -ur xorg-server-1.10.1.901//hw/xfree86/common/xf86Xinput.c git/xorg-server-1.10.1.901//hw/xfree86/common/xf86Xinput.c
2 --- xorg-server-1.10.1.901//hw/xfree86/common/xf86Xinput.c 2011-04-28 09:25:00.000000000 +0200
3 +++ git/xorg-server-1.10.1.901//hw/xfree86/common/xf86Xinput.c 2011-05-19 00:31:01.178439874 +0200
4 @@ -99,6 +99,8 @@
5 return; \
8 +#define RR_Rotate_All (RR_Rotate_0|RR_Rotate_90|RR_Rotate_180|RR_Rotate_270)
10 EventListPtr xf86Events = NULL;
12 static int
13 @@ -1408,4 +1410,73 @@
14 EnableDevice(dev, TRUE);
17 +/* Taken from evdev-properties.h. */
18 +#define EVDEV_PROP_SWAP_AXES "Evdev Axes Swap"
19 +#define EVDEV_PROP_INVERT_AXES "Evdev Axis Inversion"
21 +/* This is a hack until we get device -> CRTC association. */
22 +void
23 +xf86InputRotationNotify(Rotation rotation)
25 + DeviceIntPtr dev;
26 + //LocalDevicePtr local;
27 + int ret;
28 + int swap_axes = 0;
29 + CARD8 invert[2] = { 0, 0 };
30 + static Atom prop_swap = 0, prop_invert = 0;
31 + static int atom_generation = -1;
33 + if (atom_generation != serverGeneration) {
34 + prop_swap = 0;
35 + prop_invert = 0;
36 + }
38 + switch (rotation & RR_Rotate_All) {
39 + case RR_Rotate_0:
40 + swap_axes = 1;
41 + invert[0] = 0;
42 + invert[1] = 0;
43 + break;
44 + case RR_Rotate_90:
45 + swap_axes = 0;
46 + invert[0] = 0;
47 + invert[1] = 1;
48 + break;
49 + case RR_Rotate_180:
50 + swap_axes = 1;
51 + invert[0] = 1;
52 + invert[1] = 1;
53 + break;
54 + case RR_Rotate_270:
55 + swap_axes = 0;
56 + invert[0] = 1;
57 + invert[1] = 0;
58 + break;
59 + }
61 + if (!prop_swap)
62 + prop_swap = MakeAtom(EVDEV_PROP_SWAP_AXES,
63 + strlen(EVDEV_PROP_SWAP_AXES), TRUE);
64 + if (!prop_invert)
65 + prop_invert = MakeAtom(EVDEV_PROP_INVERT_AXES,
66 + strlen(EVDEV_PROP_INVERT_AXES), TRUE);
68 + for (dev = inputInfo.devices; dev; dev = dev->next) {
69 + //local = dev->public.devicePrivate;
70 + ret = XIChangeDeviceProperty(dev, prop_swap, XA_INTEGER, 8,
71 + PropModeReplace, 1, &swap_axes, FALSE);
72 + if (ret != Success) {
73 + xf86Msg(X_ERROR, "Changing swap_xy property failed!\n");
74 + continue;
75 + }
76 + ret = XIChangeDeviceProperty(dev, prop_invert, XA_INTEGER, 8,
77 + PropModeReplace, 2, invert, FALSE);
78 + if (ret != Success) {
79 + xf86Msg(X_ERROR, "Changing invert property failed!\n");
80 + continue;
81 + }
82 + }
86 /* end of xf86Xinput.c */
87 diff -ur xorg-server-1.10.1.901//hw/xfree86/modes/xf86Crtc.c git/xorg-server-1.10.1.901//hw/xfree86/modes/xf86Crtc.c
88 --- xorg-server-1.10.1.901//hw/xfree86/modes/xf86Crtc.c 2011-04-28 09:25:00.000000000 +0200
89 +++ git/xorg-server-1.10.1.901//hw/xfree86/modes/xf86Crtc.c 2011-05-19 00:23:16.244383998 +0200
90 @@ -389,6 +389,12 @@
91 if (didLock)
92 crtc->funcs->unlock (crtc);
94 + /*
95 + * Rotate Touchscreen
96 + */
97 + xf86InputRotationNotify(crtc->rotation);
100 return ret;
103 diff -ur xorg-server-1.10.1.901//randr/rrscreen.c git/xorg-server-1.10.1.901//randr/rrscreen.c
104 --- xorg-server-1.10.1.901//randr/rrscreen.c 2011-02-25 04:27:32.000000000 +0100
105 +++ git/xorg-server-1.10.1.901//randr/rrscreen.c 2011-05-18 23:19:39.007760004 +0200
106 @@ -910,11 +910,6 @@
108 width = mode->mode.width;
109 height = mode->mode.height;
110 - if (rotation & (RR_Rotate_90|RR_Rotate_270))
112 - width = mode->mode.height;
113 - height = mode->mode.width;
116 if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) {
117 client->errorValue = width;
118 @@ -926,7 +921,12 @@
119 free(pData);
120 return BadValue;
123 + if (rotation & (RR_Rotate_90|RR_Rotate_270))
125 + width = mode->mode.height;
126 + height = mode->mode.width;
129 if (width != pScreen->width || height != pScreen->height)
131 int c;