Remove trailing whitespace
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
1763550d01
commit
15bc35c6e4
|
@ -38,12 +38,12 @@ fbdevInitialize (KdCardInfo *card, FbdevPriv *priv)
|
||||||
int k;
|
int k;
|
||||||
unsigned long off;
|
unsigned long off;
|
||||||
|
|
||||||
if (fbdevDevicePath == NULL)
|
if (fbdevDevicePath == NULL)
|
||||||
fbdevDevicePath = "/dev/fb0";
|
fbdevDevicePath = "/dev/fb0";
|
||||||
|
|
||||||
if ((priv->fd = open(fbdevDevicePath, O_RDWR)) < 0)
|
if ((priv->fd = open(fbdevDevicePath, O_RDWR)) < 0)
|
||||||
{
|
{
|
||||||
ErrorF("Error opening framebuffer %s: %s\n",
|
ErrorF("Error opening framebuffer %s: %s\n",
|
||||||
fbdevDevicePath, strerror(errno));
|
fbdevDevicePath, strerror(errno));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -68,8 +68,8 @@ fbdevInitialize (KdCardInfo *card, FbdevPriv *priv)
|
||||||
PROT_READ|PROT_WRITE,
|
PROT_READ|PROT_WRITE,
|
||||||
MAP_SHARED,
|
MAP_SHARED,
|
||||||
priv->fd, 0);
|
priv->fd, 0);
|
||||||
|
|
||||||
if (priv->fb_base == (char *)-1)
|
if (priv->fb_base == (char *)-1)
|
||||||
{
|
{
|
||||||
perror("ERROR: mmap framebuffer fails!");
|
perror("ERROR: mmap framebuffer fails!");
|
||||||
close (priv->fd);
|
close (priv->fd);
|
||||||
|
@ -88,14 +88,14 @@ fbdevCardInit (KdCardInfo *card)
|
||||||
priv = (FbdevPriv *) xalloc (sizeof (FbdevPriv));
|
priv = (FbdevPriv *) xalloc (sizeof (FbdevPriv));
|
||||||
if (!priv)
|
if (!priv)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!fbdevInitialize (card, priv))
|
if (!fbdevInitialize (card, priv))
|
||||||
{
|
{
|
||||||
xfree (priv);
|
xfree (priv);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
card->driver = priv;
|
card->driver = priv;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ static void
|
||||||
fbdevConvertMonitorTiming (const KdMonitorTiming *t, struct fb_var_screeninfo *var)
|
fbdevConvertMonitorTiming (const KdMonitorTiming *t, struct fb_var_screeninfo *var)
|
||||||
{
|
{
|
||||||
memset (var, 0, sizeof (struct fb_var_screeninfo));
|
memset (var, 0, sizeof (struct fb_var_screeninfo));
|
||||||
|
|
||||||
var->xres = t->horizontal;
|
var->xres = t->horizontal;
|
||||||
var->yres = t->vertical;
|
var->yres = t->vertical;
|
||||||
var->xres_virtual = t->horizontal;
|
var->xres_virtual = t->horizontal;
|
||||||
|
@ -160,10 +160,10 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv)
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
k = ioctl (priv->fd, FBIOGET_VSCREENINFO, &var);
|
k = ioctl (priv->fd, FBIOGET_VSCREENINFO, &var);
|
||||||
|
|
||||||
if (!screen->width || !screen->height)
|
if (!screen->width || !screen->height)
|
||||||
{
|
{
|
||||||
if (k >= 0)
|
if (k >= 0)
|
||||||
{
|
{
|
||||||
screen->width = var.xres;
|
screen->width = var.xres;
|
||||||
screen->height = var.yres;
|
screen->height = var.yres;
|
||||||
|
@ -177,7 +177,7 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv)
|
||||||
}
|
}
|
||||||
if (!screen->fb[0].depth)
|
if (!screen->fb[0].depth)
|
||||||
{
|
{
|
||||||
if (k >= 0)
|
if (k >= 0)
|
||||||
screen->fb[0].depth = var.bits_per_pixel;
|
screen->fb[0].depth = var.bits_per_pixel;
|
||||||
else
|
else
|
||||||
screen->fb[0].depth = 16;
|
screen->fb[0].depth = 16;
|
||||||
|
@ -217,7 +217,7 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv)
|
||||||
ioctl (priv->fd, FBIOGET_VSCREENINFO, &priv->var);
|
ioctl (priv->fd, FBIOGET_VSCREENINFO, &priv->var);
|
||||||
depth = priv->var.bits_per_pixel;
|
depth = priv->var.bits_per_pixel;
|
||||||
gray = priv->var.grayscale;
|
gray = priv->var.grayscale;
|
||||||
|
|
||||||
switch (priv->fix.visual) {
|
switch (priv->fix.visual) {
|
||||||
case FB_VISUAL_PSEUDOCOLOR:
|
case FB_VISUAL_PSEUDOCOLOR:
|
||||||
if (gray)
|
if (gray)
|
||||||
|
@ -309,7 +309,7 @@ fbdevScreenInit (KdScreenInfo *screen)
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
fbdevWindowLinear (ScreenPtr pScreen,
|
fbdevWindowLinear (ScreenPtr pScreen,
|
||||||
CARD32 row,
|
CARD32 row,
|
||||||
|
@ -338,19 +338,19 @@ fbdevMapFramebuffer (KdScreenInfo *screen)
|
||||||
scrpriv->shadow = TRUE;
|
scrpriv->shadow = TRUE;
|
||||||
else
|
else
|
||||||
scrpriv->shadow = FALSE;
|
scrpriv->shadow = FALSE;
|
||||||
|
|
||||||
KdComputePointerMatrix (&m, scrpriv->randr, screen->width, screen->height);
|
KdComputePointerMatrix (&m, scrpriv->randr, screen->width, screen->height);
|
||||||
|
|
||||||
KdSetPointerMatrix (&m);
|
KdSetPointerMatrix (&m);
|
||||||
|
|
||||||
screen->width = priv->var.xres;
|
screen->width = priv->var.xres;
|
||||||
screen->height = priv->var.yres;
|
screen->height = priv->var.yres;
|
||||||
screen->memory_base = (CARD8 *) (priv->fb);
|
screen->memory_base = (CARD8 *) (priv->fb);
|
||||||
screen->memory_size = priv->fix.smem_len;
|
screen->memory_size = priv->fix.smem_len;
|
||||||
|
|
||||||
if (scrpriv->shadow)
|
if (scrpriv->shadow)
|
||||||
{
|
{
|
||||||
if (!KdShadowFbAlloc (screen, 0,
|
if (!KdShadowFbAlloc (screen, 0,
|
||||||
scrpriv->randr & (RR_Rotate_90|RR_Rotate_270)))
|
scrpriv->randr & (RR_Rotate_90|RR_Rotate_270)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
screen->off_screen_base = screen->memory_size;
|
screen->off_screen_base = screen->memory_size;
|
||||||
|
@ -358,12 +358,12 @@ fbdevMapFramebuffer (KdScreenInfo *screen)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
screen->fb[0].byteStride = priv->fix.line_length;
|
screen->fb[0].byteStride = priv->fix.line_length;
|
||||||
screen->fb[0].pixelStride = (priv->fix.line_length * 8 /
|
screen->fb[0].pixelStride = (priv->fix.line_length * 8 /
|
||||||
priv->var.bits_per_pixel);
|
priv->var.bits_per_pixel);
|
||||||
screen->fb[0].frameBuffer = (CARD8 *) (priv->fb);
|
screen->fb[0].frameBuffer = (CARD8 *) (priv->fb);
|
||||||
screen->off_screen_base = screen->fb[0].byteStride * screen->height;
|
screen->off_screen_base = screen->fb[0].byteStride * screen->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,25 +458,25 @@ fbdevRandRGetInfo (ScreenPtr pScreen, Rotation *rotations)
|
||||||
RRScreenSizePtr pSize;
|
RRScreenSizePtr pSize;
|
||||||
Rotation randr;
|
Rotation randr;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
*rotations = RR_Rotate_All|RR_Reflect_All;
|
*rotations = RR_Rotate_All|RR_Reflect_All;
|
||||||
|
|
||||||
for (n = 0; n < pScreen->numDepths; n++)
|
for (n = 0; n < pScreen->numDepths; n++)
|
||||||
if (pScreen->allowedDepths[n].numVids)
|
if (pScreen->allowedDepths[n].numVids)
|
||||||
break;
|
break;
|
||||||
if (n == pScreen->numDepths)
|
if (n == pScreen->numDepths)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
pSize = RRRegisterSize (pScreen,
|
pSize = RRRegisterSize (pScreen,
|
||||||
screen->width,
|
screen->width,
|
||||||
screen->height,
|
screen->height,
|
||||||
screen->width_mm,
|
screen->width_mm,
|
||||||
screen->height_mm);
|
screen->height_mm);
|
||||||
|
|
||||||
randr = KdSubRotation (scrpriv->randr, screen->randr);
|
randr = KdSubRotation (scrpriv->randr, screen->randr);
|
||||||
|
|
||||||
RRSetCurrentConfig (pScreen, randr, 0, pSize);
|
RRSetCurrentConfig (pScreen, randr, 0, pSize);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,20 +512,20 @@ fbdevRandRSetConfig (ScreenPtr pScreen,
|
||||||
KdDisableScreen (pScreen);
|
KdDisableScreen (pScreen);
|
||||||
|
|
||||||
oldscr = *scrpriv;
|
oldscr = *scrpriv;
|
||||||
|
|
||||||
oldwidth = screen->width;
|
oldwidth = screen->width;
|
||||||
oldheight = screen->height;
|
oldheight = screen->height;
|
||||||
oldmmwidth = pScreen->mmWidth;
|
oldmmwidth = pScreen->mmWidth;
|
||||||
oldmmheight = pScreen->mmHeight;
|
oldmmheight = pScreen->mmHeight;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set new configuration
|
* Set new configuration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
scrpriv->randr = KdAddRotation (screen->randr, randr);
|
scrpriv->randr = KdAddRotation (screen->randr, randr);
|
||||||
|
|
||||||
fbdevUnmapFramebuffer (screen);
|
fbdevUnmapFramebuffer (screen);
|
||||||
|
|
||||||
if (!fbdevMapFramebuffer (screen))
|
if (!fbdevMapFramebuffer (screen))
|
||||||
goto bail4;
|
goto bail4;
|
||||||
|
|
||||||
|
@ -546,9 +546,9 @@ fbdevRandRSetConfig (ScreenPtr pScreen,
|
||||||
screen->fb[0].bitsPerPixel,
|
screen->fb[0].bitsPerPixel,
|
||||||
screen->fb[0].byteStride,
|
screen->fb[0].byteStride,
|
||||||
screen->fb[0].frameBuffer);
|
screen->fb[0].frameBuffer);
|
||||||
|
|
||||||
/* set the subpixel order */
|
/* set the subpixel order */
|
||||||
|
|
||||||
KdSetSubpixelOrder (pScreen, scrpriv->randr);
|
KdSetSubpixelOrder (pScreen, scrpriv->randr);
|
||||||
if (wasEnabled)
|
if (wasEnabled)
|
||||||
KdEnableScreen (pScreen);
|
KdEnableScreen (pScreen);
|
||||||
|
@ -563,7 +563,7 @@ bail4:
|
||||||
pScreen->height = oldheight;
|
pScreen->height = oldheight;
|
||||||
pScreen->mmWidth = oldmmwidth;
|
pScreen->mmWidth = oldmmwidth;
|
||||||
pScreen->mmHeight = oldmmheight;
|
pScreen->mmHeight = oldmmheight;
|
||||||
|
|
||||||
if (wasEnabled)
|
if (wasEnabled)
|
||||||
KdEnableScreen (pScreen);
|
KdEnableScreen (pScreen);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -573,7 +573,7 @@ Bool
|
||||||
fbdevRandRInit (ScreenPtr pScreen)
|
fbdevRandRInit (ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
rrScrPrivPtr pScrPriv;
|
rrScrPrivPtr pScrPriv;
|
||||||
|
|
||||||
if (!RRScreenInit (pScreen))
|
if (!RRScreenInit (pScreen))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -594,7 +594,7 @@ fbdevCreateColormap (ColormapPtr pmap)
|
||||||
int i;
|
int i;
|
||||||
int nent;
|
int nent;
|
||||||
xColorItem *pdefs;
|
xColorItem *pdefs;
|
||||||
|
|
||||||
switch (priv->fix.visual) {
|
switch (priv->fix.visual) {
|
||||||
case FB_VISUAL_STATIC_PSEUDOCOLOR:
|
case FB_VISUAL_STATIC_PSEUDOCOLOR:
|
||||||
pVisual = pmap->pVisual;
|
pVisual = pmap->pVisual;
|
||||||
|
@ -639,7 +639,7 @@ fbdevFinishInitScreen (ScreenPtr pScreen)
|
||||||
if (!fbdevRandRInit (pScreen))
|
if (!fbdevRandRInit (pScreen))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -663,7 +663,7 @@ fbdevEnable (ScreenPtr pScreen)
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
priv->var.activate = FB_ACTIVATE_NOW|FB_CHANGE_CMAP_VBL;
|
priv->var.activate = FB_ACTIVATE_NOW|FB_CHANGE_CMAP_VBL;
|
||||||
|
|
||||||
/* display it on the LCD */
|
/* display it on the LCD */
|
||||||
k = ioctl (priv->fd, FBIOPUT_VSCREENINFO, &priv->var);
|
k = ioctl (priv->fd, FBIOPUT_VSCREENINFO, &priv->var);
|
||||||
if (k < 0)
|
if (k < 0)
|
||||||
|
@ -671,13 +671,13 @@ fbdevEnable (ScreenPtr pScreen)
|
||||||
perror ("FBIOPUT_VSCREENINFO");
|
perror ("FBIOPUT_VSCREENINFO");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (priv->fix.visual == FB_VISUAL_DIRECTCOLOR)
|
if (priv->fix.visual == FB_VISUAL_DIRECTCOLOR)
|
||||||
{
|
{
|
||||||
struct fb_cmap cmap;
|
struct fb_cmap cmap;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
i < (1 << priv->var.red.length) ||
|
i < (1 << priv->var.red.length) ||
|
||||||
i < (1 << priv->var.green.length) ||
|
i < (1 << priv->var.green.length) ||
|
||||||
i < (1 << priv->var.blue.length); i++)
|
i < (1 << priv->var.blue.length); i++)
|
||||||
|
@ -742,7 +742,7 @@ void
|
||||||
fbdevCardFini (KdCardInfo *card)
|
fbdevCardFini (KdCardInfo *card)
|
||||||
{
|
{
|
||||||
FbdevPriv *priv = card->driver;
|
FbdevPriv *priv = card->driver;
|
||||||
|
|
||||||
munmap (priv->fb_base, priv->fix.smem_len);
|
munmap (priv->fb_base, priv->fix.smem_len);
|
||||||
close (priv->fd);
|
close (priv->fd);
|
||||||
xfree (priv);
|
xfree (priv);
|
||||||
|
|
|
@ -42,7 +42,7 @@ typedef struct _fbdevPriv {
|
||||||
char *fb;
|
char *fb;
|
||||||
char *fb_base;
|
char *fb_base;
|
||||||
} FbdevPriv;
|
} FbdevPriv;
|
||||||
|
|
||||||
typedef struct _fbdevScrPriv {
|
typedef struct _fbdevScrPriv {
|
||||||
Rotation randr;
|
Rotation randr;
|
||||||
Bool shadow;
|
Bool shadow;
|
||||||
|
@ -63,7 +63,7 @@ fbdevScreenInit (KdScreenInfo *screen);
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv);
|
fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv);
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
fbdevInitScreen (ScreenPtr pScreen);
|
fbdevInitScreen (ScreenPtr pScreen);
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ fbdevSetShadow (ScreenPtr pScreen);
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
fbdevCreateColormap (ColormapPtr pmap);
|
fbdevCreateColormap (ColormapPtr pmap);
|
||||||
|
|
||||||
#ifdef RANDR
|
#ifdef RANDR
|
||||||
Bool
|
Bool
|
||||||
fbdevRandRGetInfo (ScreenPtr pScreen, Rotation *rotations);
|
fbdevRandRGetInfo (ScreenPtr pScreen, Rotation *rotations);
|
||||||
|
|
|
@ -60,11 +60,11 @@ ddxProcessArgument (int argc, char **argv, int i)
|
||||||
{
|
{
|
||||||
if (!strcmp (argv[i], "-fb"))
|
if (!strcmp (argv[i], "-fb"))
|
||||||
{
|
{
|
||||||
if (i+1 < argc)
|
if (i+1 < argc)
|
||||||
{
|
{
|
||||||
fbdevDevicePath = argv[i+1];
|
fbdevDevicePath = argv[i+1];
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
UseMsg();
|
UseMsg();
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -86,18 +86,18 @@ KdCardFuncs fbdevFuncs = {
|
||||||
fbdevRestore, /* restore */
|
fbdevRestore, /* restore */
|
||||||
fbdevScreenFini, /* scrfini */
|
fbdevScreenFini, /* scrfini */
|
||||||
fbdevCardFini, /* cardfini */
|
fbdevCardFini, /* cardfini */
|
||||||
|
|
||||||
0, /* initCursor */
|
0, /* initCursor */
|
||||||
0, /* enableCursor */
|
0, /* enableCursor */
|
||||||
0, /* disableCursor */
|
0, /* disableCursor */
|
||||||
0, /* finiCursor */
|
0, /* finiCursor */
|
||||||
0, /* recolorCursor */
|
0, /* recolorCursor */
|
||||||
|
|
||||||
0, /* initAccel */
|
0, /* initAccel */
|
||||||
0, /* enableAccel */
|
0, /* enableAccel */
|
||||||
0, /* disableAccel */
|
0, /* disableAccel */
|
||||||
0, /* finiAccel */
|
0, /* finiAccel */
|
||||||
|
|
||||||
fbdevGetColors, /* getColors */
|
fbdevGetColors, /* getColors */
|
||||||
fbdevPutColors, /* putColors */
|
fbdevPutColors, /* putColors */
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,7 +48,7 @@ typedef struct _kevdev {
|
||||||
int abs[ABS_MAX + 1];
|
int abs[ABS_MAX + 1];
|
||||||
int prevabs[ABS_MAX + 1];
|
int prevabs[ABS_MAX + 1];
|
||||||
long key[NBITS(KEY_MAX + 1)];
|
long key[NBITS(KEY_MAX + 1)];
|
||||||
|
|
||||||
/* supported device info */
|
/* supported device info */
|
||||||
long relbits[NBITS(REL_MAX + 1)];
|
long relbits[NBITS(REL_MAX + 1)];
|
||||||
long absbits[NBITS(ABS_MAX + 1)];
|
long absbits[NBITS(ABS_MAX + 1)];
|
||||||
|
@ -106,12 +106,12 @@ EvdevPtrMotion (KdPointerInfo *pi, struct input_event *ev)
|
||||||
int a;
|
int a;
|
||||||
for (a = 0; a <= ke->max_rel; a++)
|
for (a = 0; a <= ke->max_rel; a++)
|
||||||
{
|
{
|
||||||
if (ISBITSET (ke->relbits, a))
|
if (ISBITSET (ke->relbits, a))
|
||||||
{
|
{
|
||||||
if (a == 0)
|
if (a == 0)
|
||||||
KdEnqueuePointerEvent(pi, flags, ke->rel[a], 0, 0);
|
KdEnqueuePointerEvent(pi, flags, ke->rel[a], 0, 0);
|
||||||
else if (a == 1)
|
else if (a == 1)
|
||||||
KdEnqueuePointerEvent(pi, flags, 0, ke->rel[a], 0);
|
KdEnqueuePointerEvent(pi, flags, 0, ke->rel[a], 0);
|
||||||
}
|
}
|
||||||
ke->rel[a] = 0;
|
ke->rel[a] = 0;
|
||||||
}
|
}
|
||||||
|
@ -131,9 +131,9 @@ EvdevPtrMotion (KdPointerInfo *pi, struct input_event *ev)
|
||||||
ErrorF ("\n");
|
ErrorF ("\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ev->code == REL_WHEEL) {
|
if (ev->code == REL_WHEEL) {
|
||||||
for (i = 0; i < abs (ev->value); i++)
|
for (i = 0; i < abs (ev->value); i++)
|
||||||
{
|
{
|
||||||
if (ev->value > 0)
|
if (ev->value > 0)
|
||||||
flags |= KD_BUTTON_4;
|
flags |= KD_BUTTON_4;
|
||||||
|
@ -150,7 +150,7 @@ EvdevPtrMotion (KdPointerInfo *pi, struct input_event *ev)
|
||||||
KdEnqueuePointerEvent (pi, flags, 0, 0, 0);
|
KdEnqueuePointerEvent (pi, flags, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -164,7 +164,7 @@ EvdevPtrRead (int evdevPort, void *closure)
|
||||||
|
|
||||||
n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
|
n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
|
||||||
if (n <= 0) {
|
if (n <= 0) {
|
||||||
if (errno == ENODEV)
|
if (errno == ENODEV)
|
||||||
DeleteInputDeviceRequest(pi->dixdev);
|
DeleteInputDeviceRequest(pi->dixdev);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -231,7 +231,7 @@ EvdevPtrInit (KdPointerInfo *pi)
|
||||||
|
|
||||||
static Status
|
static Status
|
||||||
EvdevPtrEnable (KdPointerInfo *pi)
|
EvdevPtrEnable (KdPointerInfo *pi)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
unsigned long ev[NBITS(EV_MAX)];
|
unsigned long ev[NBITS(EV_MAX)];
|
||||||
Kevdev *ke;
|
Kevdev *ke;
|
||||||
|
@ -352,7 +352,7 @@ EvdevPtrFini (KdPointerInfo *pi)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Evdev keyboard functions
|
* Evdev keyboard functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -374,7 +374,7 @@ EvdevKbdRead (int evdevPort, void *closure)
|
||||||
|
|
||||||
n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
|
n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
|
||||||
if (n <= 0) {
|
if (n <= 0) {
|
||||||
if (errno == ENODEV)
|
if (errno == ENODEV)
|
||||||
DeleteInputDeviceRequest(ki->dixdev);
|
DeleteInputDeviceRequest(ki->dixdev);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -395,7 +395,7 @@ static Status
|
||||||
EvdevKbdInit (KdKeyboardInfo *ki)
|
EvdevKbdInit (KdKeyboardInfo *ki)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if (!ki->path) {
|
if (!ki->path) {
|
||||||
ErrorF("Couldn't find evdev device path\n");
|
ErrorF("Couldn't find evdev device path\n");
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
|
@ -231,7 +231,7 @@ readKernelMapping(KdKeyboardInfo *ki)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fd = LinuxConsoleFd;
|
fd = LinuxConsoleFd;
|
||||||
|
|
||||||
minKeyCode = NR_KEYS;
|
minKeyCode = NR_KEYS;
|
||||||
maxKeyCode = 0;
|
maxKeyCode = 0;
|
||||||
row = 0;
|
row = 0;
|
||||||
|
@ -241,7 +241,7 @@ readKernelMapping(KdKeyboardInfo *ki)
|
||||||
kbe.kb_index = LNX_KEY_INDEX(i);
|
kbe.kb_index = LNX_KEY_INDEX(i);
|
||||||
|
|
||||||
k = ki->keySyms.map + row * ki->keySyms.mapWidth;
|
k = ki->keySyms.map + row * ki->keySyms.mapWidth;
|
||||||
|
|
||||||
for (j = 0; j < ki->keySyms.mapWidth; ++j)
|
for (j = 0; j < ki->keySyms.mapWidth; ++j)
|
||||||
{
|
{
|
||||||
unsigned short kval;
|
unsigned short kval;
|
||||||
|
@ -463,7 +463,7 @@ readKernelMapping(KdKeyboardInfo *ki)
|
||||||
k[j] = (kbe.kb_value & 0xFF) + 0x1008FF00;
|
k[j] = (kbe.kb_value & 0xFF) + 0x1008FF00;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -720,7 +720,7 @@ static void
|
||||||
LinuxKeyboardDisable (KdKeyboardInfo *ki)
|
LinuxKeyboardDisable (KdKeyboardInfo *ki)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if (!ki)
|
if (!ki)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ LinuxInit (void)
|
||||||
vtno = kdVirtualTerminal;
|
vtno = kdVirtualTerminal;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0)
|
if ((fd = open("/dev/tty0",O_WRONLY,0)) < 0)
|
||||||
{
|
{
|
||||||
FatalError(
|
FatalError(
|
||||||
"LinuxInit: Cannot open /dev/tty0 (%s)\n",
|
"LinuxInit: Cannot open /dev/tty0 (%s)\n",
|
||||||
|
@ -129,8 +129,8 @@ LinuxSetSwitchMode (int mode)
|
||||||
{
|
{
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
struct vt_mode VT;
|
struct vt_mode VT;
|
||||||
|
|
||||||
if (ioctl(LinuxConsoleFd, VT_GETMODE, &VT) < 0)
|
if (ioctl(LinuxConsoleFd, VT_GETMODE, &VT) < 0)
|
||||||
{
|
{
|
||||||
FatalError ("LinuxInit: VT_GETMODE failed\n");
|
FatalError ("LinuxInit: VT_GETMODE failed\n");
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ LinuxSetSwitchMode (int mode)
|
||||||
sigemptyset (&act.sa_mask);
|
sigemptyset (&act.sa_mask);
|
||||||
act.sa_flags = 0;
|
act.sa_flags = 0;
|
||||||
sigaction (SIGUSR1, &act, 0);
|
sigaction (SIGUSR1, &act, 0);
|
||||||
|
|
||||||
VT.mode = mode;
|
VT.mode = mode;
|
||||||
VT.relsig = SIGUSR1;
|
VT.relsig = SIGUSR1;
|
||||||
VT.acqsig = SIGUSR1;
|
VT.acqsig = SIGUSR1;
|
||||||
|
@ -152,12 +152,12 @@ LinuxSetSwitchMode (int mode)
|
||||||
sigemptyset (&act.sa_mask);
|
sigemptyset (&act.sa_mask);
|
||||||
act.sa_flags = 0;
|
act.sa_flags = 0;
|
||||||
sigaction (SIGUSR1, &act, 0);
|
sigaction (SIGUSR1, &act, 0);
|
||||||
|
|
||||||
VT.mode = mode;
|
VT.mode = mode;
|
||||||
VT.relsig = 0;
|
VT.relsig = 0;
|
||||||
VT.acqsig = 0;
|
VT.acqsig = 0;
|
||||||
}
|
}
|
||||||
if (ioctl(LinuxConsoleFd, VT_SETMODE, &VT) < 0)
|
if (ioctl(LinuxConsoleFd, VT_SETMODE, &VT) < 0)
|
||||||
{
|
{
|
||||||
FatalError("LinuxInit: VT_SETMODE failed\n");
|
FatalError("LinuxInit: VT_SETMODE failed\n");
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ LinuxEnable (void)
|
||||||
*/
|
*/
|
||||||
LinuxApmFd = open ("/dev/apm_bios", 2);
|
LinuxApmFd = open ("/dev/apm_bios", 2);
|
||||||
if (LinuxApmFd < 0 && errno == ENOENT)
|
if (LinuxApmFd < 0 && errno == ENOENT)
|
||||||
LinuxApmFd = open ("/dev/misc/apm_bios", 2);
|
LinuxApmFd = open ("/dev/misc/apm_bios", 2);
|
||||||
if (LinuxApmFd >= 0)
|
if (LinuxApmFd >= 0)
|
||||||
{
|
{
|
||||||
LinuxApmRunning = TRUE;
|
LinuxApmRunning = TRUE;
|
||||||
|
@ -245,7 +245,7 @@ LinuxEnable (void)
|
||||||
RegisterBlockAndWakeupHandlers (LinuxApmBlock, LinuxApmWakeup, 0);
|
RegisterBlockAndWakeupHandlers (LinuxApmBlock, LinuxApmWakeup, 0);
|
||||||
AddEnabledDevice (LinuxApmFd);
|
AddEnabledDevice (LinuxApmFd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* now get the VT
|
* now get the VT
|
||||||
*/
|
*/
|
||||||
|
@ -308,8 +308,8 @@ LinuxFini (void)
|
||||||
* Find a legal VT to switch to, either the one we started from
|
* Find a legal VT to switch to, either the one we started from
|
||||||
* or the lowest active one that isn't ours
|
* or the lowest active one that isn't ours
|
||||||
*/
|
*/
|
||||||
if (activeVT < 0 ||
|
if (activeVT < 0 ||
|
||||||
activeVT == vts.v_active ||
|
activeVT == vts.v_active ||
|
||||||
!(vts.v_state & (1 << activeVT)))
|
!(vts.v_state & (1 << activeVT)))
|
||||||
{
|
{
|
||||||
for (activeVT = 1; activeVT < 16; activeVT++)
|
for (activeVT = 1; activeVT < 16; activeVT++)
|
||||||
|
|
|
@ -112,7 +112,7 @@ MouseFlush (Kbufio *b, char *buf, int size)
|
||||||
CARD32 done = now + 100;
|
CARD32 done = now + 100;
|
||||||
int c;
|
int c;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
while ((c = MouseReadByte (b, done - now)) != -1)
|
while ((c = MouseReadByte (b, done - now)) != -1)
|
||||||
{
|
{
|
||||||
if (buf)
|
if (buf)
|
||||||
|
@ -170,7 +170,7 @@ static Bool
|
||||||
MouseWriteByte (int fd, unsigned char c, int timeout)
|
MouseWriteByte (int fd, unsigned char c, int timeout)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
#ifdef DEBUG_BYTES
|
#ifdef DEBUG_BYTES
|
||||||
ErrorF ("\tput %02x\n", c);
|
ErrorF ("\tput %02x\n", c);
|
||||||
#endif
|
#endif
|
||||||
|
@ -234,7 +234,7 @@ typedef struct _kmouse {
|
||||||
int invalid;/* total invalid bytes for this protocol */
|
int invalid;/* total invalid bytes for this protocol */
|
||||||
unsigned long state; /* private per protocol, init to prot->state */
|
unsigned long state; /* private per protocol, init to prot->state */
|
||||||
} Kmouse;
|
} Kmouse;
|
||||||
|
|
||||||
static int mouseValid (KdPointerInfo *pi, unsigned char *ev, int ne)
|
static int mouseValid (KdPointerInfo *pi, unsigned char *ev, int ne)
|
||||||
{
|
{
|
||||||
Kmouse *km = pi->driverPrivate;
|
Kmouse *km = pi->driverPrivate;
|
||||||
|
@ -271,16 +271,16 @@ static Bool MouseReasonable (KdPointerInfo *pi, unsigned long flags, int dx, int
|
||||||
{
|
{
|
||||||
Kmouse *km = pi->driverPrivate;
|
Kmouse *km = pi->driverPrivate;
|
||||||
|
|
||||||
if (km->stage == MouseWorking)
|
if (km->stage == MouseWorking)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (dx < -50 || dx > 50)
|
if (dx < -50 || dx > 50)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
ErrorF ("Large X %d\n", dx);
|
ErrorF ("Large X %d\n", dx);
|
||||||
#endif
|
#endif
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (dy < -50 || dy > 50)
|
if (dy < -50 || dy > 50)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
ErrorF ("Large Y %d\n", dy);
|
ErrorF ("Large Y %d\n", dy);
|
||||||
|
@ -299,7 +299,7 @@ static Bool ps2Parse (KdPointerInfo *pi, unsigned char *ev, int ne)
|
||||||
int dx, dy, dz;
|
int dx, dy, dz;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned long flagsrelease = 0;
|
unsigned long flagsrelease = 0;
|
||||||
|
|
||||||
flags = KD_MOUSE_DELTA;
|
flags = KD_MOUSE_DELTA;
|
||||||
if (ev[0] & 4)
|
if (ev[0] & 4)
|
||||||
flags |= KD_BUTTON_2;
|
flags |= KD_BUTTON_2;
|
||||||
|
@ -307,7 +307,7 @@ static Bool ps2Parse (KdPointerInfo *pi, unsigned char *ev, int ne)
|
||||||
flags |= KD_BUTTON_3;
|
flags |= KD_BUTTON_3;
|
||||||
if (ev[0] & 1)
|
if (ev[0] & 1)
|
||||||
flags |= KD_BUTTON_1;
|
flags |= KD_BUTTON_1;
|
||||||
|
|
||||||
if (ne > 3)
|
if (ne > 3)
|
||||||
{
|
{
|
||||||
dz = (int) (signed char) ev[3];
|
dz = (int) (signed char) ev[3];
|
||||||
|
@ -322,7 +322,7 @@ static Bool ps2Parse (KdPointerInfo *pi, unsigned char *ev, int ne)
|
||||||
flagsrelease = KD_BUTTON_5;
|
flagsrelease = KD_BUTTON_5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dx = ev[1];
|
dx = ev[1];
|
||||||
if (ev[0] & 0x10)
|
if (ev[0] & 0x10)
|
||||||
dx -= 256;
|
dx -= 256;
|
||||||
|
@ -407,14 +407,14 @@ static const KmouseProt exps2Prot = {
|
||||||
#define PSM_4DMOUSE_ID 6
|
#define PSM_4DMOUSE_ID 6
|
||||||
#define PSM_4DPLUS_ID 8
|
#define PSM_4DPLUS_ID 8
|
||||||
|
|
||||||
static unsigned char ps2_init[] = {
|
static unsigned char ps2_init[] = {
|
||||||
PSMC_ENABLE_DEV,
|
PSMC_ENABLE_DEV,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NINIT_PS2 1
|
#define NINIT_PS2 1
|
||||||
|
|
||||||
static unsigned char wheel_3button_init[] = {
|
static unsigned char wheel_3button_init[] = {
|
||||||
PSMC_SET_SAMPLING_RATE, 200,
|
PSMC_SET_SAMPLING_RATE, 200,
|
||||||
PSMC_SET_SAMPLING_RATE, 100,
|
PSMC_SET_SAMPLING_RATE, 100,
|
||||||
PSMC_SET_SAMPLING_RATE, 80,
|
PSMC_SET_SAMPLING_RATE, 80,
|
||||||
|
@ -431,7 +431,7 @@ static unsigned char wheel_5button_init[] = {
|
||||||
PSMC_SET_SAMPLING_RATE, 200,
|
PSMC_SET_SAMPLING_RATE, 200,
|
||||||
PSMC_SET_SAMPLING_RATE, 200,
|
PSMC_SET_SAMPLING_RATE, 200,
|
||||||
PSMC_SET_SAMPLING_RATE, 80,
|
PSMC_SET_SAMPLING_RATE, 80,
|
||||||
PSMC_SEND_DEV_ID,
|
PSMC_SEND_DEV_ID,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -439,8 +439,8 @@ static unsigned char wheel_5button_init[] = {
|
||||||
|
|
||||||
static unsigned char intelli_init[] = {
|
static unsigned char intelli_init[] = {
|
||||||
PSMC_SET_SAMPLING_RATE, 200,
|
PSMC_SET_SAMPLING_RATE, 200,
|
||||||
PSMC_SET_SAMPLING_RATE, 100,
|
PSMC_SET_SAMPLING_RATE, 100,
|
||||||
PSMC_SET_SAMPLING_RATE, 80,
|
PSMC_SET_SAMPLING_RATE, 80,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ ps2SkipInit (KdPointerInfo *pi, int ninit, Bool ret_next)
|
||||||
int c = -1;
|
int c = -1;
|
||||||
int skipping;
|
int skipping;
|
||||||
Bool waiting;
|
Bool waiting;
|
||||||
|
|
||||||
skipping = 0;
|
skipping = 0;
|
||||||
waiting = FALSE;
|
waiting = FALSE;
|
||||||
while (ninit || ret_next)
|
while (ninit || ret_next)
|
||||||
|
@ -486,7 +486,7 @@ ps2Init (KdPointerInfo *pi)
|
||||||
int id;
|
int id;
|
||||||
unsigned char *init;
|
unsigned char *init;
|
||||||
int ninit;
|
int ninit;
|
||||||
|
|
||||||
/* Send Intellimouse initialization sequence */
|
/* Send Intellimouse initialization sequence */
|
||||||
MouseWriteBytes (km->iob.fd, intelli_init, strlen ((char *) intelli_init), 100);
|
MouseWriteBytes (km->iob.fd, intelli_init, strlen ((char *) intelli_init), 100);
|
||||||
/*
|
/*
|
||||||
|
@ -530,7 +530,7 @@ static Bool busParse (KdPointerInfo *pi, unsigned char *ev, int ne)
|
||||||
Kmouse *km = pi->driverPrivate;
|
Kmouse *km = pi->driverPrivate;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
flags = KD_MOUSE_DELTA;
|
flags = KD_MOUSE_DELTA;
|
||||||
dx = (signed char) ev[1];
|
dx = (signed char) ev[1];
|
||||||
dy = -(signed char) ev[2];
|
dy = -(signed char) ev[2];
|
||||||
|
@ -636,14 +636,14 @@ static Bool logiParse (KdPointerInfo *pi, unsigned char *ev, int ne)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
flags = KD_MOUSE_DELTA;
|
flags = KD_MOUSE_DELTA;
|
||||||
|
|
||||||
if (ne == 3)
|
if (ne == 3)
|
||||||
{
|
{
|
||||||
if (ev[0] & 0x20)
|
if (ev[0] & 0x20)
|
||||||
flags |= KD_BUTTON_1;
|
flags |= KD_BUTTON_1;
|
||||||
if (ev[0] & 0x10)
|
if (ev[0] & 0x10)
|
||||||
flags |= KD_BUTTON_3;
|
flags |= KD_BUTTON_3;
|
||||||
|
|
||||||
dx = (signed char)(((ev[0] & 0x03) << 6) | (ev[1] & 0x3F));
|
dx = (signed char)(((ev[0] & 0x03) << 6) | (ev[1] & 0x3F));
|
||||||
dy = (signed char)(((ev[0] & 0x0C) << 4) | (ev[2] & 0x3F));
|
dy = (signed char)(((ev[0] & 0x0C) << 4) | (ev[2] & 0x3F));
|
||||||
flags |= km->state & KD_BUTTON_2;
|
flags |= km->state & KD_BUTTON_2;
|
||||||
|
@ -686,7 +686,7 @@ static Bool mscParse (KdPointerInfo *pi, unsigned char *ev, int ne)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
flags = KD_MOUSE_DELTA;
|
flags = KD_MOUSE_DELTA;
|
||||||
|
|
||||||
if (!(ev[0] & 0x4))
|
if (!(ev[0] & 0x4))
|
||||||
flags |= KD_BUTTON_1;
|
flags |= KD_BUTTON_1;
|
||||||
if (!(ev[0] & 0x2))
|
if (!(ev[0] & 0x2))
|
||||||
|
@ -871,7 +871,7 @@ MouseRead (int mousePort, void *closure)
|
||||||
switch (km->stage)
|
switch (km->stage)
|
||||||
{
|
{
|
||||||
case MouseBroken:
|
case MouseBroken:
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
ErrorF ("Mouse protocol %s seems OK\n",
|
ErrorF ("Mouse protocol %s seems OK\n",
|
||||||
km->prot->name);
|
km->prot->name);
|
||||||
#endif
|
#endif
|
||||||
|
@ -939,7 +939,7 @@ MouseInit (KdPointerInfo *pi)
|
||||||
|
|
||||||
if (!pi)
|
if (!pi)
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
|
|
||||||
if (!pi->path || strcmp(pi->path, "auto") == 0) {
|
if (!pi->path || strcmp(pi->path, "auto") == 0) {
|
||||||
for (i = 0; i < NUM_DEFAULT_MOUSE; i++) {
|
for (i = 0; i < NUM_DEFAULT_MOUSE; i++) {
|
||||||
fd = open (kdefaultMouse[i], 2);
|
fd = open (kdefaultMouse[i], 2);
|
||||||
|
@ -952,7 +952,7 @@ MouseInit (KdPointerInfo *pi)
|
||||||
else {
|
else {
|
||||||
fd = open (pi->path, 2);
|
fd = open (pi->path, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
|
@ -1008,7 +1008,7 @@ MouseDisable (KdPointerInfo *pi)
|
||||||
Kmouse *km;
|
Kmouse *km;
|
||||||
if (!pi || !pi->driverPrivate)
|
if (!pi || !pi->driverPrivate)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
km = pi->driverPrivate;
|
km = pi->driverPrivate;
|
||||||
KdUnregisterFd (pi, km->iob.fd, TRUE);
|
KdUnregisterFd (pi, km->iob.fd, TRUE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ MsRead (int port, void *closure)
|
||||||
flags |= KD_BUTTON_1;
|
flags |= KD_BUTTON_1;
|
||||||
if (b[0] & 0x10)
|
if (b[0] & 0x10)
|
||||||
flags |= KD_BUTTON_3;
|
flags |= KD_BUTTON_3;
|
||||||
|
|
||||||
dx = (char)(((b[0] & 0x03) << 6) | (b[1] & 0x3F));
|
dx = (char)(((b[0] & 0x03) << 6) | (b[1] & 0x3F));
|
||||||
dy = (char)(((b[0] & 0x0C) << 4) | (b[2] & 0x3F));
|
dy = (char)(((b[0] & 0x0C) << 4) | (b[2] & 0x3F));
|
||||||
n -= 3;
|
n -= 3;
|
||||||
|
@ -103,8 +103,8 @@ MsInit (KdPointerInfo *pi)
|
||||||
pi->path = strdup("/dev/mouse");
|
pi->path = strdup("/dev/mouse");
|
||||||
if (!pi->name)
|
if (!pi->name)
|
||||||
pi->name = strdup("Microsoft protocol mouse");
|
pi->name = strdup("Microsoft protocol mouse");
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Status
|
static Status
|
||||||
|
|
|
@ -99,7 +99,7 @@ Ps2Read (int ps2Port, void *closure)
|
||||||
flags |= right_button;
|
flags |= right_button;
|
||||||
if (b[0] & 1)
|
if (b[0] & 1)
|
||||||
flags |= left_button;
|
flags |= left_button;
|
||||||
|
|
||||||
dx = b[1];
|
dx = b[1];
|
||||||
if (b[0] & 0x10)
|
if (b[0] & 0x10)
|
||||||
dx -= 256;
|
dx -= 256;
|
||||||
|
@ -146,7 +146,7 @@ static Status
|
||||||
Ps2Enable (KdPointerInfo *pi)
|
Ps2Enable (KdPointerInfo *pi)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if (!pi)
|
if (!pi)
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
* Copyright © 2002 MontaVista Software Inc.
|
* Copyright © 2002 MontaVista Software Inc.
|
||||||
* Copyright © 2005 OpenedHand Ltd.
|
* Copyright © 2005 OpenedHand Ltd.
|
||||||
* Copyright © 2006 Nokia Corporation
|
* Copyright © 2006 Nokia Corporation
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
* documentation for any purpose is hereby granted without fee, provided that
|
* documentation for any purpose is hereby granted without fee, provided that
|
||||||
* the above copyright notice appear in all copies and that both that
|
* the above copyright notice appear in all copies and that both that
|
||||||
|
@ -76,7 +76,7 @@ TsRead (int fd, void *closure)
|
||||||
if (event.pressure) {
|
if (event.pressure) {
|
||||||
flags = KD_BUTTON_1;
|
flags = KD_BUTTON_1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Here we test for the touch screen driver actually being on the
|
* Here we test for the touch screen driver actually being on the
|
||||||
* touch screen, if it is we send absolute coordinates. If not,
|
* touch screen, if it is we send absolute coordinates. If not,
|
||||||
* then we send delta's so that we can track the entire vga screen.
|
* then we send delta's so that we can track the entire vga screen.
|
||||||
|
@ -127,7 +127,7 @@ TslibEnable (KdPointerInfo *pi)
|
||||||
}
|
}
|
||||||
|
|
||||||
KdRegisterFd(private->fd, TsRead, pi);
|
KdRegisterFd(private->fd, TsRead, pi);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ TslibInit (KdPointerInfo *pi)
|
||||||
|
|
||||||
if (!pi || !pi->dixdev)
|
if (!pi || !pi->dixdev)
|
||||||
return !Success;
|
return !Success;
|
||||||
|
|
||||||
pi->driverPrivate = (struct TslibPrivate *)
|
pi->driverPrivate = (struct TslibPrivate *)
|
||||||
xcalloc(sizeof(struct TslibPrivate), 1);
|
xcalloc(sizeof(struct TslibPrivate), 1);
|
||||||
if (!pi->driverPrivate)
|
if (!pi->driverPrivate)
|
||||||
|
|
|
@ -43,10 +43,10 @@ KdSetColormap (ScreenPtr pScreen, int fb)
|
||||||
return;
|
return;
|
||||||
if (pScreenPriv->screen->fb[fb].depth > KD_MAX_PSEUDO_DEPTH)
|
if (pScreenPriv->screen->fb[fb].depth > KD_MAX_PSEUDO_DEPTH)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!pScreenPriv->enabled)
|
if (!pScreenPriv->enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!pCmap)
|
if (!pCmap)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -54,12 +54,12 @@ KdSetColormap (ScreenPtr pScreen, int fb)
|
||||||
* Make DIX convert pixels into RGB values -- this handles
|
* Make DIX convert pixels into RGB values -- this handles
|
||||||
* true/direct as well as pseudo/static visuals
|
* true/direct as well as pseudo/static visuals
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (i = 0; i < (1 << pScreenPriv->screen->fb[fb].depth); i++)
|
for (i = 0; i < (1 << pScreenPriv->screen->fb[fb].depth); i++)
|
||||||
pixels[i] = i;
|
pixels[i] = i;
|
||||||
|
|
||||||
QueryColors (pCmap, (1 << pScreenPriv->screen->fb[fb].depth), pixels, colors);
|
QueryColors (pCmap, (1 << pScreenPriv->screen->fb[fb].depth), pixels, colors);
|
||||||
|
|
||||||
for (i = 0; i < (1 << pScreenPriv->screen->fb[fb].depth); i++)
|
for (i = 0; i < (1 << pScreenPriv->screen->fb[fb].depth); i++)
|
||||||
{
|
{
|
||||||
defs[i].pixel = i;
|
defs[i].pixel = i;
|
||||||
|
@ -187,7 +187,7 @@ KdInstallColormap (ColormapPtr pCmap)
|
||||||
pScreenPriv->pInstalledmap[fb] = pCmap;
|
pScreenPriv->pInstalledmap[fb] = pCmap;
|
||||||
|
|
||||||
KdSetColormap (pCmap->pScreen, fb);
|
KdSetColormap (pCmap->pScreen, fb);
|
||||||
|
|
||||||
/* Tell X clients of the new colormap */
|
/* Tell X clients of the new colormap */
|
||||||
WalkTree(pCmap->pScreen, TellGainedMap, (pointer) &(pCmap->mid));
|
WalkTree(pCmap->pScreen, TellGainedMap, (pointer) &(pCmap->mid));
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ KdInstallColormap (ColormapPtr pCmap)
|
||||||
/*
|
/*
|
||||||
* KdUninstallColormap
|
* KdUninstallColormap
|
||||||
*
|
*
|
||||||
* This function uninstalls a colormap by either installing
|
* This function uninstalls a colormap by either installing
|
||||||
* the default X colormap or erasing the installed colormap pointer.
|
* the default X colormap or erasing the installed colormap pointer.
|
||||||
* The default X colormap itself cannot be uninstalled.
|
* The default X colormap itself cannot be uninstalled.
|
||||||
*/
|
*/
|
||||||
|
@ -236,7 +236,7 @@ KdListInstalledColormaps (ScreenPtr pScreen, Colormap *pCmaps)
|
||||||
KdScreenPriv(pScreen);
|
KdScreenPriv(pScreen);
|
||||||
int fb;
|
int fb;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
for (fb = 0; fb < KD_MAX_FB && pScreenPriv->screen->fb[fb].depth; fb++)
|
for (fb = 0; fb < KD_MAX_FB && pScreenPriv->screen->fb[fb].depth; fb++)
|
||||||
{
|
{
|
||||||
if (pScreenPriv->pInstalledmap[fb])
|
if (pScreenPriv->pInstalledmap[fb])
|
||||||
|
@ -265,16 +265,16 @@ KdStoreColors (ColormapPtr pCmap, int ndef, xColorItem *pdefs)
|
||||||
|
|
||||||
if (pCmap != pScreenPriv->pInstalledmap[fb])
|
if (pCmap != pScreenPriv->pInstalledmap[fb])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!pScreenPriv->card->cfuncs->putColors)
|
if (!pScreenPriv->card->cfuncs->putColors)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (pScreenPriv->screen->fb[fb].depth > KD_MAX_PSEUDO_DEPTH)
|
if (pScreenPriv->screen->fb[fb].depth > KD_MAX_PSEUDO_DEPTH)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!pScreenPriv->enabled)
|
if (!pScreenPriv->enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Check for DirectColor or TrueColor being simulated on a PseudoColor device. */
|
/* Check for DirectColor or TrueColor being simulated on a PseudoColor device. */
|
||||||
pVisual = pCmap->pVisual;
|
pVisual = pCmap->pVisual;
|
||||||
if ((pVisual->class | DynamicClass) == DirectColor)
|
if ((pVisual->class | DynamicClass) == DirectColor)
|
||||||
|
@ -288,7 +288,7 @@ KdStoreColors (ColormapPtr pCmap, int ndef, xColorItem *pdefs)
|
||||||
}
|
}
|
||||||
|
|
||||||
(*pScreenPriv->card->cfuncs->putColors) (pCmap->pScreen, fb, ndef, pdefs);
|
(*pScreenPriv->card->cfuncs->putColors) (pCmap->pScreen, fb, ndef, pdefs);
|
||||||
|
|
||||||
/* recolor hardware cursor */
|
/* recolor hardware cursor */
|
||||||
if (pScreenPriv->card->cfuncs->recolorCursor)
|
if (pScreenPriv->card->cfuncs->recolorCursor)
|
||||||
(*pScreenPriv->card->cfuncs->recolorCursor) (pCmap->pScreen, ndef, pdefs);
|
(*pScreenPriv->card->cfuncs->recolorCursor) (pCmap->pScreen, ndef, pdefs);
|
||||||
|
|
|
@ -31,7 +31,7 @@ KdComputeCmapShift (unsigned long mask)
|
||||||
{
|
{
|
||||||
int shift;
|
int shift;
|
||||||
unsigned long bit;
|
unsigned long bit;
|
||||||
|
|
||||||
shift = 16;
|
shift = 16;
|
||||||
bit = 0x80000000;
|
bit = 0x80000000;
|
||||||
while (!(mask & bit))
|
while (!(mask & bit))
|
||||||
|
@ -47,7 +47,7 @@ KdComputeCmapShift (unsigned long mask)
|
||||||
void
|
void
|
||||||
KdAllocateCursorPixels (ScreenPtr pScreen,
|
KdAllocateCursorPixels (ScreenPtr pScreen,
|
||||||
int fb,
|
int fb,
|
||||||
CursorPtr pCursor,
|
CursorPtr pCursor,
|
||||||
Pixel *source,
|
Pixel *source,
|
||||||
Pixel *mask)
|
Pixel *mask)
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,7 @@ KdAllocateCursorPixels (ScreenPtr pScreen,
|
||||||
*/
|
*/
|
||||||
*source = ~0;
|
*source = ~0;
|
||||||
*mask = ~0;
|
*mask = ~0;
|
||||||
|
|
||||||
sourceColor.red = pCursor->foreRed;
|
sourceColor.red = pCursor->foreRed;
|
||||||
sourceColor.green = pCursor->foreGreen;
|
sourceColor.green = pCursor->foreGreen;
|
||||||
sourceColor.blue = pCursor->foreBlue;
|
sourceColor.blue = pCursor->foreBlue;
|
||||||
|
|
|
@ -148,9 +148,9 @@ KdSetRootClip (ScreenPtr pScreen, BOOL enable)
|
||||||
REGION_EMPTY(pScreen, &pWin->borderClip);
|
REGION_EMPTY(pScreen, &pWin->borderClip);
|
||||||
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
|
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
|
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
|
||||||
|
|
||||||
if (WasViewable)
|
if (WasViewable)
|
||||||
{
|
{
|
||||||
if (pWin->firstChild)
|
if (pWin->firstChild)
|
||||||
|
@ -185,7 +185,7 @@ void
|
||||||
KdDisableScreen (ScreenPtr pScreen)
|
KdDisableScreen (ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
KdScreenPriv(pScreen);
|
KdScreenPriv(pScreen);
|
||||||
|
|
||||||
if (!pScreenPriv->enabled)
|
if (!pScreenPriv->enabled)
|
||||||
return;
|
return;
|
||||||
if (!pScreenPriv->closed)
|
if (!pScreenPriv->closed)
|
||||||
|
@ -209,7 +209,7 @@ KdDoSwitchCmd (char *reason)
|
||||||
{
|
{
|
||||||
char *command = xalloc (strlen (kdSwitchCmd) +
|
char *command = xalloc (strlen (kdSwitchCmd) +
|
||||||
1 +
|
1 +
|
||||||
strlen (reason) +
|
strlen (reason) +
|
||||||
1);
|
1);
|
||||||
if (!command)
|
if (!command)
|
||||||
return;
|
return;
|
||||||
|
@ -392,7 +392,7 @@ KdParseScreen (KdScreenInfo *screen,
|
||||||
int fb;
|
int fb;
|
||||||
int i;
|
int i;
|
||||||
int pixels, mm;
|
int pixels, mm;
|
||||||
|
|
||||||
screen->dumb = kdDumbDriver;
|
screen->dumb = kdDumbDriver;
|
||||||
screen->softCursor = kdSoftCursor;
|
screen->softCursor = kdSoftCursor;
|
||||||
screen->origin = kdOrigin;
|
screen->origin = kdOrigin;
|
||||||
|
@ -409,16 +409,16 @@ KdParseScreen (KdScreenInfo *screen,
|
||||||
return;
|
return;
|
||||||
if (strlen (arg) >= sizeof (save))
|
if (strlen (arg) >= sizeof (save))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
arg = KdParseFindNext (arg, "x/@XY", save, &delim);
|
arg = KdParseFindNext (arg, "x/@XY", save, &delim);
|
||||||
if (!save[0])
|
if (!save[0])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pixels = atoi(save);
|
pixels = atoi(save);
|
||||||
mm = 0;
|
mm = 0;
|
||||||
|
|
||||||
if (delim == '/')
|
if (delim == '/')
|
||||||
{
|
{
|
||||||
arg = KdParseFindNext (arg, "x@XY", save, &delim);
|
arg = KdParseFindNext (arg, "x@XY", save, &delim);
|
||||||
|
@ -426,7 +426,7 @@ KdParseScreen (KdScreenInfo *screen,
|
||||||
return;
|
return;
|
||||||
mm = atoi(save);
|
mm = atoi(save);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
{
|
{
|
||||||
screen->width = pixels;
|
screen->width = pixels;
|
||||||
|
@ -476,7 +476,7 @@ KdParseScreen (KdScreenInfo *screen,
|
||||||
arg = KdParseFindNext (arg, "xY", save, &delim);
|
arg = KdParseFindNext (arg, "xY", save, &delim);
|
||||||
screen->randr |= RR_Reflect_Y;
|
screen->randr |= RR_Reflect_Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
fb = 0;
|
fb = 0;
|
||||||
while (fb < KD_MAX_FB)
|
while (fb < KD_MAX_FB)
|
||||||
{
|
{
|
||||||
|
@ -691,7 +691,7 @@ KdOsInit (KdOsFuncs *pOsFuncs)
|
||||||
kdOsFuncs = pOsFuncs;
|
kdOsFuncs = pOsFuncs;
|
||||||
if (pOsFuncs)
|
if (pOsFuncs)
|
||||||
{
|
{
|
||||||
if (serverGeneration == 1)
|
if (serverGeneration == 1)
|
||||||
{
|
{
|
||||||
KdDoSwitchCmd ("start");
|
KdDoSwitchCmd ("start");
|
||||||
if (pOsFuncs->Init)
|
if (pOsFuncs->Init)
|
||||||
|
@ -704,7 +704,7 @@ Bool
|
||||||
KdAllocatePrivates (ScreenPtr pScreen)
|
KdAllocatePrivates (ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
KdPrivScreenPtr pScreenPriv;
|
KdPrivScreenPtr pScreenPriv;
|
||||||
|
|
||||||
if (kdGeneration != serverGeneration)
|
if (kdGeneration != serverGeneration)
|
||||||
kdGeneration = serverGeneration;
|
kdGeneration = serverGeneration;
|
||||||
|
|
||||||
|
@ -741,20 +741,20 @@ KdCloseScreen (int index, ScreenPtr pScreen)
|
||||||
KdScreenInfo *screen = pScreenPriv->screen;
|
KdScreenInfo *screen = pScreenPriv->screen;
|
||||||
KdCardInfo *card = pScreenPriv->card;
|
KdCardInfo *card = pScreenPriv->card;
|
||||||
Bool ret;
|
Bool ret;
|
||||||
|
|
||||||
pScreenPriv->closed = TRUE;
|
pScreenPriv->closed = TRUE;
|
||||||
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
||||||
if(pScreen->CloseScreen)
|
if(pScreen->CloseScreen)
|
||||||
ret = (*pScreen->CloseScreen) (index, pScreen);
|
ret = (*pScreen->CloseScreen) (index, pScreen);
|
||||||
else
|
else
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
||||||
if (pScreenPriv->dpmsState != KD_DPMS_NORMAL)
|
if (pScreenPriv->dpmsState != KD_DPMS_NORMAL)
|
||||||
(*card->cfuncs->dpms) (pScreen, KD_DPMS_NORMAL);
|
(*card->cfuncs->dpms) (pScreen, KD_DPMS_NORMAL);
|
||||||
|
|
||||||
if (screen->mynum == card->selected)
|
if (screen->mynum == card->selected)
|
||||||
KdDisableScreen (pScreen);
|
KdDisableScreen (pScreen);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Restore video hardware when last screen is closed
|
* Restore video hardware when last screen is closed
|
||||||
*/
|
*/
|
||||||
|
@ -763,7 +763,7 @@ KdCloseScreen (int index, ScreenPtr pScreen)
|
||||||
if (kdEnabled && card->cfuncs->restore)
|
if (kdEnabled && card->cfuncs->restore)
|
||||||
(*card->cfuncs->restore) (card);
|
(*card->cfuncs->restore) (card);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pScreenPriv->screen->dumb && card->cfuncs->finiAccel)
|
if (!pScreenPriv->screen->dumb && card->cfuncs->finiAccel)
|
||||||
(*card->cfuncs->finiAccel) (pScreen);
|
(*card->cfuncs->finiAccel) (pScreen);
|
||||||
|
|
||||||
|
@ -794,9 +794,9 @@ KdCloseScreen (int index, ScreenPtr pScreen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pScreenPriv->screen->pScreen = 0;
|
pScreenPriv->screen->pScreen = 0;
|
||||||
|
|
||||||
xfree ((pointer) pScreenPriv);
|
xfree ((pointer) pScreenPriv);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -806,10 +806,10 @@ KdSaveScreen (ScreenPtr pScreen, int on)
|
||||||
{
|
{
|
||||||
KdScreenPriv(pScreen);
|
KdScreenPriv(pScreen);
|
||||||
int dpmsState;
|
int dpmsState;
|
||||||
|
|
||||||
if (!pScreenPriv->card->cfuncs->dpms)
|
if (!pScreenPriv->card->cfuncs->dpms)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
dpmsState = pScreenPriv->dpmsState;
|
dpmsState = pScreenPriv->dpmsState;
|
||||||
switch (on) {
|
switch (on) {
|
||||||
case SCREEN_SAVER_OFF:
|
case SCREEN_SAVER_OFF:
|
||||||
|
@ -861,7 +861,7 @@ KdSetSubpixelOrder (ScreenPtr pScreen, Rotation randr)
|
||||||
int subpixel_order = screen->subpixel_order;
|
int subpixel_order = screen->subpixel_order;
|
||||||
Rotation subpixel_dir;
|
Rotation subpixel_dir;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
int subpixel_order;
|
int subpixel_order;
|
||||||
Rotation direction;
|
Rotation direction;
|
||||||
|
@ -874,7 +874,7 @@ KdSetSubpixelOrder (ScreenPtr pScreen, Rotation randr)
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
int bit;
|
int bit;
|
||||||
int normal;
|
int normal;
|
||||||
int reflect;
|
int reflect;
|
||||||
} reflects[] = {
|
} reflects[] = {
|
||||||
{ RR_Reflect_X, SubPixelHorizontalRGB, SubPixelHorizontalBGR },
|
{ RR_Reflect_X, SubPixelHorizontalRGB, SubPixelHorizontalBGR },
|
||||||
|
@ -882,7 +882,7 @@ KdSetSubpixelOrder (ScreenPtr pScreen, Rotation randr)
|
||||||
{ RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalBGR },
|
{ RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalBGR },
|
||||||
{ RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalRGB },
|
{ RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalRGB },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* map subpixel to direction */
|
/* map subpixel to direction */
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
if (orders[i].subpixel_order == subpixel_order)
|
if (orders[i].subpixel_order == subpixel_order)
|
||||||
|
@ -890,7 +890,7 @@ KdSetSubpixelOrder (ScreenPtr pScreen, Rotation randr)
|
||||||
if (i < 4)
|
if (i < 4)
|
||||||
{
|
{
|
||||||
subpixel_dir = KdAddRotation (randr & RR_Rotate_All, orders[i].direction);
|
subpixel_dir = KdAddRotation (randr & RR_Rotate_All, orders[i].direction);
|
||||||
|
|
||||||
/* map back to subpixel order */
|
/* map back to subpixel order */
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
if (orders[i].direction & subpixel_dir)
|
if (orders[i].direction & subpixel_dir)
|
||||||
|
@ -931,7 +931,7 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
|
||||||
KdAllocatePrivates (pScreen);
|
KdAllocatePrivates (pScreen);
|
||||||
|
|
||||||
pScreenPriv = KdGetScreenPriv(pScreen);
|
pScreenPriv = KdGetScreenPriv(pScreen);
|
||||||
|
|
||||||
if (!rotated)
|
if (!rotated)
|
||||||
{
|
{
|
||||||
width = screen->width;
|
width = screen->width;
|
||||||
|
@ -963,10 +963,10 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
|
||||||
* our GC functions; fbFinishScreenInit initializes MI
|
* our GC functions; fbFinishScreenInit initializes MI
|
||||||
* backing store
|
* backing store
|
||||||
*/
|
*/
|
||||||
if (!fbSetupScreen (pScreen,
|
if (!fbSetupScreen (pScreen,
|
||||||
screen->fb[0].frameBuffer,
|
screen->fb[0].frameBuffer,
|
||||||
width, height,
|
width, height,
|
||||||
monitorResolution, monitorResolution,
|
monitorResolution, monitorResolution,
|
||||||
screen->fb[0].pixelStride,
|
screen->fb[0].pixelStride,
|
||||||
screen->fb[0].bitsPerPixel))
|
screen->fb[0].bitsPerPixel))
|
||||||
{
|
{
|
||||||
|
@ -980,17 +980,17 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
|
||||||
pScreen->UninstallColormap = KdUninstallColormap;
|
pScreen->UninstallColormap = KdUninstallColormap;
|
||||||
pScreen->ListInstalledColormaps = KdListInstalledColormaps;
|
pScreen->ListInstalledColormaps = KdListInstalledColormaps;
|
||||||
pScreen->StoreColors = KdStoreColors;
|
pScreen->StoreColors = KdStoreColors;
|
||||||
|
|
||||||
pScreen->SaveScreen = KdSaveScreen;
|
pScreen->SaveScreen = KdSaveScreen;
|
||||||
pScreen->CreateWindow = KdCreateWindow;
|
pScreen->CreateWindow = KdCreateWindow;
|
||||||
|
|
||||||
#if KD_MAX_FB > 1
|
#if KD_MAX_FB > 1
|
||||||
if (screen->fb[1].depth)
|
if (screen->fb[1].depth)
|
||||||
{
|
{
|
||||||
if (!fbOverlayFinishScreenInit (pScreen,
|
if (!fbOverlayFinishScreenInit (pScreen,
|
||||||
screen->fb[0].frameBuffer,
|
screen->fb[0].frameBuffer,
|
||||||
screen->fb[1].frameBuffer,
|
screen->fb[1].frameBuffer,
|
||||||
width, height,
|
width, height,
|
||||||
monitorResolution, monitorResolution,
|
monitorResolution, monitorResolution,
|
||||||
screen->fb[0].pixelStride,
|
screen->fb[0].pixelStride,
|
||||||
screen->fb[1].pixelStride,
|
screen->fb[1].pixelStride,
|
||||||
|
@ -1005,8 +1005,8 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (!fbFinishScreenInit (pScreen,
|
if (!fbFinishScreenInit (pScreen,
|
||||||
screen->fb[0].frameBuffer,
|
screen->fb[0].frameBuffer,
|
||||||
width, height,
|
width, height,
|
||||||
monitorResolution, monitorResolution,
|
monitorResolution, monitorResolution,
|
||||||
screen->fb[0].pixelStride,
|
screen->fb[0].pixelStride,
|
||||||
|
@ -1015,7 +1015,7 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fix screen sizes; for some reason mi takes dpi instead of mm.
|
* Fix screen sizes; for some reason mi takes dpi instead of mm.
|
||||||
* Rounding errors are annoying
|
* Rounding errors are annoying
|
||||||
|
@ -1028,14 +1028,14 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
|
||||||
pScreen->mmHeight = *height_mmp;
|
pScreen->mmHeight = *height_mmp;
|
||||||
else
|
else
|
||||||
*height_mmp = pScreen->mmHeight;
|
*height_mmp = pScreen->mmHeight;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Plug in our own block/wakeup handlers.
|
* Plug in our own block/wakeup handlers.
|
||||||
* miScreenInit installs NoopDDA in both places
|
* miScreenInit installs NoopDDA in both places
|
||||||
*/
|
*/
|
||||||
pScreen->BlockHandler = KdBlockHandler;
|
pScreen->BlockHandler = KdBlockHandler;
|
||||||
pScreen->WakeupHandler = KdWakeupHandler;
|
pScreen->WakeupHandler = KdWakeupHandler;
|
||||||
|
|
||||||
#ifdef RENDER
|
#ifdef RENDER
|
||||||
if (!fbPictureInit (pScreen, 0, 0))
|
if (!fbPictureInit (pScreen, 0, 0))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1043,26 +1043,26 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
|
||||||
if (card->cfuncs->initScreen)
|
if (card->cfuncs->initScreen)
|
||||||
if (!(*card->cfuncs->initScreen) (pScreen))
|
if (!(*card->cfuncs->initScreen) (pScreen))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (!screen->dumb && card->cfuncs->initAccel)
|
if (!screen->dumb && card->cfuncs->initAccel)
|
||||||
if (!(*card->cfuncs->initAccel) (pScreen))
|
if (!(*card->cfuncs->initAccel) (pScreen))
|
||||||
screen->dumb = TRUE;
|
screen->dumb = TRUE;
|
||||||
|
|
||||||
if (card->cfuncs->finishInitScreen)
|
if (card->cfuncs->finishInitScreen)
|
||||||
if (!(*card->cfuncs->finishInitScreen) (pScreen))
|
if (!(*card->cfuncs->finishInitScreen) (pScreen))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
fbInitValidateTree (pScreen);
|
fbInitValidateTree (pScreen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
pScreen->backingStoreSupport = Always;
|
pScreen->backingStoreSupport = Always;
|
||||||
miInitializeBackingStore (pScreen);
|
miInitializeBackingStore (pScreen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wrap CloseScreen, the order now is:
|
* Wrap CloseScreen, the order now is:
|
||||||
* KdCloseScreen
|
* KdCloseScreen
|
||||||
* miBSCloseScreen
|
* miBSCloseScreen
|
||||||
|
@ -1073,9 +1073,9 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
|
||||||
|
|
||||||
pScreenPriv->CreateScreenResources = pScreen->CreateScreenResources;
|
pScreenPriv->CreateScreenResources = pScreen->CreateScreenResources;
|
||||||
pScreen->CreateScreenResources = KdCreateScreenResources;
|
pScreen->CreateScreenResources = KdCreateScreenResources;
|
||||||
|
|
||||||
if (screen->softCursor ||
|
if (screen->softCursor ||
|
||||||
!card->cfuncs->initCursor ||
|
!card->cfuncs->initCursor ||
|
||||||
!(*card->cfuncs->initCursor) (pScreen))
|
!(*card->cfuncs->initCursor) (pScreen))
|
||||||
{
|
{
|
||||||
/* Use MI for cursor display and event queueing. */
|
/* Use MI for cursor display and event queueing. */
|
||||||
|
@ -1083,7 +1083,7 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
|
||||||
miDCInitialize(pScreen, &kdPointerScreenFuncs);
|
miDCInitialize(pScreen, &kdPointerScreenFuncs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!fbCreateDefColormap (pScreen))
|
if (!fbCreateDefColormap (pScreen))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1100,7 +1100,7 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
|
||||||
if(kdOsFuncs->Enable)
|
if(kdOsFuncs->Enable)
|
||||||
(*kdOsFuncs->Enable) ();
|
(*kdOsFuncs->Enable) ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (screen->mynum == card->selected)
|
if (screen->mynum == card->selected)
|
||||||
{
|
{
|
||||||
if(card->cfuncs->preserve)
|
if(card->cfuncs->preserve)
|
||||||
|
@ -1115,7 +1115,7 @@ KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
|
||||||
if (!screen->dumb && card->cfuncs->enableAccel)
|
if (!screen->dumb && card->cfuncs->enableAccel)
|
||||||
(*card->cfuncs->enableAccel) (pScreen);
|
(*card->cfuncs->enableAccel) (pScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1126,9 +1126,9 @@ KdInitScreen (ScreenInfo *pScreenInfo,
|
||||||
char **argv)
|
char **argv)
|
||||||
{
|
{
|
||||||
KdCardInfo *card = screen->card;
|
KdCardInfo *card = screen->card;
|
||||||
|
|
||||||
(*card->cfuncs->scrinit) (screen);
|
(*card->cfuncs->scrinit) (screen);
|
||||||
|
|
||||||
if (!card->cfuncs->initAccel)
|
if (!card->cfuncs->initAccel)
|
||||||
screen->dumb = TRUE;
|
screen->dumb = TRUE;
|
||||||
if (!card->cfuncs->initCursor)
|
if (!card->cfuncs->initCursor)
|
||||||
|
@ -1166,26 +1166,26 @@ KdSetPixmapFormats (ScreenInfo *pScreenInfo)
|
||||||
bpp = 32;
|
bpp = 32;
|
||||||
if (!depthToBpp[screen->fb[fb].depth])
|
if (!depthToBpp[screen->fb[fb].depth])
|
||||||
depthToBpp[screen->fb[fb].depth] = bpp;
|
depthToBpp[screen->fb[fb].depth] = bpp;
|
||||||
else if (depthToBpp[screen->fb[fb].depth] != bpp)
|
else if (depthToBpp[screen->fb[fb].depth] != bpp)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill in additional formats
|
* Fill in additional formats
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < NUM_KD_DEPTHS; i++)
|
for (i = 0; i < NUM_KD_DEPTHS; i++)
|
||||||
if (!depthToBpp[kdDepths[i].depth])
|
if (!depthToBpp[kdDepths[i].depth])
|
||||||
depthToBpp[kdDepths[i].depth] = kdDepths[i].bpp;
|
depthToBpp[kdDepths[i].depth] = kdDepths[i].bpp;
|
||||||
|
|
||||||
pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
|
pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
|
||||||
pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
|
pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
|
||||||
pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
|
pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
|
||||||
pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
|
pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
|
||||||
|
|
||||||
pScreenInfo->numPixmapFormats = 0;
|
pScreenInfo->numPixmapFormats = 0;
|
||||||
|
|
||||||
for (i = 1; i <= 32; i++)
|
for (i = 1; i <= 32; i++)
|
||||||
{
|
{
|
||||||
if (depthToBpp[i])
|
if (depthToBpp[i])
|
||||||
|
@ -1196,7 +1196,7 @@ KdSetPixmapFormats (ScreenInfo *pScreenInfo)
|
||||||
format->scanlinePad = BITMAP_SCANLINE_PAD;
|
format->scanlinePad = BITMAP_SCANLINE_PAD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1215,7 +1215,7 @@ KdAddScreen (ScreenInfo *pScreenInfo,
|
||||||
unsigned long visuals;
|
unsigned long visuals;
|
||||||
Pixel rm, gm, bm;
|
Pixel rm, gm, bm;
|
||||||
int fb;
|
int fb;
|
||||||
|
|
||||||
visuals = 0;
|
visuals = 0;
|
||||||
rm = gm = bm = 0;
|
rm = gm = bm = 0;
|
||||||
for (fb = 0; fb < KD_MAX_FB && screen->fb[fb].depth; fb++)
|
for (fb = 0; fb < KD_MAX_FB && screen->fb[fb].depth; fb++)
|
||||||
|
@ -1236,7 +1236,7 @@ KdAddScreen (ScreenInfo *pScreenInfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
kdCurrentScreen = screen;
|
kdCurrentScreen = screen;
|
||||||
|
|
||||||
AddScreen (KdScreenInit, argc, argv);
|
AddScreen (KdScreenInit, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1292,14 +1292,14 @@ KdInitOutput (ScreenInfo *pScreenInfo,
|
||||||
KdInitScreen (pScreenInfo, screen, argc, argv);
|
KdInitScreen (pScreenInfo, screen, argc, argv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Merge the various pixmap formats together, this can fail
|
* Merge the various pixmap formats together, this can fail
|
||||||
* when two screens share depth but not bitsPerPixel
|
* when two screens share depth but not bitsPerPixel
|
||||||
*/
|
*/
|
||||||
if (!KdSetPixmapFormats (pScreenInfo))
|
if (!KdSetPixmapFormats (pScreenInfo))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add all of the screens
|
* Add all of the screens
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -242,7 +242,7 @@ struct _KdPointerInfo {
|
||||||
int z;
|
int z;
|
||||||
int flags;
|
int flags;
|
||||||
int absrel;
|
int absrel;
|
||||||
} heldEvent;
|
} heldEvent;
|
||||||
unsigned char buttonState;
|
unsigned char buttonState;
|
||||||
Bool transformCoordinates;
|
Bool transformCoordinates;
|
||||||
int pressureThreshold;
|
int pressureThreshold;
|
||||||
|
@ -421,7 +421,7 @@ KdStoreColors (ColormapPtr pCmap, int ndef, xColorItem *pdefs);
|
||||||
void
|
void
|
||||||
KdAllocateCursorPixels (ScreenPtr pScreen,
|
KdAllocateCursorPixels (ScreenPtr pScreen,
|
||||||
int fb,
|
int fb,
|
||||||
CursorPtr pCursor,
|
CursorPtr pCursor,
|
||||||
Pixel *source,
|
Pixel *source,
|
||||||
Pixel *mask);
|
Pixel *mask);
|
||||||
|
|
||||||
|
@ -517,13 +517,13 @@ void
|
||||||
KdInitOutput (ScreenInfo *pScreenInfo,
|
KdInitOutput (ScreenInfo *pScreenInfo,
|
||||||
int argc,
|
int argc,
|
||||||
char **argv);
|
char **argv);
|
||||||
|
|
||||||
void
|
void
|
||||||
KdSetSubpixelOrder (ScreenPtr pScreen, Rotation randr);
|
KdSetSubpixelOrder (ScreenPtr pScreen, Rotation randr);
|
||||||
|
|
||||||
void
|
void
|
||||||
KdBacktrace (int signum);
|
KdBacktrace (int signum);
|
||||||
|
|
||||||
/* kinfo.c */
|
/* kinfo.c */
|
||||||
KdCardInfo *
|
KdCardInfo *
|
||||||
KdCardInfoAdd (KdCardFuncs *funcs,
|
KdCardInfoAdd (KdCardFuncs *funcs,
|
||||||
|
@ -584,7 +584,7 @@ _KdEnqueuePointerEvent(KdPointerInfo *pi, int type, int x, int y, int z,
|
||||||
|
|
||||||
void
|
void
|
||||||
KdReleaseAllKeys (void);
|
KdReleaseAllKeys (void);
|
||||||
|
|
||||||
void
|
void
|
||||||
KdSetLed (KdKeyboardInfo *ki, int led, Bool on);
|
KdSetLed (KdKeyboardInfo *ki, int led, Bool on);
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ KdBlockHandler (int screen,
|
||||||
pointer readmask);
|
pointer readmask);
|
||||||
|
|
||||||
void
|
void
|
||||||
KdWakeupHandler (int screen,
|
KdWakeupHandler (int screen,
|
||||||
pointer data,
|
pointer data,
|
||||||
unsigned long result,
|
unsigned long result,
|
||||||
pointer readmask);
|
pointer readmask);
|
||||||
|
@ -669,14 +669,14 @@ KdTuneMode (KdScreenInfo *screen,
|
||||||
|
|
||||||
#ifdef RANDR
|
#ifdef RANDR
|
||||||
Bool
|
Bool
|
||||||
KdRandRGetInfo (ScreenPtr pScreen,
|
KdRandRGetInfo (ScreenPtr pScreen,
|
||||||
int randr,
|
int randr,
|
||||||
Bool (*supported) (ScreenPtr pScreen,
|
Bool (*supported) (ScreenPtr pScreen,
|
||||||
const KdMonitorTiming *));
|
const KdMonitorTiming *));
|
||||||
|
|
||||||
const KdMonitorTiming *
|
const KdMonitorTiming *
|
||||||
KdRandRGetTiming (ScreenPtr pScreen,
|
KdRandRGetTiming (ScreenPtr pScreen,
|
||||||
Bool (*supported) (ScreenPtr pScreen,
|
Bool (*supported) (ScreenPtr pScreen,
|
||||||
const KdMonitorTiming *),
|
const KdMonitorTiming *),
|
||||||
int rate,
|
int rate,
|
||||||
RRScreenSizePtr pSize);
|
RRScreenSizePtr pSize);
|
||||||
|
@ -691,7 +691,7 @@ KdShadowFbFree (KdScreenInfo *screen, int fb);
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
KdShadowSet (ScreenPtr pScreen, int randr, ShadowUpdateProc update, ShadowWindowProc window);
|
KdShadowSet (ScreenPtr pScreen, int randr, ShadowUpdateProc update, ShadowWindowProc window);
|
||||||
|
|
||||||
void
|
void
|
||||||
KdShadowUnset (ScreenPtr pScreen);
|
KdShadowUnset (ScreenPtr pScreen);
|
||||||
|
|
||||||
|
|
|
@ -155,10 +155,10 @@ KdFreePointer(KdPointerInfo *pi)
|
||||||
|
|
||||||
if (prev)
|
if (prev)
|
||||||
xfree(prev);
|
xfree(prev);
|
||||||
|
|
||||||
xfree(pi);
|
xfree(pi);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
KdFreeKeyboard(KdKeyboardInfo *ki)
|
KdFreeKeyboard(KdKeyboardInfo *ki)
|
||||||
{
|
{
|
||||||
|
|
|
@ -76,7 +76,7 @@ static KdPointerMatrix kdPointerMatrix = {
|
||||||
};
|
};
|
||||||
|
|
||||||
void KdResetInputMachine (void);
|
void KdResetInputMachine (void);
|
||||||
|
|
||||||
#define KD_MAX_INPUT_FDS 8
|
#define KD_MAX_INPUT_FDS 8
|
||||||
|
|
||||||
typedef struct _kdInputFd {
|
typedef struct _kdInputFd {
|
||||||
|
@ -105,7 +105,7 @@ static void
|
||||||
KdBlockSigio (void)
|
KdBlockSigio (void)
|
||||||
{
|
{
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
|
|
||||||
sigemptyset (&set);
|
sigemptyset (&set);
|
||||||
sigaddset (&set, SIGIO);
|
sigaddset (&set, SIGIO);
|
||||||
sigprocmask (SIG_BLOCK, &set, 0);
|
sigprocmask (SIG_BLOCK, &set, 0);
|
||||||
|
@ -115,7 +115,7 @@ static void
|
||||||
KdUnblockSigio (void)
|
KdUnblockSigio (void)
|
||||||
{
|
{
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
|
|
||||||
sigemptyset (&set);
|
sigemptyset (&set);
|
||||||
sigaddset (&set, SIGIO);
|
sigaddset (&set, SIGIO);
|
||||||
sigprocmask (SIG_UNBLOCK, &set, 0);
|
sigprocmask (SIG_UNBLOCK, &set, 0);
|
||||||
|
@ -175,7 +175,7 @@ KdAddFd (int fd)
|
||||||
{
|
{
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
sigset_t set;
|
sigset_t set;
|
||||||
|
|
||||||
kdnFds++;
|
kdnFds++;
|
||||||
fcntl (fd, F_SETOWN, getpid());
|
fcntl (fd, F_SETOWN, getpid());
|
||||||
KdNonBlockFd (fd);
|
KdNonBlockFd (fd);
|
||||||
|
@ -196,7 +196,7 @@ KdRemoveFd (int fd)
|
||||||
{
|
{
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
kdnFds--;
|
kdnFds--;
|
||||||
RemoveEnabledDevice (fd);
|
RemoveEnabledDevice (fd);
|
||||||
flags = fcntl (fd, F_GETFL);
|
flags = fcntl (fd, F_GETFL);
|
||||||
|
@ -324,7 +324,7 @@ KdEnableInput (void)
|
||||||
InternalEvent ev;
|
InternalEvent ev;
|
||||||
KdKeyboardInfo *ki;
|
KdKeyboardInfo *ki;
|
||||||
KdPointerInfo *pi;
|
KdPointerInfo *pi;
|
||||||
|
|
||||||
kdInputEnabled = TRUE;
|
kdInputEnabled = TRUE;
|
||||||
|
|
||||||
for (ki = kdKeyboards; ki; ki = ki->next) {
|
for (ki = kdKeyboards; ki; ki = ki->next) {
|
||||||
|
@ -352,7 +352,7 @@ KdFindKeyboardDriver (char *name)
|
||||||
/* ask a stupid question ... */
|
/* ask a stupid question ... */
|
||||||
if (!name)
|
if (!name)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for (ret = kdKeyboardDrivers; ret; ret = ret->next) {
|
for (ret = kdKeyboardDrivers; ret; ret = ret->next) {
|
||||||
if (strcmp(ret->name, name) == 0)
|
if (strcmp(ret->name, name) == 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -487,11 +487,11 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff)
|
||||||
pi->name ? pi->name : "Generic KDrive Pointer");
|
pi->name ? pi->name : "Generic KDrive Pointer");
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
case DEVICE_ON:
|
case DEVICE_ON:
|
||||||
if (pDev->on == TRUE)
|
if (pDev->on == TRUE)
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
if (!pi->driver->Enable) {
|
if (!pi->driver->Enable) {
|
||||||
ErrorF("no enable function\n");
|
ErrorF("no enable function\n");
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
|
@ -538,7 +538,7 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff)
|
||||||
(*pi->driver->Fini) (pi);
|
(*pi->driver->Fini) (pi);
|
||||||
|
|
||||||
KdRemovePointer(pi);
|
KdRemovePointer(pi);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,7 +557,7 @@ KdBell (int volume, DeviceIntPtr pDev, pointer arg, int something)
|
||||||
{
|
{
|
||||||
KeybdCtrl *ctrl = arg;
|
KeybdCtrl *ctrl = arg;
|
||||||
KdKeyboardInfo *ki = NULL;
|
KdKeyboardInfo *ki = NULL;
|
||||||
|
|
||||||
for (ki = kdKeyboards; ki; ki = ki->next) {
|
for (ki = kdKeyboards; ki; ki = ki->next) {
|
||||||
if (ki->dixdev && ki->dixdev->id == pDev->id)
|
if (ki->dixdev && ki->dixdev->id == pDev->id)
|
||||||
break;
|
break;
|
||||||
|
@ -565,7 +565,7 @@ KdBell (int volume, DeviceIntPtr pDev, pointer arg, int something)
|
||||||
|
|
||||||
if (!ki || !ki->dixdev || ki->dixdev->id != pDev->id || !ki->driver)
|
if (!ki || !ki->dixdev || ki->dixdev->id != pDev->id || !ki->driver)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
KdRingBell(ki, volume, ctrl->bell_pitch, ctrl->bell_duration);
|
KdRingBell(ki, volume, ctrl->bell_pitch, ctrl->bell_duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,7 +590,7 @@ KdRingBell(KdKeyboardInfo *ki, int volume, int pitch, int duration)
|
||||||
{
|
{
|
||||||
if (!ki || !ki->driver || !ki->driver->Bell)
|
if (!ki || !ki->driver || !ki->driver->Bell)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (kdInputEnabled)
|
if (kdInputEnabled)
|
||||||
(*ki->driver->Bell) (ki, volume, pitch, duration);
|
(*ki->driver->Bell) (ki, volume, pitch, duration);
|
||||||
}
|
}
|
||||||
|
@ -691,7 +691,7 @@ KdKbdCtrl (DeviceIntPtr pDevice, KeybdCtrl *ctrl)
|
||||||
|
|
||||||
KdSetLeds(ki, ctrl->leds);
|
KdSetLeds(ki, ctrl->leds);
|
||||||
ki->bellPitch = ctrl->bell_pitch;
|
ki->bellPitch = ctrl->bell_pitch;
|
||||||
ki->bellDuration = ctrl->bell_duration;
|
ki->bellDuration = ctrl->bell_duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern KeybdCtrl defaultKeyboardControl;
|
extern KeybdCtrl defaultKeyboardControl;
|
||||||
|
@ -794,7 +794,7 @@ KdKeyboardProc(DeviceIntPtr pDevice, int onoff)
|
||||||
pDev->on = FALSE;
|
pDev->on = FALSE;
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEVICE_CLOSE:
|
case DEVICE_CLOSE:
|
||||||
|
@ -935,7 +935,7 @@ KdAddKeyboard (KdKeyboardInfo *ki)
|
||||||
|
|
||||||
if (!ki)
|
if (!ki)
|
||||||
return !Success;
|
return !Success;
|
||||||
|
|
||||||
ki->dixdev = AddInputDevice(serverClient, KdKeyboardProc, TRUE);
|
ki->dixdev = AddInputDevice(serverClient, KdKeyboardProc, TRUE);
|
||||||
if (!ki->dixdev) {
|
if (!ki->dixdev) {
|
||||||
ErrorF("Couldn't register keyboard device %s\n",
|
ErrorF("Couldn't register keyboard device %s\n",
|
||||||
|
@ -1042,12 +1042,12 @@ KdRemovePointer (KdPointerInfo *pi)
|
||||||
KdFreePointer(pi);
|
KdFreePointer(pi);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* You can call your kdriver server with something like:
|
* You can call your kdriver server with something like:
|
||||||
* $ ./hw/kdrive/yourserver/X :1 -mouse evdev,,device=/dev/input/event4 -keybd
|
* $ ./hw/kdrive/yourserver/X :1 -mouse evdev,,device=/dev/input/event4 -keybd
|
||||||
* evdev,,device=/dev/input/event1,xkbmodel=abnt2,xkblayout=br
|
* evdev,,device=/dev/input/event1,xkbmodel=abnt2,xkblayout=br
|
||||||
*/
|
*/
|
||||||
static Bool
|
static Bool
|
||||||
KdGetOptions (InputOption **options, char *string)
|
KdGetOptions (InputOption **options, char *string)
|
||||||
{
|
{
|
||||||
InputOption *newopt = NULL, **tmpo = NULL;
|
InputOption *newopt = NULL, **tmpo = NULL;
|
||||||
|
@ -1058,7 +1058,7 @@ KdGetOptions (InputOption **options, char *string)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
for (tmpo = options; *tmpo; tmpo = &(*tmpo)->next)
|
for (tmpo = options; *tmpo; tmpo = &(*tmpo)->next)
|
||||||
; /* Hello, I'm here */
|
; /* Hello, I'm here */
|
||||||
*tmpo = newopt;
|
*tmpo = newopt;
|
||||||
|
|
||||||
if (strchr(string, '='))
|
if (strchr(string, '='))
|
||||||
|
@ -1099,7 +1099,7 @@ KdParseKbdOptions (KdKeyboardInfo *ki)
|
||||||
else if (!strcasecmp (option->key, "device"))
|
else if (!strcasecmp (option->key, "device"))
|
||||||
ki->path = strdup(option->value);
|
ki->path = strdup(option->value);
|
||||||
else
|
else
|
||||||
ErrorF("Kbd option key (%s) of value (%s) not assigned!\n",
|
ErrorF("Kbd option key (%s) of value (%s) not assigned!\n",
|
||||||
option->key, option->value);
|
option->key, option->value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1160,11 +1160,11 @@ KdParseKeyboard (char *arg)
|
||||||
{
|
{
|
||||||
arg = KdParseFindNext (arg, ",", save, &delim);
|
arg = KdParseFindNext (arg, ",", save, &delim);
|
||||||
|
|
||||||
if (!KdGetOptions(&options, save))
|
if (!KdGetOptions(&options, save))
|
||||||
{
|
{
|
||||||
KdFreeKeyboard(ki);
|
KdFreeKeyboard(ki);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options)
|
if (options)
|
||||||
|
@ -1196,7 +1196,7 @@ KdParsePointerOptions (KdPointerInfo *pi)
|
||||||
else if (!strcasecmp (option->key, "protocol"))
|
else if (!strcasecmp (option->key, "protocol"))
|
||||||
pi->protocol = strdup(option->value);
|
pi->protocol = strdup(option->value);
|
||||||
else
|
else
|
||||||
ErrorF("Pointer option key (%s) of value (%s) not assigned!\n",
|
ErrorF("Pointer option key (%s) of value (%s) not assigned!\n",
|
||||||
option->key, option->value);
|
option->key, option->value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1448,7 +1448,7 @@ KdInitInput (void)
|
||||||
* <> -> (deliver) synthetic_2_down_1
|
* <> -> (deliver) synthetic_2_down_1
|
||||||
* k -> (deliver) synthetic_2_down_1
|
* k -> (deliver) synthetic_2_down_1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef enum _inputClass {
|
typedef enum _inputClass {
|
||||||
down_1, up_1,
|
down_1, up_1,
|
||||||
down_2, up_2,
|
down_2, up_2,
|
||||||
|
@ -1628,7 +1628,7 @@ KdInsideEmulationWindow (KdPointerInfo *pi, int x, int y, int z)
|
||||||
return (abs (pi->emulationDx) < EMULATION_WINDOW &&
|
return (abs (pi->emulationDx) < EMULATION_WINDOW &&
|
||||||
abs (pi->emulationDy) < EMULATION_WINDOW);
|
abs (pi->emulationDy) < EMULATION_WINDOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
static KdInputClass
|
static KdInputClass
|
||||||
KdClassifyInput (KdPointerInfo *pi, int type, int x, int y, int z, int b)
|
KdClassifyInput (KdPointerInfo *pi, int type, int x, int y, int z, int b)
|
||||||
{
|
{
|
||||||
|
@ -1906,7 +1906,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
|
||||||
|
|
||||||
if (!pi)
|
if (!pi)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ms = GetTimeInMillis();
|
ms = GetTimeInMillis();
|
||||||
|
|
||||||
/* we don't need to transform z, so we don't. */
|
/* we don't need to transform z, so we don't. */
|
||||||
|
@ -2001,7 +2001,7 @@ KdBlockHandler (int screen,
|
||||||
if (pi->timeoutPending)
|
if (pi->timeoutPending)
|
||||||
{
|
{
|
||||||
int ms;
|
int ms;
|
||||||
|
|
||||||
ms = pi->emulationTimeout - GetTimeInMillis ();
|
ms = pi->emulationTimeout - GetTimeInMillis ();
|
||||||
if (ms < 1)
|
if (ms < 1)
|
||||||
ms = 1;
|
ms = 1;
|
||||||
|
@ -2020,7 +2020,7 @@ KdBlockHandler (int screen,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
KdWakeupHandler (int screen,
|
KdWakeupHandler (int screen,
|
||||||
pointer data,
|
pointer data,
|
||||||
unsigned long lresult,
|
unsigned long lresult,
|
||||||
pointer readmask)
|
pointer readmask)
|
||||||
|
@ -2029,7 +2029,7 @@ KdWakeupHandler (int screen,
|
||||||
fd_set *pReadmask = (fd_set *) readmask;
|
fd_set *pReadmask = (fd_set *) readmask;
|
||||||
int i;
|
int i;
|
||||||
KdPointerInfo *pi;
|
KdPointerInfo *pi;
|
||||||
|
|
||||||
if (kdInputEnabled && result > 0)
|
if (kdInputEnabled && result > 0)
|
||||||
{
|
{
|
||||||
for (i = 0; i < kdNumInputFds; i++)
|
for (i = 0; i < kdNumInputFds; i++)
|
||||||
|
@ -2069,13 +2069,13 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
|
||||||
int best_x, best_y;
|
int best_x, best_y;
|
||||||
int n_best_x, n_best_y;
|
int n_best_x, n_best_y;
|
||||||
CARD32 ms;
|
CARD32 ms;
|
||||||
|
|
||||||
if (kdDisableZaphod || screenInfo.numScreens <= 1)
|
if (kdDisableZaphod || screenInfo.numScreens <= 1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (0 <= *x && *x < pScreen->width && 0 <= *y && *y < pScreen->height)
|
if (0 <= *x && *x < pScreen->width && 0 <= *y && *y < pScreen->height)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
ms = GetTimeInMillis ();
|
ms = GetTimeInMillis ();
|
||||||
if (kdOffScreen && (int) (ms - kdOffScreenTime) < 1000)
|
if (kdOffScreen && (int) (ms - kdOffScreenTime) < 1000)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -2088,7 +2088,7 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
|
||||||
for (n = 0; n < screenInfo.numScreens; n++)
|
for (n = 0; n < screenInfo.numScreens; n++)
|
||||||
{
|
{
|
||||||
pNewScreen = screenInfo.screens[n];
|
pNewScreen = screenInfo.screens[n];
|
||||||
if (pNewScreen == pScreen)
|
if (pNewScreen == pScreen)
|
||||||
continue;
|
continue;
|
||||||
dx = KdScreenOrigin(pNewScreen)->x - KdScreenOrigin(pScreen)->x;
|
dx = KdScreenOrigin(pNewScreen)->x - KdScreenOrigin(pScreen)->x;
|
||||||
dy = KdScreenOrigin(pNewScreen)->y - KdScreenOrigin(pScreen)->y;
|
dy = KdScreenOrigin(pNewScreen)->y - KdScreenOrigin(pScreen)->y;
|
||||||
|
@ -2130,17 +2130,17 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
|
||||||
if (n_best_x == -1)
|
if (n_best_x == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
pNewScreen = screenInfo.screens[n_best_x];
|
pNewScreen = screenInfo.screens[n_best_x];
|
||||||
|
|
||||||
if (*x < 0)
|
if (*x < 0)
|
||||||
*x += pNewScreen->width;
|
*x += pNewScreen->width;
|
||||||
if (*y < 0)
|
if (*y < 0)
|
||||||
*y += pNewScreen->height;
|
*y += pNewScreen->height;
|
||||||
|
|
||||||
if (*x >= pScreen->width)
|
if (*x >= pScreen->width)
|
||||||
*x -= pScreen->width;
|
*x -= pScreen->width;
|
||||||
if (*y >= pScreen->height)
|
if (*y >= pScreen->height)
|
||||||
*y -= pScreen->height;
|
*y -= pScreen->height;
|
||||||
|
|
||||||
*ppScreen = pNewScreen;
|
*ppScreen = pNewScreen;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -2167,7 +2167,7 @@ KdWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
||||||
KdUnblockSigio ();
|
KdUnblockSigio ();
|
||||||
}
|
}
|
||||||
|
|
||||||
miPointerScreenFuncRec kdPointerScreenFuncs =
|
miPointerScreenFuncRec kdPointerScreenFuncs =
|
||||||
{
|
{
|
||||||
KdCursorOffScreen,
|
KdCursorOffScreen,
|
||||||
KdCrossScreen,
|
KdCrossScreen,
|
||||||
|
|
|
@ -45,7 +45,7 @@ KdMapDevice (CARD32 addr, CARD32 size)
|
||||||
DRAW_DEBUG ((DEBUG_S3INIT, "Virtual address of 0x%x is 0x%x", addr, d));
|
DRAW_DEBUG ((DEBUG_S3INIT, "Virtual address of 0x%x is 0x%x", addr, d));
|
||||||
a = VirtualCopyAddr (addr);
|
a = VirtualCopyAddr (addr);
|
||||||
DRAW_DEBUG ((DEBUG_S3INIT, "Translated address is 0x%x", a));
|
DRAW_DEBUG ((DEBUG_S3INIT, "Translated address is 0x%x", a));
|
||||||
if (!VirtualCopy (d, a, size,
|
if (!VirtualCopy (d, a, size,
|
||||||
PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL))
|
PAGE_READWRITE|PAGE_NOCACHE|PAGE_PHYSICAL))
|
||||||
{
|
{
|
||||||
DRAW_DEBUG ((DEBUG_FAILURE, "VirtualCopy failed %d",
|
DRAW_DEBUG ((DEBUG_FAILURE, "VirtualCopy failed %d",
|
||||||
|
@ -67,7 +67,7 @@ KdMapDevice (CARD32 addr, CARD32 size)
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
FatalError ("KdMapDevice: failed to open /dev/mem (%s)\n",
|
FatalError ("KdMapDevice: failed to open /dev/mem (%s)\n",
|
||||||
strerror (errno));
|
strerror (errno));
|
||||||
|
|
||||||
a = mmap ((caddr_t) 0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, addr);
|
a = mmap ((caddr_t) 0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, addr);
|
||||||
close (fd);
|
close (fd);
|
||||||
if ((long) a == -1)
|
if ((long) a == -1)
|
||||||
|
@ -124,7 +124,7 @@ KdSetMappedMode (CARD32 addr, CARD32 size, int mode)
|
||||||
sentry.base = base;
|
sentry.base = base;
|
||||||
sentry.size = nsize;
|
sentry.size = nsize;
|
||||||
sentry.type = type;
|
sentry.type = type;
|
||||||
|
|
||||||
if (ioctl (mtrr, MTRRIOC_ADD_ENTRY, &sentry) < 0)
|
if (ioctl (mtrr, MTRRIOC_ADD_ENTRY, &sentry) < 0)
|
||||||
ErrorF ("MTRRIOC_ADD_ENTRY failed 0x%x 0x%x %d (%s)\n",
|
ErrorF ("MTRRIOC_ADD_ENTRY failed 0x%x 0x%x %d (%s)\n",
|
||||||
base, bound - base, type, strerror(errno));
|
base, bound - base, type, strerror(errno));
|
||||||
|
@ -163,7 +163,7 @@ KdResetMappedMode (CARD32 addr, CARD32 size, int mode)
|
||||||
sentry.base = base;
|
sentry.base = base;
|
||||||
sentry.size = nsize;
|
sentry.size = nsize;
|
||||||
sentry.type = type;
|
sentry.type = type;
|
||||||
|
|
||||||
if (ioctl (mtrr, MTRRIOC_DEL_ENTRY, &sentry) < 0)
|
if (ioctl (mtrr, MTRRIOC_DEL_ENTRY, &sentry) < 0)
|
||||||
ErrorF ("MTRRIOC_DEL_ENTRY failed 0x%x 0x%x %d (%s)\n",
|
ErrorF ("MTRRIOC_DEL_ENTRY failed 0x%x 0x%x %d (%s)\n",
|
||||||
base, bound - base, type, strerror(errno));
|
base, bound - base, type, strerror(errno));
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
|
||||||
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*
|
*
|
||||||
* Author: Keith Packard, SuSE, Inc.
|
* Author: Keith Packard, SuSE, Inc.
|
||||||
|
@ -38,7 +38,7 @@ const KdMonitorTiming kdMonitorTimings[] = {
|
||||||
17, 12, 32, KdSyncNegative,
|
17, 12, 32, KdSyncNegative,
|
||||||
1, 11, 14, KdSyncNegative,
|
1, 11, 14, KdSyncNegative,
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Other VESA modes */
|
/* Other VESA modes */
|
||||||
{ 640, 350, 85, 31500, /* VESA */
|
{ 640, 350, 85, 31500, /* VESA */
|
||||||
32, 96, 192, KdSyncPositive, /* 26.413 */
|
32, 96, 192, KdSyncPositive, /* 26.413 */
|
||||||
|
@ -60,7 +60,7 @@ const KdMonitorTiming kdMonitorTimings[] = {
|
||||||
16, 80, 160, KdSyncPositive, /* 32.954 */
|
16, 80, 160, KdSyncPositive, /* 32.954 */
|
||||||
1, 45, 49, KdSyncPositive, /* 52.727 */
|
1, 45, 49, KdSyncPositive, /* 52.727 */
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 640x480 modes */
|
/* 640x480 modes */
|
||||||
{ 640, 480, 85, 36000, /* VESA */
|
{ 640, 480, 85, 36000, /* VESA */
|
||||||
56, 80, 192, KdSyncNegative, /* 43.269 */
|
56, 80, 192, KdSyncNegative, /* 43.269 */
|
||||||
|
@ -78,7 +78,7 @@ const KdMonitorTiming kdMonitorTimings[] = {
|
||||||
16, 48, 160, KdSyncNegative, /* 31.469 */
|
16, 48, 160, KdSyncNegative, /* 31.469 */
|
||||||
10, 33, 45, KdSyncNegative, /* 59.940 */
|
10, 33, 45, KdSyncNegative, /* 59.940 */
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 800x600 modes */
|
/* 800x600 modes */
|
||||||
{ 800, 600, 85, 56250, /* VESA */
|
{ 800, 600, 85, 56250, /* VESA */
|
||||||
32, 152, 248, KdSyncPositive, /* 53.674 */
|
32, 152, 248, KdSyncPositive, /* 53.674 */
|
||||||
|
@ -102,7 +102,7 @@ const KdMonitorTiming kdMonitorTimings[] = {
|
||||||
24, 128, 224, KdSyncPositive, /* 35.156 */
|
24, 128, 224, KdSyncPositive, /* 35.156 */
|
||||||
1, 22, 25, KdSyncPositive, /* 56.250 */
|
1, 22, 25, KdSyncPositive, /* 56.250 */
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 1024x768 modes */
|
/* 1024x768 modes */
|
||||||
{ 1024, 768, 85, 94500, /* VESA */
|
{ 1024, 768, 85, 94500, /* VESA */
|
||||||
48, 208, 352, KdSyncPositive, /* 68.677 */
|
48, 208, 352, KdSyncPositive, /* 68.677 */
|
||||||
|
@ -120,13 +120,13 @@ const KdMonitorTiming kdMonitorTimings[] = {
|
||||||
24, 160, 320, KdSyncNegative, /* 48.363 */
|
24, 160, 320, KdSyncNegative, /* 48.363 */
|
||||||
3, 29, 38, KdSyncNegative, /* 60.004 */
|
3, 29, 38, KdSyncNegative, /* 60.004 */
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 1152x864 mode */
|
/* 1152x864 mode */
|
||||||
{ 1152, 864, 75, 108000, /* VESA */
|
{ 1152, 864, 75, 108000, /* VESA */
|
||||||
64, 256, 448, KdSyncPositive, /* 67.500 */
|
64, 256, 448, KdSyncPositive, /* 67.500 */
|
||||||
1, 32, 36, KdSyncPositive, /* 75.000 */
|
1, 32, 36, KdSyncPositive, /* 75.000 */
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 1152x900 modes */
|
/* 1152x900 modes */
|
||||||
{ 1152, 900, 85, 122500, /* ADDED */
|
{ 1152, 900, 85, 122500, /* ADDED */
|
||||||
48, 208, 384, KdSyncPositive, /* 79.753 */
|
48, 208, 384, KdSyncPositive, /* 79.753 */
|
||||||
|
@ -315,7 +315,7 @@ KdTuneMode (KdScreenInfo *screen,
|
||||||
const KdMonitorTiming *))
|
const KdMonitorTiming *))
|
||||||
{
|
{
|
||||||
const KdMonitorTiming *t;
|
const KdMonitorTiming *t;
|
||||||
|
|
||||||
while (!(*usable) (screen))
|
while (!(*usable) (screen))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -327,7 +327,7 @@ KdTuneMode (KdScreenInfo *screen,
|
||||||
screen->fb[0].depth = 16;
|
screen->fb[0].depth = 16;
|
||||||
else if (screen->fb[0].depth > 8)
|
else if (screen->fb[0].depth > 8)
|
||||||
screen->fb[0].depth = 8;
|
screen->fb[0].depth = 8;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
t = kdFindPrevSize (KdFindMode (screen, supported));
|
t = kdFindPrevSize (KdFindMode (screen, supported));
|
||||||
if (!t)
|
if (!t)
|
||||||
|
@ -344,14 +344,14 @@ KdTuneMode (KdScreenInfo *screen,
|
||||||
Bool
|
Bool
|
||||||
KdRandRGetInfo (ScreenPtr pScreen,
|
KdRandRGetInfo (ScreenPtr pScreen,
|
||||||
int randr,
|
int randr,
|
||||||
Bool (*supported) (ScreenPtr pScreen,
|
Bool (*supported) (ScreenPtr pScreen,
|
||||||
const KdMonitorTiming *))
|
const KdMonitorTiming *))
|
||||||
{
|
{
|
||||||
KdScreenPriv(pScreen);
|
KdScreenPriv(pScreen);
|
||||||
KdScreenInfo *screen = pScreenPriv->screen;
|
KdScreenInfo *screen = pScreenPriv->screen;
|
||||||
int i;
|
int i;
|
||||||
const KdMonitorTiming *t;
|
const KdMonitorTiming *t;
|
||||||
|
|
||||||
for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++)
|
for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++)
|
||||||
{
|
{
|
||||||
if ((*supported) (pScreen, t))
|
if ((*supported) (pScreen, t))
|
||||||
|
@ -373,20 +373,20 @@ KdRandRGetInfo (ScreenPtr pScreen,
|
||||||
RRSetCurrentConfig (pScreen, randr, t->rate, pSize);
|
RRSetCurrentConfig (pScreen, randr, t->rate, pSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const KdMonitorTiming *
|
const KdMonitorTiming *
|
||||||
KdRandRGetTiming (ScreenPtr pScreen,
|
KdRandRGetTiming (ScreenPtr pScreen,
|
||||||
Bool (*supported) (ScreenPtr pScreen,
|
Bool (*supported) (ScreenPtr pScreen,
|
||||||
const KdMonitorTiming *),
|
const KdMonitorTiming *),
|
||||||
int rate,
|
int rate,
|
||||||
RRScreenSizePtr pSize)
|
RRScreenSizePtr pSize)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const KdMonitorTiming *t;
|
const KdMonitorTiming *t;
|
||||||
|
|
||||||
for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++)
|
for (i = 0, t = kdMonitorTimings; i < NUM_MONITOR_TIMINGS; i++, t++)
|
||||||
{
|
{
|
||||||
if (t->horizontal == pSize->width &&
|
if (t->horizontal == pSize->width &&
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com)
|
XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com)
|
||||||
Adapted for KDrive by Pontus Lidman <pontus.lidman@nokia.com>
|
Adapted for KDrive by Pontus Lidman <pontus.lidman@nokia.com>
|
||||||
|
|
||||||
Copyright (C) 2000, 2001 - Nokia Home Communications
|
Copyright (C) 2000, 2001 - Nokia Home Communications
|
||||||
|
@ -67,29 +67,29 @@ static int KdXVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *);
|
||||||
static int KdXVAllocatePort(unsigned long, XvPortPtr, XvPortPtr*);
|
static int KdXVAllocatePort(unsigned long, XvPortPtr, XvPortPtr*);
|
||||||
static int KdXVFreePort(XvPortPtr);
|
static int KdXVFreePort(XvPortPtr);
|
||||||
static int KdXVPutVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
|
static int KdXVPutVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
INT16, INT16, CARD16, CARD16);
|
INT16, INT16, CARD16, CARD16);
|
||||||
static int KdXVPutStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
|
static int KdXVPutStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
INT16, INT16, CARD16, CARD16);
|
INT16, INT16, CARD16, CARD16);
|
||||||
static int KdXVGetVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
|
static int KdXVGetVideo(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
INT16, INT16, CARD16, CARD16);
|
INT16, INT16, CARD16, CARD16);
|
||||||
static int KdXVGetStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
|
static int KdXVGetStill(ClientPtr, DrawablePtr,XvPortPtr, GCPtr,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
INT16, INT16, CARD16, CARD16);
|
INT16, INT16, CARD16, CARD16);
|
||||||
static int KdXVStopVideo(ClientPtr, XvPortPtr, DrawablePtr);
|
static int KdXVStopVideo(ClientPtr, XvPortPtr, DrawablePtr);
|
||||||
static int KdXVSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32);
|
static int KdXVSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32);
|
||||||
static int KdXVGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32 *);
|
static int KdXVGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32 *);
|
||||||
static int KdXVQueryBestSize(ClientPtr, XvPortPtr, CARD8,
|
static int KdXVQueryBestSize(ClientPtr, XvPortPtr, CARD8,
|
||||||
CARD16, CARD16,CARD16, CARD16,
|
CARD16, CARD16,CARD16, CARD16,
|
||||||
unsigned int*, unsigned int*);
|
unsigned int*, unsigned int*);
|
||||||
static int KdXVPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
static int KdXVPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
INT16, INT16, CARD16, CARD16,
|
INT16, INT16, CARD16, CARD16,
|
||||||
XvImagePtr, unsigned char*, Bool,
|
XvImagePtr, unsigned char*, Bool,
|
||||||
CARD16, CARD16);
|
CARD16, CARD16);
|
||||||
static int KdXVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr,
|
static int KdXVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr,
|
||||||
CARD16*, CARD16*, int*, int*);
|
CARD16*, CARD16*, int*, int*);
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,12 +134,12 @@ KdXVRegisterGenericAdaptorDriver(
|
||||||
|
|
||||||
/* fprintf(stderr,"KdXVRegisterGenericAdaptorDriver\n"); */
|
/* fprintf(stderr,"KdXVRegisterGenericAdaptorDriver\n"); */
|
||||||
|
|
||||||
newdrivers = xrealloc(GenDrivers, sizeof(KdXVInitGenericAdaptorPtr) *
|
newdrivers = xrealloc(GenDrivers, sizeof(KdXVInitGenericAdaptorPtr) *
|
||||||
(1 + NumGenDrivers));
|
(1 + NumGenDrivers));
|
||||||
if (!newdrivers)
|
if (!newdrivers)
|
||||||
return 0;
|
return 0;
|
||||||
GenDrivers = newdrivers;
|
GenDrivers = newdrivers;
|
||||||
|
|
||||||
GenDrivers[NumGenDrivers++] = InitFunc;
|
GenDrivers[NumGenDrivers++] = InitFunc;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -184,7 +184,7 @@ KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr)
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
KdXVScreenInit(
|
KdXVScreenInit(
|
||||||
ScreenPtr pScreen,
|
ScreenPtr pScreen,
|
||||||
KdVideoAdaptorPtr *adaptors,
|
KdVideoAdaptorPtr *adaptors,
|
||||||
int num
|
int num
|
||||||
){
|
){
|
||||||
|
@ -197,7 +197,7 @@ KdXVScreenInit(
|
||||||
KdXVGeneration = serverGeneration;
|
KdXVGeneration = serverGeneration;
|
||||||
|
|
||||||
if(!XvGetScreenKeyProc || !XvGetRTPortProc || !XvScreenInitProc)
|
if(!XvGetScreenKeyProc || !XvGetRTPortProc || !XvScreenInitProc)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if(Success != (*XvScreenInitProc)(pScreen)) return FALSE;
|
if(Success != (*XvScreenInitProc)(pScreen)) return FALSE;
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ KdXVFreeAdaptor(XvAdaptorPtr pAdaptor)
|
||||||
xfree(pAdaptor->pEncodings);
|
xfree(pAdaptor->pEncodings);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pAdaptor->pFormats)
|
if(pAdaptor->pFormats)
|
||||||
xfree(pAdaptor->pFormats);
|
xfree(pAdaptor->pFormats);
|
||||||
|
|
||||||
if(pAdaptor->pPorts) {
|
if(pAdaptor->pPorts) {
|
||||||
|
@ -269,9 +269,9 @@ KdXVFreeAdaptor(XvAdaptorPtr pAdaptor)
|
||||||
for(i = 0; i < pAdaptor->nPorts; i++, pPort++) {
|
for(i = 0; i < pAdaptor->nPorts; i++, pPort++) {
|
||||||
pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
|
pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
|
||||||
if(pPriv) {
|
if(pPriv) {
|
||||||
if(pPriv->clientClip)
|
if(pPriv->clientClip)
|
||||||
REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip);
|
REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip);
|
||||||
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
||||||
REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip);
|
REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip);
|
||||||
xfree(pPriv);
|
xfree(pPriv);
|
||||||
}
|
}
|
||||||
|
@ -291,14 +291,14 @@ KdXVFreeAdaptor(XvAdaptorPtr pAdaptor)
|
||||||
|
|
||||||
if(pAdaptor->nImages)
|
if(pAdaptor->nImages)
|
||||||
xfree(pAdaptor->pImages);
|
xfree(pAdaptor->pImages);
|
||||||
|
|
||||||
if(pAdaptor->devPriv.ptr)
|
if(pAdaptor->devPriv.ptr)
|
||||||
xfree(pAdaptor->devPriv.ptr);
|
xfree(pAdaptor->devPriv.ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
KdXVInitAdaptors(
|
KdXVInitAdaptors(
|
||||||
ScreenPtr pScreen,
|
ScreenPtr pScreen,
|
||||||
KdVideoAdaptorPtr *infoPtr,
|
KdVideoAdaptorPtr *infoPtr,
|
||||||
int number
|
int number
|
||||||
) {
|
) {
|
||||||
|
@ -329,7 +329,7 @@ KdXVInitAdaptors(
|
||||||
pxvs->nAdaptors = 0;
|
pxvs->nAdaptors = 0;
|
||||||
pxvs->pAdaptors = NULL;
|
pxvs->pAdaptors = NULL;
|
||||||
|
|
||||||
if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec))))
|
if(!(pAdaptor = xcalloc(number, sizeof(XvAdaptorRec))))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
for(pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) {
|
for(pa = pAdaptor, na = 0, numAdaptor = 0; na < number; na++, adaptorPtr++) {
|
||||||
|
@ -343,7 +343,7 @@ KdXVInitAdaptors(
|
||||||
if(!adaptorPtr->nEncodings || !adaptorPtr->pEncodings)
|
if(!adaptorPtr->nEncodings || !adaptorPtr->pEncodings)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pa->type = adaptorPtr->type;
|
pa->type = adaptorPtr->type;
|
||||||
|
|
||||||
if(!adaptorPtr->PutVideo && !adaptorPtr->GetVideo)
|
if(!adaptorPtr->PutVideo && !adaptorPtr->GetVideo)
|
||||||
pa->type &= ~XvVideoMask;
|
pa->type &= ~XvVideoMask;
|
||||||
|
@ -354,19 +354,19 @@ KdXVInitAdaptors(
|
||||||
if(!adaptorPtr->PutImage || !adaptorPtr->QueryImageAttributes)
|
if(!adaptorPtr->PutImage || !adaptorPtr->QueryImageAttributes)
|
||||||
pa->type &= ~XvImageMask;
|
pa->type &= ~XvImageMask;
|
||||||
|
|
||||||
if(!adaptorPtr->PutVideo && !adaptorPtr->PutImage &&
|
if(!adaptorPtr->PutVideo && !adaptorPtr->PutImage &&
|
||||||
!adaptorPtr->PutStill)
|
!adaptorPtr->PutStill)
|
||||||
pa->type &= ~XvInputMask;
|
pa->type &= ~XvInputMask;
|
||||||
|
|
||||||
if(!adaptorPtr->GetVideo && !adaptorPtr->GetStill)
|
if(!adaptorPtr->GetVideo && !adaptorPtr->GetStill)
|
||||||
pa->type &= ~XvOutputMask;
|
pa->type &= ~XvOutputMask;
|
||||||
|
|
||||||
if(!(adaptorPtr->type & (XvPixmapMask | XvWindowMask)))
|
if(!(adaptorPtr->type & (XvPixmapMask | XvWindowMask)))
|
||||||
continue;
|
continue;
|
||||||
if(!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask)))
|
if(!(adaptorPtr->type & (XvImageMask | XvVideoMask | XvStillMask)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pa->pScreen = pScreen;
|
pa->pScreen = pScreen;
|
||||||
pa->ddAllocatePort = KdXVAllocatePort;
|
pa->ddAllocatePort = KdXVAllocatePort;
|
||||||
pa->ddFreePort = KdXVFreePort;
|
pa->ddFreePort = KdXVFreePort;
|
||||||
pa->ddPutVideo = KdXVPutVideo;
|
pa->ddPutVideo = KdXVPutVideo;
|
||||||
|
@ -385,8 +385,8 @@ KdXVInitAdaptors(
|
||||||
if(adaptorPtr->nEncodings &&
|
if(adaptorPtr->nEncodings &&
|
||||||
(pEncode = xcalloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) {
|
(pEncode = xcalloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) {
|
||||||
|
|
||||||
for(pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0;
|
for(pe = pEncode, encodingPtr = adaptorPtr->pEncodings, i = 0;
|
||||||
i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++)
|
i < adaptorPtr->nEncodings; pe++, i++, encodingPtr++)
|
||||||
{
|
{
|
||||||
pe->id = encodingPtr->id;
|
pe->id = encodingPtr->id;
|
||||||
pe->pScreen = pScreen;
|
pe->pScreen = pScreen;
|
||||||
|
@ -398,14 +398,14 @@ KdXVInitAdaptors(
|
||||||
pe->rate.denominator = encodingPtr->rate.denominator;
|
pe->rate.denominator = encodingPtr->rate.denominator;
|
||||||
}
|
}
|
||||||
pa->nEncodings = adaptorPtr->nEncodings;
|
pa->nEncodings = adaptorPtr->nEncodings;
|
||||||
pa->pEncodings = pEncode;
|
pa->pEncodings = pEncode;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(adaptorPtr->nImages &&
|
if(adaptorPtr->nImages &&
|
||||||
(pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) {
|
(pImage = xcalloc(adaptorPtr->nImages, sizeof(XvImageRec)))) {
|
||||||
|
|
||||||
for(i = 0, pi = pImage, imagePtr = adaptorPtr->pImages;
|
for(i = 0, pi = pImage, imagePtr = adaptorPtr->pImages;
|
||||||
i < adaptorPtr->nImages; i++, pi++, imagePtr++)
|
i < adaptorPtr->nImages; i++, pi++, imagePtr++)
|
||||||
{
|
{
|
||||||
pi->id = imagePtr->id;
|
pi->id = imagePtr->id;
|
||||||
pi->type = imagePtr->type;
|
pi->type = imagePtr->type;
|
||||||
|
@ -437,8 +437,8 @@ KdXVInitAdaptors(
|
||||||
if(adaptorPtr->nAttributes &&
|
if(adaptorPtr->nAttributes &&
|
||||||
(pAttribute = xcalloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec))))
|
(pAttribute = xcalloc(adaptorPtr->nAttributes, sizeof(XvAttributeRec))))
|
||||||
{
|
{
|
||||||
for(pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0;
|
for(pat = pAttribute, attributePtr = adaptorPtr->pAttributes, i = 0;
|
||||||
i < adaptorPtr->nAttributes; pat++, i++, attributePtr++)
|
i < adaptorPtr->nAttributes; pat++, i++, attributePtr++)
|
||||||
{
|
{
|
||||||
pat->flags = attributePtr->flags;
|
pat->flags = attributePtr->flags;
|
||||||
pat->min_value = attributePtr->min_value;
|
pat->min_value = attributePtr->min_value;
|
||||||
|
@ -447,8 +447,8 @@ KdXVInitAdaptors(
|
||||||
strcpy(pat->name, attributePtr->name);
|
strcpy(pat->name, attributePtr->name);
|
||||||
}
|
}
|
||||||
pa->nAttributes = adaptorPtr->nAttributes;
|
pa->nAttributes = adaptorPtr->nAttributes;
|
||||||
pa->pAttributes = pAttribute;
|
pa->pAttributes = pAttribute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
totFormat = adaptorPtr->nFormats;
|
totFormat = adaptorPtr->nFormats;
|
||||||
|
@ -457,8 +457,8 @@ KdXVInitAdaptors(
|
||||||
KdXVFreeAdaptor(pa);
|
KdXVFreeAdaptor(pa);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for(pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats;
|
for(pf = pFormat, i = 0, numFormat = 0, formatPtr = adaptorPtr->pFormats;
|
||||||
i < adaptorPtr->nFormats; i++, formatPtr++)
|
i < adaptorPtr->nFormats; i++, formatPtr++)
|
||||||
{
|
{
|
||||||
numVisuals = pScreen->numVisuals;
|
numVisuals = pScreen->numVisuals;
|
||||||
pVisual = pScreen->visuals;
|
pVisual = pScreen->visuals;
|
||||||
|
@ -468,26 +468,26 @@ KdXVInitAdaptors(
|
||||||
(pVisual->nplanes == formatPtr->depth)) {
|
(pVisual->nplanes == formatPtr->depth)) {
|
||||||
|
|
||||||
if(numFormat >= totFormat) {
|
if(numFormat >= totFormat) {
|
||||||
void *moreSpace;
|
void *moreSpace;
|
||||||
totFormat *= 2;
|
totFormat *= 2;
|
||||||
moreSpace = xrealloc(pFormat,
|
moreSpace = xrealloc(pFormat,
|
||||||
totFormat * sizeof(XvFormatRec));
|
totFormat * sizeof(XvFormatRec));
|
||||||
if(!moreSpace) break;
|
if(!moreSpace) break;
|
||||||
pFormat = moreSpace;
|
pFormat = moreSpace;
|
||||||
pf = pFormat + numFormat;
|
pf = pFormat + numFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
pf->visual = pVisual->vid;
|
pf->visual = pVisual->vid;
|
||||||
pf->depth = formatPtr->depth;
|
pf->depth = formatPtr->depth;
|
||||||
|
|
||||||
pf++;
|
pf++;
|
||||||
numFormat++;
|
numFormat++;
|
||||||
}
|
}
|
||||||
pVisual++;
|
pVisual++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pa->nFormats = numFormat;
|
pa->nFormats = numFormat;
|
||||||
pa->pFormats = pFormat;
|
pa->pFormats = pFormat;
|
||||||
if(!numFormat) {
|
if(!numFormat) {
|
||||||
KdXVFreeAdaptor(pa);
|
KdXVFreeAdaptor(pa);
|
||||||
continue;
|
continue;
|
||||||
|
@ -517,15 +517,15 @@ KdXVInitAdaptors(
|
||||||
KdXVFreeAdaptor(pa);
|
KdXVFreeAdaptor(pa);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for(pp = pPort, i = 0, numPort = 0;
|
for(pp = pPort, i = 0, numPort = 0;
|
||||||
i < adaptorPtr->nPorts; i++) {
|
i < adaptorPtr->nPorts; i++) {
|
||||||
|
|
||||||
if(!(pp->id = FakeClientID(0)))
|
if(!(pp->id = FakeClientID(0)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!(portPriv = xcalloc(1, sizeof(XvPortRecPrivate))))
|
if(!(portPriv = xcalloc(1, sizeof(XvPortRecPrivate))))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!AddResource(pp->id, PortResource, pp)) {
|
if(!AddResource(pp->id, PortResource, pp)) {
|
||||||
xfree(portPriv);
|
xfree(portPriv);
|
||||||
continue;
|
continue;
|
||||||
|
@ -542,7 +542,7 @@ KdXVInitAdaptors(
|
||||||
portPriv->screen = screen;
|
portPriv->screen = screen;
|
||||||
portPriv->AdaptorRec = adaptorPriv;
|
portPriv->AdaptorRec = adaptorPriv;
|
||||||
portPriv->DevPriv.ptr = adaptorPtr->pPortPrivates[i].ptr;
|
portPriv->DevPriv.ptr = adaptorPtr->pPortPrivates[i].ptr;
|
||||||
|
|
||||||
pp++;
|
pp++;
|
||||||
numPort++;
|
numPort++;
|
||||||
}
|
}
|
||||||
|
@ -554,7 +554,7 @@ KdXVInitAdaptors(
|
||||||
}
|
}
|
||||||
|
|
||||||
pa->base_id = pPort->id;
|
pa->base_id = pPort->id;
|
||||||
|
|
||||||
pa++;
|
pa++;
|
||||||
numAdaptor++;
|
numAdaptor++;
|
||||||
}
|
}
|
||||||
|
@ -580,13 +580,13 @@ KdXVInitAdaptors(
|
||||||
the GC and used it's clip list when they needed to reclip the window,
|
the GC and used it's clip list when they needed to reclip the window,
|
||||||
even if the client clip was different from the one the video was
|
even if the client clip was different from the one the video was
|
||||||
initialized with. If the original GC was destroyed, they had to stop
|
initialized with. If the original GC was destroyed, they had to stop
|
||||||
the video. I like the new method better (MArk).
|
the video. I like the new method better (MArk).
|
||||||
|
|
||||||
This function only works for windows. Will need to rewrite when
|
This function only works for windows. Will need to rewrite when
|
||||||
(if) we support pixmap rendering.
|
(if) we support pixmap rendering.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
KdXVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
|
KdXVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
|
||||||
{
|
{
|
||||||
RegionPtr pregWin, pCompositeClip;
|
RegionPtr pregWin, pCompositeClip;
|
||||||
|
@ -623,7 +623,7 @@ KdXVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
|
||||||
|
|
||||||
if(freeCompClip) {
|
if(freeCompClip) {
|
||||||
REGION_DESTROY(pWin->pScreen, pregWin);
|
REGION_DESTROY(pWin->pScreen, pregWin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save the current clientClip and update the CompositeClip whenever
|
/* Save the current clientClip and update the CompositeClip whenever
|
||||||
|
@ -631,7 +631,7 @@ KdXVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
KdXVCopyClip(
|
KdXVCopyClip(
|
||||||
XvPortRecPrivatePtr portPriv,
|
XvPortRecPrivatePtr portPriv,
|
||||||
GCPtr pGC
|
GCPtr pGC
|
||||||
){
|
){
|
||||||
/* copy the new clip if it exists */
|
/* copy the new clip if it exists */
|
||||||
|
@ -672,12 +672,12 @@ KdXVRegetVideo(XvPortRecPrivatePtr portPriv)
|
||||||
WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
|
WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
|
||||||
WinBox.x2 = WinBox.x1 + portPriv->drw_w;
|
WinBox.x2 = WinBox.x1 + portPriv->drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
||||||
|
|
||||||
/* clip to the window composite clip */
|
/* clip to the window composite clip */
|
||||||
REGION_INIT(portPriv->pDraw->pScreen, &WinRegion, &WinBox, 1);
|
REGION_INIT(portPriv->pDraw->pScreen, &WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(portPriv->pDraw->pScreen, &ClipRegion, NullBox, 1);
|
REGION_INIT(portPriv->pDraw->pScreen, &ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(portPriv->pDraw->pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
REGION_INTERSECT(portPriv->pDraw->pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
||||||
|
|
||||||
/* that's all if it's totally obscured */
|
/* that's all if it's totally obscured */
|
||||||
if(!REGION_NOTEMPTY(portPriv->pDraw->pScreen, &ClipRegion)) {
|
if(!REGION_NOTEMPTY(portPriv->pDraw->pScreen, &ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
|
@ -689,10 +689,10 @@ KdXVRegetVideo(XvPortRecPrivatePtr portPriv)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->screen, portPriv->pDraw,
|
ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->screen, portPriv->pDraw,
|
||||||
portPriv->vid_x, portPriv->vid_y,
|
portPriv->vid_x, portPriv->vid_y,
|
||||||
WinBox.x1, WinBox.y1,
|
WinBox.x1, WinBox.y1,
|
||||||
portPriv->vid_w, portPriv->vid_h,
|
portPriv->vid_w, portPriv->vid_h,
|
||||||
portPriv->drw_w, portPriv->drw_h,
|
portPriv->drw_w, portPriv->drw_h,
|
||||||
&ClipRegion, portPriv->DevPriv.ptr);
|
&ClipRegion, portPriv->DevPriv.ptr);
|
||||||
|
|
||||||
if(ret == Success)
|
if(ret == Success)
|
||||||
|
@ -736,11 +736,11 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv)
|
||||||
WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
|
WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
|
||||||
WinBox.x2 = WinBox.x1 + portPriv->drw_w;
|
WinBox.x2 = WinBox.x1 + portPriv->drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
||||||
|
|
||||||
/* clip to the window composite clip */
|
/* clip to the window composite clip */
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
||||||
|
|
||||||
/* clip and translate to the viewport */
|
/* clip and translate to the viewport */
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
|
@ -753,10 +753,10 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv)
|
||||||
VPBox.y2 = screen->height;
|
VPBox.y2 = screen->height;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
REGION_UNINIT(pScreen, &VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* that's all if it's totally obscured */
|
/* that's all if it's totally obscured */
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
|
@ -767,8 +767,8 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv)
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto CLIP_VIDEO_BAILOUT;
|
goto CLIP_VIDEO_BAILOUT;
|
||||||
|
@ -780,10 +780,10 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->screen, portPriv->pDraw,
|
ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->screen, portPriv->pDraw,
|
||||||
portPriv->vid_x, portPriv->vid_y,
|
portPriv->vid_x, portPriv->vid_y,
|
||||||
WinBox.x1, WinBox.y1,
|
WinBox.x1, WinBox.y1,
|
||||||
portPriv->vid_w, portPriv->vid_h,
|
portPriv->vid_w, portPriv->vid_h,
|
||||||
portPriv->drw_w, portPriv->drw_h,
|
portPriv->drw_w, portPriv->drw_h,
|
||||||
&ClipRegion, portPriv->DevPriv.ptr);
|
&ClipRegion, portPriv->DevPriv.ptr);
|
||||||
|
|
||||||
if(ret == Success) portPriv->isOn = XV_ON;
|
if(ret == Success) portPriv->isOn = XV_ON;
|
||||||
|
@ -825,11 +825,11 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv)
|
||||||
WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
|
WinBox.y1 = portPriv->pDraw->y + portPriv->drw_y;
|
||||||
WinBox.x2 = WinBox.x1 + portPriv->drw_w;
|
WinBox.x2 = WinBox.x1 + portPriv->drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
||||||
|
|
||||||
/* clip to the window composite clip */
|
/* clip to the window composite clip */
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
||||||
|
|
||||||
/* clip and translate to the viewport */
|
/* clip and translate to the viewport */
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
|
@ -842,10 +842,10 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv)
|
||||||
VPBox.y2 = screen->height;
|
VPBox.y2 = screen->height;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
REGION_UNINIT(pScreen, &VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* that's all if it's totally obscured */
|
/* that's all if it's totally obscured */
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
|
@ -856,8 +856,8 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv)
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto CLIP_VIDEO_BAILOUT;
|
goto CLIP_VIDEO_BAILOUT;
|
||||||
|
@ -897,10 +897,10 @@ static int
|
||||||
KdXVReputAllVideo(WindowPtr pWin, pointer data)
|
KdXVReputAllVideo(WindowPtr pWin, pointer data)
|
||||||
{
|
{
|
||||||
KdXVWindowPtr WinPriv;
|
KdXVWindowPtr WinPriv;
|
||||||
|
|
||||||
if (pWin->drawable.type != DRAWABLE_WINDOW)
|
if (pWin->drawable.type != DRAWABLE_WINDOW)
|
||||||
return WT_DONTWALKCHILDREN;
|
return WT_DONTWALKCHILDREN;
|
||||||
|
|
||||||
WinPriv = GET_KDXV_WINDOW(pWin);
|
WinPriv = GET_KDXV_WINDOW(pWin);
|
||||||
|
|
||||||
while(WinPriv) {
|
while(WinPriv) {
|
||||||
|
@ -917,7 +917,7 @@ KdXVReputAllVideo(WindowPtr pWin, pointer data)
|
||||||
static int
|
static int
|
||||||
KdXVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
|
KdXVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
|
||||||
{
|
{
|
||||||
KdXVWindowPtr winPriv, PrivRoot;
|
KdXVWindowPtr winPriv, PrivRoot;
|
||||||
|
|
||||||
winPriv = PrivRoot = GET_KDXV_WINDOW(pWin);
|
winPriv = PrivRoot = GET_KDXV_WINDOW(pWin);
|
||||||
|
|
||||||
|
@ -934,7 +934,7 @@ KdXVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
|
||||||
winPriv->PortRec = portPriv;
|
winPriv->PortRec = portPriv;
|
||||||
winPriv->next = PrivRoot;
|
winPriv->next = PrivRoot;
|
||||||
dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, winPriv);
|
dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, winPriv);
|
||||||
}
|
}
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -948,14 +948,14 @@ KdXVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
|
||||||
|
|
||||||
while(winPriv) {
|
while(winPriv) {
|
||||||
if(winPriv->PortRec == portPriv) {
|
if(winPriv->PortRec == portPriv) {
|
||||||
if(prevPriv)
|
if(prevPriv)
|
||||||
prevPriv->next = winPriv->next;
|
prevPriv->next = winPriv->next;
|
||||||
else
|
else
|
||||||
dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, winPriv->next);
|
dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, winPriv->next);
|
||||||
xfree(winPriv);
|
xfree(winPriv);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
prevPriv = winPriv;
|
prevPriv = winPriv;
|
||||||
winPriv = winPriv->next;
|
winPriv = winPriv->next;
|
||||||
}
|
}
|
||||||
portPriv->pDraw = NULL;
|
portPriv->pDraw = NULL;
|
||||||
|
@ -1033,7 +1033,7 @@ KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
|
||||||
|
|
||||||
/* filter out XClearWindow/Area */
|
/* filter out XClearWindow/Area */
|
||||||
if (!pWin->valdata) return;
|
if (!pWin->valdata) return;
|
||||||
|
|
||||||
pPrev = NULL;
|
pPrev = NULL;
|
||||||
|
|
||||||
while(WinPriv) {
|
while(WinPriv) {
|
||||||
|
@ -1044,10 +1044,10 @@ KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
|
||||||
switch(pPriv->type) {
|
switch(pPriv->type) {
|
||||||
case XvInputMask:
|
case XvInputMask:
|
||||||
KdXVReputVideo(pPriv);
|
KdXVReputVideo(pPriv);
|
||||||
break;
|
break;
|
||||||
case XvOutputMask:
|
case XvOutputMask:
|
||||||
KdXVRegetVideo(pPriv);
|
KdXVRegetVideo(pPriv);
|
||||||
break;
|
break;
|
||||||
default: /* overlaid still/image*/
|
default: /* overlaid still/image*/
|
||||||
if (pPriv->AdaptorRec->ReputImage)
|
if (pPriv->AdaptorRec->ReputImage)
|
||||||
KdXVReputImage(pPriv);
|
KdXVReputImage(pPriv);
|
||||||
|
@ -1061,7 +1061,7 @@ KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
|
||||||
}
|
}
|
||||||
pPriv->pDraw = NULL;
|
pPriv->pDraw = NULL;
|
||||||
|
|
||||||
if(!pPrev)
|
if(!pPrev)
|
||||||
dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, WinPriv->next);
|
dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, WinPriv->next);
|
||||||
else
|
else
|
||||||
pPrev->next = WinPriv->next;
|
pPrev->next = WinPriv->next;
|
||||||
|
@ -1078,7 +1078,7 @@ KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
KdXVClipNotify(WindowPtr pWin, int dx, int dy)
|
KdXVClipNotify(WindowPtr pWin, int dx, int dy)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
|
@ -1097,7 +1097,7 @@ KdXVClipNotify(WindowPtr pWin, int dx, int dy)
|
||||||
|
|
||||||
pPriv->pCompositeClip = NULL;
|
pPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
/* Stop everything except images, but stop them too if the
|
/* Stop everything except images, but stop them too if the
|
||||||
window isn't visible. But we only remove the images. */
|
window isn't visible. But we only remove the images. */
|
||||||
|
|
||||||
if(pPriv->type || !visible) {
|
if(pPriv->type || !visible) {
|
||||||
|
@ -1110,7 +1110,7 @@ KdXVClipNotify(WindowPtr pWin, int dx, int dy)
|
||||||
if(!pPriv->type) { /* overlaid still/image */
|
if(!pPriv->type) { /* overlaid still/image */
|
||||||
pPriv->pDraw = NULL;
|
pPriv->pDraw = NULL;
|
||||||
|
|
||||||
if(!pPrev)
|
if(!pPrev)
|
||||||
dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, WinPriv->next);
|
dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, WinPriv->next);
|
||||||
else
|
else
|
||||||
pPrev->next = WinPriv->next;
|
pPrev->next = WinPriv->next;
|
||||||
|
@ -1153,7 +1153,7 @@ KdXVCloseScreen(int i, ScreenPtr pScreen)
|
||||||
|
|
||||||
/* fprintf(stderr,"XV: Unwrapping screen funcs\n"); */
|
/* fprintf(stderr,"XV: Unwrapping screen funcs\n"); */
|
||||||
|
|
||||||
for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) {
|
for(c = 0, pa = pxvs->pAdaptors; c < pxvs->nAdaptors; c++, pa++) {
|
||||||
KdXVFreeAdaptor(pa);
|
KdXVFreeAdaptor(pa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1193,9 +1193,9 @@ KdXVEnable(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
if (!KdXVRunning (pScreen))
|
if (!KdXVRunning (pScreen))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
WalkTree(pScreen, KdXVReputAllVideo, 0);
|
WalkTree(pScreen, KdXVReputAllVideo, 0);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1214,7 +1214,7 @@ KdXVDisable(ScreenPtr pScreen)
|
||||||
|
|
||||||
pxvs = GET_XV_SCREEN(pScreen);
|
pxvs = GET_XV_SCREEN(pScreen);
|
||||||
ScreenPriv = GET_KDXV_SCREEN(pScreen);
|
ScreenPriv = GET_KDXV_SCREEN(pScreen);
|
||||||
|
|
||||||
for(i = 0; i < pxvs->nAdaptors; i++) {
|
for(i = 0; i < pxvs->nAdaptors; i++) {
|
||||||
pAdaptor = &pxvs->pAdaptors[i];
|
pAdaptor = &pxvs->pAdaptors[i];
|
||||||
for(j = 0; j < pAdaptor->nPorts; j++) {
|
for(j = 0; j < pAdaptor->nPorts; j++) {
|
||||||
|
@ -1263,8 +1263,8 @@ KdXVPutVideo(
|
||||||
DrawablePtr pDraw,
|
DrawablePtr pDraw,
|
||||||
XvPortPtr pPort,
|
XvPortPtr pPort,
|
||||||
GCPtr pGC,
|
GCPtr pGC,
|
||||||
INT16 vid_x, INT16 vid_y,
|
INT16 vid_x, INT16 vid_y,
|
||||||
CARD16 vid_w, CARD16 vid_h,
|
CARD16 vid_w, CARD16 vid_h,
|
||||||
INT16 drw_x, INT16 drw_y,
|
INT16 drw_x, INT16 drw_y,
|
||||||
CARD16 drw_w, CARD16 drw_h
|
CARD16 drw_w, CARD16 drw_h
|
||||||
){
|
){
|
||||||
|
@ -1277,7 +1277,7 @@ KdXVPutVideo(
|
||||||
pPort->pDraw = (DrawablePtr)NULL;
|
pPort->pDraw = (DrawablePtr)NULL;
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we are changing windows, unregister our port in the old window */
|
/* If we are changing windows, unregister our port in the old window */
|
||||||
if(portPriv->pDraw && (portPriv->pDraw != pDraw))
|
if(portPriv->pDraw && (portPriv->pDraw != pDraw))
|
||||||
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
||||||
|
@ -1302,7 +1302,7 @@ KdXVPutVideo(
|
||||||
pPort->pDraw = pDraw;
|
pPort->pDraw = pDraw;
|
||||||
|
|
||||||
if (!pScreenPriv->enabled) return Success;
|
if (!pScreenPriv->enabled) return Success;
|
||||||
|
|
||||||
return(KdXVReputVideo(portPriv));
|
return(KdXVReputVideo(portPriv));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1312,13 +1312,13 @@ KdXVPutStill(
|
||||||
DrawablePtr pDraw,
|
DrawablePtr pDraw,
|
||||||
XvPortPtr pPort,
|
XvPortPtr pPort,
|
||||||
GCPtr pGC,
|
GCPtr pGC,
|
||||||
INT16 vid_x, INT16 vid_y,
|
INT16 vid_x, INT16 vid_y,
|
||||||
CARD16 vid_w, CARD16 vid_h,
|
CARD16 vid_w, CARD16 vid_h,
|
||||||
INT16 drw_x, INT16 drw_y,
|
INT16 drw_x, INT16 drw_y,
|
||||||
CARD16 drw_w, CARD16 drw_h
|
CARD16 drw_w, CARD16 drw_h
|
||||||
){
|
){
|
||||||
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
|
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
|
||||||
ScreenPtr pScreen = pDraw->pScreen;
|
ScreenPtr pScreen = pDraw->pScreen;
|
||||||
KdScreenPriv(pScreen);
|
KdScreenPriv(pScreen);
|
||||||
KdScreenInfo *screen=pScreenPriv->screen;
|
KdScreenInfo *screen=pScreenPriv->screen;
|
||||||
RegionRec WinRegion;
|
RegionRec WinRegion;
|
||||||
|
@ -1336,10 +1336,10 @@ KdXVPutStill(
|
||||||
WinBox.y1 = pDraw->y + drw_y;
|
WinBox.y1 = pDraw->y + drw_y;
|
||||||
WinBox.x2 = WinBox.x1 + drw_w;
|
WinBox.x2 = WinBox.x1 + drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + drw_h;
|
WinBox.y2 = WinBox.y1 + drw_h;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
RegionRec VPReg;
|
RegionRec VPReg;
|
||||||
|
@ -1351,7 +1351,7 @@ KdXVPutStill(
|
||||||
VPBox.y2 = screen->height;
|
VPBox.y2 = screen->height;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
REGION_UNINIT(pScreen, &VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1367,7 +1367,7 @@ KdXVPutStill(
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
|
@ -1417,8 +1417,8 @@ KdXVGetVideo(
|
||||||
DrawablePtr pDraw,
|
DrawablePtr pDraw,
|
||||||
XvPortPtr pPort,
|
XvPortPtr pPort,
|
||||||
GCPtr pGC,
|
GCPtr pGC,
|
||||||
INT16 vid_x, INT16 vid_y,
|
INT16 vid_x, INT16 vid_y,
|
||||||
CARD16 vid_w, CARD16 vid_h,
|
CARD16 vid_w, CARD16 vid_h,
|
||||||
INT16 drw_x, INT16 drw_y,
|
INT16 drw_x, INT16 drw_y,
|
||||||
CARD16 drw_w, CARD16 drw_h
|
CARD16 drw_w, CARD16 drw_h
|
||||||
){
|
){
|
||||||
|
@ -1431,7 +1431,7 @@ KdXVGetVideo(
|
||||||
pPort->pDraw = (DrawablePtr)NULL;
|
pPort->pDraw = (DrawablePtr)NULL;
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we are changing windows, unregister our port in the old window */
|
/* If we are changing windows, unregister our port in the old window */
|
||||||
if(portPriv->pDraw && (portPriv->pDraw != pDraw))
|
if(portPriv->pDraw && (portPriv->pDraw != pDraw))
|
||||||
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
||||||
|
@ -1454,7 +1454,7 @@ KdXVGetVideo(
|
||||||
|
|
||||||
/* To indicate to the DI layer that we were successful */
|
/* To indicate to the DI layer that we were successful */
|
||||||
pPort->pDraw = pDraw;
|
pPort->pDraw = pDraw;
|
||||||
|
|
||||||
if(!pScreenPriv->enabled) return Success;
|
if(!pScreenPriv->enabled) return Success;
|
||||||
|
|
||||||
return(KdXVRegetVideo(portPriv));
|
return(KdXVRegetVideo(portPriv));
|
||||||
|
@ -1466,8 +1466,8 @@ KdXVGetStill(
|
||||||
DrawablePtr pDraw,
|
DrawablePtr pDraw,
|
||||||
XvPortPtr pPort,
|
XvPortPtr pPort,
|
||||||
GCPtr pGC,
|
GCPtr pGC,
|
||||||
INT16 vid_x, INT16 vid_y,
|
INT16 vid_x, INT16 vid_y,
|
||||||
CARD16 vid_w, CARD16 vid_h,
|
CARD16 vid_w, CARD16 vid_h,
|
||||||
INT16 drw_x, INT16 drw_y,
|
INT16 drw_x, INT16 drw_y,
|
||||||
CARD16 drw_w, CARD16 drw_h
|
CARD16 drw_w, CARD16 drw_h
|
||||||
){
|
){
|
||||||
|
@ -1489,10 +1489,10 @@ KdXVGetStill(
|
||||||
WinBox.y1 = pDraw->y + drw_y;
|
WinBox.y1 = pDraw->y + drw_y;
|
||||||
WinBox.x2 = WinBox.x1 + drw_w;
|
WinBox.x2 = WinBox.x1 + drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + drw_h;
|
WinBox.y2 = WinBox.y1 + drw_h;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
||||||
|
|
||||||
if(portPriv->pDraw) {
|
if(portPriv->pDraw) {
|
||||||
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
||||||
|
@ -1526,7 +1526,7 @@ GET_STILL_BAILOUT:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
KdXVStopVideo(
|
KdXVStopVideo(
|
||||||
|
@ -1539,7 +1539,7 @@ KdXVStopVideo(
|
||||||
|
|
||||||
if(pDraw->type != DRAWABLE_WINDOW)
|
if(pDraw->type != DRAWABLE_WINDOW)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
KdXVRemovePortFromWindow((WindowPtr)pDraw, portPriv);
|
KdXVRemovePortFromWindow((WindowPtr)pDraw, portPriv);
|
||||||
|
|
||||||
if(!pScreenPriv->enabled) return Success;
|
if(!pScreenPriv->enabled) return Success;
|
||||||
|
@ -1563,8 +1563,8 @@ KdXVSetPortAttribute(
|
||||||
INT32 value
|
INT32 value
|
||||||
){
|
){
|
||||||
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
|
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
|
||||||
|
|
||||||
return((*portPriv->AdaptorRec->SetPortAttribute)(portPriv->screen,
|
return((*portPriv->AdaptorRec->SetPortAttribute)(portPriv->screen,
|
||||||
attribute, value, portPriv->DevPriv.ptr));
|
attribute, value, portPriv->DevPriv.ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1577,8 +1577,8 @@ KdXVGetPortAttribute(
|
||||||
INT32 *p_value
|
INT32 *p_value
|
||||||
){
|
){
|
||||||
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
|
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
|
||||||
|
|
||||||
return((*portPriv->AdaptorRec->GetPortAttribute)(portPriv->screen,
|
return((*portPriv->AdaptorRec->GetPortAttribute)(portPriv->screen,
|
||||||
attribute, (int *) p_value, portPriv->DevPriv.ptr));
|
attribute, (int *) p_value, portPriv->DevPriv.ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1594,8 +1594,8 @@ KdXVQueryBestSize(
|
||||||
unsigned int *p_w, unsigned int *p_h
|
unsigned int *p_w, unsigned int *p_h
|
||||||
){
|
){
|
||||||
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
|
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
|
||||||
|
|
||||||
(*portPriv->AdaptorRec->QueryBestSize)(portPriv->screen,
|
(*portPriv->AdaptorRec->QueryBestSize)(portPriv->screen,
|
||||||
(Bool)motion, vid_w, vid_h, drw_w, drw_h,
|
(Bool)motion, vid_w, vid_h, drw_w, drw_h,
|
||||||
p_w, p_h, portPriv->DevPriv.ptr);
|
p_w, p_h, portPriv->DevPriv.ptr);
|
||||||
|
|
||||||
|
@ -1603,14 +1603,14 @@ KdXVQueryBestSize(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
KdXVPutImage(
|
KdXVPutImage(
|
||||||
ClientPtr client,
|
ClientPtr client,
|
||||||
DrawablePtr pDraw,
|
DrawablePtr pDraw,
|
||||||
XvPortPtr pPort,
|
XvPortPtr pPort,
|
||||||
GCPtr pGC,
|
GCPtr pGC,
|
||||||
INT16 src_x, INT16 src_y,
|
INT16 src_x, INT16 src_y,
|
||||||
CARD16 src_w, CARD16 src_h,
|
CARD16 src_w, CARD16 src_h,
|
||||||
INT16 drw_x, INT16 drw_y,
|
INT16 drw_x, INT16 drw_y,
|
||||||
CARD16 drw_w, CARD16 drw_h,
|
CARD16 drw_w, CARD16 drw_h,
|
||||||
XvImagePtr format,
|
XvImagePtr format,
|
||||||
|
@ -1636,10 +1636,10 @@ KdXVPutImage(
|
||||||
WinBox.y1 = pDraw->y + drw_y;
|
WinBox.y1 = pDraw->y + drw_y;
|
||||||
WinBox.x2 = WinBox.x1 + drw_w;
|
WinBox.x2 = WinBox.x1 + drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + drw_h;
|
WinBox.y2 = WinBox.y1 + drw_h;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
RegionRec VPReg;
|
RegionRec VPReg;
|
||||||
|
@ -1651,7 +1651,7 @@ KdXVPutImage(
|
||||||
VPBox.y2 = pScreen->height;
|
VPBox.y2 = pScreen->height;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
REGION_UNINIT(pScreen, &VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1667,7 +1667,7 @@ KdXVPutImage(
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
|
@ -1712,19 +1712,19 @@ PUT_IMAGE_BAILOUT:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
KdXVQueryImageAttributes(
|
KdXVQueryImageAttributes(
|
||||||
ClientPtr client,
|
ClientPtr client,
|
||||||
XvPortPtr pPort,
|
XvPortPtr pPort,
|
||||||
XvImagePtr format,
|
XvImagePtr format,
|
||||||
CARD16 *width,
|
CARD16 *width,
|
||||||
CARD16 *height,
|
CARD16 *height,
|
||||||
int *pitches,
|
int *pitches,
|
||||||
int *offsets
|
int *offsets
|
||||||
){
|
){
|
||||||
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
|
XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr);
|
||||||
|
|
||||||
return (*portPriv->AdaptorRec->QueryImageAttributes)(portPriv->screen,
|
return (*portPriv->AdaptorRec->QueryImageAttributes)(portPriv->screen,
|
||||||
format->id, width, height, pitches, offsets);
|
format->id, width, height, pitches, offsets);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1878,7 +1878,7 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
|
||||||
xRectangle *rects, *r;
|
xRectangle *rects, *r;
|
||||||
BoxPtr pBox = REGION_RECTS (pRgn);
|
BoxPtr pBox = REGION_RECTS (pRgn);
|
||||||
int nBox = REGION_NUM_RECTS (pRgn);
|
int nBox = REGION_NUM_RECTS (pRgn);
|
||||||
|
|
||||||
rects = xalloc (nBox * sizeof (xRectangle));
|
rects = xalloc (nBox * sizeof (xRectangle));
|
||||||
if (!rects)
|
if (!rects)
|
||||||
goto bail0;
|
goto bail0;
|
||||||
|
@ -1892,18 +1892,18 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
|
||||||
r++;
|
r++;
|
||||||
pBox++;
|
pBox++;
|
||||||
}
|
}
|
||||||
|
|
||||||
pGC = GetScratchGC (pDraw->depth, pDraw->pScreen);
|
pGC = GetScratchGC (pDraw->depth, pDraw->pScreen);
|
||||||
if (!pGC)
|
if (!pGC)
|
||||||
goto bail1;
|
goto bail1;
|
||||||
|
|
||||||
val[0] = fg;
|
val[0] = fg;
|
||||||
val[1] = IncludeInferiors;
|
val[1] = IncludeInferiors;
|
||||||
ChangeGC (pGC, GCForeground|GCSubwindowMode, val);
|
ChangeGC (pGC, GCForeground|GCSubwindowMode, val);
|
||||||
|
|
||||||
ValidateGC (pDraw, pGC);
|
ValidateGC (pDraw, pGC);
|
||||||
|
|
||||||
(*pGC->ops->PolyFillRect) (pDraw, pGC,
|
(*pGC->ops->PolyFillRect) (pDraw, pGC,
|
||||||
REGION_NUM_RECTS (pRgn), rects);
|
REGION_NUM_RECTS (pRgn), rects);
|
||||||
|
|
||||||
FreeScratchGC (pGC);
|
FreeScratchGC (pGC);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
|
|
||||||
XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com)
|
XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com)
|
||||||
Adapted for KDrive by Pontus Lidman <pontus.lidman@nokia.com>
|
Adapted for KDrive by Pontus Lidman <pontus.lidman@nokia.com>
|
||||||
|
|
||||||
Copyright (C) 2000, 2001 - Nokia Home Communications
|
Copyright (C) 2000, 2001 - Nokia Home Communications
|
||||||
|
@ -60,21 +60,21 @@ typedef struct {
|
||||||
int id;
|
int id;
|
||||||
int type;
|
int type;
|
||||||
int byte_order;
|
int byte_order;
|
||||||
unsigned char guid[16];
|
unsigned char guid[16];
|
||||||
int bits_per_pixel;
|
int bits_per_pixel;
|
||||||
int format;
|
int format;
|
||||||
int num_planes;
|
int num_planes;
|
||||||
|
|
||||||
/* for RGB formats only */
|
/* for RGB formats only */
|
||||||
int depth;
|
int depth;
|
||||||
unsigned int red_mask;
|
unsigned int red_mask;
|
||||||
unsigned int green_mask;
|
unsigned int green_mask;
|
||||||
unsigned int blue_mask;
|
unsigned int blue_mask;
|
||||||
|
|
||||||
/* for YUV formats only */
|
/* for YUV formats only */
|
||||||
unsigned int y_sample_bits;
|
unsigned int y_sample_bits;
|
||||||
unsigned int u_sample_bits;
|
unsigned int u_sample_bits;
|
||||||
unsigned int v_sample_bits;
|
unsigned int v_sample_bits;
|
||||||
unsigned int horz_y_period;
|
unsigned int horz_y_period;
|
||||||
unsigned int horz_u_period;
|
unsigned int horz_u_period;
|
||||||
unsigned int horz_v_period;
|
unsigned int horz_v_period;
|
||||||
|
@ -83,7 +83,7 @@ typedef struct {
|
||||||
unsigned int vert_v_period;
|
unsigned int vert_v_period;
|
||||||
char component_order[32];
|
char component_order[32];
|
||||||
int scanline_order;
|
int scanline_order;
|
||||||
} KdImageRec, *KdImagePtr;
|
} KdImageRec, *KdImagePtr;
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -92,7 +92,7 @@ typedef struct {
|
||||||
unsigned short width, height;
|
unsigned short width, height;
|
||||||
int *pitches; /* bytes */
|
int *pitches; /* bytes */
|
||||||
int *offsets; /* in bytes from start of framebuffer */
|
int *offsets; /* in bytes from start of framebuffer */
|
||||||
DevUnion devPrivate;
|
DevUnion devPrivate;
|
||||||
} KdSurfaceRec, *KdSurfacePtr;
|
} KdSurfaceRec, *KdSurfacePtr;
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ typedef int (* SetPortAttributeFuncPtr)(KdScreenInfo * screen, Atom attribute,
|
||||||
typedef int (* GetPortAttributeFuncPtr)(KdScreenInfo * screen, Atom attribute,
|
typedef int (* GetPortAttributeFuncPtr)(KdScreenInfo * screen, Atom attribute,
|
||||||
int *value, pointer data);
|
int *value, pointer data);
|
||||||
typedef void (* QueryBestSizeFuncPtr)(KdScreenInfo * screen, Bool motion,
|
typedef void (* QueryBestSizeFuncPtr)(KdScreenInfo * screen, Bool motion,
|
||||||
short vid_w, short vid_h, short drw_w, short drw_h,
|
short vid_w, short vid_h, short drw_w, short drw_h,
|
||||||
unsigned int *p_w, unsigned int *p_h, pointer data);
|
unsigned int *p_w, unsigned int *p_h, pointer data);
|
||||||
typedef int (* PutImageFuncPtr)( KdScreenInfo * screen, DrawablePtr pDraw,
|
typedef int (* PutImageFuncPtr)( KdScreenInfo * screen, DrawablePtr pDraw,
|
||||||
short src_x, short src_y, short drw_x, short drw_y,
|
short src_x, short src_y, short drw_x, short drw_y,
|
||||||
|
@ -128,8 +128,8 @@ typedef int (* PutImageFuncPtr)( KdScreenInfo * screen, DrawablePtr pDraw,
|
||||||
typedef int (* ReputImageFuncPtr)( KdScreenInfo * screen, DrawablePtr pDraw,
|
typedef int (* ReputImageFuncPtr)( KdScreenInfo * screen, DrawablePtr pDraw,
|
||||||
short drw_x, short drw_y,
|
short drw_x, short drw_y,
|
||||||
RegionPtr clipBoxes, pointer data );
|
RegionPtr clipBoxes, pointer data );
|
||||||
typedef int (*QueryImageAttributesFuncPtr)(KdScreenInfo * screen,
|
typedef int (*QueryImageAttributesFuncPtr)(KdScreenInfo * screen,
|
||||||
int image, unsigned short *width, unsigned short *height,
|
int image, unsigned short *width, unsigned short *height,
|
||||||
int *pitches, int *offsets);
|
int *pitches, int *offsets);
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -148,7 +148,7 @@ typedef struct {
|
||||||
} KdVideoEncodingRec, *KdVideoEncodingPtr;
|
} KdVideoEncodingRec, *KdVideoEncodingPtr;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char depth;
|
char depth;
|
||||||
short class;
|
short class;
|
||||||
} KdVideoFormatRec, *KdVideoFormatPtr;
|
} KdVideoFormatRec, *KdVideoFormatPtr;
|
||||||
|
|
||||||
|
@ -160,13 +160,13 @@ typedef struct {
|
||||||
} KdAttributeRec, *KdAttributePtr;
|
} KdAttributeRec, *KdAttributePtr;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int type;
|
unsigned int type;
|
||||||
int flags;
|
int flags;
|
||||||
char *name;
|
char *name;
|
||||||
int nEncodings;
|
int nEncodings;
|
||||||
KdVideoEncodingPtr pEncodings;
|
KdVideoEncodingPtr pEncodings;
|
||||||
int nFormats;
|
int nFormats;
|
||||||
KdVideoFormatPtr pFormats;
|
KdVideoFormatPtr pFormats;
|
||||||
int nPorts;
|
int nPorts;
|
||||||
DevUnion *pPortPrivates;
|
DevUnion *pPortPrivates;
|
||||||
int nAttributes;
|
int nAttributes;
|
||||||
|
@ -188,7 +188,7 @@ typedef struct {
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
KdXVScreenInit(
|
KdXVScreenInit(
|
||||||
ScreenPtr pScreen,
|
ScreenPtr pScreen,
|
||||||
KdVideoAdaptorPtr *Adaptors,
|
KdVideoAdaptorPtr *Adaptors,
|
||||||
int num
|
int num
|
||||||
);
|
);
|
||||||
|
@ -239,7 +239,7 @@ typedef struct {
|
||||||
} KdXVScreenRec, *KdXVScreenPtr;
|
} KdXVScreenRec, *KdXVScreenPtr;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int flags;
|
int flags;
|
||||||
PutVideoFuncPtr PutVideo;
|
PutVideoFuncPtr PutVideo;
|
||||||
PutStillFuncPtr PutStill;
|
PutStillFuncPtr PutStill;
|
||||||
GetVideoFuncPtr GetVideo;
|
GetVideoFuncPtr GetVideo;
|
||||||
|
@ -276,4 +276,4 @@ typedef struct _KdXVWindowRec{
|
||||||
} KdXVWindowRec, *KdXVWindowPtr;
|
} KdXVWindowRec, *KdXVWindowPtr;
|
||||||
|
|
||||||
#endif /* _XVDIX_H_ */
|
#endif /* _XVDIX_H_ */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue