diff -Naur xc-orig/config/cf/host.def xc/config/cf/host.def --- xc-orig/config/cf/host.def 1969-12-31 19:00:00.000000000 -0500 +++ xc/config/cf/host.def 2004-10-14 10:03:33.000000000 -0400 @@ -0,0 +1,26 @@ +/* +#define KDriveXServer YES +#define TinyXServer YES +#define BuildServersOnly YES +#define XepsonServer YES +*/ + +#define BuildServersOnly YES +#define BuildXKBlib YES +#define BuildXKBfilelib YES +#define KDriveXServer YES +#define TinyXServer YES +#define CrossCompiling YES +#undef BuildRandR +#define BuildRandR YES +#define BuildXInputLib YES +#define ProjectRoot /usr/X11R6 +#define Freetype2Dir $(TOP)/extras/freetype2 +#define Freetype2LibDir $(TOP)/exports/lib +#define BuildXTrueType YES +#define BuildScreenSaverExt YES +#define BuildScreenSaverLibrary YES +#define SharedLibXss YES +#define ServerXdmcpDefines +/* #define XfbdevServer YES */ +#define XepsonServer YES diff -Naur xc-orig/programs/Xserver/Imakefile xc/programs/Xserver/Imakefile --- xc-orig/programs/Xserver/Imakefile 2003-02-17 12:06:40.000000000 -0500 +++ xc/programs/Xserver/Imakefile 2004-10-14 10:03:53.000000000 -0400 @@ -993,6 +993,39 @@ $(IPAQLIBS),$(IPAQSYSLIBS)) #endif /* XIPAQServer */ + + +#if defined(XepsonServer) && XepsonServer +XCOMM +XCOMM server with Alan's HP VGA Out PCMCIA driver & fbdev +XCOMM + + FBDEVDIR = $(KDRIVE)/fbdev + FBDEV = $(FBDEVDIR)/LibraryTargetName(fbdev) + + SHADOWDIR = miext/shadow + + EPSONDIR = $(KDRIVE)/epson + EPSON = $(EPSONDIR)/LibraryTargetName(epson) + + KDDIRS = StdKdDirs + + EPSONDIRS = $(STDDIRS) $(KDDIRS) $(FBDEVDIR) $(LAYERDIR) $(SHADOWDIR) $(EPSONDIR) + + EPSONLIBS = PreFbLibs $(EPSON) $(FBDEV) $(LAYER) $(SHADOW) KdLibs FbPostFbLibs + EPSONSYSLIBS = StdKdSysLibs + +#if HasParallelMake +MakeMutex($(EPSONDIRS) $(EPSONOBJS) $(EPSONLIBS) $(EPSONSYSLIBS)) +#endif +#if ForceServerRemake +$(EPSONOBJS) $(EPSONLIBS) $(EPSONSYSLIBS):: $(EPSONDIRS) + @if [ -f $@ ]; then touch $@ >/dev/null 2>&1 || exit 0; fi +#endif +ServerTarget(Xepson,$(EPSONDIRS),$(EPSONOBJS), \ + $(EPSONLIBS),$(EPSONSYSLIBS)) +#endif /* XEpsonServer */ + #if defined(XTS300Server) && XTS300Server XCOMM XCOMM server with Keith's S3 Trio and SiS530 driver for the TS300/TS400 @@ -1078,7 +1111,7 @@ KDRIVEDIRS=$(KDDIRS) $(FBDEVDIR) $(SAVAGEDIR) $(TRIDENTDIR) $(I810DIR) \ $(SIS530DIR) $(TRIODIR) $(TS300DIR) $(ITSYDIR) $(IGSDIR) \ - $(VESADIR) $(PCMCIADIR) $(IPAQDIR) $(MACH64DIR) $(CHIPSDIR) + $(VESADIR) $(PCMCIADIR) $(IPAQDIR) $(EPSONDIR) $(MACH64DIR) $(CHIPSDIR) #endif /* KDriveXServer */ #if defined(XprtServer) && XprtServer diff -Naur xc-orig/programs/Xserver/hw/kdrive/epson/Imakefile xc/programs/Xserver/hw/kdrive/epson/Imakefile --- xc-orig/programs/Xserver/hw/kdrive/epson/Imakefile 1969-12-31 19:00:00.000000000 -0500 +++ xc/programs/Xserver/hw/kdrive/epson/Imakefile 2004-09-17 10:31:11.000000000 -0400 @@ -0,0 +1,13 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/kdrive/epson/Imakefile,v 1.1 2001/05/23 17:28:39 alanh Exp $ +KDRIVE=.. +#include "../Kdrive.tmpl" + +SRCS = epsoninit.c epson.c + +OBJS = epsoninit.o epson.o + +INCLUDES = -I. $(KDINCS) -I$(KDRIVE)/fbdev + +NormalLibraryObjectRule() +NormalLibraryTarget(epson,$(OBJS)) +DependTarget() diff -Naur xc-orig/programs/Xserver/hw/kdrive/epson/epson.c xc/programs/Xserver/hw/kdrive/epson/epson.c --- xc-orig/programs/Xserver/hw/kdrive/epson/epson.c 1969-12-31 19:00:00.000000000 -0500 +++ xc/programs/Xserver/hw/kdrive/epson/epson.c 2004-09-21 12:41:31.000000000 -0400 @@ -0,0 +1,518 @@ +/* + * Copyright 2004 by Kent Lyons, Georgia Tech, Atlanta, GA, USA. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Alan Hourihane not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Alan Hourihane makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL ALAN HOURIHANE 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 OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Authors: Kent Lyons, + * + * A driver for the the I-O Data CFXGA + * + * + * + * + */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/epson/epson.c,v 1.7 2002/10/18 06:08:10 keithp Exp $ */ + +#include +#include +#include + +#include + +#include +#include +#include "iodata_cs.h" + + +#include "epson.h" +#define extern +#include +#undef extern + + +#include "X.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include "font.h" +#include "dixfontstr.h" +#include "fontstruct.h" +#include "mi.h" +#include "regionstr.h" +#include "globals.h" +#include "gcstruct.h" +#include "shadow.h" +#include "fb.h" + +void +epsonUpdate (ScreenPtr pScreen, + shadowBufPtr pBuf); + +/* +void * +epsonWindow (ScreenPtr pScreen, + CARD32 row, + CARD32 offset, + int mode, + CARD32 *size, + void *closure); +*/ + + +void write_line(int fd, FbBits *data, int y, int x1, int x2){ + // hard coded to 640x480x16 + status_t CFXGAStatus ; + int result = ioctl( fd, CFXGA_GET_STATUS, &CFXGAStatus ); + if ( result == -1 ) { // CFXGA not found + fprintf(stderr, "<>\n" ) ; + } else if ( ( result & CFXGA_INSTALLED ) ) { // CFXGA not found + fprintf(stderr, "<>\n" ) ; + } else { + copy_info_t UseBufCopy ; + UseBufCopy.x = x1 ; // Destnation x + UseBufCopy.y = y ; // Destnation y + UseBufCopy.w = 1+x2-x1 ; // Width + UseBufCopy.h = 1 ; // Height + UseBufCopy.bpp = 16 ; // Source bit per pixel + UseBufCopy.stride = UseBufCopy.w * UseBufCopy.bpp / 8 ; // src screen stride + UseBufCopy.adr = data ; // Source Data Start adr + ioctl( fd, CFXGA_COPY_FB, &UseBufCopy ) ; + } +} + + +Bool +epsonCardInit (KdCardInfo *card) +{ + epsonCardInfo *epsonc; + epsonc = (epsonCardInfo *) xalloc (sizeof (epsonCardInfo)); + if (!epsonc) + return FALSE; + + epsonc->window = 0; + + card->driver = epsonc; + + return TRUE; +} + +Bool +epsonModeSupported (KdScreenInfo *screen, + const KdMonitorTiming *t) +{ + KdCardInfo *card = screen->card; + epsonCardInfo *epsonc = (epsonCardInfo *) card->driver; + + // K: need to put in a real test? + /* + int a, b; + if (!CirrusFindClock (t->clock, &a, &b)) + return FALSE; + */ + + /* width must be a multiple of 16 */ + if (t->horizontal & 0xf) + return FALSE; + return TRUE; +} + +Bool +epsonModeUsable (KdScreenInfo *screen) +{ + KdCardInfo *card = screen->card; + epsonCardInfo *epsonc = (epsonCardInfo *) card->driver; + int screen_size; + int pixel_width; + int byte_width; + int fb; + fprintf(stderr, "Depth: %d\n", screen->fb[0].depth); + if (screen->fb[0].depth == 8) + screen->fb[0].bitsPerPixel = 8; + else if (screen->fb[0].depth == 15 || screen->fb[0].depth == 16) + screen->fb[0].bitsPerPixel = 16; + else + return FALSE; + + screen_size = 0; + screen->fb[0].pixelStride = screen->width; + screen->fb[0].byteStride = screen->width * (screen->fb[0].bitsPerPixel >>3); + screen->fb[0].frameBuffer = epsonc->fb; + screen_size = screen->fb[0].byteStride * screen->height; + + // return screen_size <= epsonc->memory; + return 1; +} + +Bool +epsonScreenInit (KdScreenInfo *screen) +{ + epsonCardInfo *epsonc = screen->card->driver; + epsonScreenInfo *epsons; + int screen_size, memory; + int i; + const KdMonitorTiming *t; + + epsons = (epsonScreenInfo *) xalloc (sizeof (epsonScreenInfo)); + if (!epsons) + return FALSE; + memset (epsons, '\0', sizeof (epsonScreenInfo)); + + screen->dumb = TRUE; + + /* default to 16bpp */ + if (!screen->fb[0].depth) + screen->fb[0].depth = 16; + + /* force at least 16 bit so we dont need to deal with the colormap */ + if (screen->fb[0].depth < 16) + screen->fb[0].depth = 16; + + + /* default to 60Hz refresh */ + if (!screen->width || !screen->height) + { + screen->width = 640; + screen->height = 480; + screen->rate = 60; + } + + //epsonc->memory = 512 * 1024; + //epsons->cursor_base = 0; + + epsons->screen = epsonc->fb; + screen->driver = epsons; + + t = KdFindMode (screen, epsonModeSupported); + + screen->rate = t->rate; + screen->width = t->horizontal; + screen->height = t->vertical; + + epsons->randr = screen->randr; + + if (!KdTuneMode (screen, epsonModeUsable, epsonModeSupported)) + { + xfree (epsons); + return FALSE; + } + + switch (screen->fb[0].depth) { + case 4: + screen->fb[0].visuals = ((1 << StaticGray) | + (1 << GrayScale) | + (1 << StaticColor)); + screen->fb[0].blueMask = 0x00; + screen->fb[0].greenMask = 0x00; + screen->fb[0].redMask = 0x00; + break; + case 8: + screen->fb[0].visuals = ((1 << StaticGray) | + (1 << GrayScale) | + (1 << StaticColor) | + (1 << PseudoColor) | + (1 << TrueColor) | + (1 << DirectColor)); + screen->fb[0].blueMask = 0x00; + screen->fb[0].greenMask = 0x00; + screen->fb[0].redMask = 0x00; + break; + case 15: + screen->fb[0].visuals = (1 << TrueColor); + screen->fb[0].blueMask = 0x001f; + screen->fb[0].greenMask = 0x03e0; + screen->fb[0].redMask = 0x7c00; + break; + case 16: + screen->fb[0].visuals = (1 << TrueColor); + screen->fb[0].blueMask = 0x001f; + screen->fb[0].greenMask = 0x07e0; + screen->fb[0].redMask = 0xf800; + break; + } + + return TRUE; +} + + +LayerPtr +epsonLayerCreate (ScreenPtr pScreen) +{ + KdScreenPriv(pScreen); + KdScreenInfo *screen = pScreenPriv->screen; + epsonCardInfo *epsonc = pScreenPriv->card->driver; + epsonScreenInfo *epsons = (epsonScreenInfo *) pScreenPriv->screen->driver; + ShadowUpdateProc update; + ShadowWindowProc window; + PixmapPtr pPixmap; + int kind; + + //window = epsonWindow; + fprintf(stderr, "randr: %d\n", epsons->randr); + if (epsons->randr == RR_Rotate_0) + update = epsonUpdate; + else { + ErrorF("oops?: update=epsonUpdateRotatePacked\n"); + //update = epsonUpdateRotatePacked; + } + + if (!update) + abort (); + + kind = LAYER_SHADOW; + pPixmap = 0; + + return LayerCreate (pScreen, kind, screen->fb[0].depth, + pPixmap, update, window, epsons->randr, 0); +} + +void +epsonConfigureScreen (ScreenPtr pScreen) +{ + KdScreenPriv(pScreen); + KdScreenInfo *screen = pScreenPriv->screen; + FbdevPriv *priv = pScreenPriv->card->driver; + epsonScreenInfo *epsons = (epsonScreenInfo *) screen->driver; + KdMouseMatrix m; + + KdComputeMouseMatrix (&m, epsons->randr, + screen->width, screen->height); + + if (m.matrix[0][0]) + { + pScreen->width = screen->width; + pScreen->height = screen->height; + pScreen->mmWidth = screen->width_mm; + pScreen->mmHeight = screen->height_mm; + } + else + { + pScreen->width = screen->height; + pScreen->height = screen->width; + pScreen->mmWidth = screen->height_mm; + pScreen->mmHeight = screen->width_mm; + } + KdSetMouseMatrix (&m); +} + +Bool +epsonInitScreen (ScreenPtr pScreen) +{ + KdScreenPriv(pScreen); + FbdevPriv *priv = pScreenPriv->card->driver; + epsonScreenInfo *epsons = (epsonScreenInfo *) pScreenPriv->screen->driver; + + if (!LayerStartInit (pScreen)) + return FALSE; + if (!LayerFinishInit (pScreen)) + return FALSE; + + epsonConfigureScreen (pScreen); + + epsons->pLayer = epsonLayerCreate (pScreen); + if (!epsons->pLayer) + return FALSE; +#ifdef RANDR + fprintf(stderr, "calling randr init\n"); + //if (!epsonRandRInit (pScreen)) + // return FALSE; +#endif + return TRUE; +} + + +void +epsonPreserve (KdCardInfo *card) +{ + fprintf(stderr, "epsonPreserve\n"); +} + + + + + + + + +/* enable card */ +Bool +epsonEnable (ScreenPtr pScreen) +{ + KdScreenPriv(pScreen); + epsonCardInfo *epsonc = pScreenPriv->card->driver; + + epsonc->fd=open("/dev/cfxga0a", O_RDONLY); + if (epsonc->fd <= 0) { + ErrorF("Couldn't open device file /dev/mydev\n"); + } + + // make sure mode is correct? + //switch (pScreenPriv->screen->fb[0].depth) {} + + ioctl(epsonc->fd, CFXGA_SET_RESO, 0 ); + ioctl(epsonc->fd, CFXGA_CLEAR_SCREEN ) ; + + return TRUE; +} + +void +epsonDisable (ScreenPtr pScreen) +{ + KdScreenPriv(pScreen); + epsonCardInfo *epsonc = pScreenPriv->card->driver; + close(epsonc->fd); +} + + +/* enable card */ +Bool +_epsonEnable (ScreenPtr pScreen) +{ + fprintf(stderr, "epsonEnable\n"); + return TRUE; +} + + + +void +_epsonDisable (ScreenPtr pScreen) +{ + fprintf(stderr, "epsonDisable\n"); +} + + + +Bool +epsonDPMS (ScreenPtr pScreen, int mode) +{ + KdScreenPriv(pScreen); + epsonCardInfo *epsonc = pScreenPriv->card->driver; + fprintf(stderr, "epsonDPMS\n"); + + return TRUE; +} + +void +epsonRestore (KdCardInfo *card) +{ + fprintf(stderr, "epsonRestore\n"); +} + +void +epsonScreenFini (KdScreenInfo *screen) +{ + epsonScreenInfo *epsons = (epsonScreenInfo *) screen->driver; + fprintf(stderr, "epsonScreenFini\n"); + xfree (epsons); + screen->driver = 0; +} + +void +epsonCardFini (KdCardInfo *card) +{ + epsonCardInfo *epsonc = card->driver; + fprintf(stderr, "epsonCardFini\n"); + return; +} + + +KdCardFuncs epsonFuncs = { + epsonCardInit, /* cardinit */ + epsonScreenInit, /* scrinit */ + epsonInitScreen, /* initScreen */ + epsonPreserve, /* preserve */ + epsonEnable, /* enable */ + epsonDPMS, /* dpms */ + epsonDisable, /* disable */ + epsonRestore, /* restore */ + epsonScreenFini, /* scrfini */ + epsonCardFini, /* cardfini */ + + 0, /* initCursor */ + 0, /* enableCursor */ + 0, /* disableCursor */ + 0, /* finiCursor */ + 0, /* recolorCursor */ + + 0, /* initAccel */ + 0, /* enableAccel */ + 0, /* syncAccel */ + 0, /* disableAccel */ + 0, /* finiAccel */ + + 0, /* getColors */ + 0, /* putColors */ +}; + + + + +/* +void * +epsonWindow (ScreenPtr pScreen, + CARD32 row, + CARD32 offset, + int mode, + CARD32 *size, + void *closure) +{ + KdScreenPriv(pScreen); + *size = pScreenPriv->screen->fb[0].byteStride; + return (CARD8 *) (row * pScreenPriv->screen->fb[0].byteStride + offset); +} +*/ + +void +epsonUpdate (ScreenPtr pScreen, + shadowBufPtr pBuf) +{ + RegionPtr damage = &pBuf->damage; + PixmapPtr pShadow = pBuf->pPixmap; + shadowScrPriv(pScreen); + int nbox = REGION_NUM_RECTS (damage); + BoxPtr pbox = REGION_RECTS (damage); + FbBits *shaBase, *shaLine, *sha; + FbStride shaStride; + int scrBase, scrLine, scr; + int shaBpp; + int shaXoff, shaYoff; /* XXX assumed to be zero */ + int x, y, w, h, width; + int i; + int winBase, win; + CARD32 winSize; + KdScreenPriv(pScreen); + epsonCardInfo *epsonc = pScreenPriv->card->driver; + int fd = epsonc->fd; + + fbGetDrawable (&pShadow->drawable, shaBase, shaStride, shaBpp, shaXoff, shaYoff); + while (nbox--) + { + + //fprintf(stderr, "nbox %d, (%d, %d), (%d, %d)\n", nbox, pbox->x1, pbox->y1, pbox->x2, pbox->y2); + // ************************************ + + y = pbox->y1; + while(yy2) { + // warning, hard coded to 640x480x16 + // I think we can use shaStride to get rid of the 640, but I'm not sure + write_line(fd, shaBase+((y*640 + pbox->x1)/(shaBpp/8)), y, pbox->x1, pbox->x2); + y++; + } + pbox++; + } +} + diff -Naur xc-orig/programs/Xserver/hw/kdrive/epson/epson.h xc/programs/Xserver/hw/kdrive/epson/epson.h --- xc-orig/programs/Xserver/hw/kdrive/epson/epson.h 1969-12-31 19:00:00.000000000 -0500 +++ xc/programs/Xserver/hw/kdrive/epson/epson.h 2004-09-17 11:59:16.000000000 -0400 @@ -0,0 +1,57 @@ +/* + * Copyright 2004 by Kent Lyons, Georgia Tech, Atlanta, GA, USA. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Alan Hourihane not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Alan Hourihane makes no representations + * about the suitability of this software for any purpose. It is provided + * "as is" without express or implied warranty. + * + * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL ALAN HOURIHANE 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 OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Authors: Kent Lyons, + */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/epson/epson.h,v 1.3 2002/10/14 18:01:41 keithp Exp $ */ + +#ifndef _EPSON_H_ +#define _EPSON_H_ + +#include + + +typedef volatile CARD8 VOL8; +typedef volatile CARD16 VOL16; +typedef volatile CARD32 VOL32; + +typedef struct _epsonCardInfo { + CARD8 *fb; + int fd; + // CARD32 memory; + CARD32 *window; +} epsonCardInfo; + + +typedef struct _epsonScreenInfo { + //CARD8 *cursor_base; + CARD8 *screen; + CARD8 *off_screen; + int off_screen_size; + int randr; + LayerPtr pLayer; +} epsonScreenInfo; + + + +extern KdCardFuncs epsonFuncs; + +#endif /* _EPSON_H_ */ diff -Naur xc-orig/programs/Xserver/hw/kdrive/epson/epsoninit.c xc/programs/Xserver/hw/kdrive/epson/epsoninit.c --- xc-orig/programs/Xserver/hw/kdrive/epson/epsoninit.c 1969-12-31 19:00:00.000000000 -0500 +++ xc/programs/Xserver/hw/kdrive/epson/epsoninit.c 2004-09-17 11:08:20.000000000 -0400 @@ -0,0 +1,54 @@ +/* + * Copyright © 1999 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD 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 OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Adapted from ts300.c by Alan Hourihane + * For the Compaq IPAQ handheld, with the HP VGA Out Card (F1252A). + */ +/* $XFree86: xc/programs/Xserver/hw/kdrive/ipaq/ipaq.c,v 1.4 2002/10/14 18:01:41 keithp Exp $ */ + +#include "epson.h" + +extern KdCardFuncs epsonFuncs; + +void +InitCard (char *name) +{ + KdCardAttr attr; + KdCardInfoAdd (&epsonFuncs, &attr, 0); +} + +void +InitOutput (ScreenInfo *pScreenInfo, int argc, char **argv) +{ + KdInitOutput (pScreenInfo, argc, argv); +} + +void +InitInput (int argc, char **argv) +{ + KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs); +} + +int +ddxProcessArgument (int argc, char **argv, int i) +{ + return KdProcessArgument (argc, argv, i); +} diff -Naur xc-orig/programs/Xserver/hw/kdrive/epson/iodata_cs.h xc/programs/Xserver/hw/kdrive/epson/iodata_cs.h --- xc-orig/programs/Xserver/hw/kdrive/epson/iodata_cs.h 1969-12-31 19:00:00.000000000 -0500 +++ xc/programs/Xserver/hw/kdrive/epson/iodata_cs.h 2004-09-17 16:00:13.000000000 -0400 @@ -0,0 +1,798 @@ +/*********************************************************************** + +Original Developed by: + + 2002/10/25 start + Copyright (C) 2002 I-O DATA DEVICE,INC. + +Abstract: + + CFXGA driver for ZAURUS(Linux) + +Revision History: + + 2002/11/25 Ver1.00 + 2003/01/08 Ver1.01 Support SWIVEL_180 and SWIVEL_270. + 2003/01/14 Ver1.01 Add BLTS_TIMEOUT define. + +***********************************************************************/ + +#ifndef _MEMORY_CS_H +#define _MEMORY_CS_H +//---------------------------------------------------------------------- +//include +//---------------------------------------------------------------------- +#include + +#define FOPS(i,f,b,c,p) (f,b,c,p) +#define FS_RELEASE_T int + +//---------------------------------------------------------------------- +//driver version [100 -> 1.00] +//---------------------------------------------------------------------- +#define DRVIER_VERSION 101 + +//---------------------------------------------------------------------- +//define +//---------------------------------------------------------------------- +#define RESO_256 0 //1: 256 color support +#define MEM_SPEED 250 // +#define BUSY_TIMEOUT 0x1000000 // +#define FIFO_TIMEOUT 0x1000 // +#define BLTS_TIMEOUT 0x100 //(Ver1.01) + +//---------------------------------------------------------------------- +//ioctl commmand No. +//---------------------------------------------------------------------- +#define CFXGA_MAGIC_NO 'c' +#define CFXGA_GET_STATUS _IOR(CFXGA_MAGIC_NO, 1, struct status_t) +#define CFXGA_GET_RESONUM _IOR(CFXGA_MAGIC_NO, 2, unsigned int) +#define CFXGA_GET_RESOINFO _IOR(CFXGA_MAGIC_NO, 3, struct reso_info_t) +#define CFXGA_SET_RESO _IOW(CFXGA_MAGIC_NO, 4, unsigned int) +#define CFXGA_COPY_FB _IOW(CFXGA_MAGIC_NO, 5, struct copy_info_t) +#define CFXGA_COPY_FB2 _IOW(CFXGA_MAGIC_NO, 6, struct copy2_info_t) +#define CFXGA_CLEAR_SCREEN _IO(CFXGA_MAGIC_NO, 7) +#define CFXGA_SCREEN_OFF _IO(CFXGA_MAGIC_NO, 8) + +//---------------------------------------------------------------------- +//structure +//---------------------------------------------------------------------- +typedef struct reso_t { + int cx; //resolution x + int cy; //resolution y + u_int ref; //refresh rate (Hz) + u_int bpp; //color depth (bits/pixel) + u_int dclk; //dot clock (kHz) + u_int flags; //resolution flags +} reso_t; +//resolution flags +#define MODE_VGA 0x00000001 +#define MODE_NTSC 0x00000002 +#define MODE_PAL 0x00000004 +#define OUT_VGA 0x00000010 +#define OUT_COMPOSITE 0x00000020 +#define OUT_SVIDEO 0x00000040 + +typedef struct status_t { + int version; //[OUT] driver version (100 = 1.00) + int flags; //[OUT] status flags +} status_t; +//status flags +#define CFXGA_INSTALLED 0x00000001 +#define CFXGA_BUSY 0x00000002 //reserved +#define CFXGA_SCREEN_ON 0x00000004 + +typedef struct reso_info_t { + u_int mode_no; //[IN] mode no. + reso_t reso; //[OUT] resolution infomation +} reso_info_t; + +typedef struct copy_info_t { + int x; //[IN] destnation x org + int y; //[IN] destnation y org + int w; //[IN] width + int h; //[IN] height + int bpp; //[IN] src bpp + int stride; //[IN] src screen stride + void *adr; //[IN] src data start address +} copy_info_t; + +typedef struct copy2_info_t { + int x; //[IN] destnation x org + int y; //[IN] destnation y org + int w; //[IN] width + int h; //[IN] height + int bpp; //[IN] src bpp + int stride; //[IN] src screen stride + u_long phys_adr; //[IN] src screen physical address + u_long size; //[IN] src screen physical address size (bytes) + u_long offset; //[IN] src date offset + u_int swivel; //[IN] swivel level +} copy2_info_t; +//swivel level +#define SWIVEL_0 0 //NOMAL +#define SWIVEL_90 1 //LEFT 90 degree +#define SWIVEL_180 2 //LEFT 180 degree +#define SWIVEL_270 3 //LEFT 270 degree + +#define MAX_REG 11 +typedef struct DefReso { + reso_t reso; + u_short reg[MAX_REG * 2]; +} DefReso, *pDefReso; + + +//---------------------------------------------------------------------- +//resolution data tatble +//---------------------------------------------------------------------- +static u_short common_reg[] = +{ + //Clock + 0x10,0x0002, + 0x14,0x0000, + 0x1c,0x0002, + //Mem Config + 0x20,0x0380, + 0x2a,0x0100, + //CRT,TV + 0x62,0x0000, + 0x64,0x0000, + 0x68,0x0000, + 0x6a,0x0000, + //CRT,TV Cursor + 0x80,0x0000, + 0x82,0x0259, + 0x84,0x0190, + 0x86,0x0000, + 0x88,0x0000, + 0x8a,0x3f1f, + 0x8c,0x001f, + 0x8e,0x0000, + //other + 0x01f0,0x0210, + 0x01f4,0x0000, + //end flag + 0xffff,0xffff, +}; + +static DefReso crt_640x480x72x16 = +{ + {640,480,72,16,31500, MODE_VGA | OUT_VGA}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1ffe, + //Clock + 0x18,0x0000, + 0x1e,0x0002, + //CRT,TV + 0x50,0x004f, + 0x52,0x0217, + 0x54,0x0004, + 0x56,0x01df, + 0x58,0x0827, + 0x5a,0x1202, + //end flag + 0xffff,0xffff, + }, +}; + +static DefReso crt_640x480x85x16 = +{ + {640,480,85,16,36000, MODE_VGA | OUT_VGA}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0011, + 0x1e,0x0002, + //CRT,TV + 0x50,0x004f, + 0x52,0x0617, + 0x54,0x0006, + 0x56,0x01df, + 0x58,0x001c, + 0x5a,0x1202, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso crt_848x480x60x16 = +{ + {848,480,60,16,33333, MODE_VGA | OUT_VGA}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1ffc, + //Clock + 0x18,0x00a3, + 0x1e,0x0002, + //CRT,TV + 0x50,0x0069, + 0x52,0x011b, + 0x54,0x008d, + 0x56,0x01df, + 0x58,0x05a4, + 0x5a,0x1287, + //end flag + 0xffff,0xffff + }, +}; + +#if 0 +static DefReso crt_800x600x60x16 = +{ + {800,640,60,16,40000, MODE_VGA | OUT_VGA}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1ffd, + //Clock + 0x18,0x0000, + 0x1e,0x0002, + //CRT,TV + 0x50,0x0063, + 0x52,0x041f, + 0x54,0x008f, + 0x56,0x027f, + 0x58,0x001b, + 0x5a,0x1283, + //end flag + 0xffff,0xffff + }, +}; +#else +static DefReso crt_800x600x60x16 = +{ + {800,600,60,16,40000, MODE_VGA | OUT_VGA}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1ffd, + //Clock + 0x18,0x0000, + 0x1e,0x0002, + //CRT,TV + 0x50,0x0063, + 0x52,0x041f, + 0x54,0x008f, + 0x56,0x0257, + 0x58,0x001b, + 0x5a,0x1283, + //end flag + 0xffff,0xffff + }, +}; +#endif + +static DefReso ntsc_comp_640x480x16 = +{ + {640,480,00,16,17734, MODE_NTSC | OUT_COMPOSITE}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0082, + 0x1e,0x0001, + //CRT,TV + 0x50,0x004f, + 0x52,0x0921, + 0x54,0x0000, + 0x56,0x01df, + 0x58,0x0015, + 0x5a,0x0000, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso ntsc_comp_696x436x16 = +{ + {696,436,00,16,17734, MODE_NTSC | OUT_COMPOSITE}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0082, + 0x1e,0x0001, + //CRT,TV + 0x50,0x0056, + 0x52,0x041a, + 0x54,0x0000, + 0x56,0x01b3, + 0x58,0x0c2b, + 0x5a,0x0000, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso ntsc_svideo_640x480x16 = +{ + {640,480,00,16,17734, MODE_NTSC | OUT_SVIDEO}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0082, + 0x1e,0x0001, + //CRT,TV + 0x50,0x004f, + 0x52,0x0921, + 0x54,0x0000, + 0x56,0x01df, + 0x58,0x0015, + 0x5a,0x0200, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso ntsc_svideo_696x436x16 = +{ + {696,436,00,16,17734, MODE_NTSC | OUT_SVIDEO}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0082, + 0x1e,0x0001, + //CRT,TV + 0x50,0x0056, + 0x52,0x041a, + 0x54,0x0000, + 0x56,0x01b3, + 0x58,0x0c2b, + 0x5a,0x0200, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso pal_comp_640x480x16 = +{ + {640,480,00,16,17734, MODE_PAL | OUT_COMPOSITE}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0080, + 0x1e,0x0001, + //CRT,TV + 0x50,0x004f, + 0x52,0x153d, + 0x54,0x0000, + 0x56,0x01df, + 0x58,0x1747, + 0x5a,0x0100, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso pal_comp_800x572x16 = +{ + {800,572,00,16,17734, MODE_PAL | OUT_COMPOSITE}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0080, + 0x1e,0x0001, + //CRT,TV + 0x50,0x0063, + 0x52,0x0929, + 0x54,0x0000, + 0x56,0x023b, + 0x58,0x0010, + 0x5a,0x0100, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso pal_svideo_640x480x16 = +{ + {640,480,00,16,17734, MODE_PAL | OUT_SVIDEO}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0080, + 0x1e,0x0001, + //CRT,TV + 0x50,0x004f, + 0x52,0x153d, + 0x54,0x0000, + 0x56,0x01df, + 0x58,0x1747, + 0x5a,0x0300, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso pal_svideo_800x572x16 = +{ + {800,572,00,16,17734, MODE_PAL | OUT_SVIDEO}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0080, + 0x1e,0x0001, + //CRT,TV + 0x50,0x0063, + 0x52,0x0929, + 0x54,0x0000, + 0x56,0x023b, + 0x58,0x0010, + 0x5a,0x0300, + //end flag + 0xffff,0xffff + }, +}; + + +#if RESO_256 + +static DefReso crt_640x480x72x8 = +{ + {640,480,72,8,31500, MODE_VGA | OUT_VGA}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1ffe, + //Clock + 0x18,0x0000, + 0x1e,0x0002, + //CRT,TV + 0x50,0x004f, + 0x52,0x0217, + 0x54,0x0004, + 0x56,0x01df, + 0x58,0x0827, + 0x5a,0x1202, + //end flag + 0xffff,0xffff, + }, +}; + +static DefReso crt_640x480x85x8 = +{ + {640,480,85,8,36000, MODE_VGA | OUT_VGA}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0011, + 0x1e,0x0002, + //CRT,TV + 0x50,0x004f, + 0x52,0x0617, + 0x54,0x0006, + 0x56,0x01df, + 0x58,0x001c, + 0x5a,0x1202, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso crt_848x480x60x8 = +{ + {848,480,60,8,33333, MODE_VGA | OUT_VGA}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1ffc, + //Clock + 0x18,0x00a3, + 0x1e,0x0002, + //CRT,TV + 0x50,0x0069, + 0x52,0x011b, + 0x54,0x008d, + 0x56,0x01df, + 0x58,0x05a4, + 0x5a,0x1287, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso crt_800x600x60x8 = +{ + {800,600,60,8,40000, MODE_VGA | OUT_VGA}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1ffd, + //Clock + 0x18,0x0000, + 0x1e,0x0002, + //CRT,TV + 0x50,0x0063, + 0x52,0x041f, + 0x54,0x008f, + 0x56,0x0257, + 0x58,0x001b, + 0x5a,0x1283, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso crt_800x600x72x8 = +{ + {800,600,72,8,40000, MODE_VGA | OUT_VGA}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0003, + 0x1e,0x0002, + //CRT,TV + 0x50,0x0063, + 0x52,0x061d, + 0x54,0x008e, + 0x56,0x0257, + 0x58,0x1d41, + 0x5a,0x1285, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso crt_1024x768x60x8 = +{ + {1024,768,60,8,65000, MODE_VGA | OUT_VGA}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1ffc, + //Clock + 0x18,0x0000, + 0x1e,0x0001, + //CRT,TV + 0x50,0x007f, + 0x52,0x0227, + 0x54,0x008f, + 0x56,0x02ff, + 0x58,0x0027, + 0x5a,0x1285, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso ntsc_comp_640x480x8 = +{ + {640,480,00,8,17734, MODE_NTSC | OUT_COMPOSITE}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0082, + 0x1e,0x0001, + //CRT,TV + 0x50,0x004f, + 0x52,0x0921, + 0x54,0x0000, + 0x56,0x01df, + 0x58,0x0015, + 0x5a,0x0000, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso ntsc_comp_696x436x8 = +{ + {696,436,00,8,17734, MODE_NTSC | OUT_COMPOSITE}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0082, + 0x1e,0x0001, + //CRT,TV + 0x50,0x0056, + 0x52,0x041a, + 0x54,0x0000, + 0x56,0x01b3, + 0x58,0x0c2b, + 0x5a,0x0000, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso ntsc_svideo_640x480x8 = +{ + {640,480,00,8,17734, MODE_NTSC | OUT_SVIDEO}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0082, + 0x1e,0x0001, + //CRT,TV + 0x50,0x004f, + 0x52,0x0921, + 0x54,0x0000, + 0x56,0x01df, + 0x58,0x0015, + 0x5a,0x0200, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso ntsc_svideo_696x436x8 = +{ + {696,436,00,8,17734, MODE_NTSC | OUT_SVIDEO}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0082, + 0x1e,0x0001, + //CRT,TV + 0x50,0x0056, + 0x52,0x041a, + 0x54,0x0000, + 0x56,0x01b3, + 0x58,0x0c2b, + 0x5a,0x0200, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso pal_comp_640x480x8 = +{ + {640,480,00,8,17734, MODE_PAL | OUT_COMPOSITE}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0080, + 0x1e,0x0001, + //CRT,TV + 0x50,0x004f, + 0x52,0x153d, + 0x54,0x0000, + 0x56,0x01df, + 0x58,0x1747, + 0x5a,0x0100, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso pal_comp_800x572x8 = +{ + {800,572,00,8,17734, MODE_PAL | OUT_COMPOSITE}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0080, + 0x1e,0x0001, + //CRT,TV + 0x50,0x0063, + 0x52,0x0929, + 0x54,0x0000, + 0x56,0x023b, + 0x58,0x0010, + 0x5a,0x0100, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso pal_svideo_640x480x8 = +{ + {640,480,00,8,17734, MODE_PAL | OUT_SVIDEO}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0080, + 0x1e,0x0001, + //CRT,TV + 0x50,0x004f, + 0x52,0x153d, + 0x54,0x0000, + 0x56,0x01df, + 0x58,0x1747, + 0x5a,0x0300, + //end flag + 0xffff,0xffff + }, +}; + +static DefReso pal_svideo_800x572x8 = +{ + {800,572,00,8,17734, MODE_PAL | OUT_SVIDEO}, + { + //GPIO + 0x04,0x0007, + 0x08,0x1fff, + //Clock + 0x18,0x0080, + 0x1e,0x0001, + //CRT,TV + 0x50,0x0063, + 0x52,0x0929, + 0x54,0x0000, + 0x56,0x023b, + 0x58,0x0010, + 0x5a,0x0300, + //end flag + 0xffff,0xffff + }, +}; + +#endif + +//------------------------------------------------------------- +//resolution table +//------------------------------------------------------------- +static pDefReso reso_tbl[] = +{ + &crt_640x480x72x16, + &crt_640x480x85x16, + &crt_848x480x60x16, + &crt_800x600x60x16, + &ntsc_comp_640x480x16, + &ntsc_comp_696x436x16, + &ntsc_svideo_640x480x16, + &ntsc_svideo_696x436x16, + &pal_comp_640x480x16, + &pal_comp_800x572x16, + &pal_svideo_640x480x16, + &pal_svideo_800x572x16, +#if RESO_256 + &crt_640x480x72x8, + &crt_640x480x85x8, + &crt_848x480x60x8, + &crt_800x600x60x8, + &crt_800x600x72x8, + &crt_1024x768x60x8, + &ntsc_comp_640x480x8, + &ntsc_comp_696x436x8, + &ntsc_svideo_640x480x8, + &ntsc_svideo_696x436x8, + &pal_comp_640x480x8, + &pal_comp_800x572x8, + &pal_svideo_640x480x8, + &pal_svideo_800x572x8, +#endif +}; + +#define CFXGA_RESONUM (sizeof(reso_tbl) / sizeof(pDefReso)) + + + +#endif //_MEMORY_CS_H diff -Naur xc-orig/programs/Xserver/hw/kdrive/kinput.c xc/programs/Xserver/hw/kdrive/kinput.c --- xc-orig/programs/Xserver/hw/kdrive/kinput.c 2002-11-13 11:37:39.000000000 -0500 +++ xc/programs/Xserver/hw/kdrive/kinput.c 2004-10-14 10:09:07.000000000 -0400 @@ -559,6 +559,8 @@ if (kdKeyboardFuncs) (*kdKeyboardFuncs->Load) (); kdMinKeyCode = kdMinScanCode + KD_KEY_OFFSET; + if (kdMaxScanCode > (255-KD_KEY_OFFSET)) + kdMaxScanCode=247; /* hack to fix overflow */ kdMaxKeyCode = kdMaxScanCode + KD_KEY_OFFSET; kdKeySyms.map = kdKeymap; kdKeySyms.minKeyCode = kdMinKeyCode;