From 318d525bf2fe52b059b1568e9b31d144b297a781 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 13 Nov 2003 09:14:29 +0000 Subject: Have the composite extension tell the damage extension about clients which have redirected subwindows in manual mode. Those clients are marked Critical and given a significant scheduling boost whenever they receive a damage notify event. This dramatically improves update frequency. If the kernel reported a large number of keys, readKernelMapping would walk off the end of the kdKeysym array. Fix usage of _IOWR; the 'size' argument is actually a datatype. --- hw/kdrive/linux/keyboard.c | 12 ++++++------ hw/kdrive/vesa/vesa.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c index 27757c3dd..97b0683de 100644 --- a/hw/kdrive/linux/keyboard.c +++ b/hw/kdrive/linux/keyboard.c @@ -118,16 +118,17 @@ readKernelMapping(void) int i, j; struct kbentry kbe; int minKeyCode, maxKeyCode; + int row; minKeyCode = NR_KEYS; maxKeyCode = 0; - k = kdKeymap; - for (i = 0; - i < NR_KEYS && (maxKeyCode - minKeyCode + 1) < KD_MAX_LENGTH; - ++i) + row = 0; + for (i = 0; i < NR_KEYS && row < KD_MAX_LENGTH; ++i) { kbe.kb_index = i; + k = kdKeymap + row * KD_MAX_WIDTH; + for (j = 0; j < KD_MAX_WIDTH; ++j) { unsigned short kval; @@ -367,8 +368,7 @@ readKernelMapping(void) if (k[1] == k[0]) k[1] = NoSymbol; if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol; if (k[3] == k[0] && k[2] == k[1] && k[2] == NoSymbol) k[3] =NoSymbol; - - k += KD_MAX_WIDTH; + row++; } kdMinScanCode = minKeyCode; kdMaxScanCode = maxKeyCode; diff --git a/hw/kdrive/vesa/vesa.c b/hw/kdrive/vesa/vesa.c index 9576bca04..74bfb857e 100644 --- a/hw/kdrive/vesa/vesa.c +++ b/hw/kdrive/vesa/vesa.c @@ -1428,7 +1428,7 @@ vesaEnable(ScreenPtr pScreen) #include #define TOSH_PROC "/proc/toshiba" #define TOSH_DEVICE "/dev/toshiba" -#define TOSH_SMM _IOWR('t', 0x90, 24) +#define TOSH_SMM _IOWR('t', 0x90, SMMRegisters) typedef struct { unsigned int eax; -- cgit v1.2.3