mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 20:07:14 +08:00
319 lines
11 KiB
Diff
319 lines
11 KiB
Diff
From 613e0e9ef74c4542ed458200165adbcdfdf3cd17 Mon Sep 17 00:00:00 2001
|
|
From: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Date: Wed, 13 Apr 2011 18:51:30 +0000
|
|
Subject: Send events that were missing from RRSelectInput
|
|
|
|
The RANDR spec (randrproto.txt) specifies that RRSelectInput will send out
|
|
events corresponding to the event mask, if there have been changes to
|
|
CRTCs or outputs. Only screen events were being generated, however.
|
|
|
|
Fixes http://bugs.freedesktop.org/21760
|
|
|
|
Signed-off-by: Federico Mena Quintero <federico@novell.com>
|
|
Reviewd-by: Keith Packard <keithp@keithp.com>
|
|
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
(cherry picked from commit b2997431fd426ab318bc5dfd2cd43956d733ebec)
|
|
---
|
|
diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c
|
|
index ac4d2ac..2135504 100644
|
|
--- a/randr/rrdispatch.c
|
|
+++ b/randr/rrdispatch.c
|
|
@@ -146,7 +146,7 @@ ProcRRSelectInput (ClientPtr client)
|
|
/*
|
|
* Now see if the client needs an event
|
|
*/
|
|
- if (pScrPriv && (pRREvent->mask & RRScreenChangeNotifyMask))
|
|
+ if (pScrPriv)
|
|
{
|
|
pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum];
|
|
if (CompareTimeStamps (pTimes->setTime,
|
|
@@ -154,7 +154,35 @@ ProcRRSelectInput (ClientPtr client)
|
|
CompareTimeStamps (pTimes->configTime,
|
|
pScrPriv->lastConfigTime) != 0)
|
|
{
|
|
- RRDeliverScreenEvent (client, pWin, pScreen);
|
|
+ if (pRREvent->mask & RRScreenChangeNotifyMask)
|
|
+ {
|
|
+ RRDeliverScreenEvent (client, pWin, pScreen);
|
|
+ }
|
|
+
|
|
+ if (pRREvent->mask & RRCrtcChangeNotifyMask)
|
|
+ {
|
|
+ int i;
|
|
+
|
|
+ for (i = 0; i < pScrPriv->numCrtcs; i++)
|
|
+ {
|
|
+ RRDeliverCrtcEvent (client, pWin, pScrPriv->crtcs[i]);
|
|
+ }
|
|
+ }
|
|
+
|
|
+ if (pRREvent->mask & RROutputChangeNotifyMask)
|
|
+ {
|
|
+ int i;
|
|
+
|
|
+ for (i = 0; i < pScrPriv->numOutputs; i++)
|
|
+ {
|
|
+ RRDeliverOutputEvent (client, pWin, pScrPriv->outputs[i]);
|
|
+ }
|
|
+ }
|
|
+
|
|
+ /* We don't check for RROutputPropertyNotifyMask, as randrproto.txt doesn't
|
|
+ * say if there ought to be notifications of changes to output properties
|
|
+ * if those changes occurred before the time RRSelectInput is called.
|
|
+ */
|
|
}
|
|
}
|
|
}
|
|
--
|
|
cgit v0.8.3-6-g21f6
|
|
From 50b9d3142ff90af2f7fa35b7b1bf9e5a07723dbd Mon Sep 17 00:00:00 2001
|
|
From: Aaron Plattner <aplattner@nvidia.com>
|
|
Date: Tue, 24 May 2011 23:02:42 +0000
|
|
Subject: randr: check rotated virtual size limits correctly
|
|
|
|
Commit d1107918d4626268803b54033a07405122278e7f introduced checks to
|
|
the RandR path that cause RRSetScreenConfig requests to fail if the
|
|
size is too large. Unfortunately, when RandR 1.1 rotation is enabled
|
|
it compares the rotated screen dimensions to the unrotated limits,
|
|
which causes 90- and 270-degree rotation to fail unless your screen
|
|
happens to be square:
|
|
|
|
X Error of failed request: BadValue (integer parameter out of range for operation)
|
|
Major opcode of failed request: 153 (RANDR)
|
|
Minor opcode of failed request: 2 (RRSetScreenConfig)
|
|
Value in failed request: 0x780
|
|
Serial number of failed request: 14
|
|
Current serial number in output stream: 14
|
|
|
|
Fix this by moving the check above the code that swaps the dimensions
|
|
based on the rotation.
|
|
|
|
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
|
Tested-by: Robert Hooker <robert.hooker@canonical.com>
|
|
Tested-by: Kent Baxley <kent.baxley@canonical.com>
|
|
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
(cherry picked from commit b6c7b9b2f39e970cedb6bc1e073f901e28cb0fa3)
|
|
---
|
|
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
|
|
index 1bc1a9e..da6d48d 100644
|
|
--- a/randr/rrscreen.c
|
|
+++ b/randr/rrscreen.c
|
|
@@ -910,12 +910,6 @@ ProcRRSetScreenConfig (ClientPtr client)
|
|
*/
|
|
width = mode->mode.width;
|
|
height = mode->mode.height;
|
|
- if (rotation & (RR_Rotate_90|RR_Rotate_270))
|
|
- {
|
|
- width = mode->mode.height;
|
|
- height = mode->mode.width;
|
|
- }
|
|
-
|
|
if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) {
|
|
client->errorValue = width;
|
|
free(pData);
|
|
@@ -927,6 +921,12 @@ ProcRRSetScreenConfig (ClientPtr client)
|
|
return BadValue;
|
|
}
|
|
|
|
+ if (rotation & (RR_Rotate_90|RR_Rotate_270))
|
|
+ {
|
|
+ width = mode->mode.height;
|
|
+ height = mode->mode.width;
|
|
+ }
|
|
+
|
|
if (width != pScreen->width || height != pScreen->height)
|
|
{
|
|
int c;
|
|
--
|
|
cgit v0.8.3-6-g21f6
|
|
From 4bfb22e7667c4cd55da5e7a31af29ce5769ecc65 Mon Sep 17 00:00:00 2001
|
|
From: Aaron Plattner <aplattner@nvidia.com>
|
|
Date: Mon, 18 Apr 2011 15:23:48 +0000
|
|
Subject: linux: Retry VT ioctls while errno == EINTR
|
|
|
|
When the smart scheduler is enabled, the VT ioctls (particularly
|
|
VT_WAITACTIVE) can be interrupted by the smart scheduler's SIGALRMs.
|
|
Previously, this caused the server to immediately continue on to
|
|
ScreenInit, almost certainly causing a crash or failure because the X
|
|
server that owned the VT hadn't finished cleaning up. As of commit
|
|
7ee965a300c9eddcc1acacf9414cfe3e589222a8, it causes a FatalError
|
|
instead.
|
|
|
|
Retrying the ioctl as long as it fails with errno == EINTR fixes the
|
|
problem and allows server regenerations to trigger VT switches that
|
|
actually succeed.
|
|
|
|
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
|
|
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Reviewed-by: Cyril Brulebois <kibi@debian.org>
|
|
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
(cherry picked from commit 88c4622b594a1725d0cee86bc82ad640d241c520)
|
|
---
|
|
diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c
|
|
index 9c71a42..77dfb2f 100644
|
|
--- a/hw/xfree86/os-support/linux/lnx_init.c
|
|
+++ b/hw/xfree86/os-support/linux/lnx_init.c
|
|
@@ -62,17 +62,21 @@ drain_console(int fd, void *closure)
|
|
static void
|
|
switch_to(int vt, const char *from)
|
|
{
|
|
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt) < 0)
|
|
- FatalError("%s: VT_ACTIVATE failed: %s\n", from, strerror(errno));
|
|
+ int ret;
|
|
|
|
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt) < 0)
|
|
- FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno));
|
|
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt));
|
|
+ if (ret < 0)
|
|
+ FatalError("%s: VT_ACTIVATE failed: %s\n", from, strerror(errno));
|
|
+
|
|
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt));
|
|
+ if (ret < 0)
|
|
+ FatalError("%s: VT_WAITACTIVE failed: %s\n", from, strerror(errno));
|
|
}
|
|
|
|
void
|
|
xf86OpenConsole(void)
|
|
{
|
|
- int i, fd = -1;
|
|
+ int i, fd = -1, ret;
|
|
struct vt_mode VT;
|
|
struct vt_stat vts;
|
|
MessageType from = X_PROBED;
|
|
@@ -107,17 +111,19 @@ xf86OpenConsole(void)
|
|
|
|
if (ShareVTs)
|
|
{
|
|
- if (ioctl(fd, VT_GETSTATE, &vts) == 0)
|
|
- xf86Info.vtno = vts.v_active;
|
|
- else
|
|
- FatalError("xf86OpenConsole: Cannot find the current"
|
|
- " VT (%s)\n", strerror(errno));
|
|
+ SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts));
|
|
+ if (ret < 0)
|
|
+ FatalError("xf86OpenConsole: Cannot find the current"
|
|
+ " VT (%s)\n", strerror(errno));
|
|
+ xf86Info.vtno = vts.v_active;
|
|
} else {
|
|
- if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
|
|
- (xf86Info.vtno == -1))
|
|
- FatalError("xf86OpenConsole: Cannot find a free VT: %s\n",
|
|
- strerror(errno));
|
|
- }
|
|
+ SYSCALL(ret = ioctl(fd, VT_OPENQRY, &xf86Info.vtno));
|
|
+ if (ret < 0)
|
|
+ FatalError("xf86OpenConsole: Cannot find a free VT: "
|
|
+ "%s\n", strerror(errno));
|
|
+ if (xf86Info.vtno == -1)
|
|
+ FatalError("xf86OpenConsole: Cannot find a free VT\n");
|
|
+ }
|
|
close(fd);
|
|
}
|
|
|
|
@@ -159,7 +165,8 @@ xf86OpenConsole(void)
|
|
* Linux doesn't switch to an active vt after the last close of a vt,
|
|
* so we do this ourselves by remembering which is active now.
|
|
*/
|
|
- if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &vts) < 0)
|
|
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETSTATE, &vts));
|
|
+ if (ret < 0)
|
|
xf86Msg(X_WARNING,"xf86OpenConsole: VT_GETSTATE failed: %s\n",
|
|
strerror(errno));
|
|
else
|
|
@@ -171,7 +178,7 @@ xf86OpenConsole(void)
|
|
* Detach from the controlling tty to avoid char loss
|
|
*/
|
|
if ((i = open("/dev/tty",O_RDWR)) >= 0) {
|
|
- ioctl(i, TIOCNOTTY, 0);
|
|
+ SYSCALL(ioctl(i, TIOCNOTTY, 0));
|
|
close(i);
|
|
}
|
|
}
|
|
@@ -186,9 +193,10 @@ xf86OpenConsole(void)
|
|
*/
|
|
switch_to(xf86Info.vtno, "xf86OpenConsole");
|
|
|
|
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
|
|
- FatalError("xf86OpenConsole: VT_GETMODE failed %s\n",
|
|
- strerror(errno));
|
|
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT));
|
|
+ if (ret < 0)
|
|
+ FatalError("xf86OpenConsole: VT_GETMODE failed %s\n",
|
|
+ strerror(errno));
|
|
|
|
signal(SIGUSR1, xf86VTRequest);
|
|
|
|
@@ -196,20 +204,23 @@ xf86OpenConsole(void)
|
|
VT.relsig = SIGUSR1;
|
|
VT.acqsig = SIGUSR1;
|
|
|
|
- if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
|
|
- FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed: %s\n",
|
|
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT));
|
|
+ if (ret < 0)
|
|
+ FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed: %s\n",
|
|
strerror(errno));
|
|
-
|
|
- if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0)
|
|
- FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed %s\n",
|
|
- strerror(errno));
|
|
+
|
|
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS));
|
|
+ if (ret < 0)
|
|
+ FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed %s\n",
|
|
+ strerror(errno));
|
|
|
|
tcgetattr(xf86Info.consoleFd, &tty_attr);
|
|
- ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode);
|
|
+ SYSCALL(ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode));
|
|
|
|
- if (ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW) < 0)
|
|
- FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n",
|
|
- strerror(errno));
|
|
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW));
|
|
+ if (ret < 0)
|
|
+ FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n",
|
|
+ strerror(errno));
|
|
|
|
nTty = tty_attr;
|
|
nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
|
|
@@ -241,6 +252,7 @@ void
|
|
xf86CloseConsole(void)
|
|
{
|
|
struct vt_mode VT;
|
|
+ int ret;
|
|
|
|
if (ShareVTs) {
|
|
close(xf86Info.consoleFd);
|
|
@@ -253,20 +265,23 @@ xf86CloseConsole(void)
|
|
};
|
|
|
|
/* Back to text mode ... */
|
|
- if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT) < 0)
|
|
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT));
|
|
+ if (ret < 0)
|
|
xf86Msg(X_WARNING, "xf86CloseConsole: KDSETMODE failed: %s\n",
|
|
strerror(errno));
|
|
|
|
- ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode);
|
|
+ SYSCALL(ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode));
|
|
tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr);
|
|
|
|
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
|
|
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_GETMODE, &VT));
|
|
+ if (ret < 0)
|
|
xf86Msg(X_WARNING, "xf86CloseConsole: VT_GETMODE failed: %s\n",
|
|
strerror(errno));
|
|
else {
|
|
/* set dflt vt handling */
|
|
VT.mode = VT_AUTO;
|
|
- if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
|
|
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_SETMODE, &VT));
|
|
+ if (ret < 0)
|
|
xf86Msg(X_WARNING, "xf86CloseConsole: VT_SETMODE failed: %s\n",
|
|
strerror(errno));
|
|
}
|
|
--
|
|
cgit v0.8.3-6-g21f6
|