diff options
| author | Graeme Gregory <dp@xora.org.uk> | 2007-10-02 16:02:45 +0000 |
|---|---|---|
| committer | Graeme Gregory <dp@xora.org.uk> | 2007-10-02 16:02:45 +0000 |
| commit | 239fbede1a35795644854839bbf9623d7779febc (patch) | |
| tree | c722df23d0e8e1151caa613d56fc623ad3357fe3 /packages | |
| parent | 6f9b6256a5b0d50c9386ce0c460de98452b8f86f (diff) | |
xorg-xserver/xserver-kdrive-1.2.0/kdrive-imageon.patch : drop duplicate old
patch
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/xorg-xserver/xserver-kdrive-1.2.0/kdrive-imageon.patch | 9079 |
1 files changed, 0 insertions, 9079 deletions
diff --git a/packages/xorg-xserver/xserver-kdrive-1.2.0/kdrive-imageon.patch b/packages/xorg-xserver/xserver-kdrive-1.2.0/kdrive-imageon.patch deleted file mode 100644 index b143eedff3..0000000000 --- a/packages/xorg-xserver/xserver-kdrive-1.2.0/kdrive-imageon.patch +++ /dev/null @@ -1,9079 +0,0 @@ -# Author: Manuel Teira <manuel.teira@telefonica.net> (sirfred in #oe) -# Description: New driver for the Imageon ATI Card. Implementing: -# -Hardware solid fills -# -Hardware bitblt -# -Hardware cursors -# -XV Extension -# -Internal and External Imageon offscreen memory support -# -Hardware RandR rotation (without using a shadow framebuffer) -# -Support for RandR mode changing - -# -# Patch managed by http://www.holgerschurig.de/patcher.html -# - -Index: xorg-server-1.2.0/configure.ac -=================================================================== ---- xorg-server-1.2.0.orig/configure.ac 2007-06-17 10:49:00.000000000 +0200 -+++ xorg-server-1.2.0/configure.ac 2007-06-17 10:49:02.000000000 +0200 -@@ -444,6 +444,7 @@ - AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no]) - AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto]) - AC_ARG_ENABLE(xsdl, AS_HELP_STRING([--enable-xsdl], [Build the kdrive Xsdl server (default: auto)]), [XSDL=$enableval], [XSDL=auto]) -+AC_ARG_ENABLE(imageon, AS_HELP_STRING([--enable-imageon], [Build the kdrive Ximageon server (default: no)]), [KDRIVEIMAGEON=$enableval], [KDRIVEIMAGEON=no]) - dnl xprint - AC_ARG_ENABLE(freetype, AS_HELP_STRING([ --enable-freetype], [Build Xprint FreeType backend (default: yes)]), [XP_USE_FREETYPE=$enableval],[XP_USE_FREETYPE=no]) - AC_ARG_WITH(freetype-config, AS_HELP_STRING([ --with-freetype-config=PROG], [Use FreeType configuration program PROG (default: auto)]), freetype_config=$withval, freetype_config=auto) -@@ -1581,6 +1582,11 @@ - AC_SUBST([XSDL_INCS]) - - -+AM_CONDITIONAL(KDRIVEIMAGEON, [test "x$KDRIVEIMAGEON" = xyes]) -+if test "x$KDRIVEIMAGEON" = xyes; then -+ AC_DEFINE(KDRIVEIMAGEON, 1, [Build Ximageon server]) -+fi -+ - dnl these only go in xkb-config.h (which is shared by the Xorg and Xnest servers) - AC_DEFINE(__XKBDEFRULES__, "xorg", [Default XKB rules]) - AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data]) -@@ -1806,6 +1812,7 @@ - hw/kdrive/epson/Makefile - hw/kdrive/fake/Makefile - hw/kdrive/fbdev/Makefile -+hw/kdrive/imageon/Makefile - hw/kdrive/i810/Makefile - hw/kdrive/linux/Makefile - hw/kdrive/mach64/Makefile -Index: xorg-server-1.2.0/hw/kdrive/Makefile.am -=================================================================== ---- xorg-server-1.2.0.orig/hw/kdrive/Makefile.am 2007-06-17 10:49:00.000000000 +0200 -+++ xorg-server-1.2.0/hw/kdrive/Makefile.am 2007-06-17 11:03:40.000000000 +0200 -@@ -1,24 +1,15 @@ --if KDRIVEVESA --VESA_SUBDIRS = vesa ati chips epson i810 mach64 mga neomagic nvidia pm2 r128 \ -- smi via --endif -- - if KDRIVEFBDEV --FBDEV_SUBDIRS = fbdev epson --endif -- --if XSDLSERVER --XSDL_SUBDIRS = sdl --endif -- --if XEPHYR --XEPHYR_SUBDIRS = ephyr -+FBDEV_SUBDIRS = fbdev - endif - - if KDRIVELINUX - LINUX_SUBDIRS = linux - endif - -+if KDRIVEIMAGEON -+IMAGEON_SUBDIRS = imageon -+endif -+ - SUBDIRS = \ - src \ - $(LINUX_SUBDIRS) \ -@@ -26,7 +17,7 @@ - $(FBDEV_SUBDIRS) \ - $(VESA_SUBDIRS) \ - $(XEPHYR_SUBDIRS) \ -- fake -+ $(IMAGEON_SUBDIRS) - - DIST_SUBDIRS = vesa ati chips epson i810 mach64 mga neomagic nvidia pm2 r128 \ - smi via fbdev sdl ephyr src linux fake sis300 -Index: xorg-server-1.2.0/hw/kdrive/imageon/Makefile.am -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ xorg-server-1.2.0/hw/kdrive/imageon/Makefile.am 2007-06-17 10:49:02.000000000 +0200 -@@ -0,0 +1,47 @@ -+if KDRIVEFBDEV -+FBDEV_INCLUDES =-I$(top_srcdir)/hw/kdrive/fbdev -+FBDEV_LIBS = $(top_builddir)/hw/kdrive/fbdev/libfbdev.a -+endif -+ -+INCLUDES = \ -+ @KDRIVE_INCS@ \ -+ $(FBDEV_INCLUDES) \ -+ @KDRIVE_CFLAGS@ -+ -+bin_PROGRAMS = Ximageon -+ -+if TSLIB -+TSLIB_FLAG = -lts -+endif -+ -+noinst_LIBRARIES = libimageon.a -+ -+libimageon_a_SOURCES = \ -+ imageon.h \ -+ imageon_regs.h \ -+ imageon_const.h \ -+ imageon.c \ -+ imageon_cursor.c \ -+ imageon_draw.c \ -+ imageon_support.c \ -+ imageon_video.c -+ -+ -+ -+Ximageon_SOURCES = \ -+ imageon_stub.c -+ -+W100_LIBS = \ -+ libimageon.a \ -+ $(FBDEV_LIBS) \ -+ @KDRIVE_LIBS@ -+ -+Ximageon_LDADD = \ -+ $(W100_LIBS) \ -+ @XSERVER_LIBS@ \ -+ $(TSLIB_FLAG) -+ -+ -+Ximageon_DEPENDENCIES = \ -+ libimageon.a \ -+ $(FBDEV_LIBS) -Index: xorg-server-1.2.0/hw/kdrive/imageon/imageon.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ xorg-server-1.2.0/hw/kdrive/imageon/imageon.c 2007-06-17 10:49:02.000000000 +0200 -@@ -0,0 +1,606 @@ -+/* -+ * Copyright © 2007 Manuel Teira -+ * -+ * 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 Manuel Teira not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Manuel Teira makes no -+ * representations about the suitability of this software for any purpose. It -+ * is provided "as is" without express or implied warranty. -+ * -+ * MANUEL TEIRA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL MANUEL TEIRA 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. -+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include <kdrive-config.h> -+#endif -+#include "imageon.h" -+#include "imageon_regs.h" -+#include "imageon_support.h" -+ -+W100CardEntry w100_cards[] = { -+ {0x1002, 0x5644, 0, "ATI Imageon 3200"}, -+ {0x1002, 0x5741, W100XVSupport, "ATI Imageon 100"}, -+ {0x1002, 0x5744, 0, "ATI Imageon 3220"}, -+ {0, 0, 0, NULL} -+}; -+ -+W100ModeSpec w100_modes[] = { -+ {800, 600, 16, W100_EXTMEM, FALSE}, -+ {640, 480, 16, W100_EXTMEM, FALSE}, -+ {320, 240, 16, W100_INTMEM, FALSE}, -+ { 0, 0, 0, 0, FALSE} -+}; -+ -+W100StartupInfo w100StartupInfo; -+ -+extern void (*tslib_transform_coords)(long *x, long *y, void *closure); -+extern void *tslib_transform_closure; -+ -+static void -+W100Startup(W100CardInfo *w100c) -+{ -+ int i; -+ DBG_IMAGEON(("--W100Startup\n")); -+ W100ModeSpec *modes; -+ /* Take the current graphics mode */ -+ if (!W100GetFbMode(w100c, &w100StartupInfo.mode)) { -+ ErrorF("(E) Unable to get current mode\n"); -+ } -+ w100StartupInfo.randr = W100GetRotation(w100c); -+ w100StartupInfo.portrait = w100StartupInfo.mode.width < w100StartupInfo.mode.height; -+ -+ /* Test the valid modes */ -+ for (modes = w100_modes; modes->width; modes++) { -+ modes->supported = W100CheckFbMode(w100c, modes); -+ } -+ -+ DBG_IMAGEON(("Startup Mode: %dx%d@%d, rot: %d, portrait: %s\n", -+ w100StartupInfo.mode.width, -+ w100StartupInfo.mode.height, -+ w100StartupInfo.mode.bpp, -+ w100StartupInfo.randr, -+ w100StartupInfo.portrait ? "Yes" : "No")); -+ -+ /* Tell the kernel to never switch off external memory */ -+ W100SysFsSet(w100c, W100_SYSFS_BASE "extmem", "1"); -+ -+ /* Disable framebuffer accel */ -+ W100SysFsSet(w100c, W100_SYSFS_BASE "accel", "0"); -+ -+ /* Enable fastsysclk */ -+ W100SysFsSet(w100c, W100_SYSFS_BASE "fastpllclk", "1"); -+ -+} -+ -+ -+static Bool -+W100Map(KdCardInfo * card, W100CardInfo *w100c) -+{ -+ DBG_IMAGEON(("--W100Map\n")); -+ w100c->mem_base = (CARD8 *) KdMapDevice(W100_MEM_BASE, W100_MEM_SIZE); -+ -+ if (w100c->mem_base == NULL) { -+ return FALSE; -+ } -+ -+ w100c->reg_base = w100c->mem_base + W100_REG_OFFSET; -+ -+ /* -+ * It doesn't matter mapping all the area as registers. -+ * There's only difference when HAVE_ASM_MTRR_H is defined. -+ * So, this call is doing nothing. -+ */ -+ KdSetMappedMode(W100_MEM_BASE, W100_MEM_SIZE, KD_MAPPED_MODE_REGISTERS); -+ -+ return TRUE; -+} -+ -+static void -+W100Unmap(KdCardInfo * card, W100CardInfo *w100c) -+{ -+ DBG_IMAGEON(("--W100Unmap\n")); -+ if (w100c->mem_base) { -+ KdResetMappedMode(W100_MEM_BASE, W100_MEM_SIZE, -+ KD_MAPPED_MODE_REGISTERS); -+ KdUnmapDevice((void *) w100c->mem_base, W100_MEM_SIZE); -+ w100c->mem_base = w100c->reg_base = 0; -+ } -+} -+ -+static void W100MemSetup(W100CardInfo *w100c) -+{ -+ int reg_value; -+ int int_start, int_size; -+ int ext_start, ext_size; -+ int i; -+ DBG_IMAGEON(("--W100MemSetup\n")); -+ -+ for (i = 0; i < w100c->num_memareas; i++) { -+ xfree(w100c->memareas[i]); -+ } -+ xfree(w100c->memareas); -+ -+ reg_value = MMIO_IN32(mmMC_FB_LOCATION); -+ int_start = (reg_value & 0xffff) << 8; -+ int_size = (((reg_value >> 16) & 0xffff) - (reg_value & 0xffff)) << 8; -+ DBG_IMAGEON(("(I) MC_FB_LOCATION: 0x%08x. Start: 0x%08x, size: %d\n", -+ reg_value, int_start, int_size)); -+ -+ reg_value = MMIO_IN32(mmMC_EXT_MEM_LOCATION); -+ ext_start = (reg_value & 0xffff) << 8; -+ ext_size = (((reg_value >> 16) & 0xffff) - (reg_value & 0xffff)) << 8; -+ DBG_IMAGEON(("(I) MC_EXT_MEM_LOCATION: 0x%08x. Start: 0x%08x, size: %d\n", -+ reg_value, ext_start, ext_size)); -+ -+ w100c->num_memareas = (ext_size > 0) ? 2 : 1; -+ w100c->memareas = xcalloc(sizeof(W100MemArea *), w100c->num_memareas); -+ -+ w100c->memareas[W100_INTMEM] = xcalloc(sizeof(W100MemArea), 1); -+ w100c->memareas[W100_INTMEM]->priority = KD_VIDMEM_MAXPRIO; -+ w100c->memareas[W100_INTMEM]->start = (CARD8 *) int_start; -+ w100c->memareas[W100_INTMEM]->size = int_size; -+ -+ if (w100c->num_memareas == 2) { -+ w100c->memareas[W100_EXTMEM] = xcalloc(sizeof(W100MemArea), 1); -+ w100c->memareas[W100_EXTMEM]->priority = KD_VIDMEM_MINPRIO; -+ w100c->memareas[W100_EXTMEM]->start = (CARD8 *) ext_start; -+ w100c->memareas[W100_EXTMEM]->size = ext_size; -+ } -+ -+ for (i = 0; i < w100c->num_memareas; i++) { -+ DBG_IMAGEON(("(I) Memory mapped at 0x%08x(0x%08x), size %d bytes\n", -+ W100_CARD2HOST(w100c->memareas[i]->start), -+ w100c->memareas[i]->start, -+ w100c->memareas[i]->size)); -+ } -+ -+} -+ -+static Bool -+W100CardInit(KdCardInfo * card) -+{ -+ W100CardInfo *w100c; -+ -+ W100CardEntry *model = &w100_cards[0]; -+ static Bool initialized = FALSE; -+ -+ DBG_IMAGEON(("--W100CardInit\n")); -+ -+ w100c = xcalloc(sizeof(W100CardInfo), 1); -+ if (w100c == NULL) -+ return FALSE; -+ -+ if (!fbdevInitialize(card, &w100c->fbdev)) { -+ return FALSE; -+ } -+ -+ if (!W100Map(card, w100c)) { -+ xfree(w100c); -+ return FALSE; -+ } -+ card->driver = w100c; -+ -+ while (model->name) { -+ if (model->device == card->attr.deviceID) { -+ w100c->card_id = model; -+ break; -+ } -+ model++; -+ } -+ -+ ErrorF("(I) Using ATI card: %s\n", w100c->card_id->name); -+ -+ if (!initialized) { -+ initialized = TRUE; -+ W100Startup(w100c); -+ } -+ -+ w100c->hw_window.mode = W100GetModeSpec(w100c, &w100StartupInfo.mode); -+ w100c->hw_window.randr = w100StartupInfo.randr; -+ -+ tslib_transform_closure = w100c; -+ tslib_transform_coords = W100TransformTsLibCoordinates; -+ return TRUE; -+} -+ -+ -+static void -+W100CardFini(KdCardInfo * card) -+{ -+ W100CardInfo *w100c = (W100CardInfo *) card->driver; -+ -+ DBG_IMAGEON(("--W100CardFini\n")); -+ W100Unmap(card, w100c); -+ fbdevCardFini(card); -+} -+ -+static void -+W100Setup(KdScreenInfo *screen) -+{ -+ W100CardInfo(screen); -+ W100MemArea *mem; -+ KdMouseMatrix m; -+ int fb_size, i; -+ -+ DBG_IMAGEON(("--W100Setup\n")); -+ -+ /* Adjust mode */ -+ w100c->hw_window.width = screen->width; -+ w100c->hw_window.height = screen->height; -+ w100c->hw_window.bpp = screen->fb[0].bitsPerPixel; -+ W100SetupGraphicWindow(w100c); -+ -+ /* Get some register values */ -+ w100c->regs.ENG_CNTL = MMIO_IN32(mmENG_CNTL); -+ w100c->regs.VIDEO_CTRL = MMIO_IN32(mmVIDEO_CTRL); -+ w100c->regs.GRAPHIC_H_DISP = MMIO_IN32(mmGRAPHIC_H_DISP); -+ w100c->regs.GRAPHIC_V_DISP = MMIO_IN32(mmGRAPHIC_V_DISP); -+ w100c->regs.DISP_DEBUG2 = MMIO_IN32(mmDISP_DEBUG2); -+ -+ W100MemSetup(w100c); -+ -+ /* Clear the VideoMemAreas set up by the framebuffer initialization */ -+ for (i = 0; i < screen->num_videomem_areas; i++) { -+ xfree(screen->videomem_areas[i]); -+ } -+ xfree(screen->videomem_areas); -+ -+ screen->videomem_areas = xcalloc(sizeof(KdVideoMemArea *), -+ w100c->num_memareas); -+ screen->num_videomem_areas = w100c->num_memareas; -+ -+ screen->fb[0].byteStride = screen->width * screen->fb[0].bitsPerPixel / 8; -+ fb_size = screen->fb[0].byteStride * screen->height; -+ -+ DBG_IMAGEON(("(I) Framebuffer required size: %d bytes\n", fb_size)); -+ -+ for (i = 0; i < w100c->num_memareas; i++) { -+ mem = w100c->memareas[i]; -+ screen->videomem_areas[i] = xcalloc(sizeof(KdVideoMemArea), 1); -+ screen->videomem_areas[i]->priority = mem->priority; -+ screen->videomem_areas[i]->base = W100_CARD2HOST(mem->start); -+ screen->videomem_areas[i]->size = mem->size; -+ if (w100c->hw_window.mode->fbpool == i) { -+ DBG_IMAGEON(("(I) FrameBuffer in w100 memzone 0x%08x(0x%08x)\n", -+ W100_CARD2HOST(mem->start), mem->start)); -+ screen->videomem_areas[i]->available_offset = fb_size; -+ screen->fb[0].frameBuffer = W100_CARD2HOST(mem->start); -+ } else { -+ screen->videomem_areas[i]->available_offset = 0; -+ } -+ DBG_IMAGEON(("New videomem_area(priority:%d, start:0x%08x, size:%d, available_offset:%d\n", -+ screen->videomem_areas[i]->priority, -+ screen->videomem_areas[i]->base, -+ screen->videomem_areas[i]->size, -+ screen->videomem_areas[i]->available_offset)); -+ } -+ -+ -+ w100c->hw_window.offset = W100_HOST2CARD(screen->fb[0].frameBuffer); -+ -+ KdComputeMouseMatrix(&m, screen->randr, -+ w100StartupInfo.portrait ? -+ W100_MIN(screen->width, screen->height) : -+ W100_MAX(screen->width, screen->height), -+ w100StartupInfo.portrait ? -+ W100_MAX(screen->width, screen->height) : -+ W100_MIN(screen->width, screen->height)); -+ -+ KdSetMouseMatrix(&m); -+ -+ DBG_IMAGEON(("Window(width:%d,height:%d,bpp:%d,offset:0x%08x" -+ "(0x%08x), randr:%d)\n", -+ w100c->hw_window.width, -+ w100c->hw_window.height, -+ w100c->hw_window.bpp, -+ w100c->hw_window.offset, -+ screen->fb[0].frameBuffer, -+ w100c->hw_window.randr)); -+ -+} -+ -+static Bool -+W100ScreenInit(KdScreenInfo * screen) -+{ -+ W100ScreenInfo *w100s; -+ W100CardInfo(screen); -+ Bool success = FALSE; -+ -+ DBG_IMAGEON(("--W100ScreenInit\n")); -+ w100s = xcalloc(sizeof(W100ScreenInfo), 1); -+ if (w100s == NULL) -+ return FALSE; -+ -+ w100s->w100c = w100c; -+ w100s->screen = screen; -+ screen->driver = w100s; -+ -+ success = fbdevScreenInitialize(screen, &w100s->fbdev); -+ -+ if (!success) { -+ screen->driver = NULL; -+ xfree(w100s); -+ return FALSE; -+ } -+ -+ W100Setup(screen); -+ -+ return TRUE; -+} -+ -+static void -+W100ScreenFini(KdScreenInfo * screen) -+{ -+ W100ScreenInfo *w100s = (W100ScreenInfo *) screen->driver; -+ DBG_IMAGEON(("--W100ScreenFini\n")); -+ fbdevScreenFini(screen); -+ xfree(w100s); -+ screen->driver = 0; -+} -+ -+static Bool -+W100InitScreen(ScreenPtr pScreen) -+{ -+ KdScreenPriv(pScreen); -+ W100CardInfo(pScreenPriv); -+ -+ DBG_IMAGEON(("--W100InitScreen\n")); -+ if (w100c->card_id->caps & W100XVSupport) { -+ W100InitVideo(pScreen); -+ } -+ return fbdevInitScreen(pScreen); -+} -+ -+#ifdef RANDR -+ -+static Bool W100RandRSetConfig(ScreenPtr pScreen, -+ Rotation randr, -+ int rate, -+ RRScreenSizePtr pSize) -+{ -+ KdScreenPriv(pScreen); -+ KdScreenInfo *screen = pScreenPriv->screen; -+ W100CardInfo(pScreenPriv); -+ Bool screenEnabled = pScreenPriv->enabled; -+ -+ DBG_IMAGEON(("--W100RandRSetConfig(randr:%d,pSize:%dx%d)\n", -+ randr, pSize->width, pSize->height)); -+ -+ if (screenEnabled) { -+ KdDisableScreen(pScreen); -+ } -+ -+ if (randr & (RR_Rotate_0|RR_Rotate_180)) { -+ pScreen->mmWidth = screen->width_mm; -+ pScreen->mmHeight = screen->height_mm; -+ pScreen->width = pSize->width; -+ pScreen->height = pSize->height; -+ } else { -+ pScreen->mmWidth = screen->height_mm; -+ pScreen->mmHeight = screen->width_mm; -+ pScreen->width = pSize->height; -+ pScreen->height = pSize->width; -+ } -+ -+ screen->randr = randr; -+ screen->width = pScreen->width; -+ screen->height = pScreen->height; -+ w100c->hw_window.randr = KdSubRotation(w100StartupInfo.randr, randr); -+ w100c->hw_window.mode = W100GetBestMode(w100c, pScreen->width, pScreen->height); -+ -+ KdOffscreenSwapOut(screen->pScreen); -+ -+ W100Setup(screen); -+ -+ DBG_IMAGEON(("ModifyPixMapHeader(width:%d,height:%d,depth:%d,bpp:%d,bs:%d,fb:0x%08x)\n", pScreen->width, pScreen->height, -+ screen->fb[0].depth, -+ screen->fb[0].bitsPerPixel, -+ screen->fb[0].byteStride, -+ screen->fb[0].frameBuffer)); -+ -+ -+ (*pScreen->ModifyPixmapHeader) (fbGetScreenPixmap(pScreen), -+ pScreen->width, -+ pScreen->height, -+ screen->fb[0].depth, -+ screen->fb[0].bitsPerPixel, -+ screen->fb[0].byteStride, -+ screen->fb[0].frameBuffer); -+ -+ -+ if (screenEnabled) { -+ KdEnableScreen(pScreen); -+ } -+ return TRUE; -+} -+ -+static Bool W100RandRGetInfo(ScreenPtr pScreen, Rotation *rotations) -+{ -+ KdScreenPriv(pScreen); -+ KdScreenInfo *screen = pScreenPriv->screen; -+ W100CardInfo(pScreenPriv); -+ RRScreenSizePtr pSize; -+ Rotation randr; -+ W100ModeSpec *modes; -+ int i; -+ -+ DBG_IMAGEON(("--W100RandRGetInfo\n")); -+ -+ *rotations = RR_Rotate_All; -+ -+ for (modes = w100_modes; modes->width; modes++) { -+ if (modes->supported) { -+ pSize = RRRegisterSize(pScreen, -+ modes->width, -+ modes->height, -+ screen->width_mm, -+ screen->height_mm); -+ if (modes == w100c->hw_window.mode) { -+ RRSetCurrentConfig(pScreen, screen->randr, 0, pSize); -+ } -+ } -+ } -+ -+ return TRUE; -+} -+ -+static Bool W100RandRInit(ScreenPtr pScreen) -+{ -+ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen); -+ DBG_IMAGEON(("--W100RandRInit\n")); -+ pScrPriv->rrSetConfig = W100RandRSetConfig; -+ pScrPriv->rrGetInfo = W100RandRGetInfo; -+ return TRUE; -+} -+ -+#endif -+ -+static Bool -+W100FinishInitScreen(ScreenPtr pScreen) -+{ -+ KdScreenPriv(pScreen); -+ W100CardInfo(pScreenPriv); -+ DBG_IMAGEON(("--W100FinishInitScreen\n")); -+ if (!fbdevFinishInitScreen(pScreen)) -+ return FALSE; -+ -+#ifdef RANDR -+ if (!W100RandRInit(pScreen)) -+ return FALSE; -+#endif -+ return TRUE; -+} -+ -+static Bool -+W100CreateResources(ScreenPtr pScreen) -+{ -+ KdScreenPriv(pScreen); -+ W100CardInfo(pScreenPriv); -+ -+ return fbdevCreateResources(pScreen); -+} -+ -+static void -+W100Preserve(KdCardInfo * card) -+{ -+ W100CardInfo *w100c = card->driver; -+ DBG_IMAGEON(("--W100Preserve\n")); -+ -+ fbdevPreserve(card); -+} -+ -+static void -+W100Restore(KdCardInfo * card) -+{ -+ W100CardInfo *w100c = card->driver; -+ DBG_IMAGEON(("--W100Restore\n")); -+ fbdevRestore(card); -+} -+ -+static Bool -+W100DPMS(ScreenPtr pScreen, int mode) -+{ -+ KdScreenPriv(pScreen); -+ W100CardInfo(pScreenPriv); -+ DBG_IMAGEON(("--W100DPMS\n")); -+ return fbdevDPMS(pScreen, mode); -+} -+ -+static Bool -+W100Enable(ScreenPtr pScreen) -+{ -+ KdScreenPriv(pScreen); -+ W100CardInfo(pScreenPriv); -+ -+ DBG_IMAGEON(("--W100Enable\n")); -+ -+ /* -+ if (!fbdevEnable(pScreen)) -+ return FALSE; -+ */ -+ -+ if (w100c->mem_base == NULL) { -+ if (!W100Map(pScreenPriv->screen->card, w100c)) { -+ return FALSE; -+ } -+ W100Setup(pScreenPriv->screen); -+ } -+ W100SetupGraphicEngine(w100c); -+ -+ graphic_offset_u go; -+ go.val = MMIO_IN32(mmGRAPHIC_OFFSET); -+ DBG_IMAGEON(("Graphic offset is 0x%08x(0x%08x)\n", -+ go.f.graphic_offset, -+ W100_CARD2HOST(go.f.graphic_offset))); -+ -+ -+ return TRUE; -+} -+ -+static void -+W100Disable(ScreenPtr pScreen) -+{ -+ KdScreenPriv(pScreen); -+ W100CardInfo(pScreenPriv); -+ DBG_IMAGEON(("--W100Disable\n")); -+ //W100Unmap(pScreenPriv->card, w100c); -+ -+ fbdevDisable(pScreen); -+} -+ -+static void -+W100GetColors(ScreenPtr pScreen, int fb, int n, xColorItem * pdefs) -+{ -+ KdScreenPriv(pScreen); -+ W100CardInfo(pScreenPriv); -+ -+ fbdevGetColors(pScreen, fb, n, pdefs); -+} -+ -+static void -+W100PutColors(ScreenPtr pScreen, int fb, int n, xColorItem * pdefs) -+{ -+ KdScreenPriv(pScreen); -+ W100CardInfo(pScreenPriv); -+ -+ fbdevPutColors(pScreen, fb, n, pdefs); -+} -+ -+KdCardFuncs W100Funcs = { -+ W100CardInit, /* cardinit */ -+ W100ScreenInit, /* scrinit */ -+ W100InitScreen, /* initScreen */ -+ W100FinishInitScreen, /* finishInitScreen */ -+ W100CreateResources, /* createRes */ -+ W100Preserve, /* preserve */ -+ W100Enable, /* enable */ -+ W100DPMS, /* dpms */ -+ W100Disable, /* disable */ -+ W100Restore, /* restore */ -+ W100ScreenFini, /* scrfini */ -+ W100CardFini, /* cardfini */ -+ -+ W100CursorInit, /* initCursor */ -+ W100CursorEnable, /* enableCursor */ -+ W100CursorDisable, /* disableCursor */ -+ W100CursorFini, /* finiCursor */ -+ W100RecolorCursor, /* recolorCursor */ -+ -+ W100InitAccel, /* initAccel */ -+ W100EnableAccel, /* enableAccel */ -+ W100DisableAccel, /* disableAccel */ -+ W100FiniAccel, /* finiAccel */ -+ -+ W100GetColors, /* getColors */ -+ W100PutColors, /* putColors */ -+}; -Index: xorg-server-1.2.0/hw/kdrive/imageon/imageon_const.h -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ xorg-server-1.2.0/hw/kdrive/imageon/imageon_const.h 2007-06-17 10:49:02.000000000 +0200 -@@ -0,0 +1,161 @@ -+/* -+ * Copyright © 2007 Manuel Teira -+ * -+ * 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 Manuel Teira not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Manuel Teira makes no -+ * representations about the suitability of this software for any purpose. It -+ * is provided "as is" without express or implied warranty. -+ * -+ * MANUEL TEIRA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL MANUEL TEIRA 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. -+ */ -+ -+#ifndef __IMAGEON_CONST_H__ -+#define __IMAGEON_CONST_H__ -+ -+// DP_GUI_MASTER_CNTL.GMC_Brush_DataType -+// DP_DATATYPE.Brush_DataType -+#define DP_BRUSH_8x8MONOOPA 0 //8x8 mono pattern (expanded to frgd, bkgd) -+#define DP_BRUSH_8x8MONOTRA 1 //8x8 mono pattern (expanded to frgd, leave_alone) -+#define DP_PEN_32x1MONOOPA 6 //32x1 mono pattern (expanded to frgd, bkgd) -+#define DP_PEN_32x1MONOTRA 7 //32x1 mono pattern (expanded to frgd, leave_alone) -+#define DP_BRUSH_8x8COLOR 10 //8x8 color pattern -+#define DP_BRUSH_SOLIDCOLOR 13 //solid color pattern (frgd) -+#define DP_BRUSH_NONE 15 //no brush used -+ -+#define SIZE_BRUSH_8x8MONO 2 -+#define SIZE_PEN_32x1MONO 1 -+#define SIZE_BRUSH_8x8COLOR_8 16 -+#define SIZE_BRUSH_8x8COLOR_16 32 -+#define MAX_BRUSH_SIZE SIZE_BRUSH_8x8COLOR_16 -+ -+// DP_GUI_MASTER_CNTL.GMC_Dst_DataType -+// DP_DATATYPE.Dp_Dst_DataType -+#define DP_DST_8BPP 2 // 8 bpp grey scale -+#define DP_DST_16BPP_1555 3 //16 bpp aRGB 1555 -+#define DP_DST_16BPP_444 5 //16 bpp aRGB 4444 -+ -+// DP_GUI_MASTER_CNTL.GMC_Src_DataType -+// DP_DATATYPE.Dp_Src_DataType -+#define DP_SRC_1BPP_OPA 0 //mono (expanded to frgd, bkgd) -+#define DP_SRC_1BPP_TRA 1 //mono (expanded to frgd, leave_alone) -+#define DP_SRC_COLOR_SAME_AS_DST 3 //color (same as DST) -+#define DP_SRC_SOLID_COLOR_BLT 4 //solid color for Blt (use frgd) -+#define DP_SRC_4BPP 5 //4 bpp -+#define DP_SRC_12BPP_PACKED 6 //12 bpp packed -+ -+// DP_GUI_MASTER_CNTL.GMC_Byte_Pix_Order -+// DP_DATATYPE.Dp_Byte_Pix_Order -+#define DP_PIX_ORDER_MSB2LSB 0 //monochrome pixel order from MSBit to LSBit -+#define DP_PIX_ORDER_LSB2MSB 1 //monochrome pixel order from LSBit to MSBit -+ -+// DP_GUI_MASTER_CNTL.GMC_Dp_Src_Source -+#define DP_SRC_MEM_LINEAR 1 //loaded from memory (linear trajectory) -+#define DP_SRC_MEM_RECTANGULAR 2 //loaded from memory (rectangular trajectory) -+#define DP_SRC_HOSTDATA_BIT 3 //loaded from hostdata (linear trajectory) -+#define DP_SRC_HOSTDATA_BYTE 4 //loaded from hostdata (linear trajectory & byte-aligned) -+ -+// DP_GUI_MASTER_CNTL.GMC_Dp_Op -+#define DP_OP_ROP 0 -+#define DP_OP_ARITHMETIC 1 -+ -+// E2_ARITHMETIC_CNTL.opcode -+#define E2_OPC_GLBALP_ADD_SRC2 0 -+#define E2_OPC_GLBALP_SUB_SRC2 1 -+#define E2_OPC_SRC1_ADD_SRC2 2 -+#define E2_OPC_SRC1_SUB_SRC2 3 -+#define E2_OPC_DST_SADDBLEND_SRC2 4 -+#define E2_OPC_DST_CADDBLEND_SRC2 5 -+#define E2_OPC_DST_CSUBBLEND_SRC2 6 -+#define E2_OPC_LF_SRC2 7 -+#define E2_OPC_SCALE_SRC2 8 -+#define E2_OPC_STRETCH_SRC2 9 -+#define E2_OPC_SRC1_4BPPCPYWEXP 10 -+#define E2_OPC_MC1 11 -+#define E2_OPC_MC2 12 -+#define E2_OPC_MC1_IDCT 13 -+#define E2_OPC_MC2_IDCT 14 -+#define E2_OPC_IDCT_ONLY_IFRAME 15 -+ -+// E2_ARITHMETIC_CNTL.clamp -+#define E2_CLAMP_OFF 0 -+#define E2_CLAMP_ON 1 -+ -+// E2_ARITHMETIC_CNTL.rounding -+#define E2_ROUNDING_TRUNCATE 0 -+#define E2_ROUNDING_TO_INFINITY 1 -+ -+// E2_ARITHMETIC_CNTL.srcblend -+#define E2_SRCBLEND_GLOBALALPHA 0 -+#define E2_SRCBLEND_ZERO 1 -+#define E2_SRCBLEND_SRC2ALPHA 2 -+#define E2_SRCBLEND_DSTALPHA 3 -+#define E2_SRCBLEND_ALPHA1PLANE 4 -+ -+// E2_ARITHMETIC_CNTL.destblend -+#define E2_DSTBLEND_GLOBALALPHA 0 -+#define E2_DSTBLEND_ZERO 1 -+#define E2_DSTBLEND_SRC2ALPHA 2 -+#define E2_DSTBLEND_DSTALPHA 3 -+#define E2_DSTBLEND_ALPHA1PLANE 4 -+ -+// LCD_FORMAT.lcd_type -+#define LCDTYPE_TFT333 0 -+#define LCDTYPE_TFT444 1 -+#define LCDTYPE_TFT555 2 -+#define LCDTYPE_TFT666 3 -+#define LCDTYPE_COLSTNPACK4 4 -+#define LCDTYPE_COLSTNPACK8F1 5 -+#define LCDTYPE_COLSTNPACK8F2 6 -+#define LCDTYPE_COLSTNPACK16 7 -+#define LCDTYPE_MONSTNPACK4 8 -+#define LCDTYPE_MONSTNPACK8 9 -+ -+// CP_RB_CNTL.rb_bufsz -+#define RB_SIZE_2K 8 -+#define RB_SIZE_4K 9 -+#define RB_SIZE_8K 10 -+#define RB_SIZE_16K 11 -+#define RB_SIZE_32K 12 -+#define RB_SIZE_64K 13 -+ -+// GRAPHIC_CTRL.color_depth -+#define COLOR_DEPTH_1BPP 0 -+#define COLOR_DEPTH_2BPP 1 -+#define COLOR_DEPTH_4BPP 2 -+#define COLOR_DEPTH_8BPP 3 -+#define COLOR_DEPTH_332 4 -+#define COLOR_DEPTH_A444 5 -+#define COLOR_DEPTH_A555 6 -+ -+// VIDEO_CTRL.video_mode -+#define VIDEO_MODE_422 0 -+#define VIDEO_MODE_420 1 -+ -+// CLR_CMP_CNTL.cmp_fcn_src -+#define CMP_FCN_SRC_NEQ 4 -+#define CMP_FCN_SRC_EQ 5 -+ -+// CLR_CMP_CNTL.cmp_src -+#define CMP_SRC_SRC 1 -+ -+// Overlay formats -+#define OVLFORMAT_YUV422 (6) -+#define OVLFORMAT_YUV420 (7) -+#define OVLFORMAT_RGB565 (5) -+#define OVLFORMAT_EQU_DISPLAY (8) -+ -+#define W100_CLK_SRC_XTAL 0 -+#define W100_CLK_SRC_PLL 1 -+ -+#endif -Index: xorg-server-1.2.0/hw/kdrive/imageon/imageon_cursor.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ xorg-server-1.2.0/hw/kdrive/imageon/imageon_cursor.c 2007-06-17 10:49:02.000000000 +0200 -@@ -0,0 +1,569 @@ -+/* -+ * Copyright © 2007 Manuel Teira -+ * -+ * 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 Manuel Teira not be used in -+ * advertising or publicity pertaining to distribution of the software without -+ * specific, written prior permission. Manuel Teira makes no -+ * representations about the suitability of this software for any purpose. It -+ * is provided "as is" without express or implied warranty. -+ * -+ * MANUEL TEIRA DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -+ * EVENT SHALL MANUEL TEIRA 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. -+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include <kdrive-config.h> -+#endif -+ -+#include "cursorstr.h" -+#include "imageon.h" -+#include "imageon_regs.h" -+ -+#define W100_CURSOR_HEIGHT (16) -+#define W100_CURSOR_WIDTH (16) -+#define W100_CURSOR_PITCH (W100_CURSOR_WIDTH / 4) -+ -+#define W100_CURSOR_SIZE W100_CURSOR_PITCH * W100_CURSOR_WIDTH -+ -+static CARD16 expand2bpp[256]; -+ -+static CARD16 spread_byte(CARD8 b) -+{ -+ CARD16 s = b; -+ -+ s = ((s & 0x00f0) << 4) | (s & 0x000f); -+ s = ((s & 0x0c0c) << 2) | (s & 0x0303); -+ s = ((s & 0x2222) << 1) | (s & 0x1111); -+ return s; -+} -+ -+static void W100InitExpansionTable() -+{ -+ int i; -+ for (i = 0; i < 256; i++) { -+ expand2bpp[i] = spread_byte(i); -+ } -+} -+ -+#define BigEndian(v) \ -+ (((v & 0x000000ff) << 24) | \ -+ ((v & 0x0000ff00) << 8) | \ -+ ((v & 0x00ff0000) >> 8) | \ -+ ((v & 0xff000000) >> 24)) -+ -+#define PixelOffset(x, y) \ -+ (((y) * W100_CURSOR_PITCH + ((x) / 4)) >> 2) -+ -+#define PixelShift(x, y) \ -+ (2 * ((x) % 16)) -+ -+#define PixelMask(x, y) \ -+ ((0xc0000000) >> PixelShift(x, y)) -+ -+#define PixelVal(src, x, y) \ -+ ((*(src + PixelOffset(x, y)) & PixelMask(x, y)) >> (30 - PixelShift(x, y))) -+ -+#define SetPixelVal(ptr, x, y, val) \ -+ *(((CARD32 *)(ptr)) + PixelOffset(x, y)) = \ -+ *(((CARD32 *)(ptr)) + PixelOffset(x, y)) & ~PixelMask(x, y) | \ -+ ((val) & 0x03) << (30 - PixelShift(x2, y2)) -+ -+#define DUMP_CURSOR(src) do { \ -+ int x; \ -+ int y; \ -+ for (y = 0; y < W100_CURSOR_HEIGHT; y++) { \ -+ DBG_IMAGEON(("Line %02d: ", y)); \ -+ for (x = 0; x < W100_CURSOR_WIDTH; x++) { \ -+ DBG_IMAGEON(("%d", PixelVal(src,x,y))); \ -+ } \ -+ DBG_IMAGEON(("\n")); \ -+ } \ -+ DBG_IMAGEON((".\n")); \ -+} while (0) -+ -+static void -+W100RotateCursor(int randr, CARD32 *src, CARD32 *dst) -+{ -+ int x1, y1, x2, y2; -+ -+ switch (randr & RR_Rotate_All) { -+ case RR_Rotate_0: -+ x1 = 0; -+ y1 = 0; -+ for (y2 = 0; y2 < W100_CURSOR_HEIGHT; y2++) { -+ for (x2 = W100_CURSOR_WIDTH - 1; x2 >= 0; --x2) { -+ SetPixelVal(dst, x2, y2, PixelVal(src, x1, y1)); -+ ++x1; -+ if (x1 >= W100_CURSOR_WIDTH) { -+ x1 = 0; -+ ++y1; -+ } -+ } -+ } -+ break; -+ case RR_Rotate_90: -+ x1 = 0; -+ y1 = 0; -+ f |
