xf86-video-geode-2.11.18/0000755000175000017500000000000012654451205011651 500000000000000xf86-video-geode-2.11.18/src/0000755000175000017500000000000012654451205012440 500000000000000xf86-video-geode-2.11.18/src/gx_vga.c0000644000175000017500000002756412654445443014024 00000000000000/* Copyright (c) 2003-2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to set modes using the VGA registers. * Since this file is for the first generation graphics unit, it interfaces * to SoftVGA registers. It works for both VSA1 and VSA2. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include /* VGA STRUCTURE */ #define GU2_STD_CRTC_REGS 25 #define GU2_EXT_CRTC_REGS 15 #define GU2_GDC_REGS 9 #define GU2_SEQ_REGS 5 #define GU2_VGA_FLAG_MISC_OUTPUT 0x1 #define GU2_VGA_FLAG_STD_CRTC 0x2 #define GU2_VGA_FLAG_EXT_CRTC 0x4 #define GU2_VGA_FLAG_GDC 0x10 #define GU2_VGA_FLAG_SEQ 0x20 #define GU2_VGA_FLAG_PALETTE 0x40 #define GU2_VGA_FLAG_ATTR 0x80 static unsigned int GDCregs[10]; static unsigned int SEQregs[10]; static unsigned int palette[256]; static unsigned int ATTRregs[32]; static unsigned char *font_data = NULL; #define VGA_BLOCK 0x40000 /* 256 k */ void gu2_vga_extcrtc(char offset, int reset); int gu2_get_vga_active(void); void gu2_vga_font_data(int flag); void gu2_set_vga(int reset); int gu2_vga_seq_blanking(void); int gu2_vga_attr_ctrl(int reset); void gu2_vga_to_gfx(void); void gu2_gfx_to_vga(int vga_mode); int gu2_vga_seq_reset(int reset); int gu2_vga_save(gfx_vga_struct * vga, int flags); void gu2_vga_clear_extended(void); int gu2_vga_restore(gfx_vga_struct * vga, int flags); int gu2_get_vga_active(void) { int data = gfx_read_reg32(MDC_GENERAL_CFG); if (data & MDC_GCFG_VGAE) return 1; return 0; } void gu2_vga_font_data(int flag) { if (flag == 0) { if (font_data == NULL) { font_data = malloc(VGA_BLOCK); } DEBUGMSG(1, (0, X_NONE, "Saving VGA Data\n")); memcpy(font_data, gfx_virt_fbptr, VGA_BLOCK); } else if (font_data) { DEBUGMSG(1, (0, X_NONE, "Restore VGA Data\n")); memcpy(gfx_virt_fbptr, font_data, VGA_BLOCK); free(font_data); font_data = NULL; } } void gu2_set_vga(int reset) { int data = gfx_read_reg32(MDC_GENERAL_CFG); if (reset) data |= MDC_GCFG_VGAE; else data &= ~MDC_GCFG_VGAE; gfx_write_reg32(MDC_GENERAL_CFG, data); } int gu2_vga_seq_blanking(void) { int tmp; gfx_outb(0x3C4, 1); tmp = gfx_inb(0x3C5); tmp |= 0x20; tmp |= tmp << 8; gfx_outw(0x3C4, tmp); gfx_delay_milliseconds(1); return (GFX_STATUS_OK); } int gu2_vga_attr_ctrl(int reset) { int tmp; tmp = gfx_inb(0x3DA); gfx_outb(0x3C0, (unsigned char) (reset ? 0x00 : 0x20)); if (reset) tmp = gfx_inb(0x3DA); return (GFX_STATUS_OK); } void gu2_vga_to_gfx(void) { gu2_vga_attr_ctrl(0); gu2_vga_seq_blanking(); gfx_delay_milliseconds(2); gu2_vga_extcrtc(0x3F, 1); } void gu2_gfx_to_vga(int vga_mode) { int tmp; char sequencer; gu2_vga_extcrtc(0x40, vga_mode); /* clear the display blanking bit */ gfx_outb(MDC_SEQUENCER_INDEX, MDC_SEQUENCER_CLK_MODE); sequencer = gfx_inb(MDC_SEQUENCER_DATA); sequencer &= ~MDC_CLK_MODE_SCREEN_OFF; sequencer |= 1; gfx_outb(MDC_SEQUENCER_DATA, sequencer); gfx_delay_milliseconds(1); /*restart the sequencer */ gfx_outw(0x3C4, 0x300); /* turn on the attribute controler */ tmp = gfx_inb(0x3DA); gfx_outb(0x3C0, 0x20); tmp = gfx_inb(0x3DA); gu2_vga_extcrtc(0x3F, 0); } /*--------------------------------------------------------------------------- * gfx_vga_seq_reset * * This routine enables or disables SoftVGA. It is used to make SoftVGA * "be quiet" and not interfere with any of the direct hardware access from * Durango. For VSA1, the sequencer is reset to stop text redraws. VSA2 may * provide a better way to have SoftVGA sit in the background. *--------------------------------------------------------------------------- */ int gu2_vga_seq_reset(int reset) { gfx_outb(0x3C4, 0); gfx_outb(0x3C5, (unsigned char) (reset ? 0x00 : 0x03)); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_vga_save * * This routine saves the state of the VGA registers into the specified * structure. Flags indicate what portions of the register state need to * be saved. *---------------------------------------------------------------------------- */ int gu2_vga_save(gfx_vga_struct * vga, int flags) { int i; unsigned short crtcindex, crtcdata; crtcindex = (gfx_inb(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; /* CHECK MISCELLANEOUS OUTPUT FLAG */ if (flags & GU2_VGA_FLAG_MISC_OUTPUT) { /* SAVE MISCCELLANEOUS OUTPUT REGISTER */ vga->miscOutput = gfx_inb(0x3CC); } /* CHECK SEQ */ if (flags & GU2_VGA_FLAG_SEQ) { /* SAVE STANDARD CRTC REGISTERS */ for (i = 1; i < GU2_SEQ_REGS; i++) { gfx_outb(0x3C4, (unsigned char) i); SEQregs[i] = gfx_inb(0x3C5); } } /* CHECK STANDARD CRTC FLAG */ if (flags & GU2_VGA_FLAG_STD_CRTC) { /* SAVE STANDARD CRTC REGISTERS */ for (i = 0; i < GU2_STD_CRTC_REGS; i++) { gfx_outb(crtcindex, (unsigned char) i); vga->stdCRTCregs[i] = gfx_inb(crtcdata); } } /* CHECK GDC */ if (flags & GU2_VGA_FLAG_GDC) { /* SAVE STANDARD CRTC REGISTERS */ for (i = 0; i < GU2_GDC_REGS; i++) { gfx_outb(0x3CE, (unsigned char) i); GDCregs[i] = gfx_inb(0x3CF); } } /* CHECK EXTENDED CRTC FLAG */ if (flags & GU2_VGA_FLAG_EXT_CRTC) { /* SAVE EXTENDED CRTC REGISTERS */ for (i = 0; i < GU2_EXT_CRTC_REGS; i++) { gfx_outb(crtcindex, (unsigned char) (0x40 + i)); vga->extCRTCregs[i] = gfx_inb(crtcdata); } } if (flags & GU2_VGA_FLAG_PALETTE) { /* SAVE PALETTE DATA */ for (i = 0; i < 0x100; i++) { gfx_outb(0x3C7, i); palette[i] = gfx_inb(0x3C9); } } if (flags & GU2_VGA_FLAG_ATTR) { /* SAVE Attribute DATA */ for (i = 0; i < 21; i++) { gfx_inb(0x3DA); gfx_outb(0x3C0, i); ATTRregs[i] = gfx_inb(0x3C1); } } /* save the VGA data */ gu2_vga_font_data(0); return (0); } /*---------------------------------------------------------------------------- * gfx_vga_clear_extended * * This routine clears the extended SoftVGA register values to have SoftVGA * behave like standard VGA. *---------------------------------------------------------------------------- */ void gu2_vga_clear_extended(void) { int i; unsigned short crtcindex, crtcdata; crtcindex = (gfx_inb(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; gfx_outb(crtcindex, 0x30); gfx_outb(crtcdata, 0x57); gfx_outb(crtcdata, 0x4C); for (i = 0x41; i <= 0x4F; i++) { gfx_outb(crtcindex, (unsigned char) i); gfx_outb(crtcdata, 0); } gfx_outb(crtcindex, 0x30); gfx_outb(crtcdata, 0x00); } void gu2_vga_extcrtc(char offset, int reset) { unsigned short crtcindex, crtcdata; crtcindex = (gfx_inb(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; /* UNLOCK EXTENDED CRTC REGISTERS */ gfx_outb(crtcindex, 0x30); gfx_outb(crtcdata, 0x57); gfx_outb(crtcdata, 0x4C); /* RESTORE EXTENDED CRTC REGISTERS */ gfx_outb(crtcindex, offset); gfx_outb(crtcdata, reset); } /*---------------------------------------------------------------------------- * gfx_vga_restore * * This routine restores the state of the VGA registers from the specified * structure. Flags indicate what portions of the register state need to * be saved. *---------------------------------------------------------------------------- */ int gu2_vga_restore(gfx_vga_struct * vga, int flags) { int i; unsigned short crtcindex, crtcdata; crtcindex = (gfx_inb(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; /* CHECK MISCELLANEOUS OUTPUT FLAG */ if (flags & GU2_VGA_FLAG_MISC_OUTPUT) { /* RESTORE MISCELLANEOUS OUTPUT REGISTER VALUE */ gfx_outb(0x3C2, vga->miscOutput); } /* CHECK SEQ */ if (flags & GU2_VGA_FLAG_SEQ) { /* RESTORE STANDARD CRTC REGISTERS */ for (i = 1; i < GU2_SEQ_REGS; i++) { gfx_outb(0x3C4, (unsigned char) i); gfx_outb(0x3C5, SEQregs[i]); } } /* CHECK STANDARD CRTC FLAG */ if (flags & GU2_VGA_FLAG_STD_CRTC) { /* UNLOCK STANDARD CRTC REGISTERS */ gfx_outb(crtcindex, 0x11); gfx_outb(crtcdata, 0); /* RESTORE STANDARD CRTC REGISTERS */ for (i = 0; i < GU2_STD_CRTC_REGS; i++) { gfx_outb(crtcindex, (unsigned char) i); gfx_outb(crtcdata, vga->stdCRTCregs[i]); } } /* CHECK GDC */ if (flags & GU2_VGA_FLAG_GDC) { /* SAVE STANDARD CRTC REGISTERS */ for (i = 0; i < GU2_GDC_REGS; i++) { gfx_outb(0x3CE, (unsigned char) i); gfx_outb(0x3CF, GDCregs[i]); } } /* CHECK EXTENDED CRTC FLAG */ if (flags & GU2_VGA_FLAG_EXT_CRTC) { /* UNLOCK EXTENDED CRTC REGISTERS */ gfx_outb(crtcindex, 0x30); gfx_outb(crtcdata, 0x57); gfx_outb(crtcdata, 0x4C); /* RESTORE EXTENDED CRTC REGISTERS */ for (i = 1; i < GU2_EXT_CRTC_REGS; i++) { gfx_outb(crtcindex, (unsigned char) (0x40 + i)); gfx_outb(crtcdata, vga->extCRTCregs[i]); } /* LOCK EXTENDED CRTC REGISTERS */ gfx_outb(crtcindex, 0x30); gfx_outb(crtcdata, 0x00); /* CHECK IF DIRECT FRAME BUFFER MODE (VESA MODE) */ if (vga->extCRTCregs[0x03] & 1) { /* SET BORDER COLOR TO BLACK */ /* This really should be another thing saved/restored, but */ /* Durango currently doesn't do the attr controller registers. */ gfx_inb(0x3BA); /* Reset flip-flop */ gfx_inb(0x3DA); gfx_outb(0x3C0, 0x11); gfx_outb(0x3C0, 0x00); } } if (flags & GU2_VGA_FLAG_PALETTE) { /* RESTORE PALETTE DATA */ for (i = 0; i < 0x100; i++) { gfx_outb(0x3C8, i); gfx_outb(0x3C9, palette[i]); } } if (flags & GU2_VGA_FLAG_ATTR) { /* RESTORE Attribute DATA */ for (i = 0; i < 21; i++) { gfx_inb(0x3DA); gfx_outb(0x3C0, i); gfx_outb(0x3C0, ATTRregs[i]); } /* SAVE Attribute DATA */ for (i = 0; i < 21; i++) { gfx_inb(0x3DA); gfx_outb(0x3C0, i); } } /* restore the VGA data */ gu2_vga_font_data(1); return (0); } /* END OF FILE */ xf86-video-geode-2.11.18/src/geode_common.c0000644000175000017500000001174512654445443015176 00000000000000/* * Copyright (c) 2007 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* We want to share as much code between GX and LX as we possibly can for obvious reasons */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include /* memcmp() */ #include #include #include #include #include #include "xf86.h" #include "geode.h" #define move0(d,s,n) \ __asm__ __volatile__( \ " rep; movsl\n" \ : "=&c" (d0), "=&S" (d1), "=&D" (d2) \ : "0" (n), "1" (s), "2" (d) \ : "memory") #define move1(d,s,n) \ __asm__ __volatile__( \ " rep; movsl\n" \ " movsb\n" \ : "=&c" (d0), "=&S" (d1), "=&D" (d2) \ : "0" (n), "1" (s), "2" (d) \ : "memory") #define move2(d,s,n) \ __asm__ __volatile__( \ " rep; movsl\n" \ " movsw\n" \ : "=&c" (d0), "=&S" (d1), "=&D" (d2) \ : "0" (n), "1" (s), "2" (d) \ : "memory") #define move3(d,s,n) \ __asm__ __volatile__( \ " rep; movsl\n" \ " movsw\n" \ " movsb\n" \ : "=&c" (d0), "=&S" (d1), "=&D" (d2) \ : "0" (n), "1" (s), "2" (d) \ : "memory") void geode_memory_to_screen_blt(unsigned long src, unsigned long dst, unsigned long sp, unsigned long dp, long w, long h, int bpp) { int d0, d1, d2; int n = w * (bpp >> 3); int m = n >> 2; switch (n & 3) { case 0: while (--h >= 0) { move0(dst, src, m); src += sp; dst += dp; } break; case 1: while (--h >= 0) { move1(dst, src, m); src += sp; dst += dp; } break; case 2: while (--h >= 0) { move2(dst, src, m); src += sp; dst += dp; } break; case 3: while (--h >= 0) { move3(dst, src, m); src += sp; dst += dp; } break; } } /* I borrowed this function from the i830 driver - its much better then what we had before */ int GeodeGetRefreshRate(DisplayModePtr pMode) { if (pMode->VRefresh) return (int) (pMode->VRefresh + 0.5); return (int) (pMode->Clock * 1000.0 / pMode->HTotal / pMode->VTotal + 0.5); } /* This is used by both GX and LX. It could be accelerated for LX, probably, but that would involve a two pass blt, the first to copy the data, and the second to copy the grey (using a pattern). That seems like a bit of work for a very underused format - so we'll just use the slow version. */ void GeodeCopyGreyscale(unsigned char *src, unsigned char *dst, int dstPitch, int srcPitch, int h, int w) { int i; unsigned char *src2 = src; unsigned char *dst2 = dst; unsigned char *dst3; unsigned char *src3; dstPitch <<= 1; while (h--) { dst3 = dst2; src3 = src2; for (i = 0; i < w; i++) { *dst3++ = *src3++; /* Copy Y data */ *dst3++ = 0x80; /* Fill UV with 0x80 - greyscale */ } src3 = src2; for (i = 0; i < w; i++) { *dst3++ = *src3++; /* Copy Y data */ *dst3++ = 0x80; /* Fill UV with 0x80 - greyscale */ } dst2 += dstPitch; src2 += srcPitch; } } #if defined(linux) #include int GeodeGetSizeFromFB(unsigned int *size) { struct fb_fix_screeninfo fix; int ret; int fd = open("/dev/fb0", O_RDONLY); if (fd == -1) return -1; ret = ioctl(fd, FBIOGET_FSCREENINFO, &fix); close(fd); if (!ret) { if (!memcmp(fix.id, "Geode", 5)) { *size = fix.smem_len; return 0; } } return -1; } #else int GeodeGetSizeFromFB(unsigned int *size) { return -1; } #endif xf86-video-geode-2.11.18/src/geode_dcon.c0000644000175000017500000001042412654445443014622 00000000000000/* Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Includes that are used by all drivers */ #include #include #include #include #include "geode.h" #include #include #define DCON_SLEEP_FILE "/sys/devices/platform/dcon/sleep" #define DCON_FREEZE_FILE "/sys/devices/platform/dcon/freeze" static Bool dcon_present(void) { static int _dval = -1; if (_dval == -1) _dval = (access("/sys/class/power_supply/olpc-ac", F_OK) == 0); return (Bool) _dval; } int DCONDPMSSet(ScrnInfoPtr pScrni, int mode) { static int failed = -1; ssize_t ret; int fd; char value[1]; if (failed == -1) failed = !dcon_present(); if (failed) return 0; /* If the DCON is frozen, don't power it down, it was probably frozen * for a reason and powering it down would corrupt the display. * This is needed to avoid losing OLPC's frozen boot image during X * startup, where DPMS is used to power down and up the display. * When geode uses KMS this will not be needed as the system realises * that no mode change is needed and the display power is untouched. */ fd = open(DCON_FREEZE_FILE, O_RDONLY); if (fd < 0) { failed = 1; return 0; } ret = read(fd, value, 1); close(fd); if (ret == 1) { if (value[0] == '1') return 0; } fd = open(DCON_SLEEP_FILE, O_WRONLY); if (fd < 0) { failed = 1; return 0; } switch (mode) { case DPMSModeOn: value[0] = '0'; break; case DPMSModeStandby: case DPMSModeSuspend: case DPMSModeOff: value[0] = '1'; break; } ret = write(fd, value, sizeof(value)); close(fd); if (ret < 0) { failed = 1; return 0; } return 1; } Bool dcon_init(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); pGeode->mm_width = 0; pGeode->mm_height = 0; if (!dcon_present()) { xf86DrvMsg(pScrni->scrnIndex, X_DEFAULT, "No DCON is present\n"); return FALSE; } pGeode->panelMode = xnfcalloc(1, sizeof(DisplayModeRec)); if (pGeode->panelMode == NULL) return FALSE; /* Set up the panel mode structure automagically */ pGeode->panelMode->type = M_T_DRIVER | M_T_PREFERRED; pGeode->panelMode->Clock = 57275; pGeode->panelMode->HDisplay = 1200; pGeode->panelMode->HSyncStart = 1208; pGeode->panelMode->HSyncEnd = 1216; pGeode->panelMode->HTotal = 1240; pGeode->panelMode->VDisplay = 900; pGeode->panelMode->VSyncStart = 905; pGeode->panelMode->VSyncEnd = 908; pGeode->panelMode->VTotal = 912; pGeode->panelMode->Flags = V_NHSYNC | V_NVSYNC; pGeode->mm_width = 152; pGeode->mm_height = 114; xf86SetModeDefaultName(pGeode->panelMode); /* TODO: Print board revision once sysfs exports it. */ xf86DrvMsg(pScrni->scrnIndex, X_DEFAULT, "DCON detected.\n"); return TRUE; } xf86-video-geode-2.11.18/src/gx_accel.c0000644000175000017500000021233612654445443014307 00000000000000/* Copyright (c) 2003-2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file is consists of main Xfree acceleration supported * routines like solid fill used here. * * Project: Geode Xfree Frame buffer device driver. * */ /* #undef OPT_ACCEL */ /* Xfree86 header files */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "vgaHW.h" #include "xf86.h" #ifdef HAVE_XAA_H #include "xaalocal.h" #endif #include "xf86fbman.h" #include "miline.h" #include "xaarop.h" #include "servermd.h" #include "picture.h" #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" #include "xf86PciInfo.h" #include "geode.h" #include "gfx_defs.h" #include "gfx_regs.h" /* Common macros for blend operations are here */ #include "geode_blend.h" #undef ulong typedef unsigned long ulong; #undef uint typedef unsigned int uint; #undef ushort typedef unsigned short ushort; #undef uchar typedef unsigned char uchar; #define CALC_FBOFFSET(x, y) \ (((ulong)(y) * gu2_pitch + ((ulong)(x) << gu2_xshift))) #define FBADDR(x,y) \ ((unsigned char *)pGeode->FBBase + CALC_FBOFFSET(x, y)) #define OS_UDELAY 0 #if OS_UDELAY > 0 #define OS_USLEEP(usec) usleep(usec); #else #define OS_USLEEP(usec) #endif #ifdef OPT_ACCEL static unsigned int BPP; static unsigned int BLT_MODE, VEC_MODE; static unsigned int ACCEL_STRIDE; #define GU2_WAIT_PENDING while(READ_GP32(MGP_BLT_STATUS) & MGP_BS_BLT_PENDING) #define GU2_WAIT_BUSY while(READ_GP32(MGP_BLT_STATUS) & MGP_BS_BLT_BUSY) #endif #define HOOK(fn) localRecPtr->fn = GX##fn #define DLOG(l, fmt, args...) ErrorF(fmt, ##args) /* static storage declarations */ typedef struct sGBltBox { ulong x, y; ulong w, h; ulong color; int bpp, transparent; } GBltBox; #if GX_SCANLINE_SUPPORT static GBltBox giwr; #endif #if GX_CPU2SCREXP_SUPPORT static GBltBox gc2s; #endif #if GX_CLREXP_8X8_PAT_SUPPORT static ulong *gc8x8p; #endif #if GX_DASH_LINE_SUPPORT typedef struct sGDashLine { ulong pat[2]; int len; int fg; int bg; } GDashLine; static GDashLine gdln; #endif static unsigned int gu2_xshift, gu2_yshift; static unsigned int gu2_pitch; #if XF86XAA static XAAInfoRecPtr localRecPtr; #endif /* pat 0xF0 */ /* src 0xCC */ /* dst 0xAA */ /* (src FUNC dst) */ static const int SDfn[16] = { 0x00, 0x88, 0x44, 0xCC, 0x22, 0xAA, 0x66, 0xEE, 0x11, 0x99, 0x55, 0xDD, 0x33, 0xBB, 0x77, 0xFF }; /* ((src FUNC dst) AND pat-mask) OR (dst AND (NOT pat-mask)) */ static const int SDfn_PM[16] = { 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA }; /* (pat FUNC dst) */ static const int PDfn[16] = { 0x00, 0xA0, 0x50, 0xF0, 0x0A, 0xAA, 0x5A, 0xFA, 0x05, 0xA5, 0x55, 0xF5, 0x0F, 0xAF, 0x5F, 0xFF }; /* ((pat FUNC dst) AND src-mask) OR (dst AND (NOT src-mask)) */ static const int PDfn_SM[16] = { 0x22, 0xA2, 0x62, 0xE2, 0x2A, 0xAA, 0x6A, 0xEA, 0x26, 0xA6, 0x66, 0xE6, 0x2E, 0xAE, 0x6E, 0xEE }; #ifdef OPT_ACCEL static inline CARD32 amd_gx_BppToRasterMode(int bpp) { switch (bpp) { case 16: return MGP_RM_BPPFMT_565; case 32: return MGP_RM_BPPFMT_8888; case 8: return MGP_RM_BPPFMT_332; default: return 0; } } #endif /* OPT_ACCEL */ /*---------------------------------------------------------------------------- * GXAccelSync. * * Description :This function is called to synchronize with the graphics * engine and it waits the graphic engine is idle. This is * required before allowing direct access to the framebuffer. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * * Returns :none *---------------------------------------------------------------------------*/ void GXAccelSync(ScrnInfoPtr pScrni) { //ErrorF("GXAccelSync()\n"); #ifndef OPT_ACCEL gfx_wait_until_idle(); #else GU2_WAIT_BUSY; #endif } #if GX_FILL_RECT_SUPPORT /*---------------------------------------------------------------------------- * GXSetupForSolidFill. * * Description :The SetupFor and Subsequent SolidFill(Rect) provide * filling rectangular areas of the screen with a * foreground color. * * Parameters. * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * color int foreground fill color * rop int unmapped raster op * planemask uint -1 (fill) or pattern data * * Returns :none *--------------------------------------------------------------------------*/ static void GXSetupForSolidFill(ScrnInfoPtr pScrni, int color, int rop, unsigned int planemask) { //ErrorF("GXSetupForSolidFill(%#x,%#x,%#x)\n", color, rop, planemask); rop &= 0x0F; #ifndef OPT_ACCEL gfx_set_solid_pattern(planemask); gfx_set_solid_source(color); gfx_set_raster_operation(planemask == ~0U ? SDfn[rop] : SDfn_PM[rop]); #else { unsigned int ROP = BPP | (planemask == ~0U ? SDfn[rop] : SDfn_PM[rop]); BLT_MODE = ((ROP ^ (ROP >> 2)) & 0x33) == 0 ? MGP_BM_SRC_MONO : 0; if (((ROP ^ (ROP >> 1)) & 0x55) != 0) BLT_MODE |= MGP_BM_DST_REQ; GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, ROP); WRITE_GP32(MGP_PAT_COLOR_0, planemask); WRITE_GP32(MGP_SRC_COLOR_FG, color); WRITE_GP32(MGP_STRIDE, ACCEL_STRIDE); } #endif } /*---------------------------------------------------------------------------- * GXSubsequentSolidFillRect. * * Description :see GXSetupForSolidFill. * * Parameters. * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * x int destination x offset * y int destination y offset * w int fill area width (pixels) * h int fill area height (pixels) * * Returns :none * * Sample application uses: * - Window backgrounds. * - pull down highlighting. * - x11perf: rectangle tests (-rect500). * - x11perf: fill trapezoid tests (-trap100). * - x11perf: horizontal line segments (-hseg500). *----------------------------------------------------------------------------*/ static void GXSubsequentSolidFillRect(ScrnInfoPtr pScrni, int x, int y, int w, int h) { //ErrorF("GXSubsequentSolidFillRect() at %d,%d %dx%d\n", x, y, w, h); #ifndef OPT_ACCEL gfx_pattern_fill(x, y, w, h); #else { unsigned int offset = CALC_FBOFFSET(x, y); unsigned int size = (w << 16) | h; GU2_WAIT_PENDING; WRITE_GP32(MGP_DST_OFFSET, offset); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_BLT_MODE, BLT_MODE); } #endif } #endif /* if GX_FILL_RECT_SUPPORT */ #if GX_CLREXP_8X8_PAT_SUPPORT /*---------------------------------------------------------------------------- * GXSetupForColor8x8PatternFill * * Description :8x8 color pattern data is 64 pixels of full color data * stored linearly in offscreen video memory. These patterns * are useful as a substitute for 8x8 mono patterns when tiling, * doing opaque stipples, or regular stipples. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * patx int x offset to pattern data * paty int y offset to pattern data * rop int unmapped raster operation * planemask uint -1 (copy) or pattern data * trans_color int -1 (copy) or transparent color (not enabled) * trans color only supported on source channel * or in monochrome pattern channel * * Returns :none. * *---------------------------------------------------------------------------*/ static void GXSetupForColor8x8PatternFill(ScrnInfoPtr pScrni, int patx, int paty, int rop, uint planemask, int trans_color) { GeodeRec *pGeode = GEODEPTR(pScrni); //ErrorF("GXSetupForColor8x8PatternFill() pat %#x,%#x rop %#x %#x %#x\n", // patx, paty, rop, planemask, trans_color); rop &= 0x0F; gc8x8p = (unsigned long *) FBADDR(patx, paty); /* gfx_set_solid_pattern is needed to clear src/pat transparency */ gfx_set_solid_pattern(0); gfx_set_raster_operation(planemask == ~0U ? PDfn[rop] : (gfx_set_solid_source(planemask), PDfn_SM[rop])); gfx2_set_source_stride(pGeode->Pitch); gfx2_set_destination_stride(pGeode->Pitch); if (trans_color == -1) gfx2_set_source_transparency(0, 0); else gfx2_set_source_transparency(trans_color, ~0); } /*---------------------------------------------------------------------------- * GXSubsequentColor8x8PatternFillRect * * Description :see GXSetupForColor8x8PatternFill. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * patx int pattern phase x offset * paty int pattern phase y offset * x int destination x offset * y int destination y offset * w int fill area width (pixels) * h int fill area height (pixels) * * Returns :none * * Sample application uses: * - Patterned desktops * - x11perf: stippled rectangle tests (-srect500). * - x11perf: opaque stippled rectangle tests (-osrect500). *--------------------------------------------------------------------------*/ static void GXSubsequentColor8x8PatternFillRect(ScrnInfoPtr pScrni, int patx, int paty, int x, int y, int w, int h) { //ErrorF( // "GXSubsequentColor8x8PatternFillRect() patxy %d,%d at %d,%d %dsx%d\n", // patx, paty, x, y, w, h); gfx2_set_pattern_origin(patx, paty); gfx2_color_pattern_fill(CALC_FBOFFSET(x, y), w, h, gc8x8p); } /* GX_CLREXP_8X8_PAT_SUPPORT */ #endif #if GX_MONO_8X8_PAT_SUPPORT /*---------------------------------------------------------------------------- * GXSetupForMono8x8PatternFill * * Description :8x8 mono pattern data is 64 bits of color expansion data * with ones indicating the foreground color and zeros * indicating the background color. These patterns are * useful when tiling, doing opaque stipples, or regular * stipples. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * patx int x offset to pattern data * paty int y offset to pattern data * fg int foreground color * bg int -1 (transparent) or background color * rop int unmapped raster operation * planemask uint -1 (copy) or pattern data * * Returns :none. * * Comments :none. * *--------------------------------------------------------------------------*/ static void GXSetupForMono8x8PatternFill(ScrnInfoPtr pScrni, int patx, int paty, int fg, int bg, int rop, uint planemask) { //ErrorF( //"GXSetupForMono8x8PatternFill() pat %#x,%#x fg %#x bg %#x %#x %#x\n", //patx, paty, fg, bg, rop, planemask); rop &= 0x0F; #ifndef OPT_ACCEL gfx_set_mono_pattern(bg, fg, patx, paty, bg == -1 ? 1 : 0); gfx_set_raster_operation(planemask == ~0U ? PDfn[rop] : (gfx_set_solid_source(planemask), PDfn_SM[rop])); #else { unsigned int ROP = BPP | (bg == -1 ? MGP_RM_PAT_MONO | MGP_RM_PAT_TRANS : MGP_RM_PAT_MONO) | (planemask == ~0U ? PDfn[rop] : PDfn_SM[rop]); BLT_MODE = ((ROP ^ (ROP >> 2)) & 0x33) == 0 ? MGP_BM_SRC_MONO : 0; if (((ROP ^ (ROP >> 1)) & 0x55) != 0) BLT_MODE |= MGP_BM_DST_REQ; GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, ROP); WRITE_GP32(MGP_SRC_COLOR_FG, planemask); WRITE_GP32(MGP_PAT_COLOR_0, bg); WRITE_GP32(MGP_PAT_COLOR_1, fg); WRITE_GP32(MGP_PAT_DATA_0, patx); WRITE_GP32(MGP_PAT_DATA_1, paty); WRITE_GP32(MGP_STRIDE, ACCEL_STRIDE); } #endif } /*---------------------------------------------------------------------------- * GXSubsequentMono8x8PatternFillRect * * Description :see GXSetupForMono8x8PatternFill * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * patx int pattern phase x offset * paty int pattern phase y offset * x int destination x offset * y int destination y offset * w int fill area width (pixels) * h int fill area height (pixels) * Returns :none * * Sample application uses: * - Patterned desktops * - x11perf: stippled rectangle tests (-srect500). * - x11perf: opaque stippled rectangle tests (-osrect500). *--------------------------------------------------------------------------*/ static void GXSubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrni, int patx, int paty, int x, int y, int w, int h) { DEBUGMSG(1, (0, X_INFO, "%s() pat %#x,%#x at %d,%d %dx%d\n", __func__, patx, paty, x, y, w, h)); #ifndef OPT_ACCEL gfx_pattern_fill(x, y, w, h); #else { unsigned int offset = CALC_FBOFFSET(x, y) | ((x & 7) << 26) | ((y & 7) << 29); unsigned int size = (w << 16) | h; GU2_WAIT_PENDING; WRITE_GP32(MGP_DST_OFFSET, offset); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_BLT_MODE, BLT_MODE); } #endif } #endif /* GX_MONO_8X8_PAT_SUPPORT */ #if GX_SCR2SCRCPY_SUPPORT /*---------------------------------------------------------------------------- * GXSetupForScreenToScreenCopy * * Description :SetupFor and Subsequent ScreenToScreenCopy functions * provide an interface for copying rectangular areas from * video memory to video memory. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * xdir int x copy direction (up/dn) * ydir int y copy direction (up/dn) * rop int unmapped raster operation * planemask uint -1 (copy) or pattern data * trans_color int -1 (copy) or transparent color * * Returns :none *---------------------------------------------------------------------------*/ static void GXSetupForScreenToScreenCopy(ScrnInfoPtr pScrni, int xdir, int ydir, int rop, uint planemask, int trans_color) { DEBUGMSG(1, (0, X_INFO, "%s() xd%d yd%d rop %#x %#x %#x\n", __func__, xdir, ydir, rop, planemask, trans_color)); rop &= 0x0F; #ifndef OPT_ACCEL { GeodeRec *pGeode = GEODEPTR(pScrni); gfx_set_solid_pattern(planemask); /* transparency is a parameter to set_rop, but set...pattern clears * transparency */ if (trans_color == -1) gfx2_set_source_transparency(0, 0); else gfx2_set_source_transparency(trans_color, ~0); gfx_set_raster_operation(planemask == ~0U ? SDfn[rop] : SDfn_PM[rop]); gfx2_set_source_stride(pGeode->Pitch); gfx2_set_destination_stride(pGeode->Pitch); } #else { unsigned int ROP = BPP | (planemask == ~0U ? SDfn[rop] : SDfn_PM[rop]); if (trans_color != -1) ROP |= MGP_RM_SRC_TRANS; BLT_MODE = ((ROP ^ (ROP >> 1)) & 0x55) != 0 ? MGP_BM_SRC_FB | MGP_BM_DST_REQ : MGP_BM_SRC_FB; GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, ROP); WRITE_GP32(MGP_PAT_COLOR_0, planemask); WRITE_GP32(MGP_SRC_COLOR_FG, trans_color); WRITE_GP32(MGP_SRC_COLOR_BG, ~0); WRITE_GP32(MGP_STRIDE, ACCEL_STRIDE); } #endif } /*---------------------------------------------------------------------------- * GXSubsquentScreenToScreenCopy * * Description :see GXSetupForScreenToScreenCopy. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * x1 int source x offset * y1 int source y offset * x2 int destination x offset * y2 int destination y offset * w int copy area width (pixels) * h int copy area height (pixels) * * Returns :none * * Sample application uses (non-transparent): * - Moving windows. * - x11perf: scroll tests (-scroll500). * - x11perf: copy from window to window (-copywinwin500). *---------------------------------------------------------------------------*/ static void GXSubsequentScreenToScreenCopy(ScrnInfoPtr pScrni, int x1, int y1, int x2, int y2, int w, int h) { DEBUGMSG(1, (0, X_INFO, "%s() from %d,%d to %d,%d %dx%d\n", __func__, x1, y1, x2, y2, w, h)); #ifndef OPT_ACCEL { int flags = 0; if (x2 > x1) flags |= 1; if (y2 > y1) flags |= 2; gfx2_screen_to_screen_blt(CALC_FBOFFSET(x1, y1), CALC_FBOFFSET(x2, y2), w, h, flags); } #else { GeodeRec *pGeode = GEODEPTR(pScrni); unsigned int src = CALC_FBOFFSET(x1, y1); unsigned int dst = CALC_FBOFFSET(x2, y2); unsigned int size = (w << 16) | h; unsigned int blt_mode = BLT_MODE; if (x2 > x1) { int n = (w << gu2_xshift) - 1; src += n; dst += n; blt_mode |= MGP_BM_NEG_XDIR; } if (y2 > y1) { int n = (h - 1) * pGeode->Pitch; src += n; dst += n; blt_mode |= MGP_BM_NEG_YDIR; } GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_OFFSET, src); WRITE_GP32(MGP_DST_OFFSET, dst); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP16(MGP_BLT_MODE, blt_mode); } #endif } #endif /* if GX_SCR2SCRCPY_SUPPORT */ #if GX_SCANLINE_SUPPORT /*---------------------------------------------------------------------------- * GXSetupForScanlineImageWrite * * Description :SetupFor/Subsequent ScanlineImageWrite and ImageWriteScanline * transfer full color pixel data from system memory to video * memory. This is useful for dealing with alignment issues and * performing raster ops on the data. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * rop int unmapped raster operation * planemask uint -1 (copy) or pattern data * bpp int bits per pixel (unused) * depth int color depth (unused) * * Returns :none * * x11perf -putimage10 * x11perf -putimage100 * x11perf -putimage500 *---------------------------------------------------------------------------- */ static void GXSetupForScanlineImageWrite(ScrnInfoPtr pScrni, int rop, uint planemask, int trans_color, int bpp, int depth) { GeodeRec *pGeode = GEODEPTR(pScrni); DEBUGMSG(1, (0, X_INFO, "%s() rop %#x %#x %#x %d %d\n", __func__, rop, planemask, trans_color, bpp, depth)); rop &= 0x0F; /* transparency is a parameter to set_rop, but set...pattern clears * transparency */ gfx_set_solid_pattern(planemask); if (trans_color == -1) gfx2_set_source_transparency(0, 0); else gfx2_set_source_transparency(trans_color, ~0); gfx_set_raster_operation(planemask == ~0U ? SDfn[rop] : SDfn_PM[rop]); gfx2_set_source_stride(pGeode->Pitch); gfx2_set_destination_stride(pGeode->Pitch); } /*---------------------------------------------------------------------------- * GXSubsequentScanlineImageWriteRect * * Description : see GXSetupForScanlineImageWrite. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * x int destination x offset * y int destination y offset * w int copy area width (pixels) * h int copy area height (pixels) * skipleft int x margin (pixels) to skip (not enabled) * * Returns :none *---------------------------------------------------------------------------*/ static void GXSubsequentScanlineImageWriteRect(ScrnInfoPtr pScrni, int x, int y, int w, int h, int skipleft) { DEBUGMSG(1, (0, X_INFO, "%s() rop %d,%d %dx%d %d\n", __func__, x, y, w, h, skipleft)); giwr.x = x; giwr.y = y; giwr.w = w; giwr.h = h; #if !GX_USE_OFFSCRN_MEM #if !GX_ONE_LINE_AT_A_TIME GXAccelSync(pScrni); #endif #endif } /*---------------------------------------------------------------------------- * GXSubsquentImageWriteScanline * * Description : see GXSetupForScanlineImageWrite. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * bufno int scanline number in write group * * Returns :none * * Sample application uses (non-transparent): * - Moving windows. * - x11perf: scroll tests (-scroll500). * - x11perf: copy from window to window (-copywinwin500). * *---------------------------------------------------------------------------*/ static void GXSubsequentImageWriteScanline(ScrnInfoPtr pScrni, int bufno) { GeodeRec *pGeode = GEODEPTR(pScrni); #if !GX_USE_OFFSCRN_MEM unsigned long offset; #endif #if GX_ONE_LINE_AT_A_TIME DEBUGMSG(1, (0, X_INFO, "%s() %d\n", __func__, bufno)); #if !GX_USE_OFFSCRN_MEM offset = pGeode->AccelImageWriteBuffers[bufno] - pGeode->FBBase; gfx2_screen_to_screen_blt(offset, CALC_FBOFFSET(giwr.x, giwr.y), giwr.w, 1, 0); #else /* if !GX_USE_OFFSCRN_MEM */ gfx2_color_bitmap_to_screen_blt(0, 0, CALC_FBOFFSET(giwr.x, giwr.y), giwr.w, 1, pGeode->AccelImageWriteBuffers[bufno], pGeode->Pitch); #endif /* if !GX_USE_OFFSCRN_MEM */ ++giwr.y; #else /* if GX_ONE_LINE_AT_A_TIME */ int blt_height; DEBUGMSG(1, (0, X_INFO, "%s() %d\n", __func__, bufno)); if ((blt_height = pGeode->NoOfImgBuffers) > giwr.h) blt_height = giwr.h; if (++bufno < blt_height) return; #if !GX_USE_OFFSCRN_MEM offset = pGeode->AccelImageWriteBuffers[0] - pGeode->FBBase; gfx2_screen_to_screen_blt(offset, CALC_FBOFFSET(giwr.x, giwr.y), giwr.w, blt_height, 0); GXAccelSync(pScrni); #else /* if !GX_USE_OFFSCRN_MEM */ gfx2_color_bitmap_to_screen_blt(0, 0, CALC_FBOFFSET(giwr.x, giwr.y), giwr.w, blt_height, pGeode->AccelImageWriteBuffers[0], pGeode->Pitch); #endif /* if !GX_USE_OFFSCRN_MEM */ giwr.h -= blt_height; giwr.y += blt_height; #endif /* if GX_ONE_LINE_AT_A_TIME */ } #endif /* GX_SCANLINE_SUPPORT */ #if GX_CPU2SCREXP_SUPPORT /*---------------------------------------------------------------------------- * GXSetupForScanlineCPUToScreenColorExpandFill * * Description :SetupFor/Subsequent CPUToScreenColorExpandFill and * ColorExpandScanline routines provide an interface for * doing expansion blits from source patterns stored in * system memory. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * fg int foreground color * bg int -1 (transparent) or background color * rop int unmapped raster operation * planemask uint -1 (copy) or pattern data * * Returns :none. *---------------------------------------------------------------------------*/ static void GXSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrni, int fg, int bg, int rop, uint planemask) { GeodeRec *pGeode = GEODEPTR(pScrni); ulong srcpitch; DEBUGMSG(1, (0, X_INFO, "%s() fg %#x bg %#x rop %#x %#x\n", __func__, fg, bg, rop, planemask)); rop &= 0x0F; srcpitch = ((pGeode->Pitch + 31) >> 5) << 2; #ifndef OPT_ACCEL gfx_set_solid_pattern(planemask); gfx_set_mono_source(bg, fg, bg == -1 ? 1 : 0); gfx_set_raster_operation(planemask == ~0U ? SDfn[rop] : SDfn_PM[rop]); gfx2_set_source_stride(srcpitch); gfx2_set_destination_stride(pGeode->Pitch); #else { unsigned int stride = (srcpitch << 16) | pGeode->Pitch; unsigned int ROP = BPP | (planemask == ~0U ? SDfn[rop] : SDfn_PM[rop]); if (bg == -1) ROP |= MGP_RM_SRC_TRANS; BLT_MODE = ((ROP ^ (ROP >> 1)) & 0x55) != 0 ? MGP_BM_SRC_MONO | MGP_BM_SRC_FB | MGP_BM_DST_REQ : MGP_BM_SRC_MONO | MGP_BM_SRC_FB; GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, ROP); WRITE_GP32(MGP_PAT_COLOR_0, planemask); WRITE_GP32(MGP_SRC_COLOR_BG, bg); WRITE_GP32(MGP_SRC_COLOR_FG, fg); WRITE_GP32(MGP_STRIDE, stride); } #endif } /*---------------------------------------------------------------------------- * GXSubsequentScanlineCPUToScreenColorExpandFill * Description :see GXSetupForScanlineCPUToScreenColorExpandFill * * Parameters: * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * x int destination x offset * y int destination y offset * w int fill area width (pixels) * h int fill area height (pixels) * * Returns :none * *---------------------------------------------------------------------------*/ static void GXSubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrni, int x, int y, int w, int h, int skipleft) { DEBUGMSG(1, (0, X_INFO, "%s() %d,%d %dx%d %d\n", __func__, x, y, w, h, skipleft)); gc2s.x = x; gc2s.y = y; gc2s.w = w; gc2s.h = h; #ifdef OPT_ACCEL { #if GX_ONE_LINE_AT_A_TIME unsigned int size = (gc2s.w << 16) | 1; GU2_WAIT_PENDING; WRITE_GP32(MGP_WID_HEIGHT, size); #else GeodeRec *pGeode = GEODEPTR(pScrni); unsigned int src = pGeode->AccelColorExpandBuffers[0] - pGeode->FBBase; GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_OFFSET, src); #endif } #endif } /*---------------------------------------------------------------------------- * GXSubsequentColorExpandScanline * * Description :see GXSetupForScanlineCPUToScreenColorExpandFill * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * bufno int scanline number in write group * * Returns :none *---------------------------------------------------------------------------- */ static void GXSubsequentColorExpandScanline(ScrnInfoPtr pScrni, int bufno) { GeodeRec *pGeode = GEODEPTR(pScrni); DEBUGMSG(1, (0, X_INFO, "%s() %d\n", __func__, bufno)); #ifndef OPT_ACCEL { #if GX_ONE_LINE_AT_A_TIME ulong offset = pGeode->AccelColorExpandBuffers[bufno] - pGeode->FBBase; gfx2_mono_expand_blt(offset, 0, 0, CALC_FBOFFSET(gc2s.x, gc2s.y), gc2s.w, 1, 0); ++gc2s.y; #else /* if GX_ONE_LINE_AT_A_TIME */ ulong srcpitch; int blt_height; if ((blt_height = pGeode->NoOfImgBuffers) > gc2s.h) blt_height = gc2s.h; if (++bufno < blt_height) return; /* convert from bits to dwords */ srcpitch = ((pGeode->Pitch + 31) >> 5) << 2; gfx2_mono_bitmap_to_screen_blt(0, 0, CALC_FBOFFSET(gc2s.x, gc2s.y), gc2s.w, blt_height, pGeode->AccelColorExpandBuffers[0], srcpitch); gc2s.h -= blt_height; gc2s.y += blt_height; #endif /* if GX_ONE_LINE_AT_A_TIME */ } #else /* ifndef OPT_ACCEL */ { #if GX_ONE_LINE_AT_A_TIME unsigned int src = pGeode->AccelColorExpandBuffers[bufno] - pGeode->FBBase; unsigned int dst = CALC_FBOFFSET(gc2s.x, gc2s.y); ++gc2s.y; GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_OFFSET, src); WRITE_GP32(MGP_DST_OFFSET, dst); WRITE_GP16(MGP_BLT_MODE, BLT_MODE); #else /* if GX_ONE_LINE_AT_A_TIME */ unsigned int dst, size; int blt_height; GU2_WAIT_BUSY; if ((blt_height = pGeode->NoOfImgBuffers) > gc2s.h) blt_height = gc2s.h; if (++bufno < blt_height) return; dst = CALC_FBOFFSET(gc2s.x, gc2s.y); size = (gc2s.w << 16) | blt_height; gc2s.h -= blt_height; gc2s.y += blt_height; GU2_WAIT_PENDING; WRITE_GP32(MGP_DST_OFFSET, dst); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP16(MGP_BLT_MODE, BLT_MODE); #endif /* if GX_ONE_LINE_AT_A_TIME */ } #endif /* ifndef OPT_ACCEL */ } #endif /* GX_CPU2SCREXP_SUPPORT */ #if GX_SCR2SCREXP_SUPPORT /*---------------------------------------------------------------------------- * GXSetupForScreenToScreenColorExpandFill * * Description :SetupFor/Subsequent ScreenToScreenColorExpandFill and * ColorExpandScanline routines provide an interface for * doing expansion blits from source patterns stored in * video memory. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * fg int foreground color * bg int -1 (transparent) or background color * rop int unmapped raster operation * planemask uint -1 (copy) or pattern data * * Returns :none. *---------------------------------------------------------------------------*/ static void GXSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrni, int fg, int bg, int rop, uint planemask) { DEBUGMSG(1, (0, X_INFO, "%s() fg %#x bg %#x rop %#x %#x\n", __func__, fg, bg, rop, planemask)); rop &= 0x0F; #ifndef OPT_ACCEL { GeodeRec *pGeode = GEODEPTR(pScrni); gfx_set_solid_pattern(planemask); gfx_set_mono_source(bg, fg, bg == -1 ? 1 : 0); gfx_set_raster_operation(planemask == ~0U ? SDfn[rop] : SDfn_PM[rop]); gfx2_set_source_stride(pGeode->Pitch); gfx2_set_destination_stride(pGeode->Pitch); } #else { unsigned int ROP = BPP | (planemask == ~0U ? SDfn[rop] : SDfn_PM[rop]); if (bg == -1) ROP |= MGP_RM_SRC_TRANS; BLT_MODE = ((ROP ^ (ROP >> 1)) & 0x55) != 0 ? MGP_BM_SRC_MONO | MGP_BM_SRC_FB | MGP_BM_DST_REQ : MGP_BM_SRC_MONO | MGP_BM_SRC_FB; GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, ROP); WRITE_GP32(MGP_PAT_COLOR_0, planemask); WRITE_GP32(MGP_SRC_COLOR_BG, bg); WRITE_GP32(MGP_SRC_COLOR_FG, fg); WRITE_GP32(MGP_STRIDE, ACCEL_STRIDE); } #endif } /*---------------------------------------------------------------------------- * GXSubsequentScreenToScreenColorExpandFill * * Description :see GXSetupForScreenToScreenColorExpandFill * * Parameters: * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * x int destination x offset * y int destination y offset * w int fill area width (pixels) * h int fill area height (pixels) * offset int initial x offset * * Returns :none * *---------------------------------------------------------------------------*/ static void GXSubsequentScreenToScreenColorExpandFill(ScrnInfoPtr pScrni, int x, int y, int w, int h, int srcx, int srcy, int offset) { DEBUGMSG(1, (0, X_INFO, "%s() %d,%d %dx%d %d,%d %d\n", __func__, x, y, w, h, srcx, srcy, offset)); #ifndef OPT_ACCEL gfx2_mono_expand_blt(CALC_FBOFFSET(srcx, srcy), offset, 0, CALC_FBOFFSET(x, y), w, h, 0); #else { unsigned int src = (CALC_FBOFFSET(srcx, srcy) + (offset >> 3)) | ((offset & 7) << 26); unsigned int dst = CALC_FBOFFSET(x, y); unsigned int size = (w << 16) | h; GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_OFFSET, src); WRITE_GP32(MGP_DST_OFFSET, dst); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP16(MGP_BLT_MODE, BLT_MODE); } #endif } #endif /* GX_SCR2SCREXP_SUPPORT */ #define VM_MAJOR_DEC 0 #define VM_MINOR_DEC 0 static unsigned short vmode[] = { VM_X_MAJOR | VM_MAJOR_INC | VM_MINOR_INC, /* !XDECREASING !YDECREASING !YMAJOR */ VM_Y_MAJOR | VM_MAJOR_INC | VM_MINOR_INC, /* !XDECREASING !YDECREASING YMAJOR */ VM_X_MAJOR | VM_MAJOR_INC | VM_MINOR_DEC, /* !XDECREASING YDECREASING !YMAJOR */ VM_Y_MAJOR | VM_MAJOR_DEC | VM_MINOR_INC, /* !XDECREASING YDECREASING YMAJOR */ VM_X_MAJOR | VM_MAJOR_DEC | VM_MINOR_INC, /* XDECREASING !YDECREASING !YMAJOR */ VM_Y_MAJOR | VM_MAJOR_INC | VM_MINOR_DEC, /* XDECREASING !YDECREASING YMAJOR */ VM_X_MAJOR | VM_MAJOR_DEC | VM_MINOR_DEC, /* XDECREASING YDECREASING !YMAJOR */ VM_Y_MAJOR | VM_MAJOR_DEC | VM_MINOR_DEC, /* XDECREASING YDECREASING YMAJOR */ }; #if GX_BRES_LINE_SUPPORT /*---------------------------------------------------------------------------- * GXSetupForSolidLine * * Description :SetupForSolidLine and Subsequent HorVertLine TwoPointLine * BresenhamLine provides an interface for drawing thin * solid lines. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * color int foreground fill color * rop int unmapped raster op * planemask uint -1 (fill) or pattern data (not enabled) * * Returns :none *---------------------------------------------------------------------------*/ static void GXSetupForSolidLine(ScrnInfoPtr pScrni, int color, int rop, uint planemask) { DEBUGMSG(1, (0, X_INFO, "%s() %#x %#x %#x\n", __func__, color, rop, planemask)); rop &= 0x0F; #ifndef OPT_ACCEL gfx_set_solid_pattern(color); gfx_set_raster_operation(planemask == ~0U ? PDfn[rop] : (gfx_set_solid_source(planemask), PDfn_SM[rop])); #else { unsigned int ROP = BPP | (planemask == ~0U ? PDfn[rop] : PDfn_SM[rop]); BLT_MODE = ((ROP ^ (ROP >> 2)) & 0x33) == 0 ? MGP_BM_SRC_MONO : 0; VEC_MODE = ((ROP ^ (ROP >> 1)) & 0x55) != 0 ? ((BLT_MODE |= MGP_BM_DST_REQ), MGP_VM_DST_REQ) : 0; GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, ROP); WRITE_GP32(MGP_PAT_COLOR_0, color); WRITE_GP32(MGP_SRC_COLOR_FG, planemask); WRITE_GP32(MGP_STRIDE, ACCEL_STRIDE); } #endif } /*--------------------------------------------------------------------------- * GXSubsequentSolidBresenhamLine * * Description :see GXSetupForSolidLine * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * x1 int destination x offset * y1 int destination y offset * absmaj int Bresenman absolute major * absmin int Bresenman absolute minor * err int Bresenman initial error term * len int length of the vector (pixels) * octant int specifies sign and magnitude relationships * used to determine axis of magor rendering * and direction of vector progress. * * Returns :none * * - Window outlines on window move. * - x11perf: line segments (-line500). * - x11perf: line segments (-seg500). *---------------------------------------------------------------------------*/ static void GXSubsequentSolidBresenhamLine(ScrnInfoPtr pScrni, int x1, int y1, int absmaj, int absmin, int err, int len, int octant) { long axial, diagn; DEBUGMSG(1, (0, X_INFO, "%s() %d,%d %d %d, %d %d, %d\n", __func__, x1, y1, absmaj, absmin, err, len, octant)); if (len <= 0) return; axial = absmin; err += axial; diagn = absmin - absmaj; #ifndef OPT_ACCEL gfx_bresenham_line(x1, y1, len, err, axial, diagn, vmode[octant]); #else { unsigned int offset = CALC_FBOFFSET(x1, y1); unsigned int vec_err = (axial << 16) | (unsigned short) diagn; unsigned int vec_len = (len << 16) | (unsigned short) err; unsigned int vec_mode = VEC_MODE | vmode[octant]; GU2_WAIT_PENDING; WRITE_GP32(MGP_DST_OFFSET, offset); WRITE_GP32(MGP_VEC_ERR, vec_err); WRITE_GP32(MGP_VEC_LEN, vec_len); WRITE_GP32(MGP_VECTOR_MODE, vec_mode); } #endif } /*--------------------------------------------------------------------------- * GXSubsequentSolidTwoPointLine * * Description :see GXSetupForSolidLine * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * x0 int destination x start offset * y0 int destination y start offset * x1 int destination x end offset * y1 int destination y end offset * flags int OMIT_LAST, dont draw last pixel (not used) * * Returns :none *---------------------------------------------------------------------------*/ static void GXSubsequentSolidTwoPointLine(ScrnInfoPtr pScrni, int x0, int y0, int x1, int y1, int flags) { long dx, dy, dmaj, dmin, octant, bias; long axial, diagn, err, len; DEBUGMSG(1, (0, X_INFO, "%s() %d,%d %d,%d, %#x\n", __func__, x0, y0, x1, y1, flags)); if ((dx = x1 - x0) < 0) dx = -dx; if ((dy = y1 - y0) < 0) dy = -dy; if (dy >= dx) { dmaj = dy; dmin = dx; octant = YMAJOR; } else { dmaj = dx; dmin = dy; octant = 0; } len = dmaj; if ((flags & OMIT_LAST) == 0) ++len; if (len <= 0) return; if (x1 < x0) octant |= XDECREASING; if (y1 < y0) octant |= YDECREASING; axial = dmin << 1; bias = miGetZeroLineBias(pScrni->pScreen); err = axial - dmaj - ((bias >> octant) & 1); diagn = (dmin - dmaj) << 1; #ifndef OPT_ACCEL gfx_bresenham_line(x0, y0, len, err, axial, diagn, vmode[octant]); #else { unsigned int offset = CALC_FBOFFSET(x0, y0); unsigned int vec_err = (axial << 16) | (unsigned short) diagn; unsigned int vec_len = (len << 16) | (unsigned short) err; unsigned int vec_mode = VEC_MODE | vmode[octant]; GU2_WAIT_PENDING; WRITE_GP32(MGP_DST_OFFSET, offset); WRITE_GP32(MGP_VEC_ERR, vec_err); WRITE_GP32(MGP_VEC_LEN, vec_len); WRITE_GP32(MGP_VECTOR_MODE, vec_mode); } #endif } /*--------------------------------------------------------------------------- * GXSubsequentSolidHorVertLine * * Description :see GXSetupForSolidLine * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * x int destination x offset * y int destination y offset * len int length of the vector (pixels) * dir int DEGREES_270 or DEGREES_0 line direction * * Sample application uses: * - Window outlines on window move. * - x11perf: line segments (-hseg500). * - x11perf: line segments (-vseg500). *--------------------------------------------------------------------------- */ static void GXSubsequentSolidHorVertLine(ScrnInfoPtr pScrni, int x, int y, int len, int dir) { DEBUGMSG(1, (0, X_INFO, "%s() %d,%d %d %d\n", __func__, x, y, len, dir)); #ifndef OPT_ACCEL if (dir == DEGREES_0) gfx_pattern_fill(x, y, len, 1); else gfx_pattern_fill(x, y, 1, len); #else { unsigned int offset = CALC_FBOFFSET(x, y); unsigned int size = dir == DEGREES_0 ? (len << 16) | 1 : (1 << 16) | len; GU2_WAIT_PENDING; WRITE_GP32(MGP_DST_OFFSET, offset); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_BLT_MODE, BLT_MODE); } #endif } #endif /* GX_BRES_LINE_SUPPORT */ #if GX_DASH_LINE_SUPPORT /*---------------------------------------------------------------------------- * GXSetupForDashedLine * * Description :SetupForDashedLine and Subsequent TwoPointLine * BresenhamLine provides an interface for drawing thin * dashed lines. * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * fg int foreground fill color * bg int -1 (transp) or background fill color * rop int unmapped raster op * planemask uint -1 (fill) or pattern data (not enabled) * length int pattern length (bits) * pattern uchar* dash pattern mask * * Returns :none *---------------------------------------------------------------------------*/ static void GXSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg, int rop, unsigned int planemask, int length, unsigned char *pattern) { int i, l, n, m; CARD32 pat = *pattern; CARD32 pat8x8[2]; if (length <= 0) return; i = l = m = 0; while (i < 2) { m |= pat >> l; l += length; if ((n = l - 32) >= 0) { pat8x8[i++] = m; m = pat << (length - n); l = n; } } gdln.pat[0] = pat8x8[0]; gdln.pat[1] = pat8x8[1]; gdln.len = length; gdln.fg = fg; gdln.bg = bg; rop &= 0x0F; gfx_set_solid_pattern(0); gfx_set_raster_operation(planemask == ~0U ? PDfn[rop] : (gfx_set_solid_source(planemask), PDfn_SM[rop])); } /*--------------------------------------------------------------------------- * GXSubsequentDashedBresenhamLine * * Description: This function is used to render a vector using the * specified bresenham parameters. * * Parameters: * pScrni: Screen handler pointer having screen information. * x1: Specifies the starting x position * y1: Specifies starting y possition * absmaj: Specfies the Bresenman absolute major. * absmin: Specfies the Bresenman absolute minor. * err: Specifies the bresenham err term. * len: Specifies the length of the vector interms of pixels. * octant: not used in this function,may be added for standard * interface. * * Returns: none * * Comments: none * * Sample application uses: * - Window outlines on window move. * - x11perf: line segments (-line500). * - x11perf: line segments (-seg500). *---------------------------------------------------------------------------- */ static void GXSubsequentDashedBresenhamLine(ScrnInfoPtr pScrni, int x1, int y1, int absmaj, int absmin, int err, int len, int octant, int phase) { int i, n; int axial, diagn; int trans = (gdln.bg == -1); unsigned long pat8x8[2]; //ErrorF("BLine %d, %d, %d, %d, %d, %d, %d\n" x1, y1, absmaj, absmin, //err, len, octant); i = phase >= 32 ? (phase -= 32, 1) : 0; n = 32 - phase; pat8x8[0] = ((gdln.pat[i] >> phase) & ((1UL << n) - 1)) | (gdln.pat[1 - i] << n); pat8x8[1] = ((gdln.pat[1 - i] >> phase) & ((1UL << n) - 1)) | (gdln.pat[i] << n); axial = absmin; err += axial; diagn = absmin - absmaj; gfx_set_mono_pattern(gdln.bg, gdln.fg, pat8x8[0], pat8x8[1], trans); gfx2_set_pattern_origin(x1, y1); gfx2_bresenham_line(CALC_FBOFFSET(x1, y1), len, err, axial, diagn, vmode[octant]); } /*--------------------------------------------------------------------------- * GXSubsequentDashedTwoPointLine * * Description :see GXSetupForDashedLine * * Arg Type Comment * pScrni ScrnInfoPtr pointer to Screeen info * x0 int destination x start offset * y0 int destination y start offset * x1 int destination x end offset * y1 int destination y end offset * flags int OMIT_LAST, dont draw last pixel (not used) * phase int initial pattern offset at x1,y1 * * Returns :none *---------------------------------------------------------------------------*/ static void GXSubsequentDashedTwoPointLine(ScrnInfoPtr pScrni, int x0, int y0, int x1, int y1, int flags, int phase) { int i, n; long dx, dy, dmaj, dmin, octant, bias; long axial, diagn, err, len, pat8x8[2]; //ErrorF("GXSubsequentDashedTwoPointLine() %d,%d %d,%d, %#x %d\n", // x0, y0, x1, y1, flags, phase); i = phase >= 32 ? (phase -= 32, 1) : 0; n = 32 - phase; pat8x8[0] = ((gdln.pat[i] >> phase) & ((1UL << n) - 1)) | (gdln.pat[1 - i] << n); pat8x8[1] = ((gdln.pat[1 - i] >> phase) & ((1UL << n) - 1)) | (gdln.pat[i] << n); if ((dx = x1 - x0) < 0) dx = -dx; if ((dy = y1 - y0) < 0) dy = -dy; if (dy >= dx) { dmaj = dy; dmin = dx; octant = YMAJOR; } else { dmaj = dx; dmin = dy; octant = 0; } len = dmaj; if ((flags & OMIT_LAST) == 0) ++len; if (len <= 0) return; if (x1 < x0) octant |= XDECREASING; if (y1 < y0) octant |= YDECREASING; axial = dmin << 1; bias = miGetZeroLineBias(pScrni->pScreen); err = axial - dmaj - ((bias >> octant) & 1); diagn = (dmin - dmaj) << 1; gfx2_set_pattern_origin(x0, y0); gfx2_bresenham_line(CALC_FBOFFSET(x0, y0), len, err, axial, diagn, vmode[octant]); } #endif /* GX_DASH_LINE_SUPPORT */ #if GX_WRITE_PIXMAP_SUPPORT static void GXWritePixmap(ScrnInfoPtr pScrni, int x, int y, int w, int h, unsigned char *src, int srcwidth, int rop, unsigned int planemask, int trans, int bpp, int depth) { GeodeRec *pGeode = GEODEPTR(pScrni); //ErrorF("GXWritePixmap() %d,%d %dx%d, s%#x sp%d %#x %#x %#x %d %d\n", // x, y, w, h, src, srcwidth, rop, planemask, trans, bpp, depth); if (bpp == pScrni->bitsPerPixel) { rop &= 0x0F; if (rop == GXcopy && trans == -1) { gfx_wait_until_idle(); geode_memory_to_screen_blt((unsigned long) src, (unsigned long) FBADDR(x, y), srcwidth, pGeode->Pitch, w, h, bpp); } else { gfx_set_solid_pattern(planemask); gfx_set_raster_operation(planemask == ~0U ? SDfn[rop] : SDfn_PM[rop]); if (trans != -1) gfx_color_bitmap_to_screen_xblt(0, 0, x, y, w, h, src, srcwidth, trans); else gfx_color_bitmap_to_screen_blt(0, 0, x, y, w, h, src, srcwidth); SET_SYNC_FLAG(pGeode->AccelInfoRec); } } else pGeode->WritePixmap(pScrni, x, y, w, h, src, srcwidth, rop, planemask, trans, bpp, depth); } #endif /* if GX_WRITE_PIXMAP_SUPPORT */ #if XF86EXA static void amd_gx_exa_WaitMarker(ScreenPtr pScreen, int Marker) { GU2_WAIT_BUSY; } static void amd_gx_exa_Done(PixmapPtr p) { } static Bool amd_gx_exa_UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int src_pitch) { GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pDst); char *dst = pGeode->pExa->memoryBase + exaGetPixmapOffset(pDst); int dst_pitch = exaGetPixmapPitch(pDst); int bpp = pDst->drawable.bitsPerPixel; dst += y * dst_pitch + x * (bpp >> 3); GU2_WAIT_BUSY; geode_memory_to_screen_blt((unsigned long) src, (unsigned long) dst, src_pitch, dst_pitch, w, h, bpp); return TRUE; } static Bool amd_gx_exa_DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, char *dst, int dst_pitch) { GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pSrc); char *src = pGeode->pExa->memoryBase + exaGetPixmapOffset(pSrc); int src_pitch = exaGetPixmapPitch(pSrc); int bpp = pSrc->drawable.bitsPerPixel; src += (y * src_pitch) + (x * (bpp >> 3)); GU2_WAIT_BUSY; geode_memory_to_screen_blt((unsigned long) src, (unsigned long) dst, src_pitch, dst_pitch, w, h, bpp); return TRUE; } /* Solid */ static Bool amd_gx_exa_PrepareSolid(PixmapPtr pxMap, int alu, Pixel planemask, Pixel fg) { int dstPitch = exaGetPixmapPitch(pxMap); unsigned int ROP = amd_gx_BppToRasterMode(pxMap->drawable.bitsPerPixel) | (planemask == ~0U ? SDfn[alu] : SDfn_PM[alu]); // FIXME: this should go away -- workaround for the blockparty icon corruption //if (pxMap->drawable.bitsPerPixel == 32) // return FALSE; BLT_MODE = ((ROP ^ (ROP >> 2)) & 0x33) == 0 ? MGP_BM_SRC_MONO : 0; if (((ROP ^ (ROP >> 1)) & 0x55) != 0) BLT_MODE |= MGP_BM_DST_REQ; //ErrorF("amd_gx_exa_PrepareSolid(%#x,%#x,%#x - ROP=%x,BLT_MODE=%x)\n", alu, planemask, fg, ROP, BLT_MODE); GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, ROP); WRITE_GP32(MGP_PAT_COLOR_0, planemask); WRITE_GP32(MGP_SRC_COLOR_FG, fg); WRITE_GP32(MGP_STRIDE, dstPitch); return TRUE; } static void amd_gx_exa_Solid(PixmapPtr pxMap, int x1, int y1, int x2, int y2) { int bpp = (pxMap->drawable.bitsPerPixel + 7) / 8; int pitch = exaGetPixmapPitch(pxMap); unsigned int offset = exaGetPixmapOffset(pxMap) + pitch * y1 + bpp * x1; unsigned int size = ((x2 - x1) << 16) | (y2 - y1); //ErrorF("amd_gx_exa_Solid() at %d,%d %d,%d - offset=%d, bpp=%d\n", x1, y1, x2, y2, offset, bpp); GU2_WAIT_PENDING; WRITE_GP32(MGP_DST_OFFSET, offset); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_BLT_MODE, BLT_MODE); } /* Copy */ static Bool amd_gx_exa_PrepareCopy(PixmapPtr pxSrc, PixmapPtr pxDst, int dx, int dy, int alu, Pixel planemask) { GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst); int dstPitch = exaGetPixmapPitch(pxDst); unsigned int ROP; /* Punt if the color formats aren't the same */ if (pxSrc->drawable.bitsPerPixel != pxDst->drawable.bitsPerPixel) return FALSE; //ErrorF("amd_gx_exa_PrepareCopy() dx%d dy%d alu %#x %#x\n", // dx, dy, alu, planemask); pGeode->cpySrcOffset = exaGetPixmapOffset(pxSrc); pGeode->cpySrcPitch = exaGetPixmapPitch(pxSrc); pGeode->cpySrcBpp = (pxSrc->drawable.bitsPerPixel + 7) / 8; pGeode->cpyDx = dx; pGeode->cpyDy = dy; ROP = amd_gx_BppToRasterMode(pxSrc->drawable.bitsPerPixel) | (planemask == ~0U ? SDfn[alu] : SDfn_PM[alu]); BLT_MODE = ((ROP ^ (ROP >> 1)) & 0x55) != 0 ? MGP_BM_SRC_FB | MGP_BM_DST_REQ : MGP_BM_SRC_FB; GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, ROP); WRITE_GP32(MGP_PAT_COLOR_0, planemask); WRITE_GP32(MGP_SRC_COLOR_FG, ~0); WRITE_GP32(MGP_SRC_COLOR_BG, ~0); WRITE_GP32(MGP_STRIDE, (pGeode->cpySrcPitch << 16) | dstPitch); return TRUE; } static void amd_gx_exa_Copy(PixmapPtr pxDst, int srcX, int srcY, int dstX, int dstY, int w, int h) { GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst); int dstBpp = (pxDst->drawable.bitsPerPixel + 7) / 8; int dstPitch = exaGetPixmapPitch(pxDst); unsigned int srcOffset = pGeode->cpySrcOffset + (pGeode->cpySrcPitch * srcY) + (pGeode->cpySrcBpp * srcX); unsigned int dstOffset = exaGetPixmapOffset(pxDst) + (dstPitch * dstY) + (dstBpp * dstX); unsigned int size = (w << 16) | h; unsigned int blt_mode = BLT_MODE; //ErrorF("amd_gx_exa_Copy() from %d,%d to %d,%d %dx%d\n", srcX, srcY, // dstX, dstY, w, h); if (pGeode->cpyDx < 0) { srcOffset += w * pGeode->cpySrcBpp - 1; dstOffset += w * dstBpp - 1; blt_mode |= MGP_BM_NEG_XDIR; } if (pGeode->cpyDy < 0) { srcOffset += (h - 1) * pGeode->cpySrcPitch; dstOffset += (h - 1) * dstPitch; blt_mode |= MGP_BM_NEG_YDIR; } GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_OFFSET, srcOffset); WRITE_GP32(MGP_DST_OFFSET, dstOffset); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP16(MGP_BLT_MODE, blt_mode); } /* A=SRC, B=DST */ #define SRC_DST 0 /* B=SRC, A=DST */ #define DST_SRC MGP_RM_DEST_FROM_CHAN_A /* A*alpha + B*0 */ #define Aa_B0 MGP_RM_ALPHA_TIMES_A /* A*0 + B*(1-alpha) */ #define A0_B1a MGP_RM_BETA_TIMES_B /* A*1 + B*(1-alpha) */ #define A1_B1a MGP_RM_A_PLUS_BETA_B /* A*alpha + B*(1-alpha) */ #define Aa_B1a MGP_RM_ALPHA_A_PLUS_BETA_B /* alpha from A */ #define a_A MGP_RM_SELECT_ALPHA_A /* alpha from B */ #define a_B MGP_RM_SELECT_ALPHA_B /* alpha from const */ #define a_C MGP_RM_SELECT_ALPHA_R /* alpha = 1 */ #define a_1 MGP_RM_SELECT_ALPHA_1 #define MGP_RM_ALPHA_TO_ARGB (MGP_RM_ALPHA_TO_ALPHA | MGP_RM_ALPHA_TO_RGB) #define gxPictOpMAX PictOpAdd /* highest accelerated op */ unsigned int amd_gx_exa_alpha_ops[] = /* A B OP AS const = 0 */ { (SRC_DST | Aa_B0 | a_C), 0, /* clear (src*0) */ (SRC_DST | Aa_B0 | a_1), 0, /* src (src*1) */ (DST_SRC | Aa_B0 | a_1), 0, /* dst (dst*1) */ (SRC_DST | A1_B1a | a_A), 0, /* src-over (src*1 + dst(1-A)) */ (DST_SRC | A1_B1a | a_A), 0, /* dst-over (dst*1 + src(1-B)) */ (SRC_DST | Aa_B0 | a_B), 0, /* src-in (src*B) */ (DST_SRC | Aa_B0 | a_B), 0, /* dst-in (dst*A) */ (DST_SRC | A0_B1a | a_A), 0, /* src-out (src*(1-B)) */ (SRC_DST | A0_B1a | a_A), 0, /* dst-out (dst*(1-A)) */ /* pass1 (SRC=dst DST=scr=src), pass2 (SRC=src, DST=dst) */ (DST_SRC | Aa_B0 | a_B), /* srcatop (src*B) */ (SRC_DST | A0_B1a | a_A), /* + (dst(1-A)) */ (SRC_DST | Aa_B0 | a_B), /* dstatop (dst*A) */ (DST_SRC | A0_B1a | a_A), /* + (src(1-B) */ (SRC_DST | A0_B1a | a_A), /* xor (src*(1-B) */ (SRC_DST | A0_B1a | a_A), /* + (dst(1-A) */ (SRC_DST | A1_B1a | a_C), 0, /* add (src*1 + dst*1) */ }; typedef struct { int exa_fmt; int bpp; int gx_fmt; int alpha_bits; } amd_gx_exa_fmt_t; amd_gx_exa_fmt_t amd_gx_exa_fmts[] = { {PICT_a8r8g8b8, 32, MGP_RM_BPPFMT_8888, 8}, {PICT_x8r8g8b8, 32, MGP_RM_BPPFMT_8888, 0}, {PICT_a4r4g4b4, 16, MGP_RM_BPPFMT_4444, 4}, {PICT_a1r5g5b5, 16, MGP_RM_BPPFMT_1555, 1}, {PICT_r5g6b5, 16, MGP_RM_BPPFMT_565, 0}, {PICT_r3g3b2, 8, MGP_RM_BPPFMT_332, 0}, }; static amd_gx_exa_fmt_t * amd_gx_exa_check_format(PicturePtr p) { int i; int bpp = p->pDrawable ? p->pDrawable->bitsPerPixel : 0; amd_gx_exa_fmt_t *fp = &amd_gx_exa_fmts[0]; for (i = sizeof(amd_gx_exa_fmts) / sizeof(amd_gx_exa_fmts[0]); --i >= 0; ++fp) { if (fp->bpp < bpp) return NULL; if (fp->bpp != bpp) continue; if (fp->exa_fmt == p->format) break; } return i < 0 ? NULL : fp; } /* Composite */ static Bool amd_gx_exa_CheckComposite(int op, PicturePtr pSrc, PicturePtr pMsk, PicturePtr pDst) { GeodeRec *pGeode = GEODEPTR_FROM_PICTURE(pDst); if (op > gxPictOpMAX) return FALSE; if (pMsk) return FALSE; if (usesPasses(op) && pGeode->exaBfrSz == 0) return FALSE; if (pSrc->filter != PictFilterNearest && pSrc->filter != PictFilterFast && pSrc->filter != PictFilterGood && pSrc->filter != PictFilterBest) return FALSE; if (pSrc->repeat) return FALSE; if (pSrc->transform) return FALSE; return TRUE; } static Bool amd_gx_exa_PrepareComposite(int op, PicturePtr pSrc, PicturePtr pMsk, PicturePtr pDst, PixmapPtr pxSrc, PixmapPtr pxMsk, PixmapPtr pxDst) { int srcPitch; if (!pxSrc || !pSrc->pDrawable) return FALSE; GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst); amd_gx_exa_fmt_t *sfp, *dfp; //ErrorF("amd_gx_exa_PrepareComposite()\n"); if ((sfp = amd_gx_exa_check_format(pSrc)) == NULL) return FALSE; if (sfp->alpha_bits == 0 && usesSrcAlpha(op)) return FALSE; if ((dfp = amd_gx_exa_check_format(pDst)) == NULL) return FALSE; if (dfp->alpha_bits == 0 && usesDstAlpha(op)) return FALSE; if (sfp->gx_fmt != dfp->gx_fmt) return FALSE; srcPitch = exaGetPixmapPitch(pxSrc); if (usesPasses(op) && srcPitch > pGeode->exaBfrSz) return FALSE; pGeode->cmpSrcPitch = srcPitch; pGeode->cmpOp = op; pGeode->cmpSrcOffset = exaGetPixmapOffset(pxSrc); pGeode->cmpSrcBpp = (pxSrc->drawable.bitsPerPixel + 7) / 8; pGeode->cmpSrcFmt = sfp->gx_fmt; pGeode->cmpDstFmt = dfp->gx_fmt | (dfp->alpha_bits == 0 ? MGP_RM_ALPHA_TO_RGB : MGP_RM_ALPHA_TO_ARGB); return TRUE; } static void amd_gx_exa_Composite(PixmapPtr pxDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int width, int height) { int op, current_line, max_lines, lines, pass, scratchPitch; unsigned int srcOffset, srcOfs = 0, srcPitch, srcPch = 0, srcBpp; unsigned int dstOffset, dstOfs = 0, dstPitch, dstPch = 0, dstBpp; unsigned int sizes, strides, blt_mode = 0, rop = 0; GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst); //ErrorF("amd_gx_exa_Composite() from %d,%d to %d,%d %dx%d\n", // srcX, srcY, dstX, dstY, width, height); op = pGeode->cmpOp; if (usesPasses(op)) { int cacheLineSz = 32; int cachelines = (width * pGeode->cmpSrcBpp + cacheLineSz - 1) / cacheLineSz; scratchPitch = cachelines * cacheLineSz; if (scratchPitch > pGeode->cmpSrcPitch) scratchPitch = pGeode->cmpSrcPitch; max_lines = pGeode->exaBfrSz / scratchPitch; } else { scratchPitch = 0; max_lines = height; } dstBpp = (pxDst->drawable.bitsPerPixel + 7) / 8; dstPitch = exaGetPixmapPitch(pxDst); dstOffset = exaGetPixmapOffset(pxDst) + dstPitch * dstY + dstBpp * dstX; srcBpp = pGeode->cmpSrcBpp; srcPitch = pGeode->cmpSrcPitch; srcOffset = pGeode->cmpSrcOffset + srcPitch * srcY + srcBpp * srcX; current_line = pass = 0; while (current_line < height) { if (usesPasses(op)) { lines = height - current_line; if (lines > max_lines) lines = max_lines; switch (pass) { case 0: /* copy src to scratch */ srcPch = srcPitch; srcOfs = srcOffset + current_line * srcPch; dstPch = scratchPitch; dstOfs = pGeode->exaBfrOffset; rop = pGeode->cmpSrcFmt | MGP_RM_ALPHA_TO_ARGB; rop |= amd_gx_exa_alpha_ops[PictOpSrc * 2]; blt_mode = usesChanB0(PictOpSrc) ? MGP_BM_SRC_FB | MGP_BM_DST_REQ : MGP_BM_SRC_FB; ++pass; break; case 1: /* pass1 */ srcPch = dstPitch; srcOfs = dstOffset + current_line * srcPch; dstPch = scratchPitch; dstOfs = pGeode->exaBfrOffset; rop = pGeode->cmpSrcFmt | MGP_RM_ALPHA_TO_ARGB; rop |= amd_gx_exa_alpha_ops[op * 2]; blt_mode = usesChanB1(op) ? MGP_BM_SRC_FB | MGP_BM_DST_REQ : MGP_BM_SRC_FB; ++pass; break; case 2: /* pass2 */ srcPch = srcPitch; srcOfs = srcOffset + current_line * srcPch; dstPch = dstPitch; dstOfs = dstOffset + current_line * dstPch; rop = pGeode->cmpSrcFmt | MGP_RM_ALPHA_TO_ARGB; rop |= amd_gx_exa_alpha_ops[op * 2 + 1]; blt_mode = usesChanB2(op) ? MGP_BM_SRC_FB | MGP_BM_DST_REQ : MGP_BM_SRC_FB; ++pass; break; case 3: /* add */ srcPch = scratchPitch; srcOfs = pGeode->exaBfrOffset; dstPch = dstPitch; dstOfs = dstOffset + current_line * dstPch; rop = pGeode->cmpDstFmt; rop |= amd_gx_exa_alpha_ops[PictOpAdd * 2]; blt_mode = usesChanB0(PictOpAdd) ? MGP_BM_SRC_FB | MGP_BM_DST_REQ : MGP_BM_SRC_FB; current_line += lines; pass = 0; break; } strides = (srcPch << 16) | dstPch; } else { /* not multi pass */ srcOfs = srcOffset; dstOfs = dstOffset; current_line = lines = height; strides = (srcPitch << 16) | dstPitch; rop = pGeode->cmpDstFmt | amd_gx_exa_alpha_ops[op * 2]; blt_mode = usesChanB0(op) ? MGP_BM_SRC_FB | MGP_BM_DST_REQ : MGP_BM_SRC_FB; } sizes = (width << 16) | lines; if (srcOfs < dstOfs) { srcOfs += (lines - 1) * srcPitch + width * srcBpp - 1; dstOfs += (lines - 1) * dstPitch + width * dstBpp - 1; blt_mode |= MGP_BM_NEG_XDIR | MGP_BM_NEG_YDIR; } GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, rop); WRITE_GP32(MGP_SRC_OFFSET, srcOfs); WRITE_GP32(MGP_DST_OFFSET, dstOfs); WRITE_GP32(MGP_WID_HEIGHT, sizes); WRITE_GP32(MGP_STRIDE, strides); WRITE_GP16(MGP_BLT_MODE, blt_mode); } } #endif /* #if XF86EXA */ /*---------------------------------------------------------------------------- * GXAccelInit. * * Description: This function sets up the supported acceleration routines and * appropriate flags. * * Parameters: * pScrn: Screeen pointer structure. * * Returns: TRUE on success and FALSE on Failure * * Comments: This function is called in GXScreenInit in * geode_driver.c to set * the acceleration. *---------------------------------------------------------------------------- */ Bool GXAccelInit(ScreenPtr pScrn) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); #if XF86EXA ExaDriverPtr pExa = pGeode->pExa; #endif gu2_xshift = pScrni->bitsPerPixel >> 4; /* XXX - fixme - this will change - we'll need to update it */ gu2_pitch = pGeode->Pitch; switch (pGeode->Pitch) { case 1024: gu2_yshift = 10; break; case 2048: gu2_yshift = 11; break; case 4096: gu2_yshift = 12; break; default: gu2_yshift = 13; break; } #ifdef OPT_ACCEL ACCEL_STRIDE = (pGeode->Pitch << 16) | pGeode->Pitch; BPP = amd_gx_BppToRasterMode(pScrni->bitsPerPixel); #endif #if XF86EXA if (pExa && pGeode->useEXA) { pExa->exa_major = EXA_VERSION_MAJOR; pExa->exa_minor = EXA_VERSION_MINOR; /* Sync */ pExa->WaitMarker = amd_gx_exa_WaitMarker; /* UploadToScreen */ pExa->UploadToScreen = amd_gx_exa_UploadToScreen; pExa->DownloadFromScreen = amd_gx_exa_DownloadFromScreen; /* Solid fill */ pExa->PrepareSolid = amd_gx_exa_PrepareSolid; pExa->Solid = amd_gx_exa_Solid; pExa->DoneSolid = amd_gx_exa_Done; /* Copy */ pExa->PrepareCopy = amd_gx_exa_PrepareCopy; pExa->Copy = amd_gx_exa_Copy; pExa->DoneCopy = amd_gx_exa_Done; /* Composite */ pExa->CheckComposite = amd_gx_exa_CheckComposite; pExa->PrepareComposite = amd_gx_exa_PrepareComposite; pExa->Composite = amd_gx_exa_Composite; pExa->DoneComposite = amd_gx_exa_Done; return exaDriverInit(pScrn, pGeode->pExa); } #endif #if XF86XAA /* Getting the pointer for acceleration Inforecord */ pGeode->AccelInfoRec = localRecPtr = XAACreateInfoRec(); if (!pGeode->AccelInfoRec) return FALSE; /* SET ACCELERATION FLAGS */ localRecPtr->Flags = PIXMAP_CACHE | OFFSCREEN_PIXMAPS | LINEAR_FRAMEBUFFER; /* HOOK SYNCRONIZARION ROUTINE */ localRecPtr->Sync = GXAccelSync; #if GX_FILL_RECT_SUPPORT /* HOOK FILLED RECTANGLES */ HOOK(SetupForSolidFill); HOOK(SubsequentSolidFillRect); localRecPtr->SolidFillFlags = 0; #endif #if GX_MONO_8X8_PAT_SUPPORT /* Color expansion */ HOOK(SetupForMono8x8PatternFill); HOOK(SubsequentMono8x8PatternFillRect); /* BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD | NO_TRANSPARENCY | */ localRecPtr->Mono8x8PatternFillFlags = BIT_ORDER_IN_BYTE_MSBFIRST | HARDWARE_PATTERN_PROGRAMMED_BITS | HARDWARE_PATTERN_SCREEN_ORIGIN; #endif #if GX_CLREXP_8X8_PAT_SUPPORT /* Color expansion */ HOOK(SetupForColor8x8PatternFill); HOOK(SubsequentColor8x8PatternFillRect); /* BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD | NO_TRANSPARENCY | */ localRecPtr->Color8x8PatternFillFlags = BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD | HARDWARE_PATTERN_PROGRAMMED_BITS | HARDWARE_PATTERN_PROGRAMMED_ORIGIN; #endif #if GX_SCR2SCRCPY_SUPPORT /* HOOK SCREEN TO SCREEN COPIES * Set flag to only allow copy if transparency is enabled. */ HOOK(SetupForScreenToScreenCopy); HOOK(SubsequentScreenToScreenCopy); localRecPtr->ScreenToScreenCopyFlags = BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD; #endif #if GX_BRES_LINE_SUPPORT /* HOOK BRESENHAM SOLID LINES */ localRecPtr->SolidLineFlags = NO_PLANEMASK; HOOK(SetupForSolidLine); HOOK(SubsequentSolidBresenhamLine); HOOK(SubsequentSolidHorVertLine); HOOK(SubsequentSolidTwoPointLine); localRecPtr->SolidBresenhamLineErrorTermBits = 15; #endif #if GX_DASH_LINE_SUPPORT /* HOOK BRESENHAM DASHED LINES */ HOOK(SetupForDashedLine); HOOK(SubsequentDashedBresenhamLine); HOOK(SubsequentDashedTwoPointLine); localRecPtr->DashedBresenhamLineErrorTermBits = 15; localRecPtr->DashPatternMaxLength = 64; localRecPtr->DashedLineFlags = NO_PLANEMASK | /* TRANSPARENCY_ONLY | */ LINE_PATTERN_POWER_OF_2_ONLY | LINE_PATTERN_MSBFIRST_MSBJUSTIFIED; #endif #if GX_SCR2SCREXP_SUPPORT /* Color expansion */ HOOK(SetupForScreenToScreenColorExpandFill); HOOK(SubsequentScreenToScreenColorExpandFill); localRecPtr->ScreenToScreenColorExpandFillFlags = BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD | NO_TRANSPARENCY; #endif if (pGeode->AccelImageWriteBuffers) { #if GX_SCANLINE_SUPPORT localRecPtr->ScanlineImageWriteBuffers = pGeode->AccelImageWriteBuffers; localRecPtr->NumScanlineImageWriteBuffers = pGeode->NoOfImgBuffers; HOOK(SetupForScanlineImageWrite); HOOK(SubsequentScanlineImageWriteRect); HOOK(SubsequentImageWriteScanline); localRecPtr->ScanlineImageWriteFlags = NO_PLANEMASK | NO_GXCOPY | BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD; #endif } else { localRecPtr->PixmapCacheFlags = DO_NOT_BLIT_STIPPLES; } if (pGeode->AccelColorExpandBuffers) { #if GX_CPU2SCREXP_SUPPORT /* Color expansion */ localRecPtr->ScanlineColorExpandBuffers = pGeode->AccelColorExpandBuffers; localRecPtr->NumScanlineColorExpandBuffers = pGeode->NoOfColorExpandLines; HOOK(SetupForScanlineCPUToScreenColorExpandFill); HOOK(SubsequentScanlineCPUToScreenColorExpandFill); HOOK(SubsequentColorExpandScanline); localRecPtr->ScanlineCPUToScreenColorExpandFillFlags = NO_PLANEMASK | BIT_ORDER_IN_BYTE_MSBFIRST | SCANLINE_PAD_DWORD; #endif } #if GX_WRITE_PIXMAP_SUPPORT pGeode->WritePixmap = localRecPtr->WritePixmap; HOOK(WritePixmap); #endif return (XAAInit(pScrn, localRecPtr)); #else /* XF86XAA */ return FALSE; #endif } /* END OF FILE */ xf86-video-geode-2.11.18/src/lx_display.c0000644000175000017500000004016012654445443014704 00000000000000/* Copyright (c) 2008 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "geode.h" #include "xf86Crtc.h" #include "cim/cim_defs.h" #include "cim/cim_regs.h" typedef struct _LXOutputPrivateRec { int video_enable; unsigned long video_flags; GeodeMemPtr rotate_mem; } LXCrtcPrivateRec, *LXCrtcPrivatePtr; void lx_enable_dac_power(ScrnInfoPtr pScrni, int option) { GeodeRec *pGeode = GEODEPTR(pScrni); df_set_crt_enable(DF_CRT_ENABLE); /* Turn off the DAC if we don't need the CRT */ if (option && (!(pGeode->Output & OUTPUT_CRT))) { unsigned int misc = READ_VID32(DF_VID_MISC); misc |= DF_DAC_POWER_DOWN; WRITE_VID32(DF_VID_MISC, misc); } if (pGeode->Output & OUTPUT_PANEL) df_set_panel_enable(1); } void lx_disable_dac_power(ScrnInfoPtr pScrni, int option) { GeodeRec *pGeode = GEODEPTR(pScrni); if (pGeode->Output & OUTPUT_PANEL) df_set_panel_enable(0); if (pGeode->Output & OUTPUT_CRT) { /* Wait for the panel to finish its procedure */ if (pGeode->Output & OUTPUT_PANEL) while ((READ_VID32(DF_POWER_MANAGEMENT) & 2) == 0); df_set_crt_enable(option); } } static void lx_set_panel_mode(VG_DISPLAY_MODE * mode, DisplayModePtr pMode) { int hsync, vsync; mode->mode_width = mode->panel_width = pMode->HDisplay; mode->mode_height = mode->panel_height = pMode->VDisplay; mode->hactive = pMode->HDisplay; mode->hblankstart = pMode->HDisplay; mode->hsyncstart = pMode->HSyncStart; mode->hsyncend = pMode->HSyncEnd; mode->hblankend = pMode->HTotal; mode->htotal = pMode->HTotal; mode->vactive = pMode->VDisplay; mode->vblankstart = pMode->VDisplay; mode->vsyncstart = pMode->VSyncStart; mode->vsyncend = pMode->VSyncEnd; mode->vblankend = pMode->VTotal; mode->vtotal = pMode->VTotal; mode->vactive_even = pMode->VDisplay; mode->vblankstart_even = pMode->VDisplay; mode->vsyncstart_even = pMode->VSyncStart; mode->vsyncend_even = pMode->VSyncEnd; mode->vblankend_even = pMode->VTotal; mode->vtotal_even = pMode->VTotal; mode->frequency = (int) ((pMode->Clock / 1000.0) * 0x10000); /* In panel mode, Cimarron purposely swizzles these, * so we swizzle them first */ hsync = (pMode->Flags & V_NHSYNC) ? 0 : 1; vsync = (pMode->Flags & V_NVSYNC) ? 0 : 1; mode->flags |= (hsync) ? VG_MODEFLAG_NEG_HSYNC : 0; mode->flags |= (vsync) ? VG_MODEFLAG_NEG_VSYNC : 0; } static void lx_set_crt_mode(VG_DISPLAY_MODE * mode, DisplayModePtr pMode) { int hsync, vsync; mode->mode_width = mode->panel_width = pMode->HDisplay; mode->mode_height = mode->panel_height = pMode->VDisplay; mode->hactive = pMode->CrtcHDisplay; mode->hblankstart = pMode->CrtcHBlankStart; mode->hsyncstart = pMode->CrtcHSyncStart; mode->hsyncend = pMode->CrtcHSyncEnd; mode->hblankend = pMode->CrtcHBlankEnd; mode->htotal = pMode->CrtcHTotal; mode->vactive = pMode->CrtcVDisplay; mode->vblankstart = pMode->CrtcVBlankStart; mode->vsyncstart = pMode->CrtcVSyncStart; mode->vsyncend = pMode->CrtcVSyncEnd; mode->vblankend = pMode->CrtcVBlankEnd; mode->vtotal = pMode->CrtcVTotal; mode->vactive_even = pMode->CrtcVDisplay; mode->vblankstart_even = pMode->CrtcVBlankStart; mode->vsyncstart_even = pMode->CrtcVSyncStart; mode->vsyncend_even = pMode->CrtcVSyncEnd; mode->vblankend_even = pMode->CrtcVBlankEnd; mode->vtotal_even = pMode->CrtcVTotal; mode->frequency = (int) ((pMode->Clock / 1000.0) * 0x10000); hsync = (pMode->Flags & V_NHSYNC) ? 1 : 0; vsync = (pMode->Flags & V_NVSYNC) ? 1 : 0; mode->flags |= (hsync) ? VG_MODEFLAG_NEG_HSYNC : 0; mode->flags |= (vsync) ? VG_MODEFLAG_NEG_VSYNC : 0; } static int lx_set_mode(ScrnInfoPtr pScrni, DisplayModePtr pMode, int bpp) { GeodeRec *pGeode = GEODEPTR(pScrni); VG_DISPLAY_MODE mode; int ret; memset(&mode, 0, sizeof(mode)); mode.flags |= pGeode->Output & OUTPUT_CRT ? VG_MODEFLAG_CRT_AND_FP : 0; if (pGeode->Output & OUTPUT_PANEL) { mode.flags |= VG_MODEFLAG_PANELOUT; if (pGeode->Output & OUTPUT_CRT) mode.flags |= VG_MODEFLAG_CRT_AND_FP; } if (pGeode->Output & OUTPUT_PANEL && pGeode->Scale) lx_set_panel_mode(&mode, pGeode->panelMode); else lx_set_crt_mode(&mode, pMode); mode.src_width = pMode->HDisplay; mode.src_height = pMode->VDisplay; /* Set the filter coefficients to the default values */ vg_set_scaler_filter_coefficients(NULL, NULL); ret = vg_set_custom_mode(&mode, bpp); return (ret == CIM_STATUS_OK) ? 0 : -1; } static void lx_crtc_dpms(xf86CrtcPtr crtc, int mode) { ScrnInfoPtr pScrni = crtc->scrn; GeodeRec *pGeode = GEODEPTR(pScrni); if (pGeode->Output & OUTPUT_DCON) DCONDPMSSet(pScrni, mode); switch (mode) { case DPMSModeOn: lx_enable_dac_power(pScrni, 1); break; case DPMSModeStandby: lx_disable_dac_power(pScrni, DF_CRT_STANDBY); break; case DPMSModeSuspend: lx_disable_dac_power(pScrni, DF_CRT_SUSPEND); break; case DPMSModeOff: lx_disable_dac_power(pScrni, DF_CRT_DISABLE); break; } } static Bool lx_crtc_lock(xf86CrtcPtr crtc) { /* Wait until the GPU is idle */ gp_wait_until_idle(); return TRUE; } static void lx_crtc_unlock(xf86CrtcPtr crtc) { /* Nothing to do here */ } static void lx_crtc_prepare(xf86CrtcPtr crtc) { LXCrtcPrivatePtr lx_crtc = crtc->driver_private; /* Disable the video */ df_get_video_enable(&lx_crtc->video_enable, &lx_crtc->video_flags); if (lx_crtc->video_enable) df_set_video_enable(0, 0); /* Turn off compression */ vg_set_compression_enable(0); /* Hide the cursor */ crtc->funcs->hide_cursor(crtc); /* Turn off the display */ crtc->funcs->dpms(crtc, DPMSModeOff); } static Bool lx_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjusted_mode) { return TRUE; } static void lx_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode, DisplayModePtr adjusted_mode, int x, int y) { ScrnInfoPtr pScrni = crtc->scrn; GeodeRec *pGeode = GEODEPTR(pScrni); DF_VIDEO_SOURCE_PARAMS vs_odd, vs_even; unsigned int rpitch; df_get_video_source_configuration(&vs_odd, &vs_even); /* Note - the memory gets adjusted when virtualX/virtualY * gets changed - so we don't need to worry about it here */ if (lx_set_mode(pScrni, adjusted_mode, pScrni->bitsPerPixel)) ErrorF("ERROR! Unable to set the mode!\n"); /* The output gets turned in in the output code as * per convention */ /* For rotation, any write to the frame buffer region marks * the retire frame as dirty. */ if (crtc->rotatedData != NULL) { rpitch = pScrni->displayWidth * (pScrni->bitsPerPixel / 8); vg_set_display_pitch(rpitch); } else vg_set_display_pitch(pGeode->Pitch); gp_set_bpp(pScrni->bitsPerPixel); /* Set the acceleration offset if we are drawing to a shadow */ if (crtc->rotatedData != NULL) vg_set_display_offset((unsigned int) ((char *) crtc->rotatedData - (char *) pGeode->FBBase)); else vg_set_display_offset(0); /* FIXME: Whats up with X and Y? Does that come into play * here? */ df_configure_video_source(&vs_odd, &vs_even); vg_wait_vertical_blank(); } static void lx_crtc_commit(xf86CrtcPtr crtc) { LXCrtcPrivatePtr lx_crtc = crtc->driver_private; ScrnInfoPtr pScrni = crtc->scrn; GeodeRec *pGeode = GEODEPTR(pScrni); /* Turn back on the sreen */ crtc->funcs->dpms(crtc, DPMSModeOn); /* Turn on compression */ if (pGeode->Compression) { vg_configure_compression(&(pGeode->CBData)); vg_set_compression_enable(1); } /* Load the cursor */ if (crtc->scrn->pScreen != NULL) { xf86_reload_cursors(crtc->scrn->pScreen); crtc->funcs->hide_cursor(crtc); crtc->cursor_shown = FALSE; } /* Renable the video */ if (lx_crtc->video_enable) df_set_video_enable(lx_crtc->video_enable, lx_crtc->video_flags); lx_crtc->video_enable = 0; lx_crtc->video_flags = 0; } static void lx_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue, int size) { unsigned int dcfg; int i; assert(size == 256); /* We need the Gamma Correction for video - fading operation, * the values address should be plused for every cycle. * Special for Screensaver Operation. */ for (i = 0; i < 256; i++) { unsigned int val; (*red) &= 0xff00; (*green) &= 0xff00; (*blue) &= 0xff00; val = (*(red++) << 8) | *(green++) | (*(blue++) >> 8); df_set_video_palette_entry(i, val); } /* df_set_video_palette_entry automatically turns on * gamma for video - if this gets called, we assume that * RandR wants it set for graphics, so reverse cimarron */ dcfg = READ_VID32(DF_DISPLAY_CONFIG); dcfg &= ~DF_DCFG_GV_PAL_BYP; WRITE_VID32(DF_DISPLAY_CONFIG, dcfg); } /* The Xserver has a scratch pixmap allocation routine that will * try to use the existing scratch pixmap if possible. When the driver * or any other user stop using it, it need to clear out any pixmap * state (private data etc) otherwise the next user may get stale data. */ /* Use our own wrapper to allocate a pixmap for wrapping a buffer object * It removes using scratch pixmaps for rotate. */ static PixmapPtr lx_create_bo_pixmap(ScreenPtr pScreen, int width, int height, int depth, int bpp, int pitch, pointer pPixData) { PixmapPtr pixmap; #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,5,0,0,0) pixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, 0); #else pixmap = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth); #endif if (!pixmap) return NULL; if (!(*pScreen->ModifyPixmapHeader) (pixmap, width, height, depth, bpp, pitch, pPixData)) { /* ModifyPixmapHeader failed, so we can't use it as scratch pixmap */ (*pScreen->DestroyPixmap) (pixmap); return NULL; } return pixmap; } static void lx_destory_bo_pixmap(PixmapPtr pixmap) { ScreenPtr pScreen = pixmap->drawable.pScreen; (*pScreen->DestroyPixmap) (pixmap); } /* Allocates shadow memory, and allocating a new space for Rotation. * The size is measured in bytes, and the offset from the beginning * of card space is returned. */ static Bool LXAllocShadow(ScrnInfoPtr pScrni, int size) { GeodeRec *pGeode = GEODEPTR(pScrni); if (pGeode->shadowArea) { if (pGeode->shadowArea->size != size) { exaOffscreenFree(pScrni->pScreen, pGeode->shadowArea); pGeode->shadowArea = NULL; } } if (pGeode->shadowArea == NULL) { pGeode->shadowArea = exaOffscreenAlloc(pScrni->pScreen, size, 4, TRUE, NULL, NULL); if (pGeode->shadowArea == NULL) return FALSE; } pScrni->fbOffset = pGeode->shadowArea->offset; return TRUE; } static void * lx_crtc_shadow_allocate(xf86CrtcPtr crtc, int width, int height) { ScrnInfoPtr pScrni = crtc->scrn; GeodePtr pGeode = GEODEPTR(pScrni); unsigned int rpitch, size; rpitch = pScrni->displayWidth * (pScrni->bitsPerPixel / 8); size = rpitch * height; /* Allocate shadow memory */ if (LXAllocShadow(pScrni, size) == FALSE) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Couldn't allocate the shadow memory for rotation\n"); xf86DrvMsg(pScrni->scrnIndex, X_ERROR, " You need 0x%x bytes, but only 0x%x bytes are available\n", size, GeodeOffscreenFreeSize(pGeode)); return NULL; } memset(pGeode->FBBase + pGeode->shadowArea->offset, 0, size); return pGeode->FBBase + pGeode->shadowArea->offset; } static PixmapPtr lx_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height) { ScrnInfoPtr pScrni = crtc->scrn; PixmapPtr rpixmap; unsigned int rpitch; rpitch = pScrni->displayWidth * (pScrni->bitsPerPixel / 8); if (!data) data = lx_crtc_shadow_allocate(crtc, width, height); rpixmap = lx_create_bo_pixmap(pScrni->pScreen, width, height, pScrni->depth, pScrni->bitsPerPixel, rpitch, data); if (rpixmap == NULL) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Couldn't allocate shadow pixmap for rotated CRTC\n"); } return rpixmap; } static void lx_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rpixmap, void *data) { ScrnInfoPtr pScrni = crtc->scrn; GeodeRec *pGeode = GEODEPTR(pScrni); if (rpixmap) lx_destory_bo_pixmap(rpixmap); /* Free shadow memory */ if (data) { gp_wait_until_idle(); if (pGeode->shadowArea != NULL) { exaOffscreenFree(pScrni->pScreen, pGeode->shadowArea); pGeode->shadowArea = NULL; } } } static void lx_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg) { vg_set_mono_cursor_colors(bg, fg); } static void lx_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) { VG_PANNING_COORDINATES panning; vg_set_cursor_position(x, y, &panning); } static void lx_crtc_show_cursor(xf86CrtcPtr crtc) { vg_set_cursor_enable(1); } static void lx_crtc_hide_cursor(xf86CrtcPtr crtc) { vg_set_cursor_enable(0); } static void lx_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) { LXLoadARGBCursorImage(crtc->scrn, (unsigned char *) image); } static const xf86CrtcFuncsRec lx_crtc_funcs = { .dpms = lx_crtc_dpms, .lock = lx_crtc_lock, .unlock = lx_crtc_unlock, .mode_fixup = lx_crtc_mode_fixup, .prepare = lx_crtc_prepare, .mode_set = lx_crtc_mode_set, .commit = lx_crtc_commit, .gamma_set = lx_crtc_gamma_set, .shadow_create = lx_crtc_shadow_create, .shadow_allocate = lx_crtc_shadow_allocate, .shadow_destroy = lx_crtc_shadow_destroy, .set_cursor_colors = lx_crtc_set_cursor_colors, .set_cursor_position = lx_crtc_set_cursor_position, .show_cursor = lx_crtc_show_cursor, .hide_cursor = lx_crtc_hide_cursor, .load_cursor_argb = lx_crtc_load_cursor_argb, }; void LXSetupCrtc(ScrnInfoPtr pScrni) { xf86CrtcPtr crtc; LXCrtcPrivatePtr lxpriv; crtc = xf86CrtcCreate(pScrni, &lx_crtc_funcs); if (crtc == NULL) { ErrorF("ERROR - failed to create a CRTC\n"); return; } lxpriv = xnfcalloc(1, sizeof(LXCrtcPrivateRec)); if (!lxpriv) { xf86CrtcDestroy(crtc); ErrorF("unable to allocate memory for lxpriv\n"); return; } crtc->driver_private = lxpriv; } xf86-video-geode-2.11.18/src/gx_video.c0000644000175000017500000012754712654445443014357 00000000000000/* Copyright (c) 2003-2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPDIs2IED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file consists of main Xfree video supported routines. * * Project: Geode Xfree Frame buffer device driver. * */ /* * Fixes & Extensions to support Y800 greyscale modes * Alan Hourihane * code to allocate offscreen memory from EXA - is borrowed from Radeon */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "xf86.h" #include "xf86_OSproc.h" #include "compiler.h" #include "xf86PciInfo.h" #include "xf86Pci.h" #include "xf86fbman.h" #include "regionstr.h" #include "geode.h" #include "xf86xv.h" #include #ifdef HAVE_XAA_H #include "xaa.h" #include "xaalocal.h" #endif #include "dixstruct.h" #include "fourcc.h" #include "geode_fourcc.h" #define OFF_DELAY 200 /* milliseconds */ #define FREE_DELAY 60000 #define OFF_TIMER 0x01 #define FREE_TIMER 0x02 #define CLIENT_VIDEO_ON 0x04 #define TIMER_MASK (OFF_TIMER | FREE_TIMER) #define XV_PROFILE 0 #define REINIT 1 #ifndef XvExtension #error "It didn't work!" void GXInitVideo(ScreenPtr pScrn) { } void GXResetVideo(ScrnInfoPtr pScrni) { } void GXSetVideoPosition() { } #else #define DBUF 1 void GXResetVideo(ScrnInfoPtr pScrni); static XF86VideoAdaptorPtr GXSetupImageVideo(ScreenPtr); static void GXInitOffscreenImages(ScreenPtr); static void GXStopVideo(ScrnInfoPtr, pointer, Bool); static int GXSetPortAttribute(ScrnInfoPtr, Atom, INT32, pointer); static int GXGetPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer); static void GXQueryBestSize(ScrnInfoPtr, Bool, short, short, short, short, unsigned int *, unsigned int *, pointer); static int GXPutImage(ScrnInfoPtr, short, short, short, short, short, short, short, short, int, unsigned char *, short, short, Bool, RegionPtr, pointer, DrawablePtr pDraw); static void GXBlockHandler(BLOCKHANDLER_ARGS_DECL); void GXSetVideoPosition(int x, int y, int width, int height, short src_w, short src_h, short drw_w, short drw_h, int id, int offset, ScrnInfoPtr pScrni); extern void GXAccelSync(ScrnInfoPtr pScrni); int DeltaX, DeltaY; unsigned long graphics_lut[256]; static int lutflag = 0; #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) static Atom xvColorKey, xvColorKeyMode, xvFilter #if DBUF , xvDoubleBuffer #endif ; #define PALETTE_ADDRESS 0x038 #define PALETTE_DATA 0x040 #define DISPLAY_CONFIG 0x008 #define MISC 0x050 static void get_gamma_ram(unsigned long *lut) { int i; gfx_write_vid32(PALETTE_ADDRESS, 0); for (i = 0; i < 256; i++) lut[i] = gfx_read_vid32(PALETTE_DATA); } /*---------------------------------------------------------------------------- * GXInitVideo * * Description :This is the initialization routine.It creates a new video * adapter and calls GXSetupImageVideo to initialize the adaptor * by filling XF86VideoAdaptorREc.Then it lists the existing * adaptors and adds the new one to it. Finally the list of * XF86VideoAdaptorPtr pointers are passed to the * xf86XVScreenInit(). * * Parameters. * pScrn :Screen handler pointer having screen information. * * Returns :none * * Comments :none *---------------------------------------------------------------------------- */ void GXInitVideo(ScreenPtr pScrn) { GeodeRec *pGeode; ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); pGeode = GEODEPTR(pScrni); if (!pGeode->NoAccel) { XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; XF86VideoAdaptorPtr newAdaptor = NULL; int num_adaptors; newAdaptor = GXSetupImageVideo(pScrn); GXInitOffscreenImages(pScrn); num_adaptors = xf86XVListGenericAdaptors(pScrni, &adaptors); if (newAdaptor) { if (!num_adaptors) { num_adaptors = 1; adaptors = &newAdaptor; } else { newAdaptors = /* need to free this someplace */ malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr *)); if (newAdaptors) { memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr)); newAdaptors[num_adaptors] = newAdaptor; adaptors = newAdaptors; num_adaptors++; } } } if (num_adaptors) xf86XVScreenInit(pScrn, adaptors, num_adaptors); if (newAdaptors) free(newAdaptors); } } /* client libraries expect an encoding */ static XF86VideoEncodingRec DummyEncoding[1] = { { 0, "XV_IMAGE", 1024, 1024, {1, 1} } }; #define NUM_FORMATS 4 static XF86VideoFormatRec Formats[NUM_FORMATS] = { {8, PseudoColor}, {15, TrueColor}, {16, TrueColor}, {24, TrueColor} }; #if DBUF #define NUM_ATTRIBUTES 4 #else #define NUM_ATTRIBUTES 3 #endif static XF86AttributeRec Attributes[NUM_ATTRIBUTES] = { #if DBUF {XvSettable | XvGettable, 0, 1, "XV_DOUBLE_BUFFER"}, #endif {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"}, {XvSettable | XvGettable, 0, 1, "XV_FILTER"}, {XvSettable | XvGettable, 0, 1, "XV_COLORKEYMODE"} }; #define NUM_IMAGES 8 static XF86ImageRec Images[NUM_IMAGES] = { XVIMAGE_UYVY, XVIMAGE_YUY2, XVIMAGE_Y2YU, XVIMAGE_YVYU, XVIMAGE_Y800, XVIMAGE_I420, XVIMAGE_YV12, XVIMAGE_RGB565 }; typedef struct { void *area; int offset; RegionRec clip; CARD32 filter; CARD32 colorKey; CARD32 colorKeyMode; CARD32 videoStatus; Time offTime; Time freeTime; #if DBUF Bool doubleBuffer; int currentBuffer; #endif } GeodePortPrivRec, *GeodePortPrivPtr; #define GET_PORT_PRIVATE(pScrni) \ (GeodePortPrivRec *)((GEODEPTR(pScrni))->adaptor->pPortPrivates[0].ptr) /*---------------------------------------------------------------------------- * GXSetColorKey * * Description :This function reads the color key for the pallete and * sets the video color key register. * * Parameters. * ScreenInfoPtr * pScrni :Screen pointer having screen information. * pPriv :Video port private data * * Returns :none * * Comments :none * *---------------------------------------------------------------------------- */ static INT32 GXSetColorkey(ScrnInfoPtr pScrni, GeodePortPrivRec * pPriv) { int red, green, blue; unsigned long key; switch (pScrni->depth) { case 8: GFX(get_display_palette_entry(pPriv->colorKey & 0xFF, &key)); red = ((key >> 16) & 0xFF); green = ((key >> 8) & 0xFF); blue = (key & 0xFF); break; case 16: red = (pPriv->colorKey & pScrni->mask.red) >> pScrni->offset.red << (8 - pScrni->weight.red); green = (pPriv->colorKey & pScrni->mask.green) >> pScrni->offset.green << (8 - pScrni->weight.green); blue = (pPriv->colorKey & pScrni->mask.blue) >> pScrni->offset.blue << (8 - pScrni->weight.blue); break; default: /* for > 16 bpp we send in the mask in xf86SetWeight. This * function is providing the offset by 1 more. So we take * this as a special case and subtract 1 for > 16 */ red = (pPriv->colorKey & pScrni->mask.red) >> (pScrni->offset.red - 1) << (8 - pScrni->weight.red); green = (pPriv->colorKey & pScrni->mask.green) >> (pScrni->offset.green - 1) << (8 - pScrni->weight.green); blue = (pPriv->colorKey & pScrni->mask.blue) >> (pScrni->offset.blue - 1) << (8 - pScrni->weight.blue); break; } GFX(set_video_color_key((blue | (green << 8) | (red << 16)), 0xFFFFFF, (pPriv->colorKeyMode == 0))); REGION_EMPTY(pScrni->pScreen, &pPriv->clip); return 0; } /*---------------------------------------------------------------------------- * GXResetVideo * * Description : This function resets the video * * Parameters. * pScrni :Screen pointer having screen information. * * Returns :None * * Comments :none * *---------------------------------------------------------------------------- */ void GXResetVideo(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); if (!pGeode->NoAccel) { GeodePortPrivRec *pPriv = pGeode->adaptor->pPortPrivates[0].ptr; GXAccelSync(pScrni); GXSetColorkey(pScrni, pPriv); GFX(set_video_filter(pPriv->filter, pPriv->filter)); } } /*---------------------------------------------------------------------------- * GXSetupImageVideo * * Description : This function allocates space for a Videoadaptor and * initializes the XF86VideoAdaptorPtr record. * * Parameters. * pScrn :Screen handler pointer having screen information. * * Returns :pointer to the initialized video adaptor record. * * Comments :none *---------------------------------------------------------------------------- */ static XF86VideoAdaptorPtr GXSetupImageVideo(ScreenPtr pScrn) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); XF86VideoAdaptorPtr adapt; GeodePortPrivRec *pPriv; if (!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + sizeof(GeodePortPrivRec) + sizeof(DevUnion)))) return NULL; adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; adapt->name = "Advanced Micro Devices"; adapt->nEncodings = 1; adapt->pEncodings = DummyEncoding; adapt->nFormats = NUM_FORMATS; adapt->pFormats = Formats; adapt->nPorts = 1; adapt->pPortPrivates = (DevUnion *) (&adapt[1]); pPriv = (GeodePortPrivRec *) (&adapt->pPortPrivates[1]); adapt->pPortPrivates[0].ptr = (pointer) (pPriv); adapt->pAttributes = Attributes; adapt->nImages = NUM_IMAGES; adapt->nAttributes = NUM_ATTRIBUTES; adapt->pImages = Images; adapt->PutVideo = NULL; adapt->PutStill = NULL; adapt->GetVideo = NULL; adapt->GetStill = NULL; adapt->StopVideo = GXStopVideo; adapt->SetPortAttribute = GXSetPortAttribute; adapt->GetPortAttribute = GXGetPortAttribute; adapt->QueryBestSize = GXQueryBestSize; adapt->PutImage = GXPutImage; adapt->QueryImageAttributes = GeodeQueryImageAttributes; pPriv->filter = 0; pPriv->colorKey = 0; pPriv->colorKeyMode = 0; pPriv->videoStatus = 0; #if DBUF pPriv->doubleBuffer = TRUE; pPriv->currentBuffer = 0; /* init to first buffer */ #endif /* gotta uninit this someplace */ #if defined(REGION_NULL) REGION_NULL(pScrn, &pPriv->clip); #else REGION_INIT(pScrn, &pPriv->clip, NullBox, 0); #endif pGeode->adaptor = adapt; pGeode->BlockHandler = pScrn->BlockHandler; pScrn->BlockHandler = GXBlockHandler; xvColorKey = MAKE_ATOM("XV_COLORKEY"); xvColorKeyMode = MAKE_ATOM("XV_COLORKEYMODE"); xvFilter = MAKE_ATOM("XV_FILTER"); #if DBUF xvDoubleBuffer = MAKE_ATOM("XV_DOUBLE_BUFFER"); #endif GXResetVideo(pScrni); return adapt; } /*---------------------------------------------------------------------------- * GXStopVideo * * Description :This function is used to stop input and output video * * Parameters. * pScrni :Screen handler pointer having screen information. * data :Pointer to the video port's private data * exit :Flag indicating whether the offscreen areas used for * video to be deallocated or not. * * Returns :none * * Comments :none *---------------------------------------------------------------------------- */ static void GXStopVideo(ScrnInfoPtr pScrni, pointer data, Bool exit) { GeodePortPrivRec *pPriv = (GeodePortPrivRec *) data; GeodeRec *pGeode = GEODEPTR(pScrni); REGION_EMPTY(pScrni->pScreen, &pPriv->clip); GXAccelSync(pScrni); if (exit) { if (pPriv->videoStatus & CLIENT_VIDEO_ON) { GFX(set_video_enable(0)); /* If we have saved graphics LUT data - restore it */ /* Otherwise, turn bypass on */ if (lutflag) GFX(set_graphics_palette(graphics_lut)); else GFX(set_video_palette_bypass(1)); lutflag = 0; } if (pPriv->area) { #ifdef XF86EXA if (pGeode->useEXA) exaOffscreenFree(pScrni->pScreen, pPriv->area); #endif if (!pGeode->useEXA) xf86FreeOffscreenArea(pPriv->area); pPriv->area = NULL; } pPriv->videoStatus = 0; pGeode->OverlayON = FALSE; } else { if (pPriv->videoStatus & CLIENT_VIDEO_ON) { pPriv->videoStatus |= OFF_TIMER; pPriv->offTime = currentTime.milliseconds + OFF_DELAY; } } } /*---------------------------------------------------------------------------- * GXSetPortAttribute * * Description :This function is used to set the attributes of a port * like colorkeymode, double buffer support and filter. * * Parameters. * pScrni :Screen handler pointer having screen information. * data :Pointer to the video port's private data * attribute :The port attribute to be set * value :Value of the attribute to be set. * * Returns :Sucess if the attribute is supported, else BadMatch * * Comments :none *---------------------------------------------------------------------------- */ static int GXSetPortAttribute(ScrnInfoPtr pScrni, Atom attribute, INT32 value, pointer data) { GeodePortPrivRec *pPriv = (GeodePortPrivRec *) data; GXAccelSync(pScrni); if (attribute == xvColorKey) { pPriv->colorKey = value; GXSetColorkey(pScrni, pPriv); } #if DBUF else if (attribute == xvDoubleBuffer) { if ((value < 0) || (value > 1)) return BadValue; pPriv->doubleBuffer = value; } #endif else if (attribute == xvColorKeyMode) { pPriv->colorKeyMode = value; GXSetColorkey(pScrni, pPriv); } else if (attribute == xvFilter) { if ((value < 0) || (value > 1)) return BadValue; pPriv->filter = value; } else return BadMatch; return Success; } /*---------------------------------------------------------------------------- * GXGetPortAttribute * * Description :This function is used to get the attributes of a port * like hue, saturation,brightness or contrast. * * Parameters. * pScrni :Screen handler pointer having screen information. * data :Pointer to the video port's private data * attribute :The port attribute to be read * value :Pointer to the value of the attribute to be read. * * Returns :Sucess if the attribute is supported, else BadMatch * * Comments :none *---------------------------------------------------------------------------- */ static int GXGetPortAttribute(ScrnInfoPtr pScrni, Atom attribute, INT32 *value, pointer data) { GeodePortPrivRec *pPriv = (GeodePortPrivRec *) data; if (attribute == xvColorKey) { *value = pPriv->colorKey; } #if DBUF else if (attribute == xvDoubleBuffer) { *value = (pPriv->doubleBuffer) ? 1 : 0; } #endif else if (attribute == xvColorKeyMode) { *value = pPriv->colorKeyMode; } else if (attribute == xvFilter) { *value = pPriv->filter; } else return BadMatch; return Success; } /*---------------------------------------------------------------------------- * GXQueryBestSize * * Description :This function provides a way to query what the * destination dimensions would end up being if they were to * request that an area vid_w by vid_h from the video stream * be scaled to rectangle of drw_w by drw_h on the screen. * * Parameters. * pScrni :Screen handler pointer having screen information. * data :Pointer to the video port's private data * vid_w,vid_h :Width and height of the video data. * drw_w,drw_h :Width and height of the scaled rectangle. * p_w,p_h :Width and height of the destination rectangle. * * Returns :None * * Comments :None *---------------------------------------------------------------------------- */ static void GXQueryBestSize(ScrnInfoPtr pScrni, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, unsigned int *p_h, pointer data) { *p_w = drw_w; *p_h = drw_h; if (*p_w > 16384) *p_w = 16384; } /*---------------------------------------------------------------------------- * GXCopyData420 * * Description : Copies data from src to destination * * Parameters. * src : pointer to the source data * dst : pointer to destination data * srcPitch : pitch of the srcdata * dstPitch : pitch of the destination data * h & w : height and width of source data * * Returns :None * * Comments :None *---------------------------------------------------------------------------- */ static void GXCopyData420(unsigned char *src, unsigned char *dst, int srcPitch, int dstPitch, int h, int w) { while (h--) { memcpy(dst, src, w); src += srcPitch; dst += dstPitch; } } /*---------------------------------------------------------------------------- * GXCopyData422 * * Description : Copies data from src to destination * * Parameters. * src : pointer to the source data * dst : pointer to destination data * srcPitch : pitch of the srcdata * dstPitch : pitch of the destination data * h & w : height and width of source data * * Returns :None * * Comments :None *---------------------------------------------------------------------------- */ static void GXCopyData422(unsigned char *src, unsigned char *dst, int srcPitch, int dstPitch, int h, int w) { w <<= 1; while (h--) { memcpy(dst, src, w); src += srcPitch; dst += dstPitch; } } #ifdef XF86EXA static void GXVideoSave(ScreenPtr pScreen, ExaOffscreenArea * area) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScreen); GeodePortPrivRec *pPriv = GET_PORT_PRIVATE(pScrni); if (area == pPriv->area) pPriv->area = NULL; } #endif static int GXAllocateMemory(ScrnInfoPtr pScrni, void **memp, int numlines) { ScreenPtr pScrn = xf86ScrnToScreen(pScrni); GeodeRec *pGeode = GEODEPTR(pScrni); //long displayWidth = pGeode->Pitch / ((pScrni->bitsPerPixel + 7) / 8); int size = numlines * pGeode->displayWidth; #if XF86EXA if (pGeode->useEXA) { ExaOffscreenArea *area = *memp; if (area != NULL) { if (area->size >= size) return area->offset; exaOffscreenFree(pScrni->pScreen, area); } area = exaOffscreenAlloc(pScrni->pScreen, size, 16, TRUE, GXVideoSave, NULL); *memp = area; return area == NULL ? 0 : area->offset; } #endif if (!pGeode->useEXA) { FBAreaPtr area = *memp; FBAreaPtr new_area; if (area) { if ((area->box.y2 - area->box.y1) >= numlines) return (area->box.y1 * pGeode->Pitch); if (xf86ResizeOffscreenArea(area, pGeode->displayWidth, numlines)) return (area->box.y1 * pGeode->Pitch); xf86FreeOffscreenArea(area); } new_area = xf86AllocateOffscreenArea(pScrn, pGeode->displayWidth, numlines, 0, NULL, NULL, NULL); if (!new_area) { int max_w, max_h; xf86QueryLargestOffscreenArea(pScrn, &max_w, &max_h, 0, FAVOR_WIDTH_THEN_AREA, PRIORITY_EXTREME); if ((max_w < pGeode->displayWidth) || (max_h < numlines)) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "No room - how sad %x, %x, %x, %x\n", max_w, pGeode->displayWidth, max_h, numlines); return 0; } xf86PurgeUnlockedOffscreenAreas(pScrn); new_area = xf86AllocateOffscreenArea(pScrn, pGeode->displayWidth, numlines, 0, NULL, NULL, NULL); } return (new_area->box.y1 * pGeode->Pitch); } return 0; } static BoxRec dstBox; static int srcPitch = 0, srcPitch2 = 0, dstPitch = 0, dstPitch2 = 0; static INT32 Bx1, Bx2, By1, By2; static int top, left, npixels, nlines; static int offset, s1offset = 0, s2offset = 0, s3offset = 0; static unsigned char *dst_start; static int d2offset = 0, d3offset = 0; #if 0 static Bool RegionsIntersect(BoxPtr pRcl1, BoxPtr pRcl2, BoxPtr pRclResult) { pRclResult->x1 = max(pRcl1->x1, pRcl2->x1); pRclResult->x2 = min(pRcl1->x2, pRcl2->x2); if (pRclResult->x1 <= pRclResult->x2) { pRclResult->y1 = max(pRcl1->y1, pRcl2->y1); pRclResult->y2 = min(pRcl1->y2, pRcl2->y2); if (pRclResult->y1 <= pRclResult->y2) { return (TRUE); } } return (FALSE); } #endif void GXSetVideoPosition(int x, int y, int width, int height, short src_w, short src_h, short drw_w, short drw_h, int id, int offset, ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); long ystart, xend, yend; unsigned long lines = 0; unsigned long y_extra, uv_extra = 0; unsigned long startAddress; #if 0 BoxRec ovly, display, result; #endif xend = x + drw_w; yend = y + drw_h; /* Take care of panning when panel is present */ startAddress = gfx_get_display_offset(); DeltaY = startAddress / pGeode->Pitch; DeltaX = startAddress & (pGeode->Pitch - 1); DeltaX /= (pScrni->bitsPerPixel >> 3); #if 0 /* Thhis code is pretty dang broken - comment it out for now */ if (pGeode->Panel) { ovly.x1 = x; ovly.x2 = x + pGeode->video_dstw; ovly.y1 = y; ovly.y2 = y + pGeode->video_dsth; display.x1 = DeltaX; display.x2 = DeltaX + pGeode->FPBX; display.y1 = DeltaY; display.y2 = DeltaY + pGeode->FPBY; x = xend = 0; if (RegionsIntersect(&display, &ovly, &result)) { x = ovly.x1 - DeltaX; xend = ovly.x2 - DeltaX; y = ovly.y1 - DeltaY; yend = ovly.y2 - DeltaY; } } #endif /* TOP CLIPPING */ if (y < 0) { if (src_h < drw_h) lines = (-y) * src_h / drw_h; else lines = (-y); ystart = 0; drw_h += y; y_extra = lines * dstPitch; uv_extra = (lines >> 1) * (dstPitch2); } else { ystart = y; lines = 0; y_extra = 0; } GFX(set_video_window(x, ystart, xend - x, yend - ystart)); if ((id == FOURCC_Y800) || (id == FOURCC_I420) || (id == FOURCC_YV12)) { GFX(set_video_yuv_offsets(offset + y_extra, offset + d3offset + uv_extra, offset + d2offset + uv_extra)); } else { GFX(set_video_offset(offset + y_extra)); } } /*---------------------------------------------------------------------------- * GXDisplayVideo * * Description :This function sets up the video registers for playing video * It sets up the video format,width, height & position of the * video window ,video offsets( y,u,v) and video pitches(y,u,v) * * Parameters * * Returns :None * * Comments :None *---------------------------------------------------------------------------- */ static void GXDisplayVideo(ScrnInfoPtr pScrni, int id, int offset, short width, short height, int pitch, int x1, int y1, int x2, int y2, BoxPtr dstBox, short src_w, short src_h, short drw_w, short drw_h) { GeodeRec *pGeode = GEODEPTR(pScrni); unsigned long dcfg, misc; GXAccelSync(pScrni); /* If the gamma LUT is already loaded with graphics data, then save it * off */ if (id != FOURCC_RGB565) { dcfg = gfx_read_vid32(DISPLAY_CONFIG); misc = gfx_read_vid32(MISC); lutflag = (!(misc & 1) && (dcfg & (1 << 21))); if (lutflag) get_gamma_ram(graphics_lut); /* Set the video gamma ram */ GFX(set_video_palette(NULL)); } GFX(set_video_enable(1)); switch (id) { case FOURCC_UYVY: /* UYVY */ GFX(set_video_format(VIDEO_FORMAT_UYVY)); GFX(set_video_size(width, height)); break; case FOURCC_Y800: /* Y800 - greyscale - we munge it! */ case FOURCC_YV12: /* YV12 */ case FOURCC_I420: /* I420 */ GFX(set_video_format(VIDEO_FORMAT_Y0Y1Y2Y3)); GFX(set_video_size(width, height)); GFX(set_video_yuv_pitch(dstPitch, dstPitch2)); break; case FOURCC_YUY2: /* YUY2 */ GFX(set_video_format(VIDEO_FORMAT_YUYV)); GFX(set_video_size(width, height)); break; case FOURCC_Y2YU: /* Y2YU */ GFX(set_video_format(VIDEO_FORMAT_Y2YU)); GFX(set_video_size(width, height)); break; case FOURCC_YVYU: /* YVYU */ GFX(set_video_format(VIDEO_FORMAT_YVYU)); GFX(set_video_size(width, height)); break; case FOURCC_RGB565: GFX(set_video_format(VIDEO_FORMAT_RGB)); GFX(set_video_size(width, height)); break; } if (pGeode->Panel) { pGeode->video_x = dstBox->x1; pGeode->video_y = dstBox->y1; pGeode->video_w = width; pGeode->video_h = height; pGeode->video_srcw = src_w; pGeode->video_srch = src_h; pGeode->video_dstw = drw_w; pGeode->video_dsth = drw_h; pGeode->video_offset = offset; pGeode->video_id = id; pGeode->video_scrnptr = pScrni; } if ((drw_w >= src_w) && (drw_h >= src_h)) GFX(set_video_scale(width, height, drw_w, drw_h)); else if (drw_w < src_w) GFX(set_video_scale(drw_w, height, drw_w, drw_h)); else if (drw_h < src_h) GFX(set_video_scale(width, drw_h, drw_w, drw_h)); GXSetVideoPosition(dstBox->x1, dstBox->y1, width, height, src_w, src_h, drw_w, drw_h, id, offset, pScrni); } /* Used by LX as well */ Bool RegionsEqual(RegionPtr A, RegionPtr B) { int *dataA, *dataB; int num; num = REGION_NUM_RECTS(A); if (num != REGION_NUM_RECTS(B)) { return FALSE; } if ((A->extents.x1 != B->extents.x1) || (A->extents.x2 != B->extents.x2) || (A->extents.y1 != B->extents.y1) || (A->extents.y2 != B->extents.y2)) return FALSE; dataA = (int *) REGION_RECTS(A); dataB = (int *) REGION_RECTS(B); while (num--) { if ((dataA[0] != dataB[0]) || (dataA[1] != dataB[1])) return FALSE; dataA += 2; dataB += 2; } return TRUE; } /*---------------------------------------------------------------------------- * GXPutImage :This function writes a single frame of video into a * drawable. The position and size of the source rectangle is * specified by src_x,src_y, src_w and src_h. This data is * stored in a system memory buffer at buf. The position and * size of the destination rectangle is specified by drw_x, * drw_y,drw_w,drw_h.The data is in the format indicated by the * image descriptor and represents a source of size width by * height. If sync is TRUE the driver should not return from * this function until it is through reading the data from buf. * Returning when sync is TRUE indicates that it is safe for the * data at buf to be replaced,freed, or modified. * * Parameters. * * Returns :None * * Comments :None *---------------------------------------------------------------------------- */ static int GXPutImage(ScrnInfoPtr pScrni, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int id, unsigned char *buf, short width, short height, Bool sync, RegionPtr clipBoxes, pointer data, DrawablePtr pDraw) { GeodePortPrivRec *pPriv = (GeodePortPrivRec *) data; GeodeRec *pGeode = GEODEPTR(pScrni); int new_h; #if REINIT BOOL ReInitVideo = FALSE; static BOOL DoReinitAgain = 0; #endif #if XV_PROFILE long oldtime, newtime; UpdateCurrentTime(); oldtime = currentTime.milliseconds; #endif #if REINIT /* update cliplist */ if (!RegionsEqual(&pPriv->clip, clipBoxes)) { ReInitVideo = TRUE; } if (DoReinitAgain) ReInitVideo = TRUE; if (ReInitVideo) { DEBUGMSG(1, (0, X_NONE, "Regional Not Equal - Init\n")); #endif DoReinitAgain = ~DoReinitAgain; if (drw_w > 16384) drw_w = 16384; /* Clip */ Bx1 = src_x; Bx2 = src_x + src_w; By1 = src_y; By2 = src_y + src_h; if ((Bx1 >= Bx2) || (By1 >= By2)) return Success; dstBox.x1 = drw_x; dstBox.x2 = drw_x + drw_w; dstBox.y1 = drw_y; dstBox.y2 = drw_y + drw_h; dstBox.x1 -= pScrni->frameX0; dstBox.x2 -= pScrni->frameX0; dstBox.y1 -= pScrni->frameY0; dstBox.y2 -= pScrni->frameY0; switch (id) { case FOURCC_YV12: case FOURCC_I420: srcPitch = (width + 3) & ~3; /* of luma */ dstPitch = (width + 31) & ~31; s2offset = srcPitch * height; d2offset = dstPitch * height; srcPitch2 = ((width >> 1) + 3) & ~3; dstPitch2 = ((width >> 1) + 15) & ~15; s3offset = (srcPitch2 * (height >> 1)) + s2offset; d3offset = (dstPitch2 * (height >> 1)) + d2offset; new_h = dstPitch * height; /* Y */ new_h += (dstPitch2 * height); /* U+V */ new_h += pGeode->Pitch - 1; new_h /= pGeode->Pitch; break; case FOURCC_UYVY: case FOURCC_YUY2: case FOURCC_Y800: case FOURCC_RGB565: default: dstPitch = ((width << 1) + 3) & ~3; srcPitch = (width << 1); new_h = ((dstPitch * height) + pGeode->Pitch - 1) / pGeode->Pitch; break; } #if DBUF if (pPriv->doubleBuffer) new_h <<= 1; #endif if (!(pPriv->offset = GXAllocateMemory(pScrni, &pPriv->area, new_h))) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Could not allocate area of size %d\n", new_h); return BadAlloc; } /* copy data */ top = By1; left = Bx1 & ~1; npixels = ((Bx2 + 1) & ~1) - left; switch (id) { case FOURCC_YV12: case FOURCC_I420: { int tmp; top &= ~1; offset = pPriv->offset + (top * dstPitch); #if DBUF if (pPriv->doubleBuffer && pPriv->currentBuffer) offset += (new_h >> 1) * pGeode->Pitch; #endif dst_start = pGeode->FBBase + offset + left; tmp = ((top >> 1) * srcPitch2) + (left >> 1); s2offset += tmp; s3offset += tmp; if (id == FOURCC_I420) { tmp = s2offset; s2offset = s3offset; s3offset = tmp; } nlines = ((By2 + 1) & ~1) - top; } break; case FOURCC_UYVY: case FOURCC_YUY2: case FOURCC_Y800: case FOURCC_RGB565: default: left <<= 1; buf += (top * srcPitch) + left; nlines = By2 - top; offset = (pPriv->offset) + (top * dstPitch); #if DBUF if (pPriv->doubleBuffer && pPriv->currentBuffer) offset += (new_h >> 1) * pGeode->Pitch; #endif dst_start = pGeode->FBBase + offset + left; break; } s1offset = (top * srcPitch) + left; #if REINIT /* update cliplist */ REGION_COPY(pScrni->pScreen, &pPriv->clip, clipBoxes); if (pPriv->colorKeyMode == 0) { xf86XVFillKeyHelper(pScrni->pScreen, pPriv->colorKey, clipBoxes); } GXDisplayVideo(pScrni, id, offset, width, height, dstPitch, Bx1, By1, Bx2, By2, &dstBox, src_w, src_h, drw_w, drw_h); } #endif switch (id) { case FOURCC_Y800: /* This is shared between LX and GX, so it lives in amd_common.c */ GeodeCopyGreyscale(buf, dst_start, srcPitch, dstPitch, nlines, npixels); break; case FOURCC_YV12: case FOURCC_I420: GXCopyData420(buf + s1offset, dst_start, srcPitch, dstPitch, nlines, npixels); GXCopyData420(buf + s2offset, dst_start + d2offset, srcPitch2, dstPitch2, nlines >> 1, npixels >> 1); GXCopyData420(buf + s3offset, dst_start + d3offset, srcPitch2, dstPitch2, nlines >> 1, npixels >> 1); break; case FOURCC_UYVY: case FOURCC_YUY2: case FOURCC_RGB565: default: GXCopyData422(buf, dst_start, srcPitch, dstPitch, nlines, npixels); break; } #if !REINIT /* update cliplist */ REGION_COPY(pScrni->pScreen, &pPriv->clip, clipBoxes); if (pPriv->colorKeyMode == 0) { /* draw these */ XAAFillSolidRects(pScrni, pPriv->colorKey, GXcopy, ~0, REGION_NUM_RECTS(clipBoxes), REGION_RECTS(clipBoxes)); } GXDisplayVideo(pScrni, id, offset, width, height, dstPitch, Bx1, By1, Bx2, By2, &dstBox, src_w, src_h, drw_w, drw_h); #endif #if XV_PROFILE UpdateCurrentTime(); newtime = currentTime.milliseconds; DEBUGMSG(1, (0, X_NONE, "PI %d\n", newtime - oldtime)); #endif #if DBUF pPriv->currentBuffer ^= 1; #endif pPriv->videoStatus = CLIENT_VIDEO_ON; pGeode->OverlayON = TRUE; return Success; } /*---------------------------------------------------------------------------- * GXQueryImageAttributes * * Description :This function is called to let the driver specify how data * for a particular image of size width by height should be * stored. * * Parameters. * pScrni :Screen handler pointer having screen information. * id :Id for the video format * width :width of the image (can be modified by the driver) * height :height of the image (can be modified by the driver) * Returns : Size of the memory required for storing this image * * Comments :None * *---------------------------------------------------------------------------- */ int GeodeQueryImageAttributes(ScrnInfoPtr pScrni, int id, unsigned short *w, unsigned short *h, int *pitches, int *offsets) { int size; int tmp; DEBUGMSG(0, (0, X_NONE, "QueryImageAttributes %X\n", id)); if (*w > 1024) *w = 1024; if (*h > 1024) *h = 1024; *w = (*w + 1) & ~1; if (offsets) offsets[0] = 0; switch (id) { case FOURCC_YV12: case FOURCC_I420: *h = (*h + 1) & ~1; size = (*w + 3) & ~3; if (pitches) pitches[0] = size; size *= *h; if (offsets) offsets[1] = size; tmp = ((*w >> 1) + 3) & ~3; if (pitches) pitches[1] = pitches[2] = tmp; tmp *= (*h >> 1); size += tmp; if (offsets) offsets[2] = size; size += tmp; break; case FOURCC_UYVY: case FOURCC_YUY2: case FOURCC_Y800: default: size = *w << 1; if (pitches) pitches[0] = size; size *= *h; break; } return size; } static void GXBlockHandler(BLOCKHANDLER_ARGS_DECL) { SCREEN_PTR(arg); ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); GeodePortPrivRec *pPriv = GET_PORT_PRIVATE(pScrni); pScrn->BlockHandler = pGeode->BlockHandler; (*pScrn->BlockHandler) (BLOCKHANDLER_ARGS); pScrn->BlockHandler = GXBlockHandler; if (pPriv->videoStatus & TIMER_MASK) { GXAccelSync(pScrni); UpdateCurrentTime(); if (pPriv->videoStatus & OFF_TIMER) { if (pPriv->offTime < currentTime.milliseconds) { GFX(set_video_enable(0)); /* If we have saved graphics LUT data - restore it */ /* Otherwise, turn bypass on */ if (lutflag) GFX(set_graphics_palette(graphics_lut)); else GFX(set_video_palette_bypass(1)); lutflag = 0; pPriv->videoStatus = FREE_TIMER; pPriv->freeTime = currentTime.milliseconds + FREE_DELAY; } } else { /* FREE_TIMER */ if (pPriv->freeTime < currentTime.milliseconds) { if (pPriv->area) { #ifdef XF86EXA if (pGeode->useEXA) exaOffscreenFree(pScrn, pPriv->area); #endif if (!pGeode->useEXA) xf86FreeOffscreenArea(pPriv->area); pPriv->area = NULL; } pPriv->videoStatus = 0; } } } } /****************** Offscreen stuff ***************/ typedef struct { void *area; int offset; Bool isOn; } OffscreenPrivRec, *OffscreenPrivPtr; /*---------------------------------------------------------------------------- * GXAllocateSurface * * Description :This function allocates an area of w by h in the offscreen * * Parameters. * pScrni :Screen handler pointer having screen information. * * Returns :None * * Comments :None *---------------------------------------------------------------------------- */ static int GXAllocateSurface(ScrnInfoPtr pScrni, int id, unsigned short w, unsigned short h, XF86SurfacePtr surface) { void *area = NULL; int pitch, fbpitch, numlines; OffscreenPrivRec *pPriv; if ((w > 1024) || (h > 1024)) return BadAlloc; w = (w + 1) & ~1; pitch = ((w << 1) + 15) & ~15; fbpitch = pScrni->bitsPerPixel * pScrni->displayWidth >> 3; numlines = ((pitch * h) + fbpitch - 1) / fbpitch; if (!(offset = GXAllocateMemory(pScrni, &area, numlines))) return BadAlloc; surface->width = w; surface->height = h; if (!(surface->pitches = malloc(sizeof(int)))) return BadAlloc; if (!(surface->offsets = malloc(sizeof(int)))) { free(surface->pitches); return BadAlloc; } if (!(pPriv = malloc(sizeof(OffscreenPrivRec)))) { free(surface->pitches); free(surface->offsets); return BadAlloc; } pPriv->area = area; pPriv->offset = offset; pPriv->isOn = FALSE; surface->pScrn = pScrni; surface->id = id; surface->pitches[0] = pitch; surface->offsets[0] = offset; surface->devPrivate.ptr = (pointer) pPriv; return Success; } static int GXStopSurface(XF86SurfacePtr surface) { OffscreenPrivRec *pPriv = (OffscreenPrivRec *) surface->devPrivate.ptr; if (pPriv->isOn) { pPriv->isOn = FALSE; } return Success; } static int GXFreeSurface(XF86SurfacePtr surface) { OffscreenPrivRec *pPriv = (OffscreenPrivRec *) surface->devPrivate.ptr; if (pPriv->isOn) GXStopSurface(surface); xf86FreeOffscreenArea(pPriv->area); free(surface->pitches); free(surface->offsets); free(surface->devPrivate.ptr); return Success; } static int GXGetSurfaceAttribute(ScrnInfoPtr pScrni, Atom attribute, INT32 *value) { return GXGetPortAttribute(pScrni, attribute, value, (pointer) (GET_PORT_PRIVATE(pScrni))); } static int GXSetSurfaceAttribute(ScrnInfoPtr pScrni, Atom attribute, INT32 value) { return GXSetPortAttribute(pScrni, attribute, value, (pointer) (GET_PORT_PRIVATE(pScrni))); } static int GXDisplaySurface(XF86SurfacePtr surface, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, RegionPtr clipBoxes) { OffscreenPrivRec *pPriv = (OffscreenPrivRec *) surface->devPrivate.ptr; ScrnInfoPtr pScrni = surface->pScrn; GeodePortPrivRec *portPriv = GET_PORT_PRIVATE(pScrni); INT32 x1, y1, x2, y2; BoxRec dstBox; DEBUGMSG(0, (0, X_NONE, "DisplaySuface\n")); x1 = src_x; x2 = src_x + src_w; y1 = src_y; y2 = src_y + src_h; dstBox.x1 = drw_x; dstBox.x2 = drw_x + drw_w; dstBox.y1 = drw_y; dstBox.y2 = drw_y + drw_h; if ((x1 >= x2) || (y1 >= y2)) return Success; dstBox.x1 -= pScrni->frameX0; dstBox.x2 -= pScrni->frameX0; dstBox.y1 -= pScrni->frameY0; dstBox.y2 -= pScrni->frameY0; xf86XVFillKeyHelper(pScrni->pScreen, portPriv->colorKey, clipBoxes); GXDisplayVideo(pScrni, surface->id, surface->offsets[0], surface->width, surface->height, surface->pitches[0], x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h); pPriv->isOn = TRUE; if (portPriv->videoStatus & CLIENT_VIDEO_ON) { REGION_EMPTY(pScrni->pScreen, &portPriv->clip); UpdateCurrentTime(); portPriv->videoStatus = FREE_TIMER; portPriv->freeTime = currentTime.milliseconds + FREE_DELAY; } return Success; } /*---------------------------------------------------------------------------- * GXInitOffscreenImages * * Description :This function sets up the offscreen memory management. It * fills in the XF86OffscreenImagePtr structure with functions to * handle offscreen memory operations. * * Parameters. * pScrn :Screen handler pointer having screen information. * * Returns : None * * Comments :None *---------------------------------------------------------------------------- */ static void GXInitOffscreenImages(ScreenPtr pScrn) { XF86OffscreenImagePtr offscreenImages; /* need to free this someplace */ if (!(offscreenImages = malloc(sizeof(XF86OffscreenImageRec)))) return; offscreenImages[0].image = &Images[0]; offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; offscreenImages[0].alloc_surface = GXAllocateSurface; offscreenImages[0].free_surface = GXFreeSurface; offscreenImages[0].display = GXDisplaySurface; offscreenImages[0].stop = GXStopSurface; offscreenImages[0].setAttribute = GXSetSurfaceAttribute; offscreenImages[0].getAttribute = GXGetSurfaceAttribute; offscreenImages[0].max_width = 1024; offscreenImages[0].max_height = 1024; offscreenImages[0].num_attributes = NUM_ATTRIBUTES; offscreenImages[0].attributes = Attributes; xf86XVRegisterOffscreenImages(pScrn, offscreenImages, 1); } #endif /* !XvExtension */ xf86-video-geode-2.11.18/src/lx_panel.c0000644000175000017500000001235312654445443014341 00000000000000/* Copyright (c) 2008 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* Reference: Video Graphics Suite Specification: * VG Config Register (0x00) page 16 * VG FP Register (0x02) page 18 */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "xf86.h" #include "compiler.h" #include "xf86Modes.h" #include "geode.h" #define LX_READ_VG(reg) \ (outw(0xAC1C,0xFC53), outw(0xAC1C,0x0200|(reg)), inw(0xAC1E)) /* This is borrowed from xerver/hw/xfree86/modes */ #define MODEPREFIX NULL, NULL, NULL, 0, M_T_DRIVER #define MODESUFFIX 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,FALSE,FALSE,0,NULL,0,0.0,0.0 DisplayModeRec lx_panel_modes[] = { {MODEPREFIX, 31200, 320, 354, 384, 400, 0, 240, 249, 253, 260, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX} , /* 320x200@75 */ {MODEPREFIX, 25175, 640, 656, 744, 800, 0, 480, 490, 492, 525, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX} , /* 640x480@60 */ {MODEPREFIX, 40000, 800, 840, 968, 1056, 0, 600, 601, 605, 628, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX} , /* 880x600@60 */ {MODEPREFIX, 65000, 1024, 1048, 1184, 1344, 0, 768, 771, 777, 806, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX} , /* 1024x768@60 */ {MODEPREFIX, 81600, 1152, 1216, 1336, 1520, 0, 864, 865, 868, 895, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX} , /* 1152x864@60 */ {MODEPREFIX, 108000, 1280, 1328, 1440, 1688, 0, 1024, 1025, 1028, 1066, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX} , /* 1280x1024@60 */ {MODEPREFIX, 162000, 1600, 1664, 1856, 2160, 0, 1200, 1201, 1204, 1250, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX} , /* 1600x1200@60 */ {MODEPREFIX, 48960, 1024, 1064, 1168, 1312, 0, 600, 601, 604, 622, 0, V_NHSYNC | V_NVSYNC, MODESUFFIX} , /* 1024x600@60 wide panels */ }; /* Get the legacy panel size from VSA, and return the associated mode rec */ DisplayModePtr LXGetLegacyPanelMode(ScrnInfoPtr pScrni) { unsigned short reg = LX_READ_VG(0x00); unsigned char ret = (reg >> 8) & 0x07; if ((ret == 1 || ret == 5)) { reg = LX_READ_VG(0x02); ret = (reg >> 3) & 0x07; /* FIXME: 7 is reserved in default. We use this value to support * wide screen resolution 1024x600@80 now for panel. If you want to use * that resolution, please assign ret to 7 manually here: * "reg = 7" * The user can use this entry for other wide screen resolutions. */ if (ret < 8) { xf86DrvMsg(pScrni->scrnIndex, X_INFO, " VSA Panel Mode is: %dx%d, pixel clock freq(kHz) is %d\n", lx_panel_modes[ret].HDisplay, lx_panel_modes[ret].VDisplay, lx_panel_modes[ret].Clock); return &lx_panel_modes[ret]; } } return NULL; } /* Construct a moderec from the specified panel mode */ DisplayModePtr LXGetManualPanelMode(char *modestr) { int clock; int hactive, hsstart, hsend, htotal; int vactive, vsstart, vsend, vtotal; DisplayModePtr mode; char sname[32]; int ret = sscanf(modestr, "%d %d %d %d %d %d %d %d %d", &clock, &hactive, &hsstart, &hsend, &htotal, &vactive, &vsstart, &vsend, &vtotal); if (ret != 9) return NULL; mode = xnfcalloc(1, sizeof(DisplayModeRec)); if (mode == NULL) return NULL; sprintf(sname, "%dx%d", hactive, vactive); mode->name = xnfalloc(strlen(sname) + 1); strcpy(mode->name, sname); mode->type = M_T_DRIVER | M_T_PREFERRED; mode->Clock = clock; mode->HDisplay = hactive; mode->HSyncStart = hsstart; mode->HSyncEnd = hsend; mode->HTotal = htotal; mode->VDisplay = vactive; mode->VSyncStart = vsstart; mode->VSyncEnd = vsend; mode->VTotal = vtotal; mode->prev = mode->next = NULL; return mode; } xf86-video-geode-2.11.18/src/Makefile.in0000644000175000017500000007221312654445520014435 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright 2005 Adam Jackson. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # on the rights to use, copy, modify, merge, publish, distribute, sub # license, and/or sell copies of the Software, and to permit persons to whom # the Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice (including the next # paragraph) shall be included in all copies or substantial portions of the # Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # this is obnoxious: # -module lets us name the module exactly how we want # -avoid-version prevents gratuitous .0.0.0 version numbers on the end # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(geode_drv_ladir)" \ "$(DESTDIR)$(ztv_drv_ladir)" LTLIBRARIES = $(geode_drv_la_LTLIBRARIES) $(ztv_drv_la_LTLIBRARIES) geode_drv_la_LIBADD = am_geode_drv_la_OBJECTS = cimarron.lo durango.lo geode_common.lo \ geode_dcon.lo geode_ddc.lo geode_driver.lo geode_msr.lo \ gx_accel.lo gx_cursor.lo gx_driver.lo gx_randr.lo gx_regacc.lo \ gx_rotate.lo gx_video.lo lx_cursor.lo lx_display.lo \ lx_driver.lo lx_exa.lo lx_memory.lo lx_output.lo lx_panel.lo \ lx_video.lo panel.lo geode_drv_la_OBJECTS = $(am_geode_drv_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = geode_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(geode_drv_la_LDFLAGS) $(LDFLAGS) -o $@ ztv_drv_la_LIBADD = am__ztv_drv_la_SOURCES_DIST = z4l.c @BUILD_ZTV_TRUE@am_ztv_drv_la_OBJECTS = z4l.lo ztv_drv_la_OBJECTS = $(am_ztv_drv_la_OBJECTS) ztv_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(ztv_drv_la_LDFLAGS) $(LDFLAGS) -o $@ @BUILD_ZTV_TRUE@am_ztv_drv_la_rpath = -rpath $(ztv_drv_ladir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(geode_drv_la_SOURCES) $(ztv_drv_la_SOURCES) DIST_SOURCES = $(geode_drv_la_SOURCES) $(am__ztv_drv_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASE_CFLAGS = @BASE_CFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ M32_CFLAGS = @M32_CFLAGS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PANEL_CPPFLAGS = @PANEL_CPPFLAGS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ PCIACCESS_LIBS = @PCIACCESS_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ XEXT_CFLAGS = @XEXT_CFLAGS@ XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/cim \ -I$(top_srcdir)/src/gfx \ -I$(top_srcdir)/src/panel \ $(PANEL_CPPFLAGS) \ -DHAVE_GX \ -DHAVE_LX \ -DOPT_ACCEL AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS) $(M32_CFLAGS) geode_drv_la_LTLIBRARIES = geode_drv.la geode_drv_la_LDFLAGS = -module -avoid-version geode_drv_ladir = $(moduledir)/drivers geode_drv_la_SOURCES = \ cimarron.c \ cim_dev.h \ compat-api.h \ durango.c \ geode_blend.h \ geode_common.c \ geode_dcon.c \ geode_ddc.c \ geode_driver.c \ geode_fourcc.h \ geode.h \ geode_msr.c \ geode_pcirename.h \ gx_accel.c \ gx_cursor.c \ gx_driver.c \ gx_randr.c \ gx_regacc.c \ gx_rotate.c \ gx_video.c \ lx_cursor.c \ lx_display.c \ lx_driver.c \ lx_exa.c \ lx_memory.c \ lx_output.c \ lx_panel.c \ lx_video.c \ panel.c EXTRA_DIST = \ cim/cim_defs.h \ cim/cim_df.c \ cim/cim_filter.c \ cim/cim_gp.c \ cim/cim_init.c \ cim/cim_modes.c \ cim/cim_msr.c \ cim/cim_parm.h \ cim/cim_regs.h \ cim/cim_rtns.h \ cim/cim_version.h \ cim/cim_vg.c \ cim/cim_vip.c \ cim/cim_vop.c \ cim/doc/release.txt \ \ gfx/disp_gu1.c \ gfx/disp_gu2.c \ gfx/gfx_dcdr.c \ gfx/gfx_defs.h \ gfx/gfx_disp.c \ gfx/gfx_i2c.c \ gfx/gfx_init.c \ gfx/gfx_mode.h \ gfx/gfx_msr.c \ gfx/gfx_priv.h \ gfx/gfx_regs.h \ gfx/gfx_rndr.c \ gfx/gfx_rtns.h \ gfx/gfx_tv.c \ gfx/gfx_type.h \ gfx/gfx_vga.c \ gfx/gfx_vid.c \ gfx/gfx_vip.c \ gfx/history.h \ gfx/i2c_acc.c \ gfx/i2c_gpio.c \ gfx/init_gu1.c \ gfx/init_gu2.c \ gfx/msr_rdcl.c \ gfx/release.txt \ gfx/rndr_gu1.c \ gfx/rndr_gu2.c \ gfx/saa7114.c \ gfx/tv_1200.c \ gfx/tv_fs450.c \ gfx/tv_fs450.h \ gfx/vga_gu1.c \ gfx/vid_1200.c \ gfx/vid_5530.c \ gfx/vid_rdcl.c \ gfx/vip_1200.c \ \ panel/92xx.h \ panel/cen9211.c \ panel/cen9211.h \ panel/dora9211.c \ panel/dora9211.h \ panel/drac9210.c \ panel/drac9210.h \ panel/gx2_9211.c \ panel/gx2_9211.h \ panel/panel.c \ panel/panel.h \ panel/platform.c \ panel/pnl_bios.c \ panel/pnl_defs.h \ panel/pnl_init.c \ panel/readme.txt \ \ gx_vga.c \ lx_vga.c @BUILD_ZTV_TRUE@ztv_drv_la_LTLIBRARIES = ztv_drv.la @BUILD_ZTV_TRUE@ztv_drv_la_LDFLAGS = -module -avoid-version @BUILD_ZTV_TRUE@ztv_drv_ladir = $(moduledir)/drivers @BUILD_ZTV_TRUE@ztv_drv_la_SOURCES = z4l.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-geode_drv_laLTLIBRARIES: $(geode_drv_la_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(geode_drv_la_LTLIBRARIES)'; test -n "$(geode_drv_ladir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(geode_drv_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(geode_drv_ladir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(geode_drv_ladir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(geode_drv_ladir)"; \ } uninstall-geode_drv_laLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(geode_drv_la_LTLIBRARIES)'; test -n "$(geode_drv_ladir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(geode_drv_ladir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(geode_drv_ladir)/$$f"; \ done clean-geode_drv_laLTLIBRARIES: -test -z "$(geode_drv_la_LTLIBRARIES)" || rm -f $(geode_drv_la_LTLIBRARIES) @list='$(geode_drv_la_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-ztv_drv_laLTLIBRARIES: $(ztv_drv_la_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(ztv_drv_la_LTLIBRARIES)'; test -n "$(ztv_drv_ladir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(ztv_drv_ladir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ztv_drv_ladir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(ztv_drv_ladir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(ztv_drv_ladir)"; \ } uninstall-ztv_drv_laLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(ztv_drv_la_LTLIBRARIES)'; test -n "$(ztv_drv_ladir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(ztv_drv_ladir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(ztv_drv_ladir)/$$f"; \ done clean-ztv_drv_laLTLIBRARIES: -test -z "$(ztv_drv_la_LTLIBRARIES)" || rm -f $(ztv_drv_la_LTLIBRARIES) @list='$(ztv_drv_la_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } geode_drv.la: $(geode_drv_la_OBJECTS) $(geode_drv_la_DEPENDENCIES) $(EXTRA_geode_drv_la_DEPENDENCIES) $(AM_V_CCLD)$(geode_drv_la_LINK) -rpath $(geode_drv_ladir) $(geode_drv_la_OBJECTS) $(geode_drv_la_LIBADD) $(LIBS) ztv_drv.la: $(ztv_drv_la_OBJECTS) $(ztv_drv_la_DEPENDENCIES) $(EXTRA_ztv_drv_la_DEPENDENCIES) $(AM_V_CCLD)$(ztv_drv_la_LINK) $(am_ztv_drv_la_rpath) $(ztv_drv_la_OBJECTS) $(ztv_drv_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cimarron.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/durango.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geode_common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geode_dcon.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geode_ddc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geode_driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geode_msr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gx_accel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gx_cursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gx_driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gx_randr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gx_regacc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gx_rotate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gx_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_cursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_display.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_exa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_memory.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_output.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_panel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lx_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/panel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/z4l.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(geode_drv_ladir)" "$(DESTDIR)$(ztv_drv_ladir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-geode_drv_laLTLIBRARIES clean-libtool \ clean-ztv_drv_laLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-geode_drv_laLTLIBRARIES \ install-ztv_drv_laLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-geode_drv_laLTLIBRARIES \ uninstall-ztv_drv_laLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-geode_drv_laLTLIBRARIES clean-libtool \ clean-ztv_drv_laLTLIBRARIES cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-geode_drv_laLTLIBRARIES install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-ztv_drv_laLTLIBRARIES installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-geode_drv_laLTLIBRARIES \ uninstall-ztv_drv_laLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xf86-video-geode-2.11.18/src/geode_driver.c0000644000175000017500000003604712654445443015203 00000000000000/* * Copyright (c) 2006 Avanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * File Contents: This is the main module configures the interfacing * with the X server. The individual modules will be * loaded based upon the options selected from the * XF86Config. This file also has modules for finding * supported modes, turning on the modes based on options. * * Project: Amd Xfree Frame buffer device driver. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* Includes that are used by all drivers */ #include "xf86.h" #include "xf86_OSproc.h" #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86Resources.h" #endif #include "compiler.h" #include "xf86PciInfo.h" #include "xf86Pci.h" #include "xf86cmap.h" #include "geode.h" #define RC_MAX_DEPTH 24 #include "fb.h" /* Machine independent stuff */ #include "mipointer.h" #include "micmap.h" #include "vgaHW.h" #include "vbe.h" #ifdef DPMSExtension #include "globals.h" #include "opaque.h" #ifdef HAVE_XEXTPROTO_71 #include #else #define DPMS_SERVER #include #endif #endif /* DPMSExtension */ /* A few things all drivers should have */ #define GEODE_NAME "GEODE" #define GEODE_DRIVER_NAME "geode" #define GEODE_VERSION 4000 #define GEODE_VERSION_MAJOR PACKAGE_VERSION_MAJOR #define GEODE_VERSION_MINOR PACKAGE_VERSION_MINOR #define GEODE_VERSION_PATCH PACKAGE_VERSION_PATCHLEVEL /* Forward definitions */ static const OptionInfoRec *AmdAvailableOptions(int chipid, int busid); static void AmdIdentify(int); #ifdef XSERVER_LIBPCIACCESS static Bool AmdPciProbe(DriverPtr, int, struct pci_device *, intptr_t); #else static Bool AmdProbe(DriverPtr, int); #endif #ifdef XSERVER_LIBPCIACCESS static const struct pci_id_match amdDeviceMatch[] = { {PCI_VENDOR_ID_NS, PCI_CHIP_GEODEGX, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0}, {PCI_VENDOR_ID_AMD, PCI_CHIP_GEODELX, PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, 0}, {0, 0, 0} }; #endif /* XSERVER_LIBPCIACCESS */ /* driver record contains the functions needed by the server after loading * the driver module. */ _X_EXPORT DriverRec AMD = { GEODE_VERSION, "amd", AmdIdentify, #ifdef XSERVER_LIBPCIACCESS NULL, #else AmdProbe, #endif AmdAvailableOptions, NULL, 0, NULL, #ifdef XSERVER_LIBPCIACCESS amdDeviceMatch, AmdPciProbe #endif }; _X_EXPORT DriverRec GEODE = { GEODE_VERSION, "geode", AmdIdentify, #ifdef XSERVER_LIBPCIACCESS NULL, #else AmdProbe, #endif AmdAvailableOptions, NULL, 0, NULL, #ifdef XSERVER_LIBPCIACCESS amdDeviceMatch, AmdPciProbe #endif }; /* Advanced Micro Devices Chip Models */ typedef struct _DEVICE_MODEL { int DeviceId; int Model; } DeviceModel; DeviceModel ChipModel[] = { #ifdef HAVE_LX {PCI_CHIP_GEODELX, LX}, #endif #ifdef HAVE_GX {PCI_CHIP_GEODEGX, GX}, #endif {-1, 0} }; /* Supported chipsets */ SymTabRec GeodeChipsets[] = { #ifdef HAVE_LX {PCI_CHIP_GEODELX, "Geode LX"}, #endif #ifdef HAVE_GX {PCI_CHIP_GEODEGX, "Geode GX"}, #endif {-1, NULL} }; PciChipsets GeodePCIchipsets[] = { #ifdef HAVE_LX {PCI_CHIP_GEODELX, PCI_CHIP_GEODELX, RES_SHARED_VGA}, #endif #ifdef HAVE_GX {PCI_CHIP_GEODEGX, PCI_CHIP_GEODEGX, RES_SHARED_VGA}, #endif {-1, -1, RES_UNDEFINED}, }; #ifdef HAVE_LX OptionInfoRec LX_GeodeOptions[] = { {LX_OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE}, {LX_OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE}, {LX_OPTION_NOCOMPRESSION, "NoCompression", OPTV_BOOLEAN, {0}, FALSE}, {LX_OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE}, {LX_OPTION_TV_SUPPORT, "TV", OPTV_ANYSTR, {0}, FALSE}, {LX_OPTION_TV_OUTPUT, "TV_Output", OPTV_ANYSTR, {0}, FALSE}, {LX_OPTION_TV_OVERSCAN, "TVOverscan", OPTV_ANYSTR, {0}, FALSE}, {LX_OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE}, {LX_OPTION_NOPANEL, "NoPanel", OPTV_BOOLEAN, {0}, FALSE}, {LX_OPTION_EXA_SCRATCH_BFRSZ, "ExaScratch", OPTV_INTEGER, {0}, FALSE}, {LX_OPTION_FBSIZE, "FBSize", OPTV_INTEGER, {0}, FALSE}, {LX_OPTION_PANEL_MODE, "PanelMode", OPTV_STRING, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; #endif #ifdef HAVE_GX OptionInfoRec GX_GeodeOptions[] = { {GX_OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE}, {GX_OPTION_HW_CURSOR, "HWcursor", OPTV_BOOLEAN, {0}, FALSE}, {GX_OPTION_NOCOMPRESSION, "NoCompression", OPTV_BOOLEAN, {0}, FALSE}, {GX_OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE}, {GX_OPTION_ACCEL_METHOD, "AccelMethod", OPTV_STRING, {0}, FALSE}, {GX_OPTION_TV_SUPPORT, "TV", OPTV_ANYSTR, {0}, FALSE}, {GX_OPTION_TV_OUTPUT, "TV_Output", OPTV_ANYSTR, {0}, FALSE}, {GX_OPTION_TV_OVERSCAN, "TVOverscan", OPTV_ANYSTR, {0}, FALSE}, {GX_OPTION_ROTATE, "Rotate", OPTV_ANYSTR, {0}, FALSE}, {GX_OPTION_NOPANEL, "NoPanel", OPTV_BOOLEAN, {0}, FALSE}, {GX_OPTION_OSM_IMG_BUFS, "OSMImageBuffers", OPTV_INTEGER, {0}, FALSE}, {GX_OPTION_OSM_CLR_BUFS, "OSMColorExpBuffers", OPTV_INTEGER, {0}, FALSE}, {GX_OPTION_FBSIZE, "FBSize", OPTV_INTEGER, {0}, FALSE}, {GX_OPTION_PANEL_GEOMETRY, "PanelGeometry", OPTV_STRING, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; #endif OptionInfoRec no_GeodeOptions[] = { {-1, NULL, OPTV_NONE, {0}, FALSE} }; #ifdef XFree86LOADER /* Module loader interface */ static MODULESETUPPROTO(AmdSetup); static XF86ModuleVersionInfo AmdVersionRec = { "amd", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, GEODE_VERSION_MAJOR, GEODE_VERSION_MINOR, GEODE_VERSION_PATCH, ABI_CLASS_VIDEODRV, /* This is a video driver */ ABI_VIDEODRV_VERSION, MOD_CLASS_VIDEODRV, {0, 0, 0, 0} }; static XF86ModuleVersionInfo GeodeVersionRec = { "geode", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, GEODE_VERSION_MAJOR, GEODE_VERSION_MINOR, GEODE_VERSION_PATCH, ABI_CLASS_VIDEODRV, /* This is a video driver */ ABI_VIDEODRV_VERSION, MOD_CLASS_VIDEODRV, {0, 0, 0, 0} }; static pointer GeodeSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor) { static Bool init = FALSE; int flag = 0; #ifdef XSERVER_LIBPCIACCESS flag = HaveDriverFuncs; #endif if (init) { *ErrorMajor = LDR_ONCEONLY; return (pointer) NULL; } init = TRUE; xf86AddDriver(&GEODE, Module, flag); return (pointer) TRUE; } static pointer AmdSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor) { static Bool Initialised = FALSE; if (!Initialised) { Initialised = TRUE; xf86AddDriver(&AMD, Module, #ifdef XSERVER_LIBPCIACCESS HaveDriverFuncs #else 0 #endif ); return (pointer) TRUE; } /*The return value must be non-NULL on success */ if (ErrorMajor) *ErrorMajor = LDR_ONCEONLY; return NULL; } _X_EXPORT XF86ModuleData amdModuleData = { &AmdVersionRec, AmdSetup, NULL }; _X_EXPORT XF86ModuleData geodeModuleData = { &GeodeVersionRec, GeodeSetup, NULL }; #endif /*End of XFree86Loader */ /*------------------------------------------------------------------------- * AmdIdentify. * * Description : This function identify an Amdfamily version. * * * Parameters. * flags : flags may be used in PreInit* * * Returns : none * * Comments : none * *------------------------------------------------------------------------ */ static void AmdIdentify(int flags) { xf86PrintChipsets(GEODE_NAME, "Driver for AMD Geode Chipsets", GeodeChipsets); } /*---------------------------------------------------------------------------- * AmdAvailableOptions. * * Description :This function returns the geodeoptions set geodeoption * * Parameters. * chipid :This will identify the chipset. * busid :This will identify the PCI busid * * Returns :ptr to GeodeOptions. * * Comments :none * *---------------------------------------------------------------------------- */ static const OptionInfoRec * AmdAvailableOptions(int chipid, int busid) { switch (chipid) { #ifdef HAVE_LX case PCI_CHIP_GEODELX: return LX_GeodeOptions; #endif #ifdef HAVE_GX case PCI_CHIP_GEODEGX: return GX_GeodeOptions; #endif } return no_GeodeOptions; } #ifdef XSERVER_LIBPCIACCESS static Bool AmdPciProbe(DriverPtr driver, int entity_num, struct pci_device *device, intptr_t match_data) { ScrnInfoPtr scrn = NULL; ErrorF("AmdPciProbe: Probing for supported devices!\n"); scrn = xf86ConfigPciEntity(scrn, 0, entity_num, GeodePCIchipsets, NULL, NULL, NULL, NULL, NULL); if (scrn != NULL) { scrn->driverName = GEODE_DRIVER_NAME; scrn->driverVersion = GEODE_VERSION; scrn->name = GEODE_NAME; scrn->Probe = NULL; switch (device->device_id) { #ifdef HAVE_LX case PCI_CHIP_GEODELX: LXSetupChipsetFPtr(scrn); break; #endif #ifdef HAVE_GX case PCI_CHIP_GEODEGX: GXSetupChipsetFPtr(scrn); break; #endif default: ErrorF("AmdPciProbe: unknown device ID\n"); return FALSE; } } return scrn != NULL; } #else /* XSERVER_LIBPCIACCESS */ /*---------------------------------------------------------------------------- * AmdProbe. * * Description :This is to find that hardware is claimed by another * driver if not claim the slot & allocate ScreenInfoRec. * * Parameters. * drv :a pointer to the geode driver * flags :flags may passed to check the config and probe detect * * Returns :TRUE on success and FALSE on failure. * * Comments :This should be minimal probe and it should under no * circumstances change the state of the hardware.Don't do * any intiallizations other than the required * ScreenInforec. *---------------------------------------------------------------------------- */ static Bool AmdProbe(DriverPtr drv, int flags) { Bool foundScreen = FALSE; int numDevSections, numUsed; GDevPtr *devSections = NULL; int *usedChips = NULL; int i; void (*drvr_setup) (ScrnInfoPtr pScrni) = NULL; int CPUDetected; DEBUGMSG(1, (0, X_INFO, "AmdProbe: Probing for supported devices!\n")); /* * * Find the config file Device sections that match this * * driver, and return if there are none. */ if ((numDevSections = xf86MatchDevice(GEODE_NAME, &devSections)) <= 0) { DEBUGMSG(1, (0, X_INFO, "AmdProbe: failed 1!\n")); return FALSE; } DEBUGMSG(1, (0, X_INFO, "AmdProbe: Before MatchPciInstances!\n")); /* PCI BUS */ if (xf86GetPciVideoInfo()) { numUsed = xf86MatchPciInstances(GEODE_NAME, PCI_VENDOR_ID_NS, GeodeChipsets, GeodePCIchipsets, devSections, numDevSections, drv, &usedChips); if (numUsed <= 0) numUsed = xf86MatchPciInstances(GEODE_NAME, PCI_VENDOR_ID_AMD, GeodeChipsets, GeodePCIchipsets, devSections, numDevSections, drv, &usedChips); DEBUGMSG(1, (0, X_INFO, "AmdProbe: MatchPCI (%d)!\n", numUsed)); if (numUsed > 0) { if (flags & PROBE_DETECT) foundScreen = TRUE; else { /* Durango only supports one instance, */ /* so take the first one */ for (i = 0; i < numUsed; i++) { /* Allocate a ScrnInfoRec */ ScrnInfoPtr pScrni = NULL; EntityInfoPtr pEnt = xf86GetEntityInfo(usedChips[i]); PciChipsets *p_id; pScrni = xf86ConfigPciEntity(pScrni, 0, usedChips[i], GeodePCIchipsets, NULL, NULL, NULL, NULL, NULL); for (p_id = GeodePCIchipsets; p_id->numChipset != -1; p_id++) { if (pEnt->chipset == p_id->numChipset) { switch (pEnt->chipset) { #ifdef HAVE_LX case PCI_CHIP_GEODELX: CPUDetected = LX; drvr_setup = &LXSetupChipsetFPtr; break; #endif #ifdef HAVE_GX case PCI_CHIP_GEODEGX: CPUDetected = GX; drvr_setup = &GXSetupChipsetFPtr; break; #endif default: break; } break; } } free(pEnt); if (drvr_setup == NULL) return FALSE; DEBUGMSG(1, (0, X_INFO, "AmdProbe: CPUDetected %d!\n", CPUDetected)); pScrni->driverName = GEODE_DRIVER_NAME; pScrni->driverVersion = GEODE_VERSION; pScrni->name = GEODE_NAME; pScrni->Probe = AmdProbe; drvr_setup(pScrni); foundScreen = TRUE; } } } } if (usedChips) free(usedChips); if (devSections) free(devSections); DEBUGMSG(1, (0, X_INFO, "AmdProbe: result (%d)!\n", foundScreen)); return foundScreen; } #endif /* else XSERVER_LIBPCIACCESS */ xf86-video-geode-2.11.18/src/geode_ddc.c0000644000175000017500000001257512654445443014442 00000000000000/* Copyright (c) 2003-2007 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "xf86Modes.h" #include "compiler.h" #include "geode.h" #ifdef XSERVER_LIBPCIACCESS #include #endif /* GPIO Register defines from the CS5536 datasheet */ #define GPIO_OUT 0x00 #define GPIO_OUT_ENABLE 0x04 #define GPIO_OUT_AUX1 0x10 #define GPIO_IN_ENABLE 0x20 #define GPIO_IN 0x30 #define GPIO_IN_AUX1 0x34 /* The DDC pins are defined to be on GPIO pins 3 and 4 */ #define DDC_SCL_PIN (1 << 3) #define DDC_SDA_PIN (1 << 4) #define DDC_DATA_HIGH DDC_SDA_PIN #define DDC_DATA_LOW (DDC_SDA_PIN << 16) #define DDC_CLK_HIGH DDC_SCL_PIN #define DDC_CLK_LOW (DDC_SCL_PIN << 16) #define CS5536_ISA_DEVICE 0x20901022 #define CS5535_ISA_DEVICE 0x002b100b static unsigned short geode_gpio_iobase(void) { #ifdef XSERVER_LIBPCIACCESS struct pci_device *pci; /* The CS5536 GPIO device is always in the same slot: 00:0f.0 */ /* The CS5535 device should be in same slot as well */ pci = pci_device_find_by_slot(0, 0, 0xF, 0x0); if (pci == NULL) return 0; if (pci_device_probe(pci) != 0) return 0; /* The GPIO I/O address is in resource 1 */ return (unsigned short) pci->regions[1].base_addr; #else PCITAG Tag; Tag = pciFindFirst(CS5536_ISA_DEVICE, 0xFFFFFFFF); if (Tag == PCI_NOT_FOUND) { Tag = pciFindFirst(CS5535_ISA_DEVICE, 0xFFFFFFFF); if (Tag == PCI_NOT_FOUND) return 0; } /* The GPIO I/O address is in resource 1 */ return (unsigned short) (pciReadLong(Tag, 0x14) & ~1); #endif } static void geode_ddc_putbits(I2CBusPtr b, int scl, int sda) { unsigned long iobase = (unsigned long) b->DriverPrivate.ptr; unsigned long dat; dat = scl ? DDC_CLK_HIGH : DDC_CLK_LOW; dat |= sda ? DDC_DATA_HIGH : DDC_DATA_LOW; outl(iobase + GPIO_OUT, dat); } static void geode_ddc_getbits(I2CBusPtr b, int *scl, int *sda) { unsigned long iobase = (unsigned long) b->DriverPrivate.ptr; unsigned long dat = inl(iobase + GPIO_IN); *scl = (dat & DDC_CLK_HIGH) ? 1 : 0; *sda = (dat & DDC_DATA_HIGH) ? 1 : 0; } Bool GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name) { I2CBusPtr bus; unsigned int ddciobase; ddciobase = geode_gpio_iobase(); if (ddciobase == 0) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Could not find the GPIO I/O base\n"); return FALSE; } /* The GPIO pins for DDC are multiplexed with a * serial port. If that serial port is enabled, then * assume that there is no DDC on the board */ if ((inl(ddciobase + GPIO_IN_AUX1) & DDC_CLK_HIGH) || (inl(ddciobase + GPIO_OUT_AUX1) & DDC_DATA_HIGH)) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "GPIO pins are in serial mode. Assuming no DDC\n"); return FALSE; } outl(ddciobase + GPIO_OUT_ENABLE, DDC_DATA_HIGH | DDC_CLK_HIGH); outl(ddciobase + GPIO_IN_ENABLE, DDC_DATA_HIGH | DDC_CLK_HIGH); bus = xf86CreateI2CBusRec(); if (!bus) return FALSE; bus->BusName = name; bus->scrnIndex = pScrni->scrnIndex; bus->I2CGetBits = geode_ddc_getbits; bus->I2CPutBits = geode_ddc_putbits; bus->DriverPrivate.ptr = (void *) (unsigned long) (ddciobase); if (!xf86I2CBusInit(bus)) return FALSE; *ptr = bus; return TRUE; } static xf86MonPtr GeodeGetDDC(ScrnInfoPtr pScrni) { xf86MonPtr mon = NULL; I2CBusPtr bus; if (!GeodeI2CInit(pScrni, &bus, "CS5536 DDC BUS")) return NULL; mon = xf86DoEDID_DDC2(DDC_CALL(pScrni), bus); #if (XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,4,99,0,0)) if (mon) xf86DDCApplyQuirks(pScrni->scrnIndex, mon); #endif xf86DestroyI2CBusRec(bus, FALSE, FALSE); return mon; } void GeodeProbeDDC(ScrnInfoPtr pScrni, int index) { ConfiguredMonitor = GeodeGetDDC(pScrni); } xf86MonPtr GeodeDoDDC(ScrnInfoPtr pScrni, int index) { xf86MonPtr info = NULL; info = GeodeGetDDC(pScrni); xf86PrintEDID(info); xf86SetDDCproperties(pScrni, info); return info; } xf86-video-geode-2.11.18/src/geode_msr.c0000644000175000017500000001011612654445443014476 00000000000000/* * Copyright (c) 2008 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #ifdef __OpenBSD__ #include #include #endif #ifdef __FreeBSD__ #include #include #endif #include "os.h" #include "geode.h" #ifdef __OpenBSD__ #define _PATH_MSRDEV "/dev/amdmsr" #define X_PRIVSEP #elif defined __FreeBSD__ #define _PATH_MSRDEV "/dev/cpuctl0" #else #define _PATH_MSRDEV "/dev/cpu/0/msr" #endif static int _msr_open(void) { static int msrfd = 0; if (msrfd == 0) { #ifdef X_PRIVSEP msrfd = priv_open_device(_PATH_MSRDEV); #else msrfd = open(_PATH_MSRDEV, O_RDWR); #endif if (msrfd == -1) FatalError("Unable to open %s: %s\n", _PATH_MSRDEV, strerror(errno)); } return msrfd; } int GeodeReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi) { #ifdef __OpenBSD__ struct amdmsr_req req; int fd = _msr_open(); req.addr = addr; if (ioctl(fd, RDMSR, &req) == -1) FatalError("Unable to read MSR at address %0x06x: %s\n", addr, strerror(errno)); *hi = req.val >> 32; *lo = req.val & 0xffffffff; #elif defined __FreeBSD__ cpuctl_msr_args_t args; int fd = _msr_open(); args.msr = addr; if (ioctl(fd, CPUCTL_RDMSR, &args) == -1) FatalError("Unable to read MSR at address %0x06x: %s\n", addr, strerror(errno)); *hi = args.data >> 32; *lo = args.data & 0xffffffff; #else unsigned int data[2]; int fd = _msr_open(); int ret; if (fd == -1) return -1; ret = lseek(fd, (off_t) addr, SEEK_SET); if (ret == -1) return -1; ret = read(fd, (void *) data, sizeof(data)); if (ret != 8) return -1; *hi = data[1]; *lo = data[0]; #endif return 0; } int GeodeWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi) { #ifdef __OpenBSD__ struct amdmsr_req req; int fd = _msr_open(); req.addr = addr; req.val = (u_int64_t) hi << 32 | (u_int64_t)lo; if (ioctl(fd, WRMSR, &req) == -1) FatalError("Unable to write MSR at address 0x%06x: %s\n", addr, strerror(errno)); #elif defined __FreeBSD__ cpuctl_msr_args_t args; int fd = _msr_open(); args.msr = addr; args.data = (u_int64_t) hi << 32 | (u_int64_t)lo; if (ioctl(fd, CPUCTL_WRMSR, &args) == -1) FatalError("Unable to write MSR at address 0x%06x: %s\n", addr, strerror(errno)); #else unsigned int data[2]; int fd = _msr_open(); if (fd == -1) return -1; if (lseek(fd, (off_t) addr, SEEK_SET) == -1) return -1; data[0] = lo; data[1] = hi; if (write(fd, (void *) data, 8) != 8) return -1; #endif return 0; } xf86-video-geode-2.11.18/src/panel.c0000644000175000017500000000416712654445443013642 00000000000000/* Copyright (c) 2003-2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contailns the panel include files and * external pointer to the hardware. * * Project: Geode Xfree Frame buffer device driver. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef __KERNEL__ #include #include #endif #include "panel.h" #include "gfx_defs.h" #include "geode.h" #define PLATFORM_DYNAMIC 1 /* runtime selection */ #define PLATFORM_DRACO 0 /* Draco + 9210 */ #define PLATFORM_CENTAURUS 1 /* Centaurus + 9211 RevA */ #define PLATFORM_DORADO 1 /* Dorado + 9211 RevC */ #define PLATFORM_GX2BASED 1 /* Redcloud */ unsigned char *XpressROMPtr; #include "pnl_init.c" #include "pnl_bios.c" xf86-video-geode-2.11.18/src/lx_memory.c0000644000175000017500000002247012654445443014553 00000000000000/* Copyright (c) 2008 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #if HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "geode.h" #include "cim/cim_regs.h" #define ALIGN(x,y) (((x) + (y) - 1) / (y) * (y)) #define LX_CB_PITCH 544 /* Geode offscreen memory allocation functions. This is overengineered for the simple hardware that we have, but there are multiple functions that may want to independently allocate and free memory (crtc->shadow_alloc and Xv). This provides a semi-robust mechanism for doing that. */ /* Return the number of free bytes */ unsigned int GeodeOffscreenFreeSize(GeodeRec * pGeode) { GeodeMemPtr ptr = pGeode->offscreenList; if (ptr == NULL) return pGeode->offscreenSize; for (; ptr->next; ptr = ptr->next); return (pGeode->offscreenStart + pGeode->offscreenSize) - (ptr->offset + ptr->size); } void GeodeFreeOffscreen(GeodeRec * pGeode, GeodeMemPtr ptr) { /* There is a clear memory leak here, but * but it is unlikely that the first block of * "allocated" memory is going to be released * individually. */ if (ptr->prev == NULL) pGeode->offscreenList = ptr->next; else ptr->prev->next = ptr->next; if (ptr->next) ptr->next->prev = ptr->prev; free(ptr); } /* Allocate the "rest" of the offscreen memory - this is for situations where we have very little video memory, and we want to take as much of it as we can for EXA */ static GeodeMemPtr GeodeAllocRemainder(GeodeRec * pGeode) { GeodeMemPtr nptr, ptr = pGeode->offscreenList; if (!pGeode->offscreenList) { pGeode->offscreenList = calloc(1, sizeof(*nptr)); pGeode->offscreenList->offset = pGeode->offscreenStart; pGeode->offscreenList->size = pGeode->offscreenSize; pGeode->offscreenList->next = NULL; pGeode->offscreenList->prev = NULL; return pGeode->offscreenList; } /* Go to the end of the list of allocated stuff */ for (; ptr->next; ptr = ptr->next); nptr = calloc(1, sizeof(*nptr)); nptr->offset = ptr->offset + ptr->size; nptr->size = pGeode->offscreenSize - (nptr->offset - pGeode->offscreenStart); nptr->next = ptr->next; nptr->prev = ptr; ptr->next = nptr; return nptr; } /* Allocate 'size' bytes of offscreen memory. */ GeodeMemPtr GeodeAllocOffscreen(GeodeRec * pGeode, int size, int align) { GeodeMemPtr ptr = pGeode->offscreenList; GeodeMemPtr nptr; unsigned int offset; if (!pGeode->offscreenList) { if (size > pGeode->offscreenSize) return NULL; offset = ALIGN(pGeode->offscreenStart, align); pGeode->offscreenList = calloc(1, sizeof(*nptr)); pGeode->offscreenList->offset = offset; pGeode->offscreenList->size = size; pGeode->offscreenList->next = NULL; return pGeode->offscreenList; } while (ptr) { unsigned int gap; if (ptr->next == NULL) gap = pGeode->offscreenSize + pGeode->offscreenStart; else gap = ptr->next->offset; gap = gap - (ptr->offset + ptr->size); gap = ALIGN(gap, align); if (size < gap) { offset = ptr->offset + ptr->size; offset = ALIGN(ptr->offset + ptr->size, align); nptr = calloc(1, sizeof(*nptr)); nptr->offset = offset; nptr->size = size; nptr->next = ptr->next; nptr->prev = ptr; ptr->next = nptr; return nptr; } ptr = ptr->next; } return NULL; } /* Carve out the space for the visible screen, and carve out the usual suspects that need offscreen memory */ #define MAX(a,b) ((a) > (b) ? (a) : (b)) void LXInitOffscreen(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); unsigned int fbavail; GeodeMemPtr ptr; /* The scratch buffer is always used */ fbavail = pGeode->FBAvail - GP3_SCRATCH_BUFFER_SIZE; pGeode->displaySize = MAX(pScrni->virtualX, pScrni->virtualY) * pGeode->Pitch; pGeode->offscreenStart = pGeode->displaySize; pGeode->offscreenSize = fbavail - pGeode->displaySize; /* Allocate the usual memory suspects */ if (pGeode->tryCompression) { int size = pScrni->virtualY * LX_CB_PITCH; /* The compression buffer needs to be 16 byte aligned */ ptr = GeodeAllocOffscreen(pGeode, size, 16); if (ptr != NULL) { pGeode->CBData.compression_offset = ptr->offset; pGeode->CBData.size = LX_CB_PITCH; pGeode->CBData.pitch = LX_CB_PITCH; pGeode->Compression = TRUE; } else { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Not enough memory for compression\n"); pGeode->Compression = FALSE; } } if (pGeode->tryHWCursor) { ptr = GeodeAllocOffscreen(pGeode, LX_CURSOR_HW_WIDTH * 4 * LX_CURSOR_HW_HEIGHT, 4); if (ptr != NULL) { pGeode->CursorStartOffset = ptr->offset; pGeode->HWCursor = TRUE; } else { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Not enough memory for the hardware cursor\n"); pGeode->HWCursor = FALSE; } } if (!pGeode->NoAccel && pGeode->pExa) { int size; /* Try to get the scratch buffer for blending */ pGeode->exaBfrOffset = 0; if (pGeode->exaBfrSz > 0) { ptr = GeodeAllocOffscreen(pGeode, pGeode->exaBfrSz, 4); if (ptr != NULL) pGeode->exaBfrOffset = ptr->offset; } pGeode->pExa->offScreenBase = 0; pGeode->pExa->memorySize = 0; /* This might cause complaints - in order to avoid using xorg.conf as much as possible, we make assumptions about what a "default" memory map would look like. After discussion, we agreed that the default driver should assume the user will want to use rotation and video overlays, and EXA will get whatever is leftover. */ /* Get the amount of offscreen memory still left */ size = GeodeOffscreenFreeSize(pGeode); /* Align the size to a K boundary */ size &= ~1023; /* Allocate the EXA offscreen space */ ptr = GeodeAllocOffscreen(pGeode, size, 4); if (ptr == NULL) { /* If we couldn't allocate what we wanted, * then allocate whats left */ ptr = GeodeAllocRemainder(pGeode); } if (ptr != NULL) { pGeode->pExa->offScreenBase = ptr->offset; pGeode->pExa->memorySize = ptr->offset + ptr->size; } } /* Show the memory map for diagnostic purposes */ xf86DrvMsg(pScrni->scrnIndex, X_INFO, "LX video memory:\n"); xf86DrvMsg(pScrni->scrnIndex, X_INFO, " Display: 0x%x bytes\n", pGeode->displaySize); if (pGeode->Compression) xf86DrvMsg(pScrni->scrnIndex, X_INFO, " Compression: 0x%x bytes\n", pScrni->virtualY * LX_CB_PITCH); if (pGeode->HWCursor) xf86DrvMsg(pScrni->scrnIndex, X_INFO, " Cursor: 0x%x bytes\n", LX_CURSOR_HW_WIDTH * 4 * LX_CURSOR_HW_HEIGHT); if (pGeode->exaBfrSz) xf86DrvMsg(pScrni->scrnIndex, X_INFO, " ExaBfrSz: 0x%x bytes\n", pGeode->exaBfrSz); if (pGeode->pExa && pGeode->pExa->offScreenBase) xf86DrvMsg(pScrni->scrnIndex, X_INFO, " EXA: 0x%x bytes\n", (unsigned int) (pGeode->pExa->memorySize - pGeode->pExa->offScreenBase)); xf86DrvMsg(pScrni->scrnIndex, X_INFO, " FREE: 0x%x bytes\n", GeodeOffscreenFreeSize(pGeode)); } /* Called as we go down, so blitz everybody */ void GeodeCloseOffscreen(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); GeodeMemPtr ptr = pGeode->offscreenList; GeodeMemPtr nptr; while (ptr) { nptr = ptr->next; free(ptr); ptr = nptr; } pGeode->offscreenList = NULL; } xf86-video-geode-2.11.18/src/geode_blend.h0000644000175000017500000000560612654445443014776 00000000000000/* * Copyright (c) 2007 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #ifndef AMD_BLEND_H_ #define AMD_BLEND_H_ #define GEODEPTR_FROM_PIXMAP(x) \ GEODEPTR(xf86Screens[(x)->drawable.pScreen->myNum]) #define GEODEPTR_FROM_SCREEN(x) \ GEODEPTR(xf86Screens[(x)->myNum]) #define GEODEPTR_FROM_PICTURE(x) \ GEODEPTR(xf86Screens[(x)->pDrawable->pScreen->myNum]) #define usesPasses(op) ((( \ ( 1 << PictOpAtop ) | \ ( 1 << PictOpAtopReverse ) | \ ( 1 << PictOpXor ) | \ 0 ) >> (op)) & 1) /* pass1 or pass2 */ #define usesSrcAlpha(op) ((( \ ( 1 << PictOpOver ) | \ ( 1 << PictOpInReverse ) | \ ( 1 << PictOpOutReverse ) | \ ( 1 << PictOpAtop ) | \ ( 1 << PictOpAtopReverse ) | \ ( 1 << PictOpXor ) | \ 0 ) >> (op)) & 1) /* pass1 or pass2 */ #define usesDstAlpha(op) ((( \ ( 1 << PictOpOverReverse ) | \ ( 1 << PictOpIn ) | \ ( 1 << PictOpOut ) | \ ( 1 << PictOpAtop ) | \ ( 1 << PictOpAtopReverse ) | \ ( 1 << PictOpXor ) | \ 0 ) >> (op)) & 1) /* non 2 pass ops */ #define usesChanB0(op) ((( \ ( 1 << PictOpOver ) | \ ( 1 << PictOpOverReverse ) | \ ( 1 << PictOpIn ) | \ ( 1 << PictOpInReverse ) | \ ( 1 << PictOpOut ) | \ ( 1 << PictOpOutReverse ) | \ ( 1 << PictOpAdd ) | \ 0 ) >> (op)) & 1) /* pass 1 ops */ #define usesChanB1(op) ((( \ ( 1 << PictOpAtop ) | \ ( 1 << PictOpAtopReverse ) | \ ( 1 << PictOpXor ) | \ 0 ) >> (op)) & 1) /* pass 2 ops */ #define usesChanB2(op) ((( \ ( 1 << PictOpAtop ) | \ ( 1 << PictOpAtopReverse ) | \ ( 1 << PictOpXor ) | \ 0 ) >> (op)) & 1) #endif xf86-video-geode-2.11.18/src/durango.c0000644000175000017500000001716712654445443014206 00000000000000/* Copyright (c) 2003-2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* The previous version of this file was way more complex then it should have been - remove the unnessesary #defines and routines, and concentrate on Linux for now. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include /* ErrorF() */ /* Compiler options */ #define GFX_DISPLAY_GU1 0 /* 1st generation display controller */ #define GFX_DISPLAY_GU2 1 /* 2nd generation display controller */ #define GFX_INIT_DYNAMIC 0 /* runtime selection */ #define GFX_INIT_GU1 0 /* SC1200/GX1 */ #define GFX_INIT_GU2 1 /* GX */ #define GFX_MSR_DYNAMIC 0 /* runtime selection */ #define GFX_MSR_REDCLOUD 1 /* GX */ #define GFX_2DACCEL_DYNAMIC 0 /* runtime selection */ #define GFX_2DACCEL_GU1 0 /* 1st generation 2D accelerator */ #define GFX_2DACCEL_GU2 1 /* 2nd generation 2D accelerator */ #define GFX_VIDEO_DYNAMIC 0 /* runtime selection */ #define GFX_VIDEO_CS5530 0 /* support for CS5530 */ #define GFX_VIDEO_SC1200 0 /* support for SC1200 */ #define GFX_VIDEO_REDCLOUD 1 /* support for GX */ #define GFX_VIP_DYNAMIC 0 /* runtime selection */ #define GFX_VIP_SC1200 0 /* support for SC1200 */ #define GFX_DECODER_DYNAMIC 0 /* runtime selection */ #define GFX_DECODER_SAA7114 0 /* Philips SAA7114 decoder */ #define GFX_TV_DYNAMIC 0 /* runtime selection */ #define GFX_TV_FS451 0 /* Focus Enhancements FS450 */ #define GFX_TV_SC1200 0 /* SC1200 integrated TV encoder */ #define GFX_I2C_DYNAMIC 0 /* runtime selection */ #define GFX_I2C_ACCESS 0 /* support for ACCESS.BUS */ #define GFX_I2C_GPIO 0 /* support for CS5530 GPIOs */ #define GFX_VGA_DYNAMIC 0 /* runtime selection */ #define GFX_VGA_GU1 0 /* 1st generation graphics unit */ #define FB4MB 1 /* Set to use 4Mb vid ram for Pyramid */ #define GFX_NO_IO_IN_WAIT_MACROS 1 /* Set to remove I/O accesses in GP */ #define GFX_READ_ROUTINES 1 #include "gfx_rtns.h" #include "gfx_priv.h" #include "gfx_regs.h" #include "gfx_defs.h" unsigned char *gfx_virt_regptr = (unsigned char *) 0x40000000; unsigned char *gfx_virt_fbptr = (unsigned char *) 0x40800000; unsigned char *gfx_virt_vidptr = (unsigned char *) 0x40010000; unsigned char *gfx_virt_vipptr = (unsigned char *) 0x40015000; unsigned char *gfx_virt_spptr = (unsigned char *) 0x40000000; unsigned char *gfx_virt_gpptr = (unsigned char *) 0x40000000; unsigned char *gfx_phys_regptr = (unsigned char *) 0x40000000; unsigned char *gfx_phys_fbptr = (unsigned char *) 0x40800000; unsigned char *gfx_phys_vidptr = (unsigned char *) 0x40010000; unsigned char *gfx_phys_vipptr = (unsigned char *) 0x40015000; #define INB(port) inb(port) #define INW(port) inw(port) #define IND(port) inl(port) #define OUTB(port,data) outb(port, data) #define OUTW(port,data) outw(port, data) #define OUTD(port,data) outl(port, data) /* Squash warnings */ unsigned char gfx_inb(unsigned short); unsigned short gfx_inw(unsigned short); unsigned long gfx_ind(unsigned short); void gfx_outb(unsigned short, unsigned char); void gfx_outw(unsigned short, unsigned short); void gfx_outd(unsigned short, unsigned long); inline unsigned char gfx_inb(unsigned short port) { return inb(port); } inline unsigned short gfx_inw(unsigned short port) { return inw(port); } inline unsigned long gfx_ind(unsigned short port) { return inl(port); } inline void gfx_outb(unsigned short port, unsigned char data) { outb(port, data); } inline void gfx_outw(unsigned short port, unsigned short data) { outw(port, data); } inline void gfx_outd(unsigned short port, unsigned long data) { outl(port, data); } /* These routines use VSA to read the MSRs - these are a second resort to the Linux MSR method */ #define vsa_msr_read(msr,adr,high,low) \ __asm__ __volatile__( \ " mov $0x0AC1C, %%edx\n" \ " mov $0xFC530007, %%eax\n" \ " out %%eax,%%dx\n" \ " add $2,%%dl\n" \ " in %%dx, %%ax" \ : "=a" (*(low)), "=d" (*(high)) \ : "c" (msr | adr)) #define vsa_msr_write(msr,adr,high,low) \ { int d0, d1, d2, d3, d4; \ __asm__ __volatile__( \ " push %%ebx\n" \ " mov $0x0AC1C, %%edx\n" \ " mov $0xFC530007, %%eax\n" \ " out %%eax,%%dx\n" \ " add $2,%%dl\n" \ " mov %6, %%ebx\n" \ " mov %7, %0\n" \ " mov %5, %3\n" \ " xor %2, %2\n" \ " xor %1, %1\n" \ " out %%ax, %%dx\n" \ " pop %%ebx\n" \ : "=a"(d0),"=&D"(d1),"=&S"(d2), \ "=c"(d3),"=d"(d4) \ : "1"(msr | adr),"2"(*(high)),"3"(*(low))); \ } extern int GeodeWriteMSR(unsigned long, unsigned long, unsigned long); extern int GeodeReadMSR(unsigned long, unsigned long *, unsigned long *); void gfx_msr_asm_write(unsigned short reg, unsigned long addr, unsigned long *hi, unsigned long *lo) { static int msr_method = 0; if (msr_method == 0) { if (!GeodeWriteMSR(addr | reg, *lo, *hi)) return; msr_method = 1; } /* This is the fallback VSA method - not preferred */ vsa_msr_write(reg, addr, hi, lo); } void gfx_msr_asm_read(unsigned short reg, unsigned long addr, unsigned long *hi, unsigned long *lo) { static int msr_method = 0; if (msr_method == 0) { if (!GeodeReadMSR(addr | reg, lo, hi)) return; ErrorF("Unable to read the MSR - reverting to the VSA method.\n"); msr_method = 1; } /* This is the fallback VSA method - not preferred */ vsa_msr_read(reg, addr, hi, lo); } #include "gfx_init.c" #include "gfx_msr.c" #include "gfx_rndr.c" #include "gfx_mode.h" #include "gfx_disp.c" #include "gfx_vid.c" #include "gfx_vip.c" #include "gfx_dcdr.c" #include "gfx_i2c.c" #include "gfx_tv.c" #include "gfx_vga.c" xf86-video-geode-2.11.18/src/Makefile.am0000644000175000017500000001022712654445443014425 00000000000000# Copyright 2005 Adam Jackson. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # on the rights to use, copy, modify, merge, publish, distribute, sub # license, and/or sell copies of the Software, and to permit persons to whom # the Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice (including the next # paragraph) shall be included in all copies or substantial portions of the # Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # this is obnoxious: # -module lets us name the module exactly how we want # -avoid-version prevents gratuitous .0.0.0 version numbers on the end # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. AM_CPPFLAGS = \ -I$(top_srcdir)/src/cim \ -I$(top_srcdir)/src/gfx \ -I$(top_srcdir)/src/panel \ $(PANEL_CPPFLAGS) \ -DHAVE_GX \ -DHAVE_LX \ -DOPT_ACCEL AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS) $(M32_CFLAGS) geode_drv_la_LTLIBRARIES = geode_drv.la geode_drv_la_LDFLAGS = -module -avoid-version geode_drv_ladir = $(moduledir)/drivers geode_drv_la_SOURCES = \ cimarron.c \ cim_dev.h \ compat-api.h \ durango.c \ geode_blend.h \ geode_common.c \ geode_dcon.c \ geode_ddc.c \ geode_driver.c \ geode_fourcc.h \ geode.h \ geode_msr.c \ geode_pcirename.h \ gx_accel.c \ gx_cursor.c \ gx_driver.c \ gx_randr.c \ gx_regacc.c \ gx_rotate.c \ gx_video.c \ lx_cursor.c \ lx_display.c \ lx_driver.c \ lx_exa.c \ lx_memory.c \ lx_output.c \ lx_panel.c \ lx_video.c \ panel.c EXTRA_DIST = \ cim/cim_defs.h \ cim/cim_df.c \ cim/cim_filter.c \ cim/cim_gp.c \ cim/cim_init.c \ cim/cim_modes.c \ cim/cim_msr.c \ cim/cim_parm.h \ cim/cim_regs.h \ cim/cim_rtns.h \ cim/cim_version.h \ cim/cim_vg.c \ cim/cim_vip.c \ cim/cim_vop.c \ cim/doc/release.txt \ \ gfx/disp_gu1.c \ gfx/disp_gu2.c \ gfx/gfx_dcdr.c \ gfx/gfx_defs.h \ gfx/gfx_disp.c \ gfx/gfx_i2c.c \ gfx/gfx_init.c \ gfx/gfx_mode.h \ gfx/gfx_msr.c \ gfx/gfx_priv.h \ gfx/gfx_regs.h \ gfx/gfx_rndr.c \ gfx/gfx_rtns.h \ gfx/gfx_tv.c \ gfx/gfx_type.h \ gfx/gfx_vga.c \ gfx/gfx_vid.c \ gfx/gfx_vip.c \ gfx/history.h \ gfx/i2c_acc.c \ gfx/i2c_gpio.c \ gfx/init_gu1.c \ gfx/init_gu2.c \ gfx/msr_rdcl.c \ gfx/release.txt \ gfx/rndr_gu1.c \ gfx/rndr_gu2.c \ gfx/saa7114.c \ gfx/tv_1200.c \ gfx/tv_fs450.c \ gfx/tv_fs450.h \ gfx/vga_gu1.c \ gfx/vid_1200.c \ gfx/vid_5530.c \ gfx/vid_rdcl.c \ gfx/vip_1200.c \ \ panel/92xx.h \ panel/cen9211.c \ panel/cen9211.h \ panel/dora9211.c \ panel/dora9211.h \ panel/drac9210.c \ panel/drac9210.h \ panel/gx2_9211.c \ panel/gx2_9211.h \ panel/panel.c \ panel/panel.h \ panel/platform.c \ panel/pnl_bios.c \ panel/pnl_defs.h \ panel/pnl_init.c \ panel/readme.txt \ \ gx_vga.c \ lx_vga.c if BUILD_ZTV ztv_drv_la_LTLIBRARIES = ztv_drv.la ztv_drv_la_LDFLAGS = -module -avoid-version ztv_drv_ladir = $(moduledir)/drivers ztv_drv_la_SOURCES = z4l.c endif BUILD_ZTV xf86-video-geode-2.11.18/src/geode_fourcc.h0000644000175000017500000000577512654445443015202 00000000000000/* Xfree video macro definitions. * * Copyright (c) 2003-2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #ifndef AMD_FOURCC_H_ #define AMD_FOURCC_H_ #define FOURCC_Y2YU 0x55593259 #define XVIMAGE_Y2YU \ { \ FOURCC_Y2YU, \ XvYUV, \ LSBFirst, \ {'Y','2','Y','U', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 16, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 2, 2, \ 1, 1, 1, \ {'Y','V','Y','U', \ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \ XvTopToBottom \ } #define FOURCC_YVYU 0x55595659 #define XVIMAGE_YVYU \ { \ FOURCC_YVYU, \ XvYUV, \ LSBFirst, \ {'Y','V','Y','U', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 16, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 8, 8, \ 1, 2, 2, \ 1, 1, 1, \ {'Y','V','Y','U', \ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \ XvTopToBottom \ } #define FOURCC_Y800 0x30303859 #define XVIMAGE_Y800 \ { \ FOURCC_Y800, \ XvYUV, \ LSBFirst, \ {'Y','8','0','0', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 8, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 0, 0, \ 1, 0, 0, \ 1, 0, 0, \ {'Y','8','0','0', \ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \ XvTopToBottom \ } /* Borrowed from Trident */ #define FOURCC_RGB565 0x36315652 #define XVIMAGE_RGB565 \ { \ FOURCC_RGB565, \ XvRGB,\ LSBFirst,\ {'R','V','1','6',\ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},\ 16,\ XvPacked,\ 1,\ 16, 0xF800, 0x07E0, 0x001F,\ 0, 0, 0,\ 0, 0, 0,\ 0, 0, 0,\ {'R','V','B',0,\ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},\ XvTopToBottom\ } #endif xf86-video-geode-2.11.18/src/lx_cursor.c0000644000175000017500000000431712654445443014560 00000000000000/* Copyright (c) 2003-2008 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "xf86i2c.h" #include "xf86Crtc.h" #include "geode.h" Bool LXCursorInit(ScreenPtr pScrn) { return xf86_cursors_init(pScrn, LX_CURSOR_MAX_WIDTH, LX_CURSOR_MAX_HEIGHT, HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | HARDWARE_CURSOR_INVERT_MASK | HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 | HARDWARE_CURSOR_ARGB); } void LXLoadARGBCursorImage(ScrnInfoPtr pScrni, unsigned char *src) { GeodeRec *pGeode = GEODEPTR(pScrni); vg_set_color_cursor_shape(pGeode->CursorStartOffset, src, LX_CURSOR_MAX_WIDTH, LX_CURSOR_MAX_HEIGHT, LX_CURSOR_MAX_WIDTH * 4, 0, 0); } xf86-video-geode-2.11.18/src/gx_randr.c0000644000175000017500000002610012654445443014336 00000000000000/* Originally derived from the Intel example * Copyright (C) 2002 Keith Packard, member of The XFree86 Project, Inc. * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "xf86Modes.h" #include "os.h" #include "globals.h" #include "xf86.h" #include "xf86Priv.h" #include "xf86DDC.h" #include "xf86Module.h" #include "mipointer.h" #include "windowstr.h" #include "inputstr.h" #include #include #include "geode.h" static int GXRandRGeneration; typedef struct _GXRandRInfo { int virtualX; int virtualY; int mmWidth; int mmHeight; int maxX; int maxY; Rotation rotation; /* current mode */ Rotation supported_rotations; /* driver supported */ } XF86RandRInfoRec, *XF86RandRInfoPtr; #if HAS_DEVPRIVATEKEYREC static DevPrivateKeyRec GXRandRIndex; #else static int GXRandRIndex; #endif #define OLD_VIDEODRV_INTERFACE (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4) #if OLD_VIDEODRV_INTERFACE #define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[GXRandRIndex].ptr) #define XF86RANDRSET(p, v) (p)->devPrivates[GXRandRIndex].ptr = v #else #define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \ dixLookupPrivate(&(p)->devPrivates, &GXRandRIndex)) #define XF86RANDRSET(p, v) dixSetPrivate(&(p)->devPrivates, &GXRandRIndex, v) #endif static int GXRandRModeRefresh(DisplayModePtr mode) { if (mode->VRefresh) return (int) (mode->VRefresh + 0.5); else return (int) (mode->Clock * 1000.0 / mode->HTotal / mode->VTotal + 0.5); } static Bool GXRandRGetInfo(ScreenPtr pScreen, Rotation * rotations) { RRScreenSizePtr pSize; ScrnInfoPtr pScrni = XF86SCRNINFO(pScreen); XF86RandRInfoPtr pRandr = XF86RANDRINFO(pScreen); DisplayModePtr mode; int refresh0 = 60; int maxX = 0, maxY = 0; *rotations = pRandr->supported_rotations; if (pRandr->virtualX == -1 || pRandr->virtualY == -1) { pRandr->virtualX = pScrni->virtualX; pRandr->virtualY = pScrni->virtualY; } for (mode = pScrni->modes;; mode = mode->next) { int refresh = GXRandRModeRefresh(mode); if (pRandr->maxX == 0 || pRandr->maxY == 0) { if (maxX < mode->HDisplay) maxX = mode->HDisplay; if (maxY < mode->VDisplay) maxY = mode->VDisplay; } if (mode == pScrni->modes) refresh0 = refresh; pSize = RRRegisterSize(pScreen, mode->HDisplay, mode->VDisplay, pRandr->mmWidth, pRandr->mmHeight); if (!pSize) return FALSE; RRRegisterRate(pScreen, pSize, refresh); if (mode == pScrni->currentMode && mode->HDisplay == pScrni->virtualX && mode->VDisplay == pScrni->virtualY) RRSetCurrentConfig(pScreen, pRandr->rotation, refresh, pSize); if (mode->next == pScrni->modes) break; } if (pRandr->maxX == 0 || pRandr->maxY == 0) { pRandr->maxX = maxX; pRandr->maxY = maxY; } if (pScrni->currentMode->HDisplay != pScrni->virtualX || pScrni->currentMode->VDisplay != pScrni->virtualY) { mode = pScrni->modes; pSize = RRRegisterSize(pScreen, pRandr->virtualX, pRandr->virtualY, pRandr->mmWidth, pRandr->mmHeight); if (!pSize) return FALSE; RRRegisterRate(pScreen, pSize, refresh0); if (pScrni->virtualX == pRandr->virtualX && pScrni->virtualY == pRandr->virtualY) { RRSetCurrentConfig(pScreen, pRandr->rotation, refresh0, pSize); } } return TRUE; } static Bool GXRandRSetMode(ScreenPtr pScreen, DisplayModePtr mode, Bool useVirtual, int mmWidth, int mmHeight) { ScrnInfoPtr pScrni = XF86SCRNINFO(pScreen); XF86RandRInfoPtr pRandr = XF86RANDRINFO(pScreen); int oldWidth = pScreen->width; int oldHeight = pScreen->height; int oldmmWidth = pScreen->mmWidth; int oldmmHeight = pScreen->mmHeight; #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 8 WindowPtr pRoot = WindowTable[pScreen->myNum]; #else WindowPtr pRoot = pScreen->root; #endif DisplayModePtr currentMode = NULL; Bool ret = TRUE; #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,9,99,1,0) PixmapPtr pspix = NULL; #endif if (pRoot) (*pScrni-> EnableDisableFBAccess) (XF86_ENABLEDISABLEFB_ARG(pScrni, FALSE)); if (useVirtual) { pScrni->virtualX = pRandr->virtualX; pScrni->virtualY = pRandr->virtualY; } else { pScrni->virtualX = mode->HDisplay; pScrni->virtualY = mode->VDisplay; } if (pRandr->rotation & (RR_Rotate_90 | RR_Rotate_270)) { pScreen->width = pScrni->virtualY; pScreen->height = pScrni->virtualX; pScreen->mmWidth = mmHeight; pScreen->mmHeight = mmWidth; } else { pScreen->width = pScrni->virtualX; pScreen->height = pScrni->virtualY; pScreen->mmWidth = mmWidth; pScreen->mmHeight = mmHeight; } if (pScrni->currentMode == mode) { currentMode = pScrni->currentMode; pScrni->currentMode = NULL; } if (!xf86SwitchMode(pScreen, mode)) { ret = FALSE; pScrni->virtualX = pScreen->width = oldWidth; pScrni->virtualY = pScreen->height = oldHeight; pScreen->mmWidth = oldmmWidth; pScreen->mmHeight = oldmmHeight; pScrni->currentMode = currentMode; } #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,9,99,1,0) /* * Get the new Screen pixmap ptr as SwitchMode might have called * ModifyPixmapHeader and xf86EnableDisableFBAccess will put it back... * Unfortunately. */ pspix = (*pScreen->GetScreenPixmap) (pScreen); if (pspix->devPrivate.ptr) pScrni->pixmapPrivate = pspix->devPrivate; #endif xf86ReconfigureLayout(); xf86SetViewport(pScreen, pScreen->width, pScreen->height); xf86SetViewport(pScreen, 0, 0); if (pRoot) (*pScrni-> EnableDisableFBAccess) (XF86_ENABLEDISABLEFB_ARG(pScrni, TRUE)); return ret; } Bool GXRandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize) { ScrnInfoPtr pScrni = XF86SCRNINFO(pScreen); XF86RandRInfoPtr pRandr = XF86RANDRINFO(pScreen); DisplayModePtr mode; int px, py; Bool useVirtual = FALSE; int maxX = 0, maxY = 0; Rotation oldRotation = pRandr->rotation; pRandr->rotation = rotation; if (pRandr->virtualX == -1 || pRandr->virtualY == -1) { pRandr->virtualX = pScrni->virtualX; pRandr->virtualY = pScrni->virtualY; } /* FIXME: we don't have a new video ABI yet */ #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3 miPointerGetPosition(inputInfo.pointer, &px, &py); #else miPointerPosition(&px, &py); #endif for (mode = pScrni->modes;; mode = mode->next) { if (pRandr->maxX == 0 || pRandr->maxY == 0) { if (maxX < mode->HDisplay) maxX = mode->HDisplay; if (maxY < mode->VDisplay) maxY = mode->VDisplay; } if (mode->HDisplay == pSize->width && mode->VDisplay == pSize->height && (rate == 0 || GXRandRModeRefresh(mode) == rate)) break; if (mode->next == pScrni->modes) { if (pSize->width == pRandr->virtualX && pSize->height == pRandr->virtualY) { mode = pScrni->modes; useVirtual = TRUE; break; } if (pRandr->maxX == 0 || pRandr->maxY == 0) { pRandr->maxX = maxX; pRandr->maxY = maxY; } return FALSE; } } if (pRandr->maxX == 0 || pRandr->maxY == 0) { pRandr->maxX = maxX; pRandr->maxY = maxY; } if (!GXRandRSetMode(pScreen, mode, useVirtual, pSize->mmWidth, pSize->mmHeight)) { pRandr->rotation = oldRotation; return FALSE; } /* FIXME: we don't have a new video ABI yet */ #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3 if (pScreen == miPointerGetScreen(inputInfo.pointer)) #else if (pScreen == miPointerCurrentScreen()) #endif { px = (px >= pScreen->width ? (pScreen->width - 1) : px); py = (py >= pScreen->height ? (pScreen->height - 1) : py); xf86SetViewport(pScreen, px, py); /* FIXME: we don't have a new video ABI yet */ (*pScreen->SetCursorPosition) ( #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3 inputInfo.pointer, #endif pScreen, px, py, FALSE); } return TRUE; } Rotation GXGetRotation(ScreenPtr pScreen) { XF86RandRInfoPtr pRandr = XF86RANDRINFO(pScreen); return pRandr->rotation; } Bool GXRandRInit(ScreenPtr pScreen, int rotation) { XF86RandRInfoPtr pRandr; rrScrPrivPtr rp; if (GXRandRGeneration != serverGeneration) { GXRandRGeneration = serverGeneration; } #if OLD_VIDEODRV_INTERFACE GXRandRIndex = AllocateScreenPrivateIndex(); #endif #if HAS_DIXREGISTERPRIVATEKEY if (!dixRegisterPrivateKey(&GXRandRIndex, PRIVATE_SCREEN, 0)) return FALSE; #endif pRandr = calloc(1, sizeof(XF86RandRInfoRec)); if (pRandr == NULL) return FALSE; if (!RRScreenInit(pScreen)) { free(pRandr); return FALSE; } rp = rrGetScrPriv(pScreen); rp->rrGetInfo = GXRandRGetInfo; rp->rrSetConfig = GXRandRSetConfig; pRandr->virtualX = -1; pRandr->virtualY = -1; pRandr->mmWidth = pScreen->mmWidth; pRandr->mmHeight = pScreen->mmHeight; pRandr->rotation = RR_Rotate_0; pRandr->supported_rotations = rotation; pRandr->maxX = pRandr->maxY = 0; XF86RANDRSET(pScreen, pRandr); return TRUE; } xf86-video-geode-2.11.18/src/cim/0000755000175000017500000000000012654451205013210 500000000000000xf86-video-geode-2.11.18/src/cim/doc/0000755000175000017500000000000012654451205013755 500000000000000xf86-video-geode-2.11.18/src/cim/doc/release.txt0000644000175000017500000000405612654445443016072 00000000000000Cimarron API Release Notes Version 02.02.0100 March 4, 2005 Developer - ----------------------------------------------------------------------------- PRODUCT INFORMATION ----------------------------------------------------------------------------- Cimarron is a graphics/video support package designed to implement common functionality for GX3 (Castle). The design of this package is similar to its predecessor, Durango; many of the Cimarron routines have functional equivalents in the Durango library. However, Cimarron does not attempt to maintain legacy by completely preserving the original Durango API. The API has been restructured to more closely match current hardware. ----------------------------------------------------------------------------- INSTALLATION INSTRUCTIONS ----------------------------------------------------------------------------- NA ----------------------------------------------------------------------------- BUILD INSTRUCTIONS ----------------------------------------------------------------------------- NA ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- NA ----------------------------------------------------------------------------- UNIT TEST ----------------------------------------------------------------------------- NA ----------------------------------------------------------------------------- FILE CHANGES ----------------------------------------------------------------------------- None ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- NA ----------------------------------------------------------------------------- KNOWN ERRATA ----------------------------------------------------------------------------- NA ----------------------------------------------------------------------------- REVISION HISTORY ----------------------------------------------------------------------------- xf86-video-geode-2.11.18/src/cim/cim_defs.h0000644000175000017500000007753612654445443015103 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron hardware access macros. */ #ifndef _cim_defs_h #define _cim_defs_h /*-----------------------------------------*/ /* MEMORY ACCESS MACROS */ /*-----------------------------------------*/ #ifndef CIMARRON_EXCLUDE_REGISTER_ACCESS_MACROS #define READ_GP32(offset) \ (*(volatile unsigned long *)(cim_gp_ptr + (offset))) #define READ_REG32(offset) \ (*(volatile unsigned long *)(cim_vg_ptr + (offset))) #define READ_FB32(offset) \ (*(volatile unsigned long *)(cim_fb_ptr + (offset))) #define WRITE_GP32(offset, value) \ (*(volatile unsigned long *)(cim_gp_ptr + (offset))) = (value) #define WRITE_REG32(offset, value) \ (*(volatile unsigned long *)(cim_vg_ptr + (offset))) = (value) #define WRITE_COMMAND32(offset, value) \ (*(unsigned long *)(cim_cmd_ptr + (offset))) = (value) #define WRITE_COMMAND8(offset, value) \ (*(unsigned char *)(cim_cmd_ptr + (offset))) = (value) #define WRITE_FB32(offset, value) \ (*(unsigned long *)(cim_fb_ptr + (offset))) = (value) #define READ_VID32(offset) \ (*(volatile unsigned long *)(cim_vid_ptr + (offset))) #define WRITE_VID32(offset, value) \ (*(volatile unsigned long *)(cim_vid_ptr + (offset))) = (value) #define READ_VIP32(offset) \ (*(volatile unsigned long *)(cim_vip_ptr + (offset))) #define WRITE_VIP32(offset, value) \ (*(volatile unsigned long *)(cim_vip_ptr + (offset))) = (value) #define READ_VOP32(offset) \ (*(volatile unsigned long *)(cim_vid_ptr + (offset))) #define WRITE_VOP32(offset, value) \ (*(volatile unsigned long *)(cim_vid_ptr + (offset))) = (value) #endif /*-----------------------------------------*/ /* GP POLLING MACROS */ /*-----------------------------------------*/ #define GP3_WAIT_WRAP(variable) \ while(((variable = READ_GP32 (GP3_CMD_READ)) > gp3_cmd_current) || \ (variable <= (gp3_cmd_top + GP3_BLT_COMMAND_SIZE + GP3_BLT_COMMAND_SIZE + 96))) #define GP3_WAIT_PRIMITIVE(variable) \ while (((variable = READ_GP32 (GP3_CMD_READ)) > gp3_cmd_current) && \ (variable <= (gp3_cmd_next + 96))) #define GP3_WAIT_BUSY \ while(READ_GP32 (GP3_BLT_STATUS) & GP3_BS_BLT_BUSY) #define GP3_WAIT_PENDING \ while(READ_GP32 (GP3_BLT_STATUS) & GP3_BS_BLT_PENDING) /*-----------------------------------------------------------------*/ /* MSR MACROS */ /* These macros facilitate interaction with the model specific */ /* registers in GeodeLX. There are two included methods, direct */ /* access using the rdmsr and wrmsr opcodes and an indirect method */ /* using VSAII. */ /*-----------------------------------------------------------------*/ #ifdef CIMARRON_INCLUDE_MSR_MACROS #if CIMARRON_MSR_DIRECT_ASM /*----------------------------------------------------------------- * MSR_READ * Read the contents of a 64 bit MSR into a data structure *-----------------------------------------------------------------*/ #define MSR_READ(msr_reg, device_add, data64_ptr) \ { \ unsigned long msr_add = (unsigned long)(msr_reg) | \ (unsigned long)(device_add); \ unsigned long data_high, data_low; \ _asm { mov ecx, msr_add } \ _asm { rdmsr } \ _asm { mov data_high, edx } \ _asm { mov data_low, eax } \ \ ((Q_WORD *)(data64_ptr))->high = data_high; \ ((Q_WORD *)(data64_ptr))->low = data_low; \ } /*----------------------------------------------------------------- * MSR_WRITE * Write the contents of a 64 bit data structure to a MSR. *-----------------------------------------------------------------*/ #define MSR_WRITE(msr_reg, device_add, data64_ptr) \ { \ unsigned long msr_add = (unsigned long)(msr_reg) | \ (unsigned long)(device_add); \ unsigned long data_high, data_low; \ \ data_high = ((Q_WORD *)(data64_ptr))->high; \ data_low = ((Q_WORD *)(data64_ptr))->low; \ \ _asm { mov ecx, msr_add } \ _asm { mov edx, data_high } \ _asm { mov eax, data_low } \ _asm { wrmsr } \ } #elif CIMARRON_MSR_VSA_IO /*----------------------------------------------------------------- * MSR_READ * Read the contents of a 64 bit MSR into a data structure *-----------------------------------------------------------------*/ #define MSR_READ(msr_reg, device_add, data64_ptr) \ { \ unsigned long msr_add = (unsigned long)(msr_reg) | \ (unsigned long)(device_add); \ unsigned long data_high, data_low; \ \ _asm { mov dx, 0x0AC1C } \ _asm { mov eax, 0x0FC530007 } \ _asm { out dx, eax } \ \ _asm { add dl, 2 } \ _asm { mov ecx, msr_add } \ _asm { in ax, dx } \ _asm { mov data_high, edx } \ _asm { mov data_low, eax } \ \ ((Q_WORD *)(data64_ptr))->high = data_high; \ ((Q_WORD *)(data64_ptr))->low = data_low; \ } /*----------------------------------------------------------------- * MSR_WRITE * Write the contents of a 64 bit data structure to a MSR. *-----------------------------------------------------------------*/ #define MSR_WRITE(msr_reg, device_add, data64_ptr) \ { \ unsigned long msr_add = (unsigned long)(msr_reg) | \ (unsigned long)(device_add); \ unsigned long data_high, data_low; \ \ data_high = ((Q_WORD *)(data64_ptr))->high; \ data_low = ((Q_WORD *)(data64_ptr))->low; \ \ _asm { mov dx, 0x0AC1C } \ _asm { mov eax, 0x0FC530007 } \ _asm { out dx, eax } \ \ _asm { add dl, 2 } \ _asm { mov ecx, msr_add } \ _asm { mov ebx, data_high } \ _asm { mov eax, data_low } \ \ _asm { mov esi, 0 } \ _asm { mov edi, 0 } \ _asm { out dx, ax } \ } #elif CIMARRON_MSR_ABSTRACTED_ASM /*----------------------------------------------------------------- * MSR_READ * Read the contents of a 64 bit MSR into a data structure *-----------------------------------------------------------------*/ #define MSR_READ(msr,adr,val) \ __asm__ __volatile__( \ " mov $0x0AC1C, %%edx\n" \ " mov $0xFC530007, %%eax\n" \ " out %%eax,%%dx\n" \ " add $2,%%dl\n" \ " in %%dx, %%ax" \ : "=a" ((val)->low), "=d" ((val)->high) \ : "c" (msr | adr)) /*----------------------------------------------------------------- * MSR_WRITE * Write the contents of a 64 bit data structure to a MSR. *-----------------------------------------------------------------*/ #define MSR_WRITE(msr,adr,val) \ { int d0, d1, d2, d3; \ __asm__ __volatile__( \ " push %%ebx\n" \ " mov $0x0AC1C, %%edx\n" \ " mov $0xFC530007, %%eax\n" \ " out %%eax,%%dx\n" \ " add $2,%%dl\n" \ " mov %4, %3\n" \ " mov 0(%5), %%ebx\n" \ " mov 4(%5), %0\n" \ " xor %2, %2\n" \ " xor %1, %1\n" \ " out %%ax, %%dx\n" \ " pop %%ebx\n" \ : "=a" (d0), "=&D" (d1), "=&S" (d2), "=c" (d3) \ : "1" (msr | adr), "2" (val)); \ } #elif CIMARRON_MSR_KERNEL_ROUTINE #include "asm/msr.h" /*----------------------------------------------------------------- * MSR_READ * Read the contents of a 64 bit MSR into a data structure *-----------------------------------------------------------------*/ #define MSR_READ(msr_reg, device_add, data64_ptr) \ { \ unsigned long addr, val1, val2; \ \ addr = device_add | msr_reg; \ rdmsr (addr, val1, val2); \ \ ((Q_WORD *)(data64_ptr))->high = val2; \ ((Q_WORD *)(data64_ptr))->low = val1; \ } /*----------------------------------------------------------------- * MSR_WRITE * Read the contents of a 64 bit data structure to a MSR. *-----------------------------------------------------------------*/ #define MSR_WRITE(msr_reg, device_add, data64_ptr) \ { \ unsigned long addr, val1, val2; \ \ val2 = ((Q_WORD *)(data64_ptr))->high; \ val1 = ((Q_WORD *)(data64_ptr))->low; \ \ addr = (device_add & 0xFFFF0000) | (unsigned long)msr_reg; \ wrmsr(addr, val1, val2); \ } #elif CIMARRON_MSR_HOOKS #define MSR_READ(msr_reg, device_add, data64_ptr) \ { \ unsigned long addr, val1, val2; \ \ addr = device_add | msr_reg; \ if (cim_rdmsr) { \ cim_rdmsr (addr, &val1, &val2); \ \ ((Q_WORD *)(data64_ptr))->high = val2; \ ((Q_WORD *)(data64_ptr))->low = val1; \ } \ } #define MSR_WRITE(msr_reg, device_add, data64_ptr) \ { \ unsigned long addr, val1, val2; \ \ val2 = ((Q_WORD *)(data64_ptr))->high; \ val1 = ((Q_WORD *)(data64_ptr))->low; \ \ addr = (device_add & 0xFFFF0000) | (unsigned long)msr_reg; \ if (cim_wrmsr) \ cim_wrmsr(addr, val1, val2); \ } #endif #endif /* #ifdef CIMARRON_INCLUDE_MSR_MACROS */ /*-----------------------------------------------------------------*/ /* STRING MACROS */ /* These macros are included to facilitate the optimization of */ /* routines that write or copy large amounts of data. Two vesions */ /* of these macros are included. One is intended for operating */ /* systems that allow the use of inline assembly, while the other */ /* is a pure C implementation for stricter operating systems. */ /*-----------------------------------------------------------------*/ #ifdef CIMARRON_INCLUDE_STRING_MACROS #if CIMARRON_OPTIMIZE_ASSEMBLY /*----------------------------------------------------------------- * WRITE_COMMAND_STRING32 * Write a series of DWORDs to the current command buffer offset *-----------------------------------------------------------------*/ #define WRITE_COMMAND_STRING32(offset, dataptr, dataoffset, dword_count) \ { \ _asm { cld } \ _asm { mov edi, cim_cmd_ptr } \ _asm { add edi, offset } \ _asm { mov esi, dataptr } \ _asm { add esi, dataoffset } \ _asm { mov ecx, dword_count } \ _asm { rep movsd } \ } /*----------------------------------------------------------------- * WRITE_FB_STRING32 * Write a series of DWORDS to video memory. *-----------------------------------------------------------------*/ #define WRITE_FB_STRING32(offset, dataptr, dword_count) \ { \ unsigned long temp = (unsigned long)(dataptr); \ _asm { cld } \ _asm { mov edi, cim_fb_ptr } \ _asm { add edi, offset } \ _asm { mov esi, temp } \ _asm { mov ecx, dword_count } \ _asm { rep movsd } \ } /*----------------------------------------------------------------- * WRITE_FB_CONSTANT * Write a constant DWORD to multiple video memory addresses *-----------------------------------------------------------------*/ #define WRITE_FB_CONSTANT(offset, value, dword_count) \ { \ unsigned long outptr = (unsigned long)cim_fb_ptr + offset; \ unsigned long dwords = dword_count; \ _asm { cld } \ _asm { mov edi, outptr } \ _asm { mov eax, value } \ _asm { mov ecx, dwords } \ _asm { rep stosd } \ } /*----------------------------------------------------------------- * WRITE_HOST_SOURCE_STRING32 * Write a series of DWORDs to the GP host source register *-----------------------------------------------------------------*/ #define WRITE_HOST_SOURCE_STRING32(dataptr, dataoffset, dword_count) \ { \ _asm { cld } \ _asm { mov edi, cim_gp_ptr } \ _asm { add edi, GP3_HST_SRC_RANGE } \ _asm { mov esi, dataptr } \ _asm { add esi, dataoffset } \ _asm { mov ecx, dword_count } \ _asm { rep movsd } \ } #elif CIMARRON_OPTIMIZE_FORLOOP /*----------------------------------------------------------------- * WRITE_COMMAND_STRING32 * Write a series of DWORDs to the current command buffer offset *-----------------------------------------------------------------*/ #define WRITE_COMMAND_STRING32(offset, dataptr, dataoffset, dword_count) \ { \ unsigned long i; \ unsigned long tempdata = (unsigned long)dataptr + (dataoffset); \ unsigned long byte_off = 0; \ for (i = 0; i < dword_count; i++, byte_off += 4) \ WRITE_COMMAND32 ((offset) + byte_off, \ *((unsigned long *)(tempdata + byte_off))); \ } /*----------------------------------------------------------------- * WRITE_FB_STRING32 * Write a series of DWORDS to video memory. *-----------------------------------------------------------------*/ #define WRITE_FB_STRING32(offset, dataptr, dword_count) \ { \ unsigned long i; \ unsigned long tempdata = (unsigned long)dataptr; \ unsigned long byte_off = 0; \ for (i = 0; i < dword_count; i++, byte_off += 4) \ WRITE_FB32 ((offset) + byte_off, \ *((unsigned long *)(tempdata + byte_off))); \ } /*----------------------------------------------------------------- * WRITE_FB_CONSTANT * Write a constant DWORD to multiple video memory addresses *-----------------------------------------------------------------*/ #define WRITE_FB_CONSTANT(offset, value, dword_count) \ { \ unsigned long i; \ unsigned long tempoffset = offset; \ for (i = 0; i < dword_count; i++, tempoffset += 4) \ WRITE_FB32 (tempoffset, value); \ } /*----------------------------------------------------------------- * WRITE_HOST_SOURCE_STRING32 * Write a series of DWORDs to the GP host source register *-----------------------------------------------------------------*/ #define WRITE_HOST_SOURCE_STRING32(dataptr, dataoffset, dword_count) \ { \ unsigned long i; \ unsigned long tempdata = (unsigned long)dataptr + (dataoffset); \ unsigned long byte_off = 0; \ for (i = 0; i < dword_count; i++, byte_off += 4) \ WRITE_GP32 (byte_off + GP3_HST_SRC_RANGE, \ *((unsigned long *)(tempdata + byte_off))); \ } #elif CIMARRON_OPTIMIZE_ABSTRACTED_ASM #define move_dw(d,s,n) \ __asm__ __volatile__( \ " rep\n" \ " movsl\n" \ : "=&c" (d0), "=&S" (d1), "=&D" (d2) \ : "0" (n), "1" ((const char *)s), "2" ((char *)d) \ : "memory") /*----------------------------------------------------------------- * WRITE_COMMAND_STRING32 * Write a series of DWORDs to the current command buffer offset *-----------------------------------------------------------------*/ #define WRITE_COMMAND_STRING32(offset, dataptr, dataoffset, dword_count) \ { \ int d0, d1, d2; \ move_dw (cim_cmd_ptr+ ((unsigned long)(offset)), \ ((unsigned long)(dataptr)+(dataoffset)), \ dword_count); \ } /*----------------------------------------------------------------- * WRITE_FB_STRING32 * Write a series of DWORDS to video memory. *-----------------------------------------------------------------*/ #define WRITE_FB_STRING32(offset, dataptr, dword_count) \ { \ unsigned long i; \ unsigned long tempdata = (unsigned long)dataptr; \ unsigned long byte_off = 0; \ for (i = 0; i < dword_count; i++, byte_off += 4) \ WRITE_FB32 ((offset) + byte_off, \ *((unsigned long *)(tempdata + byte_off))); \ } /*----------------------------------------------------------------- * WRITE_FB_CONSTANT * Write a constant DWORD to multiple video memory addresses *-----------------------------------------------------------------*/ #define WRITE_FB_CONSTANT(offset, value, dword_count) \ { \ unsigned long i; \ unsigned long tempoffset = offset; \ for (i = 0; i < dword_count; i++, tempoffset += 4) \ WRITE_FB32 (tempoffset, value); \ } /*----------------------------------------------------------------- * WRITE_HOST_SOURCE_STRING32 * Write a series of DWORDs to the GP host source register *-----------------------------------------------------------------*/ #define WRITE_HOST_SOURCE_STRING32(dataptr, dataoffset, dword_count) \ { \ unsigned long i; \ unsigned long tempdata = (unsigned long)dataptr + (dataoffset); \ unsigned long byte_off = 0; \ for (i = 0; i < dword_count; i++, byte_off += 4) \ WRITE_GP32 (byte_off + GP3_HST_SRC_RANGE, \ *((unsigned long *)(tempdata + byte_off))); \ } #endif #endif /* #ifdef CIMARRON_INCLUDE_STRING_MACROS */ /*----------------------------------------------------------------- * WRITE_COMMAND_STRING8 * Write a series of bytes to the current command buffer offset *-----------------------------------------------------------------*/ #define WRITE_COMMAND_STRING8(offset, dataptr, dataoffset, byte_count) \ { \ unsigned long i; \ unsigned long array = (unsigned long)dataptr + (dataoffset); \ for (i = 0; i < byte_count; i++) \ WRITE_COMMAND8 ((offset) + i, *((unsigned char *)(array + i))); \ } /*----------------------------------------------------------------- * WRITE_HOST_SOURCE_STRING8 * Write a series of bytes to the host source register *-----------------------------------------------------------------*/ #define WRITE_HOST_SOURCE_STRING8(dataptr, dataoffset, byte_count) \ { \ unsigned long temp1 = (unsigned long)dataptr + (dataoffset); \ unsigned long temp2 = 0; \ unsigned long shift = 0; \ unsigned long counter; \ if (byte_count) \ { \ for (counter = 0; counter < byte_count; counter++) \ { \ temp2 |= ((unsigned long)(*((unsigned char *) \ (temp1 + counter)))) << shift; \ shift += 8; \ } \ WRITE_GP32 (GP3_HST_SRC, temp2); \ } \ } /*-----------------------------------------*/ /* CUSTOM STRING MACROS */ /*-----------------------------------------*/ #ifndef CIMARRON_EXCLUDE_CUSTOM_MACROS #define WRITE_CUSTOM_COMMAND_STRING32 WRITE_COMMAND_STRING32 #define WRITE_CUSTOM_COMMAND_STRING8 WRITE_COMMAND_STRING8 #endif /*-----------------------------------------*/ /* IO ACCESS MACROS */ /*-----------------------------------------*/ #ifdef CIMARRON_INCLUDE_IO_MACROS #if CIMARRON_IO_DIRECT_ACCESS /*------------------------------------------- * OUTD * Writes one DWORD to a single I/O address. *-------------------------------------------*/ #define OUTD(port, data) cim_outd(port, data) void cim_outd(unsigned short port, unsigned long data) { _asm { pushf mov eax, data mov dx, port out dx, eax popf}} /*------------------------------------------- * IND * Reads one DWORD from a single I/O address. *-------------------------------------------*/ #define IND(port) cim_ind(port) unsigned long cim_ind(unsigned short port) { unsigned long data; _asm { pushf mov dx, port in eax, dx mov data, eax popf} return data; } /*------------------------------------------- * OUTW * Writes one WORD to a single I/O address. *-------------------------------------------*/ #define OUTW(port, data) cim_outw(port, data) void cim_outw(unsigned short port, unsigned short data) { _asm { pushf mov ax, data mov dx, port out dx, ax popf}} /*------------------------------------------- * INW * Reads one WORD from a single I/O address. *-------------------------------------------*/ #define INW(port) cim_inw(port) unsigned short cim_inw(unsigned short port) { unsigned short data; _asm { pushf mov dx, port in ax, dx mov data, ax popf} return data; } /*------------------------------------------- * OUTB * Writes one BYTE to a single I/O address. *-------------------------------------------*/ #define OUTB(port, data) cim_outb(port, data) void cim_outb(unsigned short port, unsigned char data) { _asm { pushf mov al, data mov dx, port out dx, al popf}} /*------------------------------------------- * INB * Reads one BYTE from a single I/O address. *-------------------------------------------*/ #define INB(port) cim_inb(port) unsigned char cim_inb(unsigned short port) { unsigned char data; _asm { pushf mov dx, port in al, dx mov data, al popf} return data; } #elif CIMARRON_IO_ABSTRACTED_ASM /*------------------------------------------- * OUTD * Writes one DWORD to a single I/O address. *-------------------------------------------*/ #define OUTD(port, data) cim_outd(port, data) void cim_outd(unsigned short port, unsigned long data); void cim_outd(unsigned short port, unsigned long data) { __asm__ __volatile__("outl %0,%w1"::"a"(data), "Nd"(port)); } /*------------------------------------------- * IND * Reads one DWORD from a single I/O address. *-------------------------------------------*/ #define IND(port) cim_ind(port) unsigned long cim_ind(unsigned short port); unsigned long cim_ind(unsigned short port) { unsigned long value; __asm__ __volatile__("inl %w1,%0":"=a"(value):"Nd"(port)); return value; } /*------------------------------------------- * OUTW * Writes one WORD to a single I/O address. *-------------------------------------------*/ #define OUTW(port, data) cim_outw(port, data) void cim_outw(unsigned short port, unsigned short data); void cim_outw(unsigned short port, unsigned short data) { __asm__ volatile ("out %0,%1"::"a" (data), "d"(port)); } /*------------------------------------------- * INW * Reads one WORD from a single I/O address. *-------------------------------------------*/ #define INW(port) cim_inw(port) unsigned short cim_inw(unsigned short port); unsigned short cim_inw(unsigned short port) { unsigned short value; __asm__ volatile ("in %1,%0":"=a" (value):"d"(port)); return value; } /*------------------------------------------- * INB * Reads one BYTE from a single I/O address. *-------------------------------------------*/ #define INB(port) cim_inb(port) unsigned char cim_inb(unsigned short port); unsigned char cim_inb(unsigned short port) { unsigned char value; __asm__ volatile ("inb %1,%0":"=a" (value):"d"(port)); return value; } /*------------------------------------------- * OUTB * Writes one BYTE to a single I/O address. *-------------------------------------------*/ #define OUTB(port) cim_outb(port) void cim_outb(unsigned short port, unsigned char data); void cim_outb(unsigned short port, unsigned char data) { __asm__ volatile ("outb %0,%1"::"a" (data), "d"(port)); } #endif #endif /* CIMARRON_INCLUDE_IO_MACROS */ extern void (*cim_rdmsr) (unsigned long, unsigned long *, unsigned long *); extern void (*cim_wrmsr) (unsigned long, unsigned long, unsigned long); #endif xf86-video-geode-2.11.18/src/cim/cim_version.h0000644000175000017500000000261712654445443015633 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron Version information */ #define CIMARRON_REVISION 30103 xf86-video-geode-2.11.18/src/cim/cim_init.c0000644000175000017500000001637512654445443015112 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron initialization routines. These routines detect a Geode LX and * read all hardware base addresses. */ CIMARRON_STATIC unsigned long init_video_base = 0x80000900; /*--------------------------------------------------------------------------- * init_detect_cpu * * This routine verifies that a Geode LX is present and returns the processor * revision ID. For compatibility, this routine can also detect a Redcloud * processor. * bits[24:16] = minor version * bits[15:8] = major version * bits[7:0] = type (1 = Geode GX, 2 = Geode LX) *---------------------------------------------------------------------------*/ int init_detect_cpu(unsigned long *cpu_revision, unsigned long *companion_revision) { unsigned long bus, device, i; unsigned long cpu_bus = 0, cpu_device = 0; unsigned long address, data; unsigned long num_bars, function; int cpu_found, sb_found; Q_WORD msr_value; /* SEARCH THROUGH PCI BUS */ /* We search the PCI bus for the Geode LX or Geode GX northbridge. */ /* We then verify that one of its functions is the graphics */ /* controller and that all bars are filled in. */ cpu_found = sb_found = 0; for (bus = 0; bus < 256; bus++) { for (device = 0; device < 21; device++) { address = 0x80000000 | (bus << 16) | (device << 11); data = init_read_pci(address); if (data == PCI_VENDOR_DEVICE_GEODEGX || data == PCI_VENDOR_DEVICE_GEODELX) { cpu_found = 1; cpu_device = device; cpu_bus = bus; if (data == PCI_VENDOR_DEVICE_GEODEGX) *cpu_revision = CIM_CPU_GEODEGX; else *cpu_revision = CIM_CPU_GEODELX; } else if (data == PCI_VENDOR_5535 || data == PCI_VENDOR_5536) { sb_found = 1; if (data == PCI_VENDOR_5535) *companion_revision = CIM_SB_5535; else *companion_revision = CIM_SB_5536; } if (cpu_found && sb_found) break; } if (device != 21) break; } if (bus == 256) { *cpu_revision = 0; return CIM_STATUS_CPUNOTFOUND; } msr_init_table(); if (msr_read64(MSR_DEVICE_GEODELX_GLCP, GLCP_REVID, &msr_value) != CIM_STATUS_OK) { *cpu_revision = 0; return CIM_STATUS_CPUNOTFOUND; } *cpu_revision |= ((msr_value.low & 0xF0) << 4) | ((msr_value.low & 0x0F) << 16); if (msr_read64(MSR_DEVICE_5535_GLCP, GLCP_REVID, &msr_value) != CIM_STATUS_OK) { *cpu_revision = 0; return CIM_STATUS_CPUNOTFOUND; } *companion_revision |= ((msr_value.low & 0xF0) << 4) | ((msr_value.low & 0x0F) << 16); /* SEARCH ALL FUNCTIONS FOR INTEGRATED GRAPHICS */ num_bars = 0; for (function = 0; function < 7; function++) { address = 0x80000000 | (cpu_bus << 16) | (cpu_device << 11) | (function << 8); data = init_read_pci(address); if (data == PCI_VENDOR_DEVICE_GEODEGX_VIDEO) { num_bars = 4; break; } else if (data == PCI_VENDOR_DEVICE_GEODELX_VIDEO) { num_bars = 5; break; } } /* VERIFY THAT ALL BARS ARE PRESENT */ if (function == 7) return CIM_STATUS_DISPLAYUNAVAILABLE; for (i = 0; i < num_bars; i++) { data = init_read_pci(address + 0x10 + (i << 2)); if (data == 0 || data == 0xFFFFFFFF) break; } if (i != num_bars) return CIM_STATUS_DISPLAYUNAVAILABLE; /* SAVE VIDEO BASE ADDRESS FOR FUTURE CALLS */ init_video_base = address; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * init_read_pci * * This routine reads an unsigned long value from a PCI address. *---------------------------------------------------------------------------*/ unsigned long init_read_pci(unsigned long address) { OUTD(0xCF8, address); return IND(0xCFC); } /*--------------------------------------------------------------------------- * init_read_base_addresses * * This routine reads all base addresses for the peripherals from the PCI * BARs. *---------------------------------------------------------------------------*/ int init_read_base_addresses(INIT_BASE_ADDRESSES * base_addresses) { unsigned long value; /* READ ALL BASE ADDRESSES */ base_addresses->framebuffer_base = init_read_pci(init_video_base + 0x10); base_addresses->gp_register_base = init_read_pci(init_video_base + 0x14); base_addresses->vg_register_base = init_read_pci(init_video_base + 0x18); base_addresses->df_register_base = init_read_pci(init_video_base + 0x1C); base_addresses->vip_register_base = init_read_pci(init_video_base + 0x20); /* READ FRAME BUFFER SIZE */ /* The frame buffer size is reported by a VSM in VSA II */ /* Virtual Register Class = 0x02 */ /* VG_MEM_SIZE (1MB units) = 0x00 */ OUTW(0xAC1C, 0xFC53); OUTW(0xAC1C, 0x0200); value = (unsigned long) (INW(0xAC1E)) & 0xFE; base_addresses->framebuffer_size = value << 20; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * init_read_cpu_frequency * * This routine returns the current CPU core frequency, in MHz. *---------------------------------------------------------------------------*/ int init_read_cpu_frequency(unsigned long *cpu_frequency) { /* CPU SPEED IS REPORTED BY A VSM IN VSA II */ /* Virtual Register Class = 0x12 (Sysinfo) */ /* CPU Speed Register = 0x01 */ OUTW(0xAC1C, 0xFC53); OUTW(0xAC1C, 0x1201); *cpu_frequency = (unsigned long) (INW(0xAC1E)); return CIM_STATUS_OK; } xf86-video-geode-2.11.18/src/cim/cim_regs.h0000644000175000017500000015174012654445443015110 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron register definitions */ #ifndef _cim_regs_h #define _cim_regs_h /*----------------------------------------------------------------*/ /* GRAPHICS PROCESSOR DEFINITIONS */ /*----------------------------------------------------------------*/ /*----------------------------*/ /* COMMAND BUFFER DEFINITIONS */ /*----------------------------*/ #define GP3_BLT_COMMAND_SIZE 68 /* 18 DWORDS */ #define GP3_VECTOR_COMMAND_SIZE 56 /* 14 DWORDS */ #define GP3_4BPP_LUT_COMMAND_SIZE 76 /* 16 DWORDS + 3 CMD DWORDS */ #define GP3_8BPP_LUT_COMMAND_SIZE 1036 /* 256 DWORDS + * 3 CMD DWORDS */ #define GP3_VECTOR_PATTERN_COMMAND_SIZE 20 /* 2 DWORDS + 3 CMD DWORDS */ #define GP3_MAX_COMMAND_SIZE 9000 /* 8K + * WORKAROUND SPACE */ #define GP3_SCRATCH_BUFFER_SIZE 0x100000 /* 1MB SCRATCH * BUFFER */ #define GP3_BLT_1PASS_SIZE 0xC7F8 /* (50K - 8) is largest * 1-Pass load size */ /*-------------------------------------*/ /* BLT COMMAND BUFFER REGISTER OFFSETS */ /*-------------------------------------*/ #define GP3_BLT_CMD_HEADER 0x00000000 #define GP3_BLT_RASTER_MODE 0x00000004 #define GP3_BLT_DST_OFFSET 0x00000008 #define GP3_BLT_SRC_OFFSET 0x0000000C #define GP3_BLT_STRIDE 0x00000010 #define GP3_BLT_WID_HEIGHT 0x00000014 #define GP3_BLT_SRC_COLOR_FG 0x00000018 #define GP3_BLT_SRC_COLOR_BG 0x0000001C #define GP3_BLT_PAT_COLOR_0 0x00000020 #define GP3_BLT_PAT_COLOR_1 0x00000024 #define GP3_BLT_PAT_DATA_0 0x00000028 #define GP3_BLT_PAT_DATA_1 0x0000002C #define GP3_BLT_CH3_OFFSET 0x00000030 #define GP3_BLT_CH3_MODE_STR 0x00000034 #define GP3_BLT_CH3_WIDHI 0x00000038 #define GP3_BLT_BASE_OFFSET 0x0000003C #define GP3_BLT_MODE 0x00000040 /*-----------------------------------------------------------------*/ /* VECTOR COMMAND BUFFER REGISTER OFFSETS */ /* Some of these are identical to the BLT registers (and we will */ /* be assumed to be such in the Cimarron code, but they are listed */ /* here for clarity and for future changes. */ /*-----------------------------------------------------------------*/ #define GP3_VEC_CMD_HEADER 0x00000000 #define GP3_VECTOR_RASTER_MODE 0x00000004 #define GP3_VECTOR_DST_OFFSET 0x00000008 #define GP3_VECTOR_VEC_ERR 0x0000000C #define GP3_VECTOR_STRIDE 0x00000010 #define GP3_VECTOR_VEC_LEN 0x00000014 #define GP3_VECTOR_SRC_COLOR_FG 0x00000018 #define GP3_VECTOR_PAT_COLOR_0 0x0000001C #define GP3_VECTOR_PAT_COLOR_1 0x00000020 #define GP3_VECTOR_PAT_DATA_0 0x00000024 #define GP3_VECTOR_PAT_DATA_1 0x00000028 #define GP3_VECTOR_CH3_MODE_STR 0x0000002C #define GP3_VECTOR_BASE_OFFSET 0x00000030 #define GP3_VECTOR_MODE 0x00000034 /*---------------------------------------------------*/ /* GP REGISTER DEFINITIONS */ /* Addresses for writing or reading directly to/from */ /* the graphics processor. */ /*---------------------------------------------------*/ #define GP3_DST_OFFSET 0x00000000 #define GP3_SRC_OFFSET 0x00000004 #define GP3_VEC_ERR 0x00000004 #define GP3_STRIDE 0x00000008 #define GP3_WID_HEIGHT 0x0000000C #define GP3_VEC_LEN 0x0000000C #define GP3_SRC_COLOR_FG 0x00000010 #define GP3_SRC_COLOR_BG 0x00000014 #define GP3_PAT_COLOR_0 0x00000018 #define GP3_PAT_COLOR_1 0x0000001C #define GP3_PAT_COLOR_2 0x00000020 #define GP3_PAT_COLOR_3 0x00000024 #define GP3_PAT_COLOR_4 0x00000028 #define GP3_PAT_COLOR_5 0x0000002C #define GP3_PAT_DATA_0 0x00000030 #define GP3_PAT_DATA_1 0x00000034 #define GP3_RASTER_MODE 0x00000038 #define GP3_VEC_MODE 0x0000003C #define GP3_BLT_MODE 0x00000040 #define GP3_BLT_STATUS 0x00000044 #define GP3_HST_SRC 0x00000048 #define GP3_BASE_OFFSET 0x0000004C #define GP3_CMD_TOP 0x00000050 #define GP3_CMD_BOT 0x00000054 #define GP3_CMD_READ 0x00000058 #define GP3_CMD_WRITE 0x0000005C #define GP3_CH3_OFFSET 0x00000060 #define GP3_CH3_MODE_STR 0x00000064 #define GP3_CH3_WIDHI 0x00000068 #define GP3_CH3_HST_SRC 0x0000006C #define GP3_LUT_ADDRESS 0x00000070 #define GP3_LUT_DATA 0x00000074 #define GP3_INT_CTL 0x00000078 #define GP3_HST_SRC_RANGE 0x00000100 /*------------------------*/ /* REGISTER BIT FIELDS */ /*------------------------*/ /* GP3_BLT_CMD_HEADER BIT DEFINITIONS */ #define GP3_BLT_HDR_WRAP 0x80000000 #define GP3_BLT_HDR_TYPE 0x00000000 #define GP3_BLT_HDR_HAZARD_ENABLE 0x10000000 #define GP3_BLT_HDR_RASTER_ENABLE 0x00000001 #define GP3_BLT_HDR_DST_OFF_ENABLE 0x00000002 #define GP3_BLT_HDR_SRC_OFF_ENABLE 0x00000004 #define GP3_BLT_HDR_STRIDE_ENABLE 0x00000008 #define GP3_BLT_HDR_WIDHI_ENABLE 0x00000010 #define GP3_BLT_HDR_SRC_FG_ENABLE 0x00000020 #define GP3_BLT_HDR_SRC_BG_ENABLE 0x00000040 #define GP3_BLT_HDR_PAT_CLR0_ENABLE 0x00000080 #define GP3_BLT_HDR_PAT_CLR1_ENABLE 0x00000100 #define GP3_BLT_HDR_PAT_DATA0_ENABLE 0x00000200 #define GP3_BLT_HDR_PAT_DATA1_ENABLE 0x00000400 #define GP3_BLT_HDR_CH3_OFF_ENABLE 0x00000800 #define GP3_BLT_HDR_CH3_STR_ENABLE 0x00001000 #define GP3_BLT_HDR_CH3_WIDHI_ENABLE 0x00002000 #define GP3_BLT_HDR_BASE_OFFSET_ENABLE 0x00004000 #define GP3_BLT_HDR_BLT_MODE_ENABLE 0x00008000 /* GP3_VEC_CMD_HEADER BIT DEFINITIONS */ #define GP3_VEC_HDR_WRAP 0x80000000 #define GP3_VEC_HDR_TYPE 0x20000000 #define GP3_VEC_HDR_HAZARD_ENABLE 0x10000000 #define GP3_VEC_HDR_RASTER_ENABLE 0x00000001 #define GP3_VEC_HDR_DST_OFF_ENABLE 0x00000002 #define GP3_VEC_HDR_VEC_ERR_ENABLE 0x00000004 #define GP3_VEC_HDR_STRIDE_ENABLE 0x00000008 #define GP3_VEC_HDR_VEC_LEN_ENABLE 0x00000010 #define GP3_VEC_HDR_SRC_FG_ENABLE 0x00000020 #define GP3_VEC_HDR_PAT_CLR0_ENABLE 0x00000040 #define GP3_VEC_HDR_PAT_CLR1_ENABLE 0x00000080 #define GP3_VEC_HDR_PAT_DATA0_ENABLE 0x00000100 #define GP3_VEC_HDR_PAT_DATA1_ENABLE 0x00000200 #define GP3_VEC_HDR_CH3_STR_ENABLE 0x00000400 #define GP3_VEC_HDR_BASE_OFFSET_ENABLE 0x00000800 #define GP3_VEC_HDR_VEC_MODE_ENABLE 0x00001000 /* GP3_RASTER_MODE BIT DEFINITIONS */ #define GP3_RM_BPPFMT_332 0x00000000 /* 8 BPP, palettized */ #define GP3_RM_BPPFMT_4444 0x40000000 /* 16 BPP, 4:4:4:4 */ #define GP3_RM_BPPFMT_1555 0x50000000 /* 16 BPP, 1:5:5:5 */ #define GP3_RM_BPPFMT_565 0x60000000 /* 16 BPP, 5:6:5 */ #define GP3_RM_BPPFMT_8888 0x80000000 /* 32 BPP, 8:8:8:8 */ #define GP3_RM_ALPHA_ALL 0x00C00000 /* Alpha enable */ #define GP3_RM_ALPHA_TO_RGB 0x00400000 /* Alpha applies to RGB */ #define GP3_RM_ALPHA_TO_ALPHA 0x00800000 /* Alpha applies to alpha */ #define GP3_RM_ALPHA_OP_MASK 0x00300000 /* Alpha operation */ #define GP3_RM_ALPHA_TIMES_A 0x00000000 /* Alpha * A */ #define GP3_RM_BETA_TIMES_B 0x00100000 /* (1-alpha) * B */ #define GP3_RM_A_PLUS_BETA_B 0x00200000 /* A + (1-alpha) * B */ #define GP3_RM_ALPHA_A_PLUS_BETA_B 0x00300000 /* alpha * A + (1 - alpha)B */ #define GP3_RM_ALPHA_SELECT 0x000E0000 /* Alpha Select */ #define GP3_RM_SELECT_ALPHA_A 0x00000000 /* Alpha from channel A */ #define GP3_RM_SELECT_ALPHA_B 0x00020000 /* Alpha from channel B */ #define GP3_RM_SELECT_ALPHA_R 0x00040000 /* Registered alpha */ #define GP3_RM_SELECT_ALPHA_1 0x00060000 /* Constant 1 */ #define GP3_RM_SELECT_ALPHA_CHAN_A 0x00080000 /* RGB Values from A */ #define GP3_RM_SELECT_ALPHA_CHAN_B 0x000A0000 /* RGB Values from B */ #define GP3_RM_SELECT_ALPHA_CHAN_3 0x000C0000 /* Alpha from channel 3 */ #define GP3_RM_DEST_FROM_CHAN_A 0x00010000 /* Alpha channel select */ #define GP3_RM_PATTERN_INVERT 0x00001000 /* Invert monochrome pat */ #define GP3_RM_SOURCE_INVERT 0x00002000 /* Invert monochrome src */ #define GP3_RM_PAT_FLAGS 0x00000700 /* pattern related bits */ #define GP3_RM_PAT_MONO 0x00000100 /* monochrome pattern */ #define GP3_RM_PAT_COLOR 0x00000200 /* color pattern */ #define GP3_RM_PAT_TRANS 0x00000400 /* pattern transparency */ #define GP3_RM_SRC_TRANS 0x00000800 /* source transparency */ /* GP3_VECTOR_MODE REGISTER DESCRIPTIONS */ #define GP3_VM_DST_REQ 0x00000008 /* dst data required */ #define GP3_VM_THROTTLE 0x00000010 /* sync to VBLANK */ /* GP3_BLT_MODE REGISTER DEFINITIONS */ #define GP3_BM_SRC_FB 0x00000001 /* src = frame buffer */ #define GP3_BM_SRC_HOST 0x00000002 /* src = host register */ #define GP3_BM_DST_REQ 0x00000004 /* dst data required */ #define GP3_BM_SRC_MONO 0x00000040 /* monochrome source data */ #define GP3_BM_SRC_BP_MONO 0x00000080 /* Byte-packed monochrome */ #define GP3_BM_NEG_YDIR 0x00000100 /* negative Y direction */ #define GP3_BM_NEG_XDIR 0x00000200 /* negative X direction */ #define GP3_BM_THROTTLE 0x00000400 /* sync to VBLANK */ /* GP3_BLT_STATUS REGISTER DEFINITIONS */ #define GP3_BS_BLT_BUSY 0x00000001 /* GP is not idle */ #define GP3_BS_BLT_PENDING 0x00000004 /* second BLT is pending */ #define GP3_BS_HALF_EMPTY 0x00000008 /* src FIFO half empty */ #define GP3_BS_CB_EMPTY 0x00000010 /* Command buffer empty. */ /* GP3_CH3_MODE_STR REGISTER DEFINITIONS */ #define GP3_CH3_C3EN 0x80000000 #define GP3_CH3_REPLACE_SOURCE 0x40000000 #define GP3_CH3_NEG_XDIR 0x20000000 #define GP3_CH3_NEG_YDIR 0x10000000 #define GP3_CH3_SRC_FMT_MASK 0x0f000000 #define GP3_CH3_SRC_3_3_2 0x00000000 #define GP3_CH3_SRC_8BPP_INDEXED 0x01000000 #define GP3_CH3_SRC_8BPP_ALPHA 0x02000000 #define GP3_CH3_SRC_4_4_4_4 0x04000000 #define GP3_CH3_SRC_1_5_5_5 0x05000000 #define GP3_CH3_SRC_0_5_6_5 0x06000000 #define GP3_CH3_SRC_Y_U_V 0x07000000 #define GP3_CH3_SRC_8_8_8_8 0x08000000 #define GP3_CH3_SRC_24BPP_PACKED 0x0B000000 #define GP3_CH3_SRC_4BPP_INDEXED 0x0D000000 #define GP3_CH3_SRC_4BPP_ALPHA 0x0E000000 #define GP3_CH3_SRC_MASK 0x0F000000 #define GP3_CH3_ROTATE_ENABLE 0x00800000 #define GP3_CH3_BGR_ORDER 0x00400000 #define GP3_CH3_COLOR_PAT_ENABLE 0x00200000 #define GP3_CH3_PRESERVE_LUT 0x00100000 #define GP3_CH3_PREFETCH_ENABLE 0x00080000 #define GP3_CH3_HST_SRC_ENABLE 0x00040000 #define GP3_CH3_STRIDE_MASK 0x0000FFFF /* DATA AND LUT LOAD BIT DEFINITIONS */ #define GP3_LUT_HDR_WRAP 0x80000000 #define GP3_LUT_HDR_TYPE 0x40000000 #define GP3_LUT_HDR_DATA_ENABLE 0x00000003 #define GP3_DATA_LOAD_HDR_WRAP 0x80000000 #define GP3_DATA_LOAD_HDR_TYPE 0x60000000 #define GP3_DATA_LOAD_HDR_ENABLE 0x00000001 #define GP3_HOST_SOURCE_TYPE 0x00000000 #define GP3_CH3_HOST_SOURCE_TYPE 0x20000000 #define GP3_OLD_PATTERN_COLORS 0x40000000 #define GP3_LUT_DATA_TYPE 0x60000000 #define GP3_BASE_OFFSET_DSTMASK 0xFFC00000 #define GP3_BASE_OFFSET_SRCMASK 0x003FF000 #define GP3_BASE_OFFSET_CH3MASK 0x00000FFC /*----------------------------------------------------------------*/ /* VIDEO GENERATOR DEFINITIONS */ /*----------------------------------------------------------------*/ #define DC3_UNLOCK 0x00000000 /* Unlock register */ #define DC3_GENERAL_CFG 0x00000004 /* Config registers */ #define DC3_DISPLAY_CFG 0x00000008 #define DC3_ARB_CFG 0x0000000C #define DC3_FB_ST_OFFSET 0x00000010 /* Frame buffer start offset */ #define DC3_CB_ST_OFFSET 0x00000014 /* Compression start offset */ #define DC3_CURS_ST_OFFSET 0x00000018 /* Cursor buffer start offset */ #define DC3_VID_Y_ST_OFFSET 0x00000020 /* Video Y Buffer start offset */ #define DC3_VID_U_ST_OFFSET 0x00000024 /* Video U Buffer start offset */ #define DC3_VID_V_ST_OFFSET 0x00000028 /* Video V Buffer start offset */ #define DC3_DV_TOP 0x0000002C /* DV Ram Limit Register */ #define DC3_LINE_SIZE 0x00000030 /* Video, CB, and FB line sizes */ #define DC3_GFX_PITCH 0x00000034 /* FB and DB skip counts */ #define DC3_VID_YUV_PITCH 0x00000038 /* Y, U and V buffer skip counts */ #define DC3_H_ACTIVE_TIMING 0x00000040 /* Horizontal timings */ #define DC3_H_BLANK_TIMING 0x00000044 #define DC3_H_SYNC_TIMING 0x00000048 #define DC3_V_ACTIVE_TIMING 0x00000050 /* Vertical Timings */ #define DC3_V_BLANK_TIMING 0x00000054 #define DC3_V_SYNC_TIMING 0x00000058 #define DC3_FB_ACTIVE 0x0000005C #define DC3_CURSOR_X 0x00000060 /* Cursor X position */ #define DC3_CURSOR_Y 0x00000064 /* Cursor Y Position */ #define DC3_LINE_CNT_STATUS 0x0000006C #define DC3_PAL_ADDRESS 0x00000070 /* Palette Address */ #define DC3_PAL_DATA 0x00000074 /* Palette Data */ #define DC3_DFIFO_DIAG 0x00000078 /* Display FIFO diagnostic */ #define DC3_CFIFO_DIAG 0x0000007C /* Compression FIFO diagnostic */ #define DC3_VID_DS_DELTA 0x00000080 /* Vertical Downscaling fraction */ #define DC3_PHY_MEM_OFFSET 0x00000084 /* VG Base Address Register */ #define DC3_DV_CTL 0x00000088 /* Dirty-Valid Control Register */ #define DC3_DV_ACC 0x0000008C /* Dirty-Valid RAM Access */ #define DC3_GFX_SCALE 0x00000090 /* Graphics Scaling */ #define DC3_IRQ_FILT_CTL 0x00000094 /* VBlank interrupt and filters */ #define DC3_FILT_COEFF1 0x00000098 #define DC3_FILT_COEFF2 0x0000009C #define DC3_VBI_EVEN_CTL 0x000000A0 /* VBI Data Buffer Controls */ #define DC3_VBI_ODD_CTL 0x000000A4 #define DC3_VBI_HOR 0x000000A8 #define DC3_VBI_LN_ODD 0x000000AC #define DC3_VBI_LN_EVEN 0x000000B0 #define DC3_VBI_PITCH 0x000000B4 #define DC3_COLOR_KEY 0x000000B8 /* Graphics color key */ #define DC3_COLOR_MASK 0x000000BC /* Graphics color key mask */ #define DC3_CLR_KEY_X 0x000000C0 #define DC3_CLR_KEY_Y 0x000000C4 #define DC3_IRQ 0x000000C8 #define DC3_GENLK_CTL 0x000000D4 #define DC3_VID_EVEN_Y_ST_OFFSET 0x000000D8 /* Even field video buffers */ #define DC3_VID_EVEN_U_ST_OFFSET 0x000000DC #define DC3_VID_EVEN_V_ST_OFFSET 0x000000E0 #define DC3_V_ACTIVE_EVEN 0x000000E4 /* Even field timing registers */ #define DC3_V_BLANK_EVEN 0x000000E8 #define DC3_V_SYNC_EVEN 0x000000EC /* UNLOCK VALUE */ #define DC3_UNLOCK_VALUE 0x00004758 /* used to unlock DC regs */ /* VG GEODELINK DEVICE SMI MSR FIELDS */ #define DC3_VG_BL_MASK 0x00000001 #define DC3_MISC_MASK 0x00000002 #define DC3_ISR0_MASK 0x00000004 #define DC3_VGA_BL_MASK 0x00000008 #define DC3_CRTCIO_MSK 0x00000010 #define DC3_VG_BLANK_SMI 0x00000001 #define DC3_MISC_SMI 0x00000002 #define DC3_ISR0_SMI 0x00000004 #define DC3_VGA_BLANK_SMI 0x00000008 #define DC3_CRTCIO_SMI 0x00000010 /* DC3_GENERAL_CFG BIT FIELDS */ #define DC3_GCFG_DBUG 0x80000000 #define DC3_GCFG_DBSL 0x40000000 #define DC3_GCFG_CFRW 0x20000000 #define DC3_GCFG_DIAG 0x10000000 #define DC3_GCFG_CRC_MODE 0x08000000 #define DC3_GCFG_SGFR 0x04000000 #define DC3_GCFG_SGRE 0x02000000 #define DC3_GCFG_SIGE 0x01000000 #define DC3_GCFG_SIG_SEL 0x00800000 #define DC3_GCFG_YUV_420 0x00100000 #define DC3_GCFG_VDSE 0x00080000 #define DC3_GCFG_VGAFT 0x00040000 #define DC3_GCFG_FDTY 0x00020000 #define DC3_GCFG_STFM 0x00010000 #define DC3_GCFG_DFHPEL_MASK 0x0000F000 #define DC3_GCFG_DFHPSL_MASK 0x00000F00 #define DC3_GCFG_VGAE 0x00000080 #define DC3_GCFG_DECE 0x00000040 #define DC3_GCFG_CMPE 0x00000020 #define DC3_GCFG_FILT_SIG_SEL 0x00000010 #define DC3_GCFG_VIDE 0x00000008 #define DC3_GCFG_CLR_CUR 0x00000004 #define DC3_GCFG_CURE 0x00000002 #define DC3_GCFG_DFLE 0x00000001 /* DC3_DISPLAY_CFG BIT FIELDS */ #define DC3_DCFG_VISL 0x08000000 #define DC3_DCFG_FRLK 0x04000000 #define DC3_DCFG_PALB 0x02000000 #define DC3_DCFG_DCEN 0x01000000 #define DC3_DCFG_VFHPEL_MASK 0x000F0000 #define DC3_DCFG_VFHPSL_MASK 0x0000F000 #define DC3_DCFG_16BPP_MODE_MASK 0x00000C00 #define DC3_DCFG_16BPP 0x00000000 #define DC3_DCFG_15BPP 0x00000400 #define DC3_DCFG_12BPP 0x00000800 #define DC3_DCFG_DISP_MODE_MASK 0x00000300 #define DC3_DCFG_DISP_MODE_8BPP 0x00000000 #define DC3_DCFG_DISP_MODE_16BPP 0x00000100 #define DC3_DCFG_DISP_MODE_24BPP 0x00000200 #define DC3_DCFG_DISP_MODE_32BPP 0x00000300 #define DC3_DCFG_TRUP 0x00000040 #define DC3_DCFG_VDEN 0x00000010 #define DC3_DCFG_GDEN 0x00000008 #define DC3_DCFG_TGEN 0x00000001 /* DC3_ARB_CFG BIT FIELDS */ #define DC3_ACFG_LB_LOAD_WM_EN 0x00100000 #define DC3_ACFG_LB_LOAD_WM_MASK 0x000F0000 #define DC3_ACFG_LPEN_END_COUNT_MASK 0x0000FE00 #define DC3_ACFG_HPEN_SBINV 0x00000100 #define DC3_ACFG_HPEN_FB_INV_HALFSB 0x00000080 #define DC3_ACFG_HPEN_FB_INV_SBRD 0x00000040 #define DC3_ACFG_HPEN_FB_INV 0x00000020 #define DC3_ACFG_HPEN_1LB_INV 0x00000010 #define DC3_ACFG_HPEN_2LB_INV 0x00000008 #define DC3_ACFG_HPEN_3LB_INV 0x00000004 #define DC3_ACFG_HPEN_LB_FILL 0x00000002 #define DC3_ACFG_LPEN_VSYNC 0x00000001 /* DC3_FB_ST_OFFSET BIT FIELDS */ #define DC3_FB_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_CB_ST_OFFSET BIT FIELDS */ #define DC3_CB_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_CURS_ST_OFFSET BIT FIELDS */ #define DC3_CURS_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_ICON_ST_OFFSET BIT FIELDS */ #define DC3_ICON_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_VID_Y_ST_OFFSET BIT FIELDS */ #define DC3_VID_Y_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_VID_U_ST_OFFSET BIT FIELDS */ #define DC3_VID_U_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_VID_V_ST_OFFSET BIT FIELDS */ #define DC3_VID_V_ST_OFFSET_MASK 0x0FFFFFFF /* DC3_DV_TOP BIT FIELDS */ #define DC3_DVTOP_ENABLE 0x00000001 #define DC3_DVTOP_MAX_MASK 0x00FFFC00 #define DC3_DVTOP_MAX_SHIFT 10 /* DC3_LINE_SIZE BIT FIELDS */ #define DC3_LINE_SIZE_VLS_MASK 0x3FF00000 #define DC3_LINE_SIZE_CBLS_MASK 0x0007F000 #define DC3_LINE_SIZE_FBLS_MASK 0x000003FF #define DC3_LINE_SIZE_CB_SHIFT 12 #define DC3_LINE_SIZE_VB_SHIFT 20 /* DC3_GFX_PITCH BIT FIELDS */ #define DC3_GFX_PITCH_CBP_MASK 0xFFFF0000 #define DC3_GFX_PITCH_FBP_MASK 0x0000FFFF /* DC3_VID_YUV_PITCH BIT FIELDS */ #define DC3_YUV_PITCH_UVP_MASK 0xFFFF0000 #define DC3_YUV_PITCH_YBP_MASK 0x0000FFFF /* DC3_H_ACTIVE_TIMING BIT FIELDS */ #define DC3_HAT_HT_MASK 0x0FF80000 #define DC3_HAT_HA_MASK 0x00000FF8 /* DC3_H_BLANK_TIMING BIT FIELDS */ #define DC3_HBT_HBE_MASK 0x0FF80000 #define DC3_HBT_HBS_MASK 0x00000FF8 /* DC3_H_SYNC_TIMING BIT FIELDS */ #define DC3_HST_HSE_MASK 0x0FF80000 #define DC3_HST_HSS_MASK 0x00000FF8 /* DC3_V_ACTIVE_TIMING BIT FIELDS */ #define DC3_VAT_VT_MASK 0x07FF0000 #define DC3_VAT_VA_MASK 0x000007FF /* DC3_V_BLANK_TIMING BIT FIELDS */ #define DC3_VBT_VBE_MASK 0x07FF0000 #define DC3_VBT_VBS_MASK 0x000007FF /* DC3_V_SYNC_TIMING BIT FIELDS */ #define DC3_VST_VSE_MASK 0x07FF0000 #define DC3_VST_VSS_MASK 0x000007FF /* DC3_LINE_CNT_STATUS BIT FIELDS */ #define DC3_LNCNT_DNA 0x80000000 #define DC3_LNCNT_VNA 0x40000000 #define DC3_LNCNT_VSA 0x20000000 #define DC3_LNCNT_VINT 0x10000000 #define DC3_LNCNT_FLIP 0x08000000 #define DC3_LNCNT_V_LINE_CNT 0x07FF0000 #define DC3_LNCNT_VFLIP 0x00008000 #define DC3_LNCNT_SIGC 0x00004000 #define DC3_LNCNT_EVEN_FIELD 0x00002000 #define DC3_LNCNT_SS_LINE_CMP 0x000007FF /* DC3_VID_DS_DELTA BIT FIELDS */ #define DC3_DS_DELTA_MASK 0xFFFC0000 #define DC3_601_VSYNC_SHIFT_MASK 0x00000FFF #define DC3_601_VSYNC_SHIFT_ENABLE 0x00008000 /* DC3_DV_CTL BIT DEFINITIONS */ #define DC3_DV_LINE_SIZE_MASK 0x00000C00 #define DC3_DV_LINE_SIZE_1024 0x00000000 #define DC3_DV_LINE_SIZE_2048 0x00000400 #define DC3_DV_LINE_SIZE_4096 0x00000800 #define DC3_DV_LINE_SIZE_8192 0x00000C00 /* DC3_IRQ_FILT_CTL DEFINITIONS */ #define DC3_IRQFILT_LB_MASK 0x80000200 #define DC3_IRQFILT_LB_COEFF 0x00000000 #define DC3_IRQFILT_SCALER_FILTER 0x00000200 #define DC3_IRQFILT_SYNCHRONIZER 0x80000000 #define DC3_IRQFILT_FLICKER_FILTER 0x80000200 #define DC3_IRQFILT_LB_SEL_MASK 0x60000000 #define DC3_IRQFILT_INTL_ADDR 0x10000000 #define DC3_IRQFILT_LINE_MASK 0x07FF0000 #define DC3_IRQFILT_ALPHA_FILT_EN 0x00004000 #define DC3_IRQFILT_GFX_FILT_EN 0x00001000 #define DC3_IRQFILT_INTL_EN 0x00000800 #define DC3_IRQFILT_H_FILT_SEL 0x00000400 #define DC3_IRQFILT_LB_ADDR 0x00000100 /* DC3_VBI_EVEN_CTL DEFINITIONS */ #define DC3_VBI_EVEN_ENABLE_CRC (1L << 31) #define DC3_VBI_EVEN_CTL_ENABLE_16 (1L << 30) #define DC3_VBI_EVEN_CTL_UPSCALE (1L << 29) #define DC3_VBI_ENABLE (1L << 28) #define DC3_VBI_EVEN_CTL_OFFSET_MASK 0x0FFFFFFF /* DC3_VBI_ODD_CTL DEFINITIONS */ #define DC3_VBI_ODD_CTL_OFFSET_MASK 0x0FFFFFFF /* DC3_VBI_HOR BIT DEFINITIONS */ #define DC3_VBI_HOR_END_SHIFT 16 #define DC3_VBI_HOR_END_MASK 0x0FFF0000 #define DC3_VBI_HOR_START_MASK 0x00000FFF /* DC3_VBI_LN_ODD BIT DEFINITIONS */ #define DC3_VBI_ODD_ENABLE_SHIFT 2 #define DC3_VBI_ODD_ENABLE_MASK 0x01FFFFFC #define DC3_VBI_ODD_LINE_SHIFT 25 #define DC3_VBI_ODD_LINE_MASK 0xFE000000 /* DC3_VBI_LN_EVEN BIT DEFINITIONS */ #define DC3_VBI_EVEN_ENABLE_SHIFT 2 #define DC3_VBI_EVEN_ENABLE_MASK 0x01FFFFFC #define DC3_VBI_EVEN_LINE_SHIFT 25 #define DC3_VBI_EVEN_LINE_MASK 0xFE000000 /* DC3_COLOR_KEY DEFINITIONS */ #define DC3_CLR_KEY_DATA_MASK 0x00FFFFFF #define DC3_CLR_KEY_ENABLE 0x01000000 /* DC3_IRQ DEFINITIONS */ #define DC3_IRQ_MASK 0x00000001 #define DC3_VSYNC_IRQ_MASK 0x00000002 #define DC3_IRQ_STATUS 0x00010000 #define DC3_VSYNC_IRQ_STATUS 0x00020000 /* DC3_GENLK_CTL DEFINITIONS */ #define DC3_GC_FLICKER_FILTER_NONE 0x00000000 #define DC3_GC_FLICKER_FILTER_1_16 0x10000000 #define DC3_GC_FLICKER_FILTER_1_8 0x20000000 #define DC3_GC_FLICKER_FILTER_1_4 0x40000000 #define DC3_GC_FLICKER_FILTER_5_16 0x50000000 #define DC3_GC_FLICKER_FILTER_MASK 0xF0000000 #define DC3_GC_ALPHA_FLICK_ENABLE 0x02000000 #define DC3_GC_FLICKER_FILTER_ENABLE 0x01000000 #define DC3_GC_VIP_VID_OK 0x00800000 #define DC3_GC_GENLK_ACTIVE 0x00400000 #define DC3_GC_SKEW_WAIT 0x00200000 #define DC3_GC_VSYNC_WAIT 0x00100000 #define DC3_GC_GENLOCK_TO_ENABLE 0x00080000 #define DC3_GC_GENLOCK_ENABLE 0x00040000 #define DC3_GC_GENLOCK_SKEW_MASK 0x0003FFFF /* VGA DEFINITIONS */ #define DC3_SEQUENCER_INDEX 0x03C4 #define DC3_SEQUENCER_DATA 0x03C5 #define DC3_SEQUENCER_RESET 0x00 #define DC3_SEQUENCER_CLK_MODE 0x01 #define DC3_RESET_VGA_DISP_ENABLE 0x03 #define DC3_CLK_MODE_SCREEN_OFF 0x20 /* DOT CLOCK FREQUENCY STRUCTURE */ /* Note that m, n and p refer to the register m, n and p */ /* and not the m, n and p from the PLL equation. The PLL */ /* equation adds 1 to each value. */ typedef struct tagPLLFrequency { unsigned long pll_value; unsigned long frequency; } PLL_FREQUENCY; /* VG MSRS */ #define DC3_SPARE_MSR 0x2011 #define DC3_RAM_CTL 0x2012 /* DC3_SPARE_MSR DEFINITIONS */ #define DC3_SPARE_DISABLE_CFIFO_HGO 0x00000800 #define DC3_SPARE_VFIFO_ARB_SELECT 0x00000400 #define DC3_SPARE_WM_LPEN_OVRD 0x00000200 #define DC3_SPARE_LOAD_WM_LPEN_MASK 0x00000100 #define DC3_SPARE_DISABLE_INIT_VID_PRI 0x00000080 #define DC3_SPARE_DISABLE_VFIFO_WM 0x00000040 #define DC3_SPARE_DISABLE_CWD_CHECK 0x00000020 #define DC3_SPARE_PIX8_PAN_FIX 0x00000010 #define DC3_SPARE_FIRST_REQ_MASK 0x00000002 /* VG DIAG DEFINITIONS */ #define DC3_MBD_DIAG_EN0 0x00008000 #define DC3_MBD_DIAG_EN1 0x80000000 #define DC3_DIAG_DOT_CRTC_DP 0x00000082 #define DC3_DIAG_DOT_CRTC_DP_HIGH 0x00820000 #define DC3_DIAG_EVEN_FIELD 0x00002000 /*----------------------------------------------------------------*/ /* DISPLAY FILTER DEFINITIONS */ /*----------------------------------------------------------------*/ #define DF_VIDEO_CONFIG 0x00000000 #define DF_DISPLAY_CONFIG 0x00000008 #define DF_VIDEO_X_POS 0x00000010 #define DF_VIDEO_Y_POS 0x00000018 #define DF_VIDEO_SCALER 0x00000020 #define DF_VIDEO_COLOR_KEY 0x00000028 #define DF_VIDEO_COLOR_MASK 0x00000030 #define DF_PALETTE_ADDRESS 0x00000038 #define DF_PALETTE_DATA 0x00000040 #define DF_SATURATION_LIMIT 0x00000048 #define DF_VID_MISC 0x00000050 #define DF_VIDEO_YSCALE 0x00000060 #define DF_VIDEO_XSCALE 0x00000068 #define DF_VID_CRC 0x00000088 #define DF_VID_CRC32 0x00000090 #define DF_VID_ALPHA_CONTROL 0x00000098 #define DF_CURSOR_COLOR_KEY 0x000000A0 #define DF_CURSOR_COLOR_MASK 0x000000A8 #define DF_CURSOR_COLOR_1 0x000000B0 #define DF_CURSOR_COLOR_2 0x000000B8 #define DF_ALPHA_XPOS_1 0x000000C0 #define DF_ALPHA_YPOS_1 0x000000C8 #define DF_ALPHA_COLOR_1 0x000000D0 #define DF_ALPHA_CONTROL_1 0x000000D8 #define DF_ALPHA_XPOS_2 0x000000E0 #define DF_ALPHA_YPOS_2 0x000000E8 #define DF_ALPHA_COLOR_2 0x000000F0 #define DF_ALPHA_CONTROL_2 0x000000F8 #define DF_ALPHA_XPOS_3 0x00000100 #define DF_ALPHA_YPOS_3 0x00000108 #define DF_ALPHA_COLOR_3 0x00000110 #define DF_ALPHA_CONTROL_3 0x00000118 #define DF_VIDEO_REQUEST 0x00000120 #define DF_ALPHA_WATCH 0x00000128 #define DF_VIDEO_TEST_MODE 0x00000130 #define DF_VID_YPOS_EVEN 0x00000138 #define DF_VID_ALPHA_Y_EVEN_1 0x00000140 #define DF_VID_ALPHA_Y_EVEN_2 0x00000148 #define DF_VID_ALPHA_Y_EVEN_3 0x00000150 #define DF_VIDEO_PANEL_TIM1 0x00000400 #define DF_VIDEO_PANEL_TIM2 0x00000408 #define DF_POWER_MANAGEMENT 0x00000410 #define DF_DITHER_CONTROL 0x00000418 #define DF_DITHER_ACCESS 0x00000448 #define DF_DITHER_DATA 0x00000450 #define DF_PANEL_CRC 0x00000458 #define DF_PANEL_CRC32 0x00000468 #define DF_COEFFICIENT_BASE 0x00001000 /* DF_VIDEO_CONFIG BIT DEFINITIONS */ #define DF_VCFG_VID_EN 0x00000001 #define DF_VCFG_VID_INP_FORMAT 0x0000000C #define DF_VCFG_SC_BYP 0x00000020 #define DF_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 #define DF_VCFG_INIT_READ_MASK 0x01FF0000 #define DF_VCFG_LINE_SIZE_BIT8 0x08000000 #define DF_VCFG_LINE_SIZE_BIT9 0x04000000 #define DF_VCFG_4_2_0_MODE 0x10000000 #define DF_VCFG_UYVY_FORMAT 0x00000000 #define DF_VCFG_Y2YU_FORMAT 0x00000004 #define DF_VCFG_YUYV_FORMAT 0x00000008 #define DF_VCFG_YVYU_FORMAT 0x0000000C /* DF_DISPLAY_CONFIG BIT DEFINITIONS */ #define DF_DCFG_DIS_EN 0x00000001 #define DF_DCFG_HSYNC_EN 0x00000002 #define DF_DCFG_VSYNC_EN 0x00000004 #define DF_DCFG_DAC_BL_EN 0x00000008 #define DF_DCFG_CRT_HSYNC_POL 0x00000100 #define DF_DCFG_CRT_VSYNC_POL 0x00000200 #define DF_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 #define DF_DCFG_CRT_SYNC_SKW_INIT 0x00010000 #define DF_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 #define DF_DCFG_PWR_SEQ_DLY_INIT 0x00080000 #define DF_DCFG_VG_CK 0x00100000 #define DF_DCFG_GV_PAL_BYP 0x00200000 #define DF_DAC_VREF 0x04000000 /* DF_VID_MISC BIT DEFINITIONS */ #define DF_GAMMA_BYPASS_BOTH 0x00000001 #define DF_DAC_POWER_DOWN 0x00000400 #define DF_ANALOG_POWER_DOWN 0x00000800 #define DF_USER_IMPLICIT_SCALING 0x00001000 /* DF_VID_ALPHA_CONTROL DEFINITIONS */ #define DF_HD_VIDEO 0x00000040 #define DF_YUV_CSC_EN 0x00000080 #define DF_NO_CK_OUTSIDE_ALPHA 0x00000100 #define DF_HD_GRAPHICS 0x00000200 #define DF_CSC_VIDEO_YUV_TO_RGB 0x00000400 #define DF_CSC_GRAPHICS_RGB_TO_YUV 0x00000800 #define DF_CSC_VOP_RGB_TO_YUV 0x00001000 #define DF_VIDEO_INPUT_IS_RGB 0x00002000 #define DF_VID_ALPHA_EN 0x00004000 #define DF_ALPHA_DRGB 0x00008000 /* VIDEO CURSOR COLOR KEY DEFINITIONS */ #define DF_CURSOR_COLOR_KEY_ENABLE 0x20000000 /* ALPHA COLOR BIT DEFINITION */ #define DF_ALPHA_COLOR_ENABLE 0x01000000 /* ALPHA CONTROL BIT DEFINITIONS */ #define DF_ACTRL_WIN_ENABLE 0x00010000 #define DF_ACTRL_LOAD_ALPHA 0x00020000 #define DF_ACTRL_PERPIXEL_EN 0x00040000 /* DF_VIDEO_SCALER DEFINITIONS */ #define DF_SCALE_128_PHASES 0x00002000 #define DF_SCALE_DOUBLE_H_DOWNSCALE 0x00004000 /* DEFAULT PANEL TIMINGS DEFINITIONS */ #define DF_DEFAULT_TFT_PMTIM1 0x00000000 #define DF_DEFAULT_XVGA_PMTIM1 0x00000000 #define DF_DEFAULT_TFT_PMTIM2 0x08C00000 #define DF_DEFAULT_XVGA_PMTIM2 0x08C10000 #define DF_DEFAULT_TFT_PAD_SEL_LOW 0xDFFFFFFF #define DF_DEFAULT_TFT_PAD_SEL_HIGH 0x0000003F #define DF_DEFAULT_XVGA_PAD_SEL_LOW 0x00000000 #define DF_DEFAULT_XVGA_PAD_SEL_HIGH 0x00000000 #define DF_DEFAULT_DITHCTL 0x00000070 #define DF_DEFAULT_TV_PAD_SEL_HIGH 0x000000BF #define DF_DEFAULT_TV_PAD_SEL_LOW 0xDFFFFFFF #define DF_INVERT_VOP_CLOCK 0x00000080 /* DF_VIDEO_PANEL_TIM2 DEFINITIONS */ #define DF_PMTIM2_TFT_PASSHTHROUGH 0x40000000 /* DF_POWER_MANAGEMENT DEFINITIONS */ #define DF_PM_PANEL_ON 0x01000000 #define DF_PM_INVERT_SHFCLK 0x00002000 /* DISPLAY FILTER MSRS */ #define DF_MBD_MSR_DIAG_DF 0x2010 #define DF_MSR_PAD_SEL 0x2011 #define DF_DIAG_32BIT_CRC 0x80000000 #define DF_OUTPUT_CRT 0x00000000 #define DF_OUTPUT_PANEL 0x00000008 #define DF_OUTPUT_VOP 0x00000030 #define DF_OUTPUT_DRGB 0x00000038 #define DF_SIMULTANEOUS_CRT_FP 0x00008000 #define DF_CONFIG_OUTPUT_MASK 0x00000038 /*----------------------------------------------------------------*/ /* MSR DEFINITIONS */ /*----------------------------------------------------------------*/ /*----------------------------*/ /* STATIC GEODELINK ADRESSES */ /*----------------------------*/ #define MSR_ADDRESS_GLIU0 0x10000000 #define MSR_ADDRESS_GLIU1 0x40000000 #define MSR_ADDRESS_GLIU2 0x51010000 #define MSR_ADDRESS_5535MPCI 0x51000000 #define MSR_ADDRESS_VAIL 0x00000000 /*----------------------------*/ /* UNIVERSAL DEVICE MSRS */ /*----------------------------*/ #define MSR_GEODELINK_CAP 0x2000 #define MSR_GEODELINK_CONFIG 0x2001 #define MSR_GEODELINK_SMI 0x2002 #define MSR_GEODELINK_ERROR 0x2003 #define MSR_GEODELINK_PM 0x2004 #define MSR_GEODELINK_DIAG 0x2005 /*----------------------------*/ /* DEVICE CLASS CODES */ /*----------------------------*/ #define MSR_CLASS_CODE_GLIU 0x01 #define MSR_CLASS_CODE_GLCP 0x02 #define MSR_CLASS_CODE_MPCI 0x05 #define MSR_CLASS_CODE_MC 0x20 #define MSR_CLASS_CODE_GP 0x3D #define MSR_CLASS_CODE_VG 0x3E #define MSR_CLASS_CODE_DF 0x3F #define MSR_CLASS_CODE_FG 0xF0 #define MSR_CLASS_CODE_VAIL 0x86 #define MSR_CLASS_CODE_USB 0x42 #define MSR_CLASS_CODE_USB2 0x43 #define MSR_CLASS_CODE_ATAC 0x47 #define MSR_CLASS_CODE_MDD 0xDF #define MSR_CLASS_CODE_ACC 0x33 #define MSR_CLASS_CODE_AES 0x30 #define MSR_CLASS_CODE_VIP 0x3C #define MSR_CLASS_CODE_REFLECTIVE 0xFFF #define MSR_CLASS_CODE_UNPOPULATED 0x7FF /*----------------------------*/ /* GLIU MSR DEFINITIONS */ /*----------------------------*/ #define MSR_GLIU_CAP 0x0086 #define MSR_GLIU_WHOAMI 0x008B #define NUM_PORTS_MASK 0x00380000 #define NUM_PORTS_SHIFT 19 #define WHOAMI_MASK 0x07 /*----------------------------*/ /* GLCP MSR DEFINITIONS */ /*----------------------------*/ #define GLCP_CLKOFF 0x0010 #define GLCP_CLKACTIVE 0x0011 #define GLCP_CLKDISABLE 0x0012 #define GLCP_CLK4ACK 0x0013 #define GLCP_SYS_RSTPLL 0x0014 #define GLCP_DOTPLL 0x0015 #define GLCP_DBGCLKCTL 0x0016 #define GLCP_REVID 0x0017 #define GLCP_RAW_DIAG 0x0028 #define GLCP_SETM0CTL 0x0040 #define GLCP_SETN0CTL 0x0048 #define GLCP_CMPVAL0 0x0050 #define GLCP_CMPMASK0 0x0051 #define GLCP_REGA 0x0058 #define GLCP_REGB 0x0059 #define GLCP_REGAMASK 0x005A #define GLCP_REGAVAL 0x005B #define GLCP_REGBMASK 0x005C #define GLCP_REGBVAL 0x005D #define GLCP_FIFOCTL 0x005E #define GLCP_DIAGCTL 0x005F #define GLCP_H0CTL 0x0060 #define GLCP_XSTATE 0x0066 #define GLCP_YSTATE 0x0067 #define GLCP_ACTION0 0x0068 /* GLCP_DOTPLL DEFINITIONS */ #define GLCP_DOTPLL_RESET 0x00000001 #define GLCP_DOTPLL_BYPASS 0x00008000 #define GLCP_DOTPLL_HALFPIX 0x01000000 #define GLCP_DOTPLL_LOCK 0x02000000 #define GLCP_DOTPLL_VIPCLK 0x00008000 #define GLCP_DOTPLL_DIV4 0x00010000 /* GLCP DIAG DEFINITIONS */ #define GLCP_MBD_DIAG_SEL0 0x00000007 #define GLCP_MBD_DIAG_EN0 0x00008000 #define GLCP_MBD_DIAG_SEL1 0x00070000 #define GLCP_MBD_DIAG_EN1 0x80000000 /*--------------------------------*/ /* DISPLAY FILTER MSR DEFINITIONS */ /*--------------------------------*/ /* DISPLAY FILTER MBD_MSR_DIAG DEFINITIONS */ #define DF_MBD_DIAG_SEL0 0x00007FFF #define DF_MBD_DIAG_EN0 0x00008000 #define DF_MBD_DIAG_SEL1 0x7FFF0000 #define DF_MBD_DIAG_EN1 0x80000000 /* DISPLAY FILTER MBD_MSR_CONFIG DEFINITIONS */ #define DF_CONFIG_FMT_MASK 0x00000038 #define DF_CONFIG_FMT_CRT 0x00000000 #define DF_CONFIG_FMT_FP 0x00000008 /*----------------------------------------------------------------*/ /* PCI DEFINITIONS */ /*----------------------------------------------------------------*/ #define PCI_VENDOR_DEVICE_GEODEGX 0x0028100B #define PCI_VENDOR_DEVICE_GEODEGX_VIDEO 0x0030100B #define PCI_VENDOR_DEVICE_GEODELX 0x20801022 #define PCI_VENDOR_DEVICE_GEODELX_VIDEO 0x20811022 #define PCI_VENDOR_5535 0x002B100B #define PCI_VENDOR_5536 0x20901022 /*----------------------------------------------------------------*/ /* VIP DEFINITIONS */ /*----------------------------------------------------------------*/ #define VIP_CONTROL1 0x00000000 #define VIP_CONTROL2 0x00000004 #define VIP_STATUS 0x00000008 #define VIP_INTERRUPT 0x0000000C #define VIP_CURRENT_TARGET 0x00000010 #define VIP_MAX_ADDRESS 0x00000014 #define VIP_TASKA_VID_EVEN_BASE 0x00000018 #define VIP_TASKA_VID_ODD_BASE 0x0000001C #define VIP_TASKA_VBI_EVEN_BASE 0x00000020 #define VIP_TASKA_VBI_ODD_BASE 0x00000024 #define VIP_TASKA_VID_PITCH 0x00000028 #define VIP_CONTROL3 0x0000002C #define VIP_TASKA_V_OFFSET 0x00000030 #define VIP_TASKA_U_OFFSET 0x00000034 #define VIP_TASKB_VID_EVEN_BASE 0x00000038 #define VIP_601_HORZ_END 0x00000038 #define VIP_TASKB_VID_ODD_BASE 0x0000003C #define VIP_601_HORZ_START 0x0000003C #define VIP_TASKB_VBI_EVEN_BASE 0x00000040 #define VIP_601_VBI_END 0x00000040 #define VIP_TASKB_VBI_ODD_BASE 0x00000044 #define VIP_601_VBI_START 0x00000044 #define VIP_TASKB_VID_PITCH 0x00000048 #define VIP_601_EVEN_START_STOP 0x00000048 #define VIP_TASKB_V_OFFSET 0x00000050 #define VIP_ODD_FIELD_DETECT 0x00000050 #define VIP_TASKB_U_OFFSET 0x00000054 #define VIP_ANC_MSG1_BASE 0x00000058 #define VIP_ANC_MSG2_BASE 0x0000005C #define VIP_ANC_MSG_SIZE 0x00000060 #define VIP_PAGE_OFFSET 0x00000068 #define VIP_VERTICAL_START_STOP 0x0000006C #define VIP_601_ODD_START_STOP 0x0000006C #define VIP_FIFO_ADDRESS 0x00000070 #define VIP_FIFO_DATA 0x00000074 #define VIP_VSYNC_ERR_COUNT 0x00000078 #define VIP_TASKA_U_EVEN_OFFSET 0x0000007C #define VIP_TASKA_V_EVEN_OFFSET 0x00000080 /* INDIVIDUAL REGISTER BIT DEFINITIONS */ /* Multibit register subsets are expressed as a mask and shift. */ /* Single bit values are represented as a mask. */ /* VIP_CONTROL1 REGISTER DEFINITIONS */ #define VIP_CONTROL1_DEFAULT_ANC_FF 2 #define VIP_CONTROL1_ANC_FF_MASK 0xE0000000 #define VIP_CONTROL1_ANC_FF_SHIFT 29 #define VIP_CONTROL1_DEFAULT_VID_FF 2 #define VIP_CONTROL1_VID_FF_MASK 0x1F000000 #define VIP_CONTROL1_VID_FF_SHIFT 24 #define VIP_CONTROL1_VDE_FF_MASK 0x00F00000 #define VIP_CONTROL1_VDE_FF_SHIFT 20 #define VIP_CONTROL1_NON_INTERLACED (1L << 19) #define VIP_CONTROL1_MSG_STRM_CTRL (1L << 18) #define VIP_CONTROL1_DISABLE_ZERO_DETECT (1L << 17) #define VIP_CONTROL1_DISABLE_DECIMATION (1L << 16) #define VIP_CONTROL1_CAPTURE_ENABLE_MASK 0x0000FF00 #define VIP_CONTROL1_CAPTURE_ENABLE_SHIFT 8 #define VIP_CONTROL1_RUNMODE_MASK 0x000000E0 #define VIP_CONTROL1_RUNMODE_SHIFT 5 #define VIP_CONTROL1_PLANAR (1L << 4) #define VIP_CONTROL1_MODE_MASK 0x0000000E #define VIP_CONTROL1_MODE_SHIFT 1 #define VIP_CONTROL1_RESET 0x00000001 /* VIP_CONTROL2 REGISTER DEFINITIONS */ #define VIP_CONTROL2_INVERT_POLARITY (1L << 31) #define VIP_CONTROL2_ADD_ERROR_ENABLE (1L << 30) #define VIP_CONTROL2_REPEAT_ENABLE (1L << 29) #define VIP_CONTROL2_SWC_ENABLE (1L << 28) #define VIP_CONTROL2_ANC10 (1L << 27) #define VIP_CONTROL2_ANCPEN (1L << 26) #define VIP_CONTROL2_LOOPBACK_ENABLE (1L << 25) #define VIP_CONTROL2_FIFO_ACCESS (1L << 24) #define VIP_CONTROL2_VERTERROR_ENABLE (1L << 15) #define VIP_CONTROL2_PAGECNT_MASK 0x00E00000 #define VIP_CONTROL2_PAGECNT_SHIFT 21 #define VIP_CONTROL2_DEFAULT_ANCTH 5 #define VIP_CONTROL2_ANCTH_MASK 0x001F0000 #define VIP_CONTROL2_ANCTH_SHIFT 16 #define VIP_CONTROL2_DEFAULT_VIDTH_420 19 #define VIP_CONTROL2_DEFAULT_VIDTH_422 19 #define VIP_CONTROL2_VIDTH_MASK 0x00007F00 #define VIP_CONTROL2_VIDTH_SHIFT 8 #define VIP_CONTROL2_SYNC2PIN_MASK 0x000000E0 #define VIP_CONTROL2_SYNC2PIN_SHIFT 5 #define VIP_CONTROL2_FIELD2VG_MASK 0x00000018 #define VIP_CONTROL2_FIELD2VG_SHIFT 3 #define VIP_CONTROL2_SYNC2VG_MASK 0x00000007 #define VIP_CONTROL2_SYNC2VG_SHIFT 0 /* VIP_CONTROL3 REGISTER DEFINITIONS */ #define VIP_CONTROL3_PLANAR_DEINT 0x00000400 #define VIP_CONTROL3_BASE_UPDATE 0x00000200 #define VIP_CONTROL3_DISABLE_OVERFLOW 0x00000100 #define VIP_CONTROL3_DECIMATE_EVEN 0x00000080 #define VIP_CONTROL3_TASK_POLARITY 0x00000040 #define VIP_CONTROL3_VSYNC_POLARITY 0x00000020 #define VIP_CONTROL3_HSYNC_POLARITY 0x00000010 #define VIP_CONTROL3_FIFO_RESET 0x00000001 /* VIP_STATUS REGISTER DEFINITIONS */ #define VIP_STATUS_ANC_COUNT_MASK 0xFF000000 #define VIP_STATUS_ANC_COUNT_SHIFT 24 #define VIP_STATUS_FIFO_ERROR 0x00700000 #define VIP_STATUS_ERROR_SHIFT 20 #define VIP_STATUS_DEC_COUNT (1L << 18) #define VIP_STATUS_SYNCOUT (1L << 17) #define VIP_STATUS_BASEREG_NOTUPDT (1L << 16) #define VIP_STATUS_MSGBUFF_ERR (1L << 14) #define VIP_STATUS_MSGBUFF2_FULL (1L << 13) #define VIP_STATUS_MSGBUFF1_FULL (1L << 12) #define VIP_STATUS_WRITES_COMPLETE (1L << 9) #define VIP_STATUS_FIFO_EMPTY (1L << 8) #define VIP_STATUS_FIELD (1L << 4) #define VIP_STATUS_VBLANK (1L << 3) #define VIP_STATUS_RUN_MASK 0x00000007 #define VIP_STATUS_RUN_SHIFT 0 /* VIP_CURRENT_TARGET REGISTER DEFINITIONS */ #define VIP_CTARGET_TLINE_MASK 0xFFFF0000 #define VIP_CTARGET_TLINE_SHIFT 16 #define VIP_CTARGET_CLINE_MASK 0x0000FFFF #define VIP_CTARGET_CLINE_SHIFT 0 /* VIP_MAX_ADDRESS REGISTER DEFINITIONS */ #define VIP_MAXADDR_MASK 0xFFFFFFFF #define VIP_MAXADDR_SHIFT 0 /* VIP BUFFER PITCH DEFINITIONS */ #define VIP_TASK_PITCH_MASK 0x0000FFFF #define VIP_TASK_PITCH_SHIFT 0 /* VERTICAL START/STOP */ #define VIP_VSTART_VERTEND_MASK 0x0FFF0000 #define VIP_VSTART_VERTEND_SHIFT 16 #define VIP_VSTART_VERTSTART_MASK 0x00000FFF #define VIP_VSTART_VERTSTART_SHIFT 0 /* VIP FIFO ADDRESS DEFINITIONS */ #define VIP_FIFO_ADDRESS_MASK 0x000000FF #define VIP_FIFO_ADDRESS_SHIFT 0 /* VIP VSYNC ERROR DEFINITIONS */ #define VIP_VSYNC_ERR_WINDOW_MASK 0xFF000000 #define VIP_VSYNC_ERR_WINDOW_SHIFT 24 #define VIP_VSYNC_ERR_COUNT_MASK 0x00FFFFFF #define VIP_VSYNC_ERR_COUNT_SHIFT 0 /*---------------------*/ /* VIP MSR DEFINITIONS */ /*---------------------*/ /* CAPABILITIES */ #define VIP_MSR_CAP_NSMI_MASK 0xF8000000 #define VIP_MSR_CAP_NSMI_SHIFT 27 #define VIP_MSR_CAP_NCLK_MASK 0x07000000 #define VIP_MSR_CAP_NCLK_SHIFT 24 #define VIP_MSR_CAP_DEVID_MASK 0x00FFFF00 #define VIP_MSR_CAP_DEVID_SHIFT 8 #define VIP_MSR_CAP_REVID_MASK 0x000000FF #define VIP_MSR_CAP_REVID_SHIFT 0 /* MASTER CONFIG */ #define VIP_MSR_MCR_SECOND_PRIORITY_MASK 0x00000700 #define VIP_MSR_MCR_SECOND_PRIORITY_SHIFT 8 #define VIP_MSR_MCR_PRIMARY_PRIORITY_MASK 0x00000070 #define VIP_MSR_MCR_PRIMARY_PRIORITY_SHIFT 4 #define VIP_MSR_MCR_PID_MASK 0x00000007 #define VIP_MSR_MCR_PID_SHIFT 0 /* VIP SMI */ #define VIP_MSR_SMI_FIFO_OVERFLOW (1L << 29) #define VIP_MSR_SMI_FIFO_THRESHOLD (1L << 28) #define VIP_MSR_SMI_LONGLINE (1L << 27) #define VIP_MSR_SMI_VERTICAL_TIMING (1L << 26) #define VIP_MSR_SMI_ACTIVE_PIXELS (1L << 25) #define VIP_MSR_SMI_CLOCK_INPUT (1L << 24) #define VIP_MSR_SMI_ANC_CHECKSUM_PARITY (1L << 23) #define VIP_MSR_SMI_MSG_BUFFER_FULL (1L << 22) #define VIP_MSR_SMI_END_VBLANK (1L << 21) #define VIP_MSR_SMI_START_VBLANK (1L << 20) #define VIP_MSR_SMI_START_EVEN (1L << 19) #define VIP_MSR_SMI_START_ODD (1L << 18) #define VIP_MSR_SMI_LINE_MATCH_TARGET (1L << 17) #define VIP_MSR_SMI_GLINK (1L << 16) /* VIP ERROR */ #define VIP_MSR_ERROR_ADDRESS_MASK (1L << 17) #define VIP_MSR_ERROR_ADDRESS_SHIFT 17 #define VIP_MSR_ERROR_ADDRESS_ENABLE (1L << 1) #define VIP_MSR_ERROR_ADDRESS_EN_SHIFT 1 #define VIP_MSR_ERROR_TYPE_MASK (1L << 16) #define VIP_MSR_ERROR_TYPE_SHIFT 16 #define VIP_MSR_ERROR_TYPE_ENABLE 1 #define VIP_MSR_ERROR_TYPE_EN_SHIFT 0 /* VIP POWER */ #define VIP_MSR_POWER_GLINK (1L << 0) #define VIP_MSR_POWER_CLOCK (1L << 2) /* VIP DIAG */ #define VIP_MSR_DIAG_BIST_WMASK 0x00000003 #define VIP_MSR_DIAG_BIST_RMASK 0x00000007 #define VIP_MSR_DIAG_BIST_SHIFT 0 #define VIP_MSR_DIAG_MSB_ENABLE (1L << 31) #define VIP_MSR_DIAG_SEL_UPPER_MASK 0x7FFF0000 #define VIP_MSR_DIAG_SEL_UPPER_SHIFT 16 #define VIP_MSR_DIAG_LSB_ENABLE (1L << 15) #define VIP_MSR_DIAG_SEL_LOWER_MASK 0x00007FFF #define VIP_MSR_DIAG_SEL_LOWER_SHIFT 0 /*----------------------------------------------------------------*/ /* VOP DEFINITIONS */ /*----------------------------------------------------------------*/ #define VOP_CONFIGURATION 0x00000800 #define VOP_SIGNATURE 0x00000808 /* VOP_CONFIGURATION BIT DEFINITIONS */ #define VOP_CONFIG_SWAPVBI 0x01000000 #define VOP_CONFIG_RGBMODE 0x00200000 #define VOP_CONFIG_SIGVAL 0x00100000 #define VOP_CONFIG_INVERT_DISPE 0x00080000 #define VOP_CONFIG_INVERT_VSYNC 0x00040000 #define VOP_CONFIG_INVERT_HSYNC 0x00020000 #define VOP_CONFIG_SWAPUV 0x00010000 #define VOP_CONFIG_VSYNC_MASK 0x0000C000 #define VOP_CONFIG_DISABLE_DECIMATE 0x00002000 #define VOP_CONFIG_ENABLE_601 0x00001000 #define VOP_CONFIG_VBI 0x00000800 #define VOP_CONFIG_TASK 0x00000200 #define VOP_CONFIG_SIG_FREE_RUN 0x00000100 #define VOP_CONFIG_ENABLE_SIGNATURE 0x00000080 #define VOP_CONFIG_SC_COMPATIBLE 0x00000040 #define VOP_CONFIG_422_COSITED 0x00000000 #define VOP_CONFIG_422_INTERSPERSED 0x00000010 #define VOP_CONFIG_422_ALTERNATING 0x00000020 #define VOP_CONFIG_422_MASK 0x00000030 #define VOP_CONFIG_EXTENDED_SAV 0x00000008 #define VOP_CONFIG_VIP2_16BIT 0x00000004 #define VOP_CONFIG_DISABLED 0x00000000 #define VOP_CONFIG_VIP1_1 0x00000001 #define VOP_CONFIG_VIP2_0 0x00000002 #define VOP_CONFIG_CCIR656 0x00000003 #define VOP_CONFIG_MODE_MASK 0x00000003 #endif xf86-video-geode-2.11.18/src/cim/cim_modes.c0000644000175000017500000030740612654445443015254 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron mode tables. */ /*-------------------------------*/ /* PREDEFINED DISPLAY TIMINGS */ /*-------------------------------*/ static const VG_DISPLAY_MODE CimarronDisplayModes[] = { /* 320 x 240 PANEL */ {VG_SUPPORTFLAG_75HZ | /* refresh rate = 75 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_PANEL, /* Panel Mode. */ VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_PANELOUT | /* Panel output. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC | /* negative syncs */ VG_MODEFLAG_QVGA, /* QVGA Panel size. */ 320, 240, /* No scaling. */ 320, 240, /* 320x240 active */ 320, 240, /* 320x240 panel */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0140, 0x0148, 0x0162, 0x0180, 0x0188, 0x0190, /* horiz timings */ 0x00F0, 0x00F4, 0x00F9, 0x00FD, 0x00FF, 0x0104, /* vertical timings */ (31L << 16) | ((2000L * 65536L) / 10000L), /* freq = 31.2000 MHz */ } , /* 640 x 400 */ {VG_SUPPORTFLAG_70HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC, /* negative HSYNC */ 640, 400, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x280, 0x288, 0x290, 0x2F0, 0x318, 0x320, /* horiz timings */ 0x190, 0x197, 0x19C, 0x19E, 0x1BA, 0x1C1, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (25L << 16) | ((1750L * 65536L) / 10000L), /* freq = 25.175 MHz */ } , /* 640x480 */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 640, 480, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0280, 0x0288, 0x0290, 0x02E8, 0x0318, 0x0320, /* horiz timings */ 0x01E0, 0x01E8, 0x01EA, 0x01EC, 0x0205, 0x020D, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (25L << 16) | ((1750L * 65536L) / 10000L), /* freq = 25.175 MHz */ } , {VG_SUPPORTFLAG_70HZ | /* refresh rate = 70 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ 0, 640, 480, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0280, 0x0280, 0x0298, 0x02D8, 0x0330, 0x0330, /* horiz timings */ 0x01E0, 0x01E0, 0x01E2, 0x01E5, 0x01F4, 0x01F4, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (28L << 16) | ((5600L * 65536L) / 10000L), /* freq = 28.560 MHz */ } , {VG_SUPPORTFLAG_72HZ | /* refresh rate = 72 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 640, 480, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0280, 0x0288, 0x0298, 0x02c0, 0x0338, 0x0340, /* horiz timings */ 0x01e0, 0x01e8, 0x01e9, 0x01ec, 0x0200, 0x0208, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (31L << 16) | ((5000L * 65536L) / 10000L), /* freq = 31.5 MHz */ } , {VG_SUPPORTFLAG_75HZ | /* refresh rate = 75 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 640, 480, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0280, 0x0280, 0x0290, 0x02D0, 0x0348, 0x0348, /* horiz timings */ 0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01F4, 0x01F4, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (31L << 16) | ((5000L * 65536L) / 10000L), /* freq = 31.5 MHz */ } , {VG_SUPPORTFLAG_85HZ | /* refresh rate = 85 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 640, 480, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0280, 0x0280, 0x02B8, 0x02F0, 0x0340, 0x0340, /* horiz timings */ 0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FD, 0x01FD, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (36L << 16) | ((0000L * 65536L) / 10000L), /* freq = 36.0 MHz */ } , {VG_SUPPORTFLAG_90HZ | /* refresh rate = 90 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ 0, 640, 480, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0280, 0x0280, 0x02A0, 0x02E0, 0x0340, 0x0340, /* horiz timings */ 0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FA, 0x01FA, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (37L << 16) | ((8890L * 65536L) / 10000L), /* freq = 37.889 MHz */ } , {VG_SUPPORTFLAG_100HZ | /* refresh rate = 100 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ 0, 640, 480, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0280, 0x0280, 0x02A8, 0x02E8, 0x0350, 0x0350, /* horiz timings */ 0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FD, 0x01FD, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (43L << 16) | ((1630L * 65536L) / 10000L), /* freq = 43.163 MHz */ } , /* 640 x 480 PANEL */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_PANEL, /* Panel Mode. */ VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_PANELOUT | /* Panel output. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 640, 480, /* No scaling. */ 640, 480, /* 640x480 active */ 640, 480, /* 640x480 panel */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320, /* horiz timings */ 0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (25L << 16) | ((1750L * 65536L) / 10000L), /* freq = 25.175 MHz */ } , /* 800x600 */ {VG_SUPPORTFLAG_56HZ | /* refresh rate = 56 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ 0, 800, 600, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0320, 0x0320, 0x0338, 0x0380, 0x0400, 0x0400, /* horiz timings */ 0x0258, 0x0258, 0x0259, 0x025B, 0x0271, 0x0271, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (36L << 16) | ((0000L * 65536L) / 10000L), /* freq = 36.0 MHz */ } , {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ 0, 800, 600, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0320, 0x0328, 0x0348, 0x03D0, 0x0418, 0x0420, /* horiz timings */ 0x0258, 0x0258, 0x0259, 0x025D, 0x0274, 0x0274, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (40L << 16) | ((0000L * 65536L) / 10000L), /* freq = 40.00 MHz */ } , {VG_SUPPORTFLAG_70HZ | /* refresh rate = 70 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ 0, 800, 600, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0320, 0x0320, 0x0348, 0x0398, 0x0410, 0x0410, /* horiz timings */ 0x0258, 0x0258, 0x025c, 0x025F, 0x0274, 0x0274, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (45L << 16) | ((7200L * 65536L) / 10000L), /* freq = 45.72 MHz */ } , {VG_SUPPORTFLAG_72HZ | /* refresh rate = 72 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ 0, 800, 600, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0320, 0x0320, 0x0358, 0x03D0, 0x0410, 0x0410, /* horiz timings */ 0x0258, 0x0258, 0x027D, 0x0283, 0x029A, 0x029A, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (49L << 16) | ((5000L * 65536L) / 10000L), /* freq = 49.5 MHz */ } , {VG_SUPPORTFLAG_75HZ | /* refresh rate = 75 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ 0, 800, 600, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0320, 0x0320, 0x0330, 0x0380, 0x0420, 0x0420, /* horiz timings */ 0x0258, 0x0258, 0x0259, 0x025C, 0x0271, 0x0271, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (49L << 16) | ((5000L * 65536L) / 10000L), /* freq = 49.5 MHz */ } , {VG_SUPPORTFLAG_85HZ | /* refresh rate = 85 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ 0, 800, 600, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0320, 0x0320, 0x0340, 0x0380, 0x0418, 0x0418, /* horiz timings */ 0x0258, 0x0258, 0x0259, 0x025C, 0x0277, 0x0277, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (56L << 16) | ((2500L * 65536L) / 10000L), /* freq = 56.25 MHz */ } , {VG_SUPPORTFLAG_90HZ | /* refresh rate = 90 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ 0, 800, 600, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0320, 0x0320, 0x0348, 0x03A0, 0x0420, 0x0420, /* horiz timings */ 0x0258, 0x0258, 0x0259, 0x025C, 0x0278, 0x0278, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (60L << 16) | ((650L * 65536L) / 10000L), /* freq = 60.065 MHz */ } , {VG_SUPPORTFLAG_100HZ | /* refresh rate = 100 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ 0, 800, 600, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0320, 0x0320, 0x0350, 0x03A8, 0x0430, 0x0430, /* horiz timings */ 0x0258, 0x0258, 0x0259, 0x025C, 0x0277, 0x027C, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (68L << 16) | ((1790L * 65536L) / 10000L), /* freq = 68.179 MHz */ } , /* 800x600 PANEL */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_PANEL, /* Panel Mode. */ VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_PANELOUT | /* Panel output. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 800, 600, /* No scaling. */ 800, 600, /* 800x600 active. */ 800, 600, /* 800x600 panel */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0320, 0x0320, 0x0348, 0x03C8, 0x0420, 0x0420, /* horiz timings */ 0x0258, 0x0258, 0x0259, 0x025D, 0x0274, 0x0274, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (40L << 16) | ((0000L * 65536L) / 10000L), /* freq = 40.00 MHz */ } , /* 1024x768 */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 1024, 768, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540, /* horiz timings */ 0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (65L << 16) | ((0000L * 65536L) / 10000L), /* freq = 65.00 MHz */ } , {VG_SUPPORTFLAG_70HZ | /* refresh rate = 70 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 1024, 768, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0400, 0x0400, 0x0418, 0x04A0, 0x0530, 0x0530, /* horiz timings */ 0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (75L << 16) | ((0000L * 65536L) / 10000L), /* freq = 75.0 MHz */ } , {VG_SUPPORTFLAG_72HZ | /* refresh rate = 72 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1024, 768, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0400, 0x0400, 0x0438, 0x04A8, 0x0550, 0x0550, /* horiz timings */ 0x0300, 0x0300, 0x0304, 0x0307, 0x0324, 0x0324, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (78L << 16) | ((7500L * 65536L) / 10000L), /* freq = 78.75 MHz */ } , {VG_SUPPORTFLAG_75HZ | /* refresh rate = 75 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1024, 768, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0400, 0x0400, 0x0410, 0x0470, 0x0520, 0x0520, /* horiz timings */ 0x0300, 0x0300, 0x0301, 0x0304, 0x0320, 0x0320, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (78L << 16) | ((7500L * 65536L) / 10000L), /* freq = 78.75 MHz */ } , {VG_SUPPORTFLAG_85HZ | /* refresh rate = 85 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1024, 768, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0400, 0x0400, 0x0430, 0x0490, 0x0560, 0x0560, /* horiz timings */ 0x0300, 0x0300, 0x0301, 0x0304, 0x0328, 0x0328, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (94L << 16) | ((5000L * 65536L) / 10000L), /* freq = 94.50 MHz */ } , {VG_SUPPORTFLAG_90HZ | /* refresh rate = 90 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1024, 768, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0400, 0x0400, 0x0440, 0x04B0, 0x0560, 0x0560, /* horiz timings */ 0x0300, 0x0300, 0x0301, 0x0304, 0x0329, 0x0329, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (100L << 16) | ((1870L * 65536L) / 10000L), /* freq = 100.187 MHz */ } , {VG_SUPPORTFLAG_100HZ | /* refresh rate = 100 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1024, 768, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0400, 0x0400, 0x0448, 0x04B8, 0x0570, 0x0570, /* horiz timings */ 0x0300, 0x0300, 0x0301, 0x0304, 0x032E, 0x032E, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (113L << 16) | ((3100L * 65536L) / 10000L), /* freq = 113.31 MHz */ } , /* 1024x768 PANEL */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_PANEL, /* Panel Mode. */ VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ VG_MODEFLAG_PANELOUT | /* Panel output. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 1024, 768, /* No scaling. */ 1024, 768, /* 1024x768 active. */ 1024, 768, /* 1024x768 panel */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540, /* horiz timings */ 0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (65L << 16) | ((0000L * 65536L) / 10000L), /* freq = 65.00 MHz */ } , /* 1152x864 */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1152, 864, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0480, 0x0480, 0x04C0, 0x0538, 0x05F0, 0x05F0, /* horiz timings */ 0x0360, 0x0360, 0x0361, 0x0364, 0x037F, 0x037F, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (81L << 16) | ((6000L * 65536L) / 10000L), /* freq = 81.60 MHz */ } , {VG_SUPPORTFLAG_70HZ | /* refresh rate = 70 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1152, 864, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0480, 0x0480, 0x04C8, 0x0540, 0x0600, 0x0600, /* horiz timings */ 0x0360, 0x0360, 0x0368, 0x036B, 0x038B, 0x038B, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (97L << 16) | ((5200L * 65536L) / 10000L), /* freq = 97.52 MHz */ } , {VG_SUPPORTFLAG_72HZ | /* refresh rate = 72 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1152, 864, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0480, 0x0480, 0x04C8, 0x0548, 0x0610, 0x0610, /* horiz timings */ 0x0360, 0x0360, 0x0367, 0x036A, 0x038B, 0x038B, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (101L << 16) | ((4200L * 65536L) / 10000L), /* freq = 101.42 MHz */ } , {VG_SUPPORTFLAG_75HZ | /* refresh rate = 75 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1152, 864, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0480, 0x0480, 0x04C0, 0x0540, 0x0640, 0x0640, /* horiz timings */ 0x0360, 0x0360, 0x0361, 0x0364, 0x0384, 0x0384, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (108L << 16) | ((0000L * 65536L) / 10000L), /* freq = 108.00 MHz */ } , {VG_SUPPORTFLAG_85HZ | /* refresh rate = 85 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1152, 864, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0480, 0x0480, 0x04C8, 0x0548, 0x0610, 0x0610, /* horiz timings */ 0x0360, 0x0360, 0x0363, 0x0366, 0x038B, 0x038B, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (119L << 16) | ((6500L * 65536L) / 10000L), /* freq = 119.65 MHz */ } , {VG_SUPPORTFLAG_90HZ | /* refresh rate = 90 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1152, 864, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0480, 0x0480, 0x04D0, 0x0550, 0x0620, 0x0620, /* horiz timings */ 0x0360, 0x0360, 0x0369, 0x036C, 0x0396, 0x0396, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (129L << 16) | ((6000L * 65536L) / 10000L), /* freq = 129.60 MHz */ } , {VG_SUPPORTFLAG_100HZ | /* refresh rate = 100 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1152, 864, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0480, 0x0480, 0x04D0, 0x0550, 0x0620, 0x0620, /* horiz timings */ 0x0360, 0x0360, 0x0363, 0x0366, 0x0396, 0x0396, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (144L << 16) | ((0000L * 65536L) / 10000L), /* freq = 144.00 MHz */ } , /* 1152x864 PANEL */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_PANEL, /* Panel Mode. */ VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ VG_MODEFLAG_PANELOUT | /* Panel output. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 1152, 864, /* No scaling. */ 1152, 864, /* 1152x864 active. */ 1152, 864, /* 1152x864 panel. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0480, 0x0480, 0x04C0, 0x0538, 0x05F0, 0x05F0, /* horiz timings */ 0x0360, 0x0360, 0x0361, 0x0364, 0x037F, 0x037F, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (81L << 16) | ((6000L * 65536L) / 10000L), /* freq = 81.60 MHz */ } , /* 1280x1024 */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1280, 1024, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0500, 0x0500, 0x0530, 0x05A0, 0x0698, 0x0698, /* horiz timings */ 0x0400, 0x0400, 0x0401, 0x0404, 0x042A, 0x042A, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (108L << 16) | ((0000L * 65536L) / 10000L), /* freq = 108.00 MHz */ } , {VG_SUPPORTFLAG_70HZ | /* refresh rate = 70 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1280, 1024, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0500, 0x0500, 0x0558, 0x05E0, 0x06C0, 0x06C0, /* horiz timings */ 0x0400, 0x0400, 0x0406, 0x0409, 0x042F, 0x042F, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (129L << 16) | ((6000L * 65536L) / 10000L), /* freq = 129.60 MHz */ } , {VG_SUPPORTFLAG_72HZ | /* refresh rate = 72 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1280, 1024, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0500, 0x0500, 0x0558, 0x05E0, 0x06C0, 0x06C0, /* horiz timings */ 0x0400, 0x0400, 0x0407, 0x040A, 0x0431, 0x0431, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (133L << 16) | ((5000L * 65536L) / 10000L), /* freq = 133.50 MHz */ } , {VG_SUPPORTFLAG_75HZ | /* refresh rate = 75 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1280, 1024, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0500, 0x0500, 0x0510, 0x05A0, 0x0698, 0x0698, /* horiz timings */ 0x0400, 0x0400, 0x0401, 0x0404, 0x042A, 0x042A, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (135L << 16) | ((0000L * 65536L) / 10000L), /* freq = 135.0 MHz */ } , {VG_SUPPORTFLAG_85HZ | /* refresh rate = 85 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1280, 1024, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0500, 0x0500, 0x0540, 0x05E0, 0x06C0, 0x06C0, /* horiz timings */ 0x0400, 0x0400, 0x0401, 0x0404, 0x0430, 0x0430, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (157L << 16) | ((5000L * 65536L) / 10000L), /* freq = 157.5 MHz */ } , {VG_SUPPORTFLAG_90HZ | /* refresh rate = 90 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1280, 1024, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0500, 0x0500, 0x0560, 0x05F0, 0x06E0, 0x06E0, /* horiz timings */ 0x0400, 0x0400, 0x040C, 0x040F, 0x0442, 0x0442, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (172L << 16) | ((8000L * 65536L) / 10000L), /* freq = 172.80 MHz */ } , {VG_SUPPORTFLAG_100HZ | /* refresh rate = 100 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ 0, 1280, 1024, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0500, 0x0500, 0x0560, 0x05F0, 0x06E0, 0x06E0, /* horiz timings */ 0x0400, 0x0400, 0x0406, 0x0409, 0x0442, 0x0442, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (192L << 16) | ((0000L * 65536L) / 10000L), /* freq = 192.00 MHz */ } , /* 1280x1024 PANEL */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_PANEL, /* Panel Mode. */ VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ VG_MODEFLAG_PANELOUT | /* Panel output. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 1280, 1024, /* No scaling. */ 1280, 1024, /* 1280x1024 active. */ 1280, 1024, /* 1280x1024 panel */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0500, 0x0500, 0x0530, 0x05A0, 0x0698, 0x0698, /* horiz timings */ 0x0400, 0x0400, 0x0401, 0x0404, 0x042A, 0x042A, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (108L << 16) | ((0000L * 65536L) / 10000L), /* freq = 108.00 MHz */ } , /* 1600 x 1200 */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1600, 1200, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870, /* horiz timings */ 0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (162L << 16) | ((0000L * 65536L) / 10000L), /* freq = 162.0 MHz */ } , {VG_SUPPORTFLAG_70HZ | /* refresh rate = 70 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1600, 1200, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870, /* horiz timings */ 0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (189L << 16) | ((0000L * 65536L) / 10000L), /* freq = 189.0 MHz */ } , {VG_SUPPORTFLAG_72HZ | /* refresh rate = 72 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1600, 1200, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0640, 0x0640, 0x06B0, 0x0760, 0x0880, 0x0880, /* horiz timings */ 0x04B0, 0x04B0, 0x04BD, 0x04C0, 0x04EF, 0x04EF, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (198L << 16) | ((0000L * 65536L) / 10000L), /* freq = 198.0 MHz */ } , {VG_SUPPORTFLAG_75HZ | /* refresh rate = 75 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1600, 1200, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870, /* horiz timings */ 0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (202L << 16) | ((5000L * 65536L) / 10000L), /* freq = 202.5 MHz */ } , {VG_SUPPORTFLAG_85HZ | /* refresh rate = 85 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1600, 1200, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870, /* horiz timings */ 0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (229L << 16) | ((5000L * 65536L) / 10000L), /* freq = 229.5 MHz */ } , {VG_SUPPORTFLAG_90HZ | /* refresh rate = 90 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1600, 1200, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0640, 0x0640, 0x06C0, 0x0770, 0x08A0, 0x08A0, /* horiz timings */ 0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04F0, 0x04F0, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (251L << 16) | ((1820L * 65536L) / 10000L), /* freq = 251.182 MHz */ } , {VG_SUPPORTFLAG_100HZ | /* refresh rate = 100 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1600, 1200, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0640, 0x0640, 0x06C0, 0x0770, 0x08A0, 0x08A0, /* horiz timings */ 0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04F7, 0x04F7, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (280L << 16) | ((6400L * 65536L) / 10000L), /* freq = 280.64 MHz */ } , /* 1600 x 1200 PANEL */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_PANEL, /* Panel Mode. */ VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ VG_MODEFLAG_PANELOUT | /* Panel output. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC, /* negative syncs */ 1600, 1200, /* No scaling. */ 1600, 1200, /* 1600x1200 Active. */ 1600, 1200, /* 1600x1200 Panel. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870, /* horiz timings */ 0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (162L << 16) | ((0000L * 65536L) / 10000L), /* freq = 162.0 MHz */ } , /* 1920x1440 */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1920, 1440, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0780, 0x0780, 0x0800, 0x08D0, 0x0A28, 0x0A28, /* horiz timings */ 0x05A0, 0x05A0, 0x05A1, 0x05A4, 0x05DC, 0x05DC, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (234L << 16) | ((0000L * 65536L) / 10000L), /* freq = 234.0 MHz */ } , {VG_SUPPORTFLAG_70HZ | /* refresh rate = 70 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1920, 1440, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0780, 0x0780, 0x0818, 0x08E8, 0x0A50, 0x0A50, /* horiz timings */ 0x05A0, 0x05A0, 0x05A8, 0x05AB, 0x05E2, 0x05E2, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (278L << 16) | ((4000L * 65536L) / 10000L), /* freq = 278.4 MHz */ } , {VG_SUPPORTFLAG_72HZ | /* refresh rate = 70 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1920, 1440, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0780, 0x0780, 0x0818, 0x08E8, 0x0A50, 0x0A50, /* horiz timings */ 0x05A0, 0x05A0, 0x05A4, 0x05A7, 0x05EB, 0x05EB, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (288L << 16) | ((0000L * 65536L) / 10000L), /* freq = 288.0 MHz */ } , {VG_SUPPORTFLAG_75HZ | /* refresh rate = 75 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1920, 1440, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0780, 0x0780, 0x0810, 0x08F0, 0x0A50, 0x0A50, /* horiz timings */ 0x05A0, 0x05A0, 0x05A1, 0x05A4, 0x05DC, 0x05DC, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (297L << 16) | ((0000L * 65536L) / 10000L), /* freq = 297.0 MHz */ } , {VG_SUPPORTFLAG_85HZ | /* refresh rate = 85 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ 0, 1920, 1440, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0780, 0x0780, 0x0818, 0x08F0, 0x0A60, 0x0A60, /* horiz timings */ 0x05A0, 0x05A0, 0x05A1, 0x05A4, 0x05E8, 0x05E8, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings */ (341L << 16) | ((3490L * 65536L) / 10000L), /* freq = 341.35 MHz */ } , /*-------------------------------*/ /* PREDEFINED TV TIMINGS */ /*-------------------------------*/ /* 720 x 480i NTSC */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_NTSC | /* NTSC Mode. */ VG_SUPPORTFLAG_ADV7171 | VG_SUPPORTFLAG_SAA7127 | VG_SUPPORTFLAG_ADV7300 | VG_SUPPORTFLAG_TVOUT, VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_INTERLACED | VG_MODEFLAG_TVOUT | /* Interlaced TV output */ VG_MODEFLAG_HALFCLOCK | /* DotPLL = 1/2 VOP */ VG_MODEFLAG_INT_FLICKER, /* Flicker Filter Out */ 720, 480, /* No downscaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x02D0, 0x02D0, 0x02E1, 0x0320, 0x035A, 0x035A, /* horiz timings */ 0x00F0, 0x00F0, 0x00F4, 0x00F8, 0x0107, 0x0107, /* vertical timings */ 0x00F0, 0x00F0, 0x00F4, 0x00F8, 0x0106, 0x0106, /*Even field timings */ (27L << 16) | ((0000L * 65536L) / 10000L), /* freq = 27.0 MHz */ } , {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_NTSC | /* NTSC Mode. */ VG_SUPPORTFLAG_FS454 | VG_SUPPORTFLAG_TVOUT, /* TV Mode. */ VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC | /* negative syncs */ VG_MODEFLAG_PANELOUT | VG_MODEFLAG_INVERT_SHFCLK, /* TFT Output. */ 640, 480, /* No downscaling. */ 640, 480, /* 640x480 active. */ 640, 480, /* 640x480 panel. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0280, 0x0280, 0x0333, 0x0373, 0x03A8, 0x03A8, /* horiz timings */ 0x01E0, 0x01E0, 0x01F5, 0x01F7, 0x020D, 0x020D, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings. */ (25L << 16) | ((1750L * 65536L) / 10000L), /* freq = 25.175 MHz */ } , /* 800 x 600 NTSC */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_8X6_NTSC | /* 800x600 NTSC. */ VG_SUPPORTFLAG_FS454 | VG_SUPPORTFLAG_TVOUT, /* TV Mode. */ VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC | /* negative syncs */ VG_MODEFLAG_PANELOUT | VG_MODEFLAG_INVERT_SHFCLK, /* Panel output */ 800, 600, /* No downscaling. */ 800, 600, /* 800x600 active. */ 800, 600, /* 800x600 active. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0320, 0x0320, 0x03A7, 0x03E7, 0x03F0, 0x03F0, /* horiz timings */ 0x0258, 0x0258, 0x026A, 0x0272, 0x028A, 0x028A, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings. */ (40L << 16) | ((0000L * 65536L) / 10000L), /* freq = 40.000 MHz */ } , /* 1024 x 768 NTSC */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_10X7_NTSC | /* 1024x768 NTSC. */ VG_SUPPORTFLAG_FS454 | VG_SUPPORTFLAG_TVOUT, /* TV Mode. */ VG_MODEFLAG_AVG_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC | /* negative syncs */ VG_MODEFLAG_PANELOUT | VG_MODEFLAG_INVERT_SHFCLK, /* Panel output */ 1024, 768, /* No downscaling. */ 1024, 768, /* 1024x768 active. */ 1024, 768, /* 1024x768 active. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0400, 0x0400, 0x0490, 0x04D0, 0x04E0, 0x04E0, /* horiz timings */ 0x0300, 0x0300, 0x031B, 0x031D, 0x0339, 0x0339, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings. */ (65L << 16) | ((0000L * 65536L) / 10000L), /* freq = 65.00 MHz */ } , /* 720 x 576i PAL */ {VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_PAL | /* PAL Mode. */ VG_SUPPORTFLAG_ADV7171 | VG_SUPPORTFLAG_SAA7127 | VG_SUPPORTFLAG_ADV7300 | VG_SUPPORTFLAG_TVOUT, /* TV Mode. */ VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_TVOUT | VG_MODEFLAG_INTERLACED | /* Interlaced TV out. */ VG_MODEFLAG_HALFCLOCK | /* DotPLL = 1/2 VOP */ VG_MODEFLAG_INT_FLICKER, /* Flicker Filter Out */ 720, 576, /* No downscaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x02D0, 0x02D0, 0x02E4, 0x0324, 0x0360, 0x0360, /* horiz timings */ 0x0120, 0x0120, 0x0123, 0x0127, 0x0139, 0x0139, /* vertical timings */ 0x0120, 0x0120, 0x0123, 0x0127, 0x0138, 0x0138, /* Even timings */ (27L << 16) | ((0000L * 65536L) / 10000L), /* freq = 27.0 MHz */ } , {VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_PAL | /* PAL Mode. */ VG_SUPPORTFLAG_FS454 | VG_SUPPORTFLAG_TVOUT, /* TV Mode. */ VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC | /* negative syncs */ VG_MODEFLAG_PANELOUT | VG_MODEFLAG_INVERT_SHFCLK, /* Panel output */ 640, 480, /* No downscaling. */ 640, 480, /* No mode dimensions. */ 640, 480, /* 640x480 active. */ 0, 0, 0, 0, 0, /* 640x480 panel. */ 0x0280, 0x0280, 0x030F, 0x034F, 0x0360, 0x0360, /* horiz timings */ 0x01E0, 0x01E0, 0x01F5, 0x01F7, 0x020D, 0x020D, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings. */ (25L << 16) | ((1750L * 65536L) / 10000L), /* freq = 25.175 MHz */ } , /* 800 x 600 PAL */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_8X6_PAL | /* 800x600 PAL. */ VG_SUPPORTFLAG_FS454 | VG_SUPPORTFLAG_TVOUT, /* TV Mode. */ VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC | /* negative syncs */ VG_MODEFLAG_PANELOUT | VG_MODEFLAG_INVERT_SHFCLK, /* Panel output */ 800, 600, /* No downscaling. */ 800, 600, /* 800x600 active. */ 800, 600, /* 800x600 active. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0320, 0x0320, 0x03A7, 0x03E7, 0x03F0, 0x03F0, /* horiz timings */ 0x0258, 0x0258, 0x0270, 0x0272, 0x028A, 0x028A, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings. */ (40L << 16) | ((0000L * 65536L) / 10000L), /* freq = 40.000 MHz */ } , /* 1024 x 768 PAL */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_10X7_PAL | /* 1024x768 NTSC. */ VG_SUPPORTFLAG_FS454 | VG_SUPPORTFLAG_TVOUT, /* TV Mode. */ VG_MODEFLAG_AVG_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_NEG_HSYNC | VG_MODEFLAG_NEG_VSYNC | /* negative syncs */ VG_MODEFLAG_PANELOUT | VG_MODEFLAG_INVERT_SHFCLK, /* Panel output */ 1024, 768, /* No downscaling. */ 1024, 768, /* 1024x768 active. */ 1024, 768, /* 1024x768 active. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0400, 0x0400, 0x0490, 0x04d0, 0x04e0, 0x04e0, /* horiz timings */ 0x0300, 0x0300, 0x031b, 0x031d, 0x0339, 0x0339, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings. */ (65L << 16) | ((0000L * 65536L) / 10000L), /* freq = 65.00 MHz */ } , /* 720 x 480p HDTV */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_480P | /* 720x480P. */ VG_SUPPORTFLAG_ADV7300 | VG_SUPPORTFLAG_TVOUT, /* TV Mode. */ VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_TVOUT, /* Progressive TV out. */ 720, 480, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x02D0, 0x02D0, 0x02E0, 0x0328, 0x035A, 0x035A, /* horiz timings */ 0x01E0, 0x01E0, 0x01E1, 0x01E3, 0x020D, 0x020D, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings. */ (27L << 16) | ((0000L * 65536L) / 10000L), /* freq = 27.0 MHz */ } , {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_480P | /* 720x480P. */ VG_SUPPORTFLAG_FS454 | VG_SUPPORTFLAG_TVOUT, /* TV Mode. */ VG_MODEFLAG_LOW_BAND | /* Low bandwidth mode. */ VG_MODEFLAG_PANELOUT | VG_MODEFLAG_INVERT_SHFCLK, /* Panel output */ 720, 480, /* No scaling. */ 720, 480, /* 720x480 active. */ 720, 480, /* 720x480 panel. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x02D0, 0x02D0, 0x02E3, 0x0323, 0x035A, 0x035A, /* horiz timings */ 0x01E0, 0x01E0, 0x01E4, 0x01EA, 0x020D, 0x020D, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings. */ (27L << 16) | ((0000L * 65536L) / 10000L), /* freq = 27.0 MHz */ } , /* 1280x720p HDTV */ {VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_720P | /* 1280x720P */ VG_SUPPORTFLAG_ADV7300 | VG_SUPPORTFLAG_TVOUT, /* TV Mode. */ VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ VG_MODEFLAG_TVOUT, /* Progressive TV out */ 1280, 720, /* No scaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0500, 0x0500, 0x0546, 0x0596, 0x0672, 0x0672, /* horiz timings */ 0x02D0, 0x02D0, 0x02D3, 0x02D8, 0x02EE, 0x02EE, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* even timings */ (74L << 16) | ((2500L * 65536L) / 10000L), /* freq = 74.25 MHz */ } , {VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_720P | /* 1280x720P */ VG_SUPPORTFLAG_FS454 | VG_SUPPORTFLAG_TVOUT, /* TV Mode. */ VG_MODEFLAG_AVG_BAND | /* Avg bandwidth mode. */ VG_MODEFLAG_PANELOUT | VG_MODEFLAG_INVERT_SHFCLK, /* Panel output */ 1280, 720, /* No scaling. */ 1280, 720, /* 1280x720 active. */ 1280, 720, /* 1280x720 panel. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0500, 0x0500, 0x0547, 0x0597, 0x0672, 0x0672, /* horiz timings */ 0x02D0, 0x02D0, 0x02D4, 0x02D9, 0x02EE, 0x02EE, /* vertical timings */ 0, 0, 0, 0, 0, 0, /* No even timings. */ (74L << 16) | ((2500L * 65536L) / 10000L), /* freq = 74.25 MHz */ } , /* 1920x1080i HDTV */ {VG_SUPPORTFLAG_60HZ | /* refresh rate = 60 */ VG_SUPPORTFLAG_8BPP | VG_SUPPORTFLAG_12BPP | VG_SUPPORTFLAG_15BPP | VG_SUPPORTFLAG_16BPP | VG_SUPPORTFLAG_24BPP | VG_SUPPORTFLAG_32BPP | VG_SUPPORTFLAG_1080I | /* 1920x1080i Mode. */ VG_SUPPORTFLAG_ADV7300 | VG_SUPPORTFLAG_FS454 | VG_SUPPORTFLAG_TVOUT, VG_MODEFLAG_HIGH_BAND | /* High bandwidth mode. */ VG_MODEFLAG_INTERLACED | VG_MODEFLAG_TVOUT | /* Interlaced TV out */ /* Interlaced addressing */ VG_MODEFLAG_INT_ADDRESS | VG_MODEFLAG_INVERT_SHFCLK, 1920, 1080, /* 2:1 downscaling. */ 0, 0, /* No mode dimensions. */ 0, 0, /* No panel dimensions. */ 0, 0, 0, 0, 0, /* No panel registers */ 0x0780, 0x0780, 0x07AD, 0x0805, 0x0898, 0x0898, /* horiz timings */ 0x021C, 0x021C, 0x021E, 0x0226, 0x0233, 0x0233, /* vertical timings */ 0x021C, 0x021C, 0x021E, 0x0226, 0x0232, 0x0232, /*even field timings */ (74L << 16) | ((2500L * 65536L) / 10000L), /* freq = 74.25 MHz */ } , }; #define NUM_CIMARRON_DISPLAY_MODES sizeof(CimarronDisplayModes) / \ sizeof(VG_DISPLAY_MODE) /*-----------------------------------*/ /* PREDEFINED PLL FREQUENCIES */ /*-----------------------------------*/ static const PLL_FREQUENCY CimarronPLLFrequencies[] = { {0x000031AC, (24L << 16) | ((9230L * 65536L) / 10000L)} , /* 24.9230, - 4,27,13 */ {0x0000215D, (25L << 16) | ((1750L * 65536L) / 10000L)} , /* 25.1750, - 3,22,14 */ {0x00001087, (27L << 16) | ((0000L * 65536L) / 10000L)} , /* 27.0000, - 2, 9, 8 */ {0x0000216C, (28L << 16) | ((3220L * 65536L) / 10000L)} , /* 28.3220, - 3,23,13 */ {0x0000218D, (28L << 16) | ((5600L * 65536L) / 10000L)} , /* 28.5600, - 3,25,14 */ {0x000010C9, (31L << 16) | ((2000L * 65536L) / 10000L)} , /* 31.2000, - 2,13,10 */ {0x00003147, (31L << 16) | ((5000L * 65536L) / 10000L)} , /* 31.5000, - 4,21, 8 */ {0x000010A7, (33L << 16) | ((320L * 65536L) / 10000L)} , /* 33.0320, - 2,11, 8 */ {0x00002159, (35L << 16) | ((1120L * 65536L) / 10000L)} , /* 35.1120, - 3,22,10 */ {0x00004249, (35L << 16) | ((5000L * 65536L) / 10000L)} , /* 35.5000, - 5,37,10 */ {0x00000057, (36L << 16) | ((0000L * 65536L) / 10000L)} , /* 36.0000, - 1, 6, 8 */ {0x0000219A, (37L << 16) | ((8890L * 65536L) / 10000L)} , /* 37.8890, - 3,26,11 */ {0x00002158, (39L << 16) | ((1680L * 65536L) / 10000L)} , /* 39.1680, - 3,22, 9 */ {0x00000045, (40L << 16) | ((0000L * 65536L) / 10000L)} , /* 40.0000, - 1, 5, 6 */ {0x00000089, (43L << 16) | ((1630L * 65536L) / 10000L)} , /* 43.1630, - 1, 9,10 */ {0x000010E7, (44L << 16) | ((9000L * 65536L) / 10000L)} , /* 44.9000, - 2,15, 8 */ {0x00002136, (45L << 16) | ((7200L * 65536L) / 10000L)} , /* 45.7200, - 3,20, 7 */ {0x00003207, (49L << 16) | ((5000L * 65536L) / 10000L)} , /* 49.5000, - 4,33, 8 */ {0x00002187, (50L << 16) | ((0000L * 65536L) / 10000L)} , /* 50.0000, - 3,25, 8 */ {0x00004286, (56L << 16) | ((2500L * 65536L) / 10000L)} , /* 56.2500, - 5,41, 7 */ {0x000010E5, (60L << 16) | ((650L * 65536L) / 10000L)} , /* 60.0650, - 2,15, 6 */ {0x00004214, (65L << 16) | ((0000L * 65536L) / 10000L)} , /* 65.0000, - 5,34, 5 */ {0x00001105, (68L << 16) | ((1790L * 65536L) / 10000L)} , /* 68.1790, - 2,17, 6 */ {0x000031E4, (74L << 16) | ((2500L * 65536L) / 10000L)} , /* 74.2500, - 4,31, 5 */ {0x00003183, (75L << 16) | ((0000L * 65536L) / 10000L)} , /* 75.0000, - 4,25, 4 */ {0x00004284, (78L << 16) | ((7500L * 65536L) / 10000L)} , /* 78.7500, - 5,41, 5 */ {0x00001104, (81L << 16) | ((6000L * 65536L) / 10000L)} , /* 81.6000, - 2,17, 5 */ {0x00006363, (94L << 16) | ((5000L * 65536L) / 10000L)} , /* 94.5000, - 7,55, 4 */ {0x00005303, (97L << 16) | ((5200L * 65536L) / 10000L)} , /* 97.5200, - 6,49, 4 */ {0x00002183, (100L << 16) | ((1870L * 65536L) / 10000L)} , /* 100.187, - 3,25, 4 */ {0x00002122, (101L << 16) | ((4200L * 65536L) / 10000L)} , /* 101.420, - 3,19, 3 */ {0x000041B1, (106L << 16) | ((5000L * 65536L) / 10000L)} , /* 106.50, - 5,28, 2 */ {0x00001081, (108L << 16) | ((0000L * 65536L) / 10000L)} , /* 108.00, - 2, 9, 2 */ {0x00006201, (113L << 16) | ((3100L * 65536L) / 10000L)} , /* 113.31, - 7,33, 2 */ {0x00000041, (119L << 16) | ((6500L * 65536L) / 10000L)} , /* 119.65, - 1, 5, 2 */ {0x000041A1, (129L << 16) | ((6000L * 65536L) / 10000L)} , /* 129.60, - 5,27, 2 */ {0x00002182, (133L << 16) | ((5000L * 65536L) / 10000L)} , /* 133.50, - 3,25, 3 */ {0x000041B1, (135L << 16) | ((0000L * 65536L) / 10000L)} , /* 135.00, - 5,28, 2 */ {0x00000051, (144L << 16) | ((0000L * 65536L) / 10000L)} , /* 144.00, - 1, 6, 2 */ {0x000041E1, (148L << 16) | ((5000L * 65536L) / 10000L)} , /* 148.50, - 5,31, 2 */ {0x000062D1, (157L << 16) | ((5000L * 65536L) / 10000L)} , /* 157.50, - 7,46, 2 */ {0x000031A1, (162L << 16) | ((0000L * 65536L) / 10000L)} , /* 162.00, - 4,27, 2 */ {0x00000061, (169L << 16) | ((2030L * 65536L) / 10000L)} , /* 169.203, - 1, 7, 2 */ {0x00004231, (172L << 16) | ((8000L * 65536L) / 10000L)} , /* 172.800, - 5,36, 2 */ {0x00002151, (175L << 16) | ((5000L * 65536L) / 10000L)} , /* 175.50, - 3,22, 2 */ {0x000052E1, (189L << 16) | ((0000L * 65536L) / 10000L)} , /* 189.00, - 6,47, 2 */ {0x00000071, (192L << 16) | ((0000L * 65536L) / 10000L)} , /* 192.00, - 1, 8, 2 */ {0x00003201, (198L << 16) | ((0000L * 65536L) / 10000L)} , /* 198.00, - 4,33, 2 */ {0x00004291, (202L << 16) | ((5000L * 65536L) / 10000L)} , /* 202.50, - 5,42, 2 */ {0x00001101, (204L << 16) | ((7500L * 65536L) / 10000L)} , /* 204.75, - 2,17, 2 */ {0x00007481, (218L << 16) | ((2500L * 65536L) / 10000L)} , /* 218.25, - 8,73, 2 */ {0x00004170, (229L << 16) | ((5000L * 65536L) / 10000L)} , /* 229.50, - 5,24, 1 */ {0x00006210, (234L << 16) | ((0000L * 65536L) / 10000L)} , /* 234.00, - 7,34, 1 */ {0x00003140, (251L << 16) | ((1820L * 65536L) / 10000L)} , /* 251.182, - 4,21, 1 */ {0x00006250, (261L << 16) | ((0000L * 65536L) / 10000L)} , /* 261.00, - 7,38, 1 */ {0x000041C0, (278L << 16) | ((4000L * 65536L) / 10000L)} , /* 278.40, - 5,29, 1 */ {0x00005220, (280L << 16) | ((6400L * 65536L) / 10000L)} , /* 280.64, - 6,35, 1 */ {0x00000050, (288L << 16) | ((0000L * 65536L) / 10000L)} , /* 288.00, - 1, 6, 1 */ {0x000041E0, (297L << 16) | ((0000L * 65536L) / 10000L)} , /* 297.00, - 5,31, 1 */ {0x00002130, (320L << 16) | ((2070L * 65536L) / 10000L)} , /* 320.207, - 3,20, 1 */ {0x00006310, (341L << 16) | ((3490L * 65536L) / 10000L)} /* 341.349, - 7,50, 1 */ }; #define NUM_CIMARRON_PLL_FREQUENCIES sizeof(CimarronPLLFrequencies) / \ sizeof(PLL_FREQUENCY) /*-----------------------------------*/ /* PREDEFINED FILTER COEFFICIENTS */ /*-----------------------------------*/ static const unsigned long CimarronHorizontalGraphicsFilter[][2] = { {0x1284A7D5, 0x000017D5}, /* -43, 297, 296, -43, 5 */ {0x12A497D7, 0x000013D6}, /* -41, 293, 298, -42, 4 */ {0x12D48BD7, 0x000013D6}, /* -41, 290, 301, -42, 4 */ {0x13147FD7, 0x000013D5}, /* -41, 287, 305, -43, 4 */ {0x133473D8, 0x000013D5}, /* -40, 284, 307, -43, 4 */ {0x136467D8, 0x000013D5}, /* -40, 281, 310, -43, 4 */ {0x13945FD8, 0x000013D4}, /* -40, 279, 313, -44, 4 */ {0x13B453D9, 0x000013D4}, /* -39, 276, 315, -44, 4 */ {0x13E447D9, 0x000013D4}, /* -39, 273, 318, -44, 4 */ {0x14143BDA, 0x000013D3}, /* -38, 270, 321, -45, 4 */ {0x143433DA, 0x000013D3}, /* -38, 268, 323, -45, 4 */ {0x146427DA, 0x000013D3}, /* -38, 265, 326, -45, 4 */ {0x14941BDB, 0x000013D2}, /* -37, 262, 329, -46, 4 */ {0x14C40FDB, 0x000013D2}, /* -37, 259, 332, -46, 4 */ {0x14F407DA, 0x000017D1}, /* -38, 257, 335, -47, 5 */ {0x1503FBDC, 0x000013D2}, /* -36, 254, 336, -46, 4 */ {0x1543F3DB, 0x000017D0}, /* -37, 252, 340, -48, 5 */ {0x1563E3DD, 0x000013D1}, /* -35, 248, 342, -47, 4 */ {0x1593D7DD, 0x000013D1}, /* -35, 245, 345, -47, 4 */ {0x15B3CFDD, 0x000013D1}, /* -35, 243, 347, -47, 4 */ {0x15E3C3DE, 0x000013D0}, /* -34, 240, 350, -48, 4 */ {0x1613B7DE, 0x000013D0}, /* -34, 237, 353, -48, 4 */ {0x1633ABDF, 0x000013D0}, /* -33, 234, 355, -48, 4 */ {0x16639FDF, 0x000013D0}, /* -33, 231, 358, -48, 4 */ {0x167397E0, 0x000013D0}, /* -32, 229, 359, -48, 4 */ {0x16B38BE0, 0x000013CF}, /* -32, 226, 363, -49, 4 */ {0x16E383DF, 0x000017CE}, /* -33, 224, 366, -50, 5 */ {0x170373E1, 0x000013CF}, /* -31, 220, 368, -49, 4 */ {0x17236BE1, 0x000013CF}, /* -31, 218, 370, -49, 4 */ {0x17435FE2, 0x000013CF}, /* -30, 215, 372, -49, 4 */ {0x177353E2, 0x000013CF}, /* -30, 212, 375, -49, 4 */ {0x17B34BE1, 0x000017CD}, /* -31, 210, 379, -51, 5 */ {0x17C33FE3, 0x000013CE}, /* -29, 207, 380, -50, 4 */ {0x17F333E3, 0x000013CE}, /* -29, 204, 383, -50, 4 */ {0x181327E4, 0x000013CE}, /* -28, 201, 385, -50, 4 */ {0x18431FE3, 0x000017CD}, /* -29, 199, 388, -51, 5 */ {0x186313E4, 0x000013CE}, /* -28, 196, 390, -50, 4 */ {0x188307E5, 0x000013CE}, /* -27, 193, 392, -50, 4 */ {0x18B2FBE5, 0x000013CE}, /* -27, 190, 395, -50, 4 */ {0x18C2F3E6, 0x000013CE}, /* -26, 188, 396, -50, 4 */ {0x18F2E7E6, 0x000013CE}, /* -26, 185, 399, -50, 4 */ {0x1912DBE7, 0x000013CE}, /* -25, 182, 401, -50, 4 */ {0x1952D3E6, 0x000017CC}, /* -26, 180, 405, -52, 5 */ {0x1972CBE6, 0x000017CC}, /* -26, 178, 407, -52, 5 */ {0x1992BFE7, 0x000017CC}, /* -25, 175, 409, -52, 5 */ {0x19C2B3E7, 0x000017CC}, /* -25, 172, 412, -52, 5 */ {0x19D2A7E9, 0x000013CD}, /* -23, 169, 413, -51, 4 */ {0x1A029FE8, 0x000017CC}, /* -24, 167, 416, -52, 5 */ {0x1A1293E9, 0x000013CE}, /* -23, 164, 417, -50, 4 */ {0x1A3287EA, 0x000013CE}, /* -22, 161, 419, -50, 4 */ {0x1A627FE9, 0x000017CD}, /* -23, 159, 422, -51, 5 */ {0x1A7273EB, 0x000013CE}, /* -21, 156, 423, -50, 4 */ {0x1AA267EB, 0x000013CE}, /* -21, 153, 426, -50, 4 */ {0x1AC25FEB, 0x000013CE}, /* -21, 151, 428, -50, 4 */ {0x1AE253EC, 0x000013CE}, /* -20, 148, 430, -50, 4 */ {0x1B124BEB, 0x000017CD}, /* -21, 146, 433, -51, 5 */ {0x1B223FED, 0x000013CE}, /* -19, 143, 434, -50, 4 */ {0x1B5237EC, 0x000017CD}, /* -20, 141, 437, -51, 5 */ {0x1B622BED, 0x000013CF}, /* -19, 138, 438, -49, 4 */ {0x1B821FEE, 0x000013CF}, /* -18, 135, 440, -49, 4 */ {0x1BA217EE, 0x000013CF}, /* -18, 133, 442, -49, 4 */ {0x1BC20BEF, 0x000013CF}, /* -17, 130, 444, -49, 4 */ {0x1BE203EF, 0x000013CF}, /* -17, 128, 446, -49, 4 */ {0x1C01FBEE, 0x000017CF}, /* -18, 126, 448, -49, 5 */ {0x1C11EFF0, 0x000013D0}, /* -16, 123, 449, -48, 4 */ {0x1C41E7EF, 0x000017CF}, /* -17, 121, 452, -49, 5 */ {0x1C61DFEF, 0x000017CF}, /* -17, 119, 454, -49, 5 */ {0x1C61D3F1, 0x000013D1}, /* -15, 116, 454, -47, 4 */ {0x1C91CBF0, 0x000017D0}, /* -16, 114, 457, -48, 5 */ {0x1CA1BFF2, 0x000013D1}, /* -14, 111, 458, -47, 4 */ {0x1CC1B3F2, 0x000013D2}, /* -14, 108, 460, -46, 4 */ {0x1CE1AFF1, 0x000017D1}, /* -15, 107, 462, -47, 5 */ {0x1CF1A3F3, 0x000013D2}, /* -13, 104, 463, -46, 4 */ {0x1D1197F3, 0x000013D3}, /* -13, 101, 465, -45, 4 */ {0x1D3197F2, 0x000013D2}, /* -14, 101, 467, -46, 4 */ {0x1D518BF3, 0x000013D2}, /* -13, 98, 469, -46, 4 */ {0x1D6183F3, 0x000013D3}, /* -13, 96, 470, -45, 4 */ {0x1D817BF3, 0x000013D3}, /* -13, 94, 472, -45, 4 */ {0x1D916FF4, 0x000013D4}, /* -12, 91, 473, -44, 4 */ {0x1DB167F4, 0x000013D4}, /* -12, 89, 475, -44, 4 */ {0x1DC15FF4, 0x000013D5}, /* -12, 87, 476, -43, 4 */ {0x1DE153F5, 0x000013D5}, /* -11, 84, 478, -43, 4 */ {0x1DF14BF5, 0x000013D6}, /* -11, 82, 479, -42, 4 */ {0x1E1143F5, 0x000013D6}, /* -11, 80, 481, -42, 4 */ {0x1E1137F7, 0x00000FD8}, /* -9, 77, 481, -40, 3 */ {0x1E3133F6, 0x000013D7}, /* -10, 76, 483, -41, 4 */ {0x1E412BF6, 0x000013D8}, /* -10, 74, 484, -40, 4 */ {0x1E611FF7, 0x000013D8}, /* -9, 71, 486, -40, 4 */ {0x1E7117F7, 0x000013D9}, /* -9, 69, 487, -39, 4 */ {0x1E810FF7, 0x000013DA}, /* -9, 67, 488, -38, 4 */ {0x1E9107F8, 0x000013DA}, /* -8, 65, 489, -38, 4 */ {0x1EA0FFF8, 0x000013DB}, /* -8, 63, 490, -37, 4 */ {0x1EB0F3F9, 0x00000FDD}, /* -7, 60, 491, -35, 3 */ {0x1ED0EFF8, 0x000013DC}, /* -8, 59, 493, -36, 4 */ {0x1EE0E7F9, 0x00000FDD}, /* -7, 57, 494, -35, 3 */ {0x1EF0DFF9, 0x00000FDE}, /* -7, 55, 495, -34, 3 */ {0x1F00D7F9, 0x00000FDF}, /* -7, 53, 496, -33, 3 */ {0x1F10CFFA, 0x00000FDF}, /* -6, 51, 497, -33, 3 */ {0x1F20C7FA, 0x00000FE0}, /* -6, 49, 498, -32, 3 */ {0x1F20C3FA, 0x00000FE1}, /* -6, 48, 498, -31, 3 */ {0x1F30BBFA, 0x00000FE2}, /* -6, 46, 499, -30, 3 */ {0x1F40AFFB, 0x00000FE3}, /* -5, 43, 500, -29, 3 */ {0x1F50A7FB, 0x00000FE4}, /* -5, 41, 501, -28, 3 */ {0x1F60A3FB, 0x00000FE4}, /* -5, 40, 502, -28, 3 */ {0x1F709BFB, 0x00000FE5}, /* -5, 38, 503, -27, 3 */ {0x1F7093FC, 0x00000FE6}, /* -4, 36, 503, -26, 3 */ {0x1F808FFC, 0x00000BE7}, /* -4, 35, 504, -25, 2 */ {0x1F9087FC, 0x00000BE8}, /* -4, 33, 505, -24, 2 */ {0x1F9083FC, 0x00000BE9}, /* -4, 32, 505, -23, 2 */ {0x1FA077FD, 0x00000BEA}, /* -3, 29, 506, -22, 2 */ {0x1FA073FD, 0x00000BEB}, /* -3, 28, 506, -21, 2 */ {0x1FB06BFD, 0x00000BEC}, /* -3, 26, 507, -20, 2 */ {0x1FC063FD, 0x00000BED}, /* -3, 24, 508, -19, 2 */ {0x1FC05BFE, 0x00000BEE}, /* -2, 22, 508, -18, 2 */ {0x1FC057FE, 0x00000BEF}, /* -2, 21, 508, -17, 2 */ {0x1FD053FE, 0x000007F0}, /* -2, 20, 509, -16, 1 */ {0x1FD04BFE, 0x000007F2}, /* -2, 18, 509, -14, 1 */ {0x1FE043FE, 0x000007F3}, /* -2, 16, 510, -13, 1 */ {0x1FE03BFF, 0x000007F4}, /* -1, 14, 510, -12, 1 */ {0x1FE037FF, 0x000007F5}, /* -1, 13, 510, -11, 1 */ {0x1FE033FF, 0x000007F6}, /* -1, 12, 510, -10, 1 */ {0x1FF02BFF, 0x000007F7}, /* -1, 10, 511, -9, 1 */ {0x1FF027FF, 0x000003F9}, /* -1, 9, 511, -7, 0 */ {0x1FF01C00, 0x000003FA}, /* 0, 7, 511, -6, 0 */ {0x1FF01800, 0x000003FB}, /* 0, 6, 511, -5, 0 */ {0x1FF01400, 0x000003FC}, /* 0, 5, 511, -4, 0 */ {0x1FF00C00, 0x000003FE}, /* 0, 3, 511, -2, 0 */ {0x1FF00800, 0x000003FF}, /* 0, 2, 511, -1, 0 */ {0x1FF00400, 0x00000000}, /* 0, 1, 511, 0, 0 */ {0x1FFFFC00, 0x00000002}, /* 0, -1, 511, 2, 0 */ {0x1FFFF800, 0x00000003}, /* 0, -2, 511, 3, 0 */ {0x1FFFF000, 0x00000005}, /* 0, -4, 511, 5, 0 */ {0x1FFFEC00, 0x00000006}, /* 0, -5, 511, 6, 0 */ {0x1FFFE800, 0x00000007}, /* 0, -6, 511, 7, 0 */ {0x1FFFE400, 0x000FFC09}, /* 0, -7, 511, 9, -1 */ {0x1FFFDC01, 0x000FFC0A}, /* 1, -9, 511, 10, -1 */ {0x1FEFDC01, 0x000FFC0B}, /* 1, -9, 510, 11, -1 */ {0x1FEFD401, 0x000FFC0D}, /* 1, -11, 510, 13, -1 */ {0x1FEFD001, 0x000FFC0E}, /* 1, -12, 510, 14, -1 */ {0x1FEFCC01, 0x000FF810}, /* 1, -13, 510, 16, -2 */ {0x1FDFCC01, 0x000FF811}, /* 1, -13, 509, 17, -2 */ {0x1FDFC401, 0x000FF813}, /* 1, -15, 509, 19, -2 */ {0x1FCFC002, 0x000FF814}, /* 2, -16, 508, 20, -2 */ {0x1FCFB802, 0x000FF816}, /* 2, -18, 508, 22, -2 */ {0x1FCFB402, 0x000FF418}, /* 2, -19, 508, 24, -3 */ {0x1FBFB402, 0x000FF419}, /* 2, -19, 507, 25, -3 */ {0x1FAFB002, 0x000FF41B}, /* 2, -20, 506, 27, -3 */ {0x1FAFA802, 0x000FF41D}, /* 2, -22, 506, 29, -3 */ {0x1F9FA802, 0x000FF01F}, /* 2, -22, 505, 31, -4 */ {0x1F9FA402, 0x000FF020}, /* 2, -23, 505, 32, -4 */ {0x1F8FA002, 0x000FF022}, /* 2, -24, 504, 34, -4 */ {0x1F7F9803, 0x000FF024}, /* 3, -26, 503, 36, -4 */ {0x1F7F9403, 0x000FEC26}, /* 3, -27, 503, 38, -5 */ {0x1F6F9003, 0x000FEC28}, /* 3, -28, 502, 40, -5 */ {0x1F5F9003, 0x000FEC29}, /* 3, -28, 501, 41, -5 */ {0x1F4F8C03, 0x000FEC2B}, /* 3, -29, 500, 43, -5 */ {0x1F3F8C03, 0x000FE82D}, /* 3, -29, 499, 45, -6 */ {0x1F2F8803, 0x000FE82F}, /* 3, -30, 498, 47, -6 */ {0x1F2F8003, 0x000FE831}, /* 3, -32, 498, 49, -6 */ {0x1F1F7C03, 0x000FE833}, /* 3, -33, 497, 51, -6 */ {0x1F0F7C03, 0x000FE435}, /* 3, -33, 496, 53, -7 */ {0x1EFF7803, 0x000FE437}, /* 3, -34, 495, 55, -7 */ {0x1EEF7403, 0x000FE439}, /* 3, -35, 494, 57, -7 */ {0x1EDF7004, 0x000FE03B}, /* 4, -36, 493, 59, -8 */ {0x1EBF7403, 0x000FE43C}, /* 3, -35, 491, 60, -7 */ {0x1EAF6C04, 0x000FE03F}, /* 4, -37, 490, 63, -8 */ {0x1E9F6804, 0x000FE041}, /* 4, -38, 489, 65, -8 */ {0x1E8F6804, 0x000FDC43}, /* 4, -38, 488, 67, -9 */ {0x1E7F6404, 0x000FDC45}, /* 4, -39, 487, 69, -9 */ {0x1E6F6004, 0x000FDC47}, /* 4, -40, 486, 71, -9 */ {0x1E4F6404, 0x000FD849}, /* 4, -39, 484, 73, -10 */ {0x1E3F6004, 0x000FD84B}, /* 4, -40, 483, 75, -10 */ {0x1E1F6003, 0x000FDC4D}, /* 3, -40, 481, 77, -9 */ {0x1E1F5804, 0x000FD450}, /* 4, -42, 481, 80, -11 */ {0x1DFF5804, 0x000FD452}, /* 4, -42, 479, 82, -11 */ {0x1DEF5404, 0x000FD454}, /* 4, -43, 478, 84, -11 */ {0x1DCF5804, 0x000FD056}, /* 4, -42, 476, 86, -12 */ {0x1DBF5004, 0x000FD059}, /* 4, -44, 475, 89, -12 */ {0x1D9F5004, 0x000FD05B}, /* 4, -44, 473, 91, -12 */ {0x1D8F5004, 0x000FCC5D}, /* 4, -44, 472, 93, -13 */ {0x1D6F5004, 0x000FCC5F}, /* 4, -44, 470, 95, -13 */ {0x1D5F4804, 0x000FCC62}, /* 4, -46, 469, 98, -13 */ {0x1D3F4C04, 0x000FC864}, /* 4, -45, 467, 100, -14 */ {0x1D1F4C04, 0x000FCC65}, /* 4, -45, 465, 101, -13 */ {0x1CFF4804, 0x000FCC68}, /* 4, -46, 463, 104, -13 */ {0x1CEF4405, 0x000FC46B}, /* 5, -47, 462, 107, -15 */ {0x1CCF4804, 0x000FC86C}, /* 4, -46, 460, 108, -14 */ {0x1CAF4404, 0x000FC86F}, /* 4, -47, 458, 111, -14 */ {0x1C9F4005, 0x000FC072}, /* 5, -48, 457, 114, -16 */ {0x1C6F4404, 0x000FC474}, /* 4, -47, 454, 116, -15 */ {0x1C6F3C05, 0x000FBC77}, /* 5, -49, 454, 119, -17 */ {0x1C4F3C05, 0x000FBC79}, /* 5, -49, 452, 121, -17 */ {0x1C1F4004, 0x000FC07B}, /* 4, -48, 449, 123, -16 */ {0x1C0F3C05, 0x000FB87E}, /* 5, -49, 448, 126, -18 */ {0x1BEF3C04, 0x000FBC80}, /* 4, -49, 446, 128, -17 */ {0x1BCF3C04, 0x000FBC82}, /* 4, -49, 444, 130, -17 */ {0x1BAF3C04, 0x000FB885}, /* 4, -49, 442, 133, -18 */ {0x1B8F3C04, 0x000FB887}, /* 4, -49, 440, 135, -18 */ {0x1B6F3C04, 0x000FB48A}, /* 4, -49, 438, 138, -19 */ {0x1B5F3405, 0x000FB08D}, /* 5, -51, 437, 141, -20 */ {0x1B2F3804, 0x000FB48F}, /* 4, -50, 434, 143, -19 */ {0x1B1F3405, 0x000FAC92}, /* 5, -51, 433, 146, -21 */ {0x1AEF3804, 0x000FB094}, /* 4, -50, 430, 148, -20 */ {0x1ACF3804, 0x000FAC97}, /* 4, -50, 428, 151, -21 */ {0x1AAF3804, 0x000FAC99}, /* 4, -50, 426, 153, -21 */ {0x1A7F3804, 0x000FAC9C}, /* 4, -50, 423, 156, -21 */ {0x1A6F3405, 0x000FA49F}, /* 5, -51, 422, 159, -23 */ {0x1A3F3804, 0x000FA8A1}, /* 4, -50, 419, 161, -22 */ {0x1A1F3804, 0x000FA4A4}, /* 4, -50, 417, 164, -23 */ {0x1A0F3005, 0x000FA0A7}, /* 5, -52, 416, 167, -24 */ {0x19DF3404, 0x000FA4A9}, /* 4, -51, 413, 169, -23 */ {0x19CF3005, 0x000F9CAC}, /* 5, -52, 412, 172, -25 */ {0x199F3005, 0x000F9CAF}, /* 5, -52, 409, 175, -25 */ {0x197F3005, 0x000F98B2}, /* 5, -52, 407, 178, -26 */ {0x195F3005, 0x000F98B4}, /* 5, -52, 405, 180, -26 */ {0x191F3804, 0x000F9CB6}, /* 4, -50, 401, 182, -25 */ {0x18FF3804, 0x000F98B9}, /* 4, -50, 399, 185, -26 */ {0x18CF3804, 0x000F98BC}, /* 4, -50, 396, 188, -26 */ {0x18BF3804, 0x000F94BE}, /* 4, -50, 395, 190, -27 */ {0x188F3804, 0x000F94C1}, /* 4, -50, 392, 193, -27 */ {0x186F3804, 0x000F90C4}, /* 4, -50, 390, 196, -28 */ {0x184F3405, 0x000F8CC7}, /* 5, -51, 388, 199, -29 */ {0x181F3804, 0x000F90C9}, /* 4, -50, 385, 201, -28 */ {0x17FF3804, 0x000F8CCC}, /* 4, -50, 383, 204, -29 */ {0x17CF3804, 0x000F8CCF}, /* 4, -50, 380, 207, -29 */ {0x17BF3405, 0x000F84D2}, /* 5, -51, 379, 210, -31 */ {0x177F3C04, 0x000F88D4}, /* 4, -49, 375, 212, -30 */ {0x174F3C04, 0x000F88D7}, /* 4, -49, 372, 215, -30 */ {0x172F3C04, 0x000F84DA}, /* 4, -49, 370, 218, -31 */ {0x170F3C04, 0x000F84DC}, /* 4, -49, 368, 220, -31 */ {0x16EF3805, 0x000F7CE0}, /* 5, -50, 366, 224, -33 */ {0x16BF3C04, 0x000F80E2}, /* 4, -49, 363, 226, -32 */ {0x167F4004, 0x000F80E5}, /* 4, -48, 359, 229, -32 */ {0x166F4004, 0x000F7CE7}, /* 4, -48, 358, 231, -33 */ {0x163F4004, 0x000F7CEA}, /* 4, -48, 355, 234, -33 */ {0x161F4004, 0x000F78ED}, /* 4, -48, 353, 237, -34 */ {0x15EF4004, 0x000F78F0}, /* 4, -48, 350, 240, -34 */ {0x15BF4404, 0x000F74F3}, /* 4, -47, 347, 243, -35 */ {0x159F4404, 0x000F74F5}, /* 4, -47, 345, 245, -35 */ {0x156F4404, 0x000F74F8}, /* 4, -47, 342, 248, -35 */ {0x154F4005, 0x000F6CFC}, /* 5, -48, 340, 252, -37 */ {0x150F4804, 0x000F70FE}, /* 4, -46, 336, 254, -36 */ {0x14FF4405, 0x000F6901}, /* 5, -47, 335, 257, -38 */ {0x14CF4804, 0x000F6D03}, /* 4, -46, 332, 259, -37 */ {0x149F4804, 0x000F6D06}, /* 4, -46, 329, 262, -37 */ {0x146F4C04, 0x000F6909}, /* 4, -45, 326, 265, -38 */ {0x143F4C04, 0x000F690C}, /* 4, -45, 323, 268, -38 */ {0x141F4C04, 0x000F690E}, /* 4, -45, 321, 270, -38 */ {0x13EF5004, 0x000F6511}, /* 4, -44, 318, 273, -39 */ {0x13BF5004, 0x000F6514}, /* 4, -44, 315, 276, -39 */ {0x139F5004, 0x000F6117}, /* 4, -44, 313, 279, -40 */ {0x136F5404, 0x000F6119}, /* 4, -43, 310, 281, -40 */ {0x133F5404, 0x000F611C}, /* 4, -43, 307, 284, -40 */ {0x131F5404, 0x000F5D1F}, /* 4, -43, 305, 287, -41 */ {0x12DF5C04, 0x000F5D21}, /* 4, -41, 301, 289, -41 */ {0x12AF5C04, 0x000F5D24}, /* 4, -41, 298, 292, -41 */ }; static const unsigned long CimarronVerticalGraphicsFilter[] = { 0x3F840D05, /* 261, 259, -8 */ 0x3F841D01, /* 257, 263, -8 */ 0x3F8428FE, /* 254, 266, -8 */ 0x3F8438FA, /* 250, 270, -8 */ 0x3F8444F7, /* 247, 273, -8 */ 0x3F8450F4, /* 244, 276, -8 */ 0x3F845CF1, /* 241, 279, -8 */ 0x3F8468EE, /* 238, 282, -8 */ 0x3F8474EB, /* 235, 285, -8 */ 0x3F8480E8, /* 232, 288, -8 */ 0x3F7490E5, /* 229, 292, -9 */ 0x3F749CE2, /* 226, 295, -9 */ 0x3F74ACDE, /* 222, 299, -9 */ 0x3F74B8DB, /* 219, 302, -9 */ 0x3F74C0D9, /* 217, 304, -9 */ 0x3F74CCD6, /* 214, 307, -9 */ 0x3F74D8D3, /* 211, 310, -9 */ 0x3F74E8CF, /* 207, 314, -9 */ 0x3F74F4CC, /* 204, 317, -9 */ 0x3F7500C9, /* 201, 320, -9 */ 0x3F750CC6, /* 198, 323, -9 */ 0x3F7518C3, /* 195, 326, -9 */ 0x3F7520C1, /* 193, 328, -9 */ 0x3F7530BD, /* 189, 332, -9 */ 0x3F753CBA, /* 186, 335, -9 */ 0x3F7548B7, /* 183, 338, -9 */ 0x3F6558B4, /* 180, 342, -10 */ 0x3F6560B2, /* 178, 344, -10 */ 0x3F656CAF, /* 175, 347, -10 */ 0x3F6578AC, /* 172, 350, -10 */ 0x3F6584A9, /* 169, 353, -10 */ 0x3F658CA7, /* 167, 355, -10 */ 0x3F6598A4, /* 164, 358, -10 */ 0x3F65A8A0, /* 160, 362, -10 */ 0x3F65B09E, /* 158, 364, -10 */ 0x3F65BC9B, /* 155, 367, -10 */ 0x3F65C499, /* 153, 369, -10 */ 0x3F65D096, /* 150, 372, -10 */ 0x3F55E093, /* 147, 376, -11 */ 0x3F55E891, /* 145, 378, -11 */ 0x3F55F48E, /* 142, 381, -11 */ 0x3F56008B, /* 139, 384, -11 */ 0x3F560C88, /* 136, 387, -11 */ 0x3F561486, /* 134, 389, -11 */ 0x3F562083, /* 131, 392, -11 */ 0x3F562881, /* 129, 394, -11 */ 0x3F56347E, /* 126, 397, -11 */ 0x3F56407B, /* 123, 400, -11 */ 0x3F564879, /* 121, 402, -11 */ 0x3F465876, /* 118, 406, -12 */ 0x3F466074, /* 116, 408, -12 */ 0x3F466872, /* 114, 410, -12 */ 0x3F46746F, /* 111, 413, -12 */ 0x3F467C6D, /* 109, 415, -12 */ 0x3F46846B, /* 107, 417, -12 */ 0x3F468C69, /* 105, 419, -12 */ 0x3F469866, /* 102, 422, -12 */ 0x3F46A064, /* 100, 424, -12 */ 0x3F46AC61, /* 97, 427, -12 */ 0x3F46B45F, /* 95, 429, -12 */ 0x3F46BC5D, /* 93, 431, -12 */ 0x3F46C45B, /* 91, 433, -12 */ 0x3F46CC59, /* 89, 435, -12 */ 0x3F36DC56, /* 86, 439, -13 */ 0x3F36E454, /* 84, 441, -13 */ 0x3F36EC52, /* 82, 443, -13 */ 0x3F36F450, /* 80, 445, -13 */ 0x3F36FC4E, /* 78, 447, -13 */ 0x3F37004D, /* 77, 448, -13 */ 0x3F370C4A, /* 74, 451, -13 */ 0x3F371448, /* 72, 453, -13 */ 0x3F371C46, /* 70, 455, -13 */ 0x3F372444, /* 68, 457, -13 */ 0x3F372C42, /* 66, 459, -13 */ 0x3F373440, /* 64, 461, -13 */ 0x3F37383F, /* 63, 462, -13 */ 0x3F37403D, /* 61, 464, -13 */ 0x3F37483B, /* 59, 466, -13 */ 0x3F375039, /* 57, 468, -13 */ 0x3F375438, /* 56, 469, -13 */ 0x3F375C36, /* 54, 471, -13 */ 0x3F376434, /* 52, 473, -13 */ 0x3F376833, /* 51, 474, -13 */ 0x3F377031, /* 49, 476, -13 */ 0x3F377430, /* 48, 477, -13 */ 0x3F377C2E, /* 46, 479, -13 */ 0x3F37842C, /* 44, 481, -13 */ 0x3F37882B, /* 43, 482, -13 */ 0x3F47882A, /* 42, 482, -12 */ 0x3F479028, /* 40, 484, -12 */ 0x3F479427, /* 39, 485, -12 */ 0x3F479C25, /* 37, 487, -12 */ 0x3F47A024, /* 36, 488, -12 */ 0x3F47A822, /* 34, 490, -12 */ 0x3F47AC21, /* 33, 491, -12 */ 0x3F47B020, /* 32, 492, -12 */ 0x3F57B01F, /* 31, 492, -11 */ 0x3F57B81D, /* 29, 494, -11 */ 0x3F57BC1C, /* 28, 495, -11 */ 0x3F57C01B, /* 27, 496, -11 */ 0x3F57C41A, /* 26, 497, -11 */ 0x3F67C818, /* 24, 498, -10 */ 0x3F67CC17, /* 23, 499, -10 */ 0x3F67D016, /* 22, 500, -10 */ 0x3F67D415, /* 21, 501, -10 */ 0x3F67D814, /* 20, 502, -10 */ 0x3F77D813, /* 19, 502, -9 */ 0x3F77DC12, /* 18, 503, -9 */ 0x3F77E011, /* 17, 504, -9 */ 0x3F87E010, /* 16, 504, -8 */ 0x3F87E40F, /* 15, 505, -8 */ 0x3F87E80E, /* 14, 506, -8 */ 0x3F97E80D, /* 13, 506, -7 */ 0x3F97EC0C, /* 12, 507, -7 */ 0x3F97F00B, /* 11, 508, -7 */ 0x3FA7F00A, /* 10, 508, -6 */ 0x3FA7F409, /* 9, 509, -6 */ 0x3FB7F408, /* 8, 509, -5 */ 0x3FB7F408, /* 8, 509, -5 */ 0x3FC7F806, /* 6, 510, -4 */ 0x3FC7F806, /* 6, 510, -4 */ 0x3FD7F805, /* 5, 510, -3 */ 0x3FD7FC04, /* 4, 511, -3 */ 0x3FE7FC03, /* 3, 511, -2 */ 0x3FE7FC03, /* 3, 511, -2 */ 0x3FF7FC02, /* 2, 511, -1 */ 0x3FF7FC02, /* 2, 511, -1 */ 0x0007FC01, /* 1, 511, 0 */ 0x0007FC01, /* 1, 511, 0 */ 0x0007FC01, /* 1, 511, 0 */ 0x0027FFFF, /* -1, 511, 2 */ 0x0027FFFF, /* -1, 511, 2 */ 0x0037FFFE, /* -2, 511, 3 */ 0x0037FFFE, /* -2, 511, 3 */ 0x0047FFFD, /* -3, 511, 4 */ 0x0047FBFE, /* -2, 510, 4 */ 0x0057FBFD, /* -3, 510, 5 */ 0x0067FBFC, /* -4, 510, 6 */ 0x0077F7FC, /* -4, 509, 7 */ 0x0077F7FC, /* -4, 509, 7 */ 0x0087F7FB, /* -5, 509, 8 */ 0x0097F3FB, /* -5, 508, 9 */ 0x00A7F3FA, /* -6, 508, 10 */ 0x00B7EFFA, /* -6, 507, 11 */ 0x00C7EBFA, /* -6, 506, 12 */ 0x00D7EBF9, /* -7, 506, 13 */ 0x00E7E7F9, /* -7, 505, 14 */ 0x00F7E3F9, /* -7, 504, 15 */ 0x0107E3F8, /* -8, 504, 16 */ 0x0117DFF8, /* -8, 503, 17 */ 0x0127DBF8, /* -8, 502, 18 */ 0x0137DBF7, /* -9, 502, 19 */ 0x0147D7F7, /* -9, 501, 20 */ 0x0157D3F7, /* -9, 500, 21 */ 0x0167CFF7, /* -9, 499, 22 */ 0x0177CBF7, /* -9, 498, 23 */ 0x0197C7F6, /* -10, 497, 25 */ 0x01A7C3F6, /* -10, 496, 26 */ 0x01B7BFF6, /* -10, 495, 27 */ 0x01C7BBF6, /* -10, 494, 28 */ 0x01E7B3F6, /* -10, 492, 30 */ 0x01F7B3F5, /* -11, 492, 31 */ 0x0207AFF5, /* -11, 491, 32 */ 0x0217ABF5, /* -11, 490, 33 */ 0x0237A3F5, /* -11, 488, 35 */ 0x02479FF5, /* -11, 487, 36 */ 0x026797F5, /* -11, 485, 38 */ 0x027793F5, /* -11, 484, 39 */ 0x02978BF5, /* -11, 482, 41 */ 0x02A78BF4, /* -12, 482, 42 */ 0x02B787F4, /* -12, 481, 43 */ 0x02D77FF4, /* -12, 479, 45 */ 0x02F777F4, /* -12, 477, 47 */ 0x030773F4, /* -12, 476, 48 */ 0x03276BF4, /* -12, 474, 50 */ 0x033767F4, /* -12, 473, 51 */ 0x03575FF4, /* -12, 471, 53 */ 0x037757F4, /* -12, 469, 55 */ 0x038753F4, /* -12, 468, 56 */ 0x03A74BF4, /* -12, 466, 58 */ 0x03C743F4, /* -12, 464, 60 */ 0x03E73BF4, /* -12, 462, 62 */ 0x040737F3, /* -13, 461, 64 */ 0x04272FF3, /* -13, 459, 66 */ 0x044727F3, /* -13, 457, 68 */ 0x04671FF3, /* -13, 455, 70 */ 0x048717F3, /* -13, 453, 72 */ 0x04A70FF3, /* -13, 451, 74 */ 0x04C703F4, /* -12, 448, 76 */ 0x04D6FFF4, /* -12, 447, 77 */ 0x04F6F7F4, /* -12, 445, 79 */ 0x0516EFF4, /* -12, 443, 81 */ 0x0536E7F4, /* -12, 441, 83 */ 0x0556DFF4, /* -12, 439, 85 */ 0x0586CFF5, /* -11, 435, 88 */ 0x05A6C7F5, /* -11, 433, 90 */ 0x05C6BFF5, /* -11, 431, 92 */ 0x05F6B7F4, /* -12, 429, 95 */ 0x0616AFF4, /* -12, 427, 97 */ 0x0636A3F5, /* -11, 424, 99 */ 0x06569BF5, /* -11, 422, 101 */ 0x06868FF5, /* -11, 419, 104 */ 0x06A687F5, /* -11, 417, 106 */ 0x06C67FF5, /* -11, 415, 108 */ 0x06E677F5, /* -11, 413, 110 */ 0x07166BF5, /* -11, 410, 113 */ 0x073663F5, /* -11, 408, 115 */ 0x07665BF4, /* -12, 406, 118 */ 0x07964BF5, /* -11, 402, 121 */ 0x07B643F5, /* -11, 400, 123 */ 0x07D637F6, /* -10, 397, 125 */ 0x08062BF6, /* -10, 394, 128 */ 0x082623F6, /* -10, 392, 130 */ 0x085617F6, /* -10, 389, 133 */ 0x08760FF6, /* -10, 387, 135 */ 0x08B603F5, /* -11, 384, 139 */ 0x08D5F7F6, /* -10, 381, 141 */ 0x0905EBF6, /* -10, 378, 144 */ 0x0925E3F6, /* -10, 376, 146 */ 0x0955D3F7, /* -9, 372, 149 */ 0x0985C7F7, /* -9, 369, 152 */ 0x09A5BFF7, /* -9, 367, 154 */ 0x09D5B3F7, /* -9, 364, 157 */ 0x0A05ABF6, /* -10, 362, 160 */ 0x0A359BF7, /* -9, 358, 163 */ 0x0A658FF7, /* -9, 355, 166 */ 0x0A9587F6, /* -10, 353, 169 */ 0x0AB57BF7, /* -9, 350, 171 */ 0x0AE56FF7, /* -9, 347, 174 */ 0x0B1563F7, /* -9, 344, 177 */ 0x0B455BF6, /* -10, 342, 180 */ 0x0B754BF7, /* -9, 338, 183 */ 0x0BA53FF7, /* -9, 335, 186 */ 0x0BD533F7, /* -9, 332, 189 */ 0x0C0523F8, /* -8, 328, 192 */ 0x0C251BF8, /* -8, 326, 194 */ 0x0C550FF8, /* -8, 323, 197 */ 0x0C9503F7, /* -9, 320, 201 */ 0x0CC4F7F7, /* -9, 317, 204 */ 0x0CF4EBF7, /* -9, 314, 207 */ 0x0D24DBF8, /* -8, 310, 210 */ 0x0D54CFF8, /* -8, 307, 213 */ 0x0D84C3F8, /* -8, 304, 216 */ 0x0DB4BBF7, /* -9, 302, 219 */ 0x0DE4AFF7, /* -9, 299, 222 */ 0x0E149FF8, /* -8, 295, 225 */ 0x0E4493F8, /* -8, 292, 228 */ 0x0E7483F9, /* -7, 288, 231 */ 0x0EA477F9, /* -7, 285, 234 */ 0x0ED46BF9, /* -7, 282, 237 */ 0x0F045FF9, /* -7, 279, 240 */ 0x0F4453F8, /* -8, 276, 244 */ 0x0F7447F8, /* -8, 273, 247 */ 0x0FA43BF8, /* -8, 270, 250 */ 0x0FD42BF9, /* -7, 266, 253 */ 0x10041FF9, /* -7, 263, 256 */ }; xf86-video-geode-2.11.18/src/cim/cim_filter.c0000644000175000017500000010070612654445443015424 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron default video coefficients. */ long CimarronVideoFilter256[][2] = { {0x10000000, 0x00000000}, /* 0, 4096, 0, 0 */ {0x10008008, 0x00000008}, /* -8, 4096, 8, 0 */ {0x10008010, 0x80010011}, /* -16, 4096, 17, -1 */ {0x10008019, 0x8001001A}, /* -25, 4096, 26, -1 */ {0x10008021, 0x80020023}, /* -33, 4096, 35, -2 */ {0x0FFF8029, 0x8003002D}, /* -41, 4095, 45, -3 */ {0x0FFE8031, 0x80030036}, /* -49, 4094, 54, -3 */ {0x0FFC8038, 0x80040040}, /* -56, 4092, 64, -4 */ {0x0FFB8040, 0x8005004A}, /* -64, 4091, 74, -5 */ {0x0FF88047, 0x80050054}, /* -71, 4088, 84, -5 */ {0x0FF6804E, 0x8006005E}, /* -78, 4086, 94, -6 */ {0x0FF48055, 0x80070068}, /* -85, 4084, 104, -7 */ {0x0FF0805C, 0x80070073}, /* -92, 4080, 115, -7 */ {0x0FEE8063, 0x8008007D}, /* -99, 4078, 125, -8 */ {0x0FEA8069, 0x80090088}, /* -105, 4074, 136, -9 */ {0x0FE78070, 0x800A0093}, /* -112, 4071, 147, -10 */ {0x0FE28076, 0x800A009E}, /* -118, 4066, 158, -10 */ {0x0FDD807C, 0x800B00AA}, /* -124, 4061, 170, -11 */ {0x0FD98082, 0x800C00B5}, /* -130, 4057, 181, -12 */ {0x0FD48088, 0x800D00C1}, /* -136, 4052, 193, -13 */ {0x0FCE808E, 0x800D00CD}, /* -142, 4046, 205, -13 */ {0x0FC88093, 0x800E00D9}, /* -147, 4040, 217, -14 */ {0x0FC38099, 0x800F00E5}, /* -153, 4035, 229, -15 */ {0x0FBD809E, 0x801000F1}, /* -158, 4029, 241, -16 */ {0x0FB680A3, 0x801000FD}, /* -163, 4022, 253, -16 */ {0x0FAF80A8, 0x8011010A}, /* -168, 4015, 266, -17 */ {0x0FA880AD, 0x80120117}, /* -173, 4008, 279, -18 */ {0x0FA180B2, 0x80130124}, /* -178, 4001, 292, -19 */ {0x0F9980B6, 0x80140131}, /* -182, 3993, 305, -20 */ {0x0F9280BB, 0x8015013E}, /* -187, 3986, 318, -21 */ {0x0F8880BF, 0x8015014C}, /* -191, 3976, 332, -21 */ {0x0F8080C3, 0x80160159}, /* -195, 3968, 345, -22 */ {0x0F7880C8, 0x80170167}, /* -200, 3960, 359, -23 */ {0x0F6E80CB, 0x80180175}, /* -203, 3950, 373, -24 */ {0x0F6580CF, 0x80190183}, /* -207, 3941, 387, -25 */ {0x0F5C80D3, 0x801A0191}, /* -211, 3932, 401, -26 */ {0x0F5280D7, 0x801B01A0}, /* -215, 3922, 416, -27 */ {0x0F4880DA, 0x801C01AE}, /* -218, 3912, 430, -28 */ {0x0F3D80DD, 0x801D01BD}, /* -221, 3901, 445, -29 */ {0x0F3280E0, 0x801E01CC}, /* -224, 3890, 460, -30 */ {0x0F2880E4, 0x801F01DB}, /* -228, 3880, 475, -31 */ {0x0F1C80E6, 0x802001EA}, /* -230, 3868, 490, -32 */ {0x0F1180E9, 0x802101F9}, /* -233, 3857, 505, -33 */ {0x0F0480EB, 0x80210208}, /* -235, 3844, 520, -33 */ {0x0EFA80EF, 0x80230218}, /* -239, 3834, 536, -35 */ {0x0EEC80F0, 0x80230227}, /* -240, 3820, 551, -35 */ {0x0EE080F3, 0x80240237}, /* -243, 3808, 567, -36 */ {0x0ED380F5, 0x80250247}, /* -245, 3795, 583, -37 */ {0x0EC780F7, 0x80270257}, /* -247, 3783, 599, -39 */ {0x0EB980F9, 0x80280268}, /* -249, 3769, 616, -40 */ {0x0EAC80FB, 0x80290278}, /* -251, 3756, 632, -41 */ {0x0E9E80FD, 0x802A0289}, /* -253, 3742, 649, -42 */ {0x0E9080FE, 0x802B0299}, /* -254, 3728, 665, -43 */ {0x0E838100, 0x802D02AA}, /* -256, 3715, 682, -45 */ {0x0E758102, 0x802E02BB}, /* -258, 3701, 699, -46 */ {0x0E668103, 0x802F02CC}, /* -259, 3686, 716, -47 */ {0x0E568104, 0x803002DE}, /* -260, 3670, 734, -48 */ {0x0E498106, 0x803202EF}, /* -262, 3657, 751, -50 */ {0x0E398107, 0x80330301}, /* -263, 3641, 769, -51 */ {0x0E298108, 0x80340313}, /* -264, 3625, 787, -52 */ {0x0E1A8109, 0x80360325}, /* -265, 3610, 805, -54 */ {0x0E0B810A, 0x80370336}, /* -266, 3595, 822, -55 */ {0x0DFA810A, 0x80380348}, /* -266, 3578, 840, -56 */ {0x0DEA810B, 0x803A035B}, /* -267, 3562, 859, -58 */ {0x0DDA810C, 0x803B036D}, /* -268, 3546, 877, -59 */ {0x0DCA810C, 0x803D037F}, /* -268, 3530, 895, -61 */ {0x0DB7810B, 0x803E0392}, /* -267, 3511, 914, -62 */ {0x0DA7810C, 0x804003A5}, /* -268, 3495, 933, -64 */ {0x0D95810C, 0x804103B8}, /* -268, 3477, 952, -65 */ {0x0D85810C, 0x804303CA}, /* -268, 3461, 970, -67 */ {0x0D73810C, 0x804403DD}, /* -268, 3443, 989, -68 */ {0x0D61810C, 0x804603F1}, /* -268, 3425, 1009, -70 */ {0x0D50810C, 0x80480404}, /* -268, 3408, 1028, -72 */ {0x0D3E810C, 0x80490417}, /* -268, 3390, 1047, -73 */ {0x0D2C810C, 0x804B042B}, /* -268, 3372, 1067, -75 */ {0x0D1B810C, 0x804D043E}, /* -268, 3355, 1086, -77 */ {0x0D07810B, 0x804E0452}, /* -267, 3335, 1106, -78 */ {0x0CF5810B, 0x80500466}, /* -267, 3317, 1126, -80 */ {0x0CE2810A, 0x8052047A}, /* -266, 3298, 1146, -82 */ {0x0CCF810A, 0x8053048E}, /* -266, 3279, 1166, -83 */ {0x0CBC8109, 0x805504A2}, /* -265, 3260, 1186, -85 */ {0x0CA98108, 0x805704B6}, /* -264, 3241, 1206, -87 */ {0x0C968108, 0x805904CB}, /* -264, 3222, 1227, -89 */ {0x0C838107, 0x805B04DF}, /* -263, 3203, 1247, -91 */ {0x0C6F8106, 0x805C04F3}, /* -262, 3183, 1267, -92 */ {0x0C5B8105, 0x805E0508}, /* -261, 3163, 1288, -94 */ {0x0C478104, 0x8060051D}, /* -260, 3143, 1309, -96 */ {0x0C348103, 0x80620531}, /* -259, 3124, 1329, -98 */ {0x0C1F8102, 0x80640547}, /* -258, 3103, 1351, -100 */ {0x0C0C8101, 0x8066055B}, /* -257, 3084, 1371, -102 */ {0x0BF88100, 0x80680570}, /* -256, 3064, 1392, -104 */ {0x0BE380FE, 0x806A0585}, /* -254, 3043, 1413, -106 */ {0x0BCF80FD, 0x806C059A}, /* -253, 3023, 1434, -108 */ {0x0BBA80FC, 0x806E05B0}, /* -252, 3002, 1456, -110 */ {0x0BA480F9, 0x807005C5}, /* -249, 2980, 1477, -112 */ {0x0B8F80F8, 0x807205DB}, /* -248, 2959, 1499, -114 */ {0x0B7A80F6, 0x807405F0}, /* -246, 2938, 1520, -116 */ {0x0B6580F5, 0x80760606}, /* -245, 2917, 1542, -118 */ {0x0B4F80F3, 0x8077061B}, /* -243, 2895, 1563, -119 */ {0x0B3A80F2, 0x80790631}, /* -242, 2874, 1585, -121 */ {0x0B2480F0, 0x807B0647}, /* -240, 2852, 1607, -123 */ {0x0B0F80EE, 0x807D065C}, /* -238, 2831, 1628, -125 */ {0x0AF980ED, 0x807F0673}, /* -237, 2809, 1651, -127 */ {0x0AE480EB, 0x80810688}, /* -235, 2788, 1672, -129 */ {0x0ACE80E9, 0x8084069F}, /* -233, 2766, 1695, -132 */ {0x0AB980E7, 0x808606B4}, /* -231, 2745, 1716, -134 */ {0x0AA380E6, 0x808806CB}, /* -230, 2723, 1739, -136 */ {0x0A8D80E4, 0x808A06E1}, /* -228, 2701, 1761, -138 */ {0x0A7780E2, 0x808C06F7}, /* -226, 2679, 1783, -140 */ {0x0A6180E0, 0x808E070D}, /* -224, 2657, 1805, -142 */ {0x0A4B80DE, 0x80910724}, /* -222, 2635, 1828, -145 */ {0x0A3580DC, 0x8093073A}, /* -220, 2613, 1850, -147 */ {0x0A1F80DA, 0x80950750}, /* -218, 2591, 1872, -149 */ {0x0A0880D8, 0x80970767}, /* -216, 2568, 1895, -151 */ {0x09F280D6, 0x8099077D}, /* -214, 2546, 1917, -153 */ {0x09DD80D4, 0x809C0793}, /* -212, 2525, 1939, -156 */ {0x09C680D2, 0x809E07AA}, /* -210, 2502, 1962, -158 */ {0x09B080D0, 0x80A007C0}, /* -208, 2480, 1984, -160 */ {0x099980CE, 0x80A207D7}, /* -206, 2457, 2007, -162 */ {0x098380CB, 0x80A507ED}, /* -203, 2435, 2029, -165 */ {0x096C80C9, 0x80A70804}, /* -201, 2412, 2052, -167 */ {0x095680C7, 0x80A9081A}, /* -199, 2390, 2074, -169 */ {0x094080C5, 0x80AB0830}, /* -197, 2368, 2096, -171 */ {0x092980C3, 0x80AE0848}, /* -195, 2345, 2120, -174 */ {0x091380C1, 0x80B0085E}, /* -193, 2323, 2142, -176 */ {0x08FC80BE, 0x80B20874}, /* -190, 2300, 2164, -178 */ {0x08E580BC, 0x80B4088B}, /* -188, 2277, 2187, -180 */ {0x08D080BB, 0x80B708A2}, /* -187, 2256, 2210, -183 */ {0x08B980B9, 0x80B908B9}, /* -185, 2233, 2233, -185 */ {0x08A380B7, 0x80BB08CF}, /* -183, 2211, 2255, -187 */ {0x088B80B4, 0x80BC08E5}, /* -180, 2187, 2277, -188 */ {0x087480B2, 0x80BE08FC}, /* -178, 2164, 2300, -190 */ {0x085E80B0, 0x80C10913}, /* -176, 2142, 2323, -193 */ {0x084880AE, 0x80C30929}, /* -174, 2120, 2345, -195 */ {0x083080AB, 0x80C50940}, /* -171, 2096, 2368, -197 */ {0x081A80A9, 0x80C70956}, /* -169, 2074, 2390, -199 */ {0x080480A7, 0x80C9096C}, /* -167, 2052, 2412, -201 */ {0x07ED80A5, 0x80CB0983}, /* -165, 2029, 2435, -203 */ {0x07D780A2, 0x80CE0999}, /* -162, 2007, 2457, -206 */ {0x07C080A0, 0x80D009B0}, /* -160, 1984, 2480, -208 */ {0x07AA809E, 0x80D209C6}, /* -158, 1962, 2502, -210 */ {0x0793809C, 0x80D409DD}, /* -156, 1939, 2525, -212 */ {0x077D8099, 0x80D609F2}, /* -153, 1917, 2546, -214 */ {0x07668097, 0x80D80A09}, /* -151, 1894, 2569, -216 */ {0x074F8095, 0x80DA0A20}, /* -149, 1871, 2592, -218 */ {0x073A8093, 0x80DC0A35}, /* -147, 1850, 2613, -220 */ {0x07238091, 0x80DE0A4C}, /* -145, 1827, 2636, -222 */ {0x070C808E, 0x80E00A62}, /* -142, 1804, 2658, -224 */ {0x06F7808C, 0x80E20A77}, /* -140, 1783, 2679, -226 */ {0x06E0808A, 0x80E40A8E}, /* -138, 1760, 2702, -228 */ {0x06CA8088, 0x80E60AA4}, /* -136, 1738, 2724, -230 */ {0x06B48086, 0x80E70AB9}, /* -134, 1716, 2745, -231 */ {0x069E8084, 0x80E90ACF}, /* -132, 1694, 2767, -233 */ {0x06878081, 0x80EB0AE5}, /* -129, 1671, 2789, -235 */ {0x0672807F, 0x80ED0AFA}, /* -127, 1650, 2810, -237 */ {0x065C807D, 0x80EE0B0F}, /* -125, 1628, 2831, -238 */ {0x0646807B, 0x80F00B25}, /* -123, 1606, 2853, -240 */ {0x06308079, 0x80F20B3B}, /* -121, 1584, 2875, -242 */ {0x061A8077, 0x80F30B50}, /* -119, 1562, 2896, -243 */ {0x06068076, 0x80F50B65}, /* -118, 1542, 2917, -245 */ {0x05F08074, 0x80F60B7A}, /* -116, 1520, 2938, -246 */ {0x05DB8072, 0x80F80B8F}, /* -114, 1499, 2959, -248 */ {0x05C58070, 0x80F90BA4}, /* -112, 1477, 2980, -249 */ {0x05B1806E, 0x80FC0BB9}, /* -110, 1457, 3001, -252 */ {0x059B806C, 0x80FD0BCE}, /* -108, 1435, 3022, -253 */ {0x0586806A, 0x80FE0BE2}, /* -106, 1414, 3042, -254 */ {0x05718068, 0x81000BF7}, /* -104, 1393, 3063, -256 */ {0x055C8066, 0x81010C0B}, /* -102, 1372, 3083, -257 */ {0x05478064, 0x81020C1F}, /* -100, 1351, 3103, -258 */ {0x05328062, 0x81030C33}, /* -98, 1330, 3123, -259 */ {0x051D8060, 0x81040C47}, /* -96, 1309, 3143, -260 */ {0x0508805E, 0x81050C5B}, /* -94, 1288, 3163, -261 */ {0x04F3805C, 0x81060C6F}, /* -92, 1267, 3183, -262 */ {0x04E0805B, 0x81070C82}, /* -91, 1248, 3202, -263 */ {0x04CB8059, 0x81080C96}, /* -89, 1227, 3222, -264 */ {0x04B68057, 0x81080CA9}, /* -87, 1206, 3241, -264 */ {0x04A28055, 0x81090CBC}, /* -85, 1186, 3260, -265 */ {0x048E8053, 0x810A0CCF}, /* -83, 1166, 3279, -266 */ {0x047A8052, 0x810A0CE2}, /* -82, 1146, 3298, -266 */ {0x04668050, 0x810B0CF5}, /* -80, 1126, 3317, -267 */ {0x0451804E, 0x810B0D08}, /* -78, 1105, 3336, -267 */ {0x043E804D, 0x810C0D1B}, /* -77, 1086, 3355, -268 */ {0x042B804B, 0x810C0D2C}, /* -75, 1067, 3372, -268 */ {0x04178049, 0x810C0D3E}, /* -73, 1047, 3390, -268 */ {0x04038048, 0x810C0D51}, /* -72, 1027, 3409, -268 */ {0x03F08046, 0x810C0D62}, /* -70, 1008, 3426, -268 */ {0x03DD8044, 0x810C0D73}, /* -68, 989, 3443, -268 */ {0x03CA8043, 0x810C0D85}, /* -67, 970, 3461, -268 */ {0x03B78041, 0x810C0D96}, /* -65, 951, 3478, -268 */ {0x03A48040, 0x810C0DA8}, /* -64, 932, 3496, -268 */ {0x0391803E, 0x810B0DB8}, /* -62, 913, 3512, -267 */ {0x0380803D, 0x810C0DC9}, /* -61, 896, 3529, -268 */ {0x036D803B, 0x810C0DDA}, /* -59, 877, 3546, -268 */ {0x035B803A, 0x810B0DEA}, /* -58, 859, 3562, -267 */ {0x03488038, 0x810A0DFA}, /* -56, 840, 3578, -266 */ {0x03368037, 0x810A0E0B}, /* -55, 822, 3595, -266 */ {0x03248036, 0x81090E1B}, /* -54, 804, 3611, -265 */ {0x03128034, 0x81080E2A}, /* -52, 786, 3626, -264 */ {0x03018033, 0x81070E39}, /* -51, 769, 3641, -263 */ {0x02EF8032, 0x81060E49}, /* -50, 751, 3657, -262 */ {0x02DE8030, 0x81040E56}, /* -48, 734, 3670, -260 */ {0x02CC802F, 0x81030E66}, /* -47, 716, 3686, -259 */ {0x02BB802E, 0x81020E75}, /* -46, 699, 3701, -258 */ {0x02AA802D, 0x81000E83}, /* -45, 682, 3715, -256 */ {0x0299802B, 0x80FE0E90}, /* -43, 665, 3728, -254 */ {0x0288802A, 0x80FD0E9F}, /* -42, 648, 3743, -253 */ {0x02778029, 0x80FB0EAD}, /* -41, 631, 3757, -251 */ {0x02678028, 0x80F90EBA}, /* -40, 615, 3770, -249 */ {0x02568027, 0x80F70EC8}, /* -39, 598, 3784, -247 */ {0x02468025, 0x80F50ED4}, /* -37, 582, 3796, -245 */ {0x02368024, 0x80F30EE1}, /* -36, 566, 3809, -243 */ {0x02268023, 0x80F00EED}, /* -35, 550, 3821, -240 */ {0x02188023, 0x80EF0EFA}, /* -35, 536, 3834, -239 */ {0x02078021, 0x80EB0F05}, /* -33, 519, 3845, -235 */ {0x01F98021, 0x80E90F11}, /* -33, 505, 3857, -233 */ {0x01EA8020, 0x80E60F1C}, /* -32, 490, 3868, -230 */ {0x01DC801F, 0x80E40F27}, /* -31, 476, 3879, -228 */ {0x01CD801E, 0x80E00F31}, /* -30, 461, 3889, -224 */ {0x01BE801D, 0x80DD0F3C}, /* -29, 446, 3900, -221 */ {0x01AF801C, 0x80DA0F47}, /* -28, 431, 3911, -218 */ {0x01A1801B, 0x80D70F51}, /* -27, 417, 3921, -215 */ {0x0192801A, 0x80D30F5B}, /* -26, 402, 3931, -211 */ {0x01848019, 0x80CF0F64}, /* -25, 388, 3940, -207 */ {0x01768018, 0x80CB0F6D}, /* -24, 374, 3949, -203 */ {0x01688017, 0x80C80F77}, /* -23, 360, 3959, -200 */ {0x015A8016, 0x80C30F7F}, /* -22, 346, 3967, -195 */ {0x014D8015, 0x80BF0F87}, /* -21, 333, 3975, -191 */ {0x013F8015, 0x80BB0F91}, /* -21, 319, 3985, -187 */ {0x01328014, 0x80B60F98}, /* -20, 306, 3992, -182 */ {0x01258013, 0x80B20FA0}, /* -19, 293, 4000, -178 */ {0x01188012, 0x80AD0FA7}, /* -18, 280, 4007, -173 */ {0x010B8011, 0x80A80FAE}, /* -17, 267, 4014, -168 */ {0x00FE8010, 0x80A30FB5}, /* -16, 254, 4021, -163 */ {0x00F28010, 0x809E0FBC}, /* -16, 242, 4028, -158 */ {0x00E6800F, 0x80990FC2}, /* -15, 230, 4034, -153 */ {0x00DA800E, 0x80930FC7}, /* -14, 218, 4039, -147 */ {0x00CE800D, 0x808E0FCD}, /* -13, 206, 4045, -142 */ {0x00C2800D, 0x80880FD3}, /* -13, 194, 4051, -136 */ {0x00B6800C, 0x80820FD8}, /* -12, 182, 4056, -130 */ {0x00AB800B, 0x807C0FDC}, /* -11, 171, 4060, -124 */ {0x009F800A, 0x80760FE1}, /* -10, 159, 4065, -118 */ {0x0094800A, 0x80700FE6}, /* -10, 148, 4070, -112 */ {0x00898009, 0x80690FE9}, /* -9, 137, 4073, -105 */ {0x007E8008, 0x80630FED}, /* -8, 126, 4077, -99 */ {0x00748007, 0x805C0FEF}, /* -7, 116, 4079, -92 */ {0x00698007, 0x80550FF3}, /* -7, 105, 4083, -85 */ {0x005F8006, 0x804E0FF5}, /* -6, 95, 4085, -78 */ {0x00558005, 0x80470FF7}, /* -5, 85, 4087, -71 */ {0x004B8005, 0x80400FFA}, /* -5, 75, 4090, -64 */ {0x00418004, 0x80380FFB}, /* -4, 65, 4091, -56 */ {0x00378003, 0x80310FFD}, /* -3, 55, 4093, -49 */ {0x002E8003, 0x80290FFE}, /* -3, 46, 4094, -41 */ {0x00238002, 0x80211000}, /* -2, 35, 4096, -33 */ {0x001A8001, 0x80191000}, /* -1, 26, 4096, -25 */ {0x00118001, 0x80101000}, /* -1, 17, 4096, -16 */ {0x00080000, 0x80081000}, /* 0, 8, 4096, -8 */ }; long CimarronVideoFilter128[][2] = { {0x10000000, 0x00000000}, /* 0, 4096, 0, 0 */ {0x10018011, 0x80010011}, /* -17, 4097, 17, -1 */ {0x10008021, 0x80020023}, /* -33, 4096, 35, -2 */ {0x0FFE8031, 0x80030036}, /* -49, 4094, 54, -3 */ {0x0FFB8040, 0x8005004A}, /* -64, 4091, 74, -5 */ {0x0FF6804E, 0x8006005E}, /* -78, 4086, 94, -6 */ {0x0FF0805C, 0x80070073}, /* -92, 4080, 115, -7 */ {0x0FEB806A, 0x80090088}, /* -106, 4075, 136, -9 */ {0x0FE18076, 0x800A009F}, /* -118, 4065, 159, -10 */ {0x0FD98082, 0x800C00B5}, /* -130, 4057, 181, -12 */ {0x0FCE808E, 0x800D00CD}, /* -142, 4046, 205, -13 */ {0x0FC38099, 0x800F00E5}, /* -153, 4035, 229, -15 */ {0x0FB680A4, 0x801000FE}, /* -164, 4022, 254, -16 */ {0x0FA880AD, 0x80120117}, /* -173, 4008, 279, -18 */ {0x0F9A80B7, 0x80140131}, /* -183, 3994, 305, -20 */ {0x0F8980C0, 0x8015014C}, /* -192, 3977, 332, -21 */ {0x0F7880C8, 0x80170167}, /* -200, 3960, 359, -23 */ {0x0F6680D0, 0x80190183}, /* -208, 3942, 387, -25 */ {0x0F5280D7, 0x801B01A0}, /* -215, 3922, 416, -27 */ {0x0F3E80DE, 0x801D01BD}, /* -222, 3902, 445, -29 */ {0x0F2880E4, 0x801F01DB}, /* -228, 3880, 475, -31 */ {0x0F1180EA, 0x802101FA}, /* -234, 3857, 506, -33 */ {0x0EF880EE, 0x80220218}, /* -238, 3832, 536, -34 */ {0x0EDF80F3, 0x80240238}, /* -243, 3807, 568, -36 */ {0x0EC680F7, 0x80270258}, /* -247, 3782, 600, -39 */ {0x0EAB80FB, 0x80290279}, /* -251, 3755, 633, -41 */ {0x0E9080FF, 0x802B029A}, /* -255, 3728, 666, -43 */ {0x0E748102, 0x802E02BC}, /* -258, 3700, 700, -46 */ {0x0E588105, 0x803102DE}, /* -261, 3672, 734, -49 */ {0x0E388107, 0x80330302}, /* -263, 3640, 770, -51 */ {0x0E1A8109, 0x80360325}, /* -265, 3610, 805, -54 */ {0x0DFB810B, 0x80390349}, /* -267, 3579, 841, -57 */ {0x0DDB810C, 0x803C036D}, /* -268, 3547, 877, -60 */ {0x0DBA810D, 0x803F0392}, /* -269, 3514, 914, -63 */ {0x0D98810E, 0x804203B8}, /* -270, 3480, 952, -66 */ {0x0D74810D, 0x804503DE}, /* -269, 3444, 990, -69 */ {0x0D50810D, 0x80480405}, /* -269, 3408, 1029, -72 */ {0x0D2C810C, 0x804B042B}, /* -268, 3372, 1067, -75 */ {0x0D08810C, 0x804F0453}, /* -268, 3336, 1107, -79 */ {0x0CE3810B, 0x8052047A}, /* -267, 3299, 1146, -82 */ {0x0CBD810A, 0x805604A3}, /* -266, 3261, 1187, -86 */ {0x0C968108, 0x805904CB}, /* -264, 3222, 1227, -89 */ {0x0C708107, 0x805D04F4}, /* -263, 3184, 1268, -93 */ {0x0C488105, 0x8061051E}, /* -261, 3144, 1310, -97 */ {0x0C208103, 0x80640547}, /* -259, 3104, 1351, -100 */ {0x0BF78100, 0x80680571}, /* -256, 3063, 1393, -104 */ {0x0BCF80FE, 0x806C059B}, /* -254, 3023, 1435, -108 */ {0x0BA480FA, 0x807005C6}, /* -250, 2980, 1478, -112 */ {0x0B7A80F7, 0x807405F1}, /* -247, 2938, 1521, -116 */ {0x0B4F80F4, 0x8077061C}, /* -244, 2895, 1564, -119 */ {0x0B2580F1, 0x807C0648}, /* -241, 2853, 1608, -124 */ {0x0AFA80ED, 0x80800673}, /* -237, 2810, 1651, -128 */ {0x0ACF80EA, 0x8084069F}, /* -234, 2767, 1695, -132 */ {0x0AA380E6, 0x808806CB}, /* -230, 2723, 1739, -136 */ {0x0A7880E2, 0x808D06F7}, /* -226, 2680, 1783, -141 */ {0x0A4C80DF, 0x80910724}, /* -223, 2636, 1828, -145 */ {0x0A2080DB, 0x80960751}, /* -219, 2592, 1873, -150 */ {0x09F480D7, 0x809A077D}, /* -215, 2548, 1917, -154 */ {0x09C780D2, 0x809F07AA}, /* -210, 2503, 1962, -159 */ {0x099A80CE, 0x80A307D7}, /* -206, 2458, 2007, -163 */ {0x096D80CA, 0x80A70804}, /* -202, 2413, 2052, -167 */ {0x094180C6, 0x80AC0831}, /* -198, 2369, 2097, -172 */ {0x091380C1, 0x80B0085E}, /* -193, 2323, 2142, -176 */ {0x08E780BE, 0x80B5088C}, /* -190, 2279, 2188, -181 */ {0x08B980B9, 0x80B908B9}, /* -185, 2233, 2233, -185 */ {0x088C80B5, 0x80BE08E7}, /* -181, 2188, 2279, -190 */ {0x085E80B0, 0x80C10913}, /* -176, 2142, 2323, -193 */ {0x083180AC, 0x80C60941}, /* -172, 2097, 2369, -198 */ {0x080480A7, 0x80CA096D}, /* -167, 2052, 2413, -202 */ {0x07D780A3, 0x80CE099A}, /* -163, 2007, 2458, -206 */ {0x07AA809F, 0x80D209C7}, /* -159, 1962, 2503, -210 */ {0x077D809A, 0x80D709F4}, /* -154, 1917, 2548, -215 */ {0x07518096, 0x80DB0A20}, /* -150, 1873, 2592, -219 */ {0x07248091, 0x80DF0A4C}, /* -145, 1828, 2636, -223 */ {0x06F7808D, 0x80E20A78}, /* -141, 1783, 2680, -226 */ {0x06CA8088, 0x80E60AA4}, /* -136, 1738, 2724, -230 */ {0x069E8084, 0x80EA0AD0}, /* -132, 1694, 2768, -234 */ {0x06738080, 0x80ED0AFA}, /* -128, 1651, 2810, -237 */ {0x0647807C, 0x80F10B26}, /* -124, 1607, 2854, -241 */ {0x061B8077, 0x80F40B50}, /* -119, 1563, 2896, -244 */ {0x05F18074, 0x80F70B7A}, /* -116, 1521, 2938, -247 */ {0x05C68070, 0x80FA0BA4}, /* -112, 1478, 2980, -250 */ {0x059C806C, 0x80FE0BCE}, /* -108, 1436, 3022, -254 */ {0x05728068, 0x81000BF6}, /* -104, 1394, 3062, -256 */ {0x05478064, 0x81030C20}, /* -100, 1351, 3104, -259 */ {0x051E8061, 0x81050C48}, /* -97, 1310, 3144, -261 */ {0x04F4805D, 0x81070C70}, /* -93, 1268, 3184, -263 */ {0x04CB8059, 0x81080C96}, /* -89, 1227, 3222, -264 */ {0x04A38056, 0x810A0CBD}, /* -86, 1187, 3261, -266 */ {0x047A8052, 0x810B0CE3}, /* -82, 1146, 3299, -267 */ {0x0453804F, 0x810C0D08}, /* -79, 1107, 3336, -268 */ {0x042B804B, 0x810C0D2C}, /* -75, 1067, 3372, -268 */ {0x04048048, 0x810D0D51}, /* -72, 1028, 3409, -269 */ {0x03DE8045, 0x810D0D74}, /* -69, 990, 3444, -269 */ {0x03B88042, 0x810E0D98}, /* -66, 952, 3480, -270 */ {0x0393803F, 0x810D0DB9}, /* -63, 915, 3513, -269 */ {0x036E803C, 0x810C0DDA}, /* -60, 878, 3546, -268 */ {0x03498039, 0x810B0DFB}, /* -57, 841, 3579, -267 */ {0x03258036, 0x81090E1A}, /* -54, 805, 3610, -265 */ {0x03018033, 0x81070E39}, /* -51, 769, 3641, -263 */ {0x02DE8031, 0x81050E58}, /* -49, 734, 3672, -261 */ {0x02BC802E, 0x81020E74}, /* -46, 700, 3700, -258 */ {0x0299802B, 0x80FF0E91}, /* -43, 665, 3729, -255 */ {0x02788029, 0x80FB0EAC}, /* -41, 632, 3756, -251 */ {0x02578027, 0x80F70EC7}, /* -39, 599, 3783, -247 */ {0x02378024, 0x80F30EE0}, /* -36, 567, 3808, -243 */ {0x02178022, 0x80EE0EF9}, /* -34, 535, 3833, -238 */ {0x01FA8021, 0x80EA0F11}, /* -33, 506, 3857, -234 */ {0x01DC801F, 0x80E40F27}, /* -31, 476, 3879, -228 */ {0x01BE801D, 0x80DE0F3D}, /* -29, 446, 3901, -222 */ {0x01A1801B, 0x80D70F51}, /* -27, 417, 3921, -215 */ {0x01848019, 0x80D00F65}, /* -25, 388, 3941, -208 */ {0x01688017, 0x80C80F77}, /* -23, 360, 3959, -200 */ {0x014D8015, 0x80C00F88}, /* -21, 333, 3976, -192 */ {0x01328014, 0x80B70F99}, /* -20, 306, 3993, -183 */ {0x01188012, 0x80AD0FA7}, /* -18, 280, 4007, -173 */ {0x00FF8010, 0x80A40FB5}, /* -16, 255, 4021, -164 */ {0x00E6800F, 0x80990FC2}, /* -15, 230, 4034, -153 */ {0x00CE800D, 0x808E0FCD}, /* -13, 206, 4045, -142 */ {0x00B6800C, 0x80820FD8}, /* -12, 182, 4056, -130 */ {0x00A0800A, 0x80760FE0}, /* -10, 160, 4064, -118 */ {0x00898009, 0x806A0FEA}, /* -9, 137, 4074, -106 */ {0x00748007, 0x805C0FEF}, /* -7, 116, 4079, -92 */ {0x005F8006, 0x804E0FF5}, /* -6, 95, 4085, -78 */ {0x004B8005, 0x80400FFA}, /* -5, 75, 4090, -64 */ {0x00378003, 0x80310FFD}, /* -3, 55, 4093, -49 */ {0x00238002, 0x80211000}, /* -2, 35, 4096, -33 */ {0x00118001, 0x80111001}, /* -1, 17, 4097, -17 */ {0x10000000, 0x00000000}, /* 0, 4096, 0, 0 */ {0x10018011, 0x80010011}, /* -17, 4097, 17, -1 */ {0x10008021, 0x80020023}, /* -33, 4096, 35, -2 */ {0x0FFE8031, 0x80030036}, /* -49, 4094, 54, -3 */ {0x0FFB8040, 0x8005004A}, /* -64, 4091, 74, -5 */ {0x0FF6804E, 0x8006005E}, /* -78, 4086, 94, -6 */ {0x0FF0805C, 0x80070073}, /* -92, 4080, 115, -7 */ {0x0FEB806A, 0x80090088}, /* -106, 4075, 136, -9 */ {0x0FE18076, 0x800A009F}, /* -118, 4065, 159, -10 */ {0x0FD98082, 0x800C00B5}, /* -130, 4057, 181, -12 */ {0x0FCE808E, 0x800D00CD}, /* -142, 4046, 205, -13 */ {0x0FC38099, 0x800F00E5}, /* -153, 4035, 229, -15 */ {0x0FB680A4, 0x801000FE}, /* -164, 4022, 254, -16 */ {0x0FA880AD, 0x80120117}, /* -173, 4008, 279, -18 */ {0x0F9A80B7, 0x80140131}, /* -183, 3994, 305, -20 */ {0x0F8980C0, 0x8015014C}, /* -192, 3977, 332, -21 */ {0x0F7880C8, 0x80170167}, /* -200, 3960, 359, -23 */ {0x0F6680D0, 0x80190183}, /* -208, 3942, 387, -25 */ {0x0F5280D7, 0x801B01A0}, /* -215, 3922, 416, -27 */ {0x0F3E80DE, 0x801D01BD}, /* -222, 3902, 445, -29 */ {0x0F2880E4, 0x801F01DB}, /* -228, 3880, 475, -31 */ {0x0F1180EA, 0x802101FA}, /* -234, 3857, 506, -33 */ {0x0EF880EE, 0x80220218}, /* -238, 3832, 536, -34 */ {0x0EDF80F3, 0x80240238}, /* -243, 3807, 568, -36 */ {0x0EC680F7, 0x80270258}, /* -247, 3782, 600, -39 */ {0x0EAB80FB, 0x80290279}, /* -251, 3755, 633, -41 */ {0x0E9080FF, 0x802B029A}, /* -255, 3728, 666, -43 */ {0x0E748102, 0x802E02BC}, /* -258, 3700, 700, -46 */ {0x0E588105, 0x803102DE}, /* -261, 3672, 734, -49 */ {0x0E388107, 0x80330302}, /* -263, 3640, 770, -51 */ {0x0E1A8109, 0x80360325}, /* -265, 3610, 805, -54 */ {0x0DFB810B, 0x80390349}, /* -267, 3579, 841, -57 */ {0x0DDB810C, 0x803C036D}, /* -268, 3547, 877, -60 */ {0x0DBA810D, 0x803F0392}, /* -269, 3514, 914, -63 */ {0x0D98810E, 0x804203B8}, /* -270, 3480, 952, -66 */ {0x0D74810D, 0x804503DE}, /* -269, 3444, 990, -69 */ {0x0D50810D, 0x80480405}, /* -269, 3408, 1029, -72 */ {0x0D2C810C, 0x804B042B}, /* -268, 3372, 1067, -75 */ {0x0D08810C, 0x804F0453}, /* -268, 3336, 1107, -79 */ {0x0CE3810B, 0x8052047A}, /* -267, 3299, 1146, -82 */ {0x0CBD810A, 0x805604A3}, /* -266, 3261, 1187, -86 */ {0x0C968108, 0x805904CB}, /* -264, 3222, 1227, -89 */ {0x0C708107, 0x805D04F4}, /* -263, 3184, 1268, -93 */ {0x0C488105, 0x8061051E}, /* -261, 3144, 1310, -97 */ {0x0C208103, 0x80640547}, /* -259, 3104, 1351, -100 */ {0x0BF78100, 0x80680571}, /* -256, 3063, 1393, -104 */ {0x0BCF80FE, 0x806C059B}, /* -254, 3023, 1435, -108 */ {0x0BA480FA, 0x807005C6}, /* -250, 2980, 1478, -112 */ {0x0B7A80F7, 0x807405F1}, /* -247, 2938, 1521, -116 */ {0x0B4F80F4, 0x8077061C}, /* -244, 2895, 1564, -119 */ {0x0B2580F1, 0x807C0648}, /* -241, 2853, 1608, -124 */ {0x0AFA80ED, 0x80800673}, /* -237, 2810, 1651, -128 */ {0x0ACF80EA, 0x8084069F}, /* -234, 2767, 1695, -132 */ {0x0AA380E6, 0x808806CB}, /* -230, 2723, 1739, -136 */ {0x0A7880E2, 0x808D06F7}, /* -226, 2680, 1783, -141 */ {0x0A4C80DF, 0x80910724}, /* -223, 2636, 1828, -145 */ {0x0A2080DB, 0x80960751}, /* -219, 2592, 1873, -150 */ {0x09F480D7, 0x809A077D}, /* -215, 2548, 1917, -154 */ {0x09C780D2, 0x809F07AA}, /* -210, 2503, 1962, -159 */ {0x099A80CE, 0x80A307D7}, /* -206, 2458, 2007, -163 */ {0x096D80CA, 0x80A70804}, /* -202, 2413, 2052, -167 */ {0x094180C6, 0x80AC0831}, /* -198, 2369, 2097, -172 */ {0x091380C1, 0x80B0085E}, /* -193, 2323, 2142, -176 */ {0x08E780BE, 0x80B5088C}, /* -190, 2279, 2188, -181 */ {0x08B980B9, 0x80B908B9}, /* -185, 2233, 2233, -185 */ {0x088C80B5, 0x80BE08E7}, /* -181, 2188, 2279, -190 */ {0x085E80B0, 0x80C10913}, /* -176, 2142, 2323, -193 */ {0x083180AC, 0x80C60941}, /* -172, 2097, 2369, -198 */ {0x080480A7, 0x80CA096D}, /* -167, 2052, 2413, -202 */ {0x07D780A3, 0x80CE099A}, /* -163, 2007, 2458, -206 */ {0x07AA809F, 0x80D209C7}, /* -159, 1962, 2503, -210 */ {0x077D809A, 0x80D709F4}, /* -154, 1917, 2548, -215 */ {0x07518096, 0x80DB0A20}, /* -150, 1873, 2592, -219 */ {0x07248091, 0x80DF0A4C}, /* -145, 1828, 2636, -223 */ {0x06F7808D, 0x80E20A78}, /* -141, 1783, 2680, -226 */ {0x06CA8088, 0x80E60AA4}, /* -136, 1738, 2724, -230 */ {0x069E8084, 0x80EA0AD0}, /* -132, 1694, 2768, -234 */ {0x06738080, 0x80ED0AFA}, /* -128, 1651, 2810, -237 */ {0x0647807C, 0x80F10B26}, /* -124, 1607, 2854, -241 */ {0x061B8077, 0x80F40B50}, /* -119, 1563, 2896, -244 */ {0x05F18074, 0x80F70B7A}, /* -116, 1521, 2938, -247 */ {0x05C68070, 0x80FA0BA4}, /* -112, 1478, 2980, -250 */ {0x059C806C, 0x80FE0BCE}, /* -108, 1436, 3022, -254 */ {0x05728068, 0x81000BF6}, /* -104, 1394, 3062, -256 */ {0x05478064, 0x81030C20}, /* -100, 1351, 3104, -259 */ {0x051E8061, 0x81050C48}, /* -97, 1310, 3144, -261 */ {0x04F4805D, 0x81070C70}, /* -93, 1268, 3184, -263 */ {0x04CB8059, 0x81080C96}, /* -89, 1227, 3222, -264 */ {0x04A38056, 0x810A0CBD}, /* -86, 1187, 3261, -266 */ {0x047A8052, 0x810B0CE3}, /* -82, 1146, 3299, -267 */ {0x0453804F, 0x810C0D08}, /* -79, 1107, 3336, -268 */ {0x042B804B, 0x810C0D2C}, /* -75, 1067, 3372, -268 */ {0x04048048, 0x810D0D51}, /* -72, 1028, 3409, -269 */ {0x03DE8045, 0x810D0D74}, /* -69, 990, 3444, -269 */ {0x03B88042, 0x810E0D98}, /* -66, 952, 3480, -270 */ {0x0393803F, 0x810D0DB9}, /* -63, 915, 3513, -269 */ {0x036E803C, 0x810C0DDA}, /* -60, 878, 3546, -268 */ {0x03498039, 0x810B0DFB}, /* -57, 841, 3579, -267 */ {0x03258036, 0x81090E1A}, /* -54, 805, 3610, -265 */ {0x03018033, 0x81070E39}, /* -51, 769, 3641, -263 */ {0x02DE8031, 0x81050E58}, /* -49, 734, 3672, -261 */ {0x02BC802E, 0x81020E74}, /* -46, 700, 3700, -258 */ {0x0299802B, 0x80FF0E91}, /* -43, 665, 3729, -255 */ {0x02788029, 0x80FB0EAC}, /* -41, 632, 3756, -251 */ {0x02578027, 0x80F70EC7}, /* -39, 599, 3783, -247 */ {0x02378024, 0x80F30EE0}, /* -36, 567, 3808, -243 */ {0x02178022, 0x80EE0EF9}, /* -34, 535, 3833, -238 */ {0x01FA8021, 0x80EA0F11}, /* -33, 506, 3857, -234 */ {0x01DC801F, 0x80E40F27}, /* -31, 476, 3879, -228 */ {0x01BE801D, 0x80DE0F3D}, /* -29, 446, 3901, -222 */ {0x01A1801B, 0x80D70F51}, /* -27, 417, 3921, -215 */ {0x01848019, 0x80D00F65}, /* -25, 388, 3941, -208 */ {0x01688017, 0x80C80F77}, /* -23, 360, 3959, -200 */ {0x014D8015, 0x80C00F88}, /* -21, 333, 3976, -192 */ {0x01328014, 0x80B70F99}, /* -20, 306, 3993, -183 */ {0x01188012, 0x80AD0FA7}, /* -18, 280, 4007, -173 */ {0x00FF8010, 0x80A40FB5}, /* -16, 255, 4021, -164 */ {0x00E6800F, 0x80990FC2}, /* -15, 230, 4034, -153 */ {0x00CE800D, 0x808E0FCD}, /* -13, 206, 4045, -142 */ {0x00B6800C, 0x80820FD8}, /* -12, 182, 4056, -130 */ {0x00A0800A, 0x80760FE0}, /* -10, 160, 4064, -118 */ {0x00898009, 0x806A0FEA}, /* -9, 137, 4074, -106 */ {0x00748007, 0x805C0FEF}, /* -7, 116, 4079, -92 */ {0x005F8006, 0x804E0FF5}, /* -6, 95, 4085, -78 */ {0x004B8005, 0x80400FFA}, /* -5, 75, 4090, -64 */ {0x00378003, 0x80310FFD}, /* -3, 55, 4093, -49 */ {0x00238002, 0x80211000}, /* -2, 35, 4096, -33 */ {0x00118001, 0x80111001}, /* -1, 17, 4097, -17 */ }; xf86-video-geode-2.11.18/src/cim/cim_vip.c0000644000175000017500000015621412654445443014742 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron VIP configuration routines. */ /*--------------------------------------------------------------------------- * vip_initialize * * This routine initializes the internal module state and prepares the * module for subsequent VIP orientated activities. *--------------------------------------------------------------------------*/ int vip_initialize(VIPSETMODEBUFFER * buffer) { unsigned long vip_control1, vip_control2, vip_control3; if (!buffer) return CIM_STATUS_INVALIDPARAMS; vip_control1 = 0; vip_control2 = 0; vip_control3 = 0; /* CONFIGURE CONTROL WORDS BASED ON MODE STRUCTURE */ /* Note that some of the input parameters match the register fields */ /* they represent. */ /* STREAM ENABLES */ vip_control1 |= buffer->stream_enables; /* VIP CAPTURE MODE */ vip_control1 |= buffer->operating_mode; /* HANDLE PLANAR CAPTURE */ if (buffer->flags & VIP_MODEFLAG_PLANARCAPTURE) { vip_control1 |= VIP_CONTROL1_PLANAR; if (buffer->planar_capture == VIP_420CAPTURE_EVERYLINE) { vip_control1 |= VIP_CONTROL1_DISABLE_DECIMATION; } else if (buffer->planar_capture == VIP_420CAPTURE_ALTERNATINGFIELDS) { if (buffer->flags & VIP_MODEFLAG_PROGRESSIVE) return CIM_STATUS_INVALIDPARAMS; vip_control1 |= VIP_CONTROL1_DISABLE_DECIMATION; vip_control3 |= VIP_CONTROL3_DECIMATE_EVEN; } else if (buffer->planar_capture != VIP_420CAPTURE_ALTERNATINGLINES) return CIM_STATUS_INVALIDPARAMS; /* CONFIGURE THE VIDEO FIFO THRESHOLD BASED ON THE FIFO DEPTH */ vip_control2 |= VIP_CONTROL2_DEFAULT_VIDTH_420 << VIP_CONTROL2_VIDTH_SHIFT; } else { vip_control2 |= VIP_CONTROL2_DEFAULT_VIDTH_422 << VIP_CONTROL2_VIDTH_SHIFT; } /* CONFIGURE DEFAULT ANCILARRY THRESHOLD AND VIDEO FLUSH VALUES */ vip_control2 |= VIP_CONTROL2_DEFAULT_ANCTH << VIP_CONTROL2_ANCTH_SHIFT; vip_control1 |= VIP_CONTROL1_DEFAULT_ANC_FF << VIP_CONTROL1_ANC_FF_SHIFT; vip_control1 |= VIP_CONTROL1_DEFAULT_VID_FF << VIP_CONTROL1_VID_FF_SHIFT; /* PROGRAM VIP OPTIONS */ /* The options are sanitized based on the current configuration. */ if (buffer->flags & VIP_MODEFLAG_PROGRESSIVE) vip_control1 |= VIP_CONTROL1_NON_INTERLACED; else { if (buffer->flags & VIP_MODEFLAG_TOGGLEEACHFIELD) vip_control3 |= VIP_CONTROL3_BASE_UPDATE; if (buffer->flags & VIP_MODEFLAG_INVERTPOLARITY) vip_control2 |= VIP_CONTROL2_INVERT_POLARITY; } if ((buffer->operating_mode == VIP_MODE_MSG || buffer->operating_mode == VIP_MODE_DATA) && (buffer->flags & VIP_MODEFLAG_FLIPMESSAGEWHENFULL)) { vip_control1 |= VIP_CONTROL1_MSG_STRM_CTRL; } else if (buffer->operating_mode == VIP_MODE_VIP2_8BIT || buffer->operating_mode == VIP_MODE_VIP2_16BIT) { if (buffer->flags & VIP_MODEFLAG_ENABLEREPEATFLAG) vip_control2 |= VIP_CONTROL2_REPEAT_ENABLE; if (buffer->flags & VIP_MODEFLAG_INVERTTASKPOLARITY) vip_control3 |= VIP_CONTROL3_TASK_POLARITY; } if (buffer->flags & VIP_MODEFLAG_DISABLEZERODETECT) vip_control1 |= VIP_CONTROL1_DISABLE_ZERO_DETECT; if (buffer->flags & VIP_MODEFLAG_10BITANCILLARY) vip_control2 |= VIP_CONTROL2_ANC10; /* WRITE THE CONTROL REGISTERS */ /* The control registers are kept 'live' to allow separate instances of */ /* Cimarron to control the VIP hardware. */ WRITE_VIP32(VIP_CONTROL1, vip_control1); WRITE_VIP32(VIP_CONTROL2, vip_control2); WRITE_VIP32(VIP_CONTROL3, vip_control3); /* CONFIGURE 601 PARAMETERS */ if (buffer->operating_mode == VIP_MODE_8BIT601 || buffer->operating_mode == VIP_MODE_16BIT601) { vip_update_601_params(&buffer->vip601_settings); } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_update_601_params * * This routine configures all aspects of 601 VIP data capture, including * start and stop timings and input polarities. *--------------------------------------------------------------------------*/ int vip_update_601_params(VIP_601PARAMS * buffer) { unsigned long vip_control3, vip_control1; if (!buffer) return CIM_STATUS_INVALIDPARAMS; vip_control1 = READ_VIP32(VIP_CONTROL3); vip_control3 = READ_VIP32(VIP_CONTROL3); if (buffer->flags & VIP_MODEFLAG_VSYNCACTIVEHIGH) vip_control3 |= VIP_CONTROL3_VSYNC_POLARITY; else vip_control3 &= ~VIP_CONTROL3_VSYNC_POLARITY; if (buffer->flags & VIP_MODEFLAG_HSYNCACTIVEHIGH) vip_control3 |= VIP_CONTROL3_HSYNC_POLARITY; else vip_control3 &= ~VIP_CONTROL3_HSYNC_POLARITY; WRITE_VIP32(VIP_CONTROL3, vip_control3); WRITE_VIP32(VIP_601_HORZ_START, buffer->horz_start); WRITE_VIP32(VIP_601_VBI_START, buffer->vbi_start); WRITE_VIP32(VIP_601_VBI_END, buffer->vbi_start + buffer->vbi_height - 1); WRITE_VIP32(VIP_601_EVEN_START_STOP, buffer->vert_start_even | ((buffer->vert_start_even + buffer->even_height - 1) << 16)); WRITE_VIP32(VIP_601_ODD_START_STOP, buffer->vert_start_odd | ((buffer->vert_start_odd + buffer->odd_height - 1) << 16)); WRITE_VIP32(VIP_ODD_FIELD_DETECT, buffer->odd_detect_start | (buffer->odd_detect_end << 16)); /* SPECIAL CASE FOR HORIZONTAL DATA * 601 horizontal parameters are based on the number of clocks and not * the number of pixels. */ if ((vip_control1 & VIP_CONTROL1_MODE_MASK) == VIP_MODE_16BIT601) WRITE_VIP32(VIP_601_HORZ_END, buffer->horz_start + (buffer->width << 1) + 3); else WRITE_VIP32(VIP_601_HORZ_END, buffer->horz_start + buffer->width + 3); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_configure_capture_buffers * * This routine configures the base offsets for video, ancillary or message * mode capture. The input structure can also contain multiple offsets, such * that the calling application can avoid updating the structure for each * flip. * * The new buffer addresses are written to the hardware registers although * they may not be latched immediately. Calling vip_is_buffer_update_latched * allows the determination of whether the update has occured. * * Review the Cimarron VIP API documentation to determine which buffer * addresses are latched immediately. *--------------------------------------------------------------------------*/ int vip_configure_capture_buffers(int buffer_type, VIPINPUTBUFFER * buffer) { VIPINPUTBUFFER_ADDR *offsets; unsigned long cur_buffer = buffer->current_buffer; if (!buffer) return CIM_STATUS_INVALIDPARAMS; if (buffer_type == VIP_BUFFER_A || buffer_type == VIP_BUFFER_601) { offsets = &buffer->offsets[VIP_BUFFER_TASK_A]; /* SET VIDEO PITCH */ WRITE_VIP32(VIP_TASKA_VID_PITCH, offsets->y_pitch | (offsets->uv_pitch << 16)); /* SET BASE OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_INVERTPOLARITY) { WRITE_VIP32(VIP_TASKA_VID_ODD_BASE, offsets->even_base[cur_buffer]); WRITE_VIP32(VIP_TASKA_VID_EVEN_BASE, offsets->odd_base[cur_buffer]); if (buffer->flags & VIP_INPUTFLAG_VBI) { WRITE_VIP32(VIP_TASKA_VBI_ODD_BASE, offsets->vbi_even_base); WRITE_VIP32(VIP_TASKA_VBI_EVEN_BASE, offsets->vbi_odd_base); } } else { WRITE_VIP32(VIP_TASKA_VID_ODD_BASE, offsets->odd_base[cur_buffer]); WRITE_VIP32(VIP_TASKA_VID_EVEN_BASE, offsets->even_base[cur_buffer]); if (buffer->flags & VIP_INPUTFLAG_VBI) { WRITE_VIP32(VIP_TASKA_VBI_ODD_BASE, offsets->vbi_odd_base); WRITE_VIP32(VIP_TASKA_VBI_EVEN_BASE, offsets->vbi_even_base); } } /* SET 4:2:0 OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_PLANAR) { WRITE_VIP32(VIP_TASKA_U_OFFSET, offsets->odd_uoffset); WRITE_VIP32(VIP_TASKA_V_OFFSET, offsets->odd_voffset); WRITE_VIP32(VIP_TASKA_U_EVEN_OFFSET, offsets->even_uoffset); WRITE_VIP32(VIP_TASKA_V_EVEN_OFFSET, offsets->even_voffset); } } else if (buffer_type == VIP_BUFFER_B) { offsets = &buffer->offsets[VIP_BUFFER_TASK_B]; /* SET VIDEO PITCH */ WRITE_VIP32(VIP_TASKB_VID_PITCH, offsets->y_pitch | (offsets->uv_pitch << 16)); /* SET BASE OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_INVERTPOLARITY) { WRITE_VIP32(VIP_TASKB_VID_ODD_BASE, offsets->even_base[cur_buffer]); WRITE_VIP32(VIP_TASKB_VID_EVEN_BASE, offsets->odd_base[cur_buffer]); if (buffer->flags & VIP_INPUTFLAG_VBI) { WRITE_VIP32(VIP_TASKB_VBI_ODD_BASE, offsets->vbi_even_base); WRITE_VIP32(VIP_TASKB_VBI_EVEN_BASE, offsets->vbi_odd_base); } } else { WRITE_VIP32(VIP_TASKB_VID_ODD_BASE, offsets->odd_base[cur_buffer]); WRITE_VIP32(VIP_TASKB_VID_EVEN_BASE, offsets->even_base[cur_buffer]); if (buffer->flags & VIP_INPUTFLAG_VBI) { WRITE_VIP32(VIP_TASKB_VBI_ODD_BASE, offsets->vbi_odd_base); WRITE_VIP32(VIP_TASKB_VBI_EVEN_BASE, offsets->vbi_even_base); } } /* SET 4:2:0 OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_PLANAR) { WRITE_VIP32(VIP_TASKB_U_OFFSET, offsets->odd_uoffset); WRITE_VIP32(VIP_TASKB_V_OFFSET, offsets->odd_voffset); } } else if (buffer_type == VIP_BUFFER_ANC || buffer_type == VIP_BUFFER_MSG) { WRITE_VIP32(VIP_ANC_MSG1_BASE, buffer->ancillaryData.msg1_base); WRITE_VIP32(VIP_ANC_MSG2_BASE, buffer->ancillaryData.msg2_base); WRITE_VIP32(VIP_ANC_MSG_SIZE, buffer->ancillaryData.msg_size); } else { return CIM_STATUS_INVALIDPARAMS; } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_toggle_vip_video_offsets * * This routine updates the offsets for video capture. It is a simplified * version of vip_configure_capture_buffers that is designed to be called from * interrupt service routines or other buffer flipping applications that * require low latency. *--------------------------------------------------------------------------*/ int vip_toggle_video_offsets(int buffer_type, VIPINPUTBUFFER * buffer) { unsigned long cur_buffer = buffer->current_buffer; VIPINPUTBUFFER_ADDR *offsets; if (buffer_type == VIP_BUFFER_A) { offsets = &buffer->offsets[VIP_BUFFER_TASK_A]; /* SET BASE OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_INVERTPOLARITY) { WRITE_VIP32(VIP_TASKA_VID_ODD_BASE, offsets->even_base[cur_buffer]); WRITE_VIP32(VIP_TASKA_VID_EVEN_BASE, offsets->odd_base[cur_buffer]); } else { WRITE_VIP32(VIP_TASKA_VID_ODD_BASE, offsets->odd_base[cur_buffer]); WRITE_VIP32(VIP_TASKA_VID_EVEN_BASE, offsets->even_base[cur_buffer]); } } else if (buffer_type == VIP_BUFFER_B) { offsets = &buffer->offsets[VIP_BUFFER_TASK_B]; /* SET BASE OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_INVERTPOLARITY) { WRITE_VIP32(VIP_TASKB_VID_ODD_BASE, offsets->even_base[cur_buffer]); WRITE_VIP32(VIP_TASKB_VID_EVEN_BASE, offsets->odd_base[cur_buffer]); } else { WRITE_VIP32(VIP_TASKB_VID_ODD_BASE, offsets->odd_base[cur_buffer]); WRITE_VIP32(VIP_TASKB_VID_EVEN_BASE, offsets->even_base[cur_buffer]); } } else if (buffer_type == VIP_BUFFER_A_ODD) { offsets = &buffer->offsets[VIP_BUFFER_TASK_A]; /* SET BASE OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_INVERTPOLARITY) WRITE_VIP32(VIP_TASKA_VID_ODD_BASE, offsets->even_base[cur_buffer]); else WRITE_VIP32(VIP_TASKA_VID_ODD_BASE, offsets->odd_base[cur_buffer]); } else if (buffer_type == VIP_BUFFER_A_EVEN) { offsets = &buffer->offsets[VIP_BUFFER_TASK_A]; /* SET BASE OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_INVERTPOLARITY) WRITE_VIP32(VIP_TASKA_VID_EVEN_BASE, offsets->odd_base[cur_buffer]); else WRITE_VIP32(VIP_TASKA_VID_EVEN_BASE, offsets->even_base[cur_buffer]); } else if (buffer_type == VIP_BUFFER_B_ODD) { offsets = &buffer->offsets[VIP_BUFFER_TASK_B]; /* SET BASE OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_INVERTPOLARITY) WRITE_VIP32(VIP_TASKB_VID_ODD_BASE, offsets->even_base[cur_buffer]); else WRITE_VIP32(VIP_TASKB_VID_ODD_BASE, offsets->odd_base[cur_buffer]); } else if (buffer_type == VIP_BUFFER_B_EVEN) { offsets = &buffer->offsets[VIP_BUFFER_TASK_B]; /* SET BASE OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_INVERTPOLARITY) WRITE_VIP32(VIP_TASKB_VID_EVEN_BASE, offsets->odd_base[cur_buffer]); else WRITE_VIP32(VIP_TASKB_VID_EVEN_BASE, offsets->even_base[cur_buffer]); } else return CIM_STATUS_INVALIDPARAMS; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_set_capture_state * * This routine takes the current control word definition ( stored in locals ) * adds in the specified state, and writes the control word. *--------------------------------------------------------------------------*/ int vip_set_capture_state(unsigned long state) { unsigned long vip_control1, vip_control3; /* UPDATE THE CURRENT CAPTURE MODE */ vip_control1 = READ_VIP32(VIP_CONTROL1); vip_control3 = READ_VIP32(VIP_CONTROL3); vip_control1 &= ~VIP_CONTROL1_RUNMODE_MASK; vip_control1 |= (state << VIP_CONTROL1_RUNMODE_SHIFT); WRITE_VIP32(VIP_CONTROL1, vip_control1); if (state >= VIP_STARTCAPTUREATNEXTLINE) { /* WHACK VIP RESET * The VIP can get confused when switching between capture settings, * such as between linear and planar. We will thus whack VIP reset * when enabling capture to ensure a pristine VIP state. */ WRITE_VIP32(VIP_CONTROL1, vip_control1 | VIP_CONTROL1_RESET); WRITE_VIP32(VIP_CONTROL1, vip_control1 & ~VIP_CONTROL1_RESET); WRITE_VIP32(VIP_CONTROL3, vip_control3 | VIP_CONTROL3_FIFO_RESET); } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_terminate * * This routine stops VIP capture and resets the VIP internal state. *--------------------------------------------------------------------------*/ int vip_terminate(void) { unsigned long timeout = 50000; /* DISABLE AND CLEAR ALL VIP INTERRUPTS */ WRITE_VIP32(VIP_INTERRUPT, VIP_ALL_INTERRUPTS | (VIP_ALL_INTERRUPTS >> 16)); /* DISABLE VIP CAPTURE */ /* We will try to let the VIP FIFO flush before shutting it down. */ WRITE_VIP32(VIP_CONTROL1, 0); while (timeout) { timeout--; if (READ_VIP32(VIP_STATUS) & VIP_STATUS_WRITES_COMPLETE) break; } /* RESET THE HARDWARE REGISTERS */ /* Note that we enable VIP reset to allow clock gating to lower VIP */ /* power consumption. */ WRITE_VIP32(VIP_CONTROL1, VIP_CONTROL1_RESET); WRITE_VIP32(VIP_CONTROL3, VIP_CONTROL3_FIFO_RESET); WRITE_VIP32(VIP_CONTROL2, 0); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_configure_fifo * * This routine sets the desired threshold or flush for the specified fifo. *--------------------------------------------------------------------------*/ int vip_configure_fifo(unsigned long fifo_type, unsigned long fifo_size) { unsigned long vip_control1, vip_control2; vip_control1 = READ_VIP32(VIP_CONTROL1); vip_control2 = READ_VIP32(VIP_CONTROL2); switch (fifo_type) { case VIP_VIDEOTHRESHOLD: vip_control2 &= ~VIP_CONTROL2_VIDTH_MASK; vip_control2 |= (fifo_size << VIP_CONTROL2_VIDTH_SHIFT) & VIP_CONTROL2_VIDTH_MASK; break; case VIP_ANCILLARYTHRESHOLD: vip_control2 &= ~VIP_CONTROL2_ANCTH_MASK; vip_control2 |= (fifo_size << VIP_CONTROL2_ANCTH_SHIFT) & VIP_CONTROL2_ANCTH_MASK; break; case VIP_VIDEOFLUSH: vip_control1 &= ~VIP_CONTROL1_VID_FF_MASK; vip_control1 |= ((fifo_size >> 2) << VIP_CONTROL1_VID_FF_SHIFT) & VIP_CONTROL1_VID_FF_MASK; break; case VIP_ANCILLARYFLUSH: vip_control1 &= ~VIP_CONTROL1_ANC_FF_MASK; vip_control1 |= ((fifo_size >> 2) << VIP_CONTROL1_ANC_FF_SHIFT) & VIP_CONTROL1_ANC_FF_MASK; break; default: return CIM_STATUS_INVALIDPARAMS; } WRITE_VIP32(VIP_CONTROL1, vip_control1); WRITE_VIP32(VIP_CONTROL2, vip_control2); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_set_interrupt_enable * * This routine accepts a mask of interrupts to be enabled/disabled and * an enable flag. * * For each mask match, the interrupt will be enabled or disabled based on * enable *--------------------------------------------------------------------------*/ int vip_set_interrupt_enable(unsigned long mask, int enable) { /* CHECK IF ANY VALID INTERRUPTS ARE BEING CHANGED */ if (mask & VIP_ALL_INTERRUPTS) { unsigned long int_enable = READ_VIP32(VIP_INTERRUPT) & 0xFFFF; /* SET OR CLEAR THE MASK BITS */ /* Note that the upper 16-bits of the register are 0 after this */ /* operation. This prevents us from indadvertently clearing a */ /* pending interrupt by enabling/disabling another one. */ if (enable) int_enable &= ~(mask >> 16); else int_enable |= (mask >> 16); WRITE_VIP32(VIP_INTERRUPT, int_enable); } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_set_vsync_error * * This routine defines a region that is used to determine if the vsync is * within an acceptable range. This definition is accomplished using * a count and a vertical window. The count specifies the exact number * of clocks expected for one field. The window parameters specify the number * of clocks variation allowed before and after the expected vsync. For * example, if vertical_count is 1000, window_before is 5 and window_after * is 12, VSync will be considered valid if it occurs between 995 and 1012 * clocks after the last VSync. The total window size (window_before + * window_after) cannot exceed 255. *--------------------------------------------------------------------------*/ int vip_set_vsync_error(unsigned long vertical_count, unsigned long window_before, unsigned long window_after, int enable) { unsigned long vip_control2 = READ_VIP32(VIP_CONTROL2); unsigned long temp; if (enable) { /* CREATE THE VERTICAL WINDOW * The VIP uses two counters. The first counter defines the minimum * clock count before a valid VSync can occur. The second counter * starts after the first completes and defines the acceptable * region of variation. */ temp = ((window_before + window_after) << VIP_VSYNC_ERR_WINDOW_SHIFT) & VIP_VSYNC_ERR_WINDOW_MASK; temp |= (vertical_count - window_before) & VIP_VSYNC_ERR_COUNT_MASK; vip_control2 |= VIP_CONTROL2_VERTERROR_ENABLE; WRITE_VIP32(VIP_VSYNC_ERR_COUNT, temp); } else { vip_control2 &= ~VIP_CONTROL2_VERTERROR_ENABLE; } WRITE_VIP32(VIP_CONTROL2, vip_control2); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_max_address_enable * * This routine specifies the maximum address to which the the hardware should * write during data storage. If this value is exceeded an error is generated, * (this may be monitored using the appropriate interrupt flags - see * vip_set_interrupt_enable) *--------------------------------------------------------------------------*/ int vip_max_address_enable(unsigned long max_address, int enable) { unsigned long vip_control2 = READ_VIP32(VIP_CONTROL2); if (enable) { /* ENABLE THE CONTROL BIT */ vip_control2 |= VIP_CONTROL2_ADD_ERROR_ENABLE; WRITE_VIP32(VIP_MAX_ADDRESS, max_address & VIP_MAXADDR_MASK); } else { /* DISABLE DETECTION */ vip_control2 &= ~VIP_CONTROL2_ADD_ERROR_ENABLE; } WRITE_VIP32(VIP_CONTROL2, vip_control2); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_set_loopback_enable * * This routine enables/disables internal loopback functionality. When * loopback is enabled, the VOP outputs are rerouted to the VIP inputs * internal to the chip. No loopback connector is required. *--------------------------------------------------------------------------*/ int vip_set_loopback_enable(int enable) { unsigned long vip_control2 = READ_VIP32(VIP_CONTROL2); if (enable) vip_control2 |= VIP_CONTROL2_LOOPBACK_ENABLE; else vip_control2 &= ~VIP_CONTROL2_LOOPBACK_ENABLE; WRITE_VIP32(VIP_CONTROL2, vip_control2); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_configure_genlock * * This routine configures genlock functionality. *---------------------------------------------------------------------------*/ int vip_configure_genlock(VIPGENLOCKBUFFER * buffer) { unsigned long vip_control1, vip_control2; unsigned long unlock, genlk_ctl; if (!buffer) return CIM_STATUS_INVALIDPARAMS; unlock = READ_REG32(DC3_UNLOCK); genlk_ctl = READ_REG32(DC3_GENLK_CTL); vip_control1 = READ_VIP32(VIP_CONTROL1); vip_control2 = READ_VIP32(VIP_CONTROL2); /* UPDATE VIDEO DETECTION */ /* These flags are used to indicate the ways in which the VIP signal */ /* can be considered 'lost'. */ vip_control1 &= ~VIP_CONTROL1_VDE_FF_MASK; vip_control2 &= ~(VIP_CONTROL2_FIELD2VG_MASK | VIP_CONTROL2_SYNC2VG_MASK); vip_control1 |= buffer->vip_signal_loss; /* UPDATE FIELD AND VSYNC INFORMATION */ /* These flags control how and when the even/odd field and Vsync */ /* information is communicated to the VG. */ vip_control2 |= buffer->field_to_vg; vip_control2 |= buffer->vsync_to_vg; /* ENABLE OR DISABLE GENLOCK TIMEOUT */ /* Enabling genlock timeout allows the VG to revert to its own sync */ /* timings when the VIP input is lost. Note that the VIP will not */ /* know the signal is lost unless the appropriate error detection */ /* flags have been enabled inside vip_initialize. */ if (buffer->enable_timeout) genlk_ctl |= DC3_GC_GENLOCK_TO_ENABLE; else genlk_ctl &= ~DC3_GC_GENLOCK_TO_ENABLE; genlk_ctl &= ~DC3_GC_GENLOCK_SKEW_MASK; genlk_ctl |= buffer->genlock_skew & DC3_GC_GENLOCK_SKEW_MASK; WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_GENLK_CTL, genlk_ctl); WRITE_VIP32(VIP_CONTROL1, vip_control1); WRITE_VIP32(VIP_CONTROL2, vip_control2); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_set_genlock_enable * * This routine enables/disables genlock inside the VG. *--------------------------------------------------------------------------*/ int vip_set_genlock_enable(int enable) { unsigned long unlock, temp; unlock = READ_REG32(DC3_UNLOCK); temp = READ_REG32(DC3_GENLK_CTL); if (enable) temp |= DC3_GC_GENLOCK_ENABLE; else temp &= ~DC3_GC_GENLOCK_ENABLE; WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_GENLK_CTL, temp); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_set_power_characteristics * * This routine takes a VIPPOWERBUFFER structure, and selectively sets the * GeodeLink power and/or Vip clock power states. *--------------------------------------------------------------------------*/ int vip_set_power_characteristics(VIPPOWERBUFFER * buffer) { Q_WORD q_word; if (!buffer) return CIM_STATUS_INVALIDPARAMS; q_word.low = q_word.high = 0; /* ENABLE GEODELINK CLOCK GATING */ if (buffer->glink_clock_mode) q_word.low |= VIP_MSR_POWER_GLINK; /* ENABLE VIP CLOCK GATING */ if (buffer->vip_clock_mode) q_word.low |= VIP_MSR_POWER_CLOCK; /* WRITE THE NEW VALUE */ msr_write64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_PM, &q_word); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_set_priority_characteristics * * This routine programs the VIP GeodeLink priority characteristics *--------------------------------------------------------------------------*/ int vip_set_priority_characteristics(VIPPRIORITYBUFFER * buffer) { Q_WORD q_word; if (!buffer) return CIM_STATUS_INVALIDPARAMS; q_word.low = q_word.high = 0; q_word.low |= (buffer->secondary << VIP_MSR_MCR_SECOND_PRIORITY_SHIFT) & VIP_MSR_MCR_SECOND_PRIORITY_MASK; q_word.low |= (buffer->primary << VIP_MSR_MCR_PRIMARY_PRIORITY_SHIFT) & VIP_MSR_MCR_PRIMARY_PRIORITY_MASK; q_word.low |= (buffer->pid << VIP_MSR_MCR_PID_SHIFT) & VIP_MSR_MCR_PID_MASK; msr_write64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_CONFIG, &q_word); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_set_debug_characteristics * * This routine configures the debug data that is exposed over the diag bus. *--------------------------------------------------------------------------*/ int vip_set_debug_characteristics(VIPDEBUGBUFFER * buffer) { Q_WORD q_word; if (!buffer) return CIM_STATUS_INVALIDPARAMS; q_word.low = q_word.high = 0; q_word.high |= (buffer->bist << VIP_MSR_DIAG_BIST_SHIFT) & VIP_MSR_DIAG_BIST_WMASK; q_word.low |= (buffer->enable_upper ? VIP_MSR_DIAG_MSB_ENABLE : 0x00000000); q_word.low |= (buffer->select_upper << VIP_MSR_DIAG_SEL_UPPER_SHIFT) & VIP_MSR_DIAG_SEL_UPPER_MASK; q_word.low |= (buffer->enable_lower ? VIP_MSR_DIAG_LSB_ENABLE : 0x00000000); q_word.low |= (buffer->select_lower << VIP_MSR_DIAG_SEL_LOWER_SHIFT) & VIP_MSR_DIAG_SEL_LOWER_MASK; msr_write64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_DIAG, &q_word); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_configure_pages * * This routine sets the number of pages, and their offset from each other. *--------------------------------------------------------------------------*/ int vip_configure_pages(int page_count, unsigned long page_offset) { unsigned long vip_control2 = READ_VIP32(VIP_CONTROL2); /* SET THE NEW PAGE COUNT */ vip_control2 &= ~VIP_CONTROL2_PAGECNT_MASK; vip_control2 |= (page_count << VIP_CONTROL2_PAGECNT_SHIFT) & VIP_CONTROL2_PAGECNT_MASK; /* WRITE THE PAGE OFFSET */ WRITE_VIP32(VIP_CONTROL2, vip_control2); WRITE_VIP32(VIP_PAGE_OFFSET, page_offset); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_set_interrupt_line * * This routine sets the line at which a line interrupt should be generated. *--------------------------------------------------------------------------*/ int vip_set_interrupt_line(int line) { WRITE_VIP32(VIP_CURRENT_TARGET, (line << VIP_CTARGET_TLINE_SHIFT) & VIP_CTARGET_TLINE_MASK); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_reset * * This routine does a one-shot enable of the VIP hardware. It is useful * for handling unrecoverable VIP errors. *--------------------------------------------------------------------------*/ int vip_reset(void) { unsigned long vip_control1, vip_control3; /* INVERT THE PAUSE BIT */ vip_control1 = READ_VIP32(VIP_CONTROL1); vip_control3 = READ_VIP32(VIP_CONTROL3); WRITE_VIP32(VIP_CONTROL1, vip_control1 | VIP_CONTROL1_RESET); WRITE_VIP32(VIP_CONTROL1, vip_control1 & ~VIP_CONTROL1_RESET); WRITE_VIP32(VIP_CONTROL3, vip_control3 | VIP_CONTROL3_FIFO_RESET); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_set_subwindow_enable * * This routine turns on SubWindow capture, that is a portion of the incoming * signal is captured rather than the entire frame. The window always has * the same width as the frame, only the vertical component can be * modified. *--------------------------------------------------------------------------*/ int vip_set_subwindow_enable(VIPSUBWINDOWBUFFER * buffer) { unsigned long vip_control2; if (!buffer) return CIM_STATUS_INVALIDPARAMS; vip_control2 = READ_VIP32(VIP_CONTROL2); if (buffer->enable) { /* WRITE THE WINDOW VALUE */ WRITE_VIP32(VIP_VERTICAL_START_STOP, ((buffer->stop << VIP_VSTART_VERTEND_SHIFT) & VIP_VSTART_VERTEND_MASK) | ((buffer->start << VIP_VSTART_VERTSTART_SHIFT) & VIP_VSTART_VERTSTART_MASK)); /* ENABLE IN THE CONTROL REGISTER */ vip_control2 |= VIP_CONTROL2_SWC_ENABLE; } else { /* DISABLE SUBWINDOW CAPTURE IN THE CONTROL REGISTER */ vip_control2 &= ~VIP_CONTROL2_SWC_ENABLE; } WRITE_VIP32(VIP_CONTROL2, vip_control2); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_reset_interrupt_state * * This routine resets the state of one or more interrupts. *--------------------------------------------------------------------------*/ int vip_reset_interrupt_state(unsigned long interrupt_mask) { unsigned long temp; temp = READ_VIP32(VIP_INTERRUPT); WRITE_VIP32(VIP_INTERRUPT, temp | (interrupt_mask & VIP_ALL_INTERRUPTS)); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_save_state * * This routine saves the necessary register contents in order to restore * at a later point to the same state. * * NOTE: Capture state is forced to OFF in this routine *--------------------------------------------------------------------------*/ int vip_save_state(VIPSTATEBUFFER * save_buffer) { if (!save_buffer) return CIM_STATUS_INVALIDPARAMS; /* FORCE CAPTURE TO BE DISABLED */ vip_set_capture_state(VIP_STOPCAPTURE); /* READ AND SAVE THE REGISTER CONTENTS */ save_buffer->control1 = READ_VIP32(VIP_CONTROL1); save_buffer->control2 = READ_VIP32(VIP_CONTROL2); save_buffer->vip_int = READ_VIP32(VIP_INTERRUPT); save_buffer->current_target = READ_VIP32(VIP_CURRENT_TARGET); save_buffer->max_address = READ_VIP32(VIP_MAX_ADDRESS); save_buffer->taska_evenbase = READ_VIP32(VIP_TASKA_VID_EVEN_BASE); save_buffer->taska_oddbase = READ_VIP32(VIP_TASKA_VID_ODD_BASE); save_buffer->taska_vbi_evenbase = READ_VIP32(VIP_TASKA_VBI_EVEN_BASE); save_buffer->taska_vbi_oddbase = READ_VIP32(VIP_TASKA_VBI_ODD_BASE); save_buffer->taska_data_pitch = READ_VIP32(VIP_TASKA_VID_PITCH); save_buffer->control3 = READ_VIP32(VIP_CONTROL3); save_buffer->taska_v_oddoffset = READ_VIP32(VIP_TASKA_U_OFFSET); save_buffer->taska_u_oddoffset = READ_VIP32(VIP_TASKA_V_OFFSET); save_buffer->taskb_evenbase = READ_VIP32(VIP_TASKB_VID_EVEN_BASE); save_buffer->taskb_oddbase = READ_VIP32(VIP_TASKB_VID_ODD_BASE); save_buffer->taskb_vbi_evenbase = READ_VIP32(VIP_TASKB_VBI_EVEN_BASE); save_buffer->taskb_vbi_oddbase = READ_VIP32(VIP_TASKB_VBI_ODD_BASE); save_buffer->taskb_pitch = READ_VIP32(VIP_TASKB_VID_PITCH); save_buffer->taskb_voffset = READ_VIP32(VIP_TASKB_U_OFFSET); save_buffer->taskb_uoffset = READ_VIP32(VIP_TASKB_V_OFFSET); save_buffer->msg1_base = READ_VIP32(VIP_ANC_MSG1_BASE); save_buffer->msg2_base = READ_VIP32(VIP_ANC_MSG2_BASE); save_buffer->msg_size = READ_VIP32(VIP_ANC_MSG_SIZE); save_buffer->page_offset = READ_VIP32(VIP_PAGE_OFFSET); save_buffer->vert_start_stop = READ_VIP32(VIP_VERTICAL_START_STOP); save_buffer->vsync_err_count = READ_VIP32(VIP_VSYNC_ERR_COUNT); save_buffer->taska_u_evenoffset = READ_VIP32(VIP_TASKA_U_EVEN_OFFSET); save_buffer->taska_v_evenoffset = READ_VIP32(VIP_TASKA_V_EVEN_OFFSET); /* READ ALL VIP MSRS */ msr_read64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_CONFIG, &(save_buffer->msr_config)); msr_read64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_SMI, &(save_buffer->msr_smi)); msr_read64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_PM, &(save_buffer->msr_pm)); msr_read64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_DIAG, &(save_buffer->msr_diag)); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_restore_state * * This routine restores the state of the vip registers - which were * previously saved using vip_save_state. *--------------------------------------------------------------------------*/ int vip_restore_state(VIPSTATEBUFFER * restore_buffer) { if (!restore_buffer) return CIM_STATUS_OK; /* RESTORE THE REGISTERS */ WRITE_VIP32(VIP_CURRENT_TARGET, restore_buffer->current_target); WRITE_VIP32(VIP_MAX_ADDRESS, restore_buffer->max_address); WRITE_VIP32(VIP_TASKA_VID_EVEN_BASE, restore_buffer->taska_evenbase); WRITE_VIP32(VIP_TASKA_VID_ODD_BASE, restore_buffer->taska_oddbase); WRITE_VIP32(VIP_TASKA_VBI_EVEN_BASE, restore_buffer->taska_vbi_evenbase); WRITE_VIP32(VIP_TASKA_VBI_ODD_BASE, restore_buffer->taska_vbi_oddbase); WRITE_VIP32(VIP_TASKA_VID_PITCH, restore_buffer->taska_data_pitch); WRITE_VIP32(VIP_CONTROL3, restore_buffer->control3); WRITE_VIP32(VIP_TASKA_U_OFFSET, restore_buffer->taska_v_oddoffset); WRITE_VIP32(VIP_TASKA_V_OFFSET, restore_buffer->taska_u_oddoffset); WRITE_VIP32(VIP_TASKB_VID_EVEN_BASE, restore_buffer->taskb_evenbase); WRITE_VIP32(VIP_TASKB_VID_ODD_BASE, restore_buffer->taskb_oddbase); WRITE_VIP32(VIP_TASKB_VBI_EVEN_BASE, restore_buffer->taskb_vbi_evenbase); WRITE_VIP32(VIP_TASKB_VBI_ODD_BASE, restore_buffer->taskb_vbi_oddbase); WRITE_VIP32(VIP_TASKB_VID_PITCH, restore_buffer->taskb_pitch); WRITE_VIP32(VIP_TASKB_U_OFFSET, restore_buffer->taskb_voffset); WRITE_VIP32(VIP_TASKB_V_OFFSET, restore_buffer->taskb_uoffset); WRITE_VIP32(VIP_ANC_MSG1_BASE, restore_buffer->msg1_base); WRITE_VIP32(VIP_ANC_MSG2_BASE, restore_buffer->msg2_base); WRITE_VIP32(VIP_ANC_MSG_SIZE, restore_buffer->msg_size); WRITE_VIP32(VIP_PAGE_OFFSET, restore_buffer->page_offset); WRITE_VIP32(VIP_VERTICAL_START_STOP, restore_buffer->vert_start_stop); WRITE_VIP32(VIP_VSYNC_ERR_COUNT, restore_buffer->vsync_err_count); WRITE_VIP32(VIP_TASKA_U_EVEN_OFFSET, restore_buffer->taska_u_evenoffset); WRITE_VIP32(VIP_TASKA_V_EVEN_OFFSET, restore_buffer->taska_v_evenoffset); /* RESTORE THE VIP MSRS */ msr_write64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_CONFIG, &(restore_buffer->msr_config)); msr_write64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_SMI, &(restore_buffer->msr_smi)); msr_write64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_PM, &(restore_buffer->msr_pm)); msr_write64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_DIAG, &(restore_buffer->msr_diag)); /* RESTORE THE CONTROL WORDS LAST */ WRITE_VIP32(VIP_CONTROL1, restore_buffer->control1); WRITE_VIP32(VIP_CONTROL2, restore_buffer->control2); WRITE_VIP32(VIP_CONTROL3, restore_buffer->control3); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_get_interrupt_state * * This routine returns the current interrupt state of the system. The * rv can be tested with the following flags to determine if the appropriate * event has occured. *--------------------------------------------------------------------------*/ unsigned long vip_get_interrupt_state(void) { unsigned long interrupt_mask = READ_VIP32(VIP_INTERRUPT); return (~(interrupt_mask << 16) & interrupt_mask & VIP_ALL_INTERRUPTS); } /*--------------------------------------------------------------------------- * vip_test_genlock_active * * This routine reads the live status of the genlock connection between the * VIP and VG blocks. *--------------------------------------------------------------------------*/ int vip_test_genlock_active(void) { if (READ_REG32(DC3_GENLK_CTL) & DC3_GC_GENLK_ACTIVE) return 1; return 0; } /*--------------------------------------------------------------------------- * vip_test_signal_status * * This routine reads the live signal status coming into the VIP block. *--------------------------------------------------------------------------*/ int vip_test_signal_status(void) { if (READ_REG32(DC3_GENLK_CTL) & DC3_GC_VIP_VID_OK) return 1; return 0; } /*--------------------------------------------------------------------------- * vip_get_current_field * * This routine returns the current field being received. *--------------------------------------------------------------------------*/ unsigned long vip_get_current_field(void) { if (READ_VIP32(VIP_STATUS) & VIP_STATUS_FIELD) return VIP_EVEN_FIELD; return VIP_ODD_FIELD; } /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * CIMARRON VIP READ ROUTINES * These routines are included for use in diagnostics or when debugging. They * can be optionally excluded from a project. *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ #if CIMARRON_INCLUDE_VIP_READ_ROUTINES /*--------------------------------------------------------------------------- * vip_get_current_mode * * This routine reads the current VIP operating mode. *--------------------------------------------------------------------------*/ int vip_get_current_mode(VIPSETMODEBUFFER * buffer) { unsigned long vip_control1, vip_control2, vip_control3; if (!buffer) return CIM_STATUS_INVALIDPARAMS; vip_control1 = READ_VIP32(VIP_CONTROL1); vip_control2 = READ_VIP32(VIP_CONTROL2); vip_control3 = READ_VIP32(VIP_CONTROL3); /* READ CURRENT OPERATING MODE AND ENABLES */ buffer->stream_enables = vip_control1 & VIP_ENABLE_ALL; buffer->operating_mode = vip_control1 & VIP_CONTROL1_MODE_MASK; /* READ CURRENT PLANAR CAPTURE SETTINGS */ buffer->flags = 0; buffer->planar_capture = 0; if (vip_control1 & VIP_CONTROL1_PLANAR) { buffer->flags |= VIP_MODEFLAG_PLANARCAPTURE; if (vip_control1 & VIP_CONTROL1_DISABLE_DECIMATION) { if (vip_control3 & VIP_CONTROL3_DECIMATE_EVEN) buffer->planar_capture = VIP_420CAPTURE_ALTERNATINGFIELDS; else buffer->planar_capture = VIP_420CAPTURE_EVERYLINE; } else buffer->planar_capture = VIP_420CAPTURE_ALTERNATINGLINES; } /* READ MISCELLANEOUS FLAGS */ if (vip_control1 & VIP_CONTROL1_NON_INTERLACED) buffer->flags |= VIP_MODEFLAG_PROGRESSIVE; if (vip_control3 & VIP_CONTROL3_BASE_UPDATE) buffer->flags |= VIP_MODEFLAG_TOGGLEEACHFIELD; if (vip_control2 & VIP_CONTROL2_INVERT_POLARITY) buffer->flags |= VIP_MODEFLAG_INVERTPOLARITY; if (vip_control1 & VIP_CONTROL1_MSG_STRM_CTRL) buffer->flags |= VIP_MODEFLAG_FLIPMESSAGEWHENFULL; if (vip_control2 & VIP_CONTROL2_REPEAT_ENABLE) buffer->flags |= VIP_MODEFLAG_ENABLEREPEATFLAG; if (vip_control3 & VIP_CONTROL3_TASK_POLARITY) buffer->flags |= VIP_MODEFLAG_INVERTTASKPOLARITY; if (vip_control1 & VIP_CONTROL1_DISABLE_ZERO_DETECT) buffer->flags |= VIP_MODEFLAG_DISABLEZERODETECT; if (vip_control2 & VIP_CONTROL2_ANC10) buffer->flags |= VIP_MODEFLAG_10BITANCILLARY; /* READ THE CURRENT VIP 601 SETTINGS */ vip_get_601_configuration(&buffer->vip601_settings); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_get_601_configuration * * This routine returns the current 601 configuration information. *--------------------------------------------------------------------------*/ int vip_get_601_configuration(VIP_601PARAMS * buffer) { unsigned long vip_control3, vip_control1; if (!buffer) return CIM_STATUS_INVALIDPARAMS; vip_control1 = READ_VIP32(VIP_CONTROL3); vip_control3 = READ_VIP32(VIP_CONTROL3); buffer->flags = 0; if (vip_control3 & VIP_CONTROL3_VSYNC_POLARITY) buffer->flags |= VIP_MODEFLAG_VSYNCACTIVEHIGH; if (vip_control3 & VIP_CONTROL3_HSYNC_POLARITY) buffer->flags |= VIP_MODEFLAG_HSYNCACTIVEHIGH; buffer->horz_start = READ_VIP32(VIP_601_HORZ_START); buffer->vbi_start = READ_VIP32(VIP_601_VBI_START); buffer->vbi_height = READ_VIP32(VIP_601_VBI_END) - buffer->vbi_start + 1; buffer->vert_start_even = READ_VIP32(VIP_601_EVEN_START_STOP) & 0xFFFF; buffer->even_height = (READ_VIP32(VIP_601_EVEN_START_STOP) >> 16) - buffer->vert_start_even + 1; buffer->vert_start_odd = READ_VIP32(VIP_601_ODD_START_STOP) & 0xFFFF; buffer->odd_height = (READ_VIP32(VIP_601_ODD_START_STOP) >> 16) - buffer->vert_start_odd + 1; buffer->odd_detect_start = READ_VIP32(VIP_ODD_FIELD_DETECT) & 0xFFFF; buffer->odd_detect_end = READ_VIP32(VIP_ODD_FIELD_DETECT) >> 16; /* SPECIAL CASE FOR HORIZONTAL DATA * 601 horizontal parameters are based on the number of clocks and not * the number of pixels. */ if ((vip_control1 & VIP_CONTROL1_MODE_MASK) == VIP_MODE_16BIT601) buffer->width = (READ_VIP32(VIP_601_HORZ_END) - buffer->horz_start - 3) >> 1; else buffer->width = (READ_VIP32(VIP_601_HORZ_END) - buffer->horz_start - 3); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_get_buffer_configuration * * This routine reads the current buffer configuration for Task A, Task B, * ancillary or message data. The current_buffer member indicates which * array index should hold the new values for Task A or Task B data. *--------------------------------------------------------------------------*/ int vip_get_buffer_configuration(int buffer_type, VIPINPUTBUFFER * buffer) { unsigned long cur_buffer = buffer->current_buffer; VIPINPUTBUFFER_ADDR *offsets; if (!buffer) return CIM_STATUS_INVALIDPARAMS; if (buffer_type == VIP_BUFFER_A) { offsets = &buffer->offsets[VIP_BUFFER_TASK_A]; /* READ VIDEO PITCH */ offsets->y_pitch = READ_VIP32(VIP_TASKA_VID_PITCH) & 0xFFFF; offsets->uv_pitch = READ_VIP32(VIP_TASKA_VID_PITCH) >> 16; /* READ BASE OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_INVERTPOLARITY) { offsets->even_base[cur_buffer] = READ_VIP32(VIP_TASKA_VID_ODD_BASE); offsets->odd_base[cur_buffer] = READ_VIP32(VIP_TASKA_VID_EVEN_BASE); if (buffer->flags & VIP_INPUTFLAG_VBI) { offsets->vbi_even_base = READ_VIP32(VIP_TASKA_VBI_ODD_BASE); offsets->vbi_odd_base = READ_VIP32(VIP_TASKA_VBI_EVEN_BASE); } } else { offsets->even_base[cur_buffer] = READ_VIP32(VIP_TASKA_VID_EVEN_BASE); offsets->odd_base[cur_buffer] = READ_VIP32(VIP_TASKA_VID_ODD_BASE); if (buffer->flags & VIP_INPUTFLAG_VBI) { offsets->vbi_even_base = READ_VIP32(VIP_TASKA_VBI_EVEN_BASE); offsets->vbi_odd_base = READ_VIP32(VIP_TASKA_VBI_ODD_BASE); } } /* READ 4:2:0 OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_PLANAR) { offsets->odd_uoffset = READ_VIP32(VIP_TASKA_U_OFFSET); offsets->odd_voffset = READ_VIP32(VIP_TASKA_V_OFFSET); offsets->even_uoffset = READ_VIP32(VIP_TASKA_U_EVEN_OFFSET); offsets->even_voffset = READ_VIP32(VIP_TASKA_V_EVEN_OFFSET); } } else if (buffer_type == VIP_BUFFER_B) { offsets = &buffer->offsets[VIP_BUFFER_TASK_B]; /* READ VIDEO PITCH */ offsets->y_pitch = READ_VIP32(VIP_TASKB_VID_PITCH) & 0xFFFF; offsets->uv_pitch = READ_VIP32(VIP_TASKB_VID_PITCH) >> 16; /* READ BASE OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_INVERTPOLARITY) { offsets->even_base[cur_buffer] = READ_VIP32(VIP_TASKB_VID_ODD_BASE); offsets->odd_base[cur_buffer] = READ_VIP32(VIP_TASKB_VID_EVEN_BASE); if (buffer->flags & VIP_INPUTFLAG_VBI) { offsets->vbi_even_base = READ_VIP32(VIP_TASKB_VBI_ODD_BASE); offsets->vbi_odd_base = READ_VIP32(VIP_TASKB_VBI_EVEN_BASE); } } else { offsets->even_base[cur_buffer] = READ_VIP32(VIP_TASKB_VID_EVEN_BASE); offsets->odd_base[cur_buffer] = READ_VIP32(VIP_TASKB_VID_ODD_BASE); if (buffer->flags & VIP_INPUTFLAG_VBI) { offsets->vbi_even_base = READ_VIP32(VIP_TASKB_VBI_EVEN_BASE); offsets->vbi_odd_base = READ_VIP32(VIP_TASKB_VBI_ODD_BASE); } } /* READ 4:2:0 OFFSETS */ if (buffer->flags & VIP_INPUTFLAG_PLANAR) { offsets->odd_uoffset = READ_VIP32(VIP_TASKB_U_OFFSET); offsets->odd_voffset = READ_VIP32(VIP_TASKB_V_OFFSET); } } else if (buffer_type == VIP_BUFFER_ANC || buffer_type == VIP_BUFFER_MSG) { buffer->ancillaryData.msg1_base = READ_VIP32(VIP_ANC_MSG1_BASE); buffer->ancillaryData.msg2_base = READ_VIP32(VIP_ANC_MSG2_BASE); buffer->ancillaryData.msg_size = READ_VIP32(VIP_ANC_MSG_SIZE); } else { return CIM_STATUS_INVALIDPARAMS; } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_get_genlock_configuration * * This routine reads the current genlock configuration. *--------------------------------------------------------------------------*/ int vip_get_genlock_configuration(VIPGENLOCKBUFFER * buffer) { unsigned long vip_control1, vip_control2; unsigned long genlk_ctl; if (!buffer) return CIM_STATUS_INVALIDPARAMS; genlk_ctl = READ_REG32(DC3_GENLK_CTL); vip_control1 = READ_VIP32(VIP_CONTROL1); vip_control2 = READ_VIP32(VIP_CONTROL2); /* READ ERROR DETECTION, CURRENT FIELD AND CURRENT VSYNC * These flags are used to indicate the ways in which the VIP signal can * be considered 'lost'. */ buffer->vip_signal_loss = vip_control1 & VIP_CONTROL1_VDE_FF_MASK; buffer->field_to_vg = vip_control2 & VIP_CONTROL2_FIELD2VG_MASK; buffer->vsync_to_vg = vip_control2 & VIP_CONTROL2_SYNC2VG_MASK; /* GENLOCK TIMEOUT ENABLE */ buffer->enable_timeout = 0; if (genlk_ctl & DC3_GC_GENLOCK_TO_ENABLE) buffer->enable_timeout = 1; /* GENLOCK SKEW */ buffer->genlock_skew = genlk_ctl & DC3_GC_GENLOCK_SKEW_MASK; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_get_genlock_enable * * This routine returns the current enable status of genlock in the VG. *--------------------------------------------------------------------------*/ int vip_get_genlock_enable(void) { if (READ_REG32(DC3_GENLK_CTL) & DC3_GC_GENLOCK_ENABLE) return 1; return 0; } /*--------------------------------------------------------------------------- * vip_is_buffer_update_latched * * This routine indicates whether changes to the VIP offsets have been * latched by the hardware. *--------------------------------------------------------------------------*/ int vip_is_buffer_update_latched(void) { return (!(READ_VIP32(VIP_STATUS) & VIP_STATUS_BASEREG_NOTUPDT)); } /*--------------------------------------------------------------------------- * vip_get_capture_state * * This routine reads the current capture status of the VIP hardware. *--------------------------------------------------------------------------*/ unsigned long vip_get_capture_state(void) { return ((READ_VIP32(VIP_CONTROL1) & VIP_CONTROL1_RUNMODE_MASK) >> VIP_CONTROL1_RUNMODE_SHIFT); } /*--------------------------------------------------------------------------- * vip_get_current_line * * This routine returns the current line that is being processed. *--------------------------------------------------------------------------*/ unsigned long vip_get_current_line(void) { return (READ_VIP32(VIP_CURRENT_TARGET) & VIP_CTARGET_CLINE_MASK); } /*--------------------------------------------------------------------------- * vip_read_fifo * * This routine reads from the specified fifo address. As the fifo access * enable should be disabled when running in normal vip mode, this routine * enables and disables access around the read. * DIAGNOSTIC USE ONLY *--------------------------------------------------------------------------*/ unsigned long vip_read_fifo(unsigned long dwFifoAddress) { unsigned long fifo_data; /* ENABLE FIFO ACCESS */ vip_enable_fifo_access(1); /* NOW READ THE DATA */ WRITE_VIP32(VIP_FIFO_ADDRESS, dwFifoAddress); fifo_data = READ_VIP32(VIP_FIFO_DATA); /* DISABLE FIFO ACCESS */ vip_enable_fifo_access(0); return fifo_data; } /*--------------------------------------------------------------------------- * vip_write_fifo * * SYNOPSIS: * This routine writes to the specified fifo address. As the fifo access * enable should be disabled when running in normal vip mode, this routine * enables and disables access around the write. * DIAGNOSTIC USE ONLY *--------------------------------------------------------------------------*/ int vip_write_fifo(unsigned long dwFifoAddress, unsigned long dwFifoData) { /* ENABLE FIFO ACCESS */ vip_enable_fifo_access(1); /* WRITE THE FIFO DATA */ WRITE_VIP32(VIP_FIFO_ADDRESS, dwFifoAddress); WRITE_VIP32(VIP_FIFO_DATA, dwFifoData); /* DISABLE FIFO ACCESS */ vip_enable_fifo_access(0); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_enable_fifo_access * * This routine enables/disables access to the vip fifo. * DIAGNOSTIC USE ONLY *--------------------------------------------------------------------------*/ int vip_enable_fifo_access(int enable) { unsigned long cw2; cw2 = READ_VIP32(VIP_CONTROL2); if (enable) cw2 |= VIP_CONTROL2_FIFO_ACCESS; else cw2 &= ~VIP_CONTROL2_FIFO_ACCESS; WRITE_VIP32(VIP_CONTROL2, cw2); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_get_power_characteristics * * This routine returns the current VIP clock gating state in a * VIPPOWERBUFFER. *--------------------------------------------------------------------------*/ int vip_get_power_characteristics(VIPPOWERBUFFER * buffer) { Q_WORD q_word; if (!buffer) return CIM_STATUS_INVALIDPARAMS; /* READ THE EXISTING STATE */ msr_read64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_PM, &q_word); /* DECODE THE CLOCK GATING BITS */ buffer->glink_clock_mode = (int) (q_word.low & VIP_MSR_POWER_GLINK); buffer->vip_clock_mode = (int) (q_word.low & VIP_MSR_POWER_CLOCK); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_get_priority_characteristics * * This routine returns the priority characteristics in the supplied * VIPPRIORITYBUFFER. *--------------------------------------------------------------------------*/ int vip_get_priority_characteristics(VIPPRIORITYBUFFER * buffer) { Q_WORD q_word; if (!buffer) return CIM_STATUS_INVALIDPARAMS; /* READ THE CURRENT STATE */ msr_read64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_CONFIG, &q_word); /* DECODE THE PRIORITIES */ buffer->secondary = (q_word.low & VIP_MSR_MCR_SECOND_PRIORITY_MASK) >> VIP_MSR_MCR_SECOND_PRIORITY_SHIFT; buffer->primary = (q_word.low & VIP_MSR_MCR_PRIMARY_PRIORITY_MASK) >> VIP_MSR_MCR_PRIMARY_PRIORITY_SHIFT; buffer->pid = q_word.low & VIP_MSR_MCR_PID_MASK; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vip_get_capability_characteristics * * This routine returns revision information for the device. *--------------------------------------------------------------------------*/ int vip_get_capability_characteristics(VIPCAPABILITIESBUFFER * buffer) { Q_WORD q_word; if (!buffer) return CIM_STATUS_INVALIDPARAMS; /* READ THE CURRENT MSR CONTENTS */ msr_read64(MSR_DEVICE_GEODELX_VIP, MSR_GEODELINK_CAP, &q_word); /* DECODE THE REVISIONS */ buffer->revision_id = (q_word.low & VIP_MSR_CAP_REVID_MASK) >> VIP_MSR_CAP_REVID_SHIFT; buffer->device_id = (q_word.low & VIP_MSR_CAP_DEVID_MASK) >> VIP_MSR_CAP_DEVID_SHIFT; buffer->n_clock_domains = (q_word.low & VIP_MSR_CAP_NCLK_MASK) >> VIP_MSR_CAP_NCLK_SHIFT; buffer->n_smi_registers = (q_word.low & VIP_MSR_CAP_NSMI_MASK) >> VIP_MSR_CAP_NSMI_SHIFT; return CIM_STATUS_OK; } #endif xf86-video-geode-2.11.18/src/cim/cim_vop.c0000644000175000017500000004647212654445443014754 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron VOP configuration routines. */ /*--------------------------------------------------------------------------- * vop_set_vbi_window * * This routine configures the output position and location in memory of * VBI data. *--------------------------------------------------------------------------*/ int vop_set_vbi_window(VOPVBIWINDOWBUFFER * buffer) { unsigned long unlock, temp; unsigned long hstart, hstop; unsigned long htotal, hsyncstart; if (!buffer) return CIM_STATUS_INVALIDPARAMS; unlock = READ_REG32(DC3_UNLOCK); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); /* PROGRAM HORIZONTAL POSITION * The horizontal position is a little tricky. The counter for the * horizontal timings is reused for the VBI counter. Consequently, the * horizontal start and stop values are based off the beginning of active * data. However, the VG has a quirk. If the counter start position is * before the beginning of HSync, it applies to the previous line. If * the counter is after the beginning of HSync it applies to the current * line. So, for one line the real range can be thought of as * HSync_start to (HSync_start + htotal - 1). However, the counters * must be between 0 and htotal - 1. When placing VBI data before the * start of active data, the horizontal end position will thus be *less* * than the horizontal start. */ htotal = ((READ_REG32(DC3_H_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; hsyncstart = (READ_REG32(DC3_H_SYNC_TIMING) & 0xFFF) + 1; if (buffer->horz_from_hsync) { /* VERIFY THAT THE INPUT IS VALID */ if (buffer->horz_start < 0 || (buffer->horz_start + buffer->vbi_width) > htotal) return CIM_STATUS_INVALIDPARAMS; hstart = buffer->horz_start + hsyncstart; } else { /* VERIFY THAT THE INPUT IS VALID */ if (buffer->horz_start < ((long) hsyncstart - (long) htotal) || buffer->horz_start > (long) hsyncstart || buffer->vbi_width > htotal) { return CIM_STATUS_INVALIDPARAMS; } hstart = buffer->horz_start + htotal; } hstop = hstart + buffer->vbi_width; if (hstart > htotal) hstart -= htotal; if (hstop > htotal) hstop -= htotal; hstart--; hstop--; WRITE_REG32(DC3_VBI_HOR, ((hstop << DC3_VBI_HOR_END_SHIFT) & DC3_VBI_HOR_END_MASK) | (hstart & DC3_VBI_HOR_START_MASK)); /* WRITE LINE CAPTURE MASKS */ WRITE_REG32(DC3_VBI_LN_ODD, ((buffer->odd_line_offset << DC3_VBI_ODD_LINE_SHIFT) & DC3_VBI_ODD_LINE_MASK) | (buffer->odd_line_capture_mask & DC3_VBI_ODD_ENABLE_MASK)); WRITE_REG32(DC3_VBI_LN_EVEN, ((buffer->even_line_offset << DC3_VBI_EVEN_LINE_SHIFT) & DC3_VBI_EVEN_LINE_MASK) | (buffer->even_line_capture_mask & DC3_VBI_EVEN_ENABLE_MASK)); /* PROGRAM SOURCE OFFSETS * Start with the even offsets. Note that we always enable 16-bit VBI, * as this is the only way to get VBI data on each VOP clock. */ temp = READ_REG32(DC3_VBI_EVEN_CTL) & ~DC3_VBI_EVEN_CTL_OFFSET_MASK; temp |= DC3_VBI_EVEN_CTL_ENABLE_16; if (buffer->enable_upscale) temp |= DC3_VBI_EVEN_CTL_UPSCALE; WRITE_REG32(DC3_VBI_EVEN_CTL, temp | (buffer->even_address_offset & DC3_VBI_EVEN_CTL_OFFSET_MASK)); /* ODD OFFSET */ temp = READ_REG32(DC3_VBI_ODD_CTL) & ~DC3_VBI_ODD_CTL_OFFSET_MASK; WRITE_REG32(DC3_VBI_ODD_CTL, temp | (buffer->odd_address_offset & DC3_VBI_ODD_CTL_OFFSET_MASK)); /* PITCH */ temp = ((buffer->data_size >> 3) << 16) | ((buffer->data_pitch >> 3) & 0x0000FFFF); WRITE_REG32(DC3_VBI_PITCH, temp); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vop_enable_vbi_output * * This routine enables/disables VBI fetching inside the video generator. *--------------------------------------------------------------------------*/ int vop_enable_vbi_output(int enable) { unsigned long unlock, temp; unlock = READ_REG32(DC3_UNLOCK); temp = READ_REG32(DC3_VBI_EVEN_CTL); if (enable) temp |= DC3_VBI_ENABLE; else temp &= ~DC3_VBI_ENABLE; WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_VBI_EVEN_CTL, temp); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vop_set_configuration * * This routine is passed a VOP_CONFIGURATION structure that contains all * the necessary information to configure VOP output. *--------------------------------------------------------------------------*/ int vop_set_configuration(VOPCONFIGURATIONBUFFER * config) { unsigned long vop_config = 0; unsigned long alpha, control2; unsigned long unlock; unsigned long delta; Q_WORD msr_value; int rgb = 0; if (!config) return CIM_STATUS_INVALIDPARAMS; unlock = READ_REG32(DC3_UNLOCK); delta = READ_REG32(DC3_VID_DS_DELTA) & DC3_DS_DELTA_MASK; /* OVERRIDE THE OUTPUT SETTINGS TO ENABLE VOP OUTPUT */ if (config->mode != VOP_MODE_DISABLED) { msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &msr_value); msr_value.low &= ~DF_CONFIG_OUTPUT_MASK; msr_value.low |= DF_OUTPUT_VOP; msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &msr_value); } /* SET THE UNIVERSAL VOP OPTIONS */ if (config->flags & VOP_FLAG_SWAP_UV) vop_config |= VOP_CONFIG_SWAPUV; if (config->flags & VOP_FLAG_SWAP_VBI) vop_config |= VOP_CONFIG_SWAPVBI; /* SET THE MODE SPECIFIC PARAMETERS */ if (config->mode == VOP_MODE_601) { vop_config |= config->vop601.flags; vop_config |= config->vop601.vsync_shift; vop_config |= VOP_CONFIG_ENABLE_601 | VOP_CONFIG_VIP2_0; switch (config->vop601.output_mode) { case VOP_601_YUV_16BIT: vop_config |= VOP_CONFIG_VIP2_16BIT; break; case VOP_601_YUV_4_4_4: vop_config |= VOP_CONFIG_DISABLE_DECIMATE; break; case VOP_601_RGB_8_8_8: vop_config |= VOP_CONFIG_DISABLE_DECIMATE | VOP_CONFIG_RGBMODE; rgb = 1; break; } if (config->vop601.vsync_shift == VOP_VSYNC_LATER_BY_X) { delta |= (config->vop601.vsync_shift_count & DC3_601_VSYNC_SHIFT_MASK); delta |= DC3_601_VSYNC_SHIFT_ENABLE; } } else { if (config->flags & VOP_FLAG_VBI) vop_config |= VOP_CONFIG_VBI; if (config->flags & VOP_FLAG_TASK) vop_config |= VOP_CONFIG_TASK; if (config->flags & VOP_FLAG_SINGLECHIPCOMPAT) vop_config |= VOP_CONFIG_SC_COMPATIBLE; if (config->flags & VOP_FLAG_EXTENDEDSAV) vop_config |= VOP_CONFIG_EXTENDED_SAV; switch (config->mode) { case VOP_MODE_DISABLED: vop_config |= VOP_CONFIG_DISABLED; break; case VOP_MODE_VIP11: vop_config |= VOP_CONFIG_VIP1_1; break; case VOP_MODE_CCIR656: vop_config |= VOP_CONFIG_CCIR656; break; case VOP_MODE_VIP20_8BIT: vop_config |= VOP_CONFIG_VIP2_0; break; case VOP_MODE_VIP20_16BIT: vop_config |= VOP_CONFIG_VIP2_0 | VOP_CONFIG_VIP2_16BIT; break; } } /* SET THE 4:4:4 TO 4:2:2 DECIMATION ALGORITHM */ vop_config |= (config->conversion_mode); /* SET THE VSYNC OUT OPTIONS */ control2 = READ_VIP32(VIP_CONTROL2) & ~VIP_CONTROL2_SYNC2PIN_MASK; control2 |= config->vsync_out; WRITE_VIP32(VIP_CONTROL2, control2); /* FORCE THE CORRECT VOP COLOR SPACE */ /* The output of the mixer will be either RGB or YUV. We must enable */ /* or disable the VOP CSC based on the desired output format. */ alpha = READ_VID32(DF_VID_ALPHA_CONTROL); if (!(alpha & DF_CSC_GRAPHICS_RGB_TO_YUV)) { /* RGB OUTPUT FROM THE MIXER */ if (!rgb) alpha |= DF_CSC_VOP_RGB_TO_YUV; else alpha &= ~DF_CSC_VOP_RGB_TO_YUV; } else { /* YUV OUTPUT FROM THE MIXER */ /* As there is no YUV->RGB VOP conversion, we simply disable the */ /* VOP CSC and trust that the user is competent. */ alpha &= ~DF_CSC_VOP_RGB_TO_YUV; } /* AND WRITE THE CONFIGURATION */ WRITE_VID32(DF_VID_ALPHA_CONTROL, alpha); WRITE_VOP32(VOP_CONFIGURATION, vop_config); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_VID_DS_DELTA, delta); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vop_save_state * * This routine saves the necessary register contents in order to restore * at a later point to the same state. Note that the capture state is * forced to OFF in this routine. *--------------------------------------------------------------------------*/ int vop_save_state(VOPSTATEBUFFER * save_buffer) { if (!save_buffer) return CIM_STATUS_INVALIDPARAMS; save_buffer->config = READ_VOP32(VOP_CONFIGURATION); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vop_restore_state * * This routine restores the state of the vop registers - which were * previously saved using vop_save_state. *--------------------------------------------------------------------------*/ int vop_restore_state(VOPSTATEBUFFER * restore_buffer) { if (!restore_buffer) return CIM_STATUS_INVALIDPARAMS; WRITE_VOP32(VOP_CONFIGURATION, restore_buffer->config); return CIM_STATUS_OK; } /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * CIMARRON VOP READ ROUTINES * These routines are included for use in diagnostics or when debugging. They * can be optionally excluded from a project. *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ #if CIMARRON_INCLUDE_VOP_READ_ROUTINES /*--------------------------------------------------------------------------- * vop_get_current_mode * * This routine reads the current VIP operating mode and stores it in the * passed VOP_CONFIGURATION structure. *--------------------------------------------------------------------------*/ int vop_get_current_mode(VOPCONFIGURATIONBUFFER * config) { unsigned long vop_config = 0; unsigned long alpha; if (!config) return CIM_STATUS_INVALIDPARAMS; vop_config = READ_VOP32(VOP_CONFIGURATION); alpha = READ_VID32(DF_VID_ALPHA_CONTROL); /* READ THE CURRENT MODE */ switch (vop_config & VOP_CONFIG_MODE_MASK) { case VOP_CONFIG_DISABLED: config->mode = VOP_MODE_DISABLED; break; case VOP_CONFIG_VIP1_1: config->mode = VOP_MODE_VIP11; break; case VOP_CONFIG_CCIR656: config->mode = VOP_MODE_CCIR656; break; case VOP_CONFIG_VIP2_0: if (vop_config & VOP_CONFIG_ENABLE_601) config->mode = VOP_MODE_601; else if (vop_config & VOP_CONFIG_VIP2_16BIT) config->mode = VOP_MODE_VIP20_16BIT; else config->mode = VOP_MODE_VIP20_8BIT; break; } /* READ 601 SETTINGS */ config->vop601.flags = vop_config & (VOP_CONFIG_INVERT_DISPE | VOP_CONFIG_INVERT_HSYNC | VOP_CONFIG_INVERT_VSYNC); config->vop601.vsync_shift = vop_config & VOP_CONFIG_VSYNC_MASK; config->vop601.vsync_shift_count = READ_REG32(DC3_VID_DS_DELTA) & DC3_601_VSYNC_SHIFT_MASK; if ((alpha & DF_CSC_GRAPHICS_RGB_TO_YUV) || (alpha & DF_CSC_VOP_RGB_TO_YUV)) { /* YUV OUTPUT */ if (vop_config & VOP_CONFIG_DISABLE_DECIMATE) config->vop601.output_mode = VOP_601_YUV_4_4_4; else if (vop_config & VOP_CONFIG_VIP2_16BIT) config->vop601.output_mode = VOP_601_YUV_16BIT; else config->vop601.output_mode = VOP_601_YUV_8BIT; } else { config->vop601.output_mode = VOP_601_RGB_8_8_8; } config->flags = 0; /* READ THE UNIVERSAL VOP OPTIONS */ if (vop_config & VOP_CONFIG_SWAPUV) config->flags |= VOP_FLAG_SWAP_UV; if (vop_config & VOP_CONFIG_SWAPVBI) config->flags |= VOP_FLAG_SWAP_VBI; if (vop_config & VOP_CONFIG_VBI) config->flags |= VOP_FLAG_VBI; if (vop_config & VOP_CONFIG_TASK) config->flags |= VOP_FLAG_TASK; if (vop_config & VOP_CONFIG_SC_COMPATIBLE) config->flags |= VOP_FLAG_SINGLECHIPCOMPAT; if (vop_config & VOP_CONFIG_EXTENDED_SAV) config->flags |= VOP_FLAG_EXTENDEDSAV; config->conversion_mode = vop_config & VOP_CONFIG_422_MASK; config->vsync_out = READ_VIP32(VIP_CONTROL2) & VIP_CONTROL2_SYNC2PIN_MASK; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vop_get_vbi_window * * This routine reads the current VBI configuration for VOP output. *--------------------------------------------------------------------------*/ int vop_get_vbi_configuration(VOPVBIWINDOWBUFFER * buffer) { unsigned long temp; unsigned long hstart, hstop; unsigned long htotal, hsyncstart; if (!buffer) return CIM_STATUS_INVALIDPARAMS; htotal = ((READ_REG32(DC3_H_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; hsyncstart = (READ_REG32(DC3_H_SYNC_TIMING) & 0xFFF) + 1; /* DECODE HORIZONTAL POSITION */ /* This is done according to the requested horizontal origin */ temp = READ_REG32(DC3_VBI_HOR); hstart = (temp & DC3_VBI_HOR_START_MASK) + 1; hstop = ((temp & DC3_VBI_HOR_END_MASK) >> DC3_VBI_HOR_END_SHIFT) + 1; if (buffer->horz_from_hsync) { buffer->horz_start = hstart + htotal - hsyncstart; if (buffer->horz_start >= (long) htotal) buffer->horz_start -= htotal; } else { if (hstart > hsyncstart) buffer->horz_start = (long) hstart - (long) htotal; else buffer->horz_start = hstart; } if (hstop > hstart) buffer->vbi_width = hstop - hstart; else buffer->vbi_width = (htotal - hstart) + hstop; /* READ LINE MASKS */ temp = READ_REG32(DC3_VBI_LN_ODD); buffer->odd_line_offset = (temp & DC3_VBI_ODD_LINE_MASK) >> DC3_VBI_ODD_LINE_SHIFT; buffer->odd_line_capture_mask = (temp & DC3_VBI_ODD_ENABLE_MASK); temp = READ_REG32(DC3_VBI_LN_EVEN); buffer->even_line_offset = (temp & DC3_VBI_EVEN_LINE_MASK) >> DC3_VBI_EVEN_LINE_SHIFT; buffer->even_line_capture_mask = (temp & DC3_VBI_EVEN_ENABLE_MASK); /* READ VBI UPSCALE SETTINGS */ buffer->enable_upscale = 0; temp = READ_REG32(DC3_VBI_EVEN_CTL); if (temp & DC3_VBI_EVEN_CTL_UPSCALE) buffer->enable_upscale = 1; /* READ SOURCE OFFSETS */ buffer->even_address_offset = temp & DC3_VBI_EVEN_CTL_OFFSET_MASK; buffer->odd_address_offset = READ_REG32(DC3_VBI_ODD_CTL) & DC3_VBI_ODD_CTL_OFFSET_MASK; /* PITCH AND SIZE */ temp = READ_REG32(DC3_VBI_PITCH); buffer->data_size = (temp >> 16) << 3; buffer->data_pitch = (temp & 0xFFFF); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vop_get_vbi_enable * * This routine reads the current enable status of VBI output. *--------------------------------------------------------------------------*/ int vop_get_vbi_enable(void) { if (READ_REG32(DC3_VBI_EVEN_CTL) & DC3_VBI_ENABLE) return 1; return 0; } /*--------------------------------------------------------------------------- * vop_get_crc * * This routine returns a CRC of the current VOP data --------------------------------------------------------------------------*/ unsigned long vop_get_crc(void) { unsigned long crc; unsigned long config = READ_VOP32(VOP_CONFIGURATION); unsigned long timeout = 1000; if (!(READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_TGEN)) return 0xFFFFFFFF; /* RESET CRC */ WRITE_VOP32(VOP_CONFIGURATION, config & ~VOP_CONFIG_ENABLE_SIGNATURE); /* WAIT FOR THE RESET TO BE LATCHED */ while ((READ_VOP32(VOP_SIGNATURE) != 0x00000001) && timeout) timeout--; WRITE_VOP32(VOP_CONFIGURATION, config | VOP_CONFIG_ENABLE_SIGNATURE); /* WAIT UNTIL NOT ACTIVE, THEN ACTIVE, NOT ACTIVE, THEN ACTIVE */ while (!(READ_VOP32(VOP_CONFIGURATION) & VOP_CONFIG_SIGVAL)); crc = READ_VOP32(VOP_SIGNATURE); return crc; } /*--------------------------------------------------------------------------- * vop_read_vbi_crc * * This routine returns a CRC of the current VBI data ---------------------------------------------------------------------------*/ unsigned long vop_read_vbi_crc(void) { unsigned long gcfg, unlock, vbi_even; unsigned long crc; if (!(READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_TGEN) || !(READ_REG32(DC3_VBI_EVEN_CTL) & DC3_VBI_ENABLE)) { return 0xFFFFFFFF; } unlock = READ_REG32(DC3_UNLOCK); gcfg = READ_REG32(DC3_GENERAL_CFG); vbi_even = READ_REG32(DC3_VBI_EVEN_CTL); gcfg |= DC3_GCFG_SGRE | DC3_GCFG_CRC_MODE; gcfg &= ~(DC3_GCFG_SGFR | DC3_GCFG_SIG_SEL); vbi_even |= DC3_VBI_EVEN_ENABLE_CRC; WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_VBI_EVEN_CTL, vbi_even); WRITE_REG32(DC3_GENERAL_CFG, gcfg & ~DC3_GCFG_SIGE); WRITE_REG32(DC3_GENERAL_CFG, gcfg | DC3_GCFG_SIGE); /* WAIT FOR THE CRC TO BE COMPLETED */ while (!(READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_SIGC)); /* READ THE COMPLETED CRC */ crc = READ_REG32(DC3_PAL_DATA); /* RESTORE THE PALETTE SETTINGS */ gcfg &= ~DC3_GCFG_SGRE; WRITE_REG32(DC3_GENERAL_CFG, gcfg); WRITE_REG32(DC3_UNLOCK, unlock); return crc; } #endif xf86-video-geode-2.11.18/src/cim/cim_df.c0000644000175000017500000025671712654445443014546 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron display filter routines. These routines program the video * hardware. */ /*--------------------------------------------------------------------------- * df_set_crt_enable * * This routine enables or disables CRT output. *--------------------------------------------------------------------------*/ int df_set_crt_enable(int crt_output) { unsigned long config, misc; config = READ_VID32(DF_DISPLAY_CONFIG); misc = READ_VID32(DF_VID_MISC); switch (crt_output) { /* DISABLE DISPLAY */ case DF_CRT_DISABLE: config &= ~(DF_DCFG_DIS_EN | DF_DCFG_HSYNC_EN | DF_DCFG_VSYNC_EN | DF_DCFG_DAC_BL_EN); misc |= DF_DAC_POWER_DOWN; break; /* ENABLE THE DISPLAY */ case DF_CRT_ENABLE: config |= (DF_DCFG_DIS_EN | DF_DCFG_HSYNC_EN | DF_DCFG_VSYNC_EN | DF_DCFG_DAC_BL_EN); misc &= ~(DF_DAC_POWER_DOWN | DF_ANALOG_POWER_DOWN); break; /* HSYNC:OFF VSYNC:ON */ case DF_CRT_STANDBY: config = (config & ~(DF_DCFG_DIS_EN | DF_DCFG_HSYNC_EN | DF_DCFG_DAC_BL_EN)) | DF_DCFG_VSYNC_EN; misc |= DF_DAC_POWER_DOWN; break; /* HSYNC:ON VSYNC:OFF */ case DF_CRT_SUSPEND: config = (config & ~(DF_DCFG_DIS_EN | DF_DCFG_VSYNC_EN | DF_DCFG_DAC_BL_EN)) | DF_DCFG_HSYNC_EN; misc |= DF_DAC_POWER_DOWN; break; default: return CIM_STATUS_INVALIDPARAMS; } WRITE_VID32(DF_DISPLAY_CONFIG, config); WRITE_VID32(DF_VID_MISC, misc); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_panel_enable * * This routine enables or disables panel output. *--------------------------------------------------------------------------*/ int df_set_panel_enable(int enable) { unsigned long pm; pm = READ_VID32(DF_POWER_MANAGEMENT); if (enable) pm |= DF_PM_PANEL_ON; else pm &= ~DF_PM_PANEL_ON; WRITE_VID32(DF_POWER_MANAGEMENT, pm); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_configure_video_source * * This routine initializes all aspects of the source buffer for a video overlay. *--------------------------------------------------------------------------*/ int df_configure_video_source(DF_VIDEO_SOURCE_PARAMS * video_source_odd, DF_VIDEO_SOURCE_PARAMS * video_source_even) { unsigned long pitch, ctrl, vcfg; unsigned long lock, vg_line, gcfg; unsigned long width, size, scale; unsigned long misc; lock = READ_REG32(DC3_UNLOCK); vg_line = READ_REG32(DC3_LINE_SIZE); gcfg = READ_REG32(DC3_GENERAL_CFG); vcfg = READ_VID32(DF_VIDEO_CONFIG); ctrl = READ_VID32(DF_VID_ALPHA_CONTROL); scale = READ_VID32(DF_VIDEO_SCALER); /* STORE THE DESIRED SCALING PROCEDURE */ /* Cimarron supports two modes when programming the scale and position */ /* of the video window. The first mode is designed to implicitly apply */ /* the graphics scale to any video operations. The second applys the */ /* video unchanged, allowing complete control by the user. To allow */ /* visibility between modules, the current mode is stored in a spare */ /* bit in the DF miscellaneous register. */ misc = READ_VID32(DF_VID_MISC); if (video_source_odd->flags & DF_SOURCEFLAG_IMPLICITSCALING) misc |= DF_USER_IMPLICIT_SCALING; else misc &= DF_USER_IMPLICIT_SCALING; WRITE_VID32(DF_VID_MISC, misc); /* PARAMETER - VIDEO PITCH */ pitch = (video_source_odd->y_pitch >> 3) | ((video_source_odd->uv_pitch >> 3) << 16); /* PARAMETER - VIDEO FORMAT */ gcfg &= ~DC3_GCFG_YUV_420; vcfg &= ~(DF_VCFG_VID_INP_FORMAT | DF_VCFG_4_2_0_MODE); ctrl &= ~(DF_VIDEO_INPUT_IS_RGB | DF_CSC_VIDEO_YUV_TO_RGB | DF_HD_VIDEO | DF_YUV_CSC_EN); /* SELECT PIXEL ORDERING */ switch (video_source_odd->video_format & 3) { case 0: vcfg |= DF_VCFG_UYVY_FORMAT; break; case 1: vcfg |= DF_VCFG_Y2YU_FORMAT; break; case 2: vcfg |= DF_VCFG_YUYV_FORMAT; break; case 3: vcfg |= DF_VCFG_YVYU_FORMAT; break; } /* SELECT SOURCE FORMAT (4:2:2, 4:2:0, RGB) */ switch (video_source_odd->video_format >> 2) { case 0: ctrl |= DF_CSC_VIDEO_YUV_TO_RGB; break; case 1: ctrl |= DF_CSC_VIDEO_YUV_TO_RGB; vcfg |= DF_VCFG_4_2_0_MODE; gcfg |= DC3_GCFG_YUV_420; break; case 2: ctrl |= DF_VIDEO_INPUT_IS_RGB; break; default: return CIM_STATUS_INVALIDPARAMS; } /* ALIGN TO APPROPRIATE OUTPUT COLOR SPACE */ /* We have assumed until this point that the output color space is RGB */ /* and the input (if YUV) is always SDTV video. */ if (video_source_odd->flags & DF_SOURCEFLAG_HDTVSOURCE) ctrl |= DF_HD_VIDEO; if (ctrl & DF_CSC_GRAPHICS_RGB_TO_YUV) { /* YUV OUTPUT - DISABLE YUV->RGB AND ENABLE YUV->YUV */ ctrl &= ~DF_CSC_VIDEO_YUV_TO_RGB; if ((!(ctrl & DF_HD_VIDEO) && (ctrl & DF_HD_GRAPHICS)) || ((ctrl & DF_HD_VIDEO) && !(ctrl & DF_HD_GRAPHICS))) { ctrl |= DF_YUV_CSC_EN; } } /* PARAMETER - DISPLAY FILTER BUFFER SIZE */ /* The line size in the video generator must be 32-byte aligned. */ /* However, smaller alignments are managed by setting the */ /* appropriate pitch and clipping the video window. */ vcfg &= ~(DF_VCFG_LINE_SIZE_LOWER_MASK | DF_VCFG_LINE_SIZE_BIT8 | DF_VCFG_LINE_SIZE_BIT9); size = ((video_source_odd->width >> 1) + 7) & 0xFFF8; vcfg |= (size & 0x00FF) << 8; if (size & 0x0100) vcfg |= DF_VCFG_LINE_SIZE_BIT8; if (size & 0x0200) vcfg |= DF_VCFG_LINE_SIZE_BIT9; scale = (scale & ~0x7FF) | video_source_odd->height; /* PARAMETER - VIDEO GENERATOR BUFFER SIZE */ vg_line &= ~DC3_LINE_SIZE_VLS_MASK; if (gcfg & DC3_GCFG_YUV_420) width = ((video_source_odd->width >> 1) + 7) & 0xFFF8; else width = ((video_source_odd->width << 1) + 31) & 0xFFE0; vg_line |= (width >> 3) << DC3_LINE_SIZE_VB_SHIFT; /* WRITE ALL PARAMETERS AT ONCE */ WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_VID32(DF_VIDEO_CONFIG, vcfg); WRITE_VID32(DF_VID_ALPHA_CONTROL, ctrl); WRITE_VID32(DF_VIDEO_SCALER, scale); WRITE_REG32(DC3_GENERAL_CFG, gcfg); WRITE_REG32(DC3_LINE_SIZE, vg_line); WRITE_REG32(DC3_VID_YUV_PITCH, pitch); /* WRITE EVEN OR ODD BUFFER OFFSETS */ /* The even buffer is only valid inside an interlaced display. */ if (READ_REG32(DC3_IRQ_FILT_CTL) & DC3_IRQFILT_INTL_EN) { WRITE_REG32(DC3_VID_EVEN_Y_ST_OFFSET, video_source_even->y_offset); WRITE_REG32(DC3_VID_EVEN_U_ST_OFFSET, video_source_even->u_offset); WRITE_REG32(DC3_VID_EVEN_V_ST_OFFSET, video_source_even->v_offset); } WRITE_REG32(DC3_VID_Y_ST_OFFSET, video_source_odd->y_offset); WRITE_REG32(DC3_VID_U_ST_OFFSET, video_source_odd->u_offset); WRITE_REG32(DC3_VID_V_ST_OFFSET, video_source_odd->v_offset); WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_video_offsets * * This routine sets the starting offset for the video buffer(s). The buffers * can also be configured inside df_configure_video_source, but a separate * routine is provided here to allow quick buffer flipping. *--------------------------------------------------------------------------*/ int df_set_video_offsets(int even, unsigned long y_offset, unsigned long u_offset, unsigned long v_offset) { unsigned long lock = READ_REG32(DC3_UNLOCK); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); if (even) { WRITE_REG32(DC3_VID_EVEN_Y_ST_OFFSET, y_offset); WRITE_REG32(DC3_VID_EVEN_U_ST_OFFSET, u_offset); WRITE_REG32(DC3_VID_EVEN_V_ST_OFFSET, v_offset); } else { WRITE_REG32(DC3_VID_Y_ST_OFFSET, y_offset); WRITE_REG32(DC3_VID_U_ST_OFFSET, u_offset); WRITE_REG32(DC3_VID_V_ST_OFFSET, v_offset); } WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_video_scale * * This routine programs the horizontal/vertical scale factors for video. To * disable scaling/filtering, this routine should be called with identical source * and destination dimensions. *--------------------------------------------------------------------------*/ int df_set_video_scale(unsigned long src_width, unsigned long src_height, unsigned long dst_width, unsigned long dst_height, unsigned long flags) { unsigned long temp, misc; unsigned long scale, gfxscale; unsigned long fbactive, src; unsigned long size, downscale; unsigned long vcfg, gcfg, unlock; /* APPLY THE GRAPHICS SCALE */ /* When requested by the user, we will adjust the video scale by the */ /* current graphics scale factor. This allows video to be programmed */ /* in terms of the graphics source resolution. */ misc = READ_VID32(DF_VID_MISC); if (misc & DF_USER_IMPLICIT_SCALING) { gfxscale = READ_REG32(DC3_GFX_SCALE); fbactive = READ_REG32(DC3_FB_ACTIVE); /* REVERSE ENGINEER THE SCALE FACTOR */ /* The graphics scale factor is (source / (dst - 1)), so a little */ /* math is performed to reverse engineer the correct scale for */ /* video. */ /* */ /* F = (0x4000*S)/(D-1) -> (D/S) = (((0x4000*S)/F)+1)/S */ scale = gfxscale & 0xFFFF; src = (fbactive >> 16) + 1; if (scale != 0x4000) { dst_width = dst_width * (((0x4000 * src) / scale) + 1); dst_width /= src; } scale = gfxscale >> 16; src = (fbactive & 0xFFFF) + 1; if (scale != 0x4000) { dst_height = dst_height * (((0x4000 * src) / scale) + 1); dst_height /= src; } } /* CHECK FOR VALID SCALING FACTOR */ /* The display filter/video generator can support up to 8:1 */ /* horizontal downscale and up to 4:1 vertical downscale. */ /* Scale factors above 4:1 horizontal and 2:1 horizontal */ /* will have a quality impact. However, at such large scale */ /* factors, it might not matter, */ if (((flags & DF_SCALEFLAG_CHANGEX) && dst_width < (src_width >> 3)) || ((flags & DF_SCALEFLAG_CHANGEY) && dst_height < (src_height >> 2))) { return CIM_STATUS_INVALIDSCALE; } /* ENABLE OR DISABLE ADVANCED SCALING FEATURES */ /* Scaling above 2:1 vertical and 4:1 horizontal relies */ /* on mechanisms beside the line filter. */ if (flags & DF_SCALEFLAG_CHANGEX) { scale = READ_VID32(DF_VIDEO_SCALER); vcfg = READ_VID32(DF_VIDEO_CONFIG); vcfg &= ~(DF_VCFG_LINE_SIZE_LOWER_MASK | DF_VCFG_LINE_SIZE_BIT8 | DF_VCFG_LINE_SIZE_BIT9); if (dst_width < (src_width >> 2)) { src_width >>= 1; WRITE_VID32(DF_VIDEO_SCALER, scale | DF_SCALE_DOUBLE_H_DOWNSCALE); } else { WRITE_VID32(DF_VIDEO_SCALER, scale & ~DF_SCALE_DOUBLE_H_DOWNSCALE); } /* PROGRAM A NEW LINE SIZE */ /* The line size must be updated when using the Double Horizontal */ /* Downscale (DHD) bit. This is because the amount of VFIFO space */ /* consumed is effectively half in this mode. */ size = ((src_width >> 1) + 7) & 0xFFF8; vcfg |= (size & 0x00FF) << 8; if (size & 0x0100) vcfg |= DF_VCFG_LINE_SIZE_BIT8; if (size & 0x0200) vcfg |= DF_VCFG_LINE_SIZE_BIT9; WRITE_VID32(DF_VIDEO_CONFIG, vcfg); WRITE_VID32(DF_VIDEO_XSCALE, ((0x10000 * src_width) / dst_width)); } if (flags & DF_SCALEFLAG_CHANGEY) { unlock = READ_REG32(DC3_UNLOCK); gcfg = READ_REG32(DC3_GENERAL_CFG) & ~DC3_GCFG_VDSE; WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); if (dst_height < (src_height >> 1)) { gcfg |= DC3_GCFG_VDSE; downscale = READ_REG32(DC3_VID_DS_DELTA) & ~DC3_DS_DELTA_MASK; if (dst_height == (src_height >> 2)) downscale |= (0x3FFF << 18); else downscale |= (((src_height >> 1) << 14) / dst_height) << 18; WRITE_REG32(DC3_VID_DS_DELTA, downscale); WRITE_VID32(DF_VIDEO_YSCALE, 0x20000); } else { WRITE_VID32(DF_VIDEO_YSCALE, ((0x10000 * src_height) / dst_height)); } WRITE_REG32(DC3_GENERAL_CFG, gcfg); WRITE_REG32(DC3_UNLOCK, unlock); } /* CHECK IF SCALING IS DISABLED */ /* If no scaling occurs, we disable the hardware filter. */ temp = READ_VID32(DF_VIDEO_CONFIG); if ((READ_VID32(DF_VIDEO_XSCALE) == 0x10000) && (READ_VID32(DF_VIDEO_YSCALE) == 0x10000)) { WRITE_VID32(DF_VIDEO_CONFIG, (temp | DF_VCFG_SC_BYP)); } else WRITE_VID32(DF_VIDEO_CONFIG, (temp & ~DF_VCFG_SC_BYP)); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_video_position * * This routine programs the position of the video window on the display. * An indent parameter is also passed to this program to prevent artifacts * when the video window is moved beyond the left edge of the screen. *--------------------------------------------------------------------------*/ int df_set_video_position(DF_VIDEO_POSITION * video_window) { unsigned long vblankstart_even, vblankend_even, vsyncend_even, vtotal_even, vactive_even; unsigned long hblankstart, hblankend, hsyncend, htotal, hactive; unsigned long vblankstart, vblankend, vsyncend, vtotal, vactive; unsigned long width, height, height_even; unsigned long adjust, border_x, border_y, border_y_even; unsigned long xstart, xend; unsigned long ystart, yend; unsigned long ckey_x, ckey_y; unsigned long x_copy, y_copy; unsigned long width_copy, height_copy; unsigned long vcfg, initread; unsigned long xscale, dst_clip; unsigned long ypos, ypos_even; unsigned long y, gfxscale; unsigned long misc, fbactive; unsigned long scale, src; unsigned long irq_ctl; unsigned long unlock; hsyncend = ((READ_REG32(DC3_H_SYNC_TIMING) >> 16) & 0xFFF) + 1; vsyncend = ((READ_REG32(DC3_V_SYNC_TIMING) >> 16) & 0xFFF) + 1; vblankend = ((READ_REG32(DC3_V_BLANK_TIMING) >> 16) & 0xFFF) + 1; hblankend = ((READ_REG32(DC3_H_BLANK_TIMING) >> 16) & 0xFFF) + 1; htotal = ((READ_REG32(DC3_H_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; vtotal = ((READ_REG32(DC3_V_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; vblankstart = (READ_REG32(DC3_V_BLANK_TIMING) & 0xFFF) + 1; hblankstart = (READ_REG32(DC3_H_BLANK_TIMING) & 0xFFF) + 1; hactive = (READ_REG32(DC3_H_ACTIVE_TIMING) & 0xFFF) + 1; vactive = (READ_REG32(DC3_V_ACTIVE_TIMING) & 0xFFF) + 1; unlock = READ_REG32(DC3_UNLOCK); /* INCLUDE BORDER IF REQUESTED */ if (video_window->flags & DF_POSFLAG_INCLUDEBORDER) { border_x = htotal - hblankend; border_y = vtotal - vblankend; hactive = hblankstart + htotal - hblankend; vactive = vblankstart + vtotal - vblankend; } else { border_x = border_y = 0; } /* APPLY THE GRAPHICS SCALE */ /* Do not alter the input data. */ width_copy = video_window->width; height_copy = video_window->height; x_copy = video_window->x; y_copy = video_window->y; misc = READ_VID32(DF_VID_MISC); if (misc & DF_USER_IMPLICIT_SCALING) { gfxscale = READ_REG32(DC3_GFX_SCALE); fbactive = READ_REG32(DC3_FB_ACTIVE); /* REVERSE ENGINEER THE SCALE FACTOR */ scale = gfxscale & 0xFFFF; src = (fbactive >> 16) + 1; if (scale != 0x4000) { width_copy = width_copy * (((0x4000 * src) / scale) + 1); width_copy /= src; x_copy = x_copy * (((0x4000 * src) / scale) + 1); x_copy /= src; } scale = gfxscale >> 16; src = (fbactive & 0xFFFF) + 1; if (scale != 0x4000) { height_copy = height_copy * (((0x4000 * src) / scale) + 1); height_copy /= src; y_copy = y_copy * (((0x4000 * src) / scale) + 1); y_copy /= src; } } /* HANDLE INTERLACING */ /* When the output is interlaced, we must set the position and height */ /* on the fields and not on the composite image. */ if ((irq_ctl = READ_REG32(DC3_IRQ_FILT_CTL)) & DC3_IRQFILT_INTL_EN) { vsyncend_even = ((READ_REG32(DC3_V_SYNC_EVEN) >> 16) & 0xFFF) + 1; vtotal_even = ((READ_REG32(DC3_V_ACTIVE_EVEN) >> 16) & 0xFFF) + 1; vblankend_even = ((READ_REG32(DC3_V_BLANK_EVEN) >> 16) & 0xFFF) + 1; vactive_even = (READ_REG32(DC3_V_ACTIVE_EVEN) & 0xFFF) + 1; vblankstart_even = (READ_REG32(DC3_V_BLANK_EVEN) & 0xFFF) + 1; if (video_window->flags & DF_POSFLAG_INCLUDEBORDER) { border_y_even = vtotal_even - vblankend_even; vactive_even = vblankstart_even + vtotal_even - vblankend_even; } else border_y_even = 0; /* * THE ODD FIELD MUST ALWAYS PRECEDE THE EVEN FIELD * This implies that we can never start video on an odd y position * in the composite image. This is required because the only way * to accomplish an odd y start would be to switch the buffer * which could have serious repercussions for genlocked VIP. */ y = y_copy >> 1; /* CALCULATE Y POSITION FOR ODD FIELD */ /* Clip the video window to the odd field timings. Note that the */ /* height in the odd field may be greater if the video height is */ /* odd. */ height = (height_copy + 1) >> 1; if ((y + height) > vactive) height = vactive - y; ystart = y + vtotal_even - vsyncend_even + 1; if (video_window->flags & DF_POSFLAG_INCLUDEBORDER) ystart -= border_y_even; yend = ystart + height; ypos = (yend << 16) | ystart; /* CALCULATE Y POSITION FOR EVEN FIELD */ height_even = height_copy >> 1; if ((y + height_even) > vactive_even) height_even = vactive_even - y; ystart = y + vtotal - vsyncend + 1; if (video_window->flags & DF_POSFLAG_INCLUDEBORDER) ystart -= border_y; yend = ystart + height_even; ypos_even = (yend << 16) | ystart; /* CALCULATE ACTUAL FRAME BUFFER HEIGHT */ /* The y position and height are used to determine the actual */ /* placement of the color key region. The region will either be */ /* the sum of the even and odd fields (for interlaced addressing */ /* or flicker filtering) or it will be the union of the two (for */ /* line doubling). We must also adjust the region such that the */ /* origin (0, 0) is centered on the beginning of graphics data. */ /* This is only a problem if video is being displayed over the */ /* overscan area. */ if ((READ_REG32(DC3_GENLK_CTL) & DC3_GC_FLICKER_FILTER_ENABLE) || (irq_ctl & DC3_IRQFILT_INTL_ADDR)) { y <<= 1; height += height_even; adjust = border_y + border_y_even; } else { adjust = border_y; if (height_even > height) height = height_even; } if (video_window->flags & DF_POSFLAG_INCLUDEBORDER) { if (y > adjust) { y -= adjust; adjust = 0; } else { adjust -= y; if (height > adjust) height -= adjust; else height = 0; } } } else { y = y_copy; height = height_copy; if ((y + height) > vactive) height = vactive - y; ystart = y + vtotal - vsyncend + 1; if (video_window->flags & DF_POSFLAG_INCLUDEBORDER) ystart -= border_y; yend = ystart + height; ypos = (yend << 16) | ystart; ypos_even = 0; } /* HORIZONTAL POSITION */ /* The horizontal values are identical for the even and odd field. */ width = width_copy; xstart = x_copy + htotal - hsyncend - 14; if (video_window->flags & DF_POSFLAG_INCLUDEBORDER) xstart -= border_x; /* RIGHT CLIPPING */ if ((x_copy + width) > hactive) width = hactive - x_copy; xend = xstart + width; /* * CALCULATE LEFT CLIPPING PARAMETER * The value passed in can be interpreted as destination pixels, in * which case the video scale is factored in, or as source pixels, in * which case the value is written directly. Also, the display filter's * initial read address value is only programmable on 4-pixel increments. * However, we can achieve an arbitrary left clip by adjusting the * xstart value, as there is a 14-clock delay in which to play. Also, * according to the designers, 4:2:0 and 4:2:2 behave identically when * setting the initial read address. The addition of scaling further * complicates the algorithm. When setting the initial read address, it * is in terms of source pixels, while adjusting the xstart value is in * destination pixels We may thus not be able to achieve a perfect * clipping fit for scaled video. We compensate by including two * clipping parameters in our structure. This allows us the user * additional control and it allows us to accurately convey to the user * the state of clipping on the machine. */ initread = video_window->left_clip; dst_clip = 0; if (!(video_window->flags & DF_POSFLAG_DIRECTCLIP)) { xscale = READ_VID32(DF_VIDEO_XSCALE) & 0xFFFFF; initread = (initread * xscale) / 0x10000; if (xscale) dst_clip = ((initread & 3) * 0x10000) / xscale; } else dst_clip = video_window->dst_clip; /* * LIMIT THE CLIP * We technically have a 14 pixel window in which to play. However, * taking the entire 14 pixels makes the video timing a little hairy... * Also note that we cannot do this when performing panel centering, as * the video would then exceed the mode size. */ if (dst_clip > 4) dst_clip = 4; if (READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_DCEN) dst_clip = 0; xstart -= dst_clip; vcfg = READ_VID32(DF_VIDEO_CONFIG); vcfg &= ~DF_VCFG_INIT_READ_MASK; vcfg |= (initread >> 2) << 16; /* SET COLOR KEY REGION */ /* We are assuming that color keying will never be desired outside */ /* of the video region. We adjust the color key region for graphics */ /* scaling. */ gfxscale = READ_REG32(DC3_GFX_SCALE); ckey_x = ((x_copy * (gfxscale & 0xFFFF)) / 0x4000) | ((((x_copy + width) * (gfxscale & 0xFFFF)) / 0x4000) << 16); ckey_y = ((y * (gfxscale >> 16)) / 0x4000) | ((((y + height) * (gfxscale >> 16)) / 0x4000) << 16); /* WRITE ALL PARAMETERS AT ONCE */ WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_CLR_KEY_X, ckey_x); WRITE_REG32(DC3_CLR_KEY_Y, ckey_y); WRITE_VID32(DF_VIDEO_X_POS, (xend << 16) | xstart); WRITE_VID32(DF_VIDEO_Y_POS, ypos); WRITE_VID32(DF_VID_YPOS_EVEN, ypos_even); WRITE_VID32(DF_VIDEO_CONFIG, vcfg); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_video_filter_coefficients * * This routine sets the horizontal and vertical filter coefficients for video * scaling. These coefficients are used for upscaling and downscaling video. * If the phase256 parameter is 1, the coefficient arrays are used as single * arrays of 256 phases for both vertical and horizontal scaling. If the * phase256 parameter is clear, the coefficient arrays are used as two * 128-phase arrays. The first 128 entries represent the phases for * vertical scaling. The last 128 entries represent the phases for * horizontal scaling. *--------------------------------------------------------------------------*/ int df_set_video_filter_coefficients(long taps[][4], int phase256) { unsigned long scale, coeff0, coeff1; unsigned long i; long (*defaults)[2]; /* SET PHASE COUNT AND CHOOSE COEFFICIENT ARRAY */ scale = READ_VID32(DF_VIDEO_SCALER); if (phase256) { WRITE_VID32(DF_VIDEO_SCALER, (scale & ~DF_SCALE_128_PHASES)); defaults = CimarronVideoFilter256; } else { WRITE_VID32(DF_VIDEO_SCALER, (scale | DF_SCALE_128_PHASES)); defaults = CimarronVideoFilter128; } /* PROGRAM COEFFICIENTS */ for (i = 0; i < 256; i++) { if (!taps) { coeff0 = defaults[i][0]; coeff1 = defaults[i][1]; } else { if (taps[i][1] < 0) coeff0 = -taps[i][1] | 0x8000; else coeff0 = taps[i][1]; coeff0 <<= 16; if (taps[i][0] < 0) coeff0 |= -taps[i][0] | 0x8000; else coeff0 |= taps[i][0]; if (taps[i][3] < 0) coeff1 = -taps[i][3] | 0x8000; else coeff1 = taps[i][3]; coeff1 <<= 16; if (taps[i][2] < 0) coeff1 |= -taps[i][2] | 0x8000; else coeff1 |= taps[i][2]; } WRITE_VID32((DF_COEFFICIENT_BASE + (i << 3)), coeff0); WRITE_VID32((DF_COEFFICIENT_BASE + (i << 3) + 4), coeff1); } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_video_enable * * This routine enables or disables the video overlay. *--------------------------------------------------------------------------*/ int df_set_video_enable(int enable, unsigned long flags) { unsigned long vcfg, lock, gcfg; unsigned long dcfg, vg_ckey, fifo = 0; vcfg = READ_VID32(DF_VIDEO_CONFIG); lock = READ_REG32(DC3_UNLOCK); gcfg = READ_REG32(DC3_GENERAL_CFG); /* SET VIDEO FIFO END WATERMARK */ /* The video FIFO end watermark is set to 0 when video is disabled */ /* to allow low priority transactions in the VG. Otherwise, the */ /* priority will be forced high until the VG fills the video FIFO */ /* by not fetching video. That could take a while... Note that */ /* we set the end priority to be 4 greater than the start. We */ /* assume that the start priority has been configured by a modeset. */ dcfg = READ_REG32(DC3_DISPLAY_CFG) & ~DC3_DCFG_VFHPEL_MASK; if (enable) { fifo = ((dcfg >> 12) & 0x0000000F) + 4; if (fifo > 0xF) fifo = 0xF; } WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_DISPLAY_CFG, dcfg | (fifo << 16)); /* ENABLE OR DISABLE VIDEO */ /* The mechanism to fetch video data is enabled first and */ /* disabled last. */ if (enable) { WRITE_REG32(DC3_GENERAL_CFG, (gcfg | DC3_GCFG_VIDE)); WRITE_VID32(DF_VIDEO_CONFIG, (vcfg | DF_VCFG_VID_EN)); /* DISABLE COLOR KEYING IF REQUESTED BY THE USER */ if (flags & DF_ENABLEFLAG_NOCOLORKEY) { /* OVERRIDE THE MODE TO COLOR KEYING */ dcfg = READ_VID32(DF_DISPLAY_CONFIG); WRITE_VID32(DF_DISPLAY_CONFIG, (dcfg & ~DF_DCFG_VG_CK)); /* DISABLE COLOR KEYING IN THE VG */ vg_ckey = READ_REG32(DC3_COLOR_KEY); WRITE_REG32(DC3_COLOR_KEY, (vg_ckey & ~DC3_CLR_KEY_ENABLE)); } else if (!(READ_VID32(DF_DISPLAY_CONFIG) & DF_DCFG_VG_CK)) { /* OTHERWISE RE-ENABLE COLOR KEYING */ vg_ckey = READ_REG32(DC3_COLOR_KEY); WRITE_REG32(DC3_COLOR_KEY, (vg_ckey | DC3_CLR_KEY_ENABLE)); } } else { WRITE_VID32(DF_VIDEO_CONFIG, (vcfg & ~DF_VCFG_VID_EN)); WRITE_REG32(DC3_GENERAL_CFG, (gcfg & ~DC3_GCFG_VIDE)); /* DISABLE COLOR KEY WINDOW WHEN VIDEO IS INACTIVE */ /* To mimic legacy functionality, we disble color keying */ /* when the video window is not active. We will restore */ /* the enable when video is re-enabled if the appropriate */ /* bit is set in display config. */ vg_ckey = READ_REG32(DC3_COLOR_KEY); WRITE_REG32(DC3_COLOR_KEY, (vg_ckey & ~DC3_CLR_KEY_ENABLE)); } WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_video_color_key * * This routine configures the video color/chroma key mechanism. *--------------------------------------------------------------------------*/ int df_set_video_color_key(unsigned long key, unsigned long mask, int graphics) { unsigned long lock, vg_ckey, df_dcfg; vg_ckey = READ_REG32(DC3_COLOR_KEY); lock = READ_REG32(DC3_UNLOCK); df_dcfg = READ_VID32(DF_DISPLAY_CONFIG); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); if (graphics) { /* COLOR KEY - USE VG HARDWARE */ /* Note that color key is never enabled unless a video window */ /* is active. This is to match legacy behavior. */ df_dcfg &= ~DF_DCFG_VG_CK; vg_ckey = (vg_ckey & 0xFF000000) | (key & 0xFFFFFF); if (READ_VID32(DF_VIDEO_CONFIG) & DF_VCFG_VID_EN) vg_ckey |= DC3_CLR_KEY_ENABLE; else vg_ckey &= ~DC3_CLR_KEY_ENABLE; WRITE_VID32(DF_DISPLAY_CONFIG, df_dcfg); WRITE_REG32(DC3_COLOR_KEY, vg_ckey); WRITE_REG32(DC3_COLOR_MASK, (mask & 0xFFFFFF)); } else { /* CHROMA KEY - USE DF HARDWARE */ df_dcfg |= DF_DCFG_VG_CK; vg_ckey &= ~DC3_CLR_KEY_ENABLE; WRITE_REG32(DC3_COLOR_KEY, vg_ckey); WRITE_VID32(DF_DISPLAY_CONFIG, df_dcfg); WRITE_VID32(DF_VIDEO_COLOR_KEY, (key & 0xFFFFFF)); WRITE_VID32(DF_VIDEO_COLOR_MASK, (mask & 0xFFFFFF)); } WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_video_palette * * This routine loads the video hardware palette. If a NULL pointer is * specified, the palette is bypassed. *-------------------------------------------------------------------------*/ int df_set_video_palette(unsigned long *palette) { unsigned long i, entry; unsigned long misc, dcfg; /* LOAD GEODE LX VIDEO PALETTE */ WRITE_VID32(DF_PALETTE_ADDRESS, 0); for (i = 0; i < 256; i++) { if (palette) entry = palette[i]; else entry = i | (i << 8) | (i << 16); WRITE_VID32(DF_PALETTE_DATA, entry); } /* ENABLE THE VIDEO PALETTE */ /* Ensure that the video palette has an effect by routing video data */ /* through the palette RAM and clearing the 'Bypass Both' bit. */ dcfg = READ_VID32(DF_DISPLAY_CONFIG); misc = READ_VID32(DF_VID_MISC); dcfg |= DF_DCFG_GV_PAL_BYP; misc &= ~DF_GAMMA_BYPASS_BOTH; WRITE_VID32(DF_DISPLAY_CONFIG, dcfg); WRITE_VID32(DF_VID_MISC, misc); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_video_palette_entry * * This routine loads a single entry of the video hardware palette. *--------------------------------------------------------------------------*/ int df_set_video_palette_entry(unsigned long index, unsigned long palette) { unsigned long misc, dcfg; if (index > 0xFF) return CIM_STATUS_INVALIDPARAMS; /* SET A SINGLE ENTRY */ WRITE_VID32(DF_PALETTE_ADDRESS, index); WRITE_VID32(DF_PALETTE_DATA, palette); /* ENABLE THE VIDEO PALETTE */ /* Ensure that the video palette has an effect by routing video data */ /* through the palette RAM and clearing the 'Bypass Both' bit. */ dcfg = READ_VID32(DF_DISPLAY_CONFIG); misc = READ_VID32(DF_VID_MISC); /* Ensure that the Graphic data passes through the Gamma * Correction RAM * * XXX is this a bug? perhaps it should be setting the bit so that video * data is routed, according to the description above. * it also mismatches df_set_video_palette(). */ dcfg &= ~DF_DCFG_GV_PAL_BYP; /* Unset the "bypass both" bit to make sure the above selection (gfx/video * data through gamma correction RAM) takes effect. */ misc &= ~DF_GAMMA_BYPASS_BOTH; WRITE_VID32(DF_DISPLAY_CONFIG, dcfg); WRITE_VID32(DF_VID_MISC, misc); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_configure_video_cursor_color_key * * This routine configures the hardware video cursor color key mechanism. *--------------------------------------------------------------------------*/ int df_configure_video_cursor_color_key(DF_VIDEO_CURSOR_PARAMS * cursor_color_key) { unsigned long key; if (cursor_color_key->select_color2 >= 24) return CIM_STATUS_INVALIDPARAMS; key = READ_VID32(DF_CURSOR_COLOR_KEY) & DF_CURSOR_COLOR_KEY_ENABLE; key = key | (cursor_color_key->key & 0xFFFFFF) | (cursor_color_key-> select_color2 << 24); WRITE_VID32(DF_CURSOR_COLOR_KEY, key); WRITE_VID32(DF_CURSOR_COLOR_MASK, (cursor_color_key->mask & 0xFFFFFF)); WRITE_VID32(DF_CURSOR_COLOR_1, (cursor_color_key->color1 & 0xFFFFFF)); WRITE_VID32(DF_CURSOR_COLOR_2, (cursor_color_key->color2 & 0xFFFFFF)); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_video_cursor_color_key_enable * * This routine enables or disables the video cursor color key. *--------------------------------------------------------------------------*/ int df_set_video_cursor_color_key_enable(int enable) { unsigned long temp = READ_VID32(DF_CURSOR_COLOR_KEY); if (enable) temp |= DF_CURSOR_COLOR_KEY_ENABLE; else temp &= ~DF_CURSOR_COLOR_KEY_ENABLE; WRITE_VID32(DF_CURSOR_COLOR_KEY, temp); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_configure_alpha_window * * This routine configures one of the three hardware alpha regions. *--------------------------------------------------------------------------*/ int df_configure_alpha_window(int window, DF_ALPHA_REGION_PARAMS * alpha_data) { unsigned long vsyncend_even, vtotal_even, vactive_even; unsigned long hsyncend, htotal, hactive; unsigned long vsyncend, vtotal, vactive; unsigned long alpha_ctl, pos; unsigned long hadjust, vadjust; unsigned long y, height; unsigned long xstart, xend; unsigned long ystart, yend; unsigned long x_copy, width_copy; unsigned long y_copy, height_copy; unsigned long scale, src, misc; unsigned long gfxscale, fbactive; unsigned long color; if (window > 2) return CIM_STATUS_INVALIDPARAMS; hsyncend = ((READ_REG32(DC3_H_SYNC_TIMING) >> 16) & 0xFFF) + 1; vsyncend = ((READ_REG32(DC3_V_SYNC_TIMING) >> 16) & 0xFFF) + 1; htotal = ((READ_REG32(DC3_H_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; vtotal = ((READ_REG32(DC3_V_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; hactive = (READ_REG32(DC3_H_ACTIVE_TIMING) & 0xFFF) + 1; vactive = (READ_REG32(DC3_V_ACTIVE_TIMING) & 0xFFF) + 1; /* APPLY THE GRAPHICS SCALE */ width_copy = alpha_data->width; height_copy = alpha_data->height; x_copy = alpha_data->x; y_copy = alpha_data->y; misc = READ_VID32(DF_VID_MISC); if (misc & DF_USER_IMPLICIT_SCALING) { gfxscale = READ_REG32(DC3_GFX_SCALE); fbactive = READ_REG32(DC3_FB_ACTIVE); /* REVERSE ENGINEER THE SCALE FACTOR */ scale = gfxscale & 0xFFFF; src = (fbactive >> 16) + 1; if (scale != 0x4000) { width_copy = width_copy * (((0x4000 * src) / scale) + 1); width_copy /= src; x_copy = x_copy * (((0x4000 * src) / scale) + 1); x_copy /= src; } scale = gfxscale >> 16; src = (fbactive & 0xFFFF) + 1; if (scale != 0x4000) { height_copy = height_copy * (((0x4000 * src) / scale) + 1); height_copy /= src; y_copy = y_copy * (((0x4000 * src) / scale) + 1); y_copy /= src; } } /* SET PRIORITY */ /* Priority is the only alpha parameter that is not in a register that */ /* can be indexed based on the alpha window number. */ pos = 16 + (window << 1); alpha_ctl = READ_VID32(DF_VID_ALPHA_CONTROL) & ~(3L << pos); alpha_ctl |= (alpha_data->priority & 3) << pos; WRITE_VID32(DF_VID_ALPHA_CONTROL, alpha_ctl); /* HANDLE INTERLACED MODES */ if (READ_REG32(DC3_IRQ_FILT_CTL) & DC3_IRQFILT_INTL_EN) { vsyncend_even = ((READ_REG32(DC3_V_SYNC_EVEN) >> 16) & 0xFFF) + 1; vtotal_even = ((READ_REG32(DC3_V_ACTIVE_EVEN) >> 16) & 0xFFF) + 1; vactive_even = (READ_REG32(DC3_V_ACTIVE_EVEN) & 0xFFF) + 1; y = y_copy >> 1; /* SET Y POSITION FOR ODD FIELD */ height = (height_copy + 1) >> 1; vadjust = vtotal_even - vsyncend_even + 1; ystart = y + vadjust; yend = y + vadjust + height; if (yend > (vactive + vadjust)) yend = vactive + vadjust; WRITE_VID32((DF_ALPHA_YPOS_1 + (window << 5)), (ystart | (yend << 16))); /* SET Y POSITION FOR EVEN FIELD */ height = height_copy >> 1; vadjust = vtotal - vsyncend + 1; ystart = y + vadjust; yend = y + vadjust + height; if (yend > (vactive_even + vadjust)) yend = vactive_even + vadjust; WRITE_VID32((DF_VID_ALPHA_Y_EVEN_1 + (window << 3)), (ystart | (yend << 16))); } else { y = y_copy; height = height_copy; vadjust = vtotal - vsyncend + 1; ystart = y + vadjust; yend = y + vadjust + height; if (yend > (vactive + vadjust)) yend = vactive + vadjust; WRITE_VID32((DF_ALPHA_YPOS_1 + (window << 5)), (ystart | (yend << 16))); } /* SET ALPHA X POSITION */ /* The x position is the same for both the odd and even fields. */ hadjust = htotal - hsyncend - 2; xstart = x_copy + hadjust; xend = x_copy + hadjust + width_copy; if (xend > (hactive + hadjust)) xend = hactive + hadjust; WRITE_VID32((DF_ALPHA_XPOS_1 + (window << 5)), (xstart | (xend << 16))); /* SET COLOR REGISTER */ color = alpha_data->color & 0xFFFFFF; if (alpha_data->flags & DF_ALPHAFLAG_COLORENABLED) color |= DF_ALPHA_COLOR_ENABLE; WRITE_VID32((DF_ALPHA_COLOR_1 + (window << 5)), color); /* SET ALPHA VALUE, DELTA AND PER PIXEL */ alpha_ctl = READ_VID32(DF_ALPHA_CONTROL_1 + (window << 5)) & DF_ACTRL_WIN_ENABLE; alpha_ctl |= (alpha_data->alpha_value & 0xFF) | DF_ACTRL_LOAD_ALPHA | (((unsigned long) alpha_data->delta & 0xFF) << 8); if (alpha_data->flags & DF_ALPHAFLAG_PERPIXELENABLED) alpha_ctl |= DF_ACTRL_PERPIXEL_EN; WRITE_VID32((DF_ALPHA_CONTROL_1 + (window << 5)), alpha_ctl); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_alpha_window_enable * * This routine enables or disables one of the three hardware alpha regions. *--------------------------------------------------------------------------*/ int df_set_alpha_window_enable(int window, int enable) { unsigned long alpha_ctl; if (window > 2) return CIM_STATUS_INVALIDPARAMS; alpha_ctl = READ_VID32(DF_ALPHA_CONTROL_1 + (window << 5)); if (enable) alpha_ctl |= DF_ACTRL_WIN_ENABLE; else alpha_ctl &= ~DF_ACTRL_WIN_ENABLE; WRITE_VID32((DF_ALPHA_CONTROL_1 + (window << 5)), alpha_ctl); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_no_ck_outside_alpha * * This function affects how color/chroma keying is performed inside the video * window. * * If enable is 1, color/chroma key comparison is performed only inside * the enabled alpha windows. Outside the enabled alpha windows, video * is displayed if color keying is enabled, or graphics is displayed if * chroma keying is enabled. * If enable is 0, color/chroma key comparison is performed inside the * entire video window. *--------------------------------------------------------------------------*/ int df_set_no_ck_outside_alpha(int enable) { unsigned long value; value = READ_VID32(DF_VID_ALPHA_CONTROL); if (enable) value |= DF_NO_CK_OUTSIDE_ALPHA; else value &= ~DF_NO_CK_OUTSIDE_ALPHA; WRITE_VID32(DF_VID_ALPHA_CONTROL, value); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_video_request * * This routine sets the horizontal (pixel) and vertical (line) video request * values. *--------------------------------------------------------------------------*/ int df_set_video_request(unsigned long x, unsigned long y) { unsigned long htotal, hsyncend; unsigned long vtotal, vsyncend; hsyncend = ((READ_REG32(DC3_H_SYNC_TIMING) >> 16) & 0xFFF) + 1; vsyncend = ((READ_REG32(DC3_V_SYNC_TIMING) >> 16) & 0xFFF) + 1; htotal = ((READ_REG32(DC3_H_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; vtotal = ((READ_REG32(DC3_V_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; /* SET DISPLAY FILTER VIDEO REQUEST */ x += htotal - hsyncend - 2; y += vtotal - vsyncend + 1; if (x >= 0x1000 || y >= 0x800) return CIM_STATUS_INVALIDPARAMS; WRITE_VID32(DF_VIDEO_REQUEST, (y | (x << 16))); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_output_color_space * * This routine sets the color space used when combining graphics and video. *--------------------------------------------------------------------------*/ int df_set_output_color_space(int color_space) { unsigned long alpha_ctl; alpha_ctl = READ_VID32(DF_VID_ALPHA_CONTROL); alpha_ctl &= ~(DF_CSC_GRAPHICS_RGB_TO_YUV | DF_CSC_VIDEO_YUV_TO_RGB | DF_HD_GRAPHICS | DF_YUV_CSC_EN | DF_ALPHA_DRGB); /* OUTPUT IS RGB */ /* Enable YUV->RGB CSC if necessary and enable alpha output if */ /* requested. */ if (color_space == DF_OUTPUT_RGB || color_space == DF_OUTPUT_ARGB) { if (!(alpha_ctl & DF_VIDEO_INPUT_IS_RGB)) alpha_ctl |= DF_CSC_VIDEO_YUV_TO_RGB; if (color_space == DF_OUTPUT_ARGB) alpha_ctl |= DF_ALPHA_DRGB; } /* OUTPUT IS YUV */ /* Enable YUV->YUV CSC if necessary and enable RGB->YUV CSC. */ else if (color_space == DF_OUTPUT_SDTV || color_space == DF_OUTPUT_HDTV) { alpha_ctl |= DF_CSC_GRAPHICS_RGB_TO_YUV; if (((alpha_ctl & DF_HD_VIDEO) && color_space == DF_OUTPUT_SDTV) || (!(alpha_ctl & DF_HD_VIDEO) && color_space == DF_OUTPUT_HDTV)) { alpha_ctl |= DF_YUV_CSC_EN; } if (color_space == DF_OUTPUT_HDTV) alpha_ctl |= DF_HD_GRAPHICS; } else return CIM_STATUS_INVALIDPARAMS; WRITE_VID32(DF_VID_ALPHA_CONTROL, alpha_ctl); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_set_output_path * * This routine changes the current output path in the display filter. *--------------------------------------------------------------------------*/ int df_set_output_path(int format) { unsigned long panel_tim2, panel_pm; unsigned long output = 0; Q_WORD msr_value; msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &msr_value); msr_value.low &= ~(DF_SIMULTANEOUS_CRT_FP | DF_CONFIG_OUTPUT_MASK); panel_tim2 = READ_VID32(DF_VIDEO_PANEL_TIM2); panel_pm = READ_VID32(DF_POWER_MANAGEMENT); if (format == DF_DISPLAY_CRT) { /* SiBZ #4188 */ /* When CRT output is selected, the DF drives the DISP_EN signal */ /* with the CRT display enable. As a consequence, systems that */ /* wire the DISP_EN signal to the TFT backlight control will not */ /* be able to set CRT-only output without leaving the backlight */ /* enabled. To workaround this issue, we are setting simultaneous */ /* TFT/CRT and disabling the TFT logic. The only caveat to this */ /* is that some TFT pins are shared with VIP 601 pins. VIP 601 */ /* will thus not work when in this pseudo-CRT mode. To address */ /* THAT issue, normal CRT mode sets (in cim_vg.c) will set CRT */ /* as the DF output format. This will allow VIP 601 on CRT-only */ /* systems without a TFT attached. */ panel_pm &= ~DF_PM_PANEL_ON; panel_tim2 |= DF_PMTIM2_TFT_PASSHTHROUGH; output = DF_OUTPUT_PANEL | DF_SIMULTANEOUS_CRT_FP; } else if (format == DF_DISPLAY_FP || format == DF_DISPLAY_CRT_FP) { panel_pm |= DF_PM_PANEL_ON; panel_tim2 &= ~DF_PMTIM2_TFT_PASSHTHROUGH; if (format == DF_DISPLAY_FP) output = DF_OUTPUT_PANEL; else if (format == DF_DISPLAY_CRT_FP) output = DF_OUTPUT_PANEL | DF_SIMULTANEOUS_CRT_FP; } else { switch (format) { case DF_DISPLAY_VOP: output = DF_OUTPUT_VOP; break; case DF_DISPLAY_DRGB: output = DF_OUTPUT_DRGB; break; case DF_DISPLAY_CRT_DRGB: output = DF_OUTPUT_DRGB | DF_SIMULTANEOUS_CRT_FP; break; default: return CIM_STATUS_INVALIDPARAMS; } } msr_value.low |= output; msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &msr_value); WRITE_VID32(DF_VIDEO_PANEL_TIM2, panel_tim2); WRITE_VID32(DF_POWER_MANAGEMENT, panel_pm); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_test_video_flip_status * * This routine tests if a new video offset has been latched. *--------------------------------------------------------------------------*/ unsigned long df_test_video_flip_status(void) { return (READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VFLIP); } /*--------------------------------------------------------------------------- * df_save_state * * This routine saves all persistent DF state information. *--------------------------------------------------------------------------*/ int df_save_state(DF_SAVE_RESTORE * df_state) { unsigned long i; /* READ ALL DF REGISTERS */ df_state->vcfg = READ_VID32(DF_VIDEO_CONFIG); df_state->dcfg = READ_VID32(DF_DISPLAY_CONFIG); df_state->video_x = READ_VID32(DF_VIDEO_X_POS); df_state->video_y = READ_VID32(DF_VIDEO_Y_POS); df_state->video_scaler = READ_VID32(DF_VIDEO_SCALER); df_state->video_color_key = READ_VID32(DF_VIDEO_COLOR_KEY); df_state->video_color_mask = READ_VID32(DF_VIDEO_COLOR_MASK); df_state->sat_limit = READ_VID32(DF_SATURATION_LIMIT); df_state->vid_misc = READ_VID32(DF_VID_MISC); df_state->video_yscale = READ_VID32(DF_VIDEO_YSCALE); df_state->video_xscale = READ_VID32(DF_VIDEO_XSCALE); df_state->vid_alpha_control = READ_VID32(DF_VID_ALPHA_CONTROL); df_state->cursor_key = READ_VID32(DF_CURSOR_COLOR_KEY); df_state->cursor_mask = READ_VID32(DF_CURSOR_COLOR_MASK); df_state->cursor_color1 = READ_VID32(DF_CURSOR_COLOR_1); df_state->cursor_color2 = READ_VID32(DF_CURSOR_COLOR_2); df_state->alpha_xpos1 = READ_VID32(DF_ALPHA_XPOS_1); df_state->alpha_ypos1 = READ_VID32(DF_ALPHA_YPOS_1); df_state->alpha_color1 = READ_VID32(DF_ALPHA_COLOR_1); df_state->alpha_control1 = READ_VID32(DF_ALPHA_CONTROL_1); df_state->alpha_xpos2 = READ_VID32(DF_ALPHA_XPOS_2); df_state->alpha_ypos2 = READ_VID32(DF_ALPHA_YPOS_2); df_state->alpha_color2 = READ_VID32(DF_ALPHA_COLOR_2); df_state->alpha_control2 = READ_VID32(DF_ALPHA_CONTROL_2); df_state->alpha_xpos3 = READ_VID32(DF_ALPHA_XPOS_3); df_state->alpha_ypos3 = READ_VID32(DF_ALPHA_YPOS_3); df_state->alpha_color3 = READ_VID32(DF_ALPHA_COLOR_3); df_state->alpha_control3 = READ_VID32(DF_ALPHA_CONTROL_3); df_state->vid_request = READ_VID32(DF_VIDEO_REQUEST); df_state->vid_ypos_even = READ_VID32(DF_VID_YPOS_EVEN); df_state->alpha_ypos_even1 = READ_VID32(DF_VID_ALPHA_Y_EVEN_1); df_state->alpha_ypos_even2 = READ_VID32(DF_VID_ALPHA_Y_EVEN_2); df_state->alpha_ypos_even3 = READ_VID32(DF_VID_ALPHA_Y_EVEN_3); df_state->panel_tim1 = READ_VID32(DF_VIDEO_PANEL_TIM1); df_state->panel_tim2 = READ_VID32(DF_VIDEO_PANEL_TIM2); df_state->panel_pm = READ_VID32(DF_POWER_MANAGEMENT); df_state->panel_dither = READ_VID32(DF_DITHER_CONTROL); /* READ DF PALETTE */ WRITE_VID32(DF_PALETTE_ADDRESS, 0); for (i = 0; i < 256; i++) df_state->palette[i] = READ_VID32(DF_PALETTE_DATA); /* READ FILTER COEFFICIENTS */ for (i = 0; i < 512; i++) df_state->coefficients[i] = READ_VID32(DF_COEFFICIENT_BASE + (i << 2)); /* READ ALL DF MSRS */ msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CAP, &(df_state->msr_cap)); msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &(df_state->msr_config)); msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_SMI, &(df_state->msr_smi)); msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_ERROR, &(df_state->msr_error)); msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_PM, &(df_state->msr_pm)); msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_DIAG, &(df_state->msr_diag)); msr_read64(MSR_DEVICE_GEODELX_DF, DF_MBD_MSR_DIAG_DF, &(df_state->msr_df_diag)); msr_read64(MSR_DEVICE_GEODELX_DF, DF_MSR_PAD_SEL, &(df_state->msr_pad_sel)); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_restore_state * * This routine restores all persistent DF state information. *--------------------------------------------------------------------------*/ int df_restore_state(DF_SAVE_RESTORE * df_state) { unsigned long i; /* CLEAR VCFG AND DCFG */ WRITE_VID32(DF_VIDEO_CONFIG, 0); WRITE_VID32(DF_DISPLAY_CONFIG, 0); /* RESTORE DF MSRS */ msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CAP, &(df_state->msr_cap)); msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &(df_state->msr_config)); msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_SMI, &(df_state->msr_smi)); msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_ERROR, &(df_state->msr_error)); msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_PM, &(df_state->msr_pm)); msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_DIAG, &(df_state->msr_diag)); msr_write64(MSR_DEVICE_GEODELX_DF, DF_MBD_MSR_DIAG_DF, &(df_state->msr_df_diag)); msr_write64(MSR_DEVICE_GEODELX_DF, DF_MSR_PAD_SEL, &(df_state->msr_pad_sel)); /* RESTORE ALL DF REGISTERS */ WRITE_VID32(DF_VIDEO_X_POS, df_state->video_x); WRITE_VID32(DF_VIDEO_Y_POS, df_state->video_y); WRITE_VID32(DF_VIDEO_SCALER, df_state->video_scaler); WRITE_VID32(DF_VIDEO_COLOR_KEY, df_state->video_color_key); WRITE_VID32(DF_VIDEO_COLOR_MASK, df_state->video_color_mask); WRITE_VID32(DF_SATURATION_LIMIT, df_state->sat_limit); WRITE_VID32(DF_VID_MISC, df_state->vid_misc); WRITE_VID32(DF_VIDEO_YSCALE, df_state->video_yscale); WRITE_VID32(DF_VIDEO_XSCALE, df_state->video_xscale); WRITE_VID32(DF_VID_ALPHA_CONTROL, df_state->vid_alpha_control); WRITE_VID32(DF_CURSOR_COLOR_KEY, df_state->cursor_key); WRITE_VID32(DF_CURSOR_COLOR_MASK, df_state->cursor_mask); WRITE_VID32(DF_CURSOR_COLOR_1, df_state->cursor_color1); WRITE_VID32(DF_CURSOR_COLOR_2, df_state->cursor_color2); WRITE_VID32(DF_ALPHA_XPOS_1, df_state->alpha_xpos1); WRITE_VID32(DF_ALPHA_YPOS_1, df_state->alpha_ypos1); WRITE_VID32(DF_ALPHA_COLOR_1, df_state->alpha_color1); WRITE_VID32(DF_ALPHA_CONTROL_1, df_state->alpha_control1); WRITE_VID32(DF_ALPHA_XPOS_2, df_state->alpha_xpos2); WRITE_VID32(DF_ALPHA_YPOS_2, df_state->alpha_ypos2); WRITE_VID32(DF_ALPHA_COLOR_2, df_state->alpha_color2); WRITE_VID32(DF_ALPHA_CONTROL_2, df_state->alpha_control1); WRITE_VID32(DF_ALPHA_XPOS_3, df_state->alpha_xpos3); WRITE_VID32(DF_ALPHA_YPOS_3, df_state->alpha_ypos3); WRITE_VID32(DF_ALPHA_COLOR_3, df_state->alpha_color3); WRITE_VID32(DF_ALPHA_CONTROL_3, df_state->alpha_control3); WRITE_VID32(DF_VIDEO_REQUEST, df_state->vid_request); WRITE_VID32(DF_VID_YPOS_EVEN, df_state->vid_ypos_even); WRITE_VID32(DF_VID_ALPHA_Y_EVEN_1, df_state->alpha_ypos_even1); WRITE_VID32(DF_VID_ALPHA_Y_EVEN_2, df_state->alpha_ypos_even2); WRITE_VID32(DF_VID_ALPHA_Y_EVEN_3, df_state->alpha_ypos_even3); WRITE_VID32(DF_VIDEO_PANEL_TIM1, df_state->panel_tim1); WRITE_VID32(DF_VIDEO_PANEL_TIM2, df_state->panel_tim2); WRITE_VID32(DF_POWER_MANAGEMENT, df_state->panel_pm); WRITE_VID32(DF_DITHER_CONTROL, df_state->panel_dither); /* RESTORE DF PALETTE */ WRITE_VID32(DF_PALETTE_ADDRESS, 0); for (i = 0; i < 256; i++) WRITE_VID32(DF_PALETTE_DATA, df_state->palette[i]); /* RESTORE FILTER COEFFICIENTS */ for (i = 0; i < 512; i++) WRITE_VID32(DF_COEFFICIENT_BASE + (i << 2), df_state->coefficients[i]); /* RESTORE DCFG AND VCFG */ WRITE_VID32(DF_DISPLAY_CONFIG, df_state->dcfg); WRITE_VID32(DF_VIDEO_CONFIG, df_state->vcfg); return CIM_STATUS_OK; } /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * CIMARRON DF READ ROUTINES * These routines are included for use in diagnostics or when debugging. They * can be optionally excluded from a project. *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ #if CIMARRON_INCLUDE_DF_READ_ROUTINES /*--------------------------------------------------------------------------- * df_read_composite_crc * * This routine reads the CRC of the combination of graphics/video data. This * CRC checks data immediately before the CRT DACs. *--------------------------------------------------------------------------*/ unsigned long df_read_composite_crc(int crc_source) { Q_WORD msr_value; unsigned long crc; unsigned long interlaced; unsigned long line, field; unsigned long timeout = 1000; if (!(READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_TGEN)) return 0xFFFFFFFF; /* ENABLE 32-BIT CRCS */ msr_read64(MSR_DEVICE_GEODELX_DF, DF_MBD_MSR_DIAG_DF, &msr_value); msr_value.low |= DF_DIAG_32BIT_CRC; msr_write64(MSR_DEVICE_GEODELX_DF, DF_MBD_MSR_DIAG_DF, &msr_value); /* RESET THE CRC */ WRITE_VID32(DF_VID_CRC, 0); /* WAIT FOR THE RESET TO BE LATCHED */ while ((READ_VID32(DF_VID_CRC32) != 0x00000001) && timeout) timeout--; /* WAIT FOR THE CORRECT FIELD */ /* We use the VG line count and field indicator to determine when */ /* to kick off a CRC. */ if (crc_source & DF_CRC_SOURCE_EVEN) field = 0; else field = DC3_LNCNT_EVEN_FIELD; if ((interlaced = (READ_REG32(DC3_IRQ_FILT_CTL) & DC3_IRQFILT_INTL_EN))) { /* WAIT FOR THE BEGINNING OF THE FIELD (LINE 1-5) */ /* Note that we wait for the field to be odd when CRCing the even */ /* field and vice versa. This is because the CRC will not begin */ /* until the following field. */ do { line = READ_REG32(DC3_LINE_CNT_STATUS); } while ((line & DC3_LNCNT_EVEN_FIELD) != field || ((line & DC3_LNCNT_V_LINE_CNT) >> 16) < 10 || ((line & DC3_LNCNT_V_LINE_CNT) >> 16) > 15); } else { /* NON-INTERLACED - EVEN FIELD CRCS ARE INVALID */ if (crc_source & DF_CRC_SOURCE_EVEN) return 0xFFFFFFFF; } /* ENABLE THE CRC */ WRITE_VID32(DF_VID_CRC, 1); /* WAIT FOR THE CRC TO BE COMPLETED */ while (!(READ_VID32(DF_VID_CRC) & 4)); crc = READ_VID32(DF_VID_CRC32); return crc; } /*--------------------------------------------------------------------------- * df_read_composite_window_crc * * This routine reads the CRC of a rectangular subsection of the combination * of graphics/video data. *--------------------------------------------------------------------------*/ unsigned long df_read_composite_window_crc(unsigned long x, unsigned long y, unsigned long width, unsigned long height, int source) { Q_WORD msr_value; unsigned long interlaced; unsigned long line, field; unsigned long crc = 0; unsigned long hsyncend, htotal, hsyncstart; unsigned long vsyncend, vtotal, vsyncstart; unsigned long hblankstart, hactive; unsigned long vblankstart, vactive; hsyncend = ((READ_REG32(DC3_H_SYNC_TIMING) >> 16) & 0xFFF) + 1; htotal = ((READ_REG32(DC3_H_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; hsyncstart = (READ_REG32(DC3_H_SYNC_TIMING) & 0xFFF) + 1; hactive = (READ_REG32(DC3_H_ACTIVE_TIMING) & 0xFFF) + 1; hblankstart = (READ_REG32(DC3_H_BLANK_TIMING) & 0xFFF) + 1; if ((interlaced = (READ_REG32(DC3_IRQ_FILT_CTL) & DC3_IRQFILT_INTL_EN)) && !(source & DF_CRC_SOURCE_EVEN)) { vsyncend = ((READ_REG32(DC3_V_SYNC_EVEN) >> 16) & 0xFFF) + 1; vtotal = ((READ_REG32(DC3_V_ACTIVE_EVEN) >> 16) & 0xFFF) + 1; vsyncstart = (READ_REG32(DC3_V_SYNC_EVEN) & 0xFFF) + 1; vactive = (READ_REG32(DC3_V_ACTIVE_EVEN) & 0xFFF) + 1; vblankstart = (READ_REG32(DC3_V_BLANK_EVEN) & 0xFFF) + 1; } else { vsyncend = ((READ_REG32(DC3_V_SYNC_TIMING) >> 16) & 0xFFF) + 1; vtotal = ((READ_REG32(DC3_V_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; vsyncstart = (READ_REG32(DC3_V_SYNC_TIMING) & 0xFFF) + 1; vactive = (READ_REG32(DC3_V_ACTIVE_TIMING) & 0xFFF) + 1; vblankstart = (READ_REG32(DC3_V_BLANK_TIMING) & 0xFFF) + 1; } /* TIMINGS MUST BE ACTIVE */ if (!(READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_TGEN)) return 0xFFFFFFFF; /* DISABLE GLCP ACTIONS */ msr_value.low = 0; msr_value.high = 0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DIAGCTL, &msr_value); /* ENABLE HW CLOCK GATING AND SET GLCP CLOCK TO DOT CLOCK */ msr_value.low = 5; msr_write64(MSR_DEVICE_GEODELX_GLCP, MSR_GEODELINK_PM, &msr_value); msr_value.low = 0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DBGCLKCTL, &msr_value); msr_value.low = 3; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DBGCLKCTL, &msr_value); /* USE H4 FUNCTION A FOR HSYNC AND H4 FUNCTION B FOR NOT HSYNC */ /* HSYNC is bit 30 for the DF */ msr_value.high = 0x00000001; msr_value.low = 0xE0000FF0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_H0CTL + 4, &msr_value); /* USE H3 FUNCTION A FOR VSYNC AND H3 FUNCTION B FOR NOT VSYNC */ /* VSYNC is bit 54 for VG and bit 29 for DF */ msr_value.high = 0x00000000; msr_value.low = 0x001D55AA; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_H0CTL + 3, &msr_value); /* M4 (XSTATE = 00 AND VSYNC HIGH) */ /* Goto state 01 */ /* Note: VSync = H3A */ msr_value.high = 0x00000001; msr_value.low = 0x000000A0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETM0CTL + 4, &msr_value); /* N0 (XSTATE = 01 AND VSYNC LOW) */ /* Goto state 02 */ /* Note: VSync low = H3B */ msr_value.high = 0x00040000; msr_value.low = 0x000000C0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETN0CTL, &msr_value); /* M5 (XSTATE = 10 AND VSYNC HIGH) */ /* Goto state 11 */ msr_value.high = 0x00000001; msr_value.low = 0x00000120; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETM0CTL + 5, &msr_value); /* N1 (XSTATE = 10 and HSYNC LOW) */ /* Increment H. Counter */ /* Note: HSync = H4 */ msr_value.high = 0x00080000; msr_value.low = 0x00000120; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETN0CTL + 1, &msr_value); /* M0 (XSTATE = 10 and H. COUNTER == LIMIT) */ /* Clear H. Counter and increment V. Counter */ msr_value.high = 0x00000000; msr_value.low = 0x00000122; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETM0CTL, &msr_value); /* N4 (XSTATE = 10 && CMP0 <= H. COUNTER <= CMP1 && CMP2 <= V. COUNTER * <= CMP3) * CRC into REGB */ msr_value.high = 0x00000000; msr_value.low = 0x10C20120; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETN0CTL + 4, &msr_value); /* COMPARATOR 0 VALUE */ /* Value = xstart + (htotal - hsync_end) - 1 */ /* The value will be adjusted for a border if necessary */ msr_value.low = x + htotal - hsyncend - 1; if (READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_DCEN) msr_value.low -= hblankstart - hactive; msr_value.low--; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPVAL0, &msr_value); /* COMPARATOR 1 VALUE */ /* Value = xstart + (htotal - hsync_end - 1) - 1 + width */ msr_value.low += width - 1; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPVAL0 + 2, &msr_value); /* COMPARATOR 2 VALUE */ /* Value = ystart + vtotal - vsyncend */ msr_value.low = (y + vtotal - vsyncend) << 16; if (READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_DCEN) msr_value.low -= (vblankstart - vactive) << 16; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPVAL0 + 4, &msr_value); /* COMPARATOR 3 VALUE */ /* Value = ystart + vtotal - vsyncend + height - 1 */ msr_value.low += (height - 1) << 16; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPVAL0 + 6, &msr_value); /* COMPARATOR MASKS */ /* Comparators 0 and 1 refer to lower 16 bits of RegB */ msr_value.low = 0x0000FFFF; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPMASK0, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPMASK0 + 2, &msr_value); /* Comparators 2 and 3 refer to upper 16 bits of RegB */ msr_value.low = 0xFFFF0000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPMASK0 + 4, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPMASK0 + 6, &msr_value); /* SET REGB MASK */ /* We set the mask such that all only 24 bits of data are CRCed */ msr_value.low = 0x00FFFFFF; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_REGBMASK, &msr_value); /* SET REGA LIMITS */ /* Lower counter uses htotal - sync_time - 1. */ /* Upper counter is 0xFFFF to prevent rollover. */ msr_value.low = 0xFFFF0000 | (htotal - (hsyncend - hsyncstart) - 1); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_REGAVAL, &msr_value); /* ACTIONS */ /* STATE 00->01 (SET 4M) */ msr_value.low = 0x000C0000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 14, &msr_value); /* STATE 01->10 (SET 0N) */ msr_value.low = 0x0000000A; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 15, &msr_value); /* STATE 10->11 (SET 5M) */ msr_value.low = 0x00C00000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 16, &msr_value); /* CLEAR REGA WHEN TRANSITIONING TO STATE 10 */ /* Do not clear RegB as the initial value must be 0x00000001 */ msr_value.low = 0x0000000A; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0, &msr_value); /* REGISTER ACTION 1 */ /* CRC into RegB if cmp0 <= h.counter <= cmp1 && cmp2 <= v. counter < * cmp3 && 7 xstate = 10 8 * Increment h.counter if xstate = 10 and HSync is low. */ msr_value.low = 0x000A00A0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 1, &msr_value); /* REGISTER ACTION 2 */ /* Increment V. Counter in REGA */ msr_value.low = 0x0000000C; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 2, &msr_value); /* SET REGB TO 0x00000001 */ msr_value.low = 0x00000001; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_REGB, &msr_value); /* SET XSTATE TO 0 */ msr_value.low = 0x00000000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_XSTATE, &msr_value); /* CLEAR ALL OTHER ACTIONS */ /* This prevents side-effects from previous accesses to the GLCP */ /* debug logic. */ msr_value.low = 0x00000000; msr_value.high = 0x00000000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 3, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 4, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 5, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 6, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 7, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 8, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 9, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 10, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 11, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 12, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 13, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 17, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 18, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 19, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 20, &msr_value); /* WAIT FOR THE CORRECT FIELD */ /* We use the VG line count and field indicator to determine when */ /* to kick off a CRC. */ if (source & DF_CRC_SOURCE_EVEN) field = 0; else field = DC3_LNCNT_EVEN_FIELD; if (interlaced) { /* WAIT FOR THE BEGINNING OF THE FIELD (LINE 1-5) */ /* Note that we wait for the field to be odd when CRCing the even */ /* field and vice versa. This is because the CRC will not begin */ /* until the following field. */ do { line = READ_REG32(DC3_LINE_CNT_STATUS); } while ((line & DC3_LNCNT_EVEN_FIELD) != field || ((line & DC3_LNCNT_V_LINE_CNT) >> 16) < 1 || ((line & DC3_LNCNT_V_LINE_CNT) >> 16) > 5); } else { /* NON-INTERLACED - EVEN FIELD CRCS ARE INVALID */ if (source & DF_CRC_SOURCE_EVEN) return 0xFFFFFFFF; } /* CONFIGURE DISPLAY FILTER TO LOAD DATA ONTO LOWER 32-BITS */ msr_value.high = 0; msr_value.low = 0x0000800B; msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_DIAG, &msr_value); /* CONFIGURE DIAG CONTROL */ /* Set RegA action1 to increment lower 16 bits and clear at limit. (5) * Set RegA action2 to increment upper 16 bits. (6) * Set RegB action1 to CRC32 (1) * Set all comparators to REGA override (0,1 lower mbus, 2,3 upper mbus) * Enable all actions */ msr_value.low = 0x80EA20A0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DIAGCTL, &msr_value); /* DELAY TWO FRAMES */ while (READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VNA); while (!(READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VNA)); while (READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VNA); while (!(READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VNA)); while (READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VNA); /* VERIFY THAT XSTATE = 11 */ msr_read64(MSR_DEVICE_GEODELX_GLCP, GLCP_XSTATE, &msr_value); if ((msr_value.low & 3) == 3) { msr_read64(MSR_DEVICE_GEODELX_GLCP, GLCP_REGB, &msr_value); crc = msr_value.low; } /* DISABLE DF DIAG BUS OUTPUTS */ msr_value.low = 0x00000000; msr_value.high = 0x00000000; msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_DIAG, &msr_value); /* DISABLE GLCP ACTIONS */ msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DIAGCTL, &msr_value); return crc; } /*--------------------------------------------------------------------------- * df_read_panel_crc * * This routine reads the CRC for a frame of data after the panel dithering * logic. *--------------------------------------------------------------------------*/ unsigned long df_read_panel_crc(void) { Q_WORD msr_value; unsigned long timeout = 1000; if (!(READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_TGEN)) return 0xFFFFFFFF; /* ENABLE 32-BIT CRCS */ msr_read64(MSR_DEVICE_GEODELX_DF, DF_MBD_MSR_DIAG_DF, &msr_value); msr_value.low |= DF_DIAG_32BIT_CRC; msr_write64(MSR_DEVICE_GEODELX_DF, DF_MBD_MSR_DIAG_DF, &msr_value); /* RESET CRC */ WRITE_VID32(DF_PANEL_CRC, 0); /* WAIT FOR THE RESET TO BE LATCHED */ while ((READ_VID32(DF_PANEL_CRC32) != 0x00000001) && timeout) timeout--; WRITE_VID32(DF_PANEL_CRC, 1); /* WAIT FOR THE CRC TO BE COMPLETED */ while (!(READ_VID32(DF_PANEL_CRC) & 4)); return READ_VID32(DF_PANEL_CRC32); } /*--------------------------------------------------------------------------- * df_get_video_enable * * This routine reads the enable status of the video overlay. *--------------------------------------------------------------------------*/ int df_get_video_enable(int *enable, unsigned long *flags) { *enable = 0; *flags = 0; if (READ_VID32(DF_VIDEO_CONFIG) & DF_VCFG_VID_EN) { *enable = 1; /* CHECK FOR COLOR KEY DISABLED */ /* Color keying can be completely disabled when video is enabled to */ /* allow unhindered per-pixel alpha blending. As color keying is */ /* always disabled when video is disabled, it is only possible to */ /* test for this condition when video is enabled. */ if (!(READ_VID32(DF_DISPLAY_CONFIG) & DF_DCFG_VG_CK) && !(READ_REG32(DC3_COLOR_KEY) & DC3_CLR_KEY_ENABLE)) { *flags = DF_ENABLEFLAG_NOCOLORKEY; } } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_get_video_source_configuration * * This routine reads the current configuration of the source buffers for the * video overlay. *--------------------------------------------------------------------------*/ int df_get_video_source_configuration(DF_VIDEO_SOURCE_PARAMS * video_source_odd, DF_VIDEO_SOURCE_PARAMS * video_source_even) { unsigned long format, temp; unsigned long size; /* READ VIDEO FORMAT */ temp = READ_VID32(DF_VIDEO_CONFIG); format = (temp >> 2) & 3; if (temp & DF_VCFG_4_2_0_MODE) format |= 4; else if (READ_VID32(DF_VID_ALPHA_CONTROL) & DF_VIDEO_INPUT_IS_RGB) format |= 8; video_source_odd->video_format = format; /* CHECK IF SOURCE IS HD VIDEO */ if (READ_VID32(DF_VID_ALPHA_CONTROL) & DF_HD_VIDEO) video_source_odd->flags = DF_SOURCEFLAG_HDTVSOURCE; else video_source_odd->flags = 0; /* READ SCALING ALGORITHM */ if (READ_VID32(DF_VID_MISC) & DF_USER_IMPLICIT_SCALING) video_source_odd->flags |= DF_SOURCEFLAG_IMPLICITSCALING; /* READ VIDEO PITCH */ temp = READ_REG32(DC3_VID_YUV_PITCH); video_source_odd->y_pitch = (temp & 0xFFFF) << 3; video_source_odd->uv_pitch = (temp >> 16) << 3; /* READ VIDEO SIZE */ temp = READ_VID32(DF_VIDEO_CONFIG); size = (temp >> 8) & 0xFF; if (temp & DF_VCFG_LINE_SIZE_BIT8) size |= 0x100; if (temp & DF_VCFG_LINE_SIZE_BIT9) size |= 0x200; video_source_odd->width = size << 1; video_source_odd->height = READ_VID32(DF_VIDEO_SCALER) & 0x7FF; /* READ VIDEO OFFSETS */ video_source_odd->y_offset = READ_REG32(DC3_VID_Y_ST_OFFSET) & 0xFFFFFFF; video_source_odd->u_offset = READ_REG32(DC3_VID_U_ST_OFFSET) & 0xFFFFFFF; video_source_odd->v_offset = READ_REG32(DC3_VID_V_ST_OFFSET) & 0xFFFFFFF; if (READ_REG32(DC3_IRQ_FILT_CTL) & DC3_IRQFILT_INTL_EN) { video_source_even->y_offset = READ_REG32(DC3_VID_EVEN_Y_ST_OFFSET) & 0xFFFFFFF; video_source_even->u_offset = READ_REG32(DC3_VID_EVEN_U_ST_OFFSET) & 0xFFFFFFF; video_source_even->v_offset = READ_REG32(DC3_VID_EVEN_V_ST_OFFSET) & 0xFFFFFFF; } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_get_video_position * * This routine reads the current position of the video overlay. *--------------------------------------------------------------------------*/ int df_get_video_position(DF_VIDEO_POSITION * video_window) { unsigned long xreg, yreg, dst_clip, clip; unsigned long height; unsigned long xend, yend; unsigned long hsyncend, htotal; unsigned long vsyncend, vtotal; unsigned long hadjust, vadjust; unsigned long misc, gfxscale; unsigned long temp; long xstart, ystart; video_window->flags = DF_POSFLAG_DIRECTCLIP; hsyncend = ((READ_REG32(DC3_H_SYNC_TIMING) >> 16) & 0xFFF) + 1; htotal = ((READ_REG32(DC3_H_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; /* ODD FIELD START COUNTS FROM THE EVEN FIELD TIMINGS */ /* We assume that the even field y position is always programmed */ /* to be just after the odd field. */ if (READ_REG32(DC3_IRQ_FILT_CTL) & DC3_IRQFILT_INTL_EN) { vsyncend = ((READ_REG32(DC3_V_SYNC_EVEN) >> 16) & 0xFFF) + 1; vtotal = ((READ_REG32(DC3_V_ACTIVE_EVEN) >> 16) & 0xFFF) + 1; } else { vsyncend = ((READ_REG32(DC3_V_SYNC_TIMING) >> 16) & 0xFFF) + 1; vtotal = ((READ_REG32(DC3_V_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; } hadjust = htotal - hsyncend - 14; vadjust = vtotal - vsyncend + 1; xreg = READ_VID32(DF_VIDEO_X_POS); yreg = READ_VID32(DF_VIDEO_Y_POS); xstart = (xreg & 0xFFF) - hadjust; ystart = (yreg & 0x7FF) - vadjust; xend = ((xreg >> 16) & 0xFFF) - hadjust; yend = ((yreg >> 16) & 0x7FF) - vadjust; height = yend - ystart; if (READ_REG32(DC3_IRQ_FILT_CTL) & DC3_IRQFILT_INTL_EN) { /* Y COORDINATE IS ACTUALLY 2X THE ODD FIELD START */ ystart <<= 1; /* CALCULATE THE EXACT VIDEO HEIGHT */ /* The height of the video window is the sum of the */ /* odd and even field heights. */ yreg = READ_VID32(DF_VID_YPOS_EVEN); height += ((yreg >> 16) & 0x7FF) - (yreg & 0x7FF); } clip = ((READ_VID32(DF_VIDEO_CONFIG) >> 16) & 0x1FF) << 2; /* ADJUST FOR CLIPPING VALUES THAT ARE NOT FOUR-PIXEL ALIGNED */ dst_clip = 0; if (xstart < 0) { dst_clip += -xstart; xstart = 0; } /* REVERSE THE GRAPHICS SCALE */ misc = READ_VID32(DF_VID_MISC); if (misc & DF_USER_IMPLICIT_SCALING) { gfxscale = READ_REG32(DC3_GFX_SCALE); if (gfxscale != 0x40004000) { temp = ystart + height; temp = (temp * (gfxscale >> 16)) / 0x4000; xstart = (xstart * (gfxscale & 0xFFFF)) / 0x4000; xend = (xend * (gfxscale & 0xFFFF)) / 0x4000; ystart = (ystart * (gfxscale >> 16)) / 0x4000; height = temp - ystart; } } video_window->left_clip = clip; video_window->dst_clip = dst_clip; video_window->x = xstart; video_window->y = ystart; video_window->width = xend - xstart; video_window->height = height; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_get_video_scale * * This routine reads the current scale values for video scaling. *--------------------------------------------------------------------------*/ int df_get_video_scale(unsigned long *x_scale, unsigned long *y_scale) { *x_scale = READ_VID32(DF_VIDEO_XSCALE) & 0x000FFFFF; *y_scale = READ_VID32(DF_VIDEO_YSCALE) & 0x000FFFFF; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_get_video_filter_coefficients * * This routine reads the coefficients for the video scaler/filter. *--------------------------------------------------------------------------*/ int df_get_video_filter_coefficients(long taps[][4], int *phase256) { unsigned long i, temp; long coeff; if (READ_VID32(DF_VIDEO_SCALER) & DF_SCALE_128_PHASES) *phase256 = 0; else *phase256 = 1; for (i = 0; i < 256; i++) { temp = READ_VID32(DF_COEFFICIENT_BASE + (i << 3)); /* TAP 0 */ coeff = temp & 0x7FFF; if (temp & 0x8000) coeff = -coeff; taps[i][0] = coeff; /* TAP 1 */ temp >>= 16; coeff = temp & 0x7FFF; if (temp & 0x8000) coeff = -coeff; taps[i][1] = coeff; temp = READ_VID32(DF_COEFFICIENT_BASE + (i << 3) + 4); /* TAP 2 */ coeff = temp & 0x7FFF; if (temp & 0x8000) coeff = -coeff; taps[i][2] = coeff; /* TAP 3 */ temp >>= 16; coeff = temp & 0x7FFF; if (temp & 0x8000) coeff = -coeff; taps[i][3] = coeff; } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_get_video_color_key * * This routine reads the current settings for hardware color/chroma keying. *--------------------------------------------------------------------------*/ int df_get_video_color_key(unsigned long *key, unsigned long *mask, int *graphics) { unsigned long chroma = READ_VID32(DF_DISPLAY_CONFIG) & DF_DCFG_VG_CK; if (chroma) { /* CHROMA KEY - READ KEY AND MASK FROM DF */ *graphics = 0; *key = READ_VID32(DF_VIDEO_COLOR_KEY) & 0xFFFFFF; *mask = READ_VID32(DF_VIDEO_COLOR_MASK) & 0xFFFFFF; } else { *graphics = 1; *key = READ_REG32(DC3_COLOR_KEY) & 0xFFFFFF; *mask = READ_REG32(DC3_COLOR_MASK) & 0xFFFFFF; } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_get_video_palette_entry * * This routine returns a single palette entry. *--------------------------------------------------------------------------*/ int df_get_video_palette_entry(unsigned long index, unsigned long *palette) { if (index > 0xFF) return CIM_STATUS_INVALIDPARAMS; /* READ A SINGLE ENTRY */ WRITE_VID32(DF_PALETTE_ADDRESS, index); *palette = READ_VID32(DF_PALETTE_DATA); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_get_video_palette * * This routine returns the entire video palette. *--------------------------------------------------------------------------*/ int df_get_video_palette(unsigned long *palette) { unsigned long i; WRITE_VID32(DF_PALETTE_ADDRESS, 0); for (i = 0; i < 256; i++) palette[i] = READ_VID32(DF_PALETTE_DATA); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_get_video_cursor_color_key * * This routine returns the current configuration for the hardware video cursor * color key. *--------------------------------------------------------------------------*/ int df_get_video_cursor_color_key(DF_VIDEO_CURSOR_PARAMS * cursor_color_key) { unsigned long key; cursor_color_key->flags = 0; cursor_color_key->color1 = READ_VID32(DF_CURSOR_COLOR_1) & 0xFFFFFF; cursor_color_key->color2 = READ_VID32(DF_CURSOR_COLOR_2) & 0xFFFFFF; cursor_color_key->mask = READ_VID32(DF_CURSOR_COLOR_MASK) & 0xFFFFFF; key = READ_VID32(DF_CURSOR_COLOR_KEY); cursor_color_key->key = key & 0xFFFFFF; cursor_color_key->select_color2 = (key >> 24) & 0x1F; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_get_video_cursor_color_key_enable * * This routine returns the current enable status of the hardware video cursor * color key. *--------------------------------------------------------------------------*/ int df_get_video_cursor_color_key_enable(void) { if (READ_VID32(DF_CURSOR_COLOR_KEY) & DF_CURSOR_COLOR_KEY_ENABLE) return 1; return 0; } /*--------------------------------------------------------------------------- * df_get_alpha_window_configuration * * This routine reads the current configuration for one of the three hardware * alpha regions. *--------------------------------------------------------------------------*/ int df_get_alpha_window_configuration(int window, DF_ALPHA_REGION_PARAMS * alpha_data) { unsigned long pos, color, alpha_ctl; unsigned long hsyncend, htotal; unsigned long vsyncend, vtotal; unsigned long hadjust, vadjust; unsigned long xreg, yreg; unsigned long misc, gfxscale; unsigned long temp; char delta; if (window > 2) return CIM_STATUS_INVALIDPARAMS; hsyncend = ((READ_REG32(DC3_H_SYNC_TIMING) >> 16) & 0xFFF) + 1; htotal = ((READ_REG32(DC3_H_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; if (READ_REG32(DC3_IRQ_FILT_CTL) & DC3_IRQFILT_INTL_EN) { vtotal = ((READ_REG32(DC3_V_ACTIVE_EVEN) >> 16) & 0xFFF) + 1; vsyncend = ((READ_REG32(DC3_V_SYNC_EVEN) >> 16) & 0xFFF) + 1; } else { vtotal = ((READ_REG32(DC3_V_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; vsyncend = ((READ_REG32(DC3_V_SYNC_TIMING) >> 16) & 0xFFF) + 1; } /* GET PRIORITY */ pos = 16 + (window << 1); alpha_data->priority = (READ_VID32(DF_VID_ALPHA_CONTROL) >> pos) & 3L; /* GET ALPHA WINDOW */ hadjust = htotal - hsyncend - 2; vadjust = vtotal - vsyncend + 1; xreg = READ_VID32(DF_ALPHA_XPOS_1 + (window << 5)); yreg = READ_VID32(DF_ALPHA_YPOS_1 + (window << 5)); alpha_data->width = ((xreg >> 16) & 0xFFF) - (xreg & 0xFFF); alpha_data->height = ((yreg >> 16) & 0x7FF) - (yreg & 0x7FF); alpha_data->x = (xreg & 0xFFF) - hadjust; alpha_data->y = (yreg & 0x7FF) - vadjust; /* REVERSE THE GRAPHICS SCALE */ misc = READ_VID32(DF_VID_MISC); if (misc & DF_USER_IMPLICIT_SCALING) { gfxscale = READ_REG32(DC3_GFX_SCALE); if (gfxscale != 0x40004000) { temp = alpha_data->y + alpha_data->height; temp = (temp * (gfxscale >> 16)) / 0x4000; alpha_data->x = (alpha_data->x * (gfxscale & 0xFFFF)) / 0x4000; alpha_data->width = (alpha_data->width * (gfxscale & 0xFFFF)) / 0x4000; alpha_data->y = (alpha_data->y * (gfxscale >> 16)) / 0x4000; alpha_data->height = temp - alpha_data->y; } } if (READ_REG32(DC3_IRQ_FILT_CTL) & DC3_IRQFILT_INTL_EN) { /* Y COORDINATE IS ACTUALLY 2X THE ODD FIELD START */ alpha_data->y <<= 1; /* CALCULATE THE EXACT VIDEO HEIGHT */ /* The height of the video window is the sum of the */ /* odd and even field heights. */ yreg = READ_VID32(DF_VID_ALPHA_Y_EVEN_1 + (window << 3)); alpha_data->height += ((yreg >> 16) & 0x7FF) - (yreg & 0x7FF); } /* GET COLOR REGISTER */ color = READ_VID32(DF_ALPHA_COLOR_1 + (window << 5)); alpha_data->color = color & 0xFFFFFF; if (color & DF_ALPHA_COLOR_ENABLE) alpha_data->flags = DF_ALPHAFLAG_COLORENABLED; else alpha_data->flags = 0; /* GET ALPHA VALUE, DELTA AND PER PIXEL */ alpha_ctl = READ_VID32(DF_ALPHA_CONTROL_1 + (window << 5)); alpha_data->alpha_value = alpha_ctl & 0xFF; if (alpha_ctl & DF_ACTRL_PERPIXEL_EN) alpha_data->flags |= DF_ALPHAFLAG_PERPIXELENABLED; delta = (char) ((alpha_ctl >> 8) & 0xFF); alpha_data->delta = (long) delta; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_get_alpha_window_enable * * This routine reads the current enable status of one of the three hardware * alpha regions. *--------------------------------------------------------------------------*/ int df_get_alpha_window_enable(int window) { if (window > 2) return 0; if (READ_VID32(DF_ALPHA_CONTROL_1 + (window << 5)) & DF_ACTRL_WIN_ENABLE) return 1; return 0; } /*--------------------------------------------------------------------------- * df_get_video_request * * This routine reads the horizontal (pixel) and vertical (line) video request * values. *--------------------------------------------------------------------------*/ int df_get_video_request(unsigned long *x, unsigned long *y) { unsigned long request; unsigned long hsyncend, htotal; unsigned long vsyncend, vtotal; hsyncend = ((READ_REG32(DC3_H_SYNC_TIMING) >> 16) & 0xFFF) + 1; vsyncend = ((READ_REG32(DC3_V_SYNC_TIMING) >> 16) & 0xFFF) + 1; htotal = ((READ_REG32(DC3_H_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; vtotal = ((READ_REG32(DC3_V_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; request = READ_VID32(DF_VIDEO_REQUEST); *x = ((request >> 16) & 0xFFF) - (htotal - hsyncend - 2); *y = (request & 0x7FF) - (vtotal - vsyncend + 1); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * df_get_output_color_space * * This routine sets the color space used when combining graphics and video. *--------------------------------------------------------------------------*/ int df_get_output_color_space(int *color_space) { unsigned long alpha_ctl; alpha_ctl = READ_VID32(DF_VID_ALPHA_CONTROL); if ((alpha_ctl & DF_CSC_VIDEO_YUV_TO_RGB) || !(alpha_ctl & DF_CSC_GRAPHICS_RGB_TO_YUV)) { if (alpha_ctl & DF_ALPHA_DRGB) *color_space = DF_OUTPUT_ARGB; else *color_space = DF_OUTPUT_RGB; } else { *color_space = DF_OUTPUT_SDTV; if (alpha_ctl & DF_HD_GRAPHICS) *color_space = DF_OUTPUT_HDTV; } return CIM_STATUS_OK; } #endif xf86-video-geode-2.11.18/src/cim/cim_gp.c0000644000175000017500000037371112654445443014555 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron graphics processor routines. These routines program the graphics * hardware using the graphics command buffer. */ /*---------------------*/ /* CIMARRON GP GLOBALS */ /*---------------------*/ CIMARRON_STATIC unsigned long gp3_bpp = 0; CIMARRON_STATIC unsigned long gp3_ch3_bpp = 0; CIMARRON_STATIC unsigned long gp3_pat_origin = 0; CIMARRON_STATIC unsigned long gp3_buffer_lead = 0; CIMARRON_STATIC unsigned long gp3_cmd_header; CIMARRON_STATIC unsigned long gp3_cmd_top; CIMARRON_STATIC unsigned long gp3_cmd_bottom; CIMARRON_STATIC unsigned long gp3_cmd_current; CIMARRON_STATIC unsigned long gp3_cmd_next; CIMARRON_STATIC unsigned long gp3_blt_mode; CIMARRON_STATIC unsigned long gp3_vec_mode; CIMARRON_STATIC unsigned long gp3_raster_mode; CIMARRON_STATIC unsigned long gp3_pix_shift; CIMARRON_STATIC unsigned long gp3_ch3_pat; CIMARRON_STATIC unsigned long gp3_blt; CIMARRON_STATIC unsigned long gp3_blt_flags; CIMARRON_STATIC unsigned long gp3_src_stride; CIMARRON_STATIC unsigned long gp3_dst_stride; CIMARRON_STATIC unsigned long gp3_src_format; CIMARRON_STATIC unsigned long gp3_src_pix_shift; CIMARRON_STATIC unsigned long gp3_pat_format; CIMARRON_STATIC unsigned long gp3_pat_pix_shift; CIMARRON_STATIC unsigned long gp3_fb_base; CIMARRON_STATIC unsigned long gp3_vector_pattern_color; CIMARRON_STATIC unsigned long gp3_scratch_base; CIMARRON_STATIC unsigned long gp3_base_register; CIMARRON_STATIC unsigned long gp3_vec_pat; /*--------------------------------------------------------------------------- * gp_set_limit_on_buffer_lead * * This routine is used to specify the maximum number of bytes in the command * buffer by which software can lead the graphics processor. When declaring * a BLT with the CIMGP_BLTFLAGS_LIMITBUFFER flag set, Cimarron will wait * until the command buffer read and write pointers differ by no more than * 'lead' bytes. This can be useful to limit the time lag possible when * creating a command buffer full of simple BLT commands. *-------------------------------------------------------------------------*/ void gp_set_limit_on_buffer_lead(unsigned long lead) { gp3_buffer_lead = lead; } /*--------------------------------------------------------------------------- * gp_set_command_buffer_base * * This routine is used to program the command buffer region in physical * memory. The command buffer start address must be 1MB aligned. start and * stop refer to endpoints within the associated 16MB region. Command buffers * larger than 16MB are not supported. *-------------------------------------------------------------------------*/ void gp_set_command_buffer_base(unsigned long address, unsigned long start, unsigned long stop) { Q_WORD msr_value; /* WAIT FOR IDLE */ /* Obviously, we cannot change the command buffer pointer while the GP */ /* is currently fetching commands. */ gp_wait_until_idle(); /* WRITE THE COMMAND BUFFER BASE */ msr_read64(MSR_DEVICE_GEODELX_GP, MSR_GEODELINK_CONFIG, &msr_value); msr_value.low &= 0xF000FFFF; msr_value.low |= (address >> 4) & 0x0FFF0000; msr_write64(MSR_DEVICE_GEODELX_GP, MSR_GEODELINK_CONFIG, &msr_value); /* WRITE THE BASE OFFSETS */ /* We also reset the write and read pointers. The hardware will */ /* automatically update the write pointer when the read pointer */ /* is updated to prevent the hardware from getting confused when */ /* initializing a new command buffer. */ WRITE_GP32(GP3_CMD_TOP, start); WRITE_GP32(GP3_CMD_BOT, stop); WRITE_GP32(GP3_CMD_READ, start); /* SAVE THE BASE ADDRESSES */ /* These are used to determine the appropriate wrap point. */ gp3_cmd_current = gp3_cmd_top = start; gp3_cmd_bottom = stop; } /*--------------------------------------------------------------------------- * gp_set_frame_buffer_base * * This routine is used to program the base address of the frame buffer in * physical memory. The frame buffer address must be 16MB aligned. Cimarron * tracks the base address because the maximum frame buffer size may exceed * 16MB. Any primitive will thus program the corresponding 16MB region into * all base offset registers as well as program the offset into the 16MB * region. The size parameter is provided to allow Cimarron to claim the * last 1MB of space to be used as a scratch area for workarounds or * expanded functionality. *-------------------------------------------------------------------------*/ void gp_set_frame_buffer_base(unsigned long address, unsigned long size) { gp3_scratch_base = size - GP3_SCRATCH_BUFFER_SIZE; gp3_fb_base = address >> 24; gp3_base_register = (gp3_fb_base << 24) | (gp3_fb_base << 14) | (gp3_fb_base << 4); WRITE_GP32(GP3_BASE_OFFSET, gp3_base_register); } /*--------------------------------------------------------------------------- * gp_set_bpp * * This routine sets the output BPP of the GP. The BPP used by the GP does * not have to match the display BPP, but that is usually the case. The * supported BPP values are as follows: * * 8 - palettized 8BPP * 12 - 4:4:4:4 * 15 - 1:5:5:5 * 16 - 0:5:6:5 * 32 - 8:8:8:8 *-------------------------------------------------------------------------*/ void gp_set_bpp(int bpp) { /* STORE BPP */ /* The bpp is not updated until the next call to gp_set_raster_mode. */ /* This allows the gp_set_bpp call to happen outside of a BLT. It */ /* also implies that no registers need be written in this routine. */ switch (bpp) { case 8: gp3_bpp = GP3_RM_BPPFMT_332; gp3_ch3_bpp = GP3_CH3_SRC_3_3_2; gp3_pix_shift = 0; break; case 12: gp3_bpp = GP3_RM_BPPFMT_4444; gp3_ch3_bpp = GP3_CH3_SRC_4_4_4_4; gp3_pix_shift = 1; break; case 15: gp3_bpp = GP3_RM_BPPFMT_1555; gp3_ch3_bpp = GP3_CH3_SRC_1_5_5_5; gp3_pix_shift = 1; break; case 16: gp3_bpp = GP3_RM_BPPFMT_565; gp3_ch3_bpp = GP3_CH3_SRC_0_5_6_5; gp3_pix_shift = 1; break; case 24: case 32: gp3_bpp = GP3_RM_BPPFMT_8888; gp3_ch3_bpp = GP3_CH3_SRC_8_8_8_8; gp3_pix_shift = 2; break; default: gp3_bpp = GP3_RM_BPPFMT_332; gp3_ch3_bpp = GP3_CH3_SRC_3_3_2; gp3_pix_shift = 0; break; } } /*--------------------------------------------------------------------------- * gp_declare_blt * * This routine is used to prepare for a 2D BLT. Its primary function * is to verify that enough room is available in the command buffer * to hold a BLT command. This command can be called multiple times if * necessary. For example, if a function calls this routine on entry, but * later realizes that a LUT load command must be executed before the BLT, * the application could call gp_set_color_pattern and then call * gp_declare_blt to declare the BLT. This is possible because the hardware * buffer pointer is not updated until a new BLT is actually executed. An * application must take care not to call any routines that perform a buffer * command, (such as gp_set_color_pattern) between gp_declare_blt and the * routines used to program the BLT parameters. In addition to checking for * available space, this routine also performs the following actions: * - Sets the wrap bit if this BLT will pass close to the end of the * buffer. * - Writes the command header. * * The available flags are defined as follows: * 0x01 - Preserve the LUT * 0x02 - Preserve the color pattern. * 0x04 - Enable prefetch. *-------------------------------------------------------------------------*/ void gp_declare_blt(unsigned long flags) { unsigned long temp; gp3_blt = 1; gp3_blt_flags = flags; /* SET ADDRESS OF NEXT COMMAND */ /* A summary of the command buffer logic is as follows: */ /* - If after a basic BLT we will not have room for the largest */ /* command (a full line of host source data), we set the wrap */ /* bit. This will waste up to a whopping 8K of command buffer */ /* space, but it simplifies the logic for all commands. */ /* - If we are wrapping, we have extra logic to ensure that we */ /* don't skip over the current GP read pointer. */ gp3_cmd_next = gp3_cmd_current + GP3_BLT_COMMAND_SIZE; /* CHECK WRAP CONDITION */ if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; gp3_cmd_header = GP3_BLT_HDR_TYPE | GP3_BLT_HDR_WRAP; /* WAIT FOR HARDWARE */ /* When wrapping, we must take steps to ensure that we do not */ /* wrap over the current hardware read pointer. We do this by */ /* verifying that the hardware is not between us and the end of */ /* the command buffer. We also have a special case to make sure */ /* that the hardware is not currently reading the top of the */ /* command buffer. */ GP3_WAIT_WRAP(temp); } else { gp3_cmd_header = GP3_BLT_HDR_TYPE; /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); } if (flags & CIMGP_BLTFLAGS_LIMITBUFFER) { while (1) { temp = READ_GP32(GP3_CMD_READ); if (((gp3_cmd_current >= temp) && ((gp3_cmd_current - temp) <= gp3_buffer_lead)) || ((gp3_cmd_current < temp) && ((gp3_cmd_current + (gp3_cmd_bottom - temp)) <= gp3_buffer_lead))) { break; } } } /* SET THE CURRENT BUFFER POINTER */ /* We initialize a pointer to the current buffer base to avoid an */ /* extra addition for every buffer write. */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* SET THE HAZARD BIT */ if (flags & CIMGP_BLTFLAGS_HAZARD) gp3_cmd_header |= GP3_BLT_HDR_HAZARD_ENABLE; } /*--------------------------------------------------------------------------- * gp_declare_vector * * This routine is used to prepare for a 2D vector. It has no other function * except to verify that enough room is available in the command buffer * to hold a vector command. The same rules that apply to BLTs apply to * vectors. (See the documentation for gp_declare_blt). *-------------------------------------------------------------------------*/ void gp_declare_vector(unsigned long flags) { unsigned long temp; gp3_blt = 0; gp3_blt_flags = flags; /* SET ADDRESS OF NEXT COMMAND */ /* The logic to force a wrap during a vector is identical */ /* to the BLT logic. */ /* ALLOCATE SPACE FOR AN ADDITIONAL VECTOR TO CLEAR THE BYTE ENABLES */ gp3_cmd_next = gp3_cmd_current + GP3_VECTOR_COMMAND_SIZE + GP3_VECTOR_COMMAND_SIZE + 32; /* CHECK WRAP CONDITION */ if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; gp3_cmd_header = GP3_VEC_HDR_TYPE | GP3_VEC_HDR_WRAP; /* CHECK WRAP CONDITION */ GP3_WAIT_WRAP(temp); } else { gp3_cmd_header = GP3_VEC_HDR_TYPE; /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); gp3_cmd_next -= GP3_VECTOR_COMMAND_SIZE + 32; } if (flags & CIMGP_BLTFLAGS_LIMITBUFFER) { while (1) { temp = READ_GP32(GP3_CMD_READ); if (((gp3_cmd_current >= temp) && ((gp3_cmd_current - temp) <= gp3_buffer_lead)) || ((gp3_cmd_current < temp) && ((gp3_cmd_current + (gp3_cmd_bottom - temp)) <= gp3_buffer_lead))) { break; } } } cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* SET THE HAZARD BIT */ if (flags & CIMGP_BLTFLAGS_HAZARD) gp3_cmd_header |= GP3_VEC_HDR_HAZARD_ENABLE; } /*--------------------------------------------------------------------------- * gp_write_parameters * * This routine is called to write all recent parameters to the hardware. * This routine is necessary for any implementation that performs the setup * for a BLT separate from the actual BLT. An example would be a driver * that prepares for multiple pattern fills by programming the ROP, * pattern color and destination stride. The driver might then perform * repeated pattern fills with minimal effort. *-------------------------------------------------------------------------*/ void gp_write_parameters(void) { /* WRITE THE COMMAND HEADER */ /* Command header is at offset 0 for BLTs and vectors */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); /* INCREMENT THE CURRENT WRITE POINTER */ gp3_cmd_current = gp3_cmd_next; /* UPDATE THE GP WRITE POINTER */ WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_current); } /*--------------------------------------------------------------------------- * gp_set_raster_operation * * This is generally the first routine called when programming a BLT. This * routine performs the following functions: * - Sets the initial value of the GP3_RASTER_MODE register in the buffer. * - Clears any 8x8 pattern if the ROP does not involve pattern data. *-------------------------------------------------------------------------*/ void gp_set_raster_operation(unsigned char ROP) { gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE; /* WRITE THE RASTER MODE REGISTER */ /* This register is in the same location in BLT and vector commands */ gp3_raster_mode = gp3_bpp | (unsigned long) ROP; WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_raster_mode); /* CHECK IF DESTINATION IS REQUIRED */ if ((ROP & 0x55) ^ ((ROP >> 1) & 0x55)) { gp3_blt_mode = GP3_BM_DST_REQ; gp3_vec_mode = GP3_VM_DST_REQ; } else { gp3_blt_mode = gp3_vec_mode = 0; } } /*---------------------------------------------------------------------------- * gp_set_alpha_operation * * BLTs are generally one of two types, a ROPed BLT or a BLT composited using * alpha blending. For the latter, this routine is used to configure the * mathematical function used to create the blended output. This routine * should generally be called first when programming a BLT. The available * parameters mirror the hardware and are described as follows: * * alpha_operation = * 0 - alpha * A * 1 - (1 - alpha) * B * 2 - A + (1 - alpha)*B * 3 - alpha*A + (1 - alpha)*B * * alpha_type = * 0 - alpha component of channel A * 1 - alpha component of channel B * 2 - Constant alpha * 3 - Constant 1 * 4 - The color components of channel A * 5 - The color components of channel B * 6 - Alpha comes from the alpha channel of the source before the source * undergoes color conversion. * * channel = * 0 - Channel A = source, channel B = destination * 1 - Channel B = source, channel A = destination * * apply_alpha = * 1 - Apply alpha blend to only the RGB portion of the pixel. This must be * set when the source or destination format do not include an alpha * channel. * 2 - Apply alpha blend only to the alpha portion of the pixel. This * implies that both destination and source include an alpha channel. * 3 - Apply alpha blend to both the RGB and alpha portions of the pixel. * * Alpha-blended vectors are not currently supported. *-------------------------------------------------------------------------*/ void gp_set_alpha_operation(int alpha_operation, int alpha_type, int channel, int apply_alpha, unsigned char alpha) { gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE; /* THE AVAILABLE ALPHA DEFINITIONS FOLLOW THE HARDWARE */ /* This allows us to avoid giant switch structures, but it */ /* also implies that there is no mechanism to detect invalid */ /* parameters. */ gp3_raster_mode = gp3_bpp | (unsigned long) alpha | ((unsigned long) apply_alpha << 22) | ((unsigned long) alpha_operation << 20) | ((unsigned long) alpha_type << 17) | ((unsigned long) channel << 16); WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_raster_mode); /* CHECK IF DESTINATION IS REQUIRED */ if ((alpha_operation == CIMGP_ALPHA_TIMES_A && channel == CIMGP_CHANNEL_A_SOURCE && alpha_type != CIMGP_CHANNEL_B_ALPHA && alpha_type != CIMGP_ALPHA_FROM_RGB_B) || (alpha_operation == CIMGP_BETA_TIMES_B && channel == CIMGP_CHANNEL_A_DEST && alpha_type != CIMGP_CHANNEL_A_ALPHA && alpha_type != CIMGP_ALPHA_FROM_RGB_A)) { gp3_blt_mode = 0; } else gp3_blt_mode = GP3_BM_DST_REQ; } /*--------------------------------------------------------------------------- * gp_set_solid_pattern * * This routine is called to program the hardware for a solid pattern. It * need not be called for any other reason. As a side effect, this routine * will clear any 8x8 pattern data. *-------------------------------------------------------------------------*/ void gp_set_solid_pattern(unsigned long color) { /* CHANNEL 3 IS NOT NEEDED FOR SOLID PATTERNS */ gp3_ch3_pat = 0; /* SET SOLID PATTERN IN COMMAND BUFFER */ /* We are assuming that only one pattern type is ever set for a */ /* BLT. We are also assuming that gp_set_raster_operation will */ /* be called before this routine. With these assumptions, we */ /* will thus never have to change the raster mode register for */ /* solid patterns. */ if (gp3_blt) { gp3_cmd_header |= GP3_BLT_HDR_PAT_CLR0_ENABLE; WRITE_COMMAND32(GP3_BLT_PAT_COLOR_0, color); } else { gp3_cmd_header |= GP3_VEC_HDR_PAT_CLR0_ENABLE; WRITE_COMMAND32(GP3_VECTOR_PAT_COLOR_0, color); } } /*--------------------------------------------------------------------------- * gp_set_mono_pattern * * This routine is called to program the hardware for a monochrome pattern. * As a side effect, this routine will clear any 8x8 pattern data. *-------------------------------------------------------------------------*/ void gp_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, int transparent, int x, int y) { /* CHANNEL 3 IS NOT NEEDED FOR MONOCHROME PATTERNS */ gp3_ch3_pat = 0; /* UPDATE RASTER MODE REGISTER */ if (transparent) gp3_raster_mode |= GP3_RM_PAT_MONO | GP3_RM_PAT_TRANS; else gp3_raster_mode |= GP3_RM_PAT_MONO; gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE; WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_raster_mode); /* SET MONOCHROME PATTERN DATA AND COLORS */ if (gp3_blt) { gp3_cmd_header |= (GP3_BLT_HDR_PAT_CLR0_ENABLE | GP3_BLT_HDR_PAT_CLR1_ENABLE | GP3_BLT_HDR_PAT_DATA0_ENABLE | GP3_BLT_HDR_PAT_DATA1_ENABLE); WRITE_COMMAND32(GP3_BLT_PAT_COLOR_0, bgcolor); WRITE_COMMAND32(GP3_BLT_PAT_COLOR_1, fgcolor); WRITE_COMMAND32(GP3_BLT_PAT_DATA_0, data0); WRITE_COMMAND32(GP3_BLT_PAT_DATA_1, data1); } else { gp3_cmd_header |= (GP3_VEC_HDR_PAT_CLR0_ENABLE | GP3_VEC_HDR_PAT_CLR1_ENABLE | GP3_VEC_HDR_PAT_DATA0_ENABLE | GP3_VEC_HDR_PAT_DATA1_ENABLE); WRITE_COMMAND32(GP3_VECTOR_PAT_COLOR_0, bgcolor); WRITE_COMMAND32(GP3_VECTOR_PAT_COLOR_1, fgcolor); WRITE_COMMAND32(GP3_VECTOR_PAT_DATA_0, data0); WRITE_COMMAND32(GP3_VECTOR_PAT_DATA_1, data1); } /* SAVE PATTERN ORIGIN */ gp3_pat_origin = ((unsigned long) y << 29) | (((unsigned long) x & 7) << 26); } /*--------------------------------------------------------------------------- * gp_set_pattern_origin * * This routine overrides the pattern origins set in gp_set_mono_pattern or * gp_set_color_pattern. It is generally used to override the original * pattern origin due to a change in clipping. *-------------------------------------------------------------------------*/ void gp_set_pattern_origin(int x, int y) { /* SAVE PATTERN ORIGIN */ gp3_pat_origin = ((unsigned long) y << 29) | (((unsigned long) x & 7) << 26); } /*--------------------------------------------------------------------------- * gp_set_color_pattern * * This routine is called to program a 8x8 color pattern into the LUT * hardware. Unlike the other pattern routines, this routine must be called * before any gp_declare_xxxx routines. The pattern that is programmed into * the hardware will stay persistent for all subsequent primitives until one * of the following conditions happens. * - Another pattern type is programmed. * - A color-conversion BLT rotation BLT. *-------------------------------------------------------------------------*/ void gp_set_color_pattern(unsigned long *pattern, int format, int x, int y) { unsigned long size_dwords, temp; gp3_ch3_pat = 1; /* SAVE COLOR PATTERN SOURCE INFO * Color patterns can be in a format different than the primary display. * 4BPP patterns are not supported. */ gp3_pat_pix_shift = (unsigned long) ((format >> 2) & 3); gp3_pat_format = (((unsigned long) format & 0xF) << 24) | (((unsigned long) format & 0x10) << 17) | GP3_CH3_COLOR_PAT_ENABLE | GP3_CH3_C3EN; size_dwords = (64 << gp3_pat_pix_shift) >> 2; /* CHECK FOR WRAP AFTER LUT LOAD */ /* Primitive size is 12 plus the amount of data. */ gp3_cmd_next = gp3_cmd_current + (size_dwords << 2) + 12; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; gp3_cmd_header = GP3_LUT_HDR_TYPE | GP3_LUT_HDR_WRAP | GP3_LUT_HDR_DATA_ENABLE; /* WAIT FOR HARDWARE */ /* Same logic as BLT wrapping. */ GP3_WAIT_WRAP(temp); } else { gp3_cmd_header = GP3_LUT_HDR_TYPE | GP3_LUT_HDR_DATA_ENABLE; /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); } /* SAVE CURRENT BUFFER POINTER */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* PREPARE FOR COMMAND BUFFER DATA WRITES */ /* Pattern data is contiguous DWORDs at LUT address 0x100 */ WRITE_COMMAND32(0, gp3_cmd_header); WRITE_COMMAND32(4, 0x100); WRITE_COMMAND32(8, size_dwords | GP3_LUT_DATA_TYPE); /* WRITE ALL DATA */ WRITE_COMMAND_STRING32(12, pattern, 0, size_dwords); /* START OPERATION */ WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; /* SAVE PATTERN ORIGIN */ gp3_pat_origin = ((unsigned long) y << 29) | (((unsigned long) x & 7) << 26); } /*--------------------------------------------------------------------------- * gp_set_mono_source * * This routine is called to program the colors for monochrome source data. *-------------------------------------------------------------------------*/ void gp_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, int transparent) { /* UPDATE RASTER MODE REGISTER IF TRANSPARENT */ if (transparent) { gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE; gp3_raster_mode |= GP3_RM_SRC_TRANS; WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_raster_mode); } /* SET MONOCHROME SOURCE COLORS */ /* Note that this routine only sets the colors. The actual */ /* source type is determined by the final output routine */ /* (gp_mono_bitmap_xxx, gp_color_bitmap_xxx, etc.) */ gp3_cmd_header |= GP3_BLT_HDR_SRC_FG_ENABLE | GP3_BLT_HDR_SRC_BG_ENABLE; WRITE_COMMAND32(GP3_BLT_SRC_COLOR_FG, fgcolor); WRITE_COMMAND32(GP3_BLT_SRC_COLOR_BG, bgcolor); } /*--------------------------------------------------------------------------- * gp_set_solid_source * * This routine is called to program a solid source color. A solid source * color is used primarily for vectors or antialiased text. *-------------------------------------------------------------------------*/ void gp_set_solid_source(unsigned long color) { /* SET SOLID SOURCE COLOR */ /* The solid source register is in the same place for both BLTs and */ /* vectors. */ gp3_cmd_header |= GP3_BLT_HDR_SRC_FG_ENABLE; WRITE_COMMAND32(GP3_BLT_SRC_COLOR_FG, color); } /*--------------------------------------------------------------------------- * gp_set_source_transparency * * This routine sets the source transparency and mask to be used in future * rendering operations. Transparency is cleared by gp_set_raster_operation, * so this routine should never be called first. *-------------------------------------------------------------------------*/ void gp_set_source_transparency(unsigned long color, unsigned long mask) { gp3_raster_mode |= GP3_RM_SRC_TRANS; gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE | GP3_BLT_HDR_SRC_FG_ENABLE | GP3_BLT_HDR_SRC_BG_ENABLE; WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_raster_mode); WRITE_COMMAND32(GP3_BLT_SRC_COLOR_FG, color); WRITE_COMMAND32(GP3_BLT_SRC_COLOR_BG, mask); } /*--------------------------------------------------------------------------- * gp_program_lut * * This routine is called to program the hardware LUT with color-conversion * information. This routine should be called before any gp_declare_xxxx * routines. * * colors - Pointer to an array of DWORDs for color expansion. * * full_lut - Selector between 4BPP and 8BPP expansion. The hardware is * initialized with 16 dwords for 4BPP expansion and 256 dwords * for 8BPP expansion. *-------------------------------------------------------------------------*/ void gp_program_lut(unsigned long *colors, int full_lut) { unsigned long size_dwords, temp; /* SIZE IS EITHER 16 DWORDS (4BPP) or 256 DWORDS (8BPP) */ if (full_lut) size_dwords = 256; else size_dwords = 16; /* CHECK FOR WRAP AFTER LUT LOAD */ /* Primitive size is 12 plus the amount of data. */ gp3_cmd_next = gp3_cmd_current + (size_dwords << 2) + 12; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; gp3_cmd_header = GP3_LUT_HDR_TYPE | GP3_LUT_HDR_WRAP | GP3_LUT_HDR_DATA_ENABLE; /* WAIT FOR HARDWARE */ /* Same logic as BLT wrapping. */ GP3_WAIT_WRAP(temp); } else { gp3_cmd_header = GP3_LUT_HDR_TYPE | GP3_LUT_HDR_DATA_ENABLE; /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); } /* SAVE CURRENT BUFFER POINTER */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* PREPARE FOR COMMAND BUFFER DATA WRITES */ /* Pattern data is contiguous DWORDs at LUT address 0 */ WRITE_COMMAND32(0, gp3_cmd_header); WRITE_COMMAND32(4, 0); WRITE_COMMAND32(8, (size_dwords | GP3_LUT_DATA_TYPE)); /* WRITE ALL DATA */ WRITE_COMMAND_STRING32(12, colors, 0, size_dwords); /* START OPERATION */ WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } /*--------------------------------------------------------------------------- * gp_set_vector_pattern * * This routine is called to program the hardware LUT with a vector pattern. * A vector pattern is programmed as a 32-bit mask that specifies a * transparency pattern. A length parameter is used to specify patterns * smaller than 32. Note that vectors in Geode LX do not continue across * corners. The beginning of each vector will always begin with bit 0 of the * vector pattern. It is the responsibility of the caller to update the * pattern if an alternate behavior is desired. * * This routine faces the same restrictions of all routines that program * the LUT, in that it must be called before any gp_declare_xxxx routines, * it cannot be combined with an 8x8 color pattern, color conversion or * rotation. *-------------------------------------------------------------------------*/ void gp_set_vector_pattern(unsigned long pattern, unsigned long color, int length) { unsigned long temp, mask; gp3_ch3_pat = 1; gp3_vector_pattern_color = color; /* CREATE SUITABLE PATTERN MASK */ /* The GP requires a minimum of four pixels in a vector pattern. We */ /* can get around this restriction by doubling any patterns smaller */ /* than 4 pixels. */ while (length < 4) { mask = 0xFFFFFFFF >> (32 - length); pattern = (pattern << length) | (pattern & mask); length <<= 1; } mask = 0xFFFFFFFF >> (32 - length); gp3_vec_pat = pattern; /* CHECK FOR WRAP AFTER LUT LOAD */ gp3_cmd_next = gp3_cmd_current + GP3_VECTOR_PATTERN_COMMAND_SIZE; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; gp3_cmd_header = GP3_LUT_HDR_TYPE | GP3_LUT_HDR_WRAP | GP3_LUT_HDR_DATA_ENABLE; /* WAIT FOR HARDWARE */ /* Same logic as BLT wrapping. */ GP3_WAIT_WRAP(temp); } else { gp3_cmd_header = GP3_LUT_HDR_TYPE | GP3_LUT_HDR_DATA_ENABLE; /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); } /* SAVE CURRENT BUFFER POINTER */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* PREPARE FOR COMMAND BUFFER DATA WRITES */ /* Pattern data is 2 DWORDs at 0x100 and 0x101 */ WRITE_COMMAND32(0, gp3_cmd_header); WRITE_COMMAND32(4, 0x100); WRITE_COMMAND32(8, (2 | GP3_LUT_DATA_TYPE)); WRITE_COMMAND32(12, pattern); WRITE_COMMAND32(16, mask); /* START OPERATION */ WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } /*--------------------------------------------------------------------------- * gp_set_strides * * This routine is called to program the pitch between successive lines of * data in the frame buffer. The strides should be DWORD aligned and less * than 64K. These restrictions are not checked by the API. *-------------------------------------------------------------------------*/ void gp_set_strides(unsigned long dst_stride, unsigned long src_stride) { /* SAVE STRIDES */ /* The source stride may be needed later for channel 3 source data and */ /* we may need to use these strides in calculations. */ gp3_src_stride = src_stride; gp3_dst_stride = dst_stride; /* ENABLE STRIDES */ /* The stride register is in the same place for BLTs and vectors */ gp3_cmd_header |= GP3_BLT_HDR_STRIDE_ENABLE; WRITE_COMMAND32(GP3_BLT_STRIDE, ((src_stride << 16) | dst_stride)); } /*--------------------------------------------------------------------------- * gp_set_source_format * * This routine is used to program the format of source data used in * subsequent color-conversion or rotation operations. Note that 4BPP * indexed and 8BPP indexed source formats cannot be used when rotating, as * the LUT will be destroyed. These formats also cannot be combined with an * 8x8 color pattern. The supported formats mirror the hardware and are * described as follows: * * 0 - 8BPP 3:3:2 * 1 - 8BPP indexed * 4 - 16BPP 4:4:4:4 * 5 - 16BPP 1:5:5:5 * 6 - 16BPP 5:6:5 * 7 - 16BPP YUV * 8 - 32BPP 8:8:8:8 * 13 - 4BPP indexed * 20 - 16BPP 4:4:4:4 BGR * 21 - 16BPP 1:5:5:5 BGR * 22 - 16BPP 0:5:6:5 BGR * 24 - 32BPP 8:8:8:8 BGR *-------------------------------------------------------------------------*/ void gp_set_source_format(int format) { /* SAVE FORMAT */ /* We will combine the source format later when doing color conversion. */ /* We also save the pixel size for host source calculations. */ /* Conveniently, the source formats are organized such that the upper */ /* two bits of the nibble represent the pixel shift, with a pixel shift */ /* of 3 being a special case for 4BPP data. Clever, yes? Even more */ /* clever, bit 4 indicates BGR ordering. */ gp3_src_pix_shift = (unsigned long) ((format >> 2) & 3); gp3_src_format = (((unsigned long) format & 0xF) << 24) | (((unsigned long) format & 0x10) << 18); } /*--------------------------------------------------------------------------- * gp_pattern_fill * * This routine is called to perform a simple pattern fill. The pattern * can be solid, monochrome or a preprogrammed 8x8 color pattern. If * the ROP involves source data, that source data will be constant. *-------------------------------------------------------------------------*/ void gp_pattern_fill(unsigned long dstoffset, unsigned long width, unsigned long height) { unsigned long base_register; base_register = (gp3_base_register & ~GP3_BASE_OFFSET_DSTMASK) | ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000)); /* ENABLE RELEVANT REGISTERS */ /* Note that we always enable and write the channel 3 mode, if only */ /* to turn it off. Cimarron also always writes the base offset */ /* register to allow operation with frame buffers larger than 16MB. */ gp3_cmd_header |= GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; /* WRITE THE REGISTERS COMMON TO ALL PATTERN TYPES */ /* The destination base is the frame buffer base plus whatever */ /* 4MB segment we happen to be BLTing to. */ WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, ((width << 16) | height)); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base_register); /* CHECK 8X8 COLOR PATTERN CASE */ if (gp3_ch3_pat) { /* SET CHANNEL 3 PATTERN ORIGINS */ gp3_cmd_header |= GP3_BLT_HDR_CH3_OFF_ENABLE; /* INITIALIZE CHANNEL 3 PARAMETERS */ WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, ((width << 16) | height)); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, gp3_pat_origin); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, dstoffset & 0x3FFFFF); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, gp3_pat_format); } else { /* DISABLE CHANNEL 3 AND USE NORMAL PATTERN ORIGINS */ WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, 0); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, ((dstoffset & 0x3FFFFF) | gp3_pat_origin)); } /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_COMMAND32(GP3_BLT_MODE, gp3_blt_mode); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } /*--------------------------------------------------------------------------- * gp_screen_to_screen_blt * * This routine is called to perform a BLT from one location inside video * memory to another location inside video memory. The source and destination * formats are assumed to be the current BPP. Whenever possible, this routine * tries to use channel 3 to fetch source data. The BLT flags can affect this * behavior in the following ways: * CIMGP_BLTFLAGS_PRES_COLOR_PAT * A color pattern is being stored in the channel 3 buffer. It is either * being stored for a later BLT or being combined with the current source * data. Channel 3 cannot be used to fetch source data or the pattern * will be overwritten. * CIMGP_BLTFLAGS_PRES_LUT * If the first flag is not set, this flag will limit the use of the * channel 3 buffer to 1K. *-------------------------------------------------------------------------*/ void gp_screen_to_screen_blt(unsigned long dstoffset, unsigned long srcoffset, unsigned long width, unsigned long height, int flags) { unsigned long base; unsigned long ch3_flags = 0; unsigned long blt_mode = gp3_blt_mode; unsigned long size = ((width << 16) | height); unsigned long dstbase, srcbase; /* CALCULATE BASE OFFSETS */ /* We need to set the 4MB aligned base offsets before we add offsets */ /* for negative BLTs. */ srcbase = srcoffset & 0xFFC00000; dstbase = dstoffset & 0xFFC00000; srcoffset &= 0x3FFFFF; dstoffset &= 0x3FFFFF; /* ADJUST OFFSETS BASED ON FLAGS */ /* We adjust the source and destination offsets to point to the first */ /* byte of the first pixel of the BLT. This routine assumes that the */ /* source and destination regions do not wrap past the end of a 16MB */ /* region. */ if (flags & CIMGP_NEGXDIR) { srcoffset += (width << gp3_pix_shift) - 1; dstoffset += (width << gp3_pix_shift) - 1; blt_mode |= GP3_BM_NEG_XDIR; ch3_flags |= GP3_CH3_NEG_XDIR; } if (flags & CIMGP_NEGYDIR) { srcoffset += (height - 1) * gp3_src_stride; dstoffset += (height - 1) * gp3_dst_stride; blt_mode |= GP3_BM_NEG_YDIR; ch3_flags |= GP3_CH3_NEG_YDIR; } /* BRANCH BASED ON CHANNEL 3 */ /* If a color pattern is not being saved or used, channel 3 will */ /* be used to fetch source for maximum throughput. Channel 3 */ /* is not used if transparency or alpha blending is enabled. */ if (!(gp3_blt_flags & CIMGP_BLTFLAGS_PRES_COLOR_PAT) && !(gp3_raster_mode & GP3_RM_SRC_TRANS) && !(flags & CIMGP_NEGYDIR)) { base = ((gp3_fb_base << 24) + dstbase) | ((gp3_fb_base << 4) + (srcbase >> 20)) | (gp3_base_register & GP3_BASE_OFFSET_SRCMASK); gp3_cmd_header |= GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; WRITE_COMMAND32(GP3_BLT_DST_OFFSET, (dstoffset | gp3_pat_origin)); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, srcoffset); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, size); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE | gp3_ch3_bpp | gp3_src_stride | ch3_flags | ((gp3_blt_flags & CIMGP_ENABLE_PREFETCH) << 17) | ((gp3_blt_flags & CIMGP_BLTFLAGS_PRES_LUT) << 20)); } else { /* CALCULATE BASE OFFSET REGISTER */ base = ((gp3_fb_base << 24) + dstbase) | ((gp3_fb_base << 14) + (srcbase >> 10)) | (gp3_base_register & GP3_BASE_OFFSET_CH3MASK); /* PROGRAM THE NORMAL SOURCE CHANNEL REGISTERS */ /* We assume that a color pattern is being ROPed with source */ /* data if the pattern type is color and the preserve pattern */ /* was set. */ blt_mode |= GP3_BM_SRC_FB; gp3_cmd_header |= GP3_BLT_HDR_SRC_OFF_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; if (gp3_ch3_pat) { WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, gp3_pat_origin); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, dstoffset); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, gp3_pat_format | ch3_flags); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, size); } else { WRITE_COMMAND32(GP3_BLT_DST_OFFSET, dstoffset | gp3_pat_origin); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, 0); } WRITE_COMMAND32(GP3_BLT_SRC_OFFSET, srcoffset); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); } /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_COMMAND32(GP3_BLT_MODE, blt_mode); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } /*--------------------------------------------------------------------------- * gp_screen_to_screen_convert * * This routine is called to color-convert a rectangular region of the frame * buffer into the current BPP. The format of the source region is programmed * by gp_set_source_format. *-------------------------------------------------------------------------*/ void gp_screen_to_screen_convert(unsigned long dstoffset, unsigned long srcoffset, unsigned long width, unsigned long height, int nibble) { unsigned long size = ((width << 16) | height); unsigned long ch3_offset = srcoffset & 0x3FFFFF; unsigned long ch3_size, base; base = ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000)) | ((gp3_fb_base << 4) + ((srcoffset & 0xFFC00000) >> 20)) | (gp3_base_register & GP3_BASE_OFFSET_SRCMASK); /* SET NIBBLE FOR 4BPP */ /* 4BPP is a special case in that it requires subpixel addressing. The */ /* user must supply this information via the nibble parameter. This */ /* parameter is ignored for every other source format. */ ch3_size = size; if (gp3_src_pix_shift == 3) ch3_offset |= ((nibble & 1) << 25); else if ((gp3_src_format & GP3_CH3_SRC_MASK) == GP3_CH3_SRC_24BPP_PACKED) ch3_size = ((((width * 3) + 3) >> 2) << 16) | height; /* SET APPROPRIATE ENABLES */ gp3_cmd_header |= GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; /* WRITE ALL BLT REGISTERS */ WRITE_COMMAND32(GP3_BLT_DST_OFFSET, (dstoffset & 0x3FFFFF) | gp3_pat_origin); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, ch3_size); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, ch3_offset); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE | gp3_src_format | ((gp3_blt_flags & CIMGP_BLTFLAGS_PRES_LUT) << 20) | ((gp3_blt_flags & CIMGP_ENABLE_PREFETCH) << 17) | gp3_src_stride); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_COMMAND32(GP3_BLT_MODE, gp3_blt_mode); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } /*--------------------------------------------------------------------------- * gp_color_bitmap_to_screen_blt * * This routine is called to BLT data from system memory into the frame * buffer. 'srcy' is deliberately omitted to prevent extra calculations for * simple applications that have no source indexes. *-------------------------------------------------------------------------*/ void gp_color_bitmap_to_screen_blt(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned char *data, long pitch) { unsigned long indent, temp; unsigned long total_dwords, size_dwords; unsigned long dword_count, byte_count; unsigned long size = ((width << 16) | height); unsigned long srcoffset; /* ASSUME BITMAPS ARE DWORD ALIGNED */ /* We will offset into the source data in DWORD increments. We */ /* set the source index to the remaining byte offset and */ /* increment the size of each line to account for the dont-care */ /* pixel(s). */ indent = srcx << gp3_pix_shift; srcoffset = (indent & ~3L); indent &= 3; /* PROGRAM THE NORMAL SOURCE CHANNEL REGISTERS */ /* We assume that a color pattern is being ROPed with source */ /* data if the pattern type is color and the preserve pattern */ /* was set. */ gp3_cmd_header |= GP3_BLT_HDR_SRC_OFF_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; if (gp3_ch3_pat) { gp3_cmd_header |= GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE; WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, gp3_pat_origin); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, (dstoffset & 0x3FFFFF)); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, gp3_pat_format); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, size); } else { WRITE_COMMAND32(GP3_BLT_DST_OFFSET, ((dstoffset & 0x3FFFFF) | gp3_pat_origin)); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, 0); } WRITE_COMMAND32(GP3_BLT_SRC_OFFSET, indent); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000))); WRITE_COMMAND32(GP3_BLT_MODE, gp3_blt_mode | GP3_BM_SRC_HOST); /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; /* CALCULATE THE SIZE OF ONE LINE */ size = (width << gp3_pix_shift) + indent; total_dwords = (size + 3) >> 2; size_dwords = (total_dwords << 2) + 8; dword_count = (size >> 2); byte_count = (size & 3); /* CHECK FOR SMALL BLT CASE */ if (((total_dwords << 2) * height) <= GP3_BLT_1PASS_SIZE && (gp3_cmd_bottom - gp3_cmd_current) > (GP3_BLT_1PASS_SIZE + 72)) { /* UPDATE THE COMMAND POINTER */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + ((total_dwords << 2) * height) + 8; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_HOST_SOURCE_TYPE | (total_dwords * height)); while (height--) { /* WRITE DATA */ WRITE_COMMAND_STRING32(8, data, srcoffset, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), data, srcoffset + (dword_count << 2), byte_count); srcoffset += pitch; cim_cmd_ptr += total_dwords << 2; } WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } else { /* * Each line will be created as a separate command buffer entry to * allow line-by-line wrapping and to allow simultaneous rendering * by the HW. */ while (height--) { /* UPDATE THE COMMAND POINTER * The WRITE_COMMANDXX macros use a pointer to the current buffer * space. This is created by adding gp3_cmd_current to the base * pointer. */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + size_dwords; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; /* WAIT FOR HARDWARE */ GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_HOST_SOURCE_TYPE | total_dwords); /* WRITE DATA */ WRITE_COMMAND_STRING32(8, data, srcoffset, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), data, srcoffset + (dword_count << 2), byte_count); /* UPDATE POINTERS */ srcoffset += pitch; WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } } } /*--------------------------------------------------------------------------- * gp_color_convert_blt * * This routine is called to convert data that is stored in system memory * into the current graphics BPP. The source format is programmed in * gp_set_source_format. *-------------------------------------------------------------------------*/ void gp_color_convert_blt(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned char *data, long pitch) { unsigned long indent, temp; unsigned long total_dwords, size_dwords; unsigned long dword_count, byte_count; unsigned long size = ((width << 16) | height); unsigned long ch3_size; unsigned long ch3_offset, srcoffset; unsigned long base; /* ASSUME BITMAPS ARE DWORD ALIGNED */ /* We will offset into the source data in DWORD increments. We */ /* set the source index to the remaining byte offset and */ /* increment the size of each line to account for the dont-care */ /* pixel(s). For 4BPP source data, we also set the appropriate */ /* nibble index. */ /* CALCULATE THE SIZE OF ONE LINE */ if ((gp3_src_format & GP3_CH3_SRC_MASK) == GP3_CH3_SRC_24BPP_PACKED) { /* HANDLE 24BPP * Note that we do not do anything to guarantee that the source data * is DWORD aligned. The logic here is that the source data will be * cacheable, in which case Geode LX will not lose any clocks for * unaligned moves. Also note that the channel 3 width is * programmed as the number of dwords, while the normal width is * programmed as the number of pixels. */ srcoffset = srcx * 3; ch3_offset = 0; temp = width * 3; ch3_size = (((temp + 3) >> 2) << 16) | height; } else { ch3_size = size; if (gp3_src_pix_shift == 3) { /* CALCULATE INDENT AND SOURCE OFFSET */ indent = (srcx >> 1); srcoffset = (indent & ~3L); indent &= 3; ch3_offset = indent | ((srcx & 1) << 25); temp = ((width + (srcx & 1) + 1) >> 1) + indent; } else { indent = (srcx << gp3_src_pix_shift); srcoffset = (indent & ~3L); indent &= 3; ch3_offset = indent; temp = (width << gp3_src_pix_shift) + indent; } } total_dwords = (temp + 3) >> 2; size_dwords = (total_dwords << 2) + 8; dword_count = (temp >> 2); byte_count = (temp & 3); base = ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000)) | (gp3_base_register & ~GP3_BASE_OFFSET_DSTMASK); /* SET APPROPRIATE ENABLES */ gp3_cmd_header |= GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; WRITE_COMMAND32(GP3_BLT_DST_OFFSET, (dstoffset & 0x3FFFFF) | gp3_pat_origin); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, ch3_offset); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, ch3_size); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE | GP3_CH3_HST_SRC_ENABLE | gp3_src_format | ((gp3_blt_flags & CIMGP_BLTFLAGS_PRES_LUT) << 20)); WRITE_COMMAND32(GP3_BLT_MODE, gp3_blt_mode); /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; if (((total_dwords << 2) * height) <= GP3_BLT_1PASS_SIZE && (gp3_cmd_bottom - gp3_cmd_current) > (GP3_BLT_1PASS_SIZE + 72)) { /* UPDATE THE COMMAND POINTER */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + ((total_dwords << 2) * height) + 8; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_CH3_HOST_SOURCE_TYPE | (total_dwords * height)); while (height--) { /* WRITE DATA */ WRITE_COMMAND_STRING32(8, data, srcoffset, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), data, srcoffset + (dword_count << 2), byte_count); srcoffset += pitch; cim_cmd_ptr += total_dwords << 2; } WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } else { /* WRITE DATA LINE BY LINE * Each line will be created as a separate command buffer entry to * allow line-by-line wrapping and to allow simultaneous rendering * by the HW. */ while (height--) { /* UPDATE THE COMMAND POINTER * The WRITE_COMMANDXX macros use a pointer to the current buffer * space. This is created by adding gp3_cmd_current to the base * pointer. */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + size_dwords; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; /* WAIT FOR HARDWARE */ GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_CH3_HOST_SOURCE_TYPE | total_dwords); /* WRITE DATA */ WRITE_COMMAND_STRING32(8, data, srcoffset, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), data, srcoffset + (dword_count << 2), byte_count); /* UPDATE POINTERS */ srcoffset += pitch; WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } } } /*--------------------------------------------------------------------------- * gp_custom_convert_blt * * This routine is identical to gp_color_convert_blt, except that the macro * to write data to the frame buffer has been replaced with a new macro. This * allows a user to implement custom behavior when sending data, such as * manually converting 24BPP to 32BPP, converting 2BPP to 4BPP or * premultiplying alpha data. *-------------------------------------------------------------------------*/ void gp_custom_convert_blt(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned char *data, long pitch) { unsigned long indent, temp; unsigned long total_dwords, size_dwords; unsigned long dword_count, byte_count; unsigned long size = ((width << 16) | height); unsigned long ch3_offset, srcoffset; unsigned long ch3_size, base; /* ASSUME BITMAPS ARE DWORD ALIGNED */ /* We will offset into the source data in DWORD increments. We */ /* set the source index to the remaining byte offset and */ /* increment the size of each line to account for the dont-care */ /* pixel(s). For 4BPP source data, we also set the appropriate */ /* nibble index. */ /* CALCULATE THE SIZE OF ONE LINE */ if ((gp3_src_format & GP3_CH3_SRC_MASK) == GP3_CH3_SRC_24BPP_PACKED) { /* HANDLE 24BPP * Note that we do not do anything to guarantee that the source data * is DWORD aligned. The logic here is that the source data will be * cacheable, in which case Geode LX will not lose any clocks for * unaligned moves. Also note that the channel 3 width is programmed * as the number of dwords, while the normal width is programmed as * the number of pixels. */ srcoffset = srcx * 3; ch3_offset = 0; temp = width * 3; ch3_size = (((temp + 3) >> 2) << 16) | height; } else { ch3_size = size; if (gp3_src_pix_shift == 3) { /* CALCULATE INDENT AND SOURCE OFFSET */ indent = (srcx >> 1); srcoffset = (indent & ~3L); indent &= 3; ch3_offset = indent | ((srcx & 1) << 25); temp = ((width + (srcx & 1) + 1) >> 1) + indent; } else { indent = (srcx << gp3_src_pix_shift); srcoffset = (indent & ~3L); indent &= 3; ch3_offset = indent; temp = (width << gp3_src_pix_shift) + indent; } } total_dwords = (temp + 3) >> 2; size_dwords = (total_dwords << 2) + 8; dword_count = (temp >> 2); byte_count = (temp & 3); base = ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000)) | (gp3_base_register & ~GP3_BASE_OFFSET_DSTMASK); /* SET APPROPRIATE ENABLES */ gp3_cmd_header |= GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; WRITE_COMMAND32(GP3_BLT_DST_OFFSET, (dstoffset & 0x3FFFFF) | gp3_pat_origin); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, ch3_offset); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, ch3_size); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE | GP3_CH3_HST_SRC_ENABLE | gp3_src_format | ((gp3_blt_flags & CIMGP_BLTFLAGS_PRES_LUT) << 20)); WRITE_COMMAND32(GP3_BLT_MODE, gp3_blt_mode); /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; if (((total_dwords << 2) * height) <= GP3_BLT_1PASS_SIZE && (gp3_cmd_bottom - gp3_cmd_current) > (GP3_BLT_1PASS_SIZE + 72)) { /* UPDATE THE COMMAND POINTER */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + ((total_dwords << 2) * height) + 8; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_CH3_HOST_SOURCE_TYPE | (total_dwords * height)); while (height--) { /* WRITE DATA */ WRITE_CUSTOM_COMMAND_STRING32(8, data, srcoffset, dword_count); WRITE_CUSTOM_COMMAND_STRING8(8 + (dword_count << 2), data, srcoffset + (dword_count << 2), byte_count); srcoffset += pitch; cim_cmd_ptr += total_dwords << 2; } WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } else { /* WRITE DATA LINE BY LINE * Each line will be created as a separate command buffer entry to * allow line-by-line wrapping and to allow simultaneous rendering * by the HW. */ while (height--) { /* UPDATE THE COMMAND POINTER * The WRITE_COMMANDXX macros use a pointer to the current buffer * space. This is created by adding gp3_cmd_current to the base * pointer. */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + size_dwords; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; /* WAIT FOR HARDWARE */ GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_CH3_HOST_SOURCE_TYPE | total_dwords); /* WRITE DATA */ WRITE_CUSTOM_COMMAND_STRING32(8, data, srcoffset, dword_count); WRITE_CUSTOM_COMMAND_STRING8(8 + (dword_count << 2), data, srcoffset + (dword_count << 2), byte_count); /* UPDATE POINTERS */ srcoffset += pitch; WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } } } /*--------------------------------------------------------------------------- * gp_rotate_blt * * This routine is called to rotate a rectangular area of video memory. The * data may be color converted during the rotation. 'Degrees' must be a * multiple of 90 and indicates a clockwise rotation. Width and height * refer to the width and the height of the source. The output * destinations will be equal to the rotated dimensions. *-------------------------------------------------------------------------*/ void gp_rotate_blt(unsigned long dstoffset, unsigned long srcoffset, unsigned long width, unsigned long height, int degrees) { unsigned long sizein, sizeout; unsigned long ch3_flags; unsigned long base; base = ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000)) | ((gp3_fb_base << 4) + ((srcoffset & 0xFFC00000) >> 20)) | (gp3_base_register & GP3_BASE_OFFSET_SRCMASK); srcoffset &= 0x3FFFFF; dstoffset &= 0x3FFFFF; /* SET ROTATION PARAMETERS */ switch (degrees) { case 90: srcoffset += (height - 1) * gp3_src_stride; sizein = ((width << 16) | height); sizeout = ((height << 16) | width); ch3_flags = GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE | GP3_CH3_ROTATE_ENABLE | GP3_CH3_NEG_YDIR; break; case 180: srcoffset += (height - 1) * gp3_src_stride; srcoffset += (width << gp3_src_pix_shift) - 1; sizein = sizeout = ((width << 16) | height); ch3_flags = GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE | GP3_CH3_NEG_YDIR | GP3_CH3_NEG_XDIR; break; case 270: srcoffset += (width << gp3_src_pix_shift) - 1; sizein = ((width << 16) | height); sizeout = ((height << 16) | width); ch3_flags = GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE | GP3_CH3_ROTATE_ENABLE | GP3_CH3_NEG_XDIR; break; default: sizein = sizeout = ((width << 16) | height); ch3_flags = GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE; break; } /* SET APPROPRIATE ENABLES */ /* We override the raster mode setting with a source */ /* copy ROP. */ gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; /* WRITE ALL BLT REGISTERS */ WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_bpp | 0xCC); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, dstoffset); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, sizeout); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, sizein); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, srcoffset); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, ch3_flags | gp3_src_format | ((gp3_blt_flags & CIMGP_BLTFLAGS_PRES_LUT) << 20) | ((gp3_blt_flags & CIMGP_ENABLE_PREFETCH) << 17) | gp3_src_stride); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_COMMAND32(GP3_BLT_MODE, gp3_blt_mode); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } /*--------------------------------------------------------------------------- * gp_mono_bitmap_to_screen_blt * * This routine expands and BLTs a monchrome bitmap that is stored in system * memory into the framebuffer. 'data' points to an array of monochrome data. * 'stride' indicates the pitch between successive lines of monochrome data. * 'srcx' indicates the x coordinate within each line of blend data * corresponding to the first pixel. A y coordinate for the source is * deliberately omitted to avoid extra calculation for simple cases that have * no y index. The calling program must adjust the data pointer accordingly. *-------------------------------------------------------------------------*/ void gp_mono_bitmap_to_screen_blt(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned char *data, long stride) { unsigned long indent, temp; unsigned long total_dwords, size_dwords; unsigned long dword_count, byte_count; unsigned long size = ((width << 16) | height); unsigned long srcoffset, src_value; /* ASSUME BITMAPS ARE DWORD ALIGNED */ /* We will offset into the source data in DWORD increments. We */ /* set the source index to the remaining byte offset and */ /* increment the size of each line to account for the dont-care */ /* pixel(s). */ indent = (srcx >> 3); srcoffset = (indent & ~3L); indent &= 3; src_value = (indent | ((srcx & 7) << 26)); /* PROGRAM THE NORMAL SOURCE CHANNEL REGISTERS */ /* We assume that a color pattern is being ROPed with source */ /* data if the pattern type is color and the preserve pattern */ /* was set. */ gp3_cmd_header |= GP3_BLT_HDR_SRC_OFF_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_RASTER_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; if (gp3_ch3_pat) { gp3_cmd_header |= GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE; WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, gp3_pat_origin); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, (dstoffset & 0x3FFFFF)); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, gp3_pat_format); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, size); } else { WRITE_COMMAND32(GP3_BLT_DST_OFFSET, ((dstoffset & 0x3FFFFF) | gp3_pat_origin)); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, 0); } if (gp3_blt_flags & CIMGP_BLTFLAGS_INVERTMONO) { WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_raster_mode | GP3_RM_SOURCE_INVERT); } else { WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_raster_mode & ~GP3_RM_SOURCE_INVERT); } WRITE_COMMAND32(GP3_BLT_SRC_OFFSET, src_value); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000))); WRITE_COMMAND32(GP3_BLT_MODE, gp3_blt_mode | GP3_BM_SRC_HOST | GP3_BM_SRC_MONO); /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; /* CALCULATE THE SIZE OF ONE LINE */ size = ((width + (srcx & 7) + 7) >> 3) + indent; total_dwords = (size + 3) >> 2; size_dwords = (total_dwords << 2) + 8; dword_count = (size >> 2); byte_count = (size & 3); /* CHECK FOR SMALL BLT CASE */ /* If the total amount of monochrome data is less than 50K and we have */ /* room in the command buffer, we will do all data writes in a single */ /* data packet. */ if (((total_dwords << 2) * height) <= GP3_BLT_1PASS_SIZE && (gp3_cmd_bottom - gp3_cmd_current) > (GP3_BLT_1PASS_SIZE + 72)) { /* UPDATE THE COMMAND POINTER */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + ((total_dwords << 2) * height) + 8; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_HOST_SOURCE_TYPE | (total_dwords * height)); while (height--) { /* WRITE DATA */ WRITE_COMMAND_STRING32(8, data, srcoffset, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), data, srcoffset + (dword_count << 2), byte_count); srcoffset += stride; cim_cmd_ptr += total_dwords << 2; } WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } else { /* WRITE DATA LINE BY LINE * Each line will be created as a separate command buffer entry to * allow line-by-line wrapping and to allow simultaneous rendering * by the HW. */ while (height--) { /* UPDATE THE COMMAND POINTER * The WRITE_COMMANDXX macros use a pointer to the current buffer * space. This is created by adding gp3_cmd_current to the base * pointer. */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + size_dwords; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; /* WAIT FOR HARDWARE */ GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_HOST_SOURCE_TYPE | total_dwords); /* WRITE DATA */ WRITE_COMMAND_STRING32(8, data, srcoffset, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), data, srcoffset + (dword_count << 2), byte_count); /* UPDATE POINTERS */ srcoffset += stride; WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } } } /*--------------------------------------------------------------------------- * gp_text_blt * * This routine expands and BLTs byte-packed monochrome data to the screen. * There is assumed to be no x clipping involved in the BLT. *-------------------------------------------------------------------------*/ void gp_text_blt(unsigned long dstoffset, unsigned long width, unsigned long height, unsigned char *data) { unsigned long temp, dwords_total; unsigned long dword_count, byte_count; unsigned long size = ((width << 16) | height); unsigned long srcoffset = 0; /* PROGRAM THE NORMAL SOURCE CHANNEL REGISTERS */ /* We assume that a color pattern is being ROPed with source */ /* data if the pattern type is color and the preserve pattern */ /* was set. */ gp3_cmd_header |= GP3_BLT_HDR_SRC_OFF_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_RASTER_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; if (gp3_ch3_pat) { gp3_cmd_header |= GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE; WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, gp3_pat_origin); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, (dstoffset & 0x3FFFFF)); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, gp3_pat_format); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, size); } else { WRITE_COMMAND32(GP3_BLT_DST_OFFSET, ((dstoffset & 0x3FFFFF) | gp3_pat_origin)); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, 0); } if (gp3_blt_flags & CIMGP_BLTFLAGS_INVERTMONO) { WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_raster_mode | GP3_RM_SOURCE_INVERT); } else { WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_raster_mode & ~GP3_RM_SOURCE_INVERT); } WRITE_COMMAND32(GP3_BLT_SRC_OFFSET, 0); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000))); WRITE_COMMAND32(GP3_BLT_MODE, gp3_blt_mode | GP3_BM_SRC_HOST | GP3_BM_SRC_BP_MONO); /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; /* CALCULATE THE TOTAL NUMBER OF BYTES */ size = ((width + 7) >> 3) * height; /* WRITE ALL DATA IN CHUNKS */ do { /* UPDATE THE COMMAND POINTER */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; if (size > 8192) { dword_count = 2048; byte_count = 0; dwords_total = 2048; size -= 8192; } else { dword_count = (size >> 2); byte_count = (size & 3); dwords_total = (size + 3) >> 2; size = 0; } gp3_cmd_next = gp3_cmd_current + (dwords_total << 2) + 8; /* CHECK IF A WRAP WILL BE NEEDED */ if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; /* WAIT FOR HARDWARE */ GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_HOST_SOURCE_TYPE | dwords_total); /* WRITE DATA */ WRITE_COMMAND_STRING32(8, data, srcoffset, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), data, srcoffset + (dword_count << 2), byte_count); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; /* UPDATE THE SOURCE OFFSET */ /* We add a constant value because the code will loop only if the */ /* data exceeds 8192 bytes. */ srcoffset += 8192; } while (size); } /*--------------------------------------------------------------------------- * gp_mono_expand_blt * * This routine expands monochrome data that is stored in video memory into * the current BPP. The source and destination regions are assumed not to * overlap. The pitch of the source data is specified in gp_set_strides. * 'srcy' is deliberately omitted to prevent extra calculations for simple * applications that have no source indexes. *-------------------------------------------------------------------------*/ void gp_mono_expand_blt(unsigned long dstoffset, unsigned long srcoffset, unsigned long srcx, unsigned long width, unsigned long height, int byte_packed) { unsigned long base; unsigned long blt_mode; unsigned long size = ((width << 16) | height); /* ADJUST SOURCE OFFSET */ srcoffset += (srcx >> 3); srcx &= 7; /* CALCULATE BASE OFFSET REGISTER */ base = ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000)) | ((gp3_fb_base << 14) + ((srcoffset & 0xFFC00000) >> 10)) | (gp3_base_register & GP3_BASE_OFFSET_CH3MASK); /* SET THE SOURCE TYPE */ if (byte_packed) blt_mode = gp3_blt_mode | GP3_BM_SRC_FB | GP3_BM_SRC_BP_MONO; else blt_mode = gp3_blt_mode | GP3_BM_SRC_FB | GP3_BM_SRC_MONO; /* SET HEADER ENABLES */ gp3_cmd_header |= GP3_BLT_HDR_SRC_OFF_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_RASTER_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; /* ENABLE COLOR PATTERN IF APPLICABLE */ if (gp3_ch3_pat) { gp3_cmd_header |= GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE; WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, gp3_pat_origin); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, (dstoffset & 0x3FFFFF)); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, gp3_pat_format); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, size); } else { WRITE_COMMAND32(GP3_BLT_DST_OFFSET, ((dstoffset & 0x3FFFFF) | gp3_pat_origin)); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, 0); } if (gp3_blt_flags & CIMGP_BLTFLAGS_INVERTMONO) { WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_raster_mode | GP3_RM_SOURCE_INVERT); } else { WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_raster_mode & ~GP3_RM_SOURCE_INVERT); } WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); WRITE_COMMAND32(GP3_BLT_SRC_OFFSET, (srcoffset & 0x3FFFFF) | (srcx << 26)); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size); /* WORKAROUND FOR SIBZ #3744 * Under extremely rare conditions, very narrow byte-packed mono BLTs * can hang the GP. Even under the rare case, the bad condition will * only happen once every 16 lines. The workaround is to break the * offending BLT into a series of safer BLTs. This method is preferred * over a two-pass approach because it does not require saving and * restoring any GP state, such as the ROP or mono colors. */ if ((gp3_blt_mode & GP3_BM_DST_REQ) && byte_packed && (gp3_pix_shift < 2) && (width < 5) && ((srcoffset & 0x1F) == 0x1F) && ((srcx + width) > 8)) { unsigned long dstoff1, size1, org1; unsigned long dstoff2, size2, org2; unsigned long tempheight; size1 = ((8 - srcx) << 16) | 1; size2 = ((width + srcx - 8) << 16) | 1; org1 = gp3_pat_origin; org2 = (org1 & 0xE0000000) | ((org1 + ((8 - srcx) << 26)) & 0x1C000000); dstoff1 = dstoffset & 0x3FFFFF; dstoff2 = (dstoff1 + 8 - srcx) << gp3_pix_shift; while (height) { /* DIVIDE THE FIRST LINE INTO TWO SINGLE LINE BLTS */ WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size1); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, size1); WRITE_COMMAND32(GP3_BLT_SRC_OFFSET, (srcoffset & 0x3FFFFF) | (srcx << 26)); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, dstoff1 | org1); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, org1); WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_COMMAND32(GP3_BLT_MODE, blt_mode); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; gp_wait_until_idle(); gp_declare_blt(gp3_blt_flags); gp3_cmd_header |= GP3_BLT_HDR_SRC_OFF_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE; WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size2); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, size2); WRITE_COMMAND32(GP3_BLT_SRC_OFFSET, ((srcoffset + 1) & 0x3FFFFF)); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, dstoff2 | org2); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, org2); WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_COMMAND32(GP3_BLT_MODE, blt_mode); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; gp_wait_until_idle(); if (--height) { org1 += 0x20000000; org2 += 0x20000000; dstoff1 += gp3_dst_stride; dstoff2 += gp3_dst_stride; srcoffset += 2; /* THE NEXT 15 LINES ARE NOW 'SAFE' - THEY DO NOT SHOW THE * PROBLEM */ tempheight = 15; if (tempheight > height) tempheight = height; gp_declare_blt(gp3_blt_flags); gp3_cmd_header |= GP3_BLT_HDR_SRC_OFF_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE; WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, (width << 16) | tempheight); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, (width << 16) | tempheight); WRITE_COMMAND32(GP3_BLT_SRC_OFFSET, (srcoffset & 0x3FFFFF) | (srcx << 26)); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, dstoff1 | org1); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, org1); WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_COMMAND32(GP3_BLT_MODE, blt_mode); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; gp_wait_until_idle(); height -= tempheight; if (height) { gp_declare_blt(gp3_blt_flags); gp3_cmd_header |= GP3_BLT_HDR_SRC_OFF_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE; /* ADJUST ORIGIN */ /* If we get here, we added a full 15 lines which is * equivalent to subtracting one from the pattern y origin * (adding 15). */ org1 -= 0x20000000; org2 -= 0x20000000; dstoff1 += (gp3_dst_stride * 15); dstoff2 += (gp3_dst_stride * 15); srcoffset += 30; } } } return; } /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_COMMAND32(GP3_BLT_MODE, blt_mode); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } /*--------------------------------------------------------------------------- * gp_antialiased_text * * This routine implements alpha blending between a constant source color and * a destination region. The degree of the blend is controlled by an array * of 4BPP/8BPP values specified in 'data'. 'stride' indicates the pitch * between successive lines of blend data. 'srcx' indicates the x * coordinate within each line of blend data corresponding to the first * pixel. A y coordinate for the source is deliberately omitted to avoid * extra calculation for simple cases that have no y index. The calling * program must adjust the data pointer accordingly. 'fourbpp' selects * between 4BPP and 8BPP alpha. *-------------------------------------------------------------------------*/ void gp_antialiased_text(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned char *data, long stride, int fourbpp) { unsigned long indent, temp; unsigned long total_dwords, size_dwords; unsigned long dword_count, byte_count; unsigned long size = ((width << 16) | height); unsigned long ch3_offset, srcoffset; unsigned long base, depth_flag; base = ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000)) | (gp3_base_register & ~GP3_BASE_OFFSET_DSTMASK); /* ENABLE ALL RELEVANT REGISTERS */ /* We override the raster mode register to force the */ /* correct alpha blend */ gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; /* CALCULATIONS BASED ON ALPHA DEPTH */ /* Although most antialiased text is 4BPP, the hardware supports */ /* a full 8BPP. Either case is supported by this routine. */ if (fourbpp) { depth_flag = GP3_CH3_SRC_4BPP_ALPHA; indent = (srcx >> 1); srcoffset = (indent & ~3L); indent &= 3; ch3_offset = indent | ((srcx & 1) << 25); temp = ((width + (srcx & 1) + 1) >> 1) + indent; } else { depth_flag = GP3_CH3_SRC_8BPP_ALPHA; indent = srcx; srcoffset = (indent & ~3L); indent &= 3; ch3_offset = indent; temp = width + indent; } total_dwords = (temp + 3) >> 2; size_dwords = (total_dwords << 2) + 8; dword_count = (temp >> 2); byte_count = (temp & 3); /* SET RASTER MODE REGISTER */ /* Alpha blending will only apply to RGB when no alpha component is present. */ /* As 8BPP is not supported for this routine, the only alpha-less mode is */ /* 5:6:5. */ if (gp3_bpp == GP3_RM_BPPFMT_565) { WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_bpp | GP3_RM_ALPHA_TO_RGB | GP3_RM_ALPHA_A_PLUS_BETA_B | GP3_RM_SELECT_ALPHA_CHAN_3); } else { WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_bpp | GP3_RM_ALPHA_ALL | GP3_RM_ALPHA_A_PLUS_BETA_B | GP3_RM_SELECT_ALPHA_CHAN_3); } /* WRITE ALL REMAINING REGISTERS */ WRITE_COMMAND32(GP3_BLT_DST_OFFSET, (dstoffset & 0x3FFFFF)); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, ch3_offset); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, size); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, GP3_CH3_C3EN | GP3_CH3_HST_SRC_ENABLE | depth_flag | ((gp3_blt_flags & CIMGP_BLTFLAGS_PRES_LUT) << 20)); WRITE_COMMAND32(GP3_BLT_MODE, gp3_blt_mode | GP3_BM_DST_REQ); /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; /* WRITE DATA LINE BY LINE * Each line will be created as a separate command buffer entry to allow * line-by-line wrapping and to allow simultaneous rendering by the HW. */ if (((total_dwords << 2) * height) <= GP3_BLT_1PASS_SIZE && (gp3_cmd_bottom - gp3_cmd_current) > (GP3_BLT_1PASS_SIZE + 72)) { /* UPDATE THE COMMAND POINTER */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + ((total_dwords << 2) * height) + 8; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_CH3_HOST_SOURCE_TYPE | (total_dwords * height)); while (height--) { /* WRITE DATA */ WRITE_COMMAND_STRING32(8, data, srcoffset, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), data, srcoffset + (dword_count << 2), byte_count); srcoffset += stride; cim_cmd_ptr += total_dwords << 2; } WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } else { while (height--) { /* UPDATE THE COMMAND POINTER * The WRITE_COMMANDXX macros use a pointer to the current buffer * space. This is created by adding gp3_cmd_current to the base * pointer. */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + size_dwords; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; /* WAIT FOR HARDWARE */ GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_CH3_HOST_SOURCE_TYPE | total_dwords); /* WRITE DATA */ WRITE_COMMAND_STRING32(8, data, srcoffset, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), data, srcoffset + (dword_count << 2), byte_count); /* UPDATE POINTERS */ srcoffset += stride; WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } } } /*--------------------------------------------------------------------------- * gp_masked_blt * * This routine copies source data to the screen. A monochrome mask is used * to specify source transparency. *-------------------------------------------------------------------------*/ void gp_masked_blt(unsigned long dstoffset, unsigned long width, unsigned long height, unsigned long mono_srcx, unsigned long color_srcx, unsigned char *mono_mask, unsigned char *color_data, long mono_pitch, long color_pitch) { unsigned long indent, temp; unsigned long total_dwords, size_dwords; unsigned long dword_count, byte_count; unsigned long srcoffset, size; unsigned long i, ch3_offset, base; unsigned long flags = 0; if (gp3_blt_flags & CIMGP_BLTFLAGS_INVERTMONO) flags = GP3_RM_SOURCE_INVERT; /* MONO CALCULATIONS */ indent = (mono_srcx >> 3); srcoffset = (indent & ~3L); indent &= 3; size = ((width + (mono_srcx & 7) + 7) >> 3) + indent; total_dwords = (size + 3) >> 2; size_dwords = (total_dwords << 2) + 8; dword_count = (size >> 2); byte_count = (size & 3); base = ((gp3_fb_base << 24) + (gp3_scratch_base & 0xFFC00000)) | (gp3_base_register & ~GP3_BASE_OFFSET_DSTMASK); gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE | GP3_BLT_HDR_STRIDE_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; WRITE_COMMAND32(GP3_BLT_RASTER_MODE, GP3_RM_BPPFMT_8888 | 0xCC); WRITE_COMMAND32(GP3_BLT_STRIDE, (total_dwords << 2)); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, gp3_scratch_base & 0x3FFFFF); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, (total_dwords << 16) | height); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, (total_dwords << 16) | height); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, 0); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE | GP3_CH3_HST_SRC_ENABLE | GP3_CH3_SRC_8_8_8_8 | ((gp3_blt_flags & CIMGP_BLTFLAGS_PRES_LUT) << 20)); WRITE_COMMAND32(GP3_BLT_MODE, 0); WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); /* START THE BLT */ WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; for (i = 0; i < height; i++) { /* UPDATE THE COMMAND POINTER * The WRITE_COMMANDXX macros use a pointer to the current buffer * space. This is created by adding gp3_cmd_current to the base * pointer. */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + size_dwords; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; /* WAIT FOR HARDWARE */ GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_CH3_HOST_SOURCE_TYPE | total_dwords); /* WRITE DATA */ WRITE_COMMAND_STRING32(8, mono_mask, srcoffset, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), mono_mask, srcoffset + (dword_count << 2), byte_count); /* UPDATE POINTERS */ srcoffset += mono_pitch; WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } /* SECOND BLT */ gp_declare_blt(gp3_blt_flags | CIMGP_BLTFLAGS_HAZARD); base = ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000)) | ((gp3_fb_base << 14) + (((gp3_scratch_base + indent) & 0xFFC00000) >> 10)) | (gp3_base_register & GP3_BASE_OFFSET_CH3MASK); gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE | GP3_BLT_HDR_STRIDE_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_SRC_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; /* ENABLE TRANSPARENCY AND PATTERN COPY ROP * The monochrome data is used as a mask but is otherwise not involved in * the BLT. The color data is routed through the pattern channel. */ WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_bpp | 0xF0 | GP3_RM_SRC_TRANS | flags); WRITE_COMMAND32(GP3_BLT_STRIDE, (total_dwords << 18) | gp3_dst_stride); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, dstoffset & 0x3FFFFF); WRITE_COMMAND32(GP3_BLT_SRC_OFFSET, ((gp3_scratch_base + indent) & 0x3FFFFF) | ((mono_srcx & 7) << 26)); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, (width << 16) | height); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, (width << 16) | height); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); /* PROGRAM PARAMETERS FOR COLOR SOURCE DATA */ /* Data may be color converted along the way. */ if ((gp3_src_format & GP3_CH3_SRC_MASK) == GP3_CH3_SRC_24BPP_PACKED) { srcoffset = color_srcx * 3; ch3_offset = 0; size = width * 3; WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, (((size + 3) >> 2) << 16) | height); } else if (gp3_src_pix_shift == 3) { /* CALCULATE INDENT AND SOURCE OFFSET */ indent = (color_srcx >> 1); srcoffset = (indent & ~3L); indent &= 3; ch3_offset = indent | ((color_srcx & 1) << 25); size = ((width + (color_srcx & 1) + 1) >> 1) + indent; } else { indent = (color_srcx << gp3_src_pix_shift); srcoffset = (indent & ~3L); indent &= 3; ch3_offset = indent; size = (width << gp3_src_pix_shift) + indent; } total_dwords = (size + 3) >> 2; size_dwords = (total_dwords << 2) + 8; dword_count = (size >> 2); byte_count = (size & 3); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, ch3_offset); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, GP3_CH3_C3EN | GP3_CH3_HST_SRC_ENABLE | gp3_src_format | ((gp3_blt_flags & CIMGP_BLTFLAGS_PRES_LUT) << 20)); WRITE_COMMAND32(GP3_BLT_MODE, gp3_blt_mode | GP3_BM_SRC_MONO | GP3_BM_SRC_FB); /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; /* WRITE DATA LINE BY LINE */ while (height--) { /* UPDATE THE COMMAND POINTER */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + size_dwords; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_CH3_HOST_SOURCE_TYPE | total_dwords); /* WRITE COLOR DATA TO THE COMMAND BUFFER */ WRITE_COMMAND_STRING32(8, color_data, srcoffset, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), color_data, srcoffset + (dword_count << 2), byte_count); /* UPDATE COMMAND BUFFER POINTERS */ /* We do this before writing the monochrome data because otherwise */ /* the GP could throttle the writes to the host source register */ /* waiting for color data. If the command buffer has not been */ /* updated to load the color data... */ srcoffset += color_pitch; WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } } /*--------------------------------------------------------------------------- * gp_screen_to_screen_masked * * This routine performs a screen to screen BLT, using a monochrome mask to * specify source transparency. The source data is assumed to be in the * current destination format and to not overlap the destination. *-------------------------------------------------------------------------*/ void gp_screen_to_screen_masked(unsigned long dstoffset, unsigned long srcoffset, unsigned long width, unsigned long height, unsigned long mono_srcx, unsigned char *mono_mask, long mono_pitch) { unsigned long indent, temp; unsigned long total_dwords, size_dwords; unsigned long dword_count, byte_count; unsigned long srcoff, size; unsigned long i, base; unsigned long flags = 0; if (gp3_blt_flags & CIMGP_BLTFLAGS_INVERTMONO) flags = GP3_RM_SOURCE_INVERT; /* MONO CALCULATIONS */ indent = (mono_srcx >> 3); srcoff = (indent & ~3L); indent &= 3; size = ((width + (mono_srcx & 7) + 7) >> 3) + indent; total_dwords = (size + 3) >> 2; size_dwords = (total_dwords << 2) + 8; dword_count = (size >> 2); byte_count = (size & 3); base = ((gp3_fb_base << 24) + (gp3_scratch_base & 0xFFC00000)) | (gp3_base_register & ~GP3_BASE_OFFSET_DSTMASK); gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE | GP3_BLT_HDR_STRIDE_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; WRITE_COMMAND32(GP3_BLT_RASTER_MODE, GP3_RM_BPPFMT_8888 | 0xCC); WRITE_COMMAND32(GP3_BLT_STRIDE, (total_dwords << 2)); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, gp3_scratch_base & 0x3FFFFF); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, (total_dwords << 16) | height); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, (total_dwords << 16) | height); WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, 0); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE | GP3_CH3_HST_SRC_ENABLE | GP3_CH3_SRC_8_8_8_8 | ((gp3_blt_flags & CIMGP_BLTFLAGS_PRES_LUT) << 20)); WRITE_COMMAND32(GP3_BLT_MODE, 0); WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); /* START THE BLT */ WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; for (i = 0; i < height; i++) { /* UPDATE THE COMMAND POINTER * The WRITE_COMMANDXX macros use a pointer to the current buffer * space. This is created by adding gp3_cmd_current to the base * pointer. */ cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; /* CHECK IF A WRAP WILL BE NEEDED */ gp3_cmd_next = gp3_cmd_current + size_dwords; if ((gp3_cmd_bottom - gp3_cmd_next) <= GP3_MAX_COMMAND_SIZE) { gp3_cmd_next = gp3_cmd_top; /* WAIT FOR HARDWARE */ GP3_WAIT_WRAP(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_WRAP | GP3_DATA_LOAD_HDR_ENABLE); } else { /* WAIT FOR AVAILABLE SPACE */ GP3_WAIT_PRIMITIVE(temp); WRITE_COMMAND32(0, GP3_DATA_LOAD_HDR_TYPE | GP3_DATA_LOAD_HDR_ENABLE); } /* WRITE DWORD COUNT */ WRITE_COMMAND32(4, GP3_CH3_HOST_SOURCE_TYPE | total_dwords); /* WRITE DATA */ WRITE_COMMAND_STRING32(8, mono_mask, srcoff, dword_count); WRITE_COMMAND_STRING8(8 + (dword_count << 2), mono_mask, srcoff + (dword_count << 2), byte_count); /* UPDATE POINTERS */ srcoff += mono_pitch; WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } /* SECOND BLT */ gp_declare_blt(gp3_blt_flags | CIMGP_BLTFLAGS_HAZARD); base = ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000)) | ((gp3_fb_base << 14) + (((gp3_scratch_base + indent) & 0xFFC00000) >> 10)) | ((gp3_fb_base << 4) + ((srcoffset & 0xFFC00000) >> 20)); gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE | GP3_BLT_HDR_STRIDE_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_SRC_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; /* ENABLE TRANSPARENCY AND PATTERN COPY ROP * The monochrome data is used as a mask but is otherwise not involved * in the BLT. The color data is routed through the pattern channel. */ WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_bpp | 0xF0 | GP3_RM_SRC_TRANS | flags); WRITE_COMMAND32(GP3_BLT_STRIDE, (total_dwords << 18) | gp3_dst_stride); WRITE_COMMAND32(GP3_BLT_DST_OFFSET, dstoffset & 0x3FFFFF); WRITE_COMMAND32(GP3_BLT_SRC_OFFSET, ((gp3_scratch_base + indent) & 0x3FFFFF) | ((mono_srcx & 7) << 26)); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, (width << 16) | height); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, (width << 16) | height); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); /* PROGRAM PARAMETERS FOR COLOR SOURCE DATA */ WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, srcoffset & 0x3FFFFF); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, GP3_CH3_C3EN | gp3_ch3_bpp | gp3_src_stride | ((gp3_blt_flags & CIMGP_BLTFLAGS_PRES_LUT) << 20)); WRITE_COMMAND32(GP3_BLT_MODE, gp3_blt_mode | GP3_BM_SRC_MONO | GP3_BM_SRC_FB); /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } /*--------------------------------------------------------------------------- * gp_bresenham_line * * This routine draws a vector using the specified Bresenham parameters. * Currently this file does not support a routine that accepts the two * endpoints of a vector and calculates the Bresenham parameters. If it * ever does, this routine is still required for vectors that have been * clipped. *-------------------------------------------------------------------------*/ void gp_bresenham_line(unsigned long dstoffset, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned long flags) { unsigned long base; long offset; /* HANDLE NEGATIVE VECTORS */ /* We have to be very careful with vectors that increment negatively */ /* Our framebuffer scheme tries to align the destination of every */ /* BLT or vector to the nearest 4MB-aligned boundary. This is */ /* necessary because the GP only supports offsets up to 16MB, but the */ /* framebuffer can be over 128MB. To solve this problem, the GP */ /* base address registers are alignable to 4MB regions. However, we */ /* cannot simply align the dest offset when the vector goes negative. */ /* The vector offset could underflow, causing the offset to jump from */ /* near 0 to 16MB. As we cannot accurately determine the last address */ /* that will be written in a vector short of walking the algorithm in */ /* software, we do a worst case approximation. */ offset = dstoffset; if (!(flags & CIMGP_POSMAJOR)) { if (flags & CIMGP_YMAJOR) offset -= length * gp3_dst_stride; else offset -= (length << gp3_pix_shift); if (offset < 0) offset = 0; } if (!(flags & CIMGP_POSMINOR)) { if (flags & CIMGP_YMAJOR) offset -= (length << gp3_pix_shift); else offset -= length * gp3_dst_stride; if (offset < 0) offset = 0; } offset &= 0xFFC00000; dstoffset -= offset; base = ((gp3_fb_base << 24) + offset) | (gp3_base_register & ~GP3_BASE_OFFSET_DSTMASK); /* ENABLE RELEVANT REGISTERS */ /* Note that we always enable and write the channel 3 mode, if only */ /* to turn it off. Cimarron also always writes the base offset */ /* register to allow operation with frame buffers larger than 16MB. */ gp3_cmd_header |= GP3_VEC_HDR_DST_OFF_ENABLE | GP3_VEC_HDR_VEC_ERR_ENABLE | GP3_VEC_HDR_VEC_LEN_ENABLE | GP3_VEC_HDR_BASE_OFFSET_ENABLE | GP3_VEC_HDR_CH3_STR_ENABLE | GP3_VEC_HDR_VEC_MODE_ENABLE; /* WRITE THE REGISTERS COMMON TO ALL PATTERN TYPES */ /* The destination base is the frame buffer base plus whatever */ /* 4MB segment we happen to be drawing to. */ WRITE_COMMAND32(GP3_VECTOR_VEC_ERR, (((unsigned long) axialerr << 16) | (unsigned long) diagerr)); WRITE_COMMAND32(GP3_VECTOR_VEC_LEN, (((unsigned long) length << 16) | (unsigned long) initerr)); WRITE_COMMAND32(GP3_VECTOR_BASE_OFFSET, base); /* CHECK VECTOR PATTERN CASE */ if (gp3_ch3_pat) { /* SET THE SOLID COLOR */ /* The color for vector patterns from channel 3 comes from */ /* the regular pattern registers. */ gp3_cmd_header |= GP3_VEC_HDR_PAT_CLR0_ENABLE; WRITE_COMMAND32(GP3_VECTOR_PAT_COLOR_0, gp3_vector_pattern_color); /* INITIALIZE CHANNEL 3 PARAMETERS * We route the channel 3 output to the old source channel. If the * user sets a ROP that involves source, they will get unexpected * results. */ WRITE_COMMAND32(GP3_VECTOR_DST_OFFSET, dstoffset); WRITE_COMMAND32(GP3_VECTOR_CH3_MODE_STR, GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE | GP3_CH3_COLOR_PAT_ENABLE | GP3_CH3_SRC_8_8_8_8); } else { /* DISABLE CHANNEL 3 AND USE NORMAL PATTERN ORIGINS */ WRITE_COMMAND32(GP3_VECTOR_CH3_MODE_STR, 0); WRITE_COMMAND32(GP3_VECTOR_DST_OFFSET, (dstoffset | gp3_pat_origin)); } /* START THE VECTOR */ WRITE_COMMAND32(GP3_VEC_CMD_HEADER, gp3_cmd_header); WRITE_COMMAND32(GP3_VECTOR_MODE, (gp3_vec_mode | flags)); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; /* ADD A SECOND VECTOR TO CLEAR THE BYTE ENABLES */ /* We set a transparent pattern to clear the byte enables. */ /* We then restore the previous pattern. (SiBZ #4001) */ if (gp3_ch3_pat) { cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; WRITE_COMMAND32(0, GP3_LUT_HDR_TYPE | GP3_LUT_HDR_DATA_ENABLE); WRITE_COMMAND32(4, 0x100); WRITE_COMMAND32(8, (1 | GP3_LUT_DATA_TYPE)); WRITE_COMMAND32(12, 0); /* DUMMY VECTOR */ /* We shouldn't need to write anything but vector mode and the length */ WRITE_COMMAND32(16, GP3_VEC_HDR_TYPE | GP3_VEC_HDR_VEC_MODE_ENABLE | GP3_VEC_HDR_VEC_LEN_ENABLE); WRITE_COMMAND32(16 + GP3_VECTOR_MODE, (gp3_vec_mode | flags)); WRITE_COMMAND32(16 + GP3_VECTOR_VEC_LEN, (1 << 16) | (unsigned long) initerr); WRITE_COMMAND32(16 + GP3_VECTOR_COMMAND_SIZE, GP3_LUT_HDR_TYPE | GP3_LUT_HDR_DATA_ENABLE); WRITE_COMMAND32(20 + GP3_VECTOR_COMMAND_SIZE, 0x100); WRITE_COMMAND32(24 + GP3_VECTOR_COMMAND_SIZE, (1 | GP3_LUT_DATA_TYPE)); WRITE_COMMAND32(28 + GP3_VECTOR_COMMAND_SIZE, gp3_vec_pat); gp3_cmd_current += 32 + GP3_VECTOR_COMMAND_SIZE; } } /*--------------------------------------------------------------------------- * gp_line_from_endpoints * * This routine draws a vector from a set of rectangular coordinates. The * rectangle is assumed to use the currently specified destination stride. *-------------------------------------------------------------------------*/ void gp_line_from_endpoints(unsigned long dstoffset, unsigned long x0, unsigned long y0, unsigned long x1, unsigned long y1, int inclusive) { unsigned long base; unsigned long length; unsigned long flags; unsigned short initerr, axialerr, diagerr; long dx, dy, dmaj, dmin; long offset; /* ADJUST DESTINATION OFFSET BASED ON STARTING COORDINATE */ dstoffset += (x0 << gp3_pix_shift) + (y0 * gp3_dst_stride); /* CALCULATE BRESENHAM TERMS */ dx = (long) x1 - (long) x0; dy = (long) y1 - (long) y0; if (dx < 0) dx = -dx; if (dy < 0) dy = -dy; if (dx >= dy) { dmaj = dx; dmin = dy; flags = 0; if (x1 > x0) flags |= CIMGP_POSMAJOR; if (y1 > y0) flags |= CIMGP_POSMINOR; } else { dmaj = dy; dmin = dx; flags = CIMGP_YMAJOR; if (x1 > x0) flags |= CIMGP_POSMINOR; if (y1 > y0) flags |= CIMGP_POSMAJOR; } axialerr = (unsigned short) (dmin << 1); diagerr = (unsigned short) ((dmin - dmaj) << 1); initerr = (unsigned short) ((dmin << 1) - dmaj); if (!(flags & CIMGP_POSMINOR)) initerr--; /* CHECK FOR NO WORK */ if (!dmaj) return; /* CHECK INCLUSIVE OR EXCLUSIVE */ /* An inclusive line can be accomplished by simply adding 1 to the */ /* line length. */ length = dmaj; if (inclusive) length++; /* HANDLE NEGATIVE VECTORS */ offset = dstoffset; if (!(flags & CIMGP_POSMAJOR)) { if (flags & CIMGP_YMAJOR) offset -= length * gp3_dst_stride; else offset -= (length << gp3_pix_shift); if (offset < 0) offset = 0; } if (!(flags & CIMGP_POSMINOR)) { if (flags & CIMGP_YMAJOR) offset -= (length << gp3_pix_shift); else offset -= length * gp3_dst_stride; if (offset < 0) offset = 0; } offset &= 0xFFC00000; dstoffset -= offset; base = ((gp3_fb_base << 24) + offset) | (gp3_base_register & ~GP3_BASE_OFFSET_DSTMASK); /* ENABLE RELEVANT REGISTERS */ /* Note that we always enable and write the channel 3 mode, if only */ /* to turn it off. Cimarron also always writes the base offset */ /* register to allow operation with frame buffers larger than 16MB. */ gp3_cmd_header |= GP3_VEC_HDR_DST_OFF_ENABLE | GP3_VEC_HDR_VEC_ERR_ENABLE | GP3_VEC_HDR_VEC_LEN_ENABLE | GP3_VEC_HDR_BASE_OFFSET_ENABLE | GP3_VEC_HDR_CH3_STR_ENABLE | GP3_VEC_HDR_VEC_MODE_ENABLE; /* WRITE THE REGISTERS COMMON TO ALL PATTERN TYPES */ /* The destination base is the frame buffer base plus whatever */ /* 4MB segment we happen to be drawing to. */ WRITE_COMMAND32(GP3_VECTOR_VEC_ERR, (((unsigned long) axialerr << 16) | (unsigned long) diagerr)); WRITE_COMMAND32(GP3_VECTOR_VEC_LEN, (((unsigned long) length << 16) | (unsigned long) initerr)); WRITE_COMMAND32(GP3_VECTOR_BASE_OFFSET, base); /* CHECK VECTOR PATTERN CASE */ if (gp3_ch3_pat) { /* SET THE SOLID COLOR */ /* The color for vector patterns from channel 3 comes from */ /* the regular pattern registers. */ gp3_cmd_header |= GP3_VEC_HDR_PAT_CLR0_ENABLE; WRITE_COMMAND32(GP3_VECTOR_PAT_COLOR_0, gp3_vector_pattern_color); /* INITIALIZE CHANNEL 3 PARAMETERS */ /* We route the channel 3 output to the old source channel. If the * user sets a ROP that involves source, they will get unexpected * results. */ WRITE_COMMAND32(GP3_VECTOR_DST_OFFSET, dstoffset); WRITE_COMMAND32(GP3_VECTOR_CH3_MODE_STR, GP3_CH3_C3EN | GP3_CH3_REPLACE_SOURCE | GP3_CH3_COLOR_PAT_ENABLE | GP3_CH3_SRC_8_8_8_8); } else { /* DISABLE CHANNEL 3 AND USE NORMAL PATTERN ORIGINS */ WRITE_COMMAND32(GP3_VECTOR_CH3_MODE_STR, 0); WRITE_COMMAND32(GP3_VECTOR_DST_OFFSET, (dstoffset | gp3_pat_origin)); } /* START THE VECTOR */ WRITE_COMMAND32(GP3_VEC_CMD_HEADER, gp3_cmd_header); WRITE_COMMAND32(GP3_VECTOR_MODE, (gp3_vec_mode | flags)); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; /* ADD A SECOND VECTOR TO CLEAR THE BYTE ENABLES */ /* We set a transparent pattern to clear the byte enables. */ /* We then restore the previous pattern. (SiBZ #4001) */ if (gp3_ch3_pat) { cim_cmd_ptr = cim_cmd_base_ptr + gp3_cmd_current; WRITE_COMMAND32(0, GP3_LUT_HDR_TYPE | GP3_LUT_HDR_DATA_ENABLE); WRITE_COMMAND32(4, 0x100); WRITE_COMMAND32(8, (1 | GP3_LUT_DATA_TYPE)); WRITE_COMMAND32(12, 0); /* DUMMY VECTOR */ /* We shouldn't need to write anything but vector mode and the length */ WRITE_COMMAND32(16, GP3_VEC_HDR_TYPE | GP3_VEC_HDR_VEC_MODE_ENABLE | GP3_VEC_HDR_VEC_LEN_ENABLE); WRITE_COMMAND32(16 + GP3_VECTOR_MODE, (gp3_vec_mode | flags)); WRITE_COMMAND32(16 + GP3_VECTOR_VEC_LEN, (1 << 16) | (unsigned long) initerr); WRITE_COMMAND32(16 + GP3_VECTOR_COMMAND_SIZE, GP3_LUT_HDR_TYPE | GP3_LUT_HDR_DATA_ENABLE); WRITE_COMMAND32(20 + GP3_VECTOR_COMMAND_SIZE, 0x100); WRITE_COMMAND32(24 + GP3_VECTOR_COMMAND_SIZE, (1 | GP3_LUT_DATA_TYPE)); WRITE_COMMAND32(28 + GP3_VECTOR_COMMAND_SIZE, gp3_vec_pat); gp3_cmd_current += 32 + GP3_VECTOR_COMMAND_SIZE; } } /*--------------------------------------------------------------------------- * gp_wait_until_idle * * This routine stalls execution until the GP is no longer actively rendering. *-------------------------------------------------------------------------*/ void gp_wait_until_idle(void) { unsigned long temp; while (((temp = READ_GP32(GP3_BLT_STATUS)) & GP3_BS_BLT_BUSY) || !(temp & GP3_BS_CB_EMPTY)) { ; } } /*--------------------------------------------------------------------------- * gp_test_blt_busy *-------------------------------------------------------------------------*/ int gp_test_blt_busy(void) { unsigned long temp; if (((temp = READ_GP32(GP3_BLT_STATUS)) & GP3_BS_BLT_BUSY) || !(temp & GP3_BS_CB_EMPTY)) return 1; return 0; } /*--------------------------------------------------------------------------- * gp_test_blt_pending *-------------------------------------------------------------------------*/ int gp_test_blt_pending(void) { if ((READ_GP32(GP3_BLT_STATUS)) & GP3_BS_BLT_PENDING) return 1; return 0; } /*--------------------------------------------------------------------------- * gp_wait_blt_pending *-------------------------------------------------------------------------*/ void gp_wait_blt_pending(void) { while ((READ_GP32(GP3_BLT_STATUS)) & GP3_BS_BLT_PENDING); } /*--------------------------------------------------------------------------- * gp_save_state * * This routine saves all persistent GP information. *-------------------------------------------------------------------------*/ void gp_save_state(GP_SAVE_RESTORE * gp_state) { Q_WORD msr_value; gp_wait_until_idle(); msr_read64(MSR_DEVICE_GEODELX_GP, MSR_GEODELINK_CONFIG, &msr_value); gp_state->cmd_bottom = READ_GP32(GP3_CMD_BOT) & 0xFFFFFF; gp_state->cmd_top = READ_GP32(GP3_CMD_TOP) & 0xFFFFFF; gp_state->cmd_base = (msr_value.low << 4) & 0xFFF00000; gp_state->base_offset = READ_GP32(GP3_BASE_OFFSET); /* RESET THE READ POINTER */ gp_set_command_buffer_base(gp_state->cmd_base, gp_state->cmd_top, gp_state->cmd_bottom); } /*--------------------------------------------------------------------------- * gp_restore_state * * This routine restores all persistent GP information. *-------------------------------------------------------------------------*/ void gp_restore_state(GP_SAVE_RESTORE * gp_state) { gp_wait_until_idle(); WRITE_GP32(GP3_BASE_OFFSET, gp_state->base_offset); gp_set_command_buffer_base(gp_state->cmd_base, gp_state->cmd_top, gp_state->cmd_bottom); } /* This is identical to gp_antialiased_text, except we support all one pass alpha operations similar to gp_set_alpha_operation */ void gp_blend_mask_blt(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned long dataoffset, long stride, int operation, int fourbpp) { unsigned long indent; unsigned long size = ((width << 16) | height); unsigned long base, depth_flag; base = ((gp3_fb_base << 24) + (dstoffset & 0xFFC00000)) | ((gp3_fb_base << 4) + (dataoffset >> 20)) | (gp3_base_register & GP3_BASE_OFFSET_SRCMASK); /* ENABLE ALL RELEVANT REGISTERS */ /* We override the raster mode register to force the */ /* correct alpha blend */ gp3_cmd_header |= GP3_BLT_HDR_RASTER_ENABLE | GP3_BLT_HDR_DST_OFF_ENABLE | GP3_BLT_HDR_WIDHI_ENABLE | GP3_BLT_HDR_CH3_OFF_ENABLE | GP3_BLT_HDR_CH3_STR_ENABLE | GP3_BLT_HDR_CH3_WIDHI_ENABLE | GP3_BLT_HDR_BASE_OFFSET_ENABLE | GP3_BLT_HDR_BLT_MODE_ENABLE; /* CALCULATIONS BASED ON ALPHA DEPTH */ /* Although most antialiased text is 4BPP, the hardware supports */ /* a full 8BPP. Either case is supported by this routine. */ if (fourbpp) { depth_flag = GP3_CH3_SRC_4BPP_ALPHA; indent = (srcx >> 1) & 3; dataoffset += indent | ((srcx & 1) << 25); } else { depth_flag = GP3_CH3_SRC_8BPP_ALPHA; indent = srcx & 3; dataoffset += indent; } /* SET RASTER MODE REGISTER */ /* Alpha blending will only apply to RGB when no alpha component is present. */ /* As 8BPP is not supported for this routine, the only alpha-less mode is */ /* 5:6:5. */ if (gp3_bpp == GP3_RM_BPPFMT_565) { WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_bpp | GP3_RM_ALPHA_TO_RGB | ((unsigned long) (operation << 20)) | GP3_RM_SELECT_ALPHA_CHAN_3); } else { WRITE_COMMAND32(GP3_BLT_RASTER_MODE, gp3_bpp | GP3_RM_ALPHA_ALL | ((unsigned long) (operation << 20)) | GP3_RM_SELECT_ALPHA_CHAN_3); } /* WRITE ALL REMAINING REGISTERS */ WRITE_COMMAND32(GP3_BLT_DST_OFFSET, (dstoffset & 0x3FFFFF)); /* Set the offset of the CH3 data in memory */ WRITE_COMMAND32(GP3_BLT_CH3_OFFSET, dataoffset & 0x3FFFFF); WRITE_COMMAND32(GP3_BLT_WID_HEIGHT, size); WRITE_COMMAND32(GP3_BLT_CH3_WIDHI, size); WRITE_COMMAND32(GP3_BLT_BASE_OFFSET, base); WRITE_COMMAND32(GP3_BLT_CH3_MODE_STR, GP3_CH3_C3EN | (stride & 0xFFFF) | depth_flag | ((gp3_blt_flags & CIMGP_BLTFLAGS_PRES_LUT) << 20)); WRITE_COMMAND32(GP3_BLT_MODE, GP3_BM_DST_REQ); /* START THE BLT */ WRITE_COMMAND32(GP3_BLT_CMD_HEADER, gp3_cmd_header); WRITE_GP32(GP3_CMD_WRITE, gp3_cmd_next); gp3_cmd_current = gp3_cmd_next; } xf86-video-geode-2.11.18/src/cim/cim_vg.c0000644000175000017500000037657712654445443014600 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron display controller routines. These routines program the display * mode and configure the hardware cursor and video buffers. */ /*---------------------*/ /* CIMARRON VG GLOBALS */ /*---------------------*/ CIMARRON_STATIC unsigned long vg3_x_hotspot = 0; CIMARRON_STATIC unsigned long vg3_y_hotspot = 0; CIMARRON_STATIC unsigned long vg3_cursor_offset = 0; CIMARRON_STATIC unsigned long vg3_mode_width = 0; CIMARRON_STATIC unsigned long vg3_mode_height = 0; CIMARRON_STATIC unsigned long vg3_panel_width = 0; CIMARRON_STATIC unsigned long vg3_panel_height = 0; CIMARRON_STATIC unsigned long vg3_delta_x = 0; CIMARRON_STATIC unsigned long vg3_delta_y = 0; CIMARRON_STATIC unsigned long vg3_bpp = 0; CIMARRON_STATIC unsigned long vg3_color_cursor = 0; CIMARRON_STATIC unsigned long vg3_panel_enable = 0; /*--------------------------------------------------------------------------- * vg_delay_milliseconds * * This routine delays for a number of milliseconds based on a crude * delay loop. *--------------------------------------------------------------------------*/ int vg_delay_milliseconds(unsigned long ms) { /* ASSUME 500 MHZ 20 CLOCKS PER READ */ unsigned long loop = ms * 25000; while (loop-- > 0) { READ_REG32(DC3_UNLOCK); } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_display_mode * * This routine sets a CRT display mode using predefined Cimarron timings. * The source width and height are specified to allow scaling. *--------------------------------------------------------------------------*/ int vg_set_display_mode(unsigned long src_width, unsigned long src_height, unsigned long dst_width, unsigned long dst_height, int bpp, int hz, unsigned long flags) { VG_QUERY_MODE crt_query; VG_DISPLAY_MODE crt_mode; int mode; crt_query.active_width = dst_width; crt_query.active_height = dst_height; crt_query.bpp = bpp; crt_query.hz = hz; crt_query.query_flags = VG_QUERYFLAG_ACTIVEWIDTH | VG_QUERYFLAG_ACTIVEHEIGHT | VG_QUERYFLAG_BPP | VG_QUERYFLAG_REFRESH; mode = vg_get_display_mode_index(&crt_query); if (mode >= 0) { crt_mode = CimarronDisplayModes[mode]; crt_mode.src_width = src_width; crt_mode.src_height = src_height; /* ADD USER-REQUESTED FLAGS */ crt_mode.flags |= (flags & VG_MODEFLAG_VALIDUSERFLAGS); if (flags & VG_MODEFLAG_OVERRIDE_BAND) { crt_mode.flags &= ~VG_MODEFLAG_BANDWIDTHMASK; crt_mode.flags |= (flags & VG_MODEFLAG_BANDWIDTHMASK); } if (flags & VG_MODEFLAG_INT_OVERRIDE) { crt_mode.flags &= ~VG_MODEFLAG_INT_MASK; crt_mode.flags |= (flags & VG_MODEFLAG_INT_MASK); } return vg_set_custom_mode(&crt_mode, bpp); } return CIM_STATUS_ERROR; } /*--------------------------------------------------------------------------- * vg_set_panel_mode * * This routine sets a panel mode using predefined Cimarron fixed timings. * The source width and height specify the width and height of the data in * the frame buffer. The destination width and height specify the width and * height of the active data to be displayed. The panel width and height * specify the dimensions of the panel. This interface allows the user to * scale or center graphics data or both. To perform scaling, the src width * or height should be different than the destination width or height. To * perform centering or panning, the destination width and height should be * different than the panel resolution. *--------------------------------------------------------------------------*/ int vg_set_panel_mode(unsigned long src_width, unsigned long src_height, unsigned long dst_width, unsigned long dst_height, unsigned long panel_width, unsigned long panel_height, int bpp, unsigned long flags) { unsigned long sync_width; unsigned long sync_offset; VG_QUERY_MODE panel_query; VG_DISPLAY_MODE panel_mode; int mode; /* SEARCH CIMARRON'S TABLE OF PREDEFINED PANEL MODES */ /* If the destination resolution is larger than the panel resolution, */ /* panning will be performed. However, the timings for a panned mode */ /* are identical to the timings without panning. To save space in the */ /* mode tables, there are no additional table entries for modes with */ /* panning. Instead, we read the timings for a mode without panning */ /* and override the structure entries that specify the width and */ /* height of the mode. We perform a similar procedure for centered */ /* modes, except that certain timing parameters are dynamically */ /* calculated. */ panel_query.active_width = panel_width; panel_query.active_height = panel_height; panel_query.panel_width = panel_width; panel_query.panel_height = panel_height; panel_query.bpp = bpp; panel_query.query_flags = VG_QUERYFLAG_ACTIVEWIDTH | VG_QUERYFLAG_ACTIVEHEIGHT | VG_QUERYFLAG_PANELWIDTH | VG_QUERYFLAG_PANELHEIGHT | VG_QUERYFLAG_PANEL | VG_QUERYFLAG_BPP; mode = vg_get_display_mode_index(&panel_query); /* COPY THE DATA FROM THE MODE TABLE TO A TEMPORARY STRUCTURE */ if (mode >= 0) { panel_mode = CimarronDisplayModes[mode]; panel_mode.mode_width = dst_width; panel_mode.mode_height = dst_height; panel_mode.src_width = src_width; panel_mode.src_height = src_height; /* ADD USER-REQUESTED FLAGS */ panel_mode.flags |= (flags & VG_MODEFLAG_VALIDUSERFLAGS); if (flags & VG_MODEFLAG_OVERRIDE_BAND) { panel_mode.flags &= ~VG_MODEFLAG_BANDWIDTHMASK; panel_mode.flags |= (flags & VG_MODEFLAG_BANDWIDTHMASK); } if (flags & VG_MODEFLAG_INT_OVERRIDE) { panel_mode.flags &= ~VG_MODEFLAG_INT_MASK; panel_mode.flags |= (flags & VG_MODEFLAG_INT_MASK); } /* DYNAMICALLY CALCULATE CENTERED TIMINGS */ /* For centered timings the blank start and blank end are set to */ /* half the difference between the mode dimension and the panel */ /* dimension. The sync pulse preserves the width and offset from */ /* blanking whenever possible. */ if (dst_width < panel_width) { sync_width = panel_mode.hsyncend - panel_mode.hsyncstart; sync_offset = panel_mode.hsyncstart - panel_mode.hblankstart; panel_mode.hactive = dst_width; panel_mode.hblankstart = panel_mode.hactive + ((panel_width - dst_width) >> 1); panel_mode.hblankend = panel_mode.htotal - ((panel_width - dst_width) >> 1); panel_mode.hsyncstart = panel_mode.hblankstart + sync_offset; panel_mode.hsyncend = panel_mode.hsyncstart + sync_width; panel_mode.flags |= VG_MODEFLAG_CENTERED; } if (dst_height < panel_height) { sync_width = panel_mode.vsyncend - panel_mode.vsyncstart; sync_offset = panel_mode.vsyncstart - panel_mode.vblankstart; panel_mode.vactive = dst_height; panel_mode.vblankstart = panel_mode.vactive + ((panel_height - dst_height) >> 1); panel_mode.vblankend = panel_mode.vtotal - ((panel_height - dst_height) >> 1); panel_mode.vsyncstart = panel_mode.vblankstart + sync_offset; panel_mode.vsyncend = panel_mode.vsyncstart + sync_width; panel_mode.flags |= VG_MODEFLAG_CENTERED; } return vg_set_custom_mode(&panel_mode, bpp); } return CIM_STATUS_ERROR; } /*--------------------------------------------------------------------------- * vg_set_tv_mode * * This routine sets a TV display mode using predefined Cimarron timings. The * source width and height are specified to allow scaling. *--------------------------------------------------------------------------*/ int vg_set_tv_mode(unsigned long *src_width, unsigned long *src_height, unsigned long encoder, unsigned long tvres, int bpp, unsigned long flags, unsigned long h_overscan, unsigned long v_overscan) { unsigned long sync_width; unsigned long sync_offset; VG_QUERY_MODE tv_query; VG_DISPLAY_MODE tv_mode; int mode; if (!src_width || !src_height) return CIM_STATUS_INVALIDPARAMS; tv_query.bpp = bpp; tv_query.encoder = encoder; tv_query.tvmode = tvres; tv_query.query_flags = VG_QUERYFLAG_BPP | VG_QUERYFLAG_TVOUT | VG_QUERYFLAG_ENCODER | VG_QUERYFLAG_TVMODE; mode = vg_get_display_mode_index(&tv_query); if (mode >= 0) { /* RETRIEVE THE UNSCALED RESOLUTION * As we are indexing here simply by a mode and encoder, the actual * timings may vary. A 0 value for source or height will thus query * the unscaled resolution. */ if (!(*src_width) || !(*src_height)) { *src_width = CimarronDisplayModes[mode].hactive - (h_overscan << 1); *src_height = CimarronDisplayModes[mode].vactive; if (CimarronDisplayModes[mode].flags & VG_MODEFLAG_INTERLACED) { if (((flags & VG_MODEFLAG_INT_OVERRIDE) && (flags & VG_MODEFLAG_INT_MASK) == VG_MODEFLAG_INT_LINEDOUBLE) || (!(flags & VG_MODEFLAG_INT_OVERRIDE) && (CimarronDisplayModes[mode].flags & VG_MODEFLAG_INT_MASK) == VG_MODEFLAG_INT_LINEDOUBLE)) { if (CimarronDisplayModes[mode].vactive_even > CimarronDisplayModes[mode].vactive) *src_height = CimarronDisplayModes[mode].vactive_even; /* ONLY 1/2 THE OVERSCAN FOR LINE DOUBLED MODES */ *src_height -= v_overscan; } else { *src_height += CimarronDisplayModes[mode].vactive_even; *src_height -= v_overscan << 1; } } else { *src_height -= v_overscan << 1; } return CIM_STATUS_OK; } tv_mode = CimarronDisplayModes[mode]; tv_mode.src_width = *src_width; tv_mode.src_height = *src_height; /* ADD USER-REQUESTED FLAGS */ tv_mode.flags |= (flags & VG_MODEFLAG_VALIDUSERFLAGS); if (flags & VG_MODEFLAG_OVERRIDE_BAND) { tv_mode.flags &= ~VG_MODEFLAG_BANDWIDTHMASK; tv_mode.flags |= (flags & VG_MODEFLAG_BANDWIDTHMASK); } if (flags & VG_MODEFLAG_INT_OVERRIDE) { tv_mode.flags &= ~VG_MODEFLAG_INT_MASK; tv_mode.flags |= (flags & VG_MODEFLAG_INT_MASK); } /* ADJUST FOR OVERSCAN */ if (h_overscan) { sync_width = tv_mode.hsyncend - tv_mode.hsyncstart; sync_offset = tv_mode.hsyncstart - tv_mode.hblankstart; tv_mode.hactive -= h_overscan << 1; tv_mode.hblankstart = tv_mode.hactive + h_overscan; tv_mode.hblankend = tv_mode.htotal - h_overscan; tv_mode.hsyncstart = tv_mode.hblankstart + sync_offset; tv_mode.hsyncend = tv_mode.hsyncstart + sync_width; tv_mode.flags |= VG_MODEFLAG_CENTERED; } if (v_overscan) { sync_width = tv_mode.vsyncend - tv_mode.vsyncstart; sync_offset = tv_mode.vsyncstart - tv_mode.vblankstart; if (tv_mode.flags & VG_MODEFLAG_INTERLACED) { tv_mode.vactive -= v_overscan; tv_mode.vblankstart = tv_mode.vactive + (v_overscan >> 1); tv_mode.vblankend = tv_mode.vtotal - (v_overscan >> 1); tv_mode.vsyncstart = tv_mode.vblankstart + sync_offset; tv_mode.vsyncend = tv_mode.vsyncstart + sync_width; sync_width = tv_mode.vsyncend_even - tv_mode.vsyncstart_even; sync_offset = tv_mode.vsyncstart_even - tv_mode.vblankstart_even; tv_mode.vactive_even -= v_overscan; tv_mode.vblankstart_even = tv_mode.vactive_even + (v_overscan >> 1); tv_mode.vblankend_even = tv_mode.vtotal_even - (v_overscan >> 1); tv_mode.vsyncstart_even = tv_mode.vblankstart_even + sync_offset; tv_mode.vsyncend_even = tv_mode.vsyncstart_even + sync_width; } else { tv_mode.vactive -= v_overscan << 1; tv_mode.vblankstart = tv_mode.vactive + v_overscan; tv_mode.vblankend = tv_mode.vtotal - v_overscan; tv_mode.vsyncstart = tv_mode.vblankstart + sync_offset; tv_mode.vsyncend = tv_mode.vsyncstart + sync_width; } tv_mode.flags |= VG_MODEFLAG_CENTERED; } /* TV MODES WILL NEVER ALLOW PANNING */ tv_mode.panel_width = tv_mode.hactive; tv_mode.panel_height = tv_mode.vactive; tv_mode.mode_width = tv_mode.hactive; tv_mode.mode_height = tv_mode.vactive; return vg_set_custom_mode(&tv_mode, bpp); } return CIM_STATUS_ERROR; } /*--------------------------------------------------------------------------- * vg_set_custom_mode * * This routine sets a display mode. The API is structured such that this * routine can be called from four sources: * - vg_set_display_mode * - vg_set_panel_mode * - vg_set_tv_mode * - directly by the user for a custom mode. *--------------------------------------------------------------------------*/ int vg_set_custom_mode(VG_DISPLAY_MODE * mode_params, int bpp) { unsigned long config, misc, temp; unsigned long irq_ctl, genlk_ctl; unsigned long unlock, flags; unsigned long acfg, gcfg, dcfg; unsigned long size, line_size, pitch; unsigned long bpp_mask, dv_size; unsigned long hscale, vscale, starting_width; unsigned long starting_height, output_height; Q_WORD msr_value; /* DETERMINE DIMENSIONS FOR SCALING */ /* Scaling is performed before flicker filtering and interlacing */ output_height = mode_params->vactive; if (mode_params->flags & VG_MODEFLAG_INTERLACED) { /* EVEN AND ODD FIELDS ARE SEPARATE * The composite image height is the sum of the height of both * fields */ if ((mode_params->flags & VG_MODEFLAG_INT_MASK) == VG_MODEFLAG_INT_FLICKER || (mode_params->flags & VG_MODEFLAG_INT_MASK) == VG_MODEFLAG_INT_ADDRESS) { output_height += mode_params->vactive_even; } /* LINE DOUBLING * The composite image height is the greater of the two field * heights. */ else if (mode_params->vactive_even > output_height) output_height = mode_params->vactive_even; } /* CHECK FOR VALID SCALING FACTOR * GeodeLX supports only 2:1 vertical downscale (before interlacing) and * 2:1 horizontal downscale. The source width when scaling must be * less than or equal to 1024 pixels. The destination can be any size, * except when flicker filtering is enabled. */ irq_ctl = 0; if (mode_params->flags & VG_MODEFLAG_PANELOUT) { if (mode_params->src_width != mode_params->mode_width) { starting_width = (mode_params->hactive * mode_params->src_width) / mode_params->mode_width; hscale = (mode_params->src_width << 14) / (mode_params->mode_width - 1); irq_ctl |= (DC3_IRQFILT_ALPHA_FILT_EN | DC3_IRQFILT_GFX_FILT_EN); } else { starting_width = mode_params->hactive; hscale = 0x4000; } if (mode_params->src_height != mode_params->mode_height) { starting_height = (output_height * mode_params->src_height) / mode_params->mode_height; vscale = (mode_params->src_height << 14) / (mode_params->mode_height - 1); irq_ctl |= (DC3_IRQFILT_ALPHA_FILT_EN | DC3_IRQFILT_GFX_FILT_EN); } else { starting_height = output_height; vscale = 0x4000; } } else { starting_width = mode_params->src_width; starting_height = mode_params->src_height; if (mode_params->src_width != mode_params->hactive) { hscale = (mode_params->src_width << 14) / (mode_params->hactive - 1); irq_ctl |= (DC3_IRQFILT_ALPHA_FILT_EN | DC3_IRQFILT_GFX_FILT_EN); } else { hscale = 0x4000; } if (mode_params->src_height != output_height) { vscale = (mode_params->src_height << 14) / (output_height - 1); irq_ctl |= (DC3_IRQFILT_ALPHA_FILT_EN | DC3_IRQFILT_GFX_FILT_EN); } else { vscale = 0x4000; } } starting_width = (starting_width + 7) & 0xFFFF8; if (mode_params->hactive < (starting_width >> 1) || output_height < (starting_height >> 1) || (irq_ctl && (starting_width > 1024))) { return CIM_STATUS_INVALIDSCALE; } /* VERIFY INTERLACED SCALING */ /* The output width must be less than or equal to 1024 pixels when the */ /* flicker filter is enabled. Also, scaling should be disabled when */ /* the interlacing mode is set to interlaced addressing. */ if (mode_params->flags & VG_MODEFLAG_INTERLACED) { if ((((mode_params->flags & VG_MODEFLAG_INT_MASK) == VG_MODEFLAG_INT_FLICKER) && (mode_params->hactive > 1024)) || (((mode_params->flags & VG_MODEFLAG_INT_MASK) == VG_MODEFLAG_INT_ADDRESS) && irq_ctl)) { return CIM_STATUS_INVALIDSCALE; } } /* CHECK FOR VALID BPP */ switch (bpp) { case 8: bpp_mask = DC3_DCFG_DISP_MODE_8BPP; break; case 24: bpp_mask = DC3_DCFG_DISP_MODE_24BPP; break; case 32: bpp_mask = DC3_DCFG_DISP_MODE_32BPP; break; case 12: bpp_mask = DC3_DCFG_DISP_MODE_16BPP | DC3_DCFG_12BPP; break; case 15: bpp_mask = DC3_DCFG_DISP_MODE_16BPP | DC3_DCFG_15BPP; break; case 16: bpp_mask = DC3_DCFG_DISP_MODE_16BPP | DC3_DCFG_16BPP; break; default: return CIM_STATUS_INVALIDPARAMS; } vg3_bpp = bpp; /* CLEAR PANNING OFFSETS */ vg3_delta_x = 0; vg3_delta_y = 0; /* SAVE PANEL PARAMETERS */ if (mode_params->flags & VG_MODEFLAG_PANELOUT) { vg3_panel_enable = 1; vg3_panel_width = mode_params->panel_width; vg3_panel_height = mode_params->panel_height; vg3_mode_width = mode_params->mode_width; vg3_mode_height = mode_params->mode_height; /* INVERT THE SHIFT CLOCK IF REQUESTED */ /* Note that we avoid writing the power management register if */ /* we can help it. */ temp = READ_VID32(DF_POWER_MANAGEMENT); if ((mode_params->flags & VG_MODEFLAG_INVERT_SHFCLK) && !(temp & DF_PM_INVERT_SHFCLK)) { WRITE_VID32(DF_POWER_MANAGEMENT, (temp | DF_PM_INVERT_SHFCLK)); } else if (!(mode_params->flags & VG_MODEFLAG_INVERT_SHFCLK) && (temp & DF_PM_INVERT_SHFCLK)) { WRITE_VID32(DF_POWER_MANAGEMENT, (temp & ~DF_PM_INVERT_SHFCLK)); } /* SET PANEL TIMING VALUES */ if (!(mode_params->flags & VG_MODEFLAG_NOPANELTIMINGS)) { unsigned long pmtim1, pmtim2, dith_ctl; if (mode_params->flags & VG_MODEFLAG_XVGA_TFT) { pmtim1 = DF_DEFAULT_XVGA_PMTIM1; pmtim2 = DF_DEFAULT_XVGA_PMTIM2; dith_ctl = DF_DEFAULT_DITHCTL; msr_value.low = DF_DEFAULT_XVGA_PAD_SEL_LOW; msr_value.high = DF_DEFAULT_XVGA_PAD_SEL_HIGH; } else if (mode_params->flags & VG_MODEFLAG_CUSTOM_PANEL) { pmtim1 = mode_params->panel_tim1; pmtim2 = mode_params->panel_tim2; dith_ctl = mode_params->panel_dither_ctl; msr_value.low = mode_params->panel_pad_sel_low; msr_value.high = mode_params->panel_pad_sel_high; } else { pmtim1 = DF_DEFAULT_TFT_PMTIM1; pmtim2 = DF_DEFAULT_TFT_PMTIM2; dith_ctl = DF_DEFAULT_DITHCTL; msr_value.low = DF_DEFAULT_TFT_PAD_SEL_LOW; msr_value.high = DF_DEFAULT_TFT_PAD_SEL_HIGH; } WRITE_VID32(DF_VIDEO_PANEL_TIM1, pmtim1); WRITE_VID32(DF_VIDEO_PANEL_TIM2, pmtim2); WRITE_VID32(DF_DITHER_CONTROL, dith_ctl); msr_write64(MSR_DEVICE_GEODELX_DF, DF_MSR_PAD_SEL, &msr_value); } /* SET APPROPRIATE PANEL OUTPUT MODE */ msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &msr_value); msr_value.low &= ~DF_CONFIG_OUTPUT_MASK; msr_value.low |= DF_OUTPUT_PANEL; if (mode_params->flags & VG_MODEFLAG_CRT_AND_FP) msr_value.low |= DF_SIMULTANEOUS_CRT_FP; else msr_value.low &= ~DF_SIMULTANEOUS_CRT_FP; msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &msr_value); } else if (mode_params->flags & VG_MODEFLAG_TVOUT) { vg3_panel_enable = 0; /* SET APPROPRIATE TV OUTPUT MODE */ msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &msr_value); msr_value.low &= ~DF_CONFIG_OUTPUT_MASK; msr_value.low |= DF_OUTPUT_PANEL; if (mode_params->flags & VG_MODEFLAG_CRT_AND_FP) msr_value.low |= DF_SIMULTANEOUS_CRT_FP; else msr_value.low &= ~DF_SIMULTANEOUS_CRT_FP; msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &msr_value); /* CONFIGURE PADS FOR VOP OUTPUT */ /* Note that the VOP clock is currently always inverted. */ msr_value.low = DF_DEFAULT_TV_PAD_SEL_LOW; msr_value.high = DF_DEFAULT_TV_PAD_SEL_HIGH; msr_write64(MSR_DEVICE_GEODELX_DF, DF_MSR_PAD_SEL, &msr_value); } else { vg3_panel_enable = 0; /* SET OUTPUT TO CRT ONLY */ msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &msr_value); msr_value.low &= ~DF_CONFIG_OUTPUT_MASK; msr_value.low |= DF_OUTPUT_CRT; msr_write64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &msr_value); } /* SET UNLOCK VALUE */ unlock = READ_REG32(DC3_UNLOCK); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); /*-------------------------------------------------------------------*/ /* MAKE THE SYSTEM "SAFE" */ /* Before setting a mode, we first ensure that the system is in a */ /* benign quiescent state. This involves disabling compression and */ /* all interrupt sources. It also involves terminating all accesses */ /* to memory, including video, FIFO load, VIP and the GP. */ /*-------------------------------------------------------------------*/ /* DISABLE VGA * VGA *MUST* be turned off before TGEN is enabled. If not, a condition * will result where VGA Enable is waiting for a VSync to be latched but * a VSync will not be generated until VGA is disabled. */ temp = READ_REG32(DC3_GENERAL_CFG) & ~DC3_GCFG_VGAE; /* DISABLE VIDEO (INCLUDING ALPHA WINDOWS) */ WRITE_VID32(DF_ALPHA_CONTROL_1, 0); WRITE_VID32(DF_ALPHA_CONTROL_1 + 32, 0); WRITE_VID32(DF_ALPHA_CONTROL_1 + 64, 0); WRITE_REG32(DC3_GENERAL_CFG, (temp & ~DC3_GCFG_VIDE)); temp = READ_VID32(DF_VIDEO_CONFIG); WRITE_VID32(DF_VIDEO_CONFIG, (temp & ~DF_VCFG_VID_EN)); /* DISABLE VG INTERRUPTS */ WRITE_REG32(DC3_IRQ, DC3_IRQ_MASK | DC3_VSYNC_IRQ_MASK | DC3_IRQ_STATUS | DC3_VSYNC_IRQ_STATUS); /* DISABLE GENLOCK */ genlk_ctl = READ_REG32(DC3_GENLK_CTL); WRITE_REG32(DC3_GENLK_CTL, (genlk_ctl & ~DC3_GC_GENLOCK_ENABLE)); /* DISABLE VIP CAPTURE AND VIP INTERRUPTS */ WRITE_VIP32(VIP_CONTROL1, 0); WRITE_VIP32(VIP_CONTROL2, 0); WRITE_VIP32(VIP_INTERRUPT, VIP_ALL_INTERRUPTS | (VIP_ALL_INTERRUPTS >> 16)); /* DISABLE COLOR KEYING * The color key mechanism should be disabled whenever a mode switch * occurs. */ temp = READ_REG32(DC3_COLOR_KEY); WRITE_REG32(DC3_COLOR_KEY, (temp & ~DC3_CLR_KEY_ENABLE)); /* BLANK THE DISPLAY * Note that we never blank the panel. Most flat panels have very long * latency requirements when setting their power low. Some panels require * upwards of 500ms before VDD goes high again. Needless to say, we are * not planning to take over one half a second inside this routine. */ misc = READ_VID32(DF_VID_MISC); config = READ_VID32(DF_DISPLAY_CONFIG); WRITE_VID32(DF_VID_MISC, (misc | DF_DAC_POWER_DOWN)); WRITE_VID32(DF_DISPLAY_CONFIG, (config & ~(DF_DCFG_DIS_EN | DF_DCFG_HSYNC_EN | DF_DCFG_VSYNC_EN | DF_DCFG_DAC_BL_EN))); /* DISABLE COMPRESSION */ gcfg = READ_REG32(DC3_GENERAL_CFG); gcfg &= ~(DC3_GCFG_CMPE | DC3_GCFG_DECE); WRITE_REG32(DC3_GENERAL_CFG, gcfg); /* DISABLE THE TIMING GENERATOR */ dcfg = READ_REG32(DC3_DISPLAY_CFG); dcfg &= ~DC3_DCFG_TGEN; WRITE_REG32(DC3_DISPLAY_CFG, dcfg); /* WAIT FOR PENDING MEMORY REQUESTS */ vg_delay_milliseconds(1); /* DISABLE DISPLAY FIFO LOAD */ gcfg &= ~DC3_GCFG_DFLE; WRITE_REG32(DC3_GENERAL_CFG, gcfg); gcfg = 0; dcfg = 0; /* WAIT FOR THE GP TO BE IDLE (JUST IN CASE) */ while (((temp = READ_GP32(GP3_BLT_STATUS)) & GP3_BS_BLT_BUSY) || !(temp & GP3_BS_CB_EMPTY)) { ; } /* SET THE DOT CLOCK FREQUENCY */ if (!(mode_params->flags & VG_MODEFLAG_EXCLUDEPLL)) { if (mode_params->flags & VG_MODEFLAG_HALFCLOCK) flags = VG_PLL_DIVIDE_BY_2; else if (mode_params->flags & VG_MODEFLAG_QVGA) flags = VG_PLL_DIVIDE_BY_4; else flags = 0; /* ALLOW DOTREF TO BE USED AS THE PLL */ /* This is useful for some external TV encoders. */ if (mode_params->flags & VG_MODEFLAG_PLL_BYPASS) flags |= VG_PLL_BYPASS; /* ALLOW THE USER TO MANUALLY ENTER THE MSR VALUE */ if (mode_params->flags & VG_MODEFLAG_MANUAL_FREQUENCY) flags |= VG_PLL_MANUAL; if (mode_params->flags & VG_MODEFLAG_VIP_TO_DOT_CLOCK) flags |= VG_PLL_VIP_CLOCK; vg_set_clock_frequency(mode_params->frequency, flags); } /* CLEAR ALL BUFFER OFFSETS */ WRITE_REG32(DC3_FB_ST_OFFSET, 0); WRITE_REG32(DC3_CB_ST_OFFSET, 0); WRITE_REG32(DC3_CURS_ST_OFFSET, 0); genlk_ctl = READ_REG32(DC3_GENLK_CTL) & ~(DC3_GC_ALPHA_FLICK_ENABLE | DC3_GC_FLICKER_FILTER_ENABLE | DC3_GC_FLICKER_FILTER_MASK); /* ENABLE INTERLACING */ if (mode_params->flags & VG_MODEFLAG_INTERLACED) { irq_ctl |= DC3_IRQFILT_INTL_EN; if ((mode_params->flags & VG_MODEFLAG_INT_MASK) == VG_MODEFLAG_INT_ADDRESS) irq_ctl |= DC3_IRQFILT_INTL_ADDR; else if ((mode_params->flags & VG_MODEFLAG_INT_MASK) == VG_MODEFLAG_INT_FLICKER) { genlk_ctl |= DC3_GC_FLICKER_FILTER_1_8 | DC3_GC_FLICKER_FILTER_ENABLE | DC3_GC_ALPHA_FLICK_ENABLE; } } WRITE_REG32(DC3_GFX_SCALE, (vscale << 16) | (hscale & 0xFFFF)); WRITE_REG32(DC3_IRQ_FILT_CTL, irq_ctl); WRITE_REG32(DC3_GENLK_CTL, genlk_ctl); /* SET LINE SIZE AND PITCH * The line size and pitch are calculated from the src_width parameter * passed in to this routine. All other parameters are ignored. * The pitch is set either to a power of 2 to allow efficient * compression or to a linear value to allow efficient memory management. */ switch (bpp) { case 8: size = mode_params->src_width; line_size = starting_width; break; case 12: case 15: case 16: size = mode_params->src_width << 1; line_size = starting_width << 1; break; case 24: case 32: default: size = mode_params->src_width << 2; line_size = starting_width << 2; break; } /* CALCULATE DV RAM SETTINGS AND POWER OF 2 PITCH */ pitch = 1024; dv_size = DC3_DV_LINE_SIZE_1024; if (size > 1024) { pitch = 2048; dv_size = DC3_DV_LINE_SIZE_2048; } if (size > 2048) { pitch = 4096; dv_size = DC3_DV_LINE_SIZE_4096; } if (size > 4096) { pitch = 8192; dv_size = DC3_DV_LINE_SIZE_8192; } /* OVERRIDE SETTINGS FOR LINEAR PITCH */ if (mode_params->flags & VG_MODEFLAG_LINEARPITCH) { unsigned long max; if (pitch != size) { /* CALCULATE MAXIMUM ADDRESS (1K ALIGNED) */ max = size * output_height; max = (max + 0x3FF) & 0xFFFFFC00; WRITE_REG32(DC3_DV_TOP, max | DC3_DVTOP_ENABLE); gcfg |= DC3_GCFG_FDTY; pitch = size; } else { WRITE_REG32(DC3_DV_TOP, 0); } } /* WRITE PITCH AND DV RAM SETTINGS */ /* The DV RAM line length is programmed at a power of 2 boundary */ /* in case the user wants to toggle back to a power of 2 pitch */ /* later. It could happen... */ temp = READ_REG32(DC3_DV_CTL); WRITE_REG32(DC3_GFX_PITCH, pitch >> 3); WRITE_REG32(DC3_DV_CTL, (temp & ~DC3_DV_LINE_SIZE_MASK) | dv_size); /* SET THE LINE SIZE */ WRITE_REG32(DC3_LINE_SIZE, (line_size + 7) >> 3); /* ALWAYS ENABLE VIDEO AND GRAPHICS DATA */ /* These bits are relics from a previous design and */ /* should always be enabled. */ dcfg |= (DC3_DCFG_VDEN | DC3_DCFG_GDEN); /* SET PIXEL FORMAT */ dcfg |= bpp_mask; /* ENABLE TIMING GENERATOR, TIM. REG. UPDATES, PALETTE BYPASS */ /* AND VERT. INT. SELECT */ dcfg |= (unsigned long) (DC3_DCFG_TGEN | DC3_DCFG_TRUP | DC3_DCFG_PALB | DC3_DCFG_VISL); /* SET FIFO PRIORITIES AND DISPLAY FIFO LOAD ENABLE * Note that the bandwidth setting gets upgraded when scaling or flicker * filtering are enabled, as they require more data throughput. */ msr_read64(MSR_DEVICE_GEODELX_VG, DC3_SPARE_MSR, &msr_value); msr_value.low &= ~(DC3_SPARE_DISABLE_CFIFO_HGO | DC3_SPARE_VFIFO_ARB_SELECT | DC3_SPARE_LOAD_WM_LPEN_MASK | DC3_SPARE_WM_LPEN_OVRD | DC3_SPARE_DISABLE_INIT_VID_PRI | DC3_SPARE_DISABLE_VFIFO_WM); if ((mode_params->flags & VG_MODEFLAG_BANDWIDTHMASK) == VG_MODEFLAG_HIGH_BAND || ((mode_params->flags & VG_MODEFLAG_INTERLACED) && (mode_params->flags & VG_MODEFLAG_INT_MASK) == VG_MODEFLAG_INT_FLICKER) || (irq_ctl & DC3_IRQFILT_GFX_FILT_EN)) { /* HIGH BANDWIDTH */ /* Set agressive watermarks and disallow forced low priority */ gcfg |= 0x0000BA01; dcfg |= 0x000EA000; acfg = 0x001A0201; msr_value.low |= DC3_SPARE_DISABLE_CFIFO_HGO | DC3_SPARE_VFIFO_ARB_SELECT | DC3_SPARE_WM_LPEN_OVRD; } else if ((mode_params->flags & VG_MODEFLAG_BANDWIDTHMASK) == VG_MODEFLAG_AVG_BAND) { /* AVERAGE BANDWIDTH * Set average watermarks and allow small regions of forced low * priority. */ gcfg |= 0x0000B601; dcfg |= 0x00009000; acfg = 0x00160001; msr_value.low |= DC3_SPARE_DISABLE_CFIFO_HGO | DC3_SPARE_VFIFO_ARB_SELECT | DC3_SPARE_WM_LPEN_OVRD; /* SET THE NUMBER OF LOW PRIORITY LINES TO 1/2 THE TOTAL AVAILABLE */ temp = ((READ_REG32(DC3_V_ACTIVE_TIMING) >> 16) & 0x7FF) + 1; temp -= (READ_REG32(DC3_V_SYNC_TIMING) & 0x7FF) + 1; temp >>= 1; if (temp > 127) temp = 127; acfg |= temp << 9; } else if ((mode_params->flags & VG_MODEFLAG_BANDWIDTHMASK) == VG_MODEFLAG_LOW_BAND) { /* LOW BANDWIDTH * Set low watermarks and allow larger regions of forced low priority */ gcfg |= 0x00009501; dcfg |= 0x00008000; acfg = 0x00150001; msr_value.low |= DC3_SPARE_DISABLE_CFIFO_HGO | DC3_SPARE_VFIFO_ARB_SELECT | DC3_SPARE_WM_LPEN_OVRD; /* SET THE NUMBER OF LOW PRIORITY LINES TO 3/4 THE TOTAL AVAILABLE */ temp = ((READ_REG32(DC3_V_ACTIVE_TIMING) >> 16) & 0x7FF) + 1; temp -= (READ_REG32(DC3_V_SYNC_TIMING) & 0x7FF) + 1; temp = (temp * 3) >> 2; if (temp > 127) temp = 127; acfg |= temp << 9; } else { /* LEGACY CHARACTERISTICS */ /* Arbitration from a single set of watermarks. */ gcfg |= 0x0000B601; msr_value.low |= DC3_SPARE_DISABLE_VFIFO_WM | DC3_SPARE_DISABLE_INIT_VID_PRI; acfg = 0; } msr_write64(MSR_DEVICE_GEODELX_VG, DC3_SPARE_MSR, &msr_value); /* ENABLE FLAT PANEL CENTERING */ /* For panel modes having a resolution smaller than the */ /* panel resolution, turn on data centering. */ if (mode_params->flags & VG_MODEFLAG_CENTERED) dcfg |= DC3_DCFG_DCEN; /* COMBINE AND SET TIMING VALUES */ temp = (mode_params->hactive - 1) | ((mode_params->htotal - 1) << 16); WRITE_REG32(DC3_H_ACTIVE_TIMING, temp); temp = (mode_params->hblankstart - 1) | ((mode_params->hblankend - 1) << 16); WRITE_REG32(DC3_H_BLANK_TIMING, temp); temp = (mode_params->hsyncstart - 1) | ((mode_params->hsyncend - 1) << 16); WRITE_REG32(DC3_H_SYNC_TIMING, temp); temp = (mode_params->vactive - 1) | ((mode_params->vtotal - 1) << 16); WRITE_REG32(DC3_V_ACTIVE_TIMING, temp); temp = (mode_params->vblankstart - 1) | ((mode_params->vblankend - 1) << 16); WRITE_REG32(DC3_V_BLANK_TIMING, temp); temp = (mode_params->vsyncstart - 1) | ((mode_params->vsyncend - 1) << 16); WRITE_REG32(DC3_V_SYNC_TIMING, temp); temp = (mode_params->vactive_even - 1) | ((mode_params->vtotal_even - 1) << 16); WRITE_REG32(DC3_V_ACTIVE_EVEN, temp); temp = (mode_params->vblankstart_even - 1) | ((mode_params->vblankend_even - 1) << 16); WRITE_REG32(DC3_V_BLANK_EVEN, temp); temp = (mode_params->vsyncstart_even - 1) | ((mode_params->vsyncend_even - 1) << 16); WRITE_REG32(DC3_V_SYNC_EVEN, temp); /* SET THE VIDEO REQUEST REGISTER */ WRITE_VID32(DF_VIDEO_REQUEST, 0); /* SET SOURCE DIMENSIONS */ WRITE_REG32(DC3_FB_ACTIVE, ((starting_width - 1) << 16) | (starting_height - 1)); /* SET SYNC POLARITIES */ temp = READ_VID32(DF_DISPLAY_CONFIG); temp &= ~(DF_DCFG_CRT_SYNC_SKW_MASK | DF_DCFG_PWR_SEQ_DLY_MASK | DF_DCFG_CRT_HSYNC_POL | DF_DCFG_CRT_VSYNC_POL); temp |= DF_DCFG_CRT_SYNC_SKW_INIT | DF_DCFG_PWR_SEQ_DLY_INIT; if (mode_params->flags & VG_MODEFLAG_NEG_HSYNC) temp |= DF_DCFG_CRT_HSYNC_POL; if (mode_params->flags & VG_MODEFLAG_NEG_VSYNC) temp |= DF_DCFG_CRT_VSYNC_POL; WRITE_VID32(DF_DISPLAY_CONFIG, temp); WRITE_REG32(DC3_DISPLAY_CFG, dcfg); WRITE_REG32(DC3_ARB_CFG, acfg); WRITE_REG32(DC3_GENERAL_CFG, gcfg); /* RESTORE VALUE OF DC3_UNLOCK */ WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_bpp * * This routine changes the display BPP on the fly. It is intended only to * switch between pixel depths of the same pixel size 24<->32 or 15<->16, NOT * between pixel depths of differing sizes 16<->32 *--------------------------------------------------------------------------*/ int vg_set_display_bpp(int bpp) { unsigned long unlock, dcfg, bpp_mask; switch (bpp) { case 8: bpp_mask = DC3_DCFG_DISP_MODE_8BPP; break; case 24: bpp_mask = DC3_DCFG_DISP_MODE_24BPP; break; case 32: bpp_mask = DC3_DCFG_DISP_MODE_32BPP; break; case 12: bpp_mask = DC3_DCFG_DISP_MODE_16BPP | DC3_DCFG_12BPP; break; case 15: bpp_mask = DC3_DCFG_DISP_MODE_16BPP | DC3_DCFG_15BPP; break; case 16: bpp_mask = DC3_DCFG_DISP_MODE_16BPP | DC3_DCFG_16BPP; break; default: return CIM_STATUS_INVALIDPARAMS; } unlock = READ_REG32(DC3_UNLOCK); dcfg = READ_REG32(DC3_DISPLAY_CFG) & ~(DC3_DCFG_DISP_MODE_MASK | DC3_DCFG_16BPP_MODE_MASK); dcfg |= bpp_mask; WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_DISPLAY_CFG, dcfg); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_get_display_mode_index * * This routine searches the Cimarron mode table for a mode that matches the * input parameters. If a match is found, the return value is the index into * the mode table. If no match is found, the return value is -1. *--------------------------------------------------------------------------*/ int vg_get_display_mode_index(VG_QUERY_MODE * query) { unsigned int mode; unsigned long hz_flag = 0xFFFFFFFF; unsigned long bpp_flag = 0xFFFFFFFF; unsigned long enc_flag = 0xFFFFFFFF; unsigned long tv_flag = 0; unsigned long interlaced = 0; unsigned long halfclock = 0; long minimum = 0x7FFFFFFF; long diff; int match = -1; if (!query || !query->query_flags) return -1; if (query->query_flags & VG_QUERYFLAG_REFRESH) { /* SET FLAGS TO MATCH REFRESH RATE */ if (query->hz == 56) hz_flag = VG_SUPPORTFLAG_56HZ; else if (query->hz == 60) hz_flag = VG_SUPPORTFLAG_60HZ; else if (query->hz == 70) hz_flag = VG_SUPPORTFLAG_70HZ; else if (query->hz == 72) hz_flag = VG_SUPPORTFLAG_72HZ; else if (query->hz == 75) hz_flag = VG_SUPPORTFLAG_75HZ; else if (query->hz == 85) hz_flag = VG_SUPPORTFLAG_85HZ; else if (query->hz == 90) hz_flag = VG_SUPPORTFLAG_90HZ; else if (query->hz == 100) hz_flag = VG_SUPPORTFLAG_100HZ; else hz_flag = 0; } if (query->query_flags & VG_QUERYFLAG_BPP) { /* SET BPP FLAGS TO LIMIT MODE SELECTION */ if (query->bpp == 8) bpp_flag = VG_SUPPORTFLAG_8BPP; else if (query->bpp == 12) bpp_flag = VG_SUPPORTFLAG_12BPP; else if (query->bpp == 15) bpp_flag = VG_SUPPORTFLAG_15BPP; else if (query->bpp == 16) bpp_flag = VG_SUPPORTFLAG_16BPP; else if (query->bpp == 24) bpp_flag = VG_SUPPORTFLAG_24BPP; else if (query->bpp == 32) bpp_flag = VG_SUPPORTFLAG_32BPP; else bpp_flag = 0; } if (query->query_flags & VG_QUERYFLAG_ENCODER) { /* SET ENCODER FLAGS TO LIMIT MODE SELECTION */ if (query->encoder == VG_ENCODER_ADV7171) enc_flag = VG_SUPPORTFLAG_ADV7171; else if (query->encoder == VG_ENCODER_SAA7127) enc_flag = VG_SUPPORTFLAG_SAA7127; else if (query->encoder == VG_ENCODER_FS454) enc_flag = VG_SUPPORTFLAG_FS454; else if (query->encoder == VG_ENCODER_ADV7300) enc_flag = VG_SUPPORTFLAG_ADV7300; else enc_flag = 0; } if (query->query_flags & VG_QUERYFLAG_TVMODE) { /* SET ENCODER FLAGS TO LIMIT MODE SELECTION */ if (query->tvmode == VG_TVMODE_NTSC) tv_flag = VG_SUPPORTFLAG_NTSC; else if (query->tvmode == VG_TVMODE_PAL) tv_flag = VG_SUPPORTFLAG_PAL; else if (query->tvmode == VG_TVMODE_480P) tv_flag = VG_SUPPORTFLAG_480P; else if (query->tvmode == VG_TVMODE_720P) tv_flag = VG_SUPPORTFLAG_720P; else if (query->tvmode == VG_TVMODE_1080I) tv_flag = VG_SUPPORTFLAG_1080I; else if (query->tvmode == VG_TVMODE_6X4_NTSC) tv_flag = VG_SUPPORTFLAG_6X4_NTSC; else if (query->tvmode == VG_TVMODE_8X6_NTSC) tv_flag = VG_SUPPORTFLAG_8X6_NTSC; else if (query->tvmode == VG_TVMODE_10X7_NTSC) tv_flag = VG_SUPPORTFLAG_10X7_NTSC; else if (query->tvmode == VG_TVMODE_6X4_PAL) tv_flag = VG_SUPPORTFLAG_6X4_PAL; else if (query->tvmode == VG_TVMODE_8X6_PAL) tv_flag = VG_SUPPORTFLAG_8X6_PAL; else if (query->tvmode == VG_TVMODE_10X7_PAL) tv_flag = VG_SUPPORTFLAG_10X7_PAL; else tv_flag = 0xFFFFFFFF; } /* SET APPROPRIATE TV AND VOP FLAGS */ if (query->query_flags & VG_QUERYFLAG_INTERLACED) interlaced = query->interlaced ? VG_MODEFLAG_INTERLACED : 0; if (query->query_flags & VG_QUERYFLAG_HALFCLOCK) halfclock = query->halfclock ? VG_MODEFLAG_HALFCLOCK : 0; /* CHECK FOR INVALID REQUEST */ if (!hz_flag || !bpp_flag || !enc_flag || tv_flag == 0xFFFFFFFF) return -1; /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */ for (mode = 0; mode < NUM_CIMARRON_DISPLAY_MODES; mode++) { if ((!(query->query_flags & VG_QUERYFLAG_PANEL) || (CimarronDisplayModes[mode].internal_flags & VG_SUPPORTFLAG_PANEL)) && (!(query->query_flags & VG_QUERYFLAG_TVOUT) || (CimarronDisplayModes[mode].internal_flags & VG_SUPPORTFLAG_TVOUT)) && (!(query->query_flags & VG_QUERYFLAG_INTERLACED) || (CimarronDisplayModes[mode].flags & VG_MODEFLAG_INTERLACED) == interlaced) && (!(query->query_flags & VG_QUERYFLAG_HALFCLOCK) || (CimarronDisplayModes[mode].flags & VG_MODEFLAG_HALFCLOCK) == halfclock) && (!(query->query_flags & VG_QUERYFLAG_PANELWIDTH) || (CimarronDisplayModes[mode].panel_width == query->panel_width)) && (!(query->query_flags & VG_QUERYFLAG_PANELHEIGHT) || (CimarronDisplayModes[mode].panel_height == query->panel_height)) && (!(query->query_flags & VG_QUERYFLAG_ACTIVEWIDTH) || (CimarronDisplayModes[mode].hactive == query->active_width)) && (!(query->query_flags & VG_QUERYFLAG_ACTIVEHEIGHT) || (CimarronDisplayModes[mode].vactive == query->active_height)) && (!(query->query_flags & VG_QUERYFLAG_TOTALWIDTH) || (CimarronDisplayModes[mode].htotal == query->total_width)) && (!(query->query_flags & VG_QUERYFLAG_TOTALHEIGHT) || (CimarronDisplayModes[mode].vtotal == query->total_height)) && (!(query->query_flags & VG_QUERYFLAG_BPP) || (CimarronDisplayModes[mode].internal_flags & bpp_flag)) && (!(query->query_flags & VG_QUERYFLAG_REFRESH) || (CimarronDisplayModes[mode].internal_flags & hz_flag)) && (!(query->query_flags & VG_QUERYFLAG_ENCODER) || (CimarronDisplayModes[mode].internal_flags & enc_flag)) && (!(query->query_flags & VG_QUERYFLAG_TVMODE) || ((CimarronDisplayModes[mode].internal_flags & VG_SUPPORTFLAG_TVMODEMASK) == tv_flag)) && (!(query->query_flags & VG_QUERYFLAG_PIXELCLOCK) || (CimarronDisplayModes[mode].frequency == query->frequency))) { /* ALLOW SEARCHING BASED ON AN APPROXIMATE PIXEL CLOCK */ if (query->query_flags & VG_QUERYFLAG_PIXELCLOCK_APPROX) { diff = query->frequency - CimarronDisplayModes[mode].frequency; if (diff < 0) diff = -diff; if (diff < minimum) { minimum = diff; match = mode; } } else { match = mode; break; } } } /* RETURN DISPLAY MODE INDEX */ return match; } /*--------------------------------------------------------------------------- * vg_get_display_mode_information * * This routine retrieves all information for a display mode contained * within Cimarron's mode tables. *--------------------------------------------------------------------------*/ int vg_get_display_mode_information(unsigned int index, VG_DISPLAY_MODE * vg_mode) { if (index > NUM_CIMARRON_DISPLAY_MODES) return CIM_STATUS_INVALIDPARAMS; *vg_mode = CimarronDisplayModes[index]; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_get_display_mode_count * * This routine retrieves the count of all predefined Cimarron modes. *--------------------------------------------------------------------------*/ int vg_get_display_mode_count(void) { return NUM_CIMARRON_DISPLAY_MODES; } /*--------------------------------------------------------------------------- * vg_get_current_display_mode * * This routine retrieves the settings for the current display. This includes * any panel settings. *--------------------------------------------------------------------------*/ int vg_get_current_display_mode(VG_DISPLAY_MODE * current_display, int *bpp) { Q_WORD msr_value; unsigned long active, blank, sync; unsigned long i, m, n, p; unsigned long genlk, irq, temp; unsigned long flags = 0; unsigned long iflags = 0; /* READ THE CURRENT HORIZONTAL DISPLAY TIMINGS */ active = READ_REG32(DC3_H_ACTIVE_TIMING); blank = READ_REG32(DC3_H_BLANK_TIMING); sync = READ_REG32(DC3_H_SYNC_TIMING); current_display->hactive = (active & 0xFFF) + 1; current_display->hblankstart = (blank & 0xFFF) + 1; current_display->hsyncstart = (sync & 0xFFF) + 1; current_display->htotal = ((active >> 16) & 0xFFF) + 1; current_display->hblankend = ((blank >> 16) & 0xFFF) + 1; current_display->hsyncend = ((sync >> 16) & 0xFFF) + 1; /* READ THE CURRENT VERTICAL DISPLAY TIMINGS */ active = READ_REG32(DC3_V_ACTIVE_TIMING); blank = READ_REG32(DC3_V_BLANK_TIMING); sync = READ_REG32(DC3_V_SYNC_TIMING); current_display->vactive = (active & 0x7FF) + 1; current_display->vblankstart = (blank & 0x7FF) + 1; current_display->vsyncstart = (sync & 0x7FF) + 1; current_display->vtotal = ((active >> 16) & 0x7FF) + 1; current_display->vblankend = ((blank >> 16) & 0x7FF) + 1; current_display->vsyncend = ((sync >> 16) & 0x7FF) + 1; /* READ THE CURRENT EVEN FIELD VERTICAL DISPLAY TIMINGS */ active = READ_REG32(DC3_V_ACTIVE_EVEN); blank = READ_REG32(DC3_V_BLANK_EVEN); sync = READ_REG32(DC3_V_SYNC_EVEN); current_display->vactive_even = (active & 0x7FF) + 1; current_display->vblankstart_even = (blank & 0x7FF) + 1; current_display->vsyncstart_even = (sync & 0x7FF) + 1; current_display->vtotal_even = ((active >> 16) & 0x7FF) + 1; current_display->vblankend_even = ((blank >> 16) & 0x7FF) + 1; current_display->vsyncend_even = ((sync >> 16) & 0x7FF) + 1; /* READ THE CURRENT SOURCE DIMENSIONS */ /* The DC3_FB_ACTIVE register is only used when scaling is enabled. */ /* As the goal of this routine is to return a structure that can be */ /* passed to vg_set_custom_mode to exactly recreate the current mode, */ /* we must check the status of the scaler/filter. */ genlk = READ_REG32(DC3_GENLK_CTL); irq = READ_REG32(DC3_IRQ_FILT_CTL); temp = READ_REG32(DC3_FB_ACTIVE); current_display->src_height = (temp & 0xFFFF) + 1; current_display->src_width = ((temp >> 16) & 0xFFF8) + 8; /* READ THE CURRENT PANEL CONFIGURATION */ /* We can only infer some of the panel settings based on hardware */ /* (like when panning). We will instead assume that the current */ /* mode was set using Cimarron and use the panel variables inside */ /* Cimarron when returning the current mode information. */ if (vg3_panel_enable) { Q_WORD msr_value; flags |= VG_MODEFLAG_PANELOUT; current_display->panel_width = vg3_panel_width; current_display->panel_height = vg3_panel_height; current_display->mode_width = vg3_mode_width; current_display->mode_height = vg3_mode_height; if (READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_DCEN) flags |= VG_MODEFLAG_CENTERED; msr_read64(MSR_DEVICE_GEODELX_DF, DF_MSR_PAD_SEL, &msr_value); current_display->panel_tim1 = READ_VID32(DF_VIDEO_PANEL_TIM1); current_display->panel_tim2 = READ_VID32(DF_VIDEO_PANEL_TIM2); current_display->panel_dither_ctl = READ_VID32(DF_DITHER_CONTROL); current_display->panel_pad_sel_low = msr_value.low; current_display->panel_pad_sel_high = msr_value.high; } /* SET MISCELLANEOUS MODE FLAGS */ /* INTERLACED */ if (irq & DC3_IRQFILT_INTL_EN) { flags |= VG_MODEFLAG_INTERLACED; if (irq & DC3_IRQFILT_INTL_ADDR) flags |= VG_MODEFLAG_INT_ADDRESS; else if (genlk & DC3_GC_FLICKER_FILTER_ENABLE) flags |= VG_MODEFLAG_INT_FLICKER; else flags |= VG_MODEFLAG_INT_LINEDOUBLE; } /* POLARITIES */ temp = READ_VID32(DF_DISPLAY_CONFIG); if (temp & DF_DCFG_CRT_HSYNC_POL) flags |= VG_MODEFLAG_NEG_HSYNC; if (temp & DF_DCFG_CRT_VSYNC_POL) flags |= VG_MODEFLAG_NEG_VSYNC; /* BPP */ temp = READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_DISP_MODE_MASK; if (temp == DC3_DCFG_DISP_MODE_8BPP) { iflags |= VG_SUPPORTFLAG_8BPP; *bpp = 8; } else if (temp == DC3_DCFG_DISP_MODE_24BPP) { iflags |= VG_SUPPORTFLAG_24BPP; *bpp = 24; } else if (temp == DC3_DCFG_DISP_MODE_32BPP) { iflags |= VG_SUPPORTFLAG_32BPP; *bpp = 32; } else if (temp == DC3_DCFG_DISP_MODE_16BPP) { temp = READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_16BPP_MODE_MASK; if (temp == DC3_DCFG_16BPP) { iflags |= VG_SUPPORTFLAG_16BPP; *bpp = 16; } else if (temp == DC3_DCFG_15BPP) { iflags |= VG_SUPPORTFLAG_15BPP; *bpp = 15; } else if (temp == DC3_DCFG_12BPP) { iflags |= VG_SUPPORTFLAG_12BPP; *bpp = 12; } } /* TV RELATED FLAGS */ msr_read64(MSR_DEVICE_GEODELX_DF, DF_MSR_PAD_SEL, &msr_value); if (msr_value.high & DF_INVERT_VOP_CLOCK) flags |= VG_MODEFLAG_TVOUT; /* LINEAR PITCH */ temp = (READ_REG32(DC3_GFX_PITCH) & 0x0000FFFF) << 3; if (temp != 1024 && temp != 2048 && temp != 4096 && temp != 8192) flags |= VG_MODEFLAG_LINEARPITCH; /* SIMULTANEOUS CRT/FP */ msr_read64(MSR_DEVICE_GEODELX_DF, MSR_GEODELINK_CONFIG, &msr_value); if (msr_value.low & DF_SIMULTANEOUS_CRT_FP) flags |= VG_MODEFLAG_CRT_AND_FP; /* SET PLL-RELATED FLAGS */ msr_read64(MSR_DEVICE_GEODELX_GLCP, GLCP_DOTPLL, &msr_value); if (msr_value.high & GLCP_DOTPLL_DIV4) flags |= VG_MODEFLAG_QVGA; if (msr_value.low & GLCP_DOTPLL_HALFPIX) flags |= VG_MODEFLAG_HALFCLOCK; /* SAVE THE FLAGS IN THE MODE STRUCTURE */ current_display->internal_flags = iflags; current_display->flags = flags; /* READ PIXEL CLOCK FREQUENCY */ /* We first search for an exact match. If none is found, we try */ /* a fixed point calculation and return CIM_STATUS_INEXACTMATCH. */ for (i = 0; i < NUM_CIMARRON_PLL_FREQUENCIES; i++) { if (CimarronPLLFrequencies[i].pll_value == msr_value.high) break; } if (i == NUM_CIMARRON_PLL_FREQUENCIES) { /* ATTEMPT 16.16 CALCULATION */ /* We assume the input frequency is 48 MHz, which is represented */ /* in 16.16 fixed point as 0x300000. The PLL calculation is: */ /* n + 1 */ /* Fout = 48.000 * -------------- */ /* m + 1 * p + 1 */ p = msr_value.high & 0xF; n = (msr_value.high >> 4) & 0xFF; m = (msr_value.high >> 12) & 0x7; current_display->frequency = (0x300000 * (n + 1)) / ((p + 1) * (m + 1)); return CIM_STATUS_INEXACTMATCH; } current_display->frequency = CimarronPLLFrequencies[i].frequency; /* NOW SEARCH FOR AN IDENTICAL MODE */ /* This is just to inform the user that an exact match was found. */ /* With an exact match, the user can use the refresh rate flag that */ /* is returned in the VG_DISPLAY_MODE structure. */ for (i = 0; i < NUM_CIMARRON_DISPLAY_MODES; i++) { if ((CimarronDisplayModes[i].flags & current_display->flags) && CimarronDisplayModes[i].frequency == current_display->frequency && CimarronDisplayModes[i].hactive == current_display->hactive && CimarronDisplayModes[i].hblankstart == current_display->hblankstart && CimarronDisplayModes[i].hsyncstart == current_display->hsyncstart && CimarronDisplayModes[i].hsyncend == current_display->hsyncend && CimarronDisplayModes[i].hblankend == current_display->hblankend && CimarronDisplayModes[i].htotal == current_display->htotal && CimarronDisplayModes[i].vactive == current_display->vactive && CimarronDisplayModes[i].vblankstart == current_display->vblankstart && CimarronDisplayModes[i].vsyncstart == current_display->vsyncstart && CimarronDisplayModes[i].vsyncend == current_display->vsyncend && CimarronDisplayModes[i].vblankend == current_display->vblankend && CimarronDisplayModes[i].vtotal == current_display->vtotal) { break; } } if (i == NUM_CIMARRON_DISPLAY_MODES) return CIM_STATUS_INEXACTMATCH; current_display->internal_flags |= (CimarronDisplayModes[i].internal_flags & VG_SUPPORTFLAG_HZMASK); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_scaler_filter_coefficients * * This routine sets the vertical and horizontal filter coefficients for * graphics scaling. If either of the input arrays is specified as NULL, a * set of default coeffecients will be used. *--------------------------------------------------------------------------*/ int vg_set_scaler_filter_coefficients(long h_taps[][5], long v_taps[][3]) { unsigned long irqfilt, i; unsigned long temp0, temp1; unsigned long lock; /* ENABLE ACCESS TO THE HORIZONTAL COEFFICIENTS */ irqfilt = READ_REG32(DC3_IRQ_FILT_CTL); irqfilt |= DC3_IRQFILT_H_FILT_SEL; /* UNLOCK THE COEFFICIENT REGISTERS */ lock = READ_REG32(DC3_UNLOCK); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); /* WRITE COEFFICIENTS */ /* Coefficient indexes do not auto-increment, so we must */ /* write the address for every phase */ for (i = 0; i < 256; i++) { WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i)); if (!h_taps) { temp0 = CimarronHorizontalGraphicsFilter[i][0]; temp1 = CimarronHorizontalGraphicsFilter[i][1]; } else { temp0 = ((unsigned long) h_taps[i][0] & 0x3FF) | (((unsigned long) h_taps[i][1] & 0x3FF) << 10) | (((unsigned long) h_taps[i][2] & 0x3FF) << 20); temp1 = ((unsigned long) h_taps[i][3] & 0x3FF) | (((unsigned long) h_taps[i][4] & 0x3FF) << 10); } WRITE_REG32(DC3_FILT_COEFF1, temp0); WRITE_REG32(DC3_FILT_COEFF2, temp1); } /* ENABLE ACCESS TO THE VERTICAL COEFFICIENTS */ irqfilt &= ~DC3_IRQFILT_H_FILT_SEL; /* WRITE COEFFICIENTS */ for (i = 0; i < 256; i++) { WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i)); if (!v_taps) { temp0 = CimarronVerticalGraphicsFilter[i]; } else { temp0 = ((unsigned long) v_taps[i][0] & 0x3FF) | (((unsigned long) v_taps[i][1] & 0x3FF) << 10) | (((unsigned long) v_taps[i][2] & 0x3FF) << 20); } WRITE_REG32(DC3_FILT_COEFF1, temp0); } WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_configure_flicker_filter * * This routine updates the VG flicker filter settings when in an interlaced * mode. Note that flicker filtering is enabled inside a mode set. This routine * is provided to change from the default flicker filter setting of * 1/4, 1/2, 1/4. *--------------------------------------------------------------------------*/ int vg_configure_flicker_filter(unsigned long flicker_strength, int flicker_alpha) { unsigned long unlock; unsigned long genlk_ctl; /* CHECK FOR VALID FLICKER SETTING */ if (flicker_strength != VG_FLICKER_FILTER_NONE && flicker_strength != VG_FLICKER_FILTER_1_16 && flicker_strength != VG_FLICKER_FILTER_1_8 && flicker_strength != VG_FLICKER_FILTER_1_4 && flicker_strength != VG_FLICKER_FILTER_5_16) { return CIM_STATUS_INVALIDPARAMS; } unlock = READ_REG32(DC3_UNLOCK); genlk_ctl = READ_REG32(DC3_GENLK_CTL) & ~(DC3_GC_FLICKER_FILTER_MASK | DC3_GC_ALPHA_FLICK_ENABLE); genlk_ctl |= flicker_strength; if (flicker_alpha) genlk_ctl |= DC3_GC_ALPHA_FLICK_ENABLE; WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_GENLK_CTL, genlk_ctl); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_clock_frequency * * This routine sets the frequency of the dot clock. The input to this * routine is a 16.16 fraction. If an exact match is not found, this * routine will program the closest available frequency and return * CIM_STATUS_INEXACTMATCH. *--------------------------------------------------------------------------*/ int vg_set_clock_frequency(unsigned long frequency, unsigned long pll_flags) { Q_WORD msr_value; unsigned long timeout; unsigned long index = 0; unsigned long unlock, i; unsigned long pll_high, pll_low; long diff, min = 0; /* FIND THE REGISTER VALUES FOR THE DESIRED FREQUENCY */ /* Search the table for the closest frequency (16.16 format). */ /* This search is skipped if the user is manually specifying */ /* the MSR value. */ pll_low = 0; if (!(pll_flags & VG_PLL_MANUAL)) { min = (long) CimarronPLLFrequencies[0].frequency - (long) frequency; if (min < 0L) min = -min; for (i = 1; i < NUM_CIMARRON_PLL_FREQUENCIES; i++) { diff = (long) CimarronPLLFrequencies[i].frequency - (long) frequency; if (diff < 0L) diff = -diff; if (diff < min) { min = diff; index = i; } } pll_high = CimarronPLLFrequencies[index].pll_value & 0x00007FFF; } else { pll_high = frequency; } if (pll_flags & VG_PLL_DIVIDE_BY_2) pll_low |= GLCP_DOTPLL_HALFPIX; if (pll_flags & VG_PLL_DIVIDE_BY_4) pll_high |= GLCP_DOTPLL_DIV4; if (pll_flags & VG_PLL_BYPASS) pll_low |= GLCP_DOTPLL_BYPASS; if (pll_flags & VG_PLL_VIP_CLOCK) pll_high |= GLCP_DOTPLL_VIPCLK; /* VERIFY THAT WE ARE NOT WRITING WHAT IS ALREADY IN THE REGISTERS */ /* The Dot PLL reset bit is tied to VDD for flat panels. This can */ /* cause a brief drop in flat panel power, which can cause serious */ /* glitches on some panels. */ msr_read64(MSR_DEVICE_GEODELX_GLCP, GLCP_DOTPLL, &msr_value); if ((msr_value.low & GLCP_DOTPLL_LOCK) && ((msr_value.low & (GLCP_DOTPLL_HALFPIX | GLCP_DOTPLL_BYPASS)) == pll_low) && (msr_value.high == pll_high)) { return CIM_STATUS_OK; } /* PROGRAM THE SETTINGS WITH THE RESET BIT SET */ /* Clear the bypass bit to ensure that the programmed */ /* M, N and P values are being used. */ msr_value.high = pll_high; msr_value.low &= ~(GLCP_DOTPLL_BYPASS | GLCP_DOTPLL_HALFPIX); msr_value.low |= (pll_low | 0x00000001); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DOTPLL, &msr_value); /* WAIT FOR THE LOCK BIT */ /* The PLL spec states that the PLL may take up to 100 us to */ /* properly lock. Furthermore, the lock signal is not 100% */ /* reliable. To address this, we add a hefty delay followed */ /* by a polling loop that times out after a 1000 reads. */ unlock = READ_REG32(DC3_UNLOCK); for (timeout = 0; timeout < 1280; timeout++) WRITE_REG32(DC3_UNLOCK, unlock); for (timeout = 0; timeout < 1000; timeout++) { msr_read64(MSR_DEVICE_GEODELX_GLCP, GLCP_DOTPLL, &msr_value); if (msr_value.low & GLCP_DOTPLL_LOCK) break; } /* CLEAR THE RESET BIT */ msr_value.low &= 0xFFFFFFFE; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DOTPLL, &msr_value); /* DID THE PLL SUCCESSFULLY LOCK? */ if (!(msr_value.low & GLCP_DOTPLL_LOCK)) return CIM_STATUS_NOLOCK; /* RETURN THE APPROPRIATE CODE */ if (min == 0) return CIM_STATUS_OK; else return CIM_STATUS_INEXACTMATCH; } /*--------------------------------------------------------------------------- * vg_set_border_color * * This routine sets the color used as the border in centered panel modes. *--------------------------------------------------------------------------*/ int vg_set_border_color(unsigned long border_color) { unsigned long lock = READ_REG32(DC3_UNLOCK); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_PAL_ADDRESS, 0x104); WRITE_REG32(DC3_PAL_DATA, border_color); WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_cursor_enable * * This routine enables or disables the hardware cursor. This routine should * only be called after the hardware cursor has been completely configured. *--------------------------------------------------------------------------*/ int vg_set_cursor_enable(int enable) { unsigned long unlock, gcfg; /* SET OR CLEAR CURSOR ENABLE BIT */ unlock = READ_REG32(DC3_UNLOCK); gcfg = READ_REG32(DC3_GENERAL_CFG); if (enable) gcfg |= DC3_GCFG_CURE; else gcfg &= ~(DC3_GCFG_CURE); /* WRITE NEW REGISTER VALUE */ WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_GENERAL_CFG, gcfg); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_mono_cursor_colors * * This routine sets the colors of the hardware monochrome cursor. *--------------------------------------------------------------------------*/ int vg_set_mono_cursor_colors(unsigned long bkcolor, unsigned long fgcolor) { unsigned long lock = READ_REG32(DC3_UNLOCK); /* SET CURSOR COLORS */ WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_PAL_ADDRESS, 0x100); WRITE_REG32(DC3_PAL_DATA, bkcolor); WRITE_REG32(DC3_PAL_DATA, fgcolor); WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_cursor_position * * This routine sets the position of the hardware cursor. The cursor hotspots * and memory offset must have been specified in an earlier call to * a vg_set_cursor_shape_XX routine. The coordinates passed to this routine * generally specify the focal point of the cursor, NOT the upper left * coordinate of the cursor pattern. However, for operating systems that do * not include a hotspot the input parameters may be negative. *--------------------------------------------------------------------------*/ int vg_set_cursor_position(long xpos, long ypos, VG_PANNING_COORDINATES * panning) { unsigned long unlock, memoffset; unsigned long gcfg; long x, xoffset; long y, yoffset; memoffset = vg3_cursor_offset; x = xpos - (long) vg3_x_hotspot; y = ypos - (long) vg3_y_hotspot; /* HANDLE NEGATIVE COORDINATES */ /* This routine supports operating systems that use negative */ /* coordinates, instead of positive coordinates with an appropriate */ /* hotspot. */ if (xpos < 0) xpos = 0; if (ypos < 0) ypos = 0; if (x < -63) return CIM_STATUS_INVALIDPARAMS; if (y < -63) return CIM_STATUS_INVALIDPARAMS; if (vg3_panel_enable) { if ((vg3_mode_width > vg3_panel_width) || (vg3_mode_height > vg3_panel_height)) { vg_pan_desktop(xpos, ypos, panning); x = x - (unsigned short) vg3_delta_x; y = y - (unsigned short) vg3_delta_y; } else { panning->start_x = 0; panning->start_y = 0; panning->start_updated = 0; } } /* ADJUST OFFSETS */ /* Cursor movement and panning work as follows: The cursor position */ /* refers to where the hotspot of the cursor is located. However, for */ /* non-zero hotspots, the cursor buffer actually begins before the */ /* specified position. */ if (x < 0) { xoffset = -x; x = 0; } else { xoffset = 0; } if (y < 0) { yoffset = -y; y = 0; } else { yoffset = 0; } if (vg3_color_cursor) memoffset += (unsigned long) yoffset *192; else memoffset += (unsigned long) yoffset << 4; /* SET COLOR CURSOR BIT */ gcfg = READ_REG32(DC3_GENERAL_CFG); if (vg3_color_cursor) gcfg |= DC3_GCFG_CLR_CUR; else gcfg &= ~DC3_GCFG_CLR_CUR; /* SET CURSOR POSITION */ unlock = READ_REG32(DC3_UNLOCK); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_CURS_ST_OFFSET, memoffset); WRITE_REG32(DC3_GENERAL_CFG, gcfg); WRITE_REG32(DC3_CURSOR_X, (unsigned long) x | (((unsigned long) xoffset) << 11)); WRITE_REG32(DC3_CURSOR_Y, (unsigned long) y | (((unsigned long) yoffset) << 11)); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_mono_cursor_shape32 * * This routine loads 32x32 cursor data into the cursor buffer in graphics * memory. The outside of the GeodeLX cursor buffer is padded with * transparency. *--------------------------------------------------------------------------*/ int vg_set_mono_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask, unsigned long x_hotspot, unsigned long y_hotspot) { int i; /* SAVE THE CURSOR OFFSET AND HOTSPOTS */ /* These are reused later when updating the cursor position, panning */ /* and clipping the cursor pointer. */ vg3_x_hotspot = x_hotspot; vg3_y_hotspot = y_hotspot; vg3_cursor_offset = memoffset; vg3_color_cursor = 0; for (i = 0; i < 32; i++) { /* EVEN QWORDS CONTAIN THE AND MASK */ WRITE_FB32(memoffset, 0xFFFFFFFF); WRITE_FB32(memoffset + 4, andmask[i]); /* ODD QWORDS CONTAIN THE XOR MASK */ WRITE_FB32(memoffset + 8, 0x00000000); WRITE_FB32(memoffset + 12, xormask[i]); memoffset += 16; } /* FILL THE LOWER HALF OF THE BUFFER WITH TRANSPARENT PIXELS */ for (i = 0; i < 32; i++) { WRITE_FB32(memoffset, 0xFFFFFFFF); WRITE_FB32(memoffset + 4, 0xFFFFFFFF); WRITE_FB32(memoffset + 8, 0x00000000); WRITE_FB32(memoffset + 12, 0x00000000); memoffset += 16; } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_mono_cursor_shape64 * * This routine loads 64x64 cursor data into the cursor buffer in graphics * memory. *--------------------------------------------------------------------------*/ int vg_set_mono_cursor_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask, unsigned long x_hotspot, unsigned long y_hotspot) { int i; /* SAVE THE CURSOR OFFSET AND HOTSPOTS */ /* These are reused later when updating the cursor position, panning */ /* and clipping the cursor pointer. */ vg3_x_hotspot = x_hotspot; vg3_y_hotspot = y_hotspot; vg3_cursor_offset = memoffset; vg3_color_cursor = 0; for (i = 0; i < 128; i += 2) { /* EVEN QWORDS CONTAIN THE AND MASK */ /* We invert the dwords to prevent the calling */ /* application from having to think in terms of Qwords. */ /* The hardware data order is actually 63:0, or 31:0 of */ /* the second dword followed by 31:0 of the first dword. */ WRITE_FB32(memoffset, andmask[i + 1]); WRITE_FB32(memoffset + 4, andmask[i]); /* ODD QWORDS CONTAIN THE XOR MASK */ WRITE_FB32(memoffset + 8, xormask[i + 1]); WRITE_FB32(memoffset + 12, xormask[i]); memoffset += 16; } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_color_cursor_shape * * This routine loads 8:8:8:8 cursor data into the color cursor buffer. *--------------------------------------------------------------------------*/ int vg_set_color_cursor_shape(unsigned long memoffset, unsigned char *data, unsigned long width, unsigned long height, long pitch, unsigned long x_hotspot, unsigned long y_hotspot) { unsigned long y; /* SAVE THE CURSOR OFFSET AND HOTSPOTS */ /* These are reused later when updating the cursor position, panning */ /* and clipping the cursor pointer. */ vg3_x_hotspot = x_hotspot; vg3_y_hotspot = y_hotspot; vg3_cursor_offset = memoffset; vg3_color_cursor = 1; /* WRITE THE CURSOR DATA */ /* The outside edges of the color cursor are filled with transparency */ /* The cursor buffer dimensions are 48x64. */ for (y = 0; y < height; y++) { /* WRITE THE ACTIVE AND TRANSPARENT DATA */ /* We implement this as a macro in our dedication to squeaking */ /* every ounce of performance out of our code... */ WRITE_FB_STRING32(memoffset, data, width); WRITE_FB_CONSTANT((memoffset + (width << 2)), 0, (48 - width)); /* INCREMENT PAST THE LINE */ memoffset += 192; data += pitch; } /* WRITE THE EXTRA TRANSPARENT LINES */ /* Write the lines in one big bulk setting. */ WRITE_FB_CONSTANT(memoffset, 0, ((64 - height) * 48)); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_pan_desktop * * This routine sets the correct display offset based on the current cursor * position. *--------------------------------------------------------------------------*/ int vg_pan_desktop(unsigned long x, unsigned long y, VG_PANNING_COORDINATES * panning) { unsigned long modeShiftPerPixel; unsigned long modeBytesPerScanline; unsigned long startAddress; /* TEST FOR NO-WORK */ if (x >= vg3_delta_x && x < (vg3_panel_width + vg3_delta_x) && y >= vg3_delta_y && y < (vg3_panel_height + vg3_delta_y)) { panning->start_x = vg3_delta_x; panning->start_y = vg3_delta_y; panning->start_updated = 0; return CIM_STATUS_OK; } if (vg3_bpp == 24) modeShiftPerPixel = 2; else modeShiftPerPixel = (vg3_bpp + 7) >> 4; modeBytesPerScanline = (READ_REG32(DC3_GFX_PITCH) & 0x0000FFFF) << 3; /* ADJUST PANNING VARIABLES WHEN CURSOR EXCEEDS BOUNDARY */ /* Test the boundary conditions for each coordinate and update */ /* all variables and the starting offset accordingly. */ if (x < vg3_delta_x) vg3_delta_x = x; else if (x >= (vg3_delta_x + vg3_panel_width)) vg3_delta_x = x - vg3_panel_width + 1; if (y < vg3_delta_y) vg3_delta_y = y; else if (y >= (vg3_delta_y + vg3_panel_height)) vg3_delta_y = y - vg3_panel_height + 1; /* CALCULATE THE START OFFSET */ startAddress = (vg3_delta_x << modeShiftPerPixel) + (vg3_delta_y * modeBytesPerScanline); vg_set_display_offset(startAddress); panning->start_updated = 1; panning->start_x = vg3_delta_x; panning->start_y = vg3_delta_y; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_display_offset * * This routine sets the start address of the frame buffer. It is * typically used to pan across a virtual desktop (frame buffer larger than * the displayed screen) or to flip the display between multiple buffers. *--------------------------------------------------------------------------*/ int vg_set_display_offset(unsigned long address) { unsigned long lock, gcfg; lock = READ_REG32(DC3_UNLOCK); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); /* DISABLE COMPRESSION */ /* When setting a non-zero display offset, we must disable display */ /* compression. We could maintain a variable and re-enable */ /* compression when the offset returns to zero. However, that */ /* creates additional complexity for applications that perform */ /* graphics animation. Re-enabling compression each time would */ /* be tedious and slow for such applications, implying that they */ /* would have to disable compression before starting the animation. */ /* We will instead disable compression and force the user to */ /* re-enable compression when they are ready. */ if (address != 0) { if (READ_REG32(DC3_GENERAL_CFG) & DC3_GCFG_CMPE) { gcfg = READ_REG32(DC3_GENERAL_CFG); WRITE_REG32(DC3_GENERAL_CFG, (gcfg & ~(DC3_GCFG_CMPE | DC3_GCFG_DECE))); } } WRITE_REG32(DC3_FB_ST_OFFSET, address); WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_display_pitch * * This routine sets the stride between successive lines of data in the frame * buffer. *--------------------------------------------------------------------------*/ int vg_set_display_pitch(unsigned long pitch) { unsigned long temp, dvsize, dvtop, value; unsigned long lock = READ_REG32(DC3_UNLOCK); value = READ_REG32(DC3_GFX_PITCH) & 0xFFFF0000; value |= (pitch >> 3); /* PROGRAM THE DISPLAY PITCH */ WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_GFX_PITCH, value); /* SET THE COMPRESSION BEHAVIOR BASED ON THE PITCH */ /* Strides that are not a power of two will not work with line */ /* by line compression. For these cases, we enable full-screen */ /* compression. In this mode, any write to the frame buffer */ /* region marks the entire frame as dirty. Also, the DV line */ /* size must be updated when the pitch is programmed outside of */ /* the power of 2 range specified in a mode set. */ if (pitch > 4096) { dvsize = DC3_DV_LINE_SIZE_8192; } else if (pitch > 2048) { dvsize = DC3_DV_LINE_SIZE_4096; } else if (pitch > 1024) { dvsize = DC3_DV_LINE_SIZE_2048; } else { dvsize = DC3_DV_LINE_SIZE_1024; } temp = READ_REG32(DC3_DV_CTL); WRITE_REG32(DC3_DV_CTL, (temp & ~DC3_DV_LINE_SIZE_MASK) | dvsize | 0x00000001); value = READ_REG32(DC3_GENERAL_CFG); if (pitch == 1024 || pitch == 2048 || pitch == 4096 || pitch == 8192) { value &= ~DC3_GCFG_FDTY; dvtop = 0; } else { value |= DC3_GCFG_FDTY; dvtop = (READ_REG32(DC3_FB_ACTIVE) & 0xFFF) + 1; dvtop = ((dvtop * pitch) + 0x3FF) & 0xFFFFFC00; dvtop |= DC3_DVTOP_ENABLE; } WRITE_REG32(DC3_GENERAL_CFG, value); WRITE_REG32(DC3_DV_TOP, dvtop); WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_display_palette_entry * * This routine sets a single 8BPP palette entry in the display controller. *--------------------------------------------------------------------------*/ int vg_set_display_palette_entry(unsigned long index, unsigned long palette) { unsigned long dcfg, unlock; if (index > 0xFF) return CIM_STATUS_INVALIDPARAMS; unlock = READ_REG32(DC3_UNLOCK); dcfg = READ_REG32(DC3_DISPLAY_CFG); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_DISPLAY_CFG, dcfg & ~DC3_DCFG_PALB); WRITE_REG32(DC3_UNLOCK, unlock); WRITE_REG32(DC3_PAL_ADDRESS, index); WRITE_REG32(DC3_PAL_DATA, palette); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_set_display_palette * * This routine sets the entire palette in the display controller. * A pointer is provided to a 256 entry table of 32-bit X:R:G:B values. *--------------------------------------------------------------------------*/ int vg_set_display_palette(unsigned long *palette) { unsigned long unlock, dcfg, i; WRITE_REG32(DC3_PAL_ADDRESS, 0); if (palette) { unlock = READ_REG32(DC3_UNLOCK); dcfg = READ_REG32(DC3_DISPLAY_CFG); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_DISPLAY_CFG, dcfg & ~DC3_DCFG_PALB); WRITE_REG32(DC3_UNLOCK, unlock); for (i = 0; i < 256; i++) WRITE_REG32(DC3_PAL_DATA, palette[i]); return CIM_STATUS_OK; } return CIM_STATUS_INVALIDPARAMS; } /*--------------------------------------------------------------------------- * vg_set_compression_enable * * This routine enables or disables display compression. *--------------------------------------------------------------------------*/ int vg_set_compression_enable(int enable) { Q_WORD msr_value; unsigned long unlock, gcfg; unsigned long temp; unlock = READ_REG32(DC3_UNLOCK); gcfg = READ_REG32(DC3_GENERAL_CFG); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); if (enable) { /* DO NOT ENABLE IF THE DISPLAY OFFSET IS NOT ZERO */ if (READ_REG32(DC3_FB_ST_OFFSET) & 0x0FFFFFFF) return CIM_STATUS_ERROR; /* ENABLE BIT 1 IN THE VG SPARE MSR * The bus can hang when the VG attempts to merge compression writes. * No performance is lost due to the GeodeLink QUACK features in * GeodeLX. We also enable the command word check for a valid * compression header. */ msr_read64(MSR_DEVICE_GEODELX_VG, DC3_SPARE_MSR, &msr_value); msr_value.low |= DC3_SPARE_FIRST_REQ_MASK; msr_value.low &= ~DC3_SPARE_DISABLE_CWD_CHECK; msr_write64(MSR_DEVICE_GEODELX_VG, DC3_SPARE_MSR, &msr_value); /* CLEAR DIRTY/VALID BITS IN MEMORY CONTROLLER * We don't want the controller to think that old lines are still * valid. Writing a 1 to bit 0 of the DV Control register will force * the hardware to clear all the valid bits. */ temp = READ_REG32(DC3_DV_CTL); WRITE_REG32(DC3_DV_CTL, temp | 0x00000001); /* ENABLE COMPRESSION BITS */ gcfg |= DC3_GCFG_CMPE | DC3_GCFG_DECE; } else { gcfg &= ~(DC3_GCFG_CMPE | DC3_GCFG_DECE); } WRITE_REG32(DC3_GENERAL_CFG, gcfg); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_configure_compression * * This routine configures all aspects of display compression, including * pitch, size and the offset of the compression buffer. *--------------------------------------------------------------------------*/ int vg_configure_compression(VG_COMPRESSION_DATA * comp_data) { unsigned long delta, size; unsigned long comp_size, unlock; /* CHECK FOR VALID PARAMETERS */ /* The maximum size for the compression buffer is 544 bytes (with */ /* the header) Also, the pitch cannot be less than the line size */ /* and the compression buffer offset must be 16-byte aligned. */ if (comp_data->size > 544 || comp_data->pitch < comp_data->size || comp_data->compression_offset & 0x0F) { return CIM_STATUS_INVALIDPARAMS; } /* SUBTRACT 32 FROM SIZE */ /* The display controller will actually write 4 extra QWords. So, */ /* if we assume that "size" refers to the allocated size, we must */ /* subtract 32 bytes. */ comp_size = comp_data->size - 32; /* CALCULATE REGISTER VALUES */ unlock = READ_REG32(DC3_UNLOCK); size = READ_REG32(DC3_LINE_SIZE) & ~DC3_LINE_SIZE_CBLS_MASK; delta = READ_REG32(DC3_GFX_PITCH) & ~DC3_GFX_PITCH_CBP_MASK; size |= ((comp_size >> 3) + 1) << DC3_LINE_SIZE_CB_SHIFT; delta |= ((comp_data->pitch >> 3) << 16); /* WRITE COMPRESSION PARAMETERS */ WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_CB_ST_OFFSET, comp_data->compression_offset); WRITE_REG32(DC3_LINE_SIZE, size); WRITE_REG32(DC3_GFX_PITCH, delta); WRITE_REG32(DC3_UNLOCK, unlock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_test_timing_active * * This routine checks the status of the display timing generator. *--------------------------------------------------------------------------*/ int vg_test_timing_active(void) { if (READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_TGEN) return 1; return 0; } /*--------------------------------------------------------------------------- * vg_test_vertical_active * * This routine checks if the display is currently in the middle of a frame * (not in the VBlank interval) *--------------------------------------------------------------------------*/ int vg_test_vertical_active(void) { if (READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VNA) return 0; return 1; } /*--------------------------------------------------------------------------- * vg_wait_vertical_blank * * This routine waits until the beginning of the vertical blank interval. * When the display is already in vertical blank, this routine will wait until * the beginning of the next vertical blank. *--------------------------------------------------------------------------*/ int vg_wait_vertical_blank(void) { if (vg_test_timing_active()) { while (!vg_test_vertical_active()); while (vg_test_vertical_active()); } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_test_even_field * * This routine tests the odd/even status of the current VG output field. *--------------------------------------------------------------------------*/ int vg_test_even_field(void) { if (READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_EVEN_FIELD) return 1; return 0; } /*--------------------------------------------------------------------------- * vg_configure_line_interrupt * * This routine configures the display controller's line count interrupt. * This interrupt can be used to interrupt mid-frame or to interrupt at the * beginning of vertical blank. *--------------------------------------------------------------------------*/ int vg_configure_line_interrupt(VG_INTERRUPT_PARAMS * interrupt_info) { unsigned long irq_line, irq_enable; unsigned long lock; irq_line = READ_REG32(DC3_IRQ_FILT_CTL); irq_enable = READ_REG32(DC3_IRQ); lock = READ_REG32(DC3_UNLOCK); irq_line = (irq_line & ~DC3_IRQFILT_LINE_MASK) | ((interrupt_info->line << 16) & DC3_IRQFILT_LINE_MASK); /* ENABLE OR DISABLE THE INTERRUPT */ /* The line count is set before enabling and after disabling to */ /* minimize spurious interrupts. The line count is set even */ /* when interrupts are disabled to allow polling-based or debug */ /* applications. */ WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); if (interrupt_info->enable) { WRITE_REG32(DC3_IRQ_FILT_CTL, irq_line); WRITE_REG32(DC3_IRQ, ((irq_enable & ~DC3_IRQ_MASK) | DC3_IRQ_STATUS)); } else { WRITE_REG32(DC3_IRQ, (irq_enable | DC3_IRQ_MASK)); WRITE_REG32(DC3_IRQ_FILT_CTL, irq_line); } WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_test_and_clear_interrupt * * This routine resets any pending interrupt in the video generator. The * return value indicates the interrupt status prior to the reset. *--------------------------------------------------------------------------*/ unsigned long vg_test_and_clear_interrupt(void) { unsigned long irq_enable; unsigned long lock; irq_enable = READ_REG32(DC3_IRQ); lock = READ_REG32(DC3_UNLOCK); /* NO ACTION IF INTERRUPTS ARE MASKED */ /* We are assuming that a driver or application will not want to receive */ /* the status of the interrupt when it is masked. */ if ((irq_enable & (DC3_IRQ_MASK | DC3_VSYNC_IRQ_MASK)) == (DC3_IRQ_MASK | DC3_VSYNC_IRQ_MASK)) return 0; WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_IRQ, irq_enable); WRITE_REG32(DC3_UNLOCK, lock); return (irq_enable & (DC3_IRQ_STATUS | DC3_VSYNC_IRQ_STATUS)); } /*--------------------------------------------------------------------------- * vg_test_flip_status * * This routine tests if a new display offset has been latched. *--------------------------------------------------------------------------*/ unsigned long vg_test_flip_status(void) { return (READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_FLIP); } /*--------------------------------------------------------------------------- * vg_save_state * * This routine saves all persistent VG state information. *--------------------------------------------------------------------------*/ int vg_save_state(VG_SAVE_RESTORE * vg_state) { Q_WORD msr_value; unsigned long irqfilt; unsigned long offset, i; unsigned long lock; /* READ ALL CURRENT REGISTER SETTINGS */ vg_state->unlock = READ_REG32(DC3_UNLOCK); vg_state->gcfg = READ_REG32(DC3_GENERAL_CFG); vg_state->dcfg = READ_REG32(DC3_DISPLAY_CFG); vg_state->arb_cfg = READ_REG32(DC3_ARB_CFG); vg_state->fb_offset = READ_REG32(DC3_FB_ST_OFFSET); vg_state->cb_offset = READ_REG32(DC3_CB_ST_OFFSET); vg_state->cursor_offset = READ_REG32(DC3_CURS_ST_OFFSET); vg_state->video_y_offset = READ_REG32(DC3_VID_Y_ST_OFFSET); vg_state->video_u_offset = READ_REG32(DC3_VID_U_ST_OFFSET); vg_state->video_v_offset = READ_REG32(DC3_VID_V_ST_OFFSET); vg_state->dv_top = READ_REG32(DC3_DV_TOP); vg_state->line_size = READ_REG32(DC3_LINE_SIZE); vg_state->gfx_pitch = READ_REG32(DC3_GFX_PITCH); vg_state->video_yuv_pitch = READ_REG32(DC3_VID_YUV_PITCH); vg_state->h_active = READ_REG32(DC3_H_ACTIVE_TIMING); vg_state->h_blank = READ_REG32(DC3_H_BLANK_TIMING); vg_state->h_sync = READ_REG32(DC3_H_SYNC_TIMING); vg_state->v_active = READ_REG32(DC3_V_ACTIVE_TIMING); vg_state->v_blank = READ_REG32(DC3_V_BLANK_TIMING); vg_state->v_sync = READ_REG32(DC3_V_SYNC_TIMING); vg_state->fb_active = READ_REG32(DC3_FB_ACTIVE); vg_state->cursor_x = READ_REG32(DC3_CURSOR_X); vg_state->cursor_y = READ_REG32(DC3_CURSOR_Y); vg_state->vid_ds_delta = READ_REG32(DC3_VID_DS_DELTA); vg_state->fb_base = READ_REG32(DC3_PHY_MEM_OFFSET); vg_state->dv_ctl = READ_REG32(DC3_DV_CTL); vg_state->gfx_scale = READ_REG32(DC3_GFX_SCALE); vg_state->irq_ctl = READ_REG32(DC3_IRQ_FILT_CTL); vg_state->vbi_even_ctl = READ_REG32(DC3_VBI_EVEN_CTL); vg_state->vbi_odd_ctl = READ_REG32(DC3_VBI_ODD_CTL); vg_state->vbi_hor_ctl = READ_REG32(DC3_VBI_HOR); vg_state->vbi_odd_line_enable = READ_REG32(DC3_VBI_LN_ODD); vg_state->vbi_even_line_enable = READ_REG32(DC3_VBI_LN_EVEN); vg_state->vbi_pitch = READ_REG32(DC3_VBI_PITCH); vg_state->color_key = READ_REG32(DC3_COLOR_KEY); vg_state->color_key_mask = READ_REG32(DC3_COLOR_MASK); vg_state->color_key_x = READ_REG32(DC3_CLR_KEY_X); vg_state->color_key_y = READ_REG32(DC3_CLR_KEY_Y); vg_state->irq = READ_REG32(DC3_IRQ); vg_state->genlk_ctl = READ_REG32(DC3_GENLK_CTL); vg_state->vid_y_even_offset = READ_REG32(DC3_VID_EVEN_Y_ST_OFFSET); vg_state->vid_u_even_offset = READ_REG32(DC3_VID_EVEN_U_ST_OFFSET); vg_state->vid_v_even_offset = READ_REG32(DC3_VID_EVEN_V_ST_OFFSET); vg_state->vactive_even = READ_REG32(DC3_V_ACTIVE_EVEN); vg_state->vblank_even = READ_REG32(DC3_V_BLANK_EVEN); vg_state->vsync_even = READ_REG32(DC3_V_SYNC_EVEN); /* READ THE CURRENT PALETTE */ lock = READ_REG32(DC3_UNLOCK); WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_PAL_ADDRESS, 0); for (i = 0; i < 261; i++) vg_state->palette[i] = READ_REG32(DC3_PAL_DATA); /* READ THE CURRENT FILTER COEFFICIENTS */ /* ENABLE ACCESS TO THE HORIZONTAL COEFFICIENTS */ irqfilt = READ_REG32(DC3_IRQ_FILT_CTL); irqfilt |= DC3_IRQFILT_H_FILT_SEL; /* READ HORIZONTAL COEFFICIENTS */ for (i = 0; i < 256; i++) { WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i)); vg_state->h_coeff[(i << 1)] = READ_REG32(DC3_FILT_COEFF1); vg_state->h_coeff[(i << 1) + 1] = READ_REG32(DC3_FILT_COEFF2); } /* ENABLE ACCESS TO THE VERTICAL COEFFICIENTS */ irqfilt &= ~DC3_IRQFILT_H_FILT_SEL; /* READ COEFFICIENTS */ for (i = 0; i < 256; i++) { WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i)); vg_state->v_coeff[i] = READ_REG32(DC3_FILT_COEFF1); } /* READ THE CURSOR DATA */ offset = READ_REG32(DC3_CURS_ST_OFFSET) & 0x0FFFFFFF; for (i = 0; i < 3072; i++) vg_state->cursor_data[i] = READ_FB32(offset + (i << 2)); /* READ THE CURRENT PLL */ msr_read64(MSR_DEVICE_GEODELX_GLCP, GLCP_DOTPLL, &msr_value); vg_state->pll_flags = 0; for (i = 0; i < NUM_CIMARRON_PLL_FREQUENCIES; i++) { if (CimarronPLLFrequencies[i].pll_value == (msr_value.high & 0x7FFF)) { vg_state->dot_pll = CimarronPLLFrequencies[i].frequency; break; } } if (i == NUM_CIMARRON_PLL_FREQUENCIES) { /* NO MATCH */ /* Enter the frequency as a manual frequency. */ vg_state->dot_pll = msr_value.high; vg_state->pll_flags |= VG_PLL_MANUAL; } if (msr_value.low & GLCP_DOTPLL_HALFPIX) vg_state->pll_flags |= VG_PLL_DIVIDE_BY_2; if (msr_value.low & GLCP_DOTPLL_BYPASS) vg_state->pll_flags |= VG_PLL_BYPASS; if (msr_value.high & GLCP_DOTPLL_DIV4) vg_state->pll_flags |= VG_PLL_DIVIDE_BY_4; if (msr_value.high & GLCP_DOTPLL_VIPCLK) vg_state->pll_flags |= VG_PLL_VIP_CLOCK; /* READ ALL VG MSRS */ msr_read64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_CAP, &(vg_state->msr_cap)); msr_read64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_CONFIG, &(vg_state->msr_config)); msr_read64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_SMI, &(vg_state->msr_smi)); msr_read64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_ERROR, &(vg_state->msr_error)); msr_read64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_PM, &(vg_state->msr_pm)); msr_read64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_DIAG, &(vg_state->msr_diag)); msr_read64(MSR_DEVICE_GEODELX_VG, DC3_SPARE_MSR, &(vg_state->msr_spare)); msr_read64(MSR_DEVICE_GEODELX_VG, DC3_RAM_CTL, &(vg_state->msr_ram_ctl)); WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_restore_state * * This routine restores all persistent VG state information. *--------------------------------------------------------------------------*/ int vg_restore_state(VG_SAVE_RESTORE * vg_state) { unsigned long irqfilt, i; unsigned long memoffset; /* TEMPORARILY UNLOCK ALL REGISTERS */ WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); /* RESTORE THE FRAME BUFFER OFFSET */ WRITE_REG32(DC3_PHY_MEM_OFFSET, vg_state->fb_base); /* BLANK GCFG AND DCFG */ WRITE_REG32(DC3_GENERAL_CFG, 0); WRITE_REG32(DC3_DISPLAY_CFG, 0); /* RESTORE ALL REGISTERS */ WRITE_REG32(DC3_ARB_CFG, vg_state->arb_cfg); WRITE_REG32(DC3_FB_ST_OFFSET, vg_state->fb_offset); WRITE_REG32(DC3_CB_ST_OFFSET, vg_state->cb_offset); WRITE_REG32(DC3_CURS_ST_OFFSET, vg_state->cursor_offset); WRITE_REG32(DC3_VID_Y_ST_OFFSET, vg_state->video_y_offset); WRITE_REG32(DC3_VID_U_ST_OFFSET, vg_state->video_u_offset); WRITE_REG32(DC3_VID_V_ST_OFFSET, vg_state->video_v_offset); WRITE_REG32(DC3_DV_TOP, vg_state->dv_top); WRITE_REG32(DC3_LINE_SIZE, vg_state->line_size); WRITE_REG32(DC3_GFX_PITCH, vg_state->gfx_pitch); WRITE_REG32(DC3_VID_YUV_PITCH, vg_state->video_yuv_pitch); WRITE_REG32(DC3_H_ACTIVE_TIMING, vg_state->h_active); WRITE_REG32(DC3_H_BLANK_TIMING, vg_state->h_blank); WRITE_REG32(DC3_H_SYNC_TIMING, vg_state->h_sync); WRITE_REG32(DC3_V_ACTIVE_TIMING, vg_state->v_active); WRITE_REG32(DC3_V_BLANK_TIMING, vg_state->v_blank); WRITE_REG32(DC3_V_SYNC_TIMING, vg_state->v_sync); WRITE_REG32(DC3_FB_ACTIVE, vg_state->fb_active); WRITE_REG32(DC3_CURSOR_X, vg_state->cursor_x); WRITE_REG32(DC3_CURSOR_Y, vg_state->cursor_y); WRITE_REG32(DC3_VID_DS_DELTA, vg_state->vid_ds_delta); WRITE_REG32(DC3_PHY_MEM_OFFSET, vg_state->fb_base); WRITE_REG32(DC3_DV_CTL, vg_state->dv_ctl | 0x00000001); WRITE_REG32(DC3_GFX_SCALE, vg_state->gfx_scale); WRITE_REG32(DC3_IRQ_FILT_CTL, vg_state->irq_ctl); WRITE_REG32(DC3_VBI_EVEN_CTL, vg_state->vbi_even_ctl); WRITE_REG32(DC3_VBI_ODD_CTL, vg_state->vbi_odd_ctl); WRITE_REG32(DC3_VBI_HOR, vg_state->vbi_hor_ctl); WRITE_REG32(DC3_VBI_LN_ODD, vg_state->vbi_odd_line_enable); WRITE_REG32(DC3_VBI_LN_EVEN, vg_state->vbi_even_line_enable); WRITE_REG32(DC3_VBI_PITCH, vg_state->vbi_pitch); WRITE_REG32(DC3_COLOR_KEY, vg_state->color_key); WRITE_REG32(DC3_COLOR_MASK, vg_state->color_key_mask); WRITE_REG32(DC3_CLR_KEY_X, vg_state->color_key_x); WRITE_REG32(DC3_CLR_KEY_Y, vg_state->color_key_y); WRITE_REG32(DC3_IRQ, vg_state->irq); WRITE_REG32(DC3_GENLK_CTL, vg_state->genlk_ctl); WRITE_REG32(DC3_VID_EVEN_Y_ST_OFFSET, vg_state->vid_y_even_offset); WRITE_REG32(DC3_VID_EVEN_U_ST_OFFSET, vg_state->vid_u_even_offset); WRITE_REG32(DC3_VID_EVEN_V_ST_OFFSET, vg_state->vid_v_even_offset); WRITE_REG32(DC3_V_ACTIVE_EVEN, vg_state->vactive_even); WRITE_REG32(DC3_V_BLANK_EVEN, vg_state->vblank_even); WRITE_REG32(DC3_V_SYNC_EVEN, vg_state->vsync_even); /* RESTORE THE PALETTE */ WRITE_REG32(DC3_PAL_ADDRESS, 0); for (i = 0; i < 261; i++) WRITE_REG32(DC3_PAL_DATA, vg_state->palette[i]); /* RESTORE THE HORIZONTAL FILTER COEFFICIENTS */ irqfilt = READ_REG32(DC3_IRQ_FILT_CTL); irqfilt |= DC3_IRQFILT_H_FILT_SEL; for (i = 0; i < 256; i++) { WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i)); WRITE_REG32(DC3_FILT_COEFF1, vg_state->h_coeff[(i << 1)]); WRITE_REG32(DC3_FILT_COEFF2, vg_state->h_coeff[(i << 1) + 1]); } /* RESTORE VERTICAL COEFFICIENTS */ irqfilt &= ~DC3_IRQFILT_H_FILT_SEL; for (i = 0; i < 256; i++) { WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i)); WRITE_REG32(DC3_FILT_COEFF1, vg_state->v_coeff[i]); } /* RESTORE THE CURSOR DATA */ memoffset = READ_REG32(DC3_CURS_ST_OFFSET) & 0x0FFFFFFF; WRITE_FB_STRING32(memoffset, (unsigned char *) &(vg_state->cursor_data[0]), 3072); /* RESTORE THE PLL */ /* Use a common routine to use common code to poll for lock bit */ vg_set_clock_frequency(vg_state->dot_pll, vg_state->pll_flags); /* RESTORE ALL VG MSRS */ msr_write64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_CAP, &(vg_state->msr_cap)); msr_write64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_CONFIG, &(vg_state->msr_config)); msr_write64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_SMI, &(vg_state->msr_smi)); msr_write64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_ERROR, &(vg_state->msr_error)); msr_write64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_PM, &(vg_state->msr_pm)); msr_write64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_DIAG, &(vg_state->msr_diag)); msr_write64(MSR_DEVICE_GEODELX_VG, DC3_SPARE_MSR, &(vg_state->msr_spare)); msr_write64(MSR_DEVICE_GEODELX_VG, DC3_RAM_CTL, &(vg_state->msr_ram_ctl)); /* NOW RESTORE GCFG AND DCFG */ WRITE_REG32(DC3_DISPLAY_CFG, vg_state->dcfg); WRITE_REG32(DC3_GENERAL_CFG, vg_state->gcfg); /* FINALLY RESTORE UNLOCK */ WRITE_REG32(DC3_UNLOCK, vg_state->unlock); return CIM_STATUS_OK; } /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * CIMARRON VG READ ROUTINES * These routines are included for use in diagnostics or when debugging. They * can be optionally excluded from a project. *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ #if CIMARRON_INCLUDE_VG_READ_ROUTINES /*--------------------------------------------------------------------------- * vg_read_graphics_crc * * This routine reads the Cyclic Redundancy Check (CRC) value for the graphics * frame. *--------------------------------------------------------------------------*/ unsigned long vg_read_graphics_crc(int crc_source) { unsigned long gcfg, unlock; unsigned long crc, vbi_even; unsigned long interlaced; unsigned long line, field; if (!(READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_TGEN)) return 0xFFFFFFFF; unlock = READ_REG32(DC3_UNLOCK); gcfg = READ_REG32(DC3_GENERAL_CFG); vbi_even = READ_REG32(DC3_VBI_EVEN_CTL); vbi_even &= ~DC3_VBI_EVEN_ENABLE_CRC; gcfg |= DC3_GCFG_SGRE | DC3_GCFG_CRC_MODE; gcfg &= ~(DC3_GCFG_SGFR | DC3_GCFG_SIG_SEL | DC3_GCFG_FILT_SIG_SEL); switch (crc_source) { case VG_CRC_SOURCE_PREFILTER_EVEN: case VG_CRC_SOURCE_PREFILTER: gcfg |= DC3_GCFG_SIG_SEL; break; case VG_CRC_SOURCE_PREFLICKER: case VG_CRC_SOURCE_PREFLICKER_EVEN: gcfg |= DC3_GCFG_FILT_SIG_SEL; break; case VG_CRC_SOURCE_POSTFLICKER: case VG_CRC_SOURCE_POSTFLICKER_EVEN: /* NO WORK */ break; default: return 0xFFFFFFFF; } if (crc_source & VG_CRC_SOURCE_EVEN) field = 0; else field = DC3_LNCNT_EVEN_FIELD; if ((interlaced = (READ_REG32(DC3_IRQ_FILT_CTL) & DC3_IRQFILT_INTL_EN))) { /* WAIT FOR THE BEGINNING OF THE FIELD (LINE 1-5) */ /* Note that we wait for the field to be odd when CRCing the even */ /* field and vice versa. This is because the CRC will not begin */ /* until the following field. */ do { line = READ_REG32(DC3_LINE_CNT_STATUS); } while ((line & DC3_LNCNT_EVEN_FIELD) != field || ((line & DC3_LNCNT_V_LINE_CNT) >> 16) < 10 || ((line & DC3_LNCNT_V_LINE_CNT) >> 16) > 15); } else { /* NON-INTERLACED - EVEN FIELD CRCS ARE INVALID */ if (crc_source & VG_CRC_SOURCE_EVEN) return 0xFFFFFFFF; } WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_VBI_EVEN_CTL, vbi_even); WRITE_REG32(DC3_GENERAL_CFG, gcfg & ~DC3_GCFG_SIGE); WRITE_REG32(DC3_GENERAL_CFG, gcfg | DC3_GCFG_SIGE); /* WAIT FOR THE CRC TO BE COMPLETED */ while (!(READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_SIGC)); /* READ THE COMPLETED CRC */ crc = READ_REG32(DC3_PAL_DATA); /* RESTORE THE PALETTE SETTINGS */ gcfg &= ~DC3_GCFG_SGRE; WRITE_REG32(DC3_GENERAL_CFG, gcfg); WRITE_REG32(DC3_UNLOCK, unlock); return crc; } /*--------------------------------------------------------------------------- * vg_read_window_crc * * This routine reads the Cyclic Redundancy Check (CRC) value for a sub- * section of the frame. *--------------------------------------------------------------------------*/ unsigned long vg_read_window_crc(int crc_source, unsigned long x, unsigned long y, unsigned long width, unsigned long height) { Q_WORD msr_value; unsigned long crc = 0; unsigned long hactive, hblankstart; unsigned long htotal, hblankend; unsigned long line, field; unsigned long diag; hactive = ((READ_REG32(DC3_H_ACTIVE_TIMING)) & 0xFFF) + 1; hblankstart = ((READ_REG32(DC3_H_BLANK_TIMING)) & 0xFFF) + 1; htotal = ((READ_REG32(DC3_H_ACTIVE_TIMING) >> 16) & 0xFFF) + 1; hblankend = ((READ_REG32(DC3_H_BLANK_TIMING) >> 16) & 0xFFF) + 1; /* TIMINGS MUST BE ACTIVE */ if (!(READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_TGEN)) return 0xFFFFFFFF; /* DISABLE GLCP ACTIONS */ msr_value.low = 0; msr_value.high = 0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DIAGCTL, &msr_value); if ((x == 0 && width == 1) || x == 1) { /* SPECIAL CASE FOR X == 0 */ /* The comparator output is a clock late in the MCP, so we cannot */ /* easily catch the first pixel. If the first pixel is desired, */ /* we will insert a special state machine to CRC just the first */ /* pixel. */ /* N2 - DISPE HIGH AND Y == 1 */ /* Goto state YState = 2 */ msr_value.high = 0x00000002; msr_value.low = 0x00000C00; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETN0CTL + 2, &msr_value); /* M3 - DISPE HIGH AND Y == 0 */ /* Goto YState = 1 */ msr_value.high = 0x00000002; msr_value.low = 0x00000A00; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETM0CTL + 3, &msr_value); /* N3 - DISPE LOW */ /* Goto YState = 0 */ msr_value.high = 0x00080000; msr_value.low = 0x00000000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETN0CTL + 3, &msr_value); /* Y0 -> Y1 (SET M3) */ msr_value.high = 0x00000000; msr_value.low = 0x0000C000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 18, &msr_value); /* Y1 -> Y0 (SET N3) */ msr_value.low = 0x0000A000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 17, &msr_value); /* Y1 -> Y2 (SET N2) */ msr_value.low = 0x00000A00; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 19, &msr_value); /* N5 (XSTATE = 10 && CMP2 <= V. COUNTER <= CMP3) &&DISPE&& Y == 0 */ /* CRC into REGB */ msr_value.high = 0x00000002; msr_value.low = 0x10800B20; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETN0CTL + 5, &msr_value); /* N6 (XSTATE = 10 && CMP2 <= V. COUNTER <= CMP3) && DISPE&&Y == 1 */ /* CRC into REGB */ msr_value.high = 0x00000002; msr_value.low = 0x10800D20; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETN0CTL + 6, &msr_value); } /* M4 (XSTATE = 00 AND VSYNC HIGH) */ /* Goto state 01 */ /* Note: VSync = H3A */ msr_value.high = 0x00000001; msr_value.low = 0x000000A0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETM0CTL + 4, &msr_value); /* N0 (XSTATE = 01 AND VSYNC LOW) */ /* Goto state 02 */ /* Note: VSync low = H3B */ msr_value.high = 0x00040000; msr_value.low = 0x000000C0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETN0CTL, &msr_value); /* M5 (XSTATE = 10 AND VSYNC HIGH) */ /* Goto state 11 */ msr_value.high = 0x00000001; msr_value.low = 0x00000120; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETM0CTL + 5, &msr_value); /* N1 (XSTATE = 10 and DISPE HIGH) */ /* Increment H. Counter */ /* Note: DispE = H4 */ msr_value.high = 0x00000002; msr_value.low = 0x00000120; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETN0CTL + 1, &msr_value); /* M0 (XSTATE = 10 and H. COUNTER == LIMIT) */ /* Clear H. Counter and increment V. Counter */ msr_value.high = 0x00000000; msr_value.low = 0x00000122; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETM0CTL, &msr_value); /* N4 (XSTATE = 10 && CMP0 <= H. COUNTER <= CMP1 && CMP2 <= V. COUNTER * <= CMP3) && DISPE * CRC into REGB */ msr_value.high = 0x00000002; msr_value.low = 0x10C20120; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_SETN0CTL + 4, &msr_value); /* COMPARATOR 0 VALUE */ /* We subtract 1 to account for a pipeline delay in the GLCP. */ /* When the x coordinate is 0, we must play a special game. */ /* If the width is exactly 1, we will set up a state machine */ /* to only CRC the first pixel. Otherwise, we will set it */ /* as an OR combination of a state that CRCs the first pixel */ /* and a state that CRCs 1 clock delayed width (width - 1) */ msr_value.high = 0; if (x > 1) msr_value.low = (x - 1) & 0xFFFF; else msr_value.low = x; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPVAL0, &msr_value); /* COMPARATOR 1 VALUE */ if ((x == 0 || x == 1) && width > 1) msr_value.low += width - 2; else msr_value.low += width - 1; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPVAL0 + 2, &msr_value); /* COMPARATOR 2 VALUE */ msr_value.low = y << 16; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPVAL0 + 4, &msr_value); /* COMPARATOR 3 VALUE */ msr_value.low += (height - 1) << 16; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPVAL0 + 6, &msr_value); /* COMPARATOR MASKS */ /* Comparators 0 and 1 refer to lower 16 bits of RegB */ msr_value.low = 0x0000FFFF; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPMASK0, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPMASK0 + 2, &msr_value); /* Comparators 2 and 3 refer to upper 16 bits of RegB */ msr_value.low = 0xFFFF0000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPMASK0 + 4, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_CMPMASK0 + 6, &msr_value); /* SET REGB MASK */ /* We set the mask such that all all 32 bits of data are CRCed */ msr_value.low = 0xFFFFFFFF; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_REGBMASK, &msr_value); /* ACTIONS */ /* STATE 00->01 (SET 4M) */ msr_value.low = 0x000C0000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 14, &msr_value); /* STATE 01->10 (SET 0N) */ msr_value.low = 0x0000000A; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 15, &msr_value); /* STATE 10->11 (SET 5M) */ msr_value.low = 0x00C00000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 16, &msr_value); /* CLEAR REGA WHEN TRANSITIONING TO STATE 10 */ /* Do not clear RegB as the initial value must be 0x00000001 */ msr_value.low = 0x0000000A; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0, &msr_value); /* REGISTER ACTION 1 * CRC into RegB if cmp0 <= h.counter <= cmp1 && cmp2 <= v. counter < * cmp3 && 7 xstate = 10 * Increment h.counter if xstate = 10 and HSync is low. */ msr_value.low = 0x000A00A0; if (x == 0 && width == 1) msr_value.low = 0x00A000A0; else if (x == 1 && width == 1) msr_value.low = 0x0A0000A0; else if (x == 1 && width > 1) msr_value.low |= 0x0A000000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 1, &msr_value); /* REGISTER ACTION 2 */ /* Increment V. Counter in REGA */ msr_value.low = 0x0000000C; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 2, &msr_value); /* SET REGB TO 0x00000001 */ msr_value.low = 0x00000001; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_REGB, &msr_value); /* SET XSTATE TO 0 */ msr_value.low = 0x00000000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_XSTATE, &msr_value); /* SET YSTATE TO 0 */ msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_YSTATE, &msr_value); /* CLEAR ALL OTHER ACTIONS */ /* This prevents side-effects from previous accesses to the GLCP */ /* debug logic. */ msr_value.low = 0x00000000; msr_value.high = 0x00000000; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 3, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 4, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 5, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 6, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 7, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 8, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 9, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 10, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 11, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 12, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 13, &msr_value); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_ACTION0 + 20, &msr_value); /* SET DIAG SETTINGS BASED ON DESIRED CRC */ if (crc_source == VG_CRC_SOURCE_POSTFLICKER || crc_source == VG_CRC_SOURCE_POSTFLICKER_EVEN) { diag = 0x80808086; /* ENABLE HW CLOCK GATING AND SET GLCP CLOCK TO DOT CLOCK */ msr_value.high = 0; msr_value.low = 5; msr_write64(MSR_DEVICE_GEODELX_GLCP, MSR_GEODELINK_PM, &msr_value); msr_value.low = 0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DBGCLKCTL, &msr_value); msr_value.low = 3; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DBGCLKCTL, &msr_value); /* SET REGA LIMITS */ /* Lower counter uses pixels/line */ /* Upper counter is 0xFFFF to prevent rollover. */ msr_value.low = 0xFFFF0000 | (hactive - 1); if (READ_REG32(DC3_DISPLAY_CFG) & DC3_DCFG_DCEN) { msr_value.low += hblankstart - hactive; msr_value.low += htotal - hblankend; } msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_REGAVAL, &msr_value); /* USE H4 FUNCTION A FOR DISPE AND H4 FUNCTION B FOR NOT DISPE */ /* DISPE is bit 34 */ msr_value.high = 0x00000002; msr_value.low = 0x20000FF0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_H0CTL + 4, &msr_value); /* USE H3 FUNCTION A FOR VSYNC AND H3 FUNCTION B FOR NOT VSYNC */ /* VSYNC is bit 32. */ msr_value.high = 0x00000000; msr_value.low = 0x002055AA; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_H0CTL + 3, &msr_value); } else if (crc_source == VG_CRC_SOURCE_PREFLICKER || crc_source == VG_CRC_SOURCE_PREFLICKER_EVEN) { diag = 0x801F8032; /* ENABLE HW CLOCK GATING AND SET GLCP CLOCK TO GEODELINK CLOCK */ msr_value.high = 0; msr_value.low = 5; msr_write64(MSR_DEVICE_GEODELX_GLCP, MSR_GEODELINK_PM, &msr_value); msr_value.low = 0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DBGCLKCTL, &msr_value); msr_value.low = 2; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DBGCLKCTL, &msr_value); /* SET REGA LIMITS */ /* Lower counter uses pixels/line */ /* Upper counter is 0xFFFF to prevent rollover. */ msr_value.low = 0xFFFF0000 | (hactive - 1); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_REGAVAL, &msr_value); /* USE H4 FUNCTION A FOR DISPE AND H4 FUNCTION B FOR NOT DISPE */ /* DISPE is bit 47 */ msr_value.high = 0x00000002; msr_value.low = 0xF0000FF0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_H0CTL + 4, &msr_value); /* USE H3 FUNCTION A FOR VSYNC AND H3 FUNCTION B FOR NOT VSYNC */ /* VSYNC is bit 45. */ msr_value.high = 0x00000000; msr_value.low = 0x002D55AA; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_H0CTL + 3, &msr_value); } else { /* PREFILTER CRC */ diag = 0x80138048; msr_write64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_DIAG, &msr_value); /* ENABLE HW CLOCK GATING AND SET GLCP CLOCK TO GEODELINK CLOCK */ msr_value.high = 0; msr_value.low = 5; msr_write64(MSR_DEVICE_GEODELX_GLCP, MSR_GEODELINK_PM, &msr_value); msr_value.low = 0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DBGCLKCTL, &msr_value); msr_value.low = 2; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DBGCLKCTL, &msr_value); /* SET REGA LIMITS */ /* Lower counter uses pixels/line */ /* Upper counter is 0xFFFF to prevent rollover. */ /* Note that we are assuming that the number of */ /* source pixels is specified in the FB_ACTIVE register */ msr_value.low = 0xFFFF0000 | ((READ_REG32(DC3_FB_ACTIVE) >> 16) & 0xFFF); msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_REGAVAL, &msr_value); /* USE H4 FUNCTION A FOR DISPE AND H4 FUNCTION B FOR NOT DISPE */ /* DISPE is bit 55 */ msr_value.high = 0x00000003; msr_value.low = 0x70000FF0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_H0CTL + 4, &msr_value); /* USE H3 FUNCTION A FOR VSYNC AND H3 FUNCTION B FOR NOT VSYNC */ /* VSYNC is bit 53. */ msr_value.high = 0x00000000; msr_value.low = 0x003555AA; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_H0CTL + 3, &msr_value); } /* WAIT FOR THE CORRECT FIELD */ /* We use the VG line count and field indicator to determine when */ /* to kick off a CRC. */ if (crc_source & VG_CRC_SOURCE_EVEN) field = 0; else field = DC3_LNCNT_EVEN_FIELD; if (READ_REG32(DC3_IRQ_FILT_CTL) & DC3_IRQFILT_INTL_EN) { /* WAIT FOR THE BEGINNING OF THE FIELD (LINE 1-5) */ /* Note that we wait for the field to be odd when CRCing the even */ /* field and vice versa. This is because the CRC will not begin */ /* until the following field. */ do { line = READ_REG32(DC3_LINE_CNT_STATUS); } while ((line & DC3_LNCNT_EVEN_FIELD) != field || ((line & DC3_LNCNT_V_LINE_CNT) >> 16) < 1 || ((line & DC3_LNCNT_V_LINE_CNT) >> 16) > 5); } else { /* NON-INTERLACED - EVEN FIELD CRCS ARE INVALID */ if (crc_source & VG_CRC_SOURCE_EVEN) return 0xFFFFFFFF; } /* UPDATE VG DIAG OUTPUT */ msr_value.high = 0; msr_value.low = diag; msr_write64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_DIAG, &msr_value); /* CONFIGURE DIAG CONTROL */ /* Set RegA action1 to increment lower 16 bits and clear at limit. (5) */ /* Set RegA action2 to increment upper 16 bits. (6) */ /* Set RegB action1 to CRC32 (1) */ /* Set all comparators to REGA override (0,1 lower mbus, 2,3 upper mbus) */ /* Enable all actions */ msr_value.low = 0x80EA20A0; msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DIAGCTL, &msr_value); /* DELAY TWO FRAMES */ while (READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VNA); while (!(READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VNA)); while (READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VNA); while (!(READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VNA)); while (READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_VNA); /* VERIFY THAT XSTATE = 11 */ msr_read64(MSR_DEVICE_GEODELX_GLCP, GLCP_XSTATE, &msr_value); if ((msr_value.low & 3) == 3) { msr_read64(MSR_DEVICE_GEODELX_GLCP, GLCP_REGB, &msr_value); crc = msr_value.low; } /* DISABLE VG DIAG BUS OUTPUTS */ msr_value.low = 0x00000000; msr_value.high = 0x00000000; msr_write64(MSR_DEVICE_GEODELX_VG, MSR_GEODELINK_DIAG, &msr_value); /* DISABLE GLCP ACTIONS */ msr_write64(MSR_DEVICE_GEODELX_GLCP, GLCP_DIAGCTL, &msr_value); return crc; } /*--------------------------------------------------------------------------- * vg_get_scaler_filter_coefficients * * This routine gets the vertical and horizontal filter coefficients for * graphics scaling. The coefficients are sign extended to 32-bit values. *--------------------------------------------------------------------------*/ int vg_get_scaler_filter_coefficients(long h_taps[][5], long v_taps[][3]) { unsigned long irqfilt, i; unsigned long temp; long coeff0, coeff1, coeff2; unsigned long lock; /* ENABLE ACCESS TO THE HORIZONTAL COEFFICIENTS */ lock = READ_REG32(DC3_UNLOCK); irqfilt = READ_REG32(DC3_IRQ_FILT_CTL); irqfilt |= DC3_IRQFILT_H_FILT_SEL; /* WRITE COEFFICIENTS */ /* Coefficient indexes do not auto-increment, so we must */ /* write the address for every phase */ WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); for (i = 0; i < 256; i++) { WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i)); temp = READ_REG32(DC3_FILT_COEFF1); coeff0 = (temp & 0x3FF); coeff1 = (temp >> 10) & 0x3FF; coeff2 = (temp >> 20) & 0x3FF; h_taps[i][0] = (coeff0 << 22) >> 22; h_taps[i][1] = (coeff1 << 22) >> 22; h_taps[i][2] = (coeff2 << 22) >> 22; temp = READ_REG32(DC3_FILT_COEFF2); coeff0 = (temp & 0x3FF); coeff1 = (temp >> 10) & 0x3FF; h_taps[i][3] = (coeff0 << 22) >> 22; h_taps[i][4] = (coeff1 << 22) >> 22; } /* ENABLE ACCESS TO THE VERTICAL COEFFICIENTS */ irqfilt &= ~DC3_IRQFILT_H_FILT_SEL; /* WRITE COEFFICIENTS */ for (i = 0; i < 256; i++) { WRITE_REG32(DC3_IRQ_FILT_CTL, ((irqfilt & 0xFFFFFF00L) | i)); temp = READ_REG32(DC3_FILT_COEFF1); coeff0 = (temp & 0x3FF); coeff1 = (temp >> 10) & 0x3FF; coeff2 = (temp >> 20) & 0x3FF; v_taps[i][0] = (coeff0 << 22) >> 22; v_taps[i][1] = (coeff1 << 22) >> 22; v_taps[i][2] = (coeff2 << 22) >> 22; } WRITE_REG32(DC3_UNLOCK, lock); return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_get_flicker_filter_configuration * * This routine returns the current VG flicker filter configuration. *--------------------------------------------------------------------------*/ int vg_get_flicker_filter_configuration(unsigned long *strength, int *flicker_alpha) { unsigned long genlk_ctl; if (!strength || !flicker_alpha) return CIM_STATUS_INVALIDPARAMS; genlk_ctl = READ_REG32(DC3_GENLK_CTL); *strength = genlk_ctl & DC3_GC_FLICKER_FILTER_MASK; if (genlk_ctl & DC3_GC_ALPHA_FLICK_ENABLE) *flicker_alpha = 1; else *flicker_alpha = 0; return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * vg_get_display_pitch * * This routine returns the current stride between successive lines of frame * buffer data. *--------------------------------------------------------------------------*/ unsigned long vg_get_display_pitch(void) { return ((READ_REG32(DC3_GFX_PITCH) & 0x0000FFFF) << 3); } /*--------------------------------------------------------------------------- * vg_get_frame_buffer_line_size * * This routine returns the current size in bytes of one line of frame buffer * data. *--------------------------------------------------------------------------*/ unsigned long vg_get_frame_buffer_line_size(void) { return ((READ_REG32(DC3_LINE_SIZE) & 0x3FF) << 3); } /*--------------------------------------------------------------------------- * vg_get_current_vline * * This routine returns the number of the current line that is being displayed * by the display controller. *--------------------------------------------------------------------------*/ unsigned long vg_get_current_vline(void) { unsigned long current_line; /* READ THE REGISTER TWICE TO ENSURE THAT THE VALUE IS NOT TRANSITIONING */ do { current_line = READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_V_LINE_CNT; } while (current_line != (READ_REG32(DC3_LINE_CNT_STATUS) & DC3_LNCNT_V_LINE_CNT)); return (current_line >> 16); } /*--------------------------------------------------------------------------- * vg_get_display_offset * * This routine returns the offset into the frame buffer for the first pixel * of the display. *--------------------------------------------------------------------------*/ unsigned long vg_get_display_offset(void) { return (READ_REG32(DC3_FB_ST_OFFSET) & 0x0FFFFFFF); } /*--------------------------------------------------------------------------- * vg_get_cursor_info * * This routine returns the current settings for the hardware cursor. *--------------------------------------------------------------------------*/ int vg_get_cursor_info(VG_CURSOR_DATA * cursor_data) { unsigned long temp; /* CURSOR OFFSET */ cursor_data->cursor_offset = READ_REG32(DC3_CURS_ST_OFFSET) & 0x0FFFFFFF; /* CURSOR X POSITION */ temp = READ_REG32(DC3_CURSOR_X); cursor_data->cursor_x = temp & 0x7FF; cursor_data->clipx = (temp >> 11) & 0x3F; /* CURSOR Y POSITION */ temp = READ_REG32(DC3_CURSOR_Y); cursor_data->cursor_y = temp & 0x7FF; cursor_data->clipy = (temp >> 11) & 0x3F; /* CURSOR COLORS */ WRITE_REG32(DC3_PAL_ADDRESS, 0x100); cursor_data->mono_color0 = READ_REG32(DC3_PAL_DATA); cursor_data->mono_color1 = READ_REG32(DC3_PAL_DATA); /* CURSOR ENABLES */ temp = READ_REG32(DC3_GENERAL_CFG); if (temp & DC3_GCFG_CURE) cursor_data->enable = 1; else cursor_data->enable = 0; if (temp & DC3_GCFG_CLR_CUR) cursor_data->color_cursor = 1; else cursor_data->color_cursor = 0; return CIM_STATUS_OK; } /*---------------------------------------------------------------------------- * vg_get_display_palette_entry * * This routine reads a single entry in the 8BPP display palette. *--------------------------------------------------------------------------*/ int vg_get_display_palette_entry(unsigned long index, unsigned long *entry) { if (index > 0xFF) return CIM_STATUS_INVALIDPARAMS; WRITE_REG32(DC3_PAL_ADDRESS, index); *entry = READ_REG32(DC3_PAL_DATA); return CIM_STATUS_OK; } /*---------------------------------------------------------------------------- * vg_get_border_color * * This routine reads the current border color for centered displays. *--------------------------------------------------------------------------*/ unsigned long vg_get_border_color(void) { WRITE_REG32(DC3_PAL_ADDRESS, 0x104); return READ_REG32(DC3_PAL_DATA); } /*---------------------------------------------------------------------------- * vg_get_display_palette * * This routines reads the entire contents of the display palette into a * buffer. The display palette consists of 256 X:R:G:B values. *--------------------------------------------------------------------------*/ int vg_get_display_palette(unsigned long *palette) { unsigned long i; if (palette) { WRITE_REG32(DC3_PAL_ADDRESS, 0); for (i = 0; i < 256; i++) { palette[i] = READ_REG32(DC3_PAL_DATA); } return CIM_STATUS_OK; } return CIM_STATUS_INVALIDPARAMS; } /*---------------------------------------------------------------------------- * vg_get_compression_info * * This routines reads the current status of the display compression hardware. *--------------------------------------------------------------------------*/ int vg_get_compression_info(VG_COMPRESSION_DATA * comp_data) { comp_data->compression_offset = READ_REG32(DC3_CB_ST_OFFSET) & 0x0FFFFFFF; comp_data->pitch = (READ_REG32(DC3_GFX_PITCH) >> 13) & 0x7FFF8; comp_data->size = ((READ_REG32(DC3_LINE_SIZE) >> (DC3_LINE_SIZE_CB_SHIFT - 3)) & 0x3F8) + 24; return CIM_STATUS_OK; } /*---------------------------------------------------------------------------- * vg_get_compression_enable * * This routines reads the current enable status of the display compression * hardware. *--------------------------------------------------------------------------*/ int vg_get_compression_enable(void) { if (READ_REG32(DC3_GENERAL_CFG) & DC3_GCFG_CMPE) return 1; return 0; } /*---------------------------------------------------------------------------- * vg_get_valid_bit *--------------------------------------------------------------------------*/ int vg_get_valid_bit(int line) { unsigned long offset; unsigned long valid; unsigned long lock; lock = READ_REG32(DC3_UNLOCK); offset = READ_REG32(DC3_PHY_MEM_OFFSET) & 0xFF000000; offset |= line; WRITE_REG32(DC3_UNLOCK, DC3_UNLOCK_VALUE); WRITE_REG32(DC3_PHY_MEM_OFFSET, offset); WRITE_REG32(DC3_UNLOCK, lock); valid = READ_REG32(DC3_DV_ACC) & 2; if (valid) return 1; return 0; } #endif xf86-video-geode-2.11.18/src/cim/cim_parm.h0000644000175000017500000012660612654445443015112 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron user definitions. */ #ifndef _cim_parm_h #define _cim_parm_h /*===================================================*/ /* CIMARRON RETURN VALUE DEFINITIONS */ /*===================================================*/ #define CIM_STATUS_OK 0x00000000 #define CIM_STATUS_ERROR 0x00000001 #define CIM_STATUS_INVALIDPARAMS 0x00000002 #define CIM_STATUS_DEVNOTFOUND 0x00000004 #define CIM_STATUS_INVALIDSCALE 0x00000008 #define CIM_STATUS_INEXACTMATCH 0x00000010 #define CIM_STATUS_NOLOCK 0x00000020 #define CIM_STATUS_CPUNOTFOUND 0x00000040 #define CIM_STATUS_DISPLAYUNAVAILABLE 0x00000080 #define CIM_STATUS_NOTFOUND 0x00000100 /*===================================================*/ /* CIMARRON CPU DEFINITIONS */ /*===================================================*/ #define CIM_CPU_GEODEGX 0x00000001 #define CIM_CPU_GEODELX 0x00000002 #define CIM_SB_5535 0x00000001 #define CIM_SB_5536 0x00000002 /*===================================================*/ /* MSR PARAMETERS */ /*===================================================*/ /*-------------------------------------------------------------*/ /* GEODELINK DEVICE IDS */ /* These values uniquely identify all known GeodeLink devices */ /* in GeodeLX and its companion, 5535/6. For multiple devices */ /* of the same class (GLIU, USB, etc.) the table order is used */ /* to to identify the expected device order, in terms of on */ /* which GLIU the device is found, and on which port. */ /*-------------------------------------------------------------*/ #define MSR_DEVICE_GEODELX_GLIU0 0x00 #define MSR_DEVICE_GEODELX_GLIU1 0x01 #define MSR_DEVICE_5535_GLIU 0x02 #define MSR_DEVICE_GEODELX_GLCP 0x03 #define MSR_DEVICE_5535_GLCP 0x04 #define MSR_DEVICE_GEODELX_MPCI 0x05 #define MSR_DEVICE_5535_MPCI 0x06 #define MSR_DEVICE_GEODELX_MC 0x07 #define MSR_DEVICE_GEODELX_GP 0x08 #define MSR_DEVICE_GEODELX_VG 0x09 #define MSR_DEVICE_GEODELX_VIP 0x0A #define MSR_DEVICE_GEODELX_AES 0x0B #define MSR_DEVICE_GEODELX_DF 0x0C #define MSR_DEVICE_GEODELX_FG 0x0D #define MSR_DEVICE_GEODELX_VAIL 0x0E #define MSR_DEVICE_5536_USB_2_0 0x0F #define MSR_DEVICE_5535_USB2 0x10 #define MSR_DEVICE_5535_USB1 0x11 #define MSR_DEVICE_5535_ATAC 0x12 #define MSR_DEVICE_5535_MDD 0x13 #define MSR_DEVICE_5535_ACC 0x14 #define MSR_DEVICE_EMPTY 0x15 #define MSR_DEVICE_REFLECTIVE 0x16 #define MSR_DEVICE_PRESENT 0x17 #define MSR_DEVICE_NOTFOUND 0x18 /*---------------------------------------------*/ /* GEODELINK TABLE ENTRY */ /* The following structure represents one port */ /* on a GeodeLink Interface Unit (GLIU) */ /*---------------------------------------------*/ typedef struct tagGeodeLinkNode { unsigned long address_from_cpu; unsigned long device_id; } GEODELINK_NODE; /*---------------------------------------------*/ /* QWORD DATA STRUCTURE */ /* 64-bit data structure for MSR acess. */ /*---------------------------------------------*/ typedef struct tagQ_WORD { unsigned long high; unsigned long low; } Q_WORD; /*===================================================*/ /* INITIALIZATION USER PARAMETERS */ /*===================================================*/ typedef struct tagInitBaseAddresses { unsigned long framebuffer_base; unsigned long gp_register_base; unsigned long vg_register_base; unsigned long df_register_base; unsigned long vip_register_base; unsigned long framebuffer_size; } INIT_BASE_ADDRESSES; /*===================================================*/ /* GP USER PARAMETER DEFINITIONS */ /*===================================================*/ /*---------------------------*/ /* GP_DECLARE_BLT PARAMETERS */ /*---------------------------*/ #define CIMGP_BLTFLAGS_PRES_LUT 0x0001 #define CIMGP_BLTFLAGS_PRES_COLOR_PAT 0x0002 #define CIMGP_ENABLE_PREFETCH 0x0004 #define CIMGP_BLTFLAGS_HAZARD 0x0008 #define CIMGP_BLTFLAGS_INVERTMONO 0x0010 #define CIMGP_BLTFLAGS_LIMITBUFFER 0x0020 /*-----------------------------------*/ /* GP_SET_ALPHA_OPERATION PARAMETERS */ /*-----------------------------------*/ #define CIMGP_APPLY_BLEND_TO_RGB 1 #define CIMGP_APPLY_BLEND_TO_ALPHA 2 #define CIMGP_APPLY_BLEND_TO_ALL 3 #define CIMGP_ALPHA_TIMES_A 0 #define CIMGP_BETA_TIMES_B 1 #define CIMGP_A_PLUS_BETA_B 2 #define CIMGP_ALPHA_A_PLUS_BETA_B 3 #define CIMGP_CHANNEL_A_ALPHA 0 #define CIMGP_CHANNEL_B_ALPHA 1 #define CIMGP_CONSTANT_ALPHA 2 #define CIMGP_ALPHA_EQUALS_ONE 3 #define CIMGP_ALPHA_FROM_RGB_A 4 #define CIMGP_ALPHA_FROM_RGB_B 5 #define CIMGP_CONVERTED_ALPHA 6 #define CIMGP_CHANNEL_A_SOURCE 0 #define CIMGP_CHANNEL_A_DEST 1 /*---------------------------------*/ /* GP_SET_SOURCE_FORMAT PARAMETERS */ /*---------------------------------*/ #define CIMGP_SOURCE_FMT_3_3_2 0x00 #define CIMGP_SOURCE_FMT_8BPP_INDEXED 0x01 #define CIMGP_SOURCE_FMT_4_4_4_4 0x04 #define CIMGP_SOURCE_FMT_12BPP_BGR 0x14 #define CIMGP_SOURCE_FMT_1_5_5_5 0x05 #define CIMGP_SOURCE_FMT_15BPP_BGR 0x15 #define CIMGP_SOURCE_FMT_0_5_6_5 0x06 #define CIMGP_SOURCE_FMT_16BPP_BGR 0x16 #define CIMGP_SOURCE_FMT_YUYV 0x07 #define CIMGP_SOURCE_FMT_UYVY 0x17 #define CIMGP_SOURCE_FMT_8_8_8_8 0x08 #define CIMGP_SOURCE_FMT_32BPP_BGR 0x18 #define CIMGP_SOURCE_FMT_24BPP 0x0B #define CIMGP_SOURCE_FMT_4BPP_INDEXED 0x0D /*------------------------------------*/ /* GP_SCREEN_TO_SCREEN_BLT PARAMETERS */ /*------------------------------------*/ #define CIMGP_NEGXDIR 1 #define CIMGP_NEGYDIR 2 /*------------------------------------*/ /* GP_BRESENHAM_LINE PARAMETERS */ /*------------------------------------*/ #define CIMGP_YMAJOR 1 #define CIMGP_POSMAJOR 2 #define CIMGP_POSMINOR 4 /*----------------------------------------------*/ /* USER STRUCTURE FOR SAVING/RESTORING GP STATE */ /*----------------------------------------------*/ typedef struct tagGPSaveRestore { unsigned long base_offset; unsigned long cmd_top; unsigned long cmd_bottom; unsigned long cmd_base; unsigned long cmd_read; } GP_SAVE_RESTORE; /*===================================================*/ /* VG USER PARAMETER DEFINITIONS */ /*===================================================*/ /*-------------------------------------------*/ /* SUPPORTED TV ENCODERS */ /*-------------------------------------------*/ #define VG_ENCODER_ADV7171 0x0001 #define VG_ENCODER_SAA7127 0x0002 #define VG_ENCODER_FS454 0x0003 #define VG_ENCODER_ADV7300 0x0004 /*-------------------------------------------*/ /* SUPPORTED TV RESOLUTIONS */ /*-------------------------------------------*/ #define VG_TVMODE_NTSC 0x00000000 #define VG_TVMODE_PAL 0x00000001 #define VG_TVMODE_480P 0x00000002 #define VG_TVMODE_720P 0x00000003 #define VG_TVMODE_1080I 0x00000004 #define VG_TVMODE_6X4_NTSC 0x00000005 #define VG_TVMODE_8X6_NTSC 0x00000006 #define VG_TVMODE_10X7_NTSC 0x00000007 #define VG_TVMODE_6X4_PAL 0x00000008 #define VG_TVMODE_8X6_PAL 0x00000009 #define VG_TVMODE_10X7_PAL 0x0000000A /*-------------------------------------------*/ /* USER STRUCTURE FOR SETTING A DISPLAY MODE */ /*-------------------------------------------*/ #define VG_SUPPORTFLAG_8BPP 0x00000001 #define VG_SUPPORTFLAG_12BPP 0x00000002 #define VG_SUPPORTFLAG_15BPP 0x00000004 #define VG_SUPPORTFLAG_16BPP 0x00000008 #define VG_SUPPORTFLAG_24BPP 0x00000010 #define VG_SUPPORTFLAG_32BPP 0x00000020 #define VG_SUPPORTFLAG_56HZ 0x00000040 #define VG_SUPPORTFLAG_60HZ 0x00000080 #define VG_SUPPORTFLAG_70HZ 0x00000100 #define VG_SUPPORTFLAG_72HZ 0x00000200 #define VG_SUPPORTFLAG_75HZ 0x00000400 #define VG_SUPPORTFLAG_85HZ 0x00000800 #define VG_SUPPORTFLAG_90HZ 0x00001000 #define VG_SUPPORTFLAG_100HZ 0x00002000 #define VG_SUPPORTFLAG_HZMASK 0x00003FC0 #define VG_SUPPORTFLAG_ADV7171 0x00004000 #define VG_SUPPORTFLAG_SAA7127 0x00008000 #define VG_SUPPORTFLAG_FS454 0x00010000 #define VG_SUPPORTFLAG_ADV7300 0x00020000 #define VG_SUPPORTFLAG_ENCODERMASK 0x0003C000 #define VG_SUPPORTFLAG_PANEL 0x00040000 #define VG_SUPPORTFLAG_TVOUT 0x00080000 #define VG_SUPPORTFLAG_NTSC 0x00000000 #define VG_SUPPORTFLAG_PAL 0x00100000 #define VG_SUPPORTFLAG_480P 0x00200000 #define VG_SUPPORTFLAG_720P 0x00300000 #define VG_SUPPORTFLAG_1080I 0x00400000 #define VG_SUPPORTFLAG_6X4_NTSC 0x00500000 #define VG_SUPPORTFLAG_8X6_NTSC 0x00600000 #define VG_SUPPORTFLAG_10X7_NTSC 0x00700000 #define VG_SUPPORTFLAG_6X4_PAL 0x00800000 #define VG_SUPPORTFLAG_8X6_PAL 0x00900000 #define VG_SUPPORTFLAG_10X7_PAL 0x00A00000 #define VG_SUPPORTFLAG_TVMODEMASK 0x00F00000 #define VG_MODEFLAG_NEG_HSYNC 0x00000001 #define VG_MODEFLAG_NEG_VSYNC 0x00000002 #define VG_MODEFLAG_INTERLACED 0x00000004 #define VG_MODEFLAG_PANELOUT 0x00000008 #define VG_MODEFLAG_CENTERED 0x00000010 #define VG_MODEFLAG_LINEARPITCH 0x00000020 #define VG_MODEFLAG_TVOUT 0x00000040 #define VG_MODEFLAG_HALFCLOCK 0x00000080 #define VG_MODEFLAG_QVGA 0x00000100 #define VG_MODEFLAG_EXCLUDEPLL 0x00000200 #define VG_MODEFLAG_NOPANELTIMINGS 0x00000400 #define VG_MODEFLAG_XVGA_TFT 0x00000800 #define VG_MODEFLAG_CUSTOM_PANEL 0x00001000 #define VG_MODEFLAG_CRT_AND_FP 0x00002000 #define VG_MODEFLAG_LOW_BAND 0x00000000 #define VG_MODEFLAG_AVG_BAND 0x00004000 #define VG_MODEFLAG_HIGH_BAND 0x00008000 #define VG_MODEFLAG_LEGACY_BAND 0x0000C000 #define VG_MODEFLAG_BANDWIDTHMASK 0x0000C000 #define VG_MODEFLAG_OVERRIDE_BAND 0x00010000 #define VG_MODEFLAG_INT_ADDRESS 0x00000000 #define VG_MODEFLAG_INT_LINEDOUBLE 0x00020000 #define VG_MODEFLAG_INT_FLICKER 0x00040000 #define VG_MODEFLAG_INT_MASK 0x00060000 #define VG_MODEFLAG_INT_OVERRIDE 0x00080000 #define VG_MODEFLAG_INVERT_SHFCLK 0x00100000 #define VG_MODEFLAG_MANUAL_FREQUENCY 0x00200000 #define VG_MODEFLAG_PLL_BYPASS 0x00400000 #define VG_MODEFLAG_VIP_TO_DOT_CLOCK 0x00800000 #define VG_MODEFLAG_VALIDUSERFLAGS (VG_MODEFLAG_CRT_AND_FP | \ VG_MODEFLAG_XVGA_TFT | \ VG_MODEFLAG_NOPANELTIMINGS | \ VG_MODEFLAG_EXCLUDEPLL | \ VG_MODEFLAG_LINEARPITCH) typedef struct tagVGDisplayMode { /* DISPLAY MODE FLAGS */ /* Includes BPP, refresh rate information, interlacing, etc. */ unsigned long internal_flags; unsigned long flags; /* SOURCE RESOLUTION */ /* The following values reflect the resolution of the data in the frame */ /* buffer. These values are used to enable scaling and filtering. */ unsigned long src_width; unsigned long src_height; /* PANEL SETTINGS * These allow a user to set a panel mode through the vg_set_custom_mode * routine. These values are only relevant if the VG_MODEFLAG_PANEL is * also set. */ unsigned long mode_width; unsigned long mode_height; unsigned long panel_width; unsigned long panel_height; unsigned long panel_tim1; unsigned long panel_tim2; unsigned long panel_dither_ctl; unsigned long panel_pad_sel_low; unsigned long panel_pad_sel_high; /* OUTPUT TIMINGS */ /* If the active width and height do not match the source */ /* dimensions the graphics data will be scaled. */ unsigned long hactive; unsigned long hblankstart; unsigned long hsyncstart; unsigned long hsyncend; unsigned long hblankend; unsigned long htotal; unsigned long vactive; unsigned long vblankstart; unsigned long vsyncstart; unsigned long vsyncend; unsigned long vblankend; unsigned long vtotal; unsigned long vactive_even; unsigned long vblankstart_even; unsigned long vsyncstart_even; unsigned long vsyncend_even; unsigned long vblankend_even; unsigned long vtotal_even; /* CLOCK FREQUENCY */ unsigned long frequency; } VG_DISPLAY_MODE; /*-------------------------------------------*/ /* PLL FLAGS */ /*-------------------------------------------*/ #define VG_PLL_DIVIDE_BY_2 0x00000001 #define VG_PLL_DIVIDE_BY_4 0x00000002 #define VG_PLL_BYPASS 0x00000004 #define VG_PLL_MANUAL 0x00000008 #define VG_PLL_VIP_CLOCK 0x00000010 /*-------------------------------------------*/ /* USER STRUCTURE FOR QUERYING DISPLAY MODES */ /*-------------------------------------------*/ typedef struct tagQueryDisplayMode { int interlaced; int halfclock; unsigned long active_width; unsigned long active_height; unsigned long panel_width; unsigned long panel_height; unsigned long total_width; unsigned long total_height; unsigned long bpp; unsigned long hz; unsigned long frequency; unsigned long query_flags; unsigned long encoder; unsigned long tvmode; } VG_QUERY_MODE; /*-------------------------------------------*/ /* USER STRUCTURE FOR QUERYING CURSOR DATA */ /*-------------------------------------------*/ typedef struct tagCursorData { int enable; int color_cursor; unsigned long cursor_offset; unsigned long cursor_x; unsigned long cursor_y; unsigned long clipx; unsigned long clipy; unsigned long mono_color0; unsigned long mono_color1; unsigned long flags; } VG_CURSOR_DATA; /*------------------------------------------------*/ /* VG INTERRUPT STATUS SOURCES */ /*------------------------------------------------*/ #define VG_INT_LINE_MATCH 0x00010000 #define VG_INT_VSYNC_LOSS 0x00020000 /*------------------------------------------------*/ /* USER STRUCTURE FOR SETTING COMPRESSION DATA */ /*------------------------------------------------*/ typedef struct tagCompressionData { unsigned long compression_offset; unsigned long pitch; unsigned long size; unsigned long flags; } VG_COMPRESSION_DATA; /*-------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING LINE INTERRUPTS */ /*-------------------------------------------------*/ typedef struct tagInterruptInfo { unsigned long line; unsigned long flags; int enable; } VG_INTERRUPT_PARAMS; /*-------------------------------------------------*/ /* USER STRUCTURE FOR PANNING THE DESKTOP */ /*-------------------------------------------------*/ typedef struct tagPanningInfo { unsigned long start_x; unsigned long start_y; int start_updated; } VG_PANNING_COORDINATES; /*--------------------------------------------------*/ /* USER STRUCTURE FOR SAVING/RESTORING THE VG STATE */ /*--------------------------------------------------*/ typedef struct tagVGSaveRestore { /* VG REGISTERS */ unsigned long unlock; unsigned long gcfg; unsigned long dcfg; unsigned long arb_cfg; unsigned long fb_offset; unsigned long cb_offset; unsigned long cursor_offset; unsigned long video_y_offset; unsigned long video_u_offset; unsigned long video_v_offset; unsigned long dv_top; unsigned long line_size; unsigned long gfx_pitch; unsigned long video_yuv_pitch; unsigned long h_active; unsigned long h_blank; unsigned long h_sync; unsigned long v_active; unsigned long v_blank; unsigned long v_sync; unsigned long fb_active; unsigned long cursor_x; unsigned long cursor_y; unsigned long vid_ds_delta; unsigned long fb_base; unsigned long dv_ctl; unsigned long gfx_scale; unsigned long irq_ctl; unsigned long vbi_even_ctl; unsigned long vbi_odd_ctl; unsigned long vbi_hor_ctl; unsigned long vbi_odd_line_enable; unsigned long vbi_even_line_enable; unsigned long vbi_pitch; unsigned long color_key; unsigned long color_key_mask; unsigned long color_key_x; unsigned long color_key_y; unsigned long irq; unsigned long genlk_ctl; unsigned long vid_y_even_offset; unsigned long vid_u_even_offset; unsigned long vid_v_even_offset; unsigned long vactive_even; unsigned long vblank_even; unsigned long vsync_even; unsigned long h_coeff[512]; unsigned long v_coeff[256]; unsigned long palette[261]; unsigned long cursor_data[3072]; unsigned long dot_pll; unsigned long pll_flags; /* VG MSRS */ Q_WORD msr_cap; Q_WORD msr_config; Q_WORD msr_smi; Q_WORD msr_error; Q_WORD msr_pm; Q_WORD msr_diag; Q_WORD msr_spare; Q_WORD msr_ram_ctl; } VG_SAVE_RESTORE; /*-------------------------------------------*/ /* VG_GET_DISPLAY_MODE_INDEX PARAMETERS */ /*-------------------------------------------*/ #define VG_QUERYFLAG_ACTIVEWIDTH 0x00000001 #define VG_QUERYFLAG_ACTIVEHEIGHT 0x00000002 #define VG_QUERYFLAG_TOTALWIDTH 0x00000004 #define VG_QUERYFLAG_TOTALHEIGHT 0x00000008 #define VG_QUERYFLAG_BPP 0x00000010 #define VG_QUERYFLAG_REFRESH 0x00000020 #define VG_QUERYFLAG_PIXELCLOCK 0x00000040 #define VG_QUERYFLAG_PIXELCLOCK_APPROX 0x00000080 #define VG_QUERYFLAG_PANEL 0x00000100 #define VG_QUERYFLAG_PANELWIDTH 0x00000200 #define VG_QUERYFLAG_PANELHEIGHT 0x00000400 #define VG_QUERYFLAG_TVOUT 0x00000800 #define VG_QUERYFLAG_INTERLACED 0x00001000 #define VG_QUERYFLAG_HALFCLOCK 0x00002000 #define VG_QUERYFLAG_ENCODER 0x00004000 #define VG_QUERYFLAG_TVMODE 0x00008000 /*-----------------------------------------------*/ /* VG FLICKER FILTER SETTINGS */ /*-----------------------------------------------*/ #define VG_FLICKER_FILTER_NONE 0x00000000 #define VG_FLICKER_FILTER_1_16 0x10000000 #define VG_FLICKER_FILTER_1_8 0x20000000 #define VG_FLICKER_FILTER_1_4 0x40000000 #define VG_FLICKER_FILTER_5_16 0x50000000 #define VG_FLICKER_FILTER_MASK 0xF0000000 /*-----------------------------------------------*/ /* VG CRC SOURCES */ /*-----------------------------------------------*/ #define VG_CRC_SOURCE_PREFILTER 0x00000000 #define VG_CRC_SOURCE_PREFLICKER 0x00000001 #define VG_CRC_SOURCE_POSTFLICKER 0x00000002 #define VG_CRC_SOURCE_PREFILTER_EVEN 0x00000010 #define VG_CRC_SOURCE_PREFLICKER_EVEN 0x00000011 #define VG_CRC_SOURCE_POSTFLICKER_EVEN 0x00000012 #define VG_CRC_SOURCE_EVEN 0x00000010 /*===================================================*/ /* DISPLAY FILTER PARAMETERS */ /*===================================================*/ /*-----------------------------------------------*/ /* VIDEO FORMAT DEFINITIONS */ /*-----------------------------------------------*/ #define DF_VIDFMT_UYVY 0x0000 #define DF_VIDFMT_Y2YU 0x0001 #define DF_VIDFMT_YUYV 0x0002 #define DF_VIDFMT_YVYU 0x0003 #define DF_VIDFMT_Y0Y1Y2Y3 0x0004 #define DF_VIDFMT_Y3Y2Y1Y0 0x0005 #define DF_VIDFMT_Y1Y0Y3Y2 0x0006 #define DF_VIDFMT_Y1Y2Y3Y0 0x0007 #define DF_VIDFMT_RGB 0x0008 #define DF_VIDFMT_P2M_P2L_P1M_P1L 0x0009 #define DF_VIDFMT_P1M_P1L_P2M_P2L 0x000A #define DF_VIDFMT_P1M_P2L_P2M_P1L 0x000B /*-----------------------------------------------*/ /* CRT ENABLE STATES */ /*-----------------------------------------------*/ #define DF_CRT_DISABLE 0x0000 #define DF_CRT_ENABLE 0x0001 #define DF_CRT_STANDBY 0x0002 #define DF_CRT_SUSPEND 0x0003 /*-----------------------------------------------*/ /* VIDEO SCALING FLAGS */ /*-----------------------------------------------*/ #define DF_SCALEFLAG_CHANGEX 0x0001 #define DF_SCALEFLAG_CHANGEY 0x0002 /*-----------------------------------------------*/ /* DISPLAY FILTER COLOR SPACES */ /*-----------------------------------------------*/ #define DF_OUTPUT_RGB 0x0001 #define DF_OUTPUT_ARGB 0x0002 #define DF_OUTPUT_SDTV 0x0003 #define DF_OUTPUT_HDTV 0x0004 /*-----------------------------------------------*/ /* DISPLAY FILTER OUTPUT PATHS */ /*-----------------------------------------------*/ #define DF_DISPLAY_CRT 0x0001 #define DF_DISPLAY_FP 0x0002 #define DF_DISPLAY_CRT_FP 0x0003 #define DF_DISPLAY_VOP 0x0004 #define DF_DISPLAY_DRGB 0x0005 #define DF_DISPLAY_CRT_DRGB 0x0006 /*-----------------------------------------------*/ /* WINDOWED CRC DATA SOURCES */ /*-----------------------------------------------*/ #define DF_CRC_SOURCE_GFX_DATA 0x0000 #define DF_CRC_SOURCE_CRT_RGB 0x0001 #define DF_CRC_SOURCE_FP_DATA 0x0002 /*-----------------------------------------------*/ /* VIDEO ENABLE FLAGS */ /*-----------------------------------------------*/ #define DF_ENABLEFLAG_NOCOLORKEY 0x0001 /*-----------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING A VIDEO SOURCE */ /*-----------------------------------------------*/ #define DF_SOURCEFLAG_HDTVSOURCE 0x0001 #define DF_SOURCEFLAG_IMPLICITSCALING 0x0002 typedef struct tagVideoSourceInfo { unsigned long video_format; unsigned long y_offset; unsigned long u_offset; unsigned long v_offset; unsigned long y_pitch; unsigned long uv_pitch; unsigned long width; unsigned long height; unsigned long flags; } DF_VIDEO_SOURCE_PARAMS; /*---------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING THE VIDEO POSITION */ /*---------------------------------------------------*/ #define DF_POSFLAG_DIRECTCLIP 0x0001 #define DF_POSFLAG_INCLUDEBORDER 0x0002 typedef struct tagVideoPosition { long x; long y; unsigned long width; unsigned long height; unsigned long left_clip; unsigned long dst_clip; unsigned long flags; } DF_VIDEO_POSITION; /*-------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING THE VIDEO CURSOR */ /*-------------------------------------------------*/ typedef struct tagVideoCursorInfo { unsigned long key; unsigned long mask; unsigned long color1; unsigned long color2; unsigned long select_color2; unsigned long flags; } DF_VIDEO_CURSOR_PARAMS; /*-------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING AN ALPHA REGION */ /*-------------------------------------------------*/ #define DF_ALPHAFLAG_COLORENABLED 0x0001 #define DF_ALPHAFLAG_PERPIXELENABLED 0x0002 typedef struct tagAlphaRegionInfo { unsigned long x; unsigned long y; unsigned long width; unsigned long height; unsigned long alpha_value; unsigned long priority; unsigned long color; unsigned long flags; long delta; } DF_ALPHA_REGION_PARAMS; /*-------------------------------------------------*/ /* USER STRUCTURE FOR SAVING/RESTORING DF DATA */ /*-------------------------------------------------*/ typedef struct tagDFSaveRestore { unsigned long vcfg; unsigned long dcfg; unsigned long video_x; unsigned long video_y; unsigned long video_scaler; unsigned long video_color_key; unsigned long video_color_mask; unsigned long sat_limit; unsigned long vid_misc; unsigned long video_yscale; unsigned long video_xscale; unsigned long vid_alpha_control; unsigned long cursor_key; unsigned long cursor_mask; unsigned long cursor_color1; unsigned long cursor_color2; unsigned long alpha_xpos1; unsigned long alpha_ypos1; unsigned long alpha_color1; unsigned long alpha_control1; unsigned long alpha_xpos2; unsigned long alpha_ypos2; unsigned long alpha_color2; unsigned long alpha_control2; unsigned long alpha_xpos3; unsigned long alpha_ypos3; unsigned long alpha_color3; unsigned long alpha_control3; unsigned long vid_request; unsigned long vid_ypos_even; unsigned long alpha_ypos_even1; unsigned long alpha_ypos_even2; unsigned long alpha_ypos_even3; unsigned long panel_tim1; unsigned long panel_tim2; unsigned long panel_pm; unsigned long panel_dither; unsigned long palette[256]; unsigned long coefficients[512]; /* DF MSRS */ Q_WORD msr_cap; Q_WORD msr_config; Q_WORD msr_smi; Q_WORD msr_error; Q_WORD msr_pm; Q_WORD msr_diag; Q_WORD msr_df_diag; Q_WORD msr_pad_sel; } DF_SAVE_RESTORE; /*-----------------------------------------------*/ /* DF CRC SOURCES */ /*-----------------------------------------------*/ #define DF_CRC_SOURCE_ODD_FIELD 0x00000100 #define DF_CRC_SOURCE_EVEN_FIELD 0x00001000 #define DF_CRC_SOURCE_EVEN 0x00001000 /*===================================================*/ /* VIP USER PARAMETER DEFINITIONS */ /*===================================================*/ #define VIP_MODEFLAG_VSYNCACTIVEHIGH 0x00000001 #define VIP_MODEFLAG_HSYNCACTIVEHIGH 0x00000002 /*---------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING 601 SETTINGS */ /*---------------------------------------------*/ typedef struct _TAG_VIP601PARAMS { unsigned long flags; unsigned long horz_start; unsigned long width; unsigned long vert_start_even; unsigned long even_height; unsigned long vert_start_odd; unsigned long odd_height; unsigned long vbi_start; unsigned long vbi_height; unsigned long odd_detect_start; unsigned long odd_detect_end; } VIP_601PARAMS; /*-------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING A VIP MODE */ /*-------------------------------------------*/ /* VIP MODE FLAGS */ #define VIP_MODEFLAG_PLANARCAPTURE 0x00000001 #define VIP_MODEFLAG_INVERTPOLARITY 0x00000002 #define VIP_MODEFLAG_PROGRESSIVE 0x00000004 #define VIP_MODEFLAG_DISABLEZERODETECT 0x00000008 #define VIP_MODEFLAG_ENABLEREPEATFLAG 0x00000010 #define VIP_MODEFLAG_10BITANCILLARY 0x00000020 #define VIP_MODEFLAG_TOGGLEEACHFIELD 0x00000040 #define VIP_MODEFLAG_INVERTTASKPOLARITY 0x00000080 #define VIP_MODEFLAG_FLIPMESSAGEWHENFULL 0x00000100 /* VIP CAPTURE ENABLE FLAGS */ #define VIP_ENABLE_TASKA 0x00000100 #define VIP_ENABLE_TASKA_VBI 0x00000200 #define VIP_ENABLE_TASKB 0x00000400 #define VIP_ENABLE_TASKB_VBI 0x00000800 #define VIP_ENABLE_ANCILLARY 0x00001000 #define VIP_ENABLE_ALL 0x00001F00 /* VIP CAPTURE MODE FLAGS */ #define VIP_MODE_IDLE 0x00000000 #define VIP_MODE_VIP2_8BIT 0x00000002 #define VIP_MODE_VIP2_16BIT 0x00000004 #define VIP_MODE_VIP1_8BIT 0x00000006 #define VIP_MODE_MSG 0x00000008 #define VIP_MODE_DATA 0x0000000A #define VIP_MODE_8BIT601 0x0000000C #define VIP_MODE_16BIT601 0x0000000E /* 4:2:0 PLANAR CAPTURE METHODS */ #define VIP_420CAPTURE_EVERYLINE 0x00000001 #define VIP_420CAPTURE_ALTERNATINGLINES 0x00000002 #define VIP_420CAPTURE_ALTERNATINGFIELDS 0x00000003 typedef struct _TAG_SETMODEBUFFER { unsigned long flags; unsigned long stream_enables; unsigned long operating_mode; unsigned long planar_capture; VIP_601PARAMS vip601_settings; } VIPSETMODEBUFFER; /*-----------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING VG/VIP GENLOCK */ /*-----------------------------------------------*/ /* LOSS OF VIDEO DETECTION FLAGS */ #define VIP_VDE_RUNAWAY_LINE 0x00800000 #define VIP_VDE_VERTICAL_TIMING 0x00400000 #define VIP_VDE_CLOCKS_PER_LINE 0x00200000 #define VIP_VDE_LOST_CLOCK 0x00100000 /* VIP VSYNC SELECT FOR THE VG */ #define VIP_VGSYNC_NONE 0x00000000 #define VIP_VGSYNC_START_FRAME 0x00000001 #define VIP_VGSYNC_FALLING_EDGE_VBLANK 0x00000002 #define VIP_VGSYNC_RISING_EDGE_VBLANK 0x00000003 #define VIP_VGSYNC_FALLING_EDGE_FIELD 0x00000004 #define VIP_VGSYNC_RISING_EDGE_FIELD 0x00000005 #define VIP_VGSYNC_VIP_CURRENT_LINE 0x00000006 #define VIP_VGSYNC_MSG_INT 0x00000007 /* VIP FIELD SELECT FOR THE VG */ #define VIP_VGFIELD_INPUT 0x00000000 #define VIP_VGFIELD_INPUT_INV 0x00000008 #define VIP_VGFIELD_ACTIVE_PAGE 0x00000010 #define VIP_VGFIELD_ACTIVE_PAGE_IN 0x00000018 /*--------------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING THE VG VSYNC GENLOCK */ /*--------------------------------------------------------*/ typedef struct _TAG_GENLOCKBUFFER { unsigned long vip_signal_loss; unsigned long vsync_to_vg; unsigned long field_to_vg; unsigned long genlock_skew; int enable_timeout; } VIPGENLOCKBUFFER; /*------------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING VIP ANCILLARY CAPTURE */ /*------------------------------------------------------*/ typedef struct _TAG_ANCILLARYBUFFER { unsigned long msg1_base; unsigned long msg2_base; unsigned long msg_size; } VIPANCILLARYBUFFER; /*----------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING VIP CAPTURE BUFFERS */ /*----------------------------------------------------*/ #define VIP_INPUTFLAG_VBI 0x00000001 #define VIP_INPUTFLAG_INVERTPOLARITY 0x00000002 #define VIP_INPUTFLAG_PLANAR 0x00000004 #define VIP_MAX_BUFFERS 10 #define VIP_BUFFER_TASK_A 0x0000 #define VIP_BUFFER_TASK_B 0x0001 #define VIP_BUFFER_MAX_TASKS 0x0002 #define VIP_BUFFER_A 0x0000 #define VIP_BUFFER_B 0x0001 #define VIP_BUFFER_ANC 0x0002 #define VIP_BUFFER_MSG 0x0003 #define VIP_BUFFER_601 0x0004 #define VIP_BUFFER_A_ODD 0x0005 #define VIP_BUFFER_A_EVEN 0x0006 #define VIP_BUFFER_B_ODD 0x0007 #define VIP_BUFFER_B_EVEN 0x0008 typedef struct _TAG_INPUTBUFFER_ADDR { unsigned long even_base[VIP_MAX_BUFFERS]; unsigned long odd_base[VIP_MAX_BUFFERS]; unsigned long y_pitch; unsigned long uv_pitch; unsigned long odd_uoffset; unsigned long odd_voffset; unsigned long even_uoffset; unsigned long even_voffset; unsigned long vbi_even_base; unsigned long vbi_odd_base; } VIPINPUTBUFFER_ADDR; typedef struct _TAG_SETINPUTBUFFER { unsigned long flags; VIPINPUTBUFFER_ADDR offsets[VIP_BUFFER_MAX_TASKS]; unsigned long current_buffer; VIPANCILLARYBUFFER ancillaryData; } VIPINPUTBUFFER; /*------------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING VIP SUBWINDOW CAPTURE */ /*------------------------------------------------------*/ typedef struct _TAG_SUBWINDOWBUFFER { int enable; unsigned long start; unsigned long stop; } VIPSUBWINDOWBUFFER; /*--------------------------------------------------------*/ /* USER STRUCTURE FOR SAVING/RESTORING VIP REGISTERS */ /*--------------------------------------------------------*/ typedef struct _TAG_VIPSTATEBUFFER { unsigned long control1; unsigned long control2; unsigned long vip_int; unsigned long current_target; unsigned long max_address; unsigned long taska_evenbase; unsigned long taska_oddbase; unsigned long taska_vbi_evenbase; unsigned long taska_vbi_oddbase; unsigned long taska_data_pitch; unsigned long control3; unsigned long taska_v_oddoffset; unsigned long taska_u_oddoffset; unsigned long taskb_evenbase; unsigned long taskb_oddbase; unsigned long taskb_vbi_evenbase; unsigned long taskb_vbi_oddbase; unsigned long taskb_pitch; unsigned long taskb_voffset; unsigned long taskb_uoffset; unsigned long msg1_base; unsigned long msg2_base; unsigned long msg_size; unsigned long page_offset; unsigned long vert_start_stop; unsigned long vsync_err_count; unsigned long taska_u_evenoffset; unsigned long taska_v_evenoffset; Q_WORD msr_config; Q_WORD msr_smi; Q_WORD msr_pm; Q_WORD msr_diag; } VIPSTATEBUFFER; /*--------------------------------------------------------*/ /* VIP_SET_CAPTURE_STATE USER PARAMETERS */ /*--------------------------------------------------------*/ #define VIP_STOPCAPTURE 0x0000 #define VIP_STOPCAPTUREATLINEEND 0x0001 #define VIP_STOPCAPTUREATFIELDEND 0x0002 #define VIP_STOPCAPTUREATFRAMEEND 0x0003 #define VIP_STARTCAPTUREATNEXTLINE 0x0004 #define VIP_STARTCAPTUREATNEXTFIELD 0x0005 #define VIP_STARTCAPTUREATNEXTFRAME 0x0006 #define VIP_STARTCAPTURE 0x0007 /*--------------------------------------------------------*/ /* VIP_CONFIGURE_FIFO USER PARAMETERS */ /*--------------------------------------------------------*/ #define VIP_VIDEOTHRESHOLD 0x3000 #define VIP_ANCILLARYTHRESHOLD 0x3001 #define VIP_VIDEOFLUSH 0x3002 #define VIP_ANCILLARYFLUSH 0x3003 /*--------------------------------------------------------*/ /* VIP_SET_INTERRUPT_ENABLE USER DEFINITIONS */ /*--------------------------------------------------------*/ #define VIP_INT_FIFO_ERROR 0x80000000 #define VIP_INT_FIFO_WRAP 0x40000000 #define VIP_INT_FIFO_OVERFLOW 0x20000000 #define VIP_INT_FIFO_THRESHOLD 0x10000000 #define VIP_INT_LONGLINE 0x08000000 #define VIP_INT_VERTICAL_TIMING 0x04000000 #define VIP_INT_ACTIVE_PIXELS 0x02000000 #define VIP_INT_CLOCK_INPUT 0x01000000 #define VIP_INT_ANC_CHECKSUM_PARITY 0x00800000 #define VIP_INT_MSG_BUFFER_FULL 0x00400000 #define VIP_INT_END_VBLANK 0x00200000 #define VIP_INT_START_VBLANK 0x00100000 #define VIP_INT_START_EVEN 0x00080000 #define VIP_INT_START_ODD 0x00040000 #define VIP_INT_LINE_MATCH_TARGET 0x00020000 #define VIP_ALL_INTERRUPTS 0xFFFE0000 /*--------------------------------------------------------*/ /* VIP_GET_CURRENT_FIELD RETURN VALUES */ /*--------------------------------------------------------*/ #define VIP_ODD_FIELD 1 #define VIP_EVEN_FIELD 0 /*-------------------------------------------------*/ /* USER STRUCTURE FOR QUERYING VIP CAPABILITIES */ /*-------------------------------------------------*/ typedef struct _TAG_CAPABILITIESBUFFER { unsigned long revision_id; unsigned long device_id; unsigned long n_clock_domains; unsigned long n_smi_registers; } VIPCAPABILITIESBUFFER; /*-------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING VIP POWER */ /*-------------------------------------------------*/ typedef struct _TAG_POWERBUFFER { int glink_clock_mode; int vip_clock_mode; } VIPPOWERBUFFER; /*-------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING VIP PRIORITIES */ /*-------------------------------------------------*/ typedef struct _TAG_PRIORITYBUFFER { unsigned long secondary; unsigned long primary; unsigned long pid; } VIPPRIORITYBUFFER; /*--------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING VIP DEBUG OUTPUTS */ /*--------------------------------------------------*/ #define VIP_DIAG_UPPER_GLINK_MASTER 0x00010000 #define VIP_DIAG_UPPER_GLINK_SLAVE 0x00020000 #define VIP_DIAG_UPPER_GLINK_SLAVE_MMREG 0x00040000 #define VIP_DIAG_UPPER_Y_BUFFER 0x00080000 #define VIP_DIAG_UPPER_A_BUFFER 0x00100000 #define VIP_DIAG_UPPER_FIFO_OUTPUT 0x00200000 #define VIP_DIAG_UPPER_FIFO_INPUT 0x01000000 #define VIP_DIAG_UPPER_FORMATTER 0x02000000 #define VIP_DIAG_UPPER_INPUT_CONTROL 0x04000000 #define VIP_DIAG_LOWER_GLINK_MASTER 0x00000001 #define VIP_DIAG_LOWER_GLINK_SLAVE 0x00000002 #define VIP_DIAG_LOWER_GLINK_SLAVE_MMREG 0x00000004 #define VIP_DIAG_LOWER_Y_BUFFER 0x00000008 #define VIP_DIAG_LOWER_A_BUFFER 0x00000010 #define VIP_DIAG_LOWER_FIFO_OUTPUT 0x00000020 #define VIP_DIAG_LOWER_FIFO_INPUT 0x00000100 #define VIP_DIAG_LOWER_FORMATTER 0x00000200 #define VIP_DIAG_LOWER_INPUT_CONTROL 0x00000400 typedef struct _TAG_DEBUGBUFFER { unsigned long bist; unsigned long enable_upper; unsigned long select_upper; unsigned long enable_lower; unsigned long select_lower; } VIPDEBUGBUFFER; /*===================================================*/ /* VOP USER PARAMETER DEFINITIONS */ /*===================================================*/ /*------------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING VBI CAPTURE */ /*------------------------------------------------------*/ typedef struct _TAG_VBIWINDOWBUFFER { long horz_start; unsigned long vbi_width; unsigned long odd_line_capture_mask; unsigned long even_line_capture_mask; unsigned long odd_line_offset; unsigned long even_line_offset; unsigned long even_address_offset; unsigned long odd_address_offset; unsigned long data_size; unsigned long data_pitch; int enable_upscale; int horz_from_hsync; } VOPVBIWINDOWBUFFER; /*------------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING 601 FOR VOP */ /*------------------------------------------------------*/ #define VOP_601_INVERT_DISPE 0x00080000 #define VOP_601_INVERT_VSYNC 0x00040000 #define VOP_601_INVERT_HSYNC 0x00020000 #define VOP_VSYNC_EARLIER_BY4 0x00000000 #define VOP_VSYNC_EARLIER_BY2 0x00004000 #define VOP_VSYNC_NOSHIFT 0x00008000 #define VOP_VSYNC_LATER_BY_X 0x0000C000 #define VOP_601_YUV_8BIT 0x00000000 #define VOP_601_YUV_16BIT 0x00000001 #define VOP_601_RGB_8_8_8 0x00000002 #define VOP_601_YUV_4_4_4 0x00000003 typedef struct _TAG_VOP601 { unsigned long flags; unsigned long vsync_shift; unsigned long vsync_shift_count; unsigned long output_mode; } VOP_601DATA; /*------------------------------------------------------*/ /* USER STRUCTURE FOR CONFIGURING VOP OUTPUT */ /*------------------------------------------------------*/ /* VOP FLAGS */ #define VOP_FLAG_SINGLECHIPCOMPAT 0x00000001 #define VOP_FLAG_EXTENDEDSAV 0x00000002 #define VOP_FLAG_VBI 0x00000008 #define VOP_FLAG_TASK 0x00000010 #define VOP_FLAG_SWAP_UV 0x00000020 #define VOP_FLAG_SWAP_VBI 0x00000040 /* 4:4:2 TO 4:2:2 DECIMATION */ #define VOP_422MODE_COSITED 0x00000000 #define VOP_422MODE_INTERSPERSED 0x00000010 #define VOP_422MODE_ALTERNATING 0x00000020 /* VOP OPERATING MODES */ #define VOP_MODE_DISABLED 0x00000000 #define VOP_MODE_VIP11 0x00000001 #define VOP_MODE_CCIR656 0x00000002 #define VOP_MODE_VIP20_8BIT 0x00000003 #define VOP_MODE_VIP20_16BIT 0x00000004 #define VOP_MODE_601 0x00000005 /* VSYNC OUT SELECT FLAGS */ #define VOP_MB_SYNCSEL_DISABLED 0x00000000 #define VOP_MB_SYNCSEL_VG 0x00000020 #define VOP_MB_SYNCSEL_VG_INV 0x00000040 #define VOP_MB_SYNCSEL_STATREG17 0x00000060 #define VOP_MB_SYNCSEL_STATREG17_INV 0x00000080 typedef struct _TAG_VOPMODECONFIGURATIONBUFFER { unsigned long flags; unsigned long mode; unsigned long conversion_mode; unsigned long vsync_out; VOP_601DATA vop601; } VOPCONFIGURATIONBUFFER; /*--------------------------------------------------------*/ /* USER STRUCTURE FOR SAVING/RESTORING VOP REGISTERS */ /*--------------------------------------------------------*/ typedef struct _TAG_VOPSTATEBUFFER { unsigned long config; } VOPSTATEBUFFER; #endif xf86-video-geode-2.11.18/src/cim/cim_rtns.h0000644000175000017500000005070312654445443015133 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron function prototypes. */ #ifndef _cim_rtns_h #define _cim_rtns_h /* INCLUDE USER PARAMETER DEFINITIONS */ #include "cim_parm.h" /* COMPILER OPTION FOR C++ PROGRAMS */ #ifdef __cplusplus extern "C" { #endif /*--------------------------*/ /* CIMARRON MEMORY POINTERS */ /*--------------------------*/ extern unsigned char *cim_gp_ptr; extern unsigned char *cim_fb_ptr; extern unsigned char *cim_cmd_base_ptr; extern unsigned char *cim_cmd_ptr; extern unsigned char *cim_vid_ptr; extern unsigned char *cim_vip_ptr; extern unsigned char *cim_vg_ptr; /*----------------------------------------*/ /* INITIALIZATION ROUTINE DEFINITIONS */ /*----------------------------------------*/ int init_detect_cpu(unsigned long *cpu_revision, unsigned long *companion_revision); unsigned long init_read_pci(unsigned long address); int init_read_base_addresses(INIT_BASE_ADDRESSES * base_addresses); int init_read_cpu_frequency(unsigned long *cpu_frequency); /*----------------------------------------*/ /* GRAPHICS PROCESSOR ROUTINE DEFINITIONS */ /*----------------------------------------*/ void gp_set_limit_on_buffer_lead(unsigned long lead); void gp_set_command_buffer_base(unsigned long address, unsigned long start, unsigned long stop); void gp_set_frame_buffer_base(unsigned long address, unsigned long size); void gp_set_bpp(int bpp); void gp_declare_blt(unsigned long flags); void gp_declare_vector(unsigned long flags); void gp_write_parameters(void); void gp_set_raster_operation(unsigned char ROP); void gp_set_alpha_operation(int alpha_operation, int alpha_type, int channel, int apply_alpha, unsigned char alpha); void gp_set_solid_pattern(unsigned long color); void gp_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, int transparent, int x, int y); void gp_set_pattern_origin(int x, int y); void gp_set_color_pattern(unsigned long *pattern, int format, int x, int y); void gp_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, int transparent); void gp_set_solid_source(unsigned long color); void gp_set_source_transparency(unsigned long color, unsigned long mask); void gp_program_lut(unsigned long *colors, int full_lut); void gp_set_vector_pattern(unsigned long pattern, unsigned long color, int length); void gp_set_strides(unsigned long dst_stride, unsigned long src_stride); void gp_set_source_format(int format); void gp_pattern_fill(unsigned long dstoffset, unsigned long width, unsigned long height); void gp_screen_to_screen_blt(unsigned long dstoffset, unsigned long srcoffset, unsigned long width, unsigned long height, int flags); void gp_screen_to_screen_convert(unsigned long dstoffset, unsigned long srcoffset, unsigned long width, unsigned long height, int nibble); void gp_color_bitmap_to_screen_blt(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned char *data, long pitch); void gp_color_convert_blt(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned char *data, long pitch); void gp_custom_convert_blt(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned char *data, long pitch); void gp_rotate_blt(unsigned long dstoffset, unsigned long srcoffset, unsigned long width, unsigned long height, int degrees); void gp_mono_bitmap_to_screen_blt(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned char *data, long stride); void gp_text_blt(unsigned long dstoffset, unsigned long width, unsigned long height, unsigned char *data); void gp_mono_expand_blt(unsigned long dstoffset, unsigned long srcoffset, unsigned long srcx, unsigned long width, unsigned long height, int byte_packed); void gp_antialiased_text(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned char *data, long stride, int fourbpp); void gp_blend_mask_blt(unsigned long dstoffset, unsigned long srcx, unsigned long width, unsigned long height, unsigned long, long stride, int operation, int fourbpp); void gp_masked_blt(unsigned long dstoffset, unsigned long width, unsigned long height, unsigned long mono_srcx, unsigned long color_srcx, unsigned char *mono_mask, unsigned char *color_data, long mono_pitch, long color_pitch); void gp_screen_to_screen_masked(unsigned long dstoffset, unsigned long srcoffset, unsigned long width, unsigned long height, unsigned long mono_srcx, unsigned char *mono_mask, long mono_pitch); void gp_bresenham_line(unsigned long dstoffset, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned long flags); void gp_line_from_endpoints(unsigned long dstoffset, unsigned long x0, unsigned long y0, unsigned long x1, unsigned long y1, int inclusive); int gp_test_blt_pending(void); void gp_wait_blt_pending(void); void gp_wait_until_idle(void); int gp_test_blt_busy(void); void gp_save_state(GP_SAVE_RESTORE * gp_state); void gp_restore_state(GP_SAVE_RESTORE * gp_state); /*----------------------------------------*/ /* VIDEO GENERATOR ROUTINE DEFINITIONS */ /*----------------------------------------*/ int vg_delay_milliseconds(unsigned long ms); int vg_set_display_mode(unsigned long src_width, unsigned long src_height, unsigned long dst_width, unsigned long dst_height, int bpp, int hz, unsigned long flags); int vg_set_panel_mode(unsigned long src_width, unsigned long src_height, unsigned long dst_width, unsigned long dst_height, unsigned long panel_width, unsigned long panel_height, int bpp, unsigned long flags); int vg_set_tv_mode(unsigned long *src_width, unsigned long *src_height, unsigned long encoder, unsigned long tvres, int bpp, unsigned long flags, unsigned long h_overscan, unsigned long v_overscan); int vg_set_custom_mode(VG_DISPLAY_MODE * mode_params, int bpp); int vg_set_display_bpp(int bpp); int vg_get_display_mode_index(VG_QUERY_MODE * query); int vg_get_display_mode_information(unsigned int index, VG_DISPLAY_MODE * vg_mode); int vg_get_display_mode_count(void); int vg_get_current_display_mode(VG_DISPLAY_MODE * current_display, int *bpp); int vg_set_scaler_filter_coefficients(long h_taps[][5], long v_taps[][3]); int vg_configure_flicker_filter(unsigned long flicker_strength, int flicker_alpha); int vg_set_clock_frequency(unsigned long frequency, unsigned long pll_flags); int vg_set_border_color(unsigned long border_color); int vg_set_cursor_enable(int enable); int vg_set_mono_cursor_colors(unsigned long bkcolor, unsigned long fgcolor); int vg_set_cursor_position(long xpos, long ypos, VG_PANNING_COORDINATES * panning); int vg_set_mono_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask, unsigned long x_hotspot, unsigned long y_hotspot); int vg_set_mono_cursor_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask, unsigned long x_hotspot, unsigned long y_hotspot); int vg_set_color_cursor_shape(unsigned long memoffset, unsigned char *data, unsigned long width, unsigned long height, long pitch, unsigned long x_hotspot, unsigned long y_hotspot); int vg_pan_desktop(unsigned long x, unsigned long y, VG_PANNING_COORDINATES * panning); int vg_set_display_offset(unsigned long address); int vg_set_display_pitch(unsigned long pitch); int vg_set_display_palette_entry(unsigned long index, unsigned long palette); int vg_set_display_palette(unsigned long *palette); int vg_set_compression_enable(int enable); int vg_configure_compression(VG_COMPRESSION_DATA * comp_data); int vg_test_timing_active(void); int vg_test_vertical_active(void); int vg_wait_vertical_blank(void); int vg_test_even_field(void); int vg_configure_line_interrupt(VG_INTERRUPT_PARAMS * interrupt_info); unsigned long vg_test_and_clear_interrupt(void); unsigned long vg_test_flip_status(void); int vg_save_state(VG_SAVE_RESTORE * vg_state); int vg_restore_state(VG_SAVE_RESTORE * vg_state); /*----------------------------------------*/ /* VIDEO GENERATOR READ ROUTINES */ /*----------------------------------------*/ unsigned long vg_read_graphics_crc(int crc_source); unsigned long vg_read_window_crc(int crc_source, unsigned long x, unsigned long y, unsigned long width, unsigned long height); int vg_get_scaler_filter_coefficients(long h_taps[][5], long v_taps[][3]); int vg_get_flicker_filter_configuration(unsigned long *strength, int *flicker_alpha); unsigned long vg_get_display_pitch(void); unsigned long vg_get_frame_buffer_line_size(void); unsigned long vg_get_current_vline(void); unsigned long vg_get_display_offset(void); int vg_get_cursor_info(VG_CURSOR_DATA * cursor_data); int vg_get_display_palette_entry(unsigned long index, unsigned long *entry); unsigned long vg_get_border_color(void); int vg_get_display_palette(unsigned long *palette); int vg_get_compression_info(VG_COMPRESSION_DATA * comp_data); int vg_get_compression_enable(void); int vg_get_valid_bit(int line); /*----------------------------------------*/ /* DISPLAY FILTER ROUTINE DEFINITIONS */ /*----------------------------------------*/ int df_set_crt_enable(int crt_output); int df_set_panel_enable(int panel_output); int df_configure_video_source(DF_VIDEO_SOURCE_PARAMS * video_source_odd, DF_VIDEO_SOURCE_PARAMS * video_source_even); int df_set_video_offsets(int even, unsigned long y_offset, unsigned long u_offset, unsigned long v_offset); int df_set_video_scale(unsigned long src_width, unsigned long src_height, unsigned long dst_width, unsigned long dst_height, unsigned long flags); int df_set_video_position(DF_VIDEO_POSITION * video_window); int df_set_video_filter_coefficients(long taps[][4], int phase256); int df_set_video_enable(int enable, unsigned long flags); int df_set_video_color_key(unsigned long key, unsigned long mask, int graphics); int df_set_video_palette(unsigned long *palette); int df_set_video_palette_entry(unsigned long index, unsigned long palette); int df_configure_video_cursor_color_key(DF_VIDEO_CURSOR_PARAMS * cursor_color_key); int df_set_video_cursor_color_key_enable(int enable); int df_configure_alpha_window(int window, DF_ALPHA_REGION_PARAMS * alpha_data); int df_set_alpha_window_enable(int window, int enable); int df_set_no_ck_outside_alpha(int enable); int df_set_video_request(unsigned long x, unsigned long y); int df_set_output_color_space(int color_space); int df_set_output_path(int format); unsigned long df_test_video_flip_status(void); int df_save_state(DF_SAVE_RESTORE * gp_state); int df_restore_state(DF_SAVE_RESTORE * gp_state); /*----------------------------------------*/ /* DISPLAY FILTER READ ROUTINES */ /*----------------------------------------*/ unsigned long df_read_composite_crc(int crc_source); unsigned long df_read_composite_window_crc(unsigned long x, unsigned long y, unsigned long width, unsigned long height, int source); unsigned long df_read_panel_crc(void); int df_get_video_enable(int *enable, unsigned long *flags); int df_get_video_source_configuration(DF_VIDEO_SOURCE_PARAMS * video_source_odd, DF_VIDEO_SOURCE_PARAMS * video_source_even); int df_get_video_position(DF_VIDEO_POSITION * video_window); int df_get_video_scale(unsigned long *x_scale, unsigned long *y_scale); int df_get_video_filter_coefficients(long taps[][4], int *phase256); int df_get_video_color_key(unsigned long *key, unsigned long *mask, int *graphics); int df_get_video_palette_entry(unsigned long index, unsigned long *palette); int df_get_video_palette(unsigned long *palette); int df_get_video_cursor_color_key(DF_VIDEO_CURSOR_PARAMS * cursor_color_key); int df_get_video_cursor_color_key_enable(void); int df_get_alpha_window_configuration(int window, DF_ALPHA_REGION_PARAMS * alpha_data); int df_get_alpha_window_enable(int window); int df_get_video_request(unsigned long *x, unsigned long *y); int df_get_output_color_space(int *color_space); /*----------------------------------------*/ /* MSR ROUTINE DEFINITIONS */ /*----------------------------------------*/ int msr_init_table(void); int msr_create_geodelink_table(GEODELINK_NODE * gliu_nodes); int msr_create_device_list(GEODELINK_NODE * gliu_nodes, int max_devices); int msr_read64(unsigned long device, unsigned long msr_register, Q_WORD * msr_value); int msr_write64(unsigned long device, unsigned long msr_register, Q_WORD * msr_value); /*----------------------------------------*/ /* VIP ROUTINE DEFINITIONS */ /*----------------------------------------*/ int vip_initialize(VIPSETMODEBUFFER * buffer); int vip_update_601_params(VIP_601PARAMS * buffer); int vip_terminate(void); int vip_configure_capture_buffers(int buffer_type, VIPINPUTBUFFER * buffer); int vip_toggle_video_offsets(int buffer_type, VIPINPUTBUFFER * buffer); int vip_max_address_enable(unsigned long max_address, int enable); int vip_set_interrupt_enable(unsigned long mask, int enable); unsigned long vip_get_interrupt_state(void); int vip_set_capture_state(unsigned long state); int vip_set_vsync_error(unsigned long vertical_count, unsigned long window_before, unsigned long window_after, int enable); int vip_configure_fifo(unsigned long fifo_type, unsigned long fifo_size); int vip_set_loopback_enable(int bEnable); int vip_configure_genlock(VIPGENLOCKBUFFER * buffer); int vip_set_genlock_enable(int bEnable); int vip_configure_pages(int page_count, unsigned long page_offset); int vip_set_interrupt_line(int line); int vip_reset(void); int vip_set_subwindow_enable(VIPSUBWINDOWBUFFER * buffer); int vip_reset_interrupt_state(unsigned long interrupt_mask); int vip_save_state(VIPSTATEBUFFER * save_buffer); int vip_restore_state(VIPSTATEBUFFER * restore_buffer); int vip_set_power_characteristics(VIPPOWERBUFFER * buffer); int vip_set_priority_characteristics(VIPPRIORITYBUFFER * buffer); int vip_set_debug_characteristics(VIPDEBUGBUFFER * buffer); int vip_test_genlock_active(void); int vip_test_signal_status(void); unsigned long vip_get_current_field(void); /*----------------------------------------*/ /* VIP READ ROUTINES */ /*----------------------------------------*/ int vip_get_current_mode(VIPSETMODEBUFFER * buffer); int vip_get_601_configuration(VIP_601PARAMS * buffer); int vip_get_buffer_configuration(int buffer_type, VIPINPUTBUFFER * buffer); int vip_get_genlock_configuration(VIPGENLOCKBUFFER * buffer); int vip_get_genlock_enable(void); int vip_is_buffer_update_latched(void); unsigned long vip_get_capture_state(void); unsigned long vip_get_current_line(void); unsigned long vip_read_fifo(unsigned long fifo_address); int vip_write_fifo(unsigned long fifo_address, unsigned long fifo_data); int vip_enable_fifo_access(int enable); int vip_get_capability_characteristics(VIPCAPABILITIESBUFFER * buffer); int vip_get_power_characteristics(VIPPOWERBUFFER * buffer); int vip_get_priority_characteristics(VIPPRIORITYBUFFER * buffer); /*----------------------------------------*/ /* VOP ROUTINE DEFINITIONS */ /*----------------------------------------*/ int vop_set_vbi_window(VOPVBIWINDOWBUFFER * buffer); int vop_enable_vbi_output(int enable); int vop_set_configuration(VOPCONFIGURATIONBUFFER * config); int vop_save_state(VOPSTATEBUFFER * save_buffer); int vop_restore_state(VOPSTATEBUFFER * save_buffer); /*----------------------------------------*/ /* VOP READ ROUTINES */ /*----------------------------------------*/ int vop_get_current_mode(VOPCONFIGURATIONBUFFER * config); int vop_get_vbi_configuration(VOPVBIWINDOWBUFFER * buffer); int vop_get_vbi_enable(void); unsigned long vop_get_crc(void); unsigned long vop_read_vbi_crc(void); /* CLOSE BRACKET FOR C++ COMPLILATION */ #ifdef __cplusplus } #endif #endif xf86-video-geode-2.11.18/src/cim/cim_msr.c0000644000175000017500000003637312654445443014750 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Cimarron MSR access routines. These routines allow the user to query the * state of the GeodeLink Bus and read and write model-specfic registers. */ /*--------------------------------------------------------------*/ /* MSR GLOBALS */ /* These variables hold a local copy of the GeodeLink mapping */ /* as well as a lookup table for easy device addressing. */ /*--------------------------------------------------------------*/ GEODELINK_NODE gliu_nodes[24]; GEODELINK_NODE msr_dev_lookup[MSR_DEVICE_EMPTY]; #define GET_DEVICE_ID(macrohigh, macrolow) ((macrolow >> 12) & 0xFF) /*--------------------------------------------------------------------------- * msr_init_table * * This routine intializes the internal MSR table in Cimarron. This table is * used for any MSR device accesses. *--------------------------------------------------------------------------*/ int msr_init_table(void) { Q_WORD msr_value = { 0, 0 }; unsigned int i, j; int return_value = CIM_STATUS_OK; /* CHECK FOR VALID GEODELINK CONFIGURATION * The CPU and the three GLIUs are assumed to be at known static * addresses, so we will check the device IDs at these addresses as proof * of a valid GeodeLink configuration */ MSR_READ(MSR_GEODELINK_CAP, MSR_ADDRESS_VAIL, &msr_value); if (GET_DEVICE_ID(msr_value.high, msr_value.low) != MSR_CLASS_CODE_VAIL) return_value = CIM_STATUS_ERROR; MSR_READ(MSR_GEODELINK_CAP, MSR_ADDRESS_GLIU0, &msr_value); if (GET_DEVICE_ID(msr_value.high, msr_value.low) != MSR_CLASS_CODE_GLIU) return_value = CIM_STATUS_ERROR; MSR_READ(MSR_GEODELINK_CAP, MSR_ADDRESS_GLIU1, &msr_value); if (GET_DEVICE_ID(msr_value.high, msr_value.low) != MSR_CLASS_CODE_GLIU) return_value = CIM_STATUS_ERROR; MSR_READ(MSR_GEODELINK_CAP, MSR_ADDRESS_GLIU2, &msr_value); if (GET_DEVICE_ID(msr_value.high, msr_value.low) != MSR_CLASS_CODE_GLIU) return_value = CIM_STATUS_ERROR; if (return_value == CIM_STATUS_OK) { /* BUILD LOCAL COPY OF THE GEODELINK BUS */ msr_create_geodelink_table(gliu_nodes); /* CLEAR TABLE STATUS */ for (i = 0; i < MSR_DEVICE_EMPTY; i++) msr_dev_lookup[i].device_id = MSR_DEVICE_NOTFOUND; /* CREATE EASY LOOKUP TABLE FOR FUTURE HARDWARE ACCESS */ /* Note that MSR_DEVICE_EMPTY is the index after the last */ /* available device. Also note that we fill in known */ /* devices before filling in the rest of the table. */ msr_dev_lookup[MSR_DEVICE_GEODELX_GLIU0].address_from_cpu = MSR_ADDRESS_GLIU0; msr_dev_lookup[MSR_DEVICE_GEODELX_GLIU0].device_id = MSR_DEVICE_PRESENT; msr_dev_lookup[MSR_DEVICE_GEODELX_GLIU1].address_from_cpu = MSR_ADDRESS_GLIU1; msr_dev_lookup[MSR_DEVICE_GEODELX_GLIU1].device_id = MSR_DEVICE_PRESENT; msr_dev_lookup[MSR_DEVICE_5535_GLIU].address_from_cpu = MSR_ADDRESS_GLIU2; msr_dev_lookup[MSR_DEVICE_5535_GLIU].device_id = MSR_DEVICE_PRESENT; msr_dev_lookup[MSR_DEVICE_GEODELX_VAIL].address_from_cpu = MSR_ADDRESS_VAIL; msr_dev_lookup[MSR_DEVICE_GEODELX_VAIL].device_id = MSR_DEVICE_PRESENT; for (i = 0; i < MSR_DEVICE_EMPTY; i++) { if (msr_dev_lookup[i].device_id == MSR_DEVICE_NOTFOUND) { for (j = 0; j < 24; j++) { if (gliu_nodes[j].device_id == i) break; } if (j == 24) msr_dev_lookup[i].device_id = MSR_DEVICE_NOTFOUND; else { msr_dev_lookup[i].device_id = MSR_DEVICE_PRESENT; msr_dev_lookup[i].address_from_cpu = gliu_nodes[j].address_from_cpu; } } } } else { /* ERROR OUT THE GEODELINK TABLES */ for (i = 0; i < 24; i++) { gliu_nodes[i].address_from_cpu = 0xFFFFFFFF; gliu_nodes[i].device_id = MSR_DEVICE_EMPTY; } for (i = 0; i < MSR_DEVICE_EMPTY; i++) { msr_dev_lookup[i].address_from_cpu = 0xFFFFFFFF; msr_dev_lookup[i].device_id = MSR_DEVICE_NOTFOUND; } } return return_value; } /*--------------------------------------------------------------------------- * msr_create_geodelink_table * * This routine dumps the contents of the GeodeLink bus into an array of * 24 GEODELINK_NODE structures. Indexes 0-7 represent ports 0-7 of GLIU0, * indexes 8-15 represent ports 0-7 of GLIU1 and indexes 16-23 represent * ports 0-7 of GLIU2 (5535). *--------------------------------------------------------------------------*/ int msr_create_geodelink_table(GEODELINK_NODE * gliu_nodes) { unsigned long mbiu_port_count, reflective; unsigned long port, index; unsigned long gliu_count = 0; int glcp_count = 0; int usb_count = 0; int mpci_count = 0; Q_WORD msr_value = { 0, 0 }; /* ALL THREE GLIUS ARE IN ONE ARRAY */ /* Entries 0-7 contain the port information for GLIU0, entries */ /* 8-15 contain GLIU1 and 15-23 contain GLIU2. We perform the */ /* enumeration in two passes. The first simply fills in the */ /* addresses and class codes at each node. The second pass */ /* translates the class codes into indexes into Cimarron's device */ /* lookup table. */ /* COUNT GLIU0 PORTS */ MSR_READ(MSR_GLIU_CAP, MSR_ADDRESS_GLIU0, &msr_value); mbiu_port_count = (msr_value.high >> NUM_PORTS_SHIFT) & 7; /* FIND REFLECTIVE PORT */ /* Query the GLIU for the port through which we are communicating. */ /* We will avoid accesses to this port to avoid a self-reference. */ MSR_READ(MSR_GLIU_WHOAMI, MSR_ADDRESS_GLIU0, &msr_value); reflective = msr_value.low & WHOAMI_MASK; /* SPECIAL CASE FOR PORT 0 */ /* GLIU0 port 0 is a special case, as it points back to GLIU0. GLIU0 */ /* responds at address 0x10000xxx, which does not equal 0 << 29. */ gliu_nodes[0].address_from_cpu = MSR_ADDRESS_GLIU0; gliu_nodes[0].device_id = MSR_CLASS_CODE_GLIU; /* ENUMERATE ALL PORTS */ for (port = 1; port < 8; port++) { /* FILL IN ADDRESS */ gliu_nodes[port].address_from_cpu = port << 29; if (port == reflective) gliu_nodes[port].device_id = MSR_CLASS_CODE_REFLECTIVE; else if (port > mbiu_port_count) gliu_nodes[port].device_id = MSR_CLASS_CODE_UNPOPULATED; else { MSR_READ(MSR_GEODELINK_CAP, gliu_nodes[port].address_from_cpu, &msr_value); gliu_nodes[port].device_id = GET_DEVICE_ID(msr_value.high, msr_value.low); } } /* COUNT GLIU1 PORTS */ MSR_READ(MSR_GLIU_CAP, MSR_ADDRESS_GLIU1, &msr_value); mbiu_port_count = (msr_value.high >> NUM_PORTS_SHIFT) & 7; /* FIND REFLECTIVE PORT */ MSR_READ(MSR_GLIU_WHOAMI, MSR_ADDRESS_GLIU1, &msr_value); reflective = msr_value.low & WHOAMI_MASK; /* ENUMERATE ALL PORTS */ for (port = 0; port < 8; port++) { index = port + 8; /* FILL IN ADDRESS */ gliu_nodes[index].address_from_cpu = (0x02l << 29) + (port << 26); if (port == reflective) gliu_nodes[index].device_id = MSR_CLASS_CODE_REFLECTIVE; else if (port > mbiu_port_count) gliu_nodes[index].device_id = MSR_CLASS_CODE_UNPOPULATED; else { MSR_READ(MSR_GEODELINK_CAP, gliu_nodes[index].address_from_cpu, &msr_value); gliu_nodes[index].device_id = GET_DEVICE_ID(msr_value.high, msr_value.low); } } /* COUNT GLIU2 PORTS */ MSR_READ(MSR_GLIU_CAP, MSR_ADDRESS_GLIU2, &msr_value); mbiu_port_count = (msr_value.high >> NUM_PORTS_SHIFT) & 7; /* FIND REFLECTIVE PORT */ MSR_READ(MSR_GLIU_WHOAMI, MSR_ADDRESS_GLIU2, &msr_value); reflective = msr_value.low & WHOAMI_MASK; /* FILL IN PORT 0 AND 1 */ /* Port 0 on 5535 is MBIU2. Port 1 is MPCI, but it is referenced at */ /* a special address. */ gliu_nodes[16].address_from_cpu = MSR_ADDRESS_GLIU2; gliu_nodes[16].device_id = MSR_CLASS_CODE_GLIU; gliu_nodes[17].address_from_cpu = MSR_ADDRESS_5535MPCI; gliu_nodes[17].device_id = MSR_CLASS_CODE_MPCI; /* ENUMERATE ALL PORTS */ for (port = 2; port < 8; port++) { index = port + 16; /* FILL IN ADDRESS */ gliu_nodes[index].address_from_cpu = (0x02l << 29) + (0x04l << 26) + (0x02l << 23) + (port << 20); if (port == reflective) gliu_nodes[index].device_id = MSR_CLASS_CODE_REFLECTIVE; else if (port > mbiu_port_count) gliu_nodes[index].device_id = MSR_CLASS_CODE_UNPOPULATED; else { MSR_READ(MSR_GEODELINK_CAP, gliu_nodes[index].address_from_cpu, &msr_value); gliu_nodes[index].device_id = GET_DEVICE_ID(msr_value.high, msr_value.low); } } /* SECOND PASS - TRANSLATION */ /* Now that the class codes for each device are stored in the */ /* array, we walk through the array and translate the class */ /* codes to table indexes. For class codes that have multiple */ /* instances, the table indexes are sequential. */ for (port = 0; port < 24; port++) { /* SPECIAL CASE FOR GLIU UNITS */ /* A GLIU can be both on another port and on its own port. These */ /* end up as the same address, but are shown as duplicate nodes in */ /* the GeodeLink table. */ if ((port & 7) == 0) gliu_count = port >> 3; switch (gliu_nodes[port].device_id) { /* UNPOPULATED OR REFLECTIVE NODES */ case MSR_CLASS_CODE_UNPOPULATED: index = MSR_DEVICE_EMPTY; break; case MSR_CLASS_CODE_REFLECTIVE: index = MSR_DEVICE_REFLECTIVE; break; /* KNOWN CLASS CODES */ case MSR_CLASS_CODE_GLIU: index = MSR_DEVICE_GEODELX_GLIU0 + gliu_count++; break; case MSR_CLASS_CODE_GLCP: index = MSR_DEVICE_GEODELX_GLCP + glcp_count++; break; case MSR_CLASS_CODE_MPCI: index = MSR_DEVICE_GEODELX_MPCI + mpci_count++; break; case MSR_CLASS_CODE_USB: index = MSR_DEVICE_5535_USB2 + usb_count++; break; case MSR_CLASS_CODE_USB2: index = MSR_DEVICE_5536_USB_2_0; break; case MSR_CLASS_CODE_ATAC: index = MSR_DEVICE_5535_ATAC; break; case MSR_CLASS_CODE_MDD: index = MSR_DEVICE_5535_MDD; break; case MSR_CLASS_CODE_ACC: index = MSR_DEVICE_5535_ACC; break; case MSR_CLASS_CODE_MC: index = MSR_DEVICE_GEODELX_MC; break; case MSR_CLASS_CODE_GP: index = MSR_DEVICE_GEODELX_GP; break; case MSR_CLASS_CODE_VG: index = MSR_DEVICE_GEODELX_VG; break; case MSR_CLASS_CODE_DF: index = MSR_DEVICE_GEODELX_DF; break; case MSR_CLASS_CODE_FG: index = MSR_DEVICE_GEODELX_FG; break; case MSR_CLASS_CODE_VIP: index = MSR_DEVICE_GEODELX_VIP; break; case MSR_CLASS_CODE_AES: index = MSR_DEVICE_GEODELX_AES; break; case MSR_CLASS_CODE_VAIL: index = MSR_DEVICE_GEODELX_VAIL; break; default: index = MSR_DEVICE_EMPTY; break; } gliu_nodes[port].device_id = index; } return CIM_STATUS_OK; } /*--------------------------------------------------------------------------- * msr_create_device_list * * This routine dumps a list of all known GeodeLX/5535 devices as well as their * respective status and address. *--------------------------------------------------------------------------*/ int msr_create_device_list(GEODELINK_NODE * gliu_nodes, int max_devices) { int i, count; if (max_devices < MSR_DEVICE_EMPTY) count = max_devices; else count = MSR_DEVICE_EMPTY; for (i = 0; i < count; i++) { gliu_nodes[i].address_from_cpu = msr_dev_lookup[i].address_from_cpu; gliu_nodes[i].device_id = msr_dev_lookup[i].device_id; } return CIM_STATUS_OK; } /*-------------------------------------------------------------------- * msr_read64 * * Performs a 64-bit read from 'msr_register' in device 'device'. 'device' is * an index into Cimarron's table of known GeodeLink devices. *-------------------------------------------------------------------*/ int msr_read64(unsigned long device, unsigned long msr_register, Q_WORD * msr_value) { if (device < MSR_DEVICE_EMPTY) { if (msr_dev_lookup[device].device_id == MSR_DEVICE_PRESENT) { MSR_READ(msr_register, msr_dev_lookup[device].address_from_cpu, msr_value); return CIM_STATUS_OK; } } msr_value->low = msr_value->high = 0; return CIM_STATUS_DEVNOTFOUND; } /*-------------------------------------------------------------------- * msr_write64 * * Performs a 64-bit write to 'msr_register' in device 'device'. 'device' is * an index into Cimarron's table of known GeodeLink devices. *-------------------------------------------------------------------*/ int msr_write64(unsigned long device, unsigned long msr_register, Q_WORD * msr_value) { if (device < MSR_DEVICE_EMPTY) { if (msr_dev_lookup[device].device_id == MSR_DEVICE_PRESENT) { MSR_WRITE(msr_register, msr_dev_lookup[device].address_from_cpu, msr_value); return CIM_STATUS_OK; } } return CIM_STATUS_DEVNOTFOUND; } xf86-video-geode-2.11.18/src/lx_output.c0000644000175000017500000002107412654445443014602 00000000000000/* Copyright (c) 2008 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "X11/Xatom.h" #include "geode.h" #include "xf86Modes.h" #include "xf86Crtc.h" #include "cim/cim_defs.h" #include "cim/cim_regs.h" #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) typedef struct _LXOutputPrivateRec { I2CBusPtr pDDCBus; } LXOutputPrivateRec, *LXOutputPrivatePtr; static Atom scale_atom; static void lx_create_resources(xf86OutputPtr output) { int ret; char *s; ScrnInfoPtr pScrni = output->scrn; GeodeRec *pGeode = GEODEPTR(pScrni); /* Scaling is only used for panels */ if (!(pGeode->Output & OUTPUT_PANEL)) return; scale_atom = MAKE_ATOM("scale"); ret = RRConfigureOutputProperty(output->randr_output, scale_atom, FALSE, FALSE, FALSE, 0, NULL); if (ret) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "RRConfigureOutputProperty error %d\n", ret); } s = "on"; ret = RRChangeOutputProperty(output->randr_output, scale_atom, XA_STRING, 8, PropModeReplace, strlen(s), (pointer) s, FALSE, FALSE); if (ret) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "RRCharOutputProperty error %d\n", ret); } } static Bool lx_output_set_property(xf86OutputPtr output, Atom property, RRPropertyValuePtr value) { ScrnInfoPtr pScrni = output->scrn; GeodeRec *pGeode = GEODEPTR(pScrni); Bool scale = pGeode->Scale; char *s; int ret; if (property != scale_atom) return FALSE; if (value->type != XA_STRING || value->format != 8) return FALSE; s = (char *) value->data; if (value->size == 2 && !strncmp("on", s, 2)) pGeode->Scale = TRUE; else if (value->size == 3 && !strncmp("off", s, 3)) pGeode->Scale = FALSE; if (pGeode->Scale != scale && output->crtc) { xf86CrtcPtr crtc = output->crtc; if (crtc->enabled) { ret = xf86CrtcSetMode(crtc, &crtc->desiredMode, crtc->desiredRotation, crtc->desiredX, crtc->desiredY); if (!ret) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Failed to set mode after property change!\n"); pGeode->Scale = scale; return FALSE; } } } return TRUE; } static void lx_output_dpms(xf86OutputPtr output, int mode) { /* DPMS is handled by the CRTC */ } static void lx_output_prepare(xf86OutputPtr output) { /* Nothing to do */ } static void lx_output_commit(xf86OutputPtr output) { /* Nothing to do */ } static void lx_output_save(xf86OutputPtr output) { /* Nothing to do */ } static void lx_output_restore(xf86OutputPtr output) { /* Nothing to do */ } static int lx_output_mode_valid(xf86OutputPtr output, DisplayModePtr pMode) { ScrnInfoPtr pScrni = output->scrn; GeodeRec *pGeode = GEODEPTR(pScrni); /* DCON Panel specific resolution - OLPC's one */ if (pGeode->Output & OUTPUT_DCON) { if (pGeode->panelMode->HDisplay == 1200 && pGeode->panelMode->VDisplay == 900) return MODE_OK; } if ((pGeode->Output & OUTPUT_PANEL) && gfx_is_panel_mode_supported(pGeode->panelMode->HDisplay, pGeode->panelMode->VDisplay, pMode->HDisplay, pMode->VDisplay, pScrni->bitsPerPixel) != -1) { return MODE_OK; } if (gfx_is_display_mode_supported(pMode->HDisplay, pMode->VDisplay, pScrni->bitsPerPixel, GeodeGetRefreshRate(pMode)) != -1) { return MODE_OK; } if (pMode->type & (M_T_DRIVER | M_T_PREFERRED)) return MODE_OK; return MODE_OK; } static Bool lx_output_mode_fixup(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { return TRUE; } static void lx_output_mode_set(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode) { ScrnInfoPtr pScrni = output->scrn; GeodeRec *pGeode = GEODEPTR(pScrni); /* Configure the output path */ if (pGeode->Output & OUTPUT_PANEL) df_set_output_path((pGeode->Output & OUTPUT_CRT) ? DF_DISPLAY_CRT_FP : DF_DISPLAY_FP); else df_set_output_path(DF_DISPLAY_CRT); } static xf86OutputStatus lx_output_detect(xf86OutputPtr output) { /* We assume that there is always something * out there */ return XF86OutputStatusConnected; } static DisplayModePtr lx_output_get_modes(xf86OutputPtr output) { ScrnInfoPtr pScrni = output->scrn; GeodeRec *pGeode = GEODEPTR(pScrni); LXOutputPrivatePtr lx_output = output->driver_private; xf86MonPtr mon; DisplayModePtr modes; if (!(pGeode->Output & OUTPUT_PANEL)) { mon = xf86OutputGetEDID(output, lx_output->pDDCBus); xf86OutputSetEDID(output, mon); modes = xf86OutputGetEDIDModes(output); } else { modes = xf86DuplicateMode(pGeode->panelMode); } return modes; } static void lx_output_destroy(xf86OutputPtr output) { if (output->driver_private) free(output->driver_private); output->driver_private = NULL; } #ifdef RANDR_GET_CRTC_INTERFACE static xf86CrtcPtr lx_output_get_crtc(xf86OutputPtr output) { return output->crtc; } #endif static const xf86OutputFuncsRec lx_output_funcs = { .create_resources = lx_create_resources, .dpms = lx_output_dpms, .save = lx_output_save, .restore = lx_output_restore, .mode_valid = lx_output_mode_valid, .mode_fixup = lx_output_mode_fixup, .prepare = lx_output_prepare, .mode_set = lx_output_mode_set, .commit = lx_output_commit, .detect = lx_output_detect, .get_modes = lx_output_get_modes, #ifdef RANDR_GET_CRTC_INTERFACE .get_crtc = lx_output_get_crtc, #endif .set_property = lx_output_set_property, .destroy = lx_output_destroy, }; void LXSetupOutput(ScrnInfoPtr pScrni) { xf86OutputPtr output; LXOutputPrivatePtr lxpriv; GeodePtr pGeode = GEODEPTR(pScrni); output = xf86OutputCreate(pScrni, &lx_output_funcs, "default"); lxpriv = xnfcalloc(1, sizeof(LXOutputPrivateRec)); if (!lxpriv) { xf86OutputDestroy(output); return; } output->driver_private = lxpriv; output->interlaceAllowed = TRUE; output->doubleScanAllowed = TRUE; /* Set up the DDC bus */ GeodeI2CInit(pScrni, &lxpriv->pDDCBus, "CS5536 DDC"); if (pScrni->monitor->widthmm && pScrni->monitor->heightmm) { /* prioritize the admin's screen size */ output->mm_width = pScrni->monitor->widthmm; output->mm_height = pScrni->monitor->heightmm; } else if (pGeode->mm_width && pGeode->mm_height) { /* if we have a panel that we're certain of the size of, set it */ output->mm_width = pScrni->monitor->widthmm = pGeode->mm_width; output->mm_height = pScrni->monitor->heightmm = pGeode->mm_height; } /* We only have one CRTC, and this output is tied to it */ output->possible_crtcs = 1; } xf86-video-geode-2.11.18/src/cim_dev.h0000644000175000017500000000405512654445443014152 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #ifndef CIMDEV_H_ #define CIMDEV_H_ #define CIM_RESERVE_MEM 0x01 #define CIM_FREE_MEM 0x02 #define CIMDEV_MINOR_DEV 156 /* Block flags */ #define CIM_F_FREE 0x01 /* This block is marked as free */ #define CIM_F_CMDBUF 0x02 /* GP command buffer flag */ #define CIM_F_PRIVATE 0x04 /* This block is reserved only for its owner */ #define CIM_F_PUBLIC 0x08 /* This block can be used by the world */ typedef struct { /* These fields get populated by the client */ char owner[10]; char name[15]; int flags; int size; /* These fields are populated by the device */ unsigned long offset; } cim_mem_req_t; typedef struct { char owner[10]; unsigned long offset; } cim_mem_free_t; #endif xf86-video-geode-2.11.18/src/geode_pcirename.h0000644000175000017500000001167612654445443015661 00000000000000/* * Copyright 2007 George Sapountzis * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * Macros for porting drivers from legacy xfree86 PCI code to the pciaccess * library. The main purpose being to facilitate source code compatibility. */ #ifndef CIRPCIRENAME_H #define CIRPCIRENAME_H enum region_type { REGION_MEM, REGION_IO }; #ifndef XSERVER_LIBPCIACCESS /* pciVideoPtr */ #define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor) #define PCI_DEV_DEVICE_ID(_pcidev) ((_pcidev)->chipType) #define PCI_DEV_REVISION(_pcidev) ((_pcidev)->chipRev) #define PCI_SUB_VENDOR_ID(_pcidev) ((_pcidev)->subsysVendor) #define PCI_SUB_DEVICE_ID(_pcidev) ((_pcidev)->subsysCard) #define PCI_DEV_TAG(_pcidev) pciTag((_pcidev)->bus, \ (_pcidev)->device, \ (_pcidev)->func) #define PCI_DEV_BUS(_pcidev) ((_pcidev)->bus) #define PCI_DEV_DEV(_pcidev) ((_pcidev)->device) #define PCI_DEV_FUNC(_pcidev) ((_pcidev)->func) /* pciConfigPtr */ #define PCI_CFG_TAG(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->tag) #define PCI_CFG_BUS(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->busnum) #define PCI_CFG_DEV(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->devnum) #define PCI_CFG_FUNC(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->funcnum) /* region addr: xfree86 uses different fields for memory regions and I/O ports */ #define PCI_REGION_BASE(_pcidev, _b, _type) \ (((_type) == REGION_MEM) ? (_pcidev)->memBase[(_b)] \ : (_pcidev)->ioBase[(_b)]) /* region size: xfree86 uses the log2 of the region size, * but with zero meaning no region, not size of one XXX */ #define PCI_REGION_SIZE(_pcidev, _b) \ (((_pcidev)->size[(_b)] > 0) ? (1 << (_pcidev)->size[(_b)]) : 0) /* read/write PCI configuration space */ #define PCI_READ_BYTE(_pcidev, _value_ptr, _offset) \ *(_value_ptr) = pciReadByte(PCI_CFG_TAG(_pcidev), (_offset)) #define PCI_READ_LONG(_pcidev, _value_ptr, _offset) \ *(_value_ptr) = pciReadLong(PCI_CFG_TAG(_pcidev), (_offset)) #define PCI_WRITE_LONG(_pcidev, _value, _offset) \ pciWriteLong(PCI_CFG_TAG(_pcidev), (_offset), (_value)) #else /* XSERVER_LIBPCIACCESS */ typedef struct pci_device *pciVideoPtr; #define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor_id) #define PCI_DEV_DEVICE_ID(_pcidev) ((_pcidev)->device_id) #define PCI_DEV_REVISION(_pcidev) ((_pcidev)->revision) #define PCI_SUB_VENDOR_ID(_pcidev) ((_pcidev)->subvendor_id) #define PCI_SUB_DEVICE_ID(_pcidev) ((_pcidev)->subdevice_id) /* pci-rework functions take a 'pci_device' parameter instead of a tag */ #define PCI_DEV_TAG(_pcidev) (_pcidev) /* PCI_DEV macros, typically used in printf's, add domain ? XXX */ #define PCI_DEV_BUS(_pcidev) ((_pcidev)->bus) #define PCI_DEV_DEV(_pcidev) ((_pcidev)->dev) #define PCI_DEV_FUNC(_pcidev) ((_pcidev)->func) /* pci-rework functions take a 'pci_device' parameter instead of a tag */ #define PCI_CFG_TAG(_pcidev) (_pcidev) /* PCI_CFG macros, typically used in DRI init, contain the domain */ #define PCI_CFG_BUS(_pcidev) (((_pcidev)->domain << 8) | \ (_pcidev)->bus) #define PCI_CFG_DEV(_pcidev) ((_pcidev)->dev) #define PCI_CFG_FUNC(_pcidev) ((_pcidev)->func) #define PCI_REGION_BASE(_pcidev, _b, _type) ((_pcidev)->regions[(_b)].base_addr) #define PCI_REGION_SIZE(_pcidev, _b) ((_pcidev)->regions[(_b)].size) #define PCI_READ_BYTE(_pcidev, _value_ptr, _offset) \ pci_device_cfg_read_u8((_pcidev), (_value_ptr), (_offset)) #define PCI_READ_LONG(_pcidev, _value_ptr, _offset) \ pci_device_cfg_read_u32((_pcidev), (_value_ptr), (_offset)) #define PCI_WRITE_LONG(_pcidev, _value, _offset) \ pci_device_cfg_write_u32((_pcidev), (_value), (_offset)) #endif /* XSERVER_LIBPCIACCESS */ #endif /* CIRPCIRENAME_H */ xf86-video-geode-2.11.18/src/gx_driver.c0000644000175000017500000013524112654445443014532 00000000000000/* Copyright (c) 2003-2006 Advanced Micro Devices, Inc. * * Portioned modeled from xf86-video-intel/src/i830_driver.c * Copyright 2001 VA Linux Systems Inc., Fremont, California. * Copyright \ufffd 2002 by David Dawes * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "xf86.h" #include "xf86_OSproc.h" #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86Resources.h" #endif #include "xf86cmap.h" #include "compiler.h" #include "mipointer.h" #include "shadow.h" #include #include "fb.h" #include "miscstruct.h" #include "micmap.h" #include "vbe.h" #include "fb.h" #include "randrstr.h" #include "geode.h" #include "gfx_defs.h" #include "gfx_regs.h" #include "panel.h" /* Bring in VGA functions */ #include "gx_vga.c" #define GX_MIN_PITCH 1024 #define GX_MAX_PITCH 8192 #define GX_MAX_WIDTH 1600 #define GX_MIN_HEIGHT 400 #define GX_MAX_HEIGHT 1200 #define GX_CB_PITCH 544 #define GX_CB_SIZE 544 #define GX_CPU_REG_SIZE 0x4000 #define GX_GP_REG_SIZE 0x4000 #define GX_VID_REG_SIZE 0x4000 #define DEFAULT_IMG_LINE_BUFS 20 #define DEFAULT_CLR_LINE_BUFS 20 extern OptionInfoRec GX_GeodeOptions[]; unsigned char *XpressROMPtr; static inline void gx_enable_dac_power(void) { gfx_write_vid32(RCDF_VID_MISC, gfx_read_vid32(RCDF_VID_MISC) & RCDF_GAMMA_BYPASS_BOTH); } static inline void gx_disable_dac_power(void) { gfx_write_vid32(RCDF_VID_MISC, RCDF_DAC_POWER_DOWN | RCDF_ANALOG_POWER_DOWN | (gfx_read_vid32(RCDF_VID_MISC) & RCDF_GAMMA_BYPASS_BOTH)); } static void GXInitEXAMemory(ScrnInfoPtr pScrni, unsigned int *offset, unsigned int *avail) { GeodePtr pGeode = GEODEPTR(pScrni); if (pGeode->exaBfrSz > 0 && pGeode->exaBfrSz <= *avail) { pGeode->exaBfrOffset = *offset; *offset += pGeode->exaBfrOffset; *avail -= pGeode->exaBfrOffset; } } static void GXInitXAAMemory(ScrnInfoPtr pScrni, unsigned int *offset, unsigned int *avail) { GeodePtr pGeode = GEODEPTR(pScrni); unsigned int size, i, pitch; /* XXX - FIXME - What if we are out of room? Then what? */ /* For now, we NULL them all out. */ if (pGeode->NoOfImgBuffers > 0) { size = pGeode->displayPitch * pGeode->NoOfImgBuffers; if (size <= *avail) { for (i = 0; i < pGeode->NoOfImgBuffers; i++) { pGeode->AccelImageWriteBuffers[i] = pGeode->FBBase + *offset; *offset += pGeode->displayPitch; *avail -= pGeode->displayPitch; } } else { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Not enough memory for image write buffers.\n"); for (i = 0; i < pGeode->NoOfImgBuffers; i++) pGeode->AccelImageWriteBuffers[i] = NULL; } } if (pGeode->NoOfColorExpandLines > 0) { pitch = ((pGeode->displayPitch + 31) >> 5) << 2; size = pitch * pGeode->NoOfColorExpandLines; if (size <= *avail) { for (i = 0; i < pGeode->NoOfColorExpandLines; i++) { pGeode->AccelColorExpandBuffers[i] = pGeode->FBBase + *offset; *offset += pitch; *avail -= pitch; } } else { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Not enough memory for color expansion buffers.\n"); for (i = 0; i < pGeode->NoOfImgBuffers; i++) pGeode->AccelColorExpandBuffers[i] = NULL; } } } static Bool GXAllocateMemory(ScreenPtr pScrn, ScrnInfoPtr pScrni, int rotate) { GeodePtr pGeode = GEODEPTR(pScrni); unsigned int fboffset, fbavail; unsigned int size; unsigned int bytpp = (pScrni->bitsPerPixel + 7) / 8; BOOL ret = TRUE; if (pGeode->tryCompression) pGeode->displayPitch = GeodeCalculatePitchBytes(pScrni->virtualX, pScrni->bitsPerPixel); else pGeode->displayPitch = ((pScrni->virtualX + 3) & ~3) * (pScrni->bitsPerPixel >> 3); pGeode->Pitch = pGeode->displayPitch; pGeode->displayWidth = pGeode->displayPitch / bytpp; pScrni->displayWidth = pGeode->displayWidth; fbavail = pGeode->FBAvail - 0x4000; pGeode->displayOffset = fboffset = 0; pGeode->displaySize = pScrni->virtualY * pGeode->displayPitch; fbavail -= pGeode->displaySize; fboffset += pGeode->displaySize; if (pGeode->tryCompression) { size = pScrni->virtualY * GX_CB_PITCH; if (size <= fbavail) { pGeode->CBData.compression_offset = fboffset; fboffset += size; fbavail -= size; pGeode->Compression = TRUE; } else { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Not enough memory for compression\n"); pGeode->Compression = FALSE; } } if (pGeode->tryHWCursor) { if (fbavail >= 1024) { pGeode->CursorStartOffset = fboffset; fboffset += 1024; fbavail -= 1024; pGeode->HWCursor = TRUE; } else { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Not enough memory for the hardware cursor\n"); pGeode->HWCursor = FALSE; } } if (!pGeode->NoAccel) { if (pGeode->useEXA) GXInitEXAMemory(pScrni, &fboffset, &fbavail); else GXInitXAAMemory(pScrni, &fboffset, &fbavail); } pGeode->shadowSize = 0; if (rotate != RR_Rotate_0) { if (rotate & (RR_Rotate_90 | RR_Rotate_270)) size = pGeode->displayPitch * pScrni->virtualX; else size = pGeode->displayPitch * pScrni->virtualY; if (size <= fbavail) { pGeode->shadowOffset = fboffset; pGeode->shadowSize = size; fboffset += size; fbavail -= size; } else { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Not enough memory for the shadow framebuffer\n"); ret = FALSE; } } /* XAA always exists - we can't remove it on demand like we can with EXA. * So we assume the worse, and only give XAA enough offspace room to * account for any eventuality that RandR might throw at us. */ if (!pGeode->NoAccel) { if (pGeode->useEXA && pGeode->pExa) { ExaDriverPtr pExa = pGeode->pExa; pExa->offScreenBase = fboffset; pExa->memorySize = fboffset + fbavail; } if (!pGeode->useEXA) { #if XF86XAA if (!xf86FBManagerRunning(pScrn)) { unsigned int offset = fboffset; unsigned int avail = fbavail; RegionRec OffscreenRegion; BoxRec AvailBox; /* Assume the shadow FB exists even if it doesnt */ if (pGeode->shadowSize == 0) { size = (pScrn->width * bytpp) * pScrni->virtualX; offset += size; avail -= size; } AvailBox.x1 = 0; AvailBox.y1 = (offset + pGeode->displayPitch - 1) / pGeode->displayPitch; AvailBox.x2 = pGeode->displayWidth; AvailBox.y2 = (offset + avail) / pGeode->displayPitch; if (AvailBox.y1 < AvailBox.y2) { REGION_INIT(pScrn, &OffscreenRegion, &AvailBox, 2); if (!xf86InitFBManagerRegion(pScrn, &OffscreenRegion)) xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Memory manager initialization failed.\n"); REGION_UNINIT(pScrn, &OffscreenRegion); } else xf86DrvMsg(pScrni->scrnIndex, X_INFO, "Cache disabled - no offscreen memory available.\n"); } else xf86DrvMsg(pScrni->scrnIndex, X_INFO, "XAA offscreen memory has already been allocated.\n"); #endif } } return ret; } static Bool GXSaveScreen(ScreenPtr pScrn, int mode) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodePtr pGeode = GEODEPTR(pScrni); if (pGeode->useVGA && !pScrni->vtSema) return vgaHWSaveScreen(pScrn, mode); return TRUE; } /* Common function - used by the LX too */ #ifdef XSERVER_LIBPCIACCESS static inline void * map_pci_mem(ScrnInfoPtr pScrni, int vram, struct pci_device *dev, int bar, int size) { void *ptr; int map_size = size ? size : dev->regions[bar].size; int err = pci_device_map_range(dev, dev->regions[bar].base_addr, map_size, PCI_DEV_MAP_FLAG_WRITABLE | (vram ? PCI_DEV_MAP_FLAG_WRITE_COMBINE : 0), &ptr); if (err) return NULL; return ptr; } static inline int unmap_pci_mem(ScrnInfoPtr pScrni, struct pci_device *dev, void *ptr, int size) { return pci_device_unmap_range(dev, ptr, size); } #endif extern unsigned long gfx_gx2_scratch_base; static Bool GXMapMem(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); int index = pScrni->scrnIndex; pciVideoPtr pci = xf86GetPciInfoForEntity(pGeode->pEnt->index); #ifndef XSERVER_LIBPCIACCESS gfx_virt_regptr = (unsigned char *) xf86MapVidMem(index, VIDMEM_MMIO, pci->memBase[2], pci->size[2]); gfx_virt_gpptr = (unsigned char *) xf86MapVidMem(index, VIDMEM_MMIO, pci->memBase[1], pci->size[1]); gfx_virt_vidptr = (unsigned char *) xf86MapVidMem(index, VIDMEM_MMIO, pci->memBase[3], pci->size[3]); gfx_virt_fbptr = (unsigned char *) xf86MapVidMem(index, VIDMEM_FRAMEBUFFER, pci->memBase[0], pGeode->FBAvail); #else gfx_virt_regptr = map_pci_mem(pScrni, 0, pci, 2, 0); gfx_virt_gpptr = map_pci_mem(pScrni, 0, pci, 1, 0); gfx_virt_vidptr = map_pci_mem(pScrni, 0, pci, 3, 0); gfx_virt_fbptr = map_pci_mem(pScrni, 1, pci, 0, pGeode->FBAvail); #endif gfx_gx2_scratch_base = pGeode->FBAvail - 0x4000; #ifndef XSERVER_LIBPCIACCESS XpressROMPtr = xf86MapVidMem(index, VIDMEM_FRAMEBUFFER, 0xF0000, 0x10000); #else { int fd = open("/dev/mem", O_RDWR); if (fd < 0) { xf86DrvMsg(index, X_ERROR, "Failed to open /dev/mem: %m\n"); return FALSE; } XpressROMPtr = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xF0000); close(fd); } #endif pGeode->FBBase = gfx_virt_fbptr; if ((!gfx_virt_regptr) || (!gfx_virt_gpptr) || (!gfx_virt_vidptr) || (!gfx_virt_fbptr)) return FALSE; if (!pGeode->NoAccel && pGeode->useEXA) pGeode->pExa->memoryBase = pGeode->FBBase; xf86DrvMsg(index, X_INFO, "Found Geode %x %p\n", pGeode->FBAvail, pGeode->FBBase); return TRUE; } /* Check to see if VGA exists - we map the space and look for a signature - if it doesn't match exactly, then we assume no VGA. */ static Bool GXCheckVGA(ScrnInfoPtr pScrni, EntityInfoPtr pEnt) { #ifndef XSERVER_LIBPCIACCESS unsigned char *ptr; const char *vgasig = "IBM VGA Compatible"; int ret; ptr = xf86MapVidMem(pScrni->scrnIndex, VIDMEM_FRAMEBUFFER, 0xC001E, strlen(vgasig)); if (ptr == NULL) return FALSE; ret = memcmp(ptr, vgasig, strlen(vgasig)); xf86UnMapVidMem(pScrni->scrnIndex, (pointer) ptr, strlen(vgasig)); return ret ? FALSE : TRUE; #else pciVideoPtr pci = xf86GetPciInfoForEntity(pEnt->index); return pci_device_is_boot_vga(pci); #endif } static Bool GXPreInit(ScrnInfoPtr pScrni, int flags) { GeodePtr pGeode; ClockRangePtr GeodeClockRange; OptionInfoRec *GeodeOptions = &GX_GeodeOptions[0]; int ret; QQ_WORD msrValue; EntityInfoPtr pEnt; rgb defaultWeight = { 0, 0, 0 }; int modecnt; char *s, *panelgeo; Bool useVGA; if (pScrni->numEntities != 1) return FALSE; pEnt = xf86GetEntityInfo(pScrni->entityList[0]); #ifndef XSERVER_LIBPCIACCESS if (pEnt->resources) return FALSE; #endif pGeode = pScrni->driverPrivate = xnfcalloc(1, sizeof(GeodeRec)); if (pGeode == NULL) return FALSE; useVGA = GXCheckVGA(pScrni, pEnt); if (flags & PROBE_DETECT) { GeodeProbeDDC(pScrni, pEnt->index); return TRUE; } /* Probe for VGA */ pGeode->useVGA = useVGA; pGeode->pEnt = pEnt; if (pGeode->useVGA) { if (!xf86LoadSubModule(pScrni, "vgahw") || !vgaHWGetHWRec(pScrni)) pGeode->useVGA = FALSE; else vgaHWSetStdFuncs(VGAHWPTR(pScrni)); #if INT10_SUPPORT pGeode->vesa = calloc(1, sizeof(VESARec)); #endif } gfx_msr_init(); ret = gfx_msr_read(RC_ID_DF, MBD_MSR_CONFIG, &msrValue); if (!ret) { pGeode->Output = ((msrValue.low & RCDF_CONFIG_FMT_MASK) == RCDF_CONFIG_FMT_FP) ? OUTPUT_PANEL : OUTPUT_CRT; } /* Fill in the monitor information */ pScrni->monitor = pScrni->confScreen->monitor; if (!xf86SetDepthBpp(pScrni, 16, 16, 16, Support24bppFb | Support32bppFb)) return FALSE; switch (pScrni->depth) { case 8: pScrni->rgbBits = 8; case 16: case 24: case 32: break; default: xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "The driver does not support %d as a depth.\n", pScrni->depth); return FALSE; } xf86PrintDepthBpp(pScrni); if (!xf86SetWeight(pScrni, defaultWeight, defaultWeight)) return FALSE; if (!xf86SetDefaultVisual(pScrni, -1)) return FALSE; /* * If the driver can do gamma correction, it should call xf86SetGamma() * here. */ { Gamma zeros = { 0.0, 0.0, 0.0 }; if (!xf86SetGamma(pScrni, zeros)) { return FALSE; } } pScrni->progClock = TRUE; xf86CollectOptions(pScrni, NULL); xf86ProcessOptions(pScrni->scrnIndex, pScrni->options, GeodeOptions); /* Set up our various options that may get reversed as we go on */ pGeode->FBVGAActive = FALSE; pGeode->tryHWCursor = TRUE; pGeode->tryCompression = TRUE; pGeode->NoAccel = FALSE; pGeode->useEXA = FALSE; pGeode->Panel = (pGeode->Output & OUTPUT_PANEL) ? TRUE : FALSE; pGeode->NoOfImgBuffers = DEFAULT_IMG_LINE_BUFS; pGeode->NoOfColorExpandLines = DEFAULT_CLR_LINE_BUFS; pGeode->exaBfrSz = DEFAULT_EXA_SCRATCH_BFRSZ; xf86GetOptValBool(GeodeOptions, GX_OPTION_HW_CURSOR, &pGeode->tryHWCursor); if (!xf86GetOptValInteger(GeodeOptions, GX_OPTION_FBSIZE, (int *) &(pGeode->FBAvail))) pGeode->FBAvail = 0; /* For compatability - allow SWCursor too */ if (xf86ReturnOptValBool(GeodeOptions, GX_OPTION_SW_CURSOR, FALSE)) pGeode->tryHWCursor = FALSE; if (xf86ReturnOptValBool(GeodeOptions, GX_OPTION_NOCOMPRESSION, FALSE)) pGeode->tryCompression = FALSE; if (xf86ReturnOptValBool(GeodeOptions, GX_OPTION_NOACCEL, FALSE)) pGeode->NoAccel = TRUE; pGeode->rotation = RR_Rotate_0; if ((s = xf86GetOptValString(GeodeOptions, GX_OPTION_ROTATE))) { if (!xf86NameCmp(s, "LEFT")) pGeode->rotation = RR_Rotate_90; else if (!xf86NameCmp(s, "INVERT")) pGeode->rotation = RR_Rotate_180; else if (!xf86NameCmp(s, "CCW")) pGeode->rotation = RR_Rotate_270; else xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Invalid rotation %s.\n", s); } xf86GetOptValInteger(GeodeOptions, GX_OPTION_OSM_IMG_BUFS, &(pGeode->NoOfImgBuffers)); if (pGeode->NoOfImgBuffers <= 0) pGeode->NoOfImgBuffers = 0; xf86GetOptValInteger(GeodeOptions, GX_OPTION_OSM_CLR_BUFS, &(pGeode->NoOfColorExpandLines)); if (pGeode->NoOfColorExpandLines <= 0) pGeode->NoOfColorExpandLines = 0; xf86GetOptValInteger(GeodeOptions, GX_OPTION_OSM_CLR_BUFS, (int *) &(pGeode->exaBfrSz)); if (pGeode->exaBfrSz <= 0) pGeode->exaBfrSz = 0; if (pGeode->Panel == TRUE) { if (xf86ReturnOptValBool(GeodeOptions, GX_OPTION_NOPANEL, FALSE)) pGeode->Panel = FALSE; } panelgeo = xf86GetOptValString(GeodeOptions, GX_OPTION_PANEL_GEOMETRY); if ((s = xf86GetOptValString(GeodeOptions, GX_OPTION_ACCEL_METHOD))) { #if defined(XF86XAA) && defined(XF86EXA) if (!xf86NameCmp(s, "XAA")) pGeode->useEXA = FALSE; else if (xf86NameCmp(s, "EXA")) xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Unknown accleration method %s. Defaulting to XAA.\n", s); #elif defined(XF86EXA) pGeode->useEXA = TRUE; #else pGeode->useEXA = FALSE; #endif } xf86DrvMsg(pScrni->scrnIndex, X_INFO, "Using %s acceleration architecture\n", pGeode->useEXA ? "EXA" : "XAA"); /* Set up the panel */ if (pGeode->Panel) { if (panelgeo != NULL) { if (GeodeGetFPGeometry(panelgeo, &pGeode->PanelX, &pGeode->PanelY)) pGeode->Panel = FALSE; } #ifdef PNL_SUP else { int b, f; /* The bitdepth and refresh isn't used anywhere else in the driver */ if ((pGeode->Panel = Pnl_IsPanelEnabledInBIOS())) Pnl_GetPanelInfoFromBIOS(&pGeode->PanelX, &pGeode->PanelY, &b, &f); } #endif } /* Set up the VGA */ if (pGeode->useVGA) { #if INT10_SUPPORT VESARec *pVesa; if (!xf86LoadSubModule(pScrni, "int10")) return FALSE; pVesa = pGeode->vesa; if ((pVesa->pInt = xf86InitInt10(pGeode->pEnt->index)) == NULL) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Unable to initialize 1NT10 support\n"); pGeode->useVGA = FALSE; } #endif } /* First try to get the framebuffer size from the framebuffer, * and if that fails, revert all the way back to the legacy * method */ if (pGeode->FBAvail == 0) { if (GeodeGetSizeFromFB(&pGeode->FBAvail)) pGeode->FBAvail = gfx_get_frame_buffer_size(); } if (pScrni->memPhysBase == 0) pScrni->memPhysBase = gfx_get_frame_buffer_base(); pScrni->fbOffset = 0; if (pGeode->pEnt->device->videoRam == 0) pScrni->videoRam = pGeode->FBAvail / 1024; else pScrni->videoRam = pGeode->pEnt->device->videoRam; GeodeClockRange = (ClockRangePtr) xnfcalloc(1, sizeof(ClockRange)); GeodeClockRange->next = NULL; GeodeClockRange->minClock = 25175; GeodeClockRange->maxClock = 229500; GeodeClockRange->clockIndex = -1; GeodeClockRange->interlaceAllowed = TRUE; GeodeClockRange->doubleScanAllowed = FALSE; pScrni->monitor->DDC = GeodeDoDDC(pScrni, pGeode->pEnt->index); /* I'm still not 100% sure this uses the right values */ modecnt = xf86ValidateModes(pScrni, pScrni->monitor->Modes, pScrni->display->modes, GeodeClockRange, NULL, GX_MIN_PITCH, GX_MAX_PITCH, 32, GX_MIN_HEIGHT, GX_MAX_HEIGHT, pScrni->display->virtualX, pScrni->display->virtualY, pGeode->FBAvail, LOOKUP_BEST_REFRESH); if (modecnt <= 0) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "No valid modes were found\n"); return FALSE; } xf86PruneDriverModes(pScrni); if (pScrni->modes == NULL) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "No valid modes were found\n"); return FALSE; } xf86SetCrtcForModes(pScrni, 0); pScrni->currentMode = pScrni->modes; xf86PrintModes(pScrni); xf86SetDpi(pScrni, 0, 0); /* Load the modules we'll need */ if (xf86LoadSubModule(pScrni, "fb") == NULL) { return FALSE; } if (pGeode->NoAccel == FALSE) { const char *module = (pGeode->useEXA) ? "exa" : "xaa"; if (!xf86LoadSubModule(pScrni, module)) { return FALSE; } } if (pGeode->tryHWCursor == TRUE) { if (!xf86LoadSubModule(pScrni, "ramdac")) { return FALSE; } } #ifndef XSERVER_LIBPCIACCESS if (xf86RegisterResources(pGeode->pEnt->index, NULL, ResExclusive)) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Couldn't register the resources.\n"); return FALSE; } #endif return TRUE; } static void GXRestore(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); if (pGeode->useVGA && pGeode->FBVGAActive) { vgaHWPtr pvgaHW = VGAHWPTR(pScrni); vgaHWProtect(pScrni, TRUE); vgaHWRestore(pScrni, &pvgaHW->SavedReg, VGA_SR_ALL); vgaHWProtect(pScrni, FALSE); } } static Bool GXUnmapMem(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); /* unmap all the memory map's */ #ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrni->scrnIndex, gfx_virt_regptr, GX_CPU_REG_SIZE); xf86UnMapVidMem(pScrni->scrnIndex, gfx_virt_gpptr, GX_GP_REG_SIZE); xf86UnMapVidMem(pScrni->scrnIndex, gfx_virt_vidptr, GX_VID_REG_SIZE); xf86UnMapVidMem(pScrni->scrnIndex, gfx_virt_fbptr, pGeode->FBAvail); #else pciVideoPtr pci = xf86GetPciInfoForEntity(pGeode->pEnt->index); unmap_pci_mem(pScrni, pci, gfx_virt_regptr, GX_CPU_REG_SIZE); unmap_pci_mem(pScrni, pci, gfx_virt_gpptr, GX_GP_REG_SIZE); unmap_pci_mem(pScrni, pci, gfx_virt_vidptr, GX_VID_REG_SIZE); unmap_pci_mem(pScrni, pci, gfx_virt_fbptr, pGeode->FBAvail); munmap(XpressROMPtr, 0x10000); #endif return TRUE; } static void GXSetDvLineSize(unsigned int pitch) { unsigned long temp, dv_size = MDC_DV_LINE_SIZE_1024; if (pitch > 1024) { dv_size = MDC_DV_LINE_SIZE_2048; } if (pitch > 2048) { dv_size = MDC_DV_LINE_SIZE_4096; } if (pitch > 4096) { dv_size = MDC_DV_LINE_SIZE_8192; } /* WRITE DIRTY/VALID CONTROL WITH LINE LENGTH */ temp = READ_REG32(MDC_DV_CTL); WRITE_REG32(MDC_DV_CTL, (temp & ~MDC_DV_LINE_SIZE_MASK) | dv_size); } /* XXX - this is nothing like the original function - not sure exactly what the purpose is for this quite yet */ static void GXAdjustFrame(ADJUST_FRAME_ARGS_DECL) { SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); unsigned long offset; offset = y * pGeode->Pitch + x * (pScrni->bitsPerPixel >> 3); gfx_set_display_offset(offset); } static Bool GXSetVideoMode(ScrnInfoPtr pScrni, DisplayModePtr pMode) { GeodeRec *pGeode = GEODEPTR(pScrni); int flags = 0; int custom = 0; pScrni->vtSema = TRUE; gx_disable_dac_power(); if (pMode->Flags & V_NHSYNC) flags |= 1; if (pMode->Flags & V_NVSYNC) flags |= 2; /* Check to see if we should use custom or built-in timings */ if (pGeode->Panel) custom = (pMode->type & M_T_USERDEF); else custom = !(pMode->type & (M_T_BUILTIN | M_T_DEFAULT)); /* If we're not doing a custom mode, then just set the fixed timings, * otherwise, do the whole shooting match */ if (!custom) { GFX(set_fixed_timings(pGeode->PanelX, pGeode->PanelY, pMode->CrtcHDisplay, pMode->CrtcVDisplay, pScrni->bitsPerPixel)); } else { if (pGeode->Panel) GFX(set_panel_present(pGeode->PanelX, pGeode->PanelY, pMode->CrtcHDisplay, pMode->CrtcVDisplay, pScrni->bitsPerPixel)); GFX(set_display_timings(pScrni->bitsPerPixel, flags, pMode->CrtcHDisplay, pMode->CrtcHBlankStart, pMode->CrtcHSyncStart, pMode->CrtcHSyncEnd, pMode->CrtcHBlankEnd, pMode->CrtcHTotal, pMode->CrtcVDisplay, pMode->CrtcVBlankStart, pMode->CrtcVSyncStart, pMode->CrtcVSyncEnd, pMode->CrtcVBlankEnd, pMode->CrtcVTotal, (int) ((pMode->SynthClock / 1000.0) * 0x10000))); } GFX(set_crt_enable(CRT_ENABLE)); GFX(set_display_pitch(pGeode->displayPitch)); GFX(set_display_offset(0L)); GFX(wait_vertical_blank()); if (pGeode->Compression) { GXSetDvLineSize(pGeode->Pitch); gfx_set_compression_offset(pGeode->CBData.compression_offset); gfx_set_compression_pitch(GX_CB_PITCH); gfx_set_compression_size(GX_CB_SIZE); gfx_set_compression_enable(1); } if (pGeode->HWCursor && !(pMode->Flags & V_DBLSCAN)) { GXLoadCursorImage(pScrni, NULL); GFX(set_cursor_position(pGeode->CursorStartOffset, 0, 0, 0, 0)); GXShowCursor(pScrni); } else { GFX(set_cursor_enable(0)); pGeode->HWCursor = FALSE; } GXAdjustFrame(ADJUST_FRAME_ARGS(pScrni->frameX0, pScrni->frameY0)); gx_enable_dac_power(); return TRUE; } static Bool GXSwitchMode(SWITCH_MODE_ARGS_DECL) { SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); int ret = TRUE; int rotate; /* Syn the engine and shutdown the DAC momentarily */ gfx_wait_until_idle(); /* Set up the memory for the new mode */ rotate = GXGetRotation(pScrni->pScreen); ret = GXAllocateMemory(pScrni->pScreen, pScrni, rotate); if (ret) { if (pGeode->curMode != pMode) ret = GXSetVideoMode(pScrni, pMode); } if (ret) ret = GXRotate(pScrni, pMode); /* Go back the way it was */ if (ret == FALSE) { if (!GXSetVideoMode(pScrni, pGeode->curMode)) xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Could not restore the previous mode\n"); } else pGeode->curMode = pMode; return ret; } static void GXLeaveGraphics(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); gfx_wait_until_idle(); /* Restore VG registers */ gfx_set_display_timings(pGeode->FBgfxdisplaytiming.wBpp, pGeode->FBgfxdisplaytiming.wPolarity, pGeode->FBgfxdisplaytiming.wHActive, pGeode->FBgfxdisplaytiming.wHBlankStart, pGeode->FBgfxdisplaytiming.wHSyncStart, pGeode->FBgfxdisplaytiming.wHSyncEnd, pGeode->FBgfxdisplaytiming.wHBlankEnd, pGeode->FBgfxdisplaytiming.wHTotal, pGeode->FBgfxdisplaytiming.wVActive, pGeode->FBgfxdisplaytiming.wVBlankStart, pGeode->FBgfxdisplaytiming.wVSyncStart, pGeode->FBgfxdisplaytiming.wVSyncEnd, pGeode->FBgfxdisplaytiming.wVBlankEnd, pGeode->FBgfxdisplaytiming.wVTotal, pGeode->FBgfxdisplaytiming.dwDotClock); gfx_set_compression_enable(0); /* Restore the previous Compression state */ if (pGeode->FBCompressionEnable) { gfx_set_compression_offset(pGeode->FBCompressionOffset); gfx_set_compression_pitch(pGeode->FBCompressionPitch); gfx_set_compression_size(pGeode->FBCompressionSize); gfx_set_compression_enable(1); } gfx_set_display_pitch(pGeode->FBgfxdisplaytiming.wPitch); gfx_set_display_offset(pGeode->FBDisplayOffset); /* Restore Cursor */ gfx_set_cursor_position(pGeode->FBCursorOffset, 0, 0, 0, 0); if (pGeode->useVGA) { pGeode->vesa->pInt->num = 0x10; pGeode->vesa->pInt->ax = 0x0 | pGeode->FBBIOSMode; pGeode->vesa->pInt->bx = 0; xf86ExecX86int10(pGeode->vesa->pInt); gfx_delay_milliseconds(3); } GXRestore(pScrni); gx_enable_dac_power(); } static Bool GXCloseScreen(CLOSE_SCREEN_ARGS_DECL) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); if (pScrni->vtSema) GXLeaveGraphics(pScrni); #ifdef XF86XAA if (pGeode->AccelInfoRec) XAADestroyInfoRec(pGeode->AccelInfoRec); #endif if (pGeode->AccelImageWriteBuffers) { free(pGeode->AccelImageWriteBuffers[0]); free(pGeode->AccelImageWriteBuffers); pGeode->AccelImageWriteBuffers = NULL; } if (pGeode->AccelColorExpandBuffers) { free(pGeode->AccelColorExpandBuffers); pGeode->AccelColorExpandBuffers = NULL; } if (pGeode->pExa) { exaDriverFini(pScrn); free(pGeode->pExa); pGeode->pExa = NULL; } pScrni->vtSema = FALSE; GXUnmapMem(pScrni); pScrni->PointerMoved = pGeode->PointerMoved; pScrn->CloseScreen = pGeode->CloseScreen; if (pScrn->CloseScreen) return (*pScrn->CloseScreen) (CLOSE_SCREEN_ARGS); return TRUE; } static Bool GXEnterGraphics(ScreenPtr pScrn, ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); if (!GXMapMem(pScrni)) return FALSE; if (pGeode->useVGA) pGeode->FBVGAActive = gu2_get_vga_active(); gfx_wait_until_idle(); /* Save off the current state (should this be somewhere else)? */ pGeode->FBgfxdisplaytiming.dwDotClock = gfx_get_clock_frequency(); pGeode->FBgfxdisplaytiming.wPitch = gfx_get_display_pitch(); pGeode->FBgfxdisplaytiming.wBpp = gfx_get_display_bpp(); pGeode->FBgfxdisplaytiming.wHTotal = gfx_get_htotal(); pGeode->FBgfxdisplaytiming.wHActive = gfx_get_hactive(); pGeode->FBgfxdisplaytiming.wHSyncStart = gfx_get_hsync_start(); pGeode->FBgfxdisplaytiming.wHSyncEnd = gfx_get_hsync_end(); pGeode->FBgfxdisplaytiming.wHBlankStart = gfx_get_hblank_start(); pGeode->FBgfxdisplaytiming.wHBlankEnd = gfx_get_hblank_end(); pGeode->FBgfxdisplaytiming.wVTotal = gfx_get_vtotal(); pGeode->FBgfxdisplaytiming.wVActive = gfx_get_vactive(); pGeode->FBgfxdisplaytiming.wVSyncStart = gfx_get_vsync_start(); pGeode->FBgfxdisplaytiming.wVSyncEnd = gfx_get_vsync_end(); pGeode->FBgfxdisplaytiming.wVBlankStart = gfx_get_vblank_start(); pGeode->FBgfxdisplaytiming.wVBlankEnd = gfx_get_vblank_end(); pGeode->FBgfxdisplaytiming.wPolarity = gfx_get_sync_polarities(); pGeode->FBDisplayOffset = gfx_get_display_offset(); if (pGeode->useVGA) { vgaHWPtr pvgaHW = VGAHWPTR(pScrni); pGeode->FBBIOSMode = pvgaHW->readCrtc(pvgaHW, 0x040); } pGeode->FBCompressionEnable = gfx_get_compression_enable(); pGeode->FBCompressionOffset = gfx_get_compression_offset(); pGeode->FBCompressionPitch = gfx_get_compression_pitch(); pGeode->FBCompressionSize = gfx_get_compression_size(); #ifdef PNL_SUP Pnl_SavePanelState(); #endif /* Turn off the VGA */ if (pGeode->useVGA && pGeode->FBVGAActive) { unsigned short sequencer; vgaHWPtr pvgaHW = VGAHWPTR(pScrni); /* Map VGA aperture */ if (!vgaHWMapMem(pScrni)) return FALSE; /* Unlock VGA registers */ vgaHWUnlock(pvgaHW); /* Save the current state and setup the current mode */ vgaHWSave(pScrni, &VGAHWPTR(pScrni)->SavedReg, VGA_SR_ALL); /* DISABLE VGA SEQUENCER */ /* This allows the VGA state machine to terminate. We must delay */ /* such that there are no pending MBUS requests. */ gfx_outb(MDC_SEQUENCER_INDEX, MDC_SEQUENCER_CLK_MODE); sequencer = gfx_inb(MDC_SEQUENCER_DATA); sequencer |= MDC_CLK_MODE_SCREEN_OFF; gfx_outb(MDC_SEQUENCER_DATA, sequencer); gfx_delay_milliseconds(1); /* BLANK THE VGA DISPLAY */ gfx_outw(MDC_SEQUENCER_INDEX, MDC_SEQUENCER_RESET); sequencer = gfx_inb(MDC_SEQUENCER_DATA); sequencer &= ~MDC_RESET_VGA_DISP_ENABLE; gfx_outb(MDC_SEQUENCER_DATA, sequencer); gfx_delay_milliseconds(1); } /* Set up the memory */ /* XXX - FIXME - when we alow inital rotation, it should be here */ GXAllocateMemory(pScrn, pScrni, pGeode->rotation); /* Clear the framebuffer */ memset(pGeode->FBBase + pGeode->displayOffset, 0, pGeode->displaySize); /* Set up the video mode */ GXSetVideoMode(pScrni, pScrni->currentMode); pGeode->curMode = pScrni->currentMode; return TRUE; } static void GXLoadPalette(ScrnInfoPtr pScrni, int numColors, int *indizes, LOCO * colors, VisualPtr pVisual) { int i, index, color; for (i = 0; i < numColors; i++) { index = indizes[i] & 0xFF; color = (((unsigned long) (colors[index].red & 0xFF)) << 16) | (((unsigned long) (colors[index].green & 0xFF)) << 8) | ((unsigned long) (colors[index].blue & 0xFF)); GFX(set_display_palette_entry(index, color)); } } #ifdef DPMSExtension static void GXPanelPower(int enable) { unsigned long power = READ_VID32(RCDF_POWER_MANAGEMENT); if (enable != 0) power |= RCDF_PM_PANEL_POWER_ON; else power &= ~RCDF_PM_PANEL_POWER_ON; WRITE_VID32(RCDF_POWER_MANAGEMENT, power); } static void GXDPMSSet(ScrnInfoPtr pScrni, int mode, int flags) { GeodeRec *pGeode; pGeode = GEODEPTR(pScrni); if (!pScrni->vtSema) return; switch (mode) { case DPMSModeOn: /* Screen: On; HSync: On; VSync: On */ GFX(set_crt_enable(CRT_ENABLE)); #if defined(PNL_SUP) if (pGeode->Panel) { Pnl_PowerUp(); GXPanelPower(1); } #endif break; case DPMSModeStandby: /* Screen: Off; HSync: Off; VSync: On */ GFX(set_crt_enable(CRT_STANDBY)); #if defined(PNL_SUP) if (pGeode->Panel) { Pnl_PowerDown(); GXPanelPower(0); } #endif break; case DPMSModeSuspend: /* Screen: Off; HSync: On; VSync: Off */ GFX(set_crt_enable(CRT_SUSPEND)); #if defined(PNL_SUP) if (pGeode->Panel) { Pnl_PowerDown(); GXPanelPower(0); } #endif break; case DPMSModeOff: /* Screen: Off; HSync: Off; VSync: Off */ GFX(set_crt_enable(CRT_DISABLE)); #if defined(PNL_SUP) if (pGeode->Panel) { Pnl_PowerDown(); GXPanelPower(0); } #endif break; } } #endif static Bool GXCreateScreenResources(ScreenPtr pScreen) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScreen); GeodeRec *pGeode = GEODEPTR(pScrni); pScreen->CreateScreenResources = pGeode->CreateScreenResources; if (!(*pScreen->CreateScreenResources) (pScreen)) return FALSE; if (xf86LoaderCheckSymbol("GXRandRSetConfig") && pGeode->rotation != RR_Rotate_0) { Rotation(*GXRandRSetConfig) (ScreenPtr pScreen, Rotation rr, int rate, RRScreenSizePtr pSize) = NULL; RRScreenSize p; Rotation requestedRotation = pGeode->rotation; pGeode->rotation = RR_Rotate_0; /* Just setup enough for an initial rotate */ p.width = pScreen->width; p.height = pScreen->height; p.mmWidth = pScreen->mmWidth; p.mmHeight = pScreen->mmHeight; GXRandRSetConfig = LoaderSymbol("GXRandRSetConfig"); if (GXRandRSetConfig) { pGeode->starting = TRUE; (*GXRandRSetConfig) (pScreen, requestedRotation, 0, &p); pGeode->starting = FALSE; } } return TRUE; } static Bool GXScreenInit(SCREEN_INIT_ARGS_DECL) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); XF86ModReqInfo shadowReq; int maj, min, ret, rotate; pGeode->starting = TRUE; /* If we are using VGA then go ahead and map the memory */ if (pGeode->useVGA) { if (!vgaHWMapMem(pScrni)) return FALSE; vgaHWGetIOBase(VGAHWPTR(pScrni)); } if (!pGeode->NoAccel) { if (pGeode->useEXA) { if (!(pGeode->pExa = exaDriverAlloc())) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Couldn't allocate the EXA structure.\n"); pGeode->NoAccel = TRUE; } else { ExaDriverPtr pExa = pGeode->pExa; /* THis is set in GXAllocMem */ pExa->memoryBase = 0; /* This is set in GXAllocateMemory */ pExa->memorySize = 0; pExa->pixmapOffsetAlign = 32; pExa->pixmapPitchAlign = 32; pExa->flags = EXA_OFFSCREEN_PIXMAPS; pExa->maxX = GX_MAX_WIDTH - 1; pExa->maxY = GX_MAX_HEIGHT - 1; } } else { pGeode->AccelImageWriteBuffers = calloc(pGeode->NoOfImgBuffers, sizeof(pGeode->AccelImageWriteBuffers[0])); pGeode->AccelColorExpandBuffers = calloc(pGeode->NoOfColorExpandLines, sizeof(pGeode->AccelColorExpandBuffers[0])); } } /* XXX FIXME - Take down any of the structures on failure? */ if (!GXEnterGraphics(pScrn, pScrni)) return FALSE; miClearVisualTypes(); /* XXX Again - take down anything? */ if (pScrni->bitsPerPixel > 8) { if (!miSetVisualTypes(pScrni->depth, TrueColorMask, pScrni->rgbBits, pScrni->defaultVisual)) { return FALSE; } } else { if (!miSetVisualTypes(pScrni->depth, miGetDefaultVisualMask(pScrni->depth), pScrni->rgbBits, pScrni->defaultVisual)) { return FALSE; } } miSetPixmapDepths(); /* Point at the visible area to start */ ret = fbScreenInit(pScrn, pGeode->FBBase + pGeode->displayOffset, pScrni->virtualX, pScrni->virtualY, pScrni->xDpi, pScrni->yDpi, pGeode->displayWidth, pScrni->bitsPerPixel); if (!ret) return FALSE; xf86SetBlackWhitePixels(pScrn); /* Set up the color ordering */ if (pScrni->bitsPerPixel > 8) { VisualPtr visual = pScrn->visuals + pScrn->numVisuals; while (--visual >= pScrn->visuals) { if ((visual->class | DynamicClass) == DirectColor) { visual->offsetRed = pScrni->offset.red; visual->offsetGreen = pScrni->offset.green; visual->offsetBlue = pScrni->offset.blue; visual->redMask = pScrni->mask.red; visual->greenMask = pScrni->mask.green; visual->blueMask = pScrni->mask.blue; } } } /* Must follow the color ordering */ fbPictureInit(pScrn, 0, 0); if (!pGeode->NoAccel) GXAccelInit(pScrn); xf86SetBackingStore(pScrn); /* Set up the soft cursor */ miDCInitialize(pScrn, xf86GetPointerScreenFuncs()); /* Set up the HW cursor - must follow the soft cursor init */ if (pGeode->tryHWCursor) { if (!GXHWCursorInit(pScrn)) xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Hardware cursor initialization failed.\n"); } /* Set up the color map */ if (!miCreateDefColormap(pScrn)) return FALSE; if (pScrni->bitsPerPixel == 8) { /* Must follow initialization of the default colormap */ if (!xf86HandleColormaps(pScrn, 256, 8, GXLoadPalette, NULL, CMAP_PALETTED_TRUECOLOR | CMAP_RELOAD_ON_MODE_SWITCH)) { return FALSE; } } #ifdef DPMSExtension xf86DPMSInit(pScrn, GXDPMSSet, 0); #endif GXInitVideo(pScrn); /* Set up RandR */ xf86DisableRandR(); /* We provide our own RandR goodness */ /* Try to set up the shadow FB for rotation */ memset(&shadowReq, 0, sizeof(shadowReq)); shadowReq.majorversion = 1; shadowReq.minorversion = 1; if (LoadSubModule(pScrni->module, "shadow", NULL, NULL, NULL, &shadowReq, &maj, &min)) { rotate = RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270; shadowSetup(pScrn); } else { LoaderErrorMsg(NULL, "shadow", maj, min); xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Error loading shadow - rotation not available.\n"); if (pGeode->rotation != RR_Rotate_0) xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Reverting back to normal rotation.\n"); rotate = pGeode->rotation = RR_Rotate_0; } GXRandRInit(pScrn, rotate); pGeode->PointerMoved = pScrni->PointerMoved; pScrni->PointerMoved = GeodePointerMoved; pGeode->CreateScreenResources = pScrn->CreateScreenResources; pScrn->CreateScreenResources = GXCreateScreenResources; pGeode->CloseScreen = pScrn->CloseScreen; pScrn->CloseScreen = GXCloseScreen; pScrn->SaveScreen = GXSaveScreen; if (serverGeneration == 1) xf86ShowUnusedOptions(pScrni->scrnIndex, pScrni->options); pGeode->starting = FALSE; return TRUE; } static int GXValidMode(VALID_MODE_ARGS_DECL) { SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); int p; int custom = 0; if (pGeode->Panel) custom = (pMode->type & M_T_USERDEF); else custom = (pMode->type & (M_T_BUILTIN | M_T_DEFAULT)); /* Use the durango lookup for !custom modes */ if (!custom && pGeode->Panel) { if (pMode->CrtcHDisplay > pGeode->PanelX || pMode->CrtcVDisplay > pGeode->PanelY || gfx_is_panel_mode_supported(pGeode->PanelX, pGeode->PanelY, pMode->CrtcHDisplay, pMode->CrtcVDisplay, pScrni->bitsPerPixel) < 0) { return MODE_BAD; } } if (gfx_is_display_mode_supported(pMode->CrtcHDisplay, pMode->CrtcVDisplay, pScrni->bitsPerPixel, GeodeGetRefreshRate(pMode)) < 0) { return MODE_BAD; } if (pMode->Flags & V_INTERLACE) return MODE_NO_INTERLACE; if (pGeode->tryCompression) p = GeodeCalculatePitchBytes(pMode->CrtcHDisplay, pScrni->bitsPerPixel); else p = ((pMode->CrtcHDisplay + 3) & ~3) * (pScrni->bitsPerPixel >> 3); if (p * pMode->CrtcVDisplay > pGeode->FBAvail) return MODE_MEM; return MODE_OK; } /* XXX - Way more to do here */ static Bool GXEnterVT(VT_FUNC_ARGS_DECL) { SCRN_INFO_PTR(arg); return GXEnterGraphics(NULL, pScrni); } static void GXLeaveVT(VT_FUNC_ARGS_DECL) { SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); pGeode->PrevDisplayOffset = gfx_get_display_offset(); GXLeaveGraphics(pScrni); } void GXSetupChipsetFPtr(ScrnInfoPtr pScrn) { pScrn->PreInit = GXPreInit; pScrn->ScreenInit = GXScreenInit; pScrn->SwitchMode = GXSwitchMode; pScrn->AdjustFrame = GXAdjustFrame; pScrn->EnterVT = GXEnterVT; pScrn->LeaveVT = GXLeaveVT; pScrn->FreeScreen = GeodeFreeScreen; pScrn->ValidMode = GXValidMode; } /* ====== Common functions ====== * These are all the common functions that we use for both GX and LX - They live here * because most of them came along for the GX first, and then were adapted to the LX. * We could move these to a common function, but there is no hurry * ============================== */ void GeodePointerMoved(POINTER_MOVED_ARGS_DECL) { SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); int newX = x, newY = y; switch (pGeode->rotation) { case RR_Rotate_0: break; case RR_Rotate_90: newX = y; newY = pScrni->pScreen->width - x - 1; break; case RR_Rotate_180: newX = pScrni->pScreen->width - x - 1; newY = pScrni->pScreen->height - y - 1; break; case RR_Rotate_270: newX = pScrni->pScreen->height - y - 1; newY = x; break; } (*pGeode->PointerMoved) (POINTER_MOVED_ARGS(newX, newY)); } int GeodeGetFPGeometry(const char *str, int *width, int *height) { int ret = sscanf(str, "%dx%d", width, height); return (ret == 2) ? 0 : 1; } static void GeodeFreeRec(ScrnInfoPtr pScrni) { if (pScrni->driverPrivate != NULL) { free(pScrni->driverPrivate); pScrni->driverPrivate = NULL; } } void GeodeFreeScreen(FREE_SCREEN_ARGS_DECL) { SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); if (pGeode == NULL) return; if (pGeode->useVGA) { if (xf86LoaderCheckSymbol("vgaHWFreeHWRec")) vgaHWFreeHWRec(pScrni); } GeodeFreeRec(pScrni); } int GeodeCalculatePitchBytes(unsigned int width, unsigned int bpp) { int delta = width * (bpp >> 3); /* Less then 640 has doubling enabled */ if (width < 640) delta <<= 1; /* Calculate the pitch (compression rquires a power of 2) */ if (delta > 4096) delta = 8192; else if (delta > 2048) delta = 4096; else if (delta > 1024) delta = 2048; else delta = 1024; return delta; } xf86-video-geode-2.11.18/src/compat-api.h0000644000175000017500000001023112654445443014567 00000000000000/* * Copyright 2012 Red Hat, Inc. * Copyright 2012 Canonical Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Authors: * Dave Airlie * Maarten Lankhorst */ /* this file provides API compat between server post 1.13 and pre it, it should be reused inside as many drivers as possible */ #ifndef COMPAT_API_H #define COMPAT_API_H #ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR #define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum] #define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p #endif #ifndef XF86_HAS_SCRN_CONV #define xf86ScreenToScrn(s) xf86Screens[(s)->myNum] #define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex] #endif #ifndef XF86_SCRN_INTERFACE #define DDC_CALL(pScrni) (pScrni->scrnIndex) #define SCRN_ARG_TYPE int #define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrni = xf86Screens[(arg1)] #define SCREEN_ARG_TYPE int #define SCREEN_PTR(arg1) ScreenPtr pScrn = screenInfo.screens[(arg1)] #define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScrn, int argc, char **argv #define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask #define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask #define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScrn #define CLOSE_SCREEN_ARGS scrnIndex, pScrn #define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags #define ADJUST_FRAME_ARGS(x, y) pScrni->scrnIndex, (x), (y), 0 #define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr pMode, int flags #define FREE_SCREEN_ARGS_DECL int arg, int flags #define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0 #define VT_FUNC_ARGS_DECL int arg, int flags #define VT_FUNC_ARGS(flags) pScrni->scrnIndex, (flags) #define XF86_ENABLEDISABLEFB_ARG(pScrni, x) ((pScrni)->scrnIndex), (x) #define POINTER_MOVED_ARGS_DECL int arg, int x, int y #define POINTER_MOVED_ARGS(x, y) pScrni->scrnIndex, (x), (y) #define VALID_MODE_ARGS_DECL int arg, DisplayModePtr pMode, Bool Verbose, int flags #else /*XF86_SCRN_INTERFACE) */ #define DDC_CALL(pScrni) (pScrni) #define SCRN_ARG_TYPE ScrnInfoPtr #define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrni = (arg1) #define SCREEN_ARG_TYPE ScreenPtr #define SCREEN_PTR(arg1) ScreenPtr pScrn = (arg1) #define SCREEN_INIT_ARGS_DECL ScreenPtr pScrn, int argc, char **argv #define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask #define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask #define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScrn #define CLOSE_SCREEN_ARGS pScrn #define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y #define ADJUST_FRAME_ARGS(x, y) pScrni, (x), (y) #define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr pMode #define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg #define FREE_SCREEN_ARGS(x) (x) #define VT_FUNC_ARGS_DECL ScrnInfoPtr arg #define VT_FUNC_ARGS(flags) pScrni #define XF86_ENABLEDISABLEFB_ARG(pScrni, x) (pScrni), (x) #define POINTER_MOVED_ARGS_DECL ScrnInfoPtr arg, int x, int y #define POINTER_MOVED_ARGS(x, y) pScrni, (x), (y) #define VALID_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr pMode, Bool Verbose, int flags #endif #endif xf86-video-geode-2.11.18/src/lx_driver.c0000644000175000017500000007213012654445443014534 00000000000000/* Copyright (c) 2003-2008 Advanced Micro Devices, Inc. * * Portioned modeled from xf86-video-intel/src/i830_driver.c * Copyright 2001 VA Linux Systems Inc., Fremont, California. * Copyright \ufffd 2002 by David Dawes * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "xf86.h" #include "xf86_OSproc.h" #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 #include "xf86Resources.h" #endif #include "xf86i2c.h" #include "xf86Crtc.h" #include "xf86cmap.h" #include "compiler.h" #include "mipointer.h" #include "fb.h" #include "miscstruct.h" #include "micmap.h" #include "vbe.h" #include "fb.h" #include "cim_defs.h" #include "cim_regs.h" #include "geode.h" /* Bring in VGA functions */ #include "lx_vga.c" #define LX_MAX_WIDTH 1940 #define LX_MAX_HEIGHT 1600 /* Size of the register blocks */ #define LX_GP_REG_SIZE 0x4000 #define LX_VG_REG_SIZE 0x4000 #define LX_VID_REG_SIZE 0x4000 #define LX_VIP_REG_SIZE 0x4000 /* Size of the Cimarron command buffer */ #define CIM_CMD_BFR_SZ 0x200000 extern OptionInfoRec LX_GeodeOptions[]; unsigned char *XpressROMPtr; static Bool LXSaveScreen(ScreenPtr pScrn, int mode) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodePtr pGeode = GEODEPTR(pScrni); if (pGeode->useVGA && !pScrni->vtSema) return vgaHWSaveScreen(pScrn, mode); return TRUE; } /* This is an overly complex MSR read mechanism */ /* From Cimarron - the VSAII read/write methods - we use these as fallback */ #define LX_MSR_READ(adr,lo,hi) \ __asm__ __volatile__( \ " mov $0x0AC1C, %%edx\n" \ " mov $0xFC530007, %%eax\n" \ " out %%eax,%%dx\n" \ " add $2,%%dl\n" \ " in %%dx, %%ax" \ : "=a" (lo), "=d" (hi) \ : "c" (adr)) #define LX_MSR_WRITE(adr,low,high) \ { int d0, d1, d2, d3, d4; \ __asm__ __volatile__( \ " push %%ebx\n" \ " mov $0x0AC1C, %%edx\n" \ " mov $0xFC530007, %%eax\n" \ " out %%eax,%%dx\n" \ " add $2,%%dl\n" \ " mov %6, %%ebx\n" \ " mov %7, %0\n" \ " mov %5, %3\n" \ " xor %2, %2\n" \ " xor %1, %1\n" \ " out %%ax, %%dx\n" \ " pop %%ebx\n" \ : "=a"(d0),"=&D"(d1),"=&S"(d2), \ "=c"(d3),"=d"(d4) \ : "1"(adr),"2"(high),"3"(low)); \ } static void LXReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi) { if (GeodeReadMSR(addr, lo, hi) == -1) { unsigned int l, h; LX_MSR_READ(addr, l, h); *lo = l; *hi = h; } } static void LXWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi) { if (GeodeWriteMSR(addr, lo, hi) == -1) LX_MSR_WRITE(addr, lo, hi); } static unsigned int LXCalcPitch(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); if (pGeode->tryCompression) return GeodeCalculatePitchBytes(pScrni->virtualX, pScrni->bitsPerPixel); else return ((pScrni->virtualX + 3) & ~3) * (pScrni->bitsPerPixel >> 3); } #ifdef XSERVER_LIBPCIACCESS static inline void * map_pci_mem(ScrnInfoPtr pScrni, int vram, struct pci_device *dev, int bar, int size) { void *ptr; int map_size = size ? size : dev->regions[bar].size; int err = pci_device_map_range(dev, dev->regions[bar].base_addr, map_size, PCI_DEV_MAP_FLAG_WRITABLE | (vram ? PCI_DEV_MAP_FLAG_WRITE_COMBINE : 0), &ptr); if (err) return NULL; return ptr; } static inline int unmap_pci_mem(ScrnInfoPtr pScrni, struct pci_device *dev, void *ptr, int size) { return pci_device_unmap_range(dev, ptr, size); } #endif static Bool LXMapMem(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); int index = pScrni->scrnIndex; unsigned long cmd_bfr_phys; pciVideoPtr pci = xf86GetPciInfoForEntity(pGeode->pEnt->index); #ifndef XSERVER_LIBPCIACCESS PCITAG tag; tag = pciTag(pci->bus, pci->device, pci->func); cim_gp_ptr = (unsigned char *) xf86MapPciMem(index, VIDMEM_MMIO, tag, pci->memBase[1], LX_GP_REG_SIZE); cim_vg_ptr = (unsigned char *) xf86MapPciMem(index, VIDMEM_MMIO, tag, pci->memBase[2], LX_VG_REG_SIZE); cim_vid_ptr = (unsigned char *) xf86MapPciMem(index, VIDMEM_MMIO, tag, pci->memBase[3], LX_VID_REG_SIZE); cim_vip_ptr = (unsigned char *) xf86MapPciMem(index, VIDMEM_MMIO, tag, pci->memBase[4], LX_VIP_REG_SIZE); cim_fb_ptr = (unsigned char *) xf86MapPciMem(index, VIDMEM_FRAMEBUFFER, tag, pci->memBase[0], pGeode->FBAvail + CIM_CMD_BFR_SZ); #else cim_gp_ptr = map_pci_mem(pScrni, 0, pci, 1, LX_GP_REG_SIZE); cim_vg_ptr = map_pci_mem(pScrni, 0, pci, 2, LX_VG_REG_SIZE); cim_vid_ptr = map_pci_mem(pScrni, 0, pci, 3, LX_VID_REG_SIZE); cim_vip_ptr = map_pci_mem(pScrni, 0, pci, 4, LX_VIP_REG_SIZE); cim_fb_ptr = map_pci_mem(pScrni, 1, pci, 0, pGeode->FBAvail + CIM_CMD_BFR_SZ); #endif if (pScrni->memPhysBase == 0) pScrni->memPhysBase = PCI_REGION_BASE(pci, 0, REGION_MEM); cmd_bfr_phys = PCI_REGION_BASE(pci, 0, REGION_MEM) + pGeode->CmdBfrOffset; cim_cmd_base_ptr = cim_fb_ptr + pGeode->CmdBfrOffset; if (!cim_gp_ptr || !cim_vg_ptr || !cim_vid_ptr || !cim_fb_ptr || !cim_vip_ptr) return FALSE; gp_set_frame_buffer_base(PCI_REGION_BASE(pci, 0, REGION_MEM), pGeode->FBAvail); gp_set_command_buffer_base(cmd_bfr_phys, 0, pGeode->CmdBfrSize); #ifndef XSERVER_LIBPCIACCESS XpressROMPtr = xf86MapVidMem(index, VIDMEM_FRAMEBUFFER, 0xF0000, 0x10000); #else { int fd = open("/dev/mem", O_RDWR); if (fd < 0) { xf86DrvMsg(index, X_ERROR, "Failed to open /dev/mem: %m\n"); return FALSE; } XpressROMPtr = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xF0000); close(fd); } #endif pGeode->FBBase = cim_fb_ptr; if (!pGeode->NoAccel) pGeode->pExa->memoryBase = pGeode->FBBase; xf86DrvMsg(index, X_INFO, "Geode LX video memory %x bytes at %p\n", pGeode->FBAvail, pGeode->FBBase); return TRUE; } /* Check to see if VGA exists - we map the space and look for a signature - if it doesn't match exactly, then we assume no VGA. */ static Bool LXCheckVGA(ScrnInfoPtr pScrni, EntityInfoPtr pEnt) { #ifndef XSERVER_LIBPCIACCESS unsigned char *ptr; const char *vgasig = "IBM VGA Compatible"; int ret; ptr = xf86MapVidMem(pScrni->scrnIndex, VIDMEM_FRAMEBUFFER, 0xC001E, strlen(vgasig)); if (ptr == NULL) return FALSE; ret = memcmp(ptr, vgasig, strlen(vgasig)); xf86UnMapVidMem(pScrni->scrnIndex, (pointer) ptr, strlen(vgasig)); return ret ? FALSE : TRUE; #else pciVideoPtr pci = xf86GetPciInfoForEntity(pEnt->index); return pci_device_is_boot_vga(pci); #endif } static Bool LXCrtcResize(ScrnInfoPtr pScrni, int width, int height) { return TRUE; } static const xf86CrtcConfigFuncsRec lx_xf86crtc_config_funcs = { LXCrtcResize, }; static Bool LXPreInit(ScrnInfoPtr pScrni, int flags) { GeodePtr pGeode; EntityInfoPtr pEnt; OptionInfoRec *GeodeOptions = &LX_GeodeOptions[0]; rgb defaultWeight = { 0, 0, 0 }; char *s; if (pScrni->numEntities != 1) return FALSE; pEnt = xf86GetEntityInfo(pScrni->entityList[0]); #ifndef XSERVER_LIBPCIACCESS if (pEnt->resources) return FALSE; #endif if (flags & PROBE_DETECT) { GeodeProbeDDC(pScrni, pEnt->index); return TRUE; } pGeode = pScrni->driverPrivate = xnfcalloc(1, sizeof(GeodeRec)); if (pGeode == NULL) return FALSE; pGeode->useVGA = LXCheckVGA(pScrni, pEnt); pGeode->VGAActive = FALSE; pGeode->pEnt = pEnt; if (pGeode->useVGA) { if (!xf86LoadSubModule(pScrni, "vgahw") || !vgaHWGetHWRec(pScrni)) pGeode->useVGA = FALSE; else vgaHWSetStdFuncs(VGAHWPTR(pScrni)); pGeode->vesa = calloc(1, sizeof(VESARec)); } cim_rdmsr = LXReadMSR; cim_wrmsr = LXWriteMSR; /* Set up the Cimarron MSR tables */ msr_init_table(); /* By default, we support panel and CRT - the config file should * disable the ones we don't want */ pGeode->Output = OUTPUT_PANEL | OUTPUT_CRT; /* Fill in the monitor information */ pScrni->monitor = pScrni->confScreen->monitor; if (!xf86SetDepthBpp(pScrni, 16, 16, 16, Support24bppFb | Support32bppFb)) return FALSE; switch (pScrni->depth) { case 8: pScrni->rgbBits = 8; case 16: case 24: case 32: break; default: xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "The driver does not support %d as a depth.\n", pScrni->depth); return FALSE; } xf86PrintDepthBpp(pScrni); if (!xf86SetWeight(pScrni, defaultWeight, defaultWeight)) return FALSE; if (!xf86SetDefaultVisual(pScrni, -1)) return FALSE; /* * If the driver can do gamma correction, it should call xf86SetGamma() * here. */ { Gamma zeros = { 0.0, 0.0, 0.0 }; if (!xf86SetGamma(pScrni, zeros)) { return FALSE; } } pScrni->progClock = TRUE; xf86CollectOptions(pScrni, NULL); xf86ProcessOptions(pScrni->scrnIndex, pScrni->options, GeodeOptions); /* Set up our various options that may get reversed as we go on */ pGeode->tryHWCursor = TRUE; pGeode->tryCompression = TRUE; /* Protect against old versions of EXA */ #if (EXA_VERSION_MAJOR < 2) pGeode->NoAccel = TRUE; xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "*** This driver was compiled with EXA version %d\n"); xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "*** we need version 2 or greater\n"); xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "*** All accelerations are being turned off.\n"); #else pGeode->NoAccel = FALSE; #endif pGeode->exaBfrSz = DEFAULT_EXA_SCRATCH_BFRSZ; xf86GetOptValBool(GeodeOptions, LX_OPTION_HW_CURSOR, &pGeode->tryHWCursor); if (!xf86GetOptValInteger(GeodeOptions, LX_OPTION_FBSIZE, (int *) &(pGeode->FBAvail))) pGeode->FBAvail = 0; /* For compatability - allow SWCursor too */ if (xf86ReturnOptValBool(GeodeOptions, LX_OPTION_SW_CURSOR, FALSE)) pGeode->tryHWCursor = FALSE; if (xf86ReturnOptValBool(GeodeOptions, LX_OPTION_NOCOMPRESSION, FALSE)) pGeode->tryCompression = FALSE; if (xf86ReturnOptValBool(GeodeOptions, LX_OPTION_NOACCEL, FALSE)) pGeode->NoAccel = TRUE; pGeode->rotation = RR_Rotate_0; if ((s = xf86GetOptValString(GeodeOptions, LX_OPTION_ROTATE))) { if (!xf86NameCmp(s, "LEFT")) pGeode->rotation = RR_Rotate_90; else if (!xf86NameCmp(s, "INVERT")) pGeode->rotation = RR_Rotate_180; else if (!xf86NameCmp(s, "CCW")) pGeode->rotation = RR_Rotate_270; else xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Invalid rotation %s.\n", s); } xf86GetOptValInteger(GeodeOptions, LX_OPTION_EXA_SCRATCH_BFRSZ, (int *) &(pGeode->exaBfrSz)); if (pGeode->exaBfrSz <= 0) pGeode->exaBfrSz = 0; if (pGeode->Output & OUTPUT_PANEL) { if (xf86ReturnOptValBool(GeodeOptions, LX_OPTION_NOPANEL, FALSE)) pGeode->Output &= ~OUTPUT_PANEL; } /* Panel detection code - * 1. See if an OLPC DCON is attached - we can make some assumptions * about the panel if so. * 2. Use panel mode specified in the config * 3. "Autodetect" the panel through VSA */ if (dcon_init(pScrni)) { pGeode->Output = OUTPUT_PANEL | OUTPUT_DCON; } else if (pGeode->Output & OUTPUT_PANEL) { char *pmode = xf86GetOptValString(GeodeOptions, LX_OPTION_PANEL_MODE); if (pmode != NULL) pGeode->panelMode = LXGetManualPanelMode(pmode); if (pGeode->panelMode == NULL) pGeode->panelMode = LXGetLegacyPanelMode(pScrni); if (pGeode->panelMode == NULL) pGeode->Output &= ~OUTPUT_PANEL; } /* Default to turn scaling on for panels */ if (pGeode->Output & OUTPUT_PANEL) pGeode->Scale = TRUE; xf86DrvMsg(pScrni->scrnIndex, X_INFO, "LX output options:\n"); xf86DrvMsg(pScrni->scrnIndex, X_INFO, " CRT: %s\n", pGeode->Output & OUTPUT_CRT ? "YES" : "NO"); xf86DrvMsg(pScrni->scrnIndex, X_INFO, " PANEL: %s\n", pGeode->Output & OUTPUT_PANEL ? "YES" : "NO"); xf86DrvMsg(pScrni->scrnIndex, X_INFO, " DCON: %s\n", pGeode->Output & OUTPUT_DCON ? "YES" : "NO"); xf86DrvMsg(pScrni->scrnIndex, X_INFO, " VGA: %s\n", pGeode->useVGA ? "YES" : "NO"); /* Set up VGA */ if (pGeode->useVGA) { VESARec *pVesa; if (!xf86LoadSubModule(pScrni, "int10")) return FALSE; pVesa = pGeode->vesa; if ((pVesa->pInt = xf86InitInt10(pGeode->pEnt->index)) == NULL) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Unable to initialize 1NT10 support\n"); pGeode->useVGA = FALSE; } } /* Read the amount of framebuffer memory */ /* First try to read it from the framebuffer, and if that fails, * do it the legacy way */ if (pGeode->FBAvail == 0) { if (GeodeGetSizeFromFB(&pGeode->FBAvail)) { unsigned long value; cim_outw(0xAC1C, 0xFC53); cim_outw(0xAC1C, 0x0200); value = (unsigned long) (cim_inw(0xAC1E)) & 0xFE; pGeode->FBAvail = value << 20; } } pScrni->fbOffset = 0; if (pGeode->pEnt->device->videoRam == 0) pScrni->videoRam = pGeode->FBAvail / 1024; else { pScrni->videoRam = pGeode->pEnt->device->videoRam; pGeode->FBAvail = pScrni->videoRam << 10; } /* If we have <= 16Mb of memory then compression is going to hurt - so warn and disable */ if (pGeode->tryCompression && pGeode->FBAvail <= 0x1000000) { xf86DrvMsg(pScrni->scrnIndex, X_INFO, "%x bytes of video memory is less then optimal\n", pGeode->FBAvail); xf86DrvMsg(pScrni->scrnIndex, X_INFO, "when compression is on. Disabling compression.\n"); pGeode->tryCompression = FALSE; } /* Carve out some memory for the command buffer */ pGeode->CmdBfrSize = CIM_CMD_BFR_SZ; pGeode->FBAvail -= CIM_CMD_BFR_SZ; pGeode->CmdBfrOffset = pGeode->FBAvail; /* Allocate a a CRTC config structure */ xf86CrtcConfigInit(pScrni, &lx_xf86crtc_config_funcs); /* Set up the GPU CRTC */ LXSetupCrtc(pScrni); xf86CrtcSetSizeRange(pScrni, 320, 200, LX_MAX_WIDTH, LX_MAX_HEIGHT); /* Setup the output */ LXSetupOutput(pScrni); if (!xf86InitialConfiguration(pScrni, FALSE)) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "No valid modes.\n"); return FALSE; } xf86PrintModes(pScrni); pScrni->currentMode = pScrni->modes; pGeode->Pitch = LXCalcPitch(pScrni); xf86SetDpi(pScrni, 0, 0); /* Load the modules we'll need */ if (xf86LoadSubModule(pScrni, "fb") == NULL) { return FALSE; } if (!pGeode->NoAccel) { if (!xf86LoadSubModule(pScrni, "exa")) return FALSE; } #ifndef XSERVER_LIBPCIACCESS if (xf86RegisterResources(pGeode->pEnt->index, NULL, ResExclusive)) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Couldn't register the resources.\n"); return FALSE; } #endif return TRUE; } static void LXRestore(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); if (pGeode->useVGA) { vgaHWPtr pvgaHW = VGAHWPTR(pScrni); vgaHWProtect(pScrni, TRUE); vgaHWRestore(pScrni, &pvgaHW->SavedReg, VGA_SR_ALL); vgaHWProtect(pScrni, FALSE); } } static Bool LXUnmapMem(ScrnInfoPtr pScrni) { #ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_gp_ptr, LX_GP_REG_SIZE); xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_vg_ptr, LX_VG_REG_SIZE); xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_vid_ptr, LX_VID_REG_SIZE); xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_vip_ptr, LX_VIP_REG_SIZE); xf86UnMapVidMem(pScrni->scrnIndex, XpressROMPtr, 0x10000); #else GeodeRec *pGeode = GEODEPTR(pScrni); pciVideoPtr pci = xf86GetPciInfoForEntity(pGeode->pEnt->index); unmap_pci_mem(pScrni, pci, cim_gp_ptr, LX_GP_REG_SIZE); unmap_pci_mem(pScrni, pci, cim_vg_ptr, LX_VG_REG_SIZE); unmap_pci_mem(pScrni, pci, cim_vid_ptr, LX_VID_REG_SIZE); unmap_pci_mem(pScrni, pci, cim_vip_ptr, LX_VIP_REG_SIZE); unmap_pci_mem(pScrni, pci, cim_fb_ptr, pGeode->FBAvail + CIM_CMD_BFR_SZ); munmap(XpressROMPtr, 0x10000); #endif return TRUE; } /* These should be correctly accounted for rotation */ void LXAdjustFrame(ADJUST_FRAME_ARGS_DECL) { SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); unsigned long offset; offset = (y * pGeode->Pitch); offset += x * (pScrni->bitsPerPixel >> 3); vg_set_display_offset(offset); } static Bool LXSwitchMode(SWITCH_MODE_ARGS_DECL) { SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); /* Set the new mode */ return xf86SetSingleMode(pScrni, pMode, pGeode->rotation); } static void LXLeaveGraphics(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); VG_PANNING_COORDINATES panning; gp_wait_until_idle(); lx_disable_dac_power(pScrni, DF_CRT_DISABLE); vg_set_custom_mode(&(pGeode->FBcimdisplaytiming.vgDisplayMode), pGeode->FBcimdisplaytiming.wBpp); vg_set_compression_enable(0); /* Restore the previous Compression state */ if (pGeode->FBCompressionEnable) { vg_configure_compression(&(pGeode->FBCBData)); vg_set_compression_enable(1); } vg_set_display_pitch(pGeode->FBcimdisplaytiming.wPitch); vg_set_display_offset(pGeode->FBDisplayOffset); /* Restore Cursor */ vg_set_cursor_position(pGeode->FBCursor.cursor_x, pGeode->FBCursor.cursor_y, &panning); LXRestore(pScrni); if (pGeode->useVGA && pGeode->VGAActive) { pGeode->vesa->pInt->num = 0x10; pGeode->vesa->pInt->ax = 0x0 | pGeode->FBBIOSMode; pGeode->vesa->pInt->bx = 0; xf86ExecX86int10(pGeode->vesa->pInt); vg_delay_milliseconds(3); } lx_enable_dac_power(pScrni, 1); pScrni->vtSema = FALSE; } static Bool LXCloseScreen(CLOSE_SCREEN_ARGS_DECL) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); if (pScrni->vtSema) LXLeaveGraphics(pScrni); if (pGeode->pExa) { exaDriverFini(pScrn); free(pGeode->pExa); pGeode->pExa = NULL; } /* Unmap the offscreen allocations */ GeodeCloseOffscreen(pScrni); LXUnmapMem(pScrni); if (pGeode->useVGA) vgaHWUnmapMem(pScrni); pScrni->PointerMoved = pGeode->PointerMoved; pScrn->CloseScreen = pGeode->CloseScreen; if (pScrn->CloseScreen) return (*pScrn->CloseScreen) (CLOSE_SCREEN_ARGS); return TRUE; } static Bool LXEnterGraphics(ScreenPtr pScrn, ScrnInfoPtr pScrni) { int bpp; GeodeRec *pGeode = GEODEPTR(pScrni); pGeode->VGAActive = gu3_get_vga_active(); gp_wait_until_idle(); vg_get_current_display_mode(&pGeode->FBcimdisplaytiming.vgDisplayMode, &bpp); pGeode->FBcimdisplaytiming.wBpp = bpp; pGeode->FBcimdisplaytiming.wPitch = vg_get_display_pitch(); pGeode->FBDisplayOffset = vg_get_display_offset(); if (pGeode->useVGA && pGeode->VGAActive) { vgaHWPtr pvgaHW = VGAHWPTR(pScrni); pGeode->FBBIOSMode = pvgaHW->readCrtc(pvgaHW, 0x040); } pGeode->FBCompressionEnable = vg_get_compression_enable(); vg_get_compression_info(&(pGeode->FBCBData)); /* Save Cursor offset */ vg_get_cursor_info(&pGeode->FBCursor); /* Turn off the VGA */ if (pGeode->useVGA) { unsigned short sequencer; vgaHWPtr pvgaHW = VGAHWPTR(pScrni); /* Unlock VGA registers */ vgaHWUnlock(pvgaHW); /* Save the current state and setup the current mode */ vgaHWSave(pScrni, &VGAHWPTR(pScrni)->SavedReg, VGA_SR_ALL); /* DISABLE VGA SEQUENCER */ /* This allows the VGA state machine to terminate. We must delay */ /* such that there are no pending MBUS requests. */ cim_outb(DC3_SEQUENCER_INDEX, DC3_SEQUENCER_CLK_MODE); sequencer = cim_inb(DC3_SEQUENCER_DATA); sequencer |= DC3_CLK_MODE_SCREEN_OFF; cim_outb(DC3_SEQUENCER_DATA, sequencer); vg_delay_milliseconds(1); /* BLANK THE VGA DISPLAY */ cim_outw(DC3_SEQUENCER_INDEX, DC3_SEQUENCER_RESET); sequencer = cim_inb(DC3_SEQUENCER_DATA); sequencer &= ~DC3_RESET_VGA_DISP_ENABLE; cim_outb(DC3_SEQUENCER_DATA, sequencer); vg_delay_milliseconds(1); } /* Clear the framebuffer */ memset(pGeode->FBBase, 0, pGeode->displaySize); /* Set the modes */ if (!xf86SetDesiredModes(pScrni)) return FALSE; pScrni->vtSema = TRUE; return TRUE; } static void LXLoadPalette(ScrnInfoPtr pScrni, int numColors, int *indizes, LOCO * colors, VisualPtr pVisual) { int i, index, color; for (i = 0; i < numColors; i++) { index = indizes[i] & 0xFF; color = (((unsigned long) (colors[index].red & 0xFF)) << 16) | (((unsigned long) (colors[index].green & 0xFF)) << 8) | ((unsigned long) (colors[index].blue & 0xFF)); vg_set_display_palette_entry(index, color); } } static Bool LXScreenInit(SCREEN_INIT_ARGS_DECL) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); int ret; unsigned int dwidth; pGeode->starting = TRUE; /* If we are using VGA then go ahead and map the memory */ if (pGeode->useVGA) { if (!vgaHWMapMem(pScrni)) return FALSE; vgaHWGetIOBase(VGAHWPTR(pScrni)); } if (!pGeode->NoAccel) { pGeode->pExa = exaDriverAlloc(); if (pGeode->pExa) { pGeode->pExa->memoryBase = 0; pGeode->pExa->memorySize = 0; pGeode->pExa->pixmapOffsetAlign = 32; pGeode->pExa->pixmapPitchAlign = 32; pGeode->pExa->flags = EXA_OFFSCREEN_PIXMAPS; pGeode->pExa->maxX = LX_MAX_WIDTH - 1; pGeode->pExa->maxY = LX_MAX_HEIGHT - 1; } else { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Couldn't allocate the EXA structure.\n"); pGeode->NoAccel = TRUE; } } /* Map the memory here before doing anything else */ if (!LXMapMem(pScrni)) return FALSE; LXInitOffscreen(pScrni); /* XXX FIXME - Take down any of the structures on failure? */ if (!LXEnterGraphics(pScrn, pScrni)) return FALSE; miClearVisualTypes(); /* XXX Again - take down anything? */ if (pScrni->bitsPerPixel > 8) { if (!miSetVisualTypes(pScrni->depth, TrueColorMask, pScrni->rgbBits, pScrni->defaultVisual)) { return FALSE; } } else { if (!miSetVisualTypes(pScrni->depth, miGetDefaultVisualMask(pScrni->depth), pScrni->rgbBits, pScrni->defaultVisual)) { return FALSE; } } miSetPixmapDepths(); if (pScrni->virtualX > pScrni->displayWidth) pScrni->displayWidth = pScrni->virtualX; /* Point at the visible area to start */ /* fbScreenInit assumes that the stride is display width * * bytes per pixel. If compression is on, then our stride might * be completely different, so we divide the pitch by the * bytes per pixel to fake fbScreenInit into doing the right thing */ dwidth = pGeode->Pitch / ((pScrni->bitsPerPixel + 7) / 8); ret = fbScreenInit(pScrn, pGeode->FBBase, pScrni->virtualX, pScrni->virtualY, pScrni->xDpi, pScrni->yDpi, dwidth, pScrni->bitsPerPixel); if (!ret) return FALSE; xf86SetBlackWhitePixels(pScrn); /* Set up the color ordering */ if (pScrni->bitsPerPixel > 8) { VisualPtr visual = pScrn->visuals + pScrn->numVisuals; while (--visual >= pScrn->visuals) { if ((visual->class | DynamicClass) == DirectColor) { visual->offsetRed = pScrni->offset.red; visual->offsetGreen = pScrni->offset.green; visual->offsetBlue = pScrni->offset.blue; visual->redMask = pScrni->mask.red; visual->greenMask = pScrni->mask.green; visual->blueMask = pScrni->mask.blue; } } } /* Must follow the color ordering */ fbPictureInit(pScrn, 0, 0); if (!pGeode->NoAccel) pGeode->NoAccel = LXExaInit(pScrn) ? FALSE : TRUE; xf86SetBackingStore(pScrn); /* Set up the soft cursor */ miDCInitialize(pScrn, xf86GetPointerScreenFuncs()); /* Set up the HW cursor - must follow the soft cursor init */ if (pGeode->tryHWCursor) { if (!LXCursorInit(pScrn)) xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "Hardware cursor initialization failed.\n"); } /* Set up the color map */ if (!miCreateDefColormap(pScrn)) return FALSE; if (pScrni->bitsPerPixel == 8) { /* Must follow initialization of the default colormap */ if (!xf86HandleColormaps(pScrn, 256, 8, LXLoadPalette, NULL, CMAP_PALETTED_TRUECOLOR | CMAP_RELOAD_ON_MODE_SWITCH)) { return FALSE; } } xf86DPMSInit(pScrn, xf86DPMSSet, 0); LXInitVideo(pScrn); pGeode->PointerMoved = pScrni->PointerMoved; pScrni->PointerMoved = GeodePointerMoved; pGeode->CloseScreen = pScrn->CloseScreen; pScrn->CloseScreen = LXCloseScreen; pScrn->SaveScreen = LXSaveScreen; if (!xf86CrtcScreenInit(pScrn)) { xf86DrvMsg(pScrni->scrnIndex, X_ERROR, "CRTCScreenInit failed.\n"); return FALSE; } if (serverGeneration == 1) xf86ShowUnusedOptions(pScrni->scrnIndex, pScrni->options); pGeode->starting = FALSE; return TRUE; } static int LXValidMode(VALID_MODE_ARGS_DECL) { return MODE_OK; } static Bool LXEnterVT(VT_FUNC_ARGS_DECL) { SCRN_INFO_PTR(arg); return LXEnterGraphics(NULL, pScrni); } static void LXLeaveVT(VT_FUNC_ARGS_DECL) { SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); pGeode->PrevDisplayOffset = vg_get_display_offset(); LXLeaveGraphics(pScrni); } void LXSetupChipsetFPtr(ScrnInfoPtr pScrn) { pScrn->PreInit = LXPreInit; pScrn->ScreenInit = LXScreenInit; pScrn->SwitchMode = LXSwitchMode; pScrn->AdjustFrame = LXAdjustFrame; pScrn->EnterVT = LXEnterVT; pScrn->LeaveVT = LXLeaveVT; pScrn->FreeScreen = GeodeFreeScreen; pScrn->ValidMode = LXValidMode; } xf86-video-geode-2.11.18/src/gx_rotate.c0000644000175000017500000001423712654445443014536 00000000000000/* Copyrightg (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "shadow.h" #include "geode.h" static void * GXWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode, CARD32 *size, void *closure) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScreen); GeodeRec *pGeode = GEODEPTR(pScrni); *size = pGeode->displayPitch; return (pGeode->FBBase + pGeode->displayOffset) + row * pGeode->displayPitch + offset; } static void GXUpdate(ScreenPtr pScreen, shadowBufPtr pBuf) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScreen); GeodeRec *pGeode = GEODEPTR(pScrni); int rotate = pGeode->rotation; switch (rotate) { case RR_Rotate_90: if (pScrni->bitsPerPixel == 8) shadowUpdateRotate8_90(pScreen, pBuf); else if (pScrni->bitsPerPixel == 16) shadowUpdateRotate16_90(pScreen, pBuf); else shadowUpdateRotate32_90(pScreen, pBuf); break; case RR_Rotate_180: if (pScrni->bitsPerPixel == 8) shadowUpdateRotate8_180(pScreen, pBuf); else if (pScrni->bitsPerPixel == 16) shadowUpdateRotate16_180(pScreen, pBuf); else shadowUpdateRotate32_180(pScreen, pBuf); break; case RR_Rotate_270: if (pScrni->bitsPerPixel == 8) shadowUpdateRotate8_270(pScreen, pBuf); else if (pScrni->bitsPerPixel == 16) shadowUpdateRotate16_270(pScreen, pBuf); else shadowUpdateRotate32_270(pScreen, pBuf); break; } } Bool GXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode) { GeodeRec *pGeode = GEODEPTR(pScrni); Rotation curr = pGeode->rotation; unsigned int curdw = pScrni->displayWidth; PixmapPtr pPixmap; BOOL ret; pPixmap = pScrni->pScreen->GetScreenPixmap(pScrni->pScreen); pGeode->rotation = GXGetRotation(pScrni->pScreen); /* Leave if we have nothing to do */ if (pGeode->rotation == curr && pGeode->curMode == mode) { return TRUE; } shadowRemove(pScrni->pScreen, NULL); switch (pGeode->rotation) { case RR_Rotate_0: ErrorF("Rotate to 0 degrees\n"); pScrni->displayWidth = pGeode->displayWidth; pGeode->Pitch = pGeode->displayPitch; break; case RR_Rotate_90: ErrorF("Rotate to 90 degrees\n"); pScrni->displayWidth = pScrni->pScreen->width; break; case RR_Rotate_180: ErrorF("Rotate to 180 degrees\n"); pScrni->displayWidth = pGeode->displayWidth; break; case RR_Rotate_270: ErrorF("Rotate to 270 degrees\n"); pScrni->displayWidth = pScrni->pScreen->width; break; } if (pGeode->rotation != RR_Rotate_0) { ret = shadowAdd(pScrni->pScreen, pPixmap, GXUpdate, GXWindowLinear, pGeode->rotation, NULL); if (!ret) { ErrorF("shadowAdd failed\n"); goto error; } } if (pGeode->rotation == RR_Rotate_0) pScrni->fbOffset = pGeode->displayOffset; else pScrni->fbOffset = pGeode->shadowOffset; pScrni->pScreen->ModifyPixmapHeader(pPixmap, pScrni->pScreen->width, pScrni->pScreen->height, pScrni->pScreen->rootDepth, pScrni->bitsPerPixel, PixmapBytePad(pScrni->displayWidth, pScrni-> pScreen->rootDepth), (pointer) (pGeode->FBBase + pScrni->fbOffset)); /* Don't use XAA pixmap cache or offscreen pixmaps when rotated */ #if XF86XAA if (pGeode->AccelInfoRec) { if (pGeode->rotation == RR_Rotate_0) { pGeode->AccelInfoRec->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS | PIXMAP_CACHE; pGeode->AccelInfoRec->UsingPixmapCache = TRUE; pGeode->AccelInfoRec->maxOffPixWidth = 0; pGeode->AccelInfoRec->maxOffPixHeight = 0; } else { pGeode->AccelInfoRec->Flags = LINEAR_FRAMEBUFFER; pGeode->AccelInfoRec->UsingPixmapCache = FALSE; pGeode->AccelInfoRec->maxOffPixWidth = 1; pGeode->AccelInfoRec->maxOffPixHeight = 1; } } #endif return TRUE; error: /* Restore the old rotation */ pScrni->displayWidth = curdw; if (curr & (RR_Rotate_0 | RR_Rotate_180)) { pScrni->pScreen->width = pScrni->virtualX; pScrni->pScreen->height = pScrni->virtualY; } else { pScrni->pScreen->width = pScrni->virtualY; pScrni->pScreen->height = pScrni->virtualX; } pGeode->rotation = curr; return FALSE; } xf86-video-geode-2.11.18/src/lx_vga.c0000644000175000017500000000331012654445443014010 00000000000000/* * Copyright (c) 2006-2008 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * This file contains routines to set modes using the VGA registers. * Since this file is for the first generation graphics unit, it interfaces * to SoftVGA registers. It works for both VSA1 and VSA2. */ /* VGA STRUCTURE */ int gu3_get_vga_active(void); int gu3_get_vga_active(void) { int data = READ_REG32(DC3_GENERAL_CFG); return (data & DC3_GCFG_VGAE) ? 1 : 0; } xf86-video-geode-2.11.18/src/gx_regacc.c0000644000175000017500000002312312654445443014456 00000000000000/* Copyright (c) 2003-2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This is the main file used to add Durango graphics support to a software * project. The main reason to have a single file include the other files * is that it centralizes the location of the compiler options. This file * should be tuned for a specific implementation, and then modified as needed * for new Durango releases. The releases.txt file indicates any updates to * this main file, such as a new definition for a new hardware platform. * * In other words, this file should be copied from the Durango source files * once when a software project starts, and then maintained as necessary. * It should not be recopied with new versions of Durango unless the * developer is willing to tune the file again for the specific project. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gfx_rtns.h" #include "gfx_defs.h" #include "gfx_regs.h" #define GU2_WAIT_PENDING \ while(READ_GP32(MGP_BLT_STATUS) & MGP_BS_BLT_PENDING) #define GU2_WAIT_HALF_EMPTY \ while(!(READ_GP32(MGP_BLT_STATUS) & MGP_BS_HALF_EMPTY)) extern unsigned long gu2_pitch; extern unsigned long gu2_xshift; extern unsigned short GFXpatternFlags; extern unsigned long gu2_rop32; extern unsigned short gu2_blt_mode; void gfx_write_reg8(unsigned long offset, unsigned char value); void gfx_write_reg16(unsigned long offset, unsigned short value); void gfx_write_reg32(unsigned long offset, unsigned long value); unsigned short gfx_read_reg16(unsigned long offset); unsigned long gfx_read_reg32(unsigned long offset); void gfx_write_vid32(unsigned long offset, unsigned long value); unsigned long gfx_read_vid32(unsigned long offset); unsigned long gfx_read_vip32(unsigned long offset); void gfx_write_vip32(unsigned long offset, unsigned long value); void gfx_mono_bitmap_to_screen_blt_swp(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, short pitch); unsigned int GetVideoMemSize(void); /* ROUTINES added accessing hardware reg */ void gfx_write_reg8(unsigned long offset, unsigned char value) { WRITE_REG8(offset, value); } void gfx_write_reg16(unsigned long offset, unsigned short value) { WRITE_REG16(offset, value); } void gfx_write_reg32(unsigned long offset, unsigned long value) { WRITE_REG32(offset, value); } unsigned short gfx_read_reg16(unsigned long offset) { unsigned short value; value = READ_REG16(offset); return value; } unsigned long gfx_read_reg32(unsigned long offset) { unsigned long value; value = READ_REG32(offset); return value; } void gfx_write_vid32(unsigned long offset, unsigned long value) { WRITE_VID32(offset, value); } unsigned long gfx_read_vid32(unsigned long offset) { unsigned long value; value = READ_VID32(offset); return value; } /*Addition for the VIP code */ unsigned long gfx_read_vip32(unsigned long offset) { unsigned long value; value = READ_VIP32(offset); return value; } void gfx_write_vip32(unsigned long offset, unsigned long value) { WRITE_VIP32(offset, value); } #define SWAP_BITS_IN_BYTES(v) \ (((0x01010101 & (v)) << 7) | ((0x02020202 & (v)) << 5) | \ ((0x04040404 & (v)) << 3) | ((0x08080808 & (v)) << 1) | \ ((0x10101010 & (v)) >> 1) | ((0x20202020 & (v)) >> 3) | \ ((0x40404040 & (v)) >> 5) | ((0x80808080 & (v)) >> 7)) #define WRITE_GPREG_STRING32_SWP(regoffset, dwords, \ counter, array, array_offset, temp) \ { \ temp = (unsigned long)array + (array_offset); \ for (counter = 0; counter < dwords; counter++) \ WRITE_GP32 (regoffset, \ SWAP_BITS_IN_BYTES(*((unsigned long *)temp + counter))); \ } void gfx_mono_bitmap_to_screen_blt_swp(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, short pitch) { unsigned long dstoffset, size, bytes; unsigned long offset, temp_offset, temp1 = 0, temp2 = 0; unsigned long i, j = 0, fifo_lines, dwords_extra, bytes_extra; unsigned long shift = 0; size = (((unsigned long) width) << 16) | height; /* CALCULATE STARTING OFFSETS */ offset = (unsigned long) srcy *pitch + ((unsigned long) srcx >> 3); dstoffset = (unsigned long) dsty *gu2_pitch + (((unsigned long) dstx) << gu2_xshift); /* CHECK IF PATTERN ORIGINS NEED TO BE SET */ if (GFXpatternFlags) { /* COMBINE X AND Y PATTERN ORIGINS WITH OFFSET */ dstoffset |= ((unsigned long) (dstx & 7)) << 26; dstoffset |= ((unsigned long) (dsty & 7)) << 29; } bytes = ((srcx & 7) + width + 7) >> 3; fifo_lines = bytes >> 5; dwords_extra = (bytes & 0x0000001Cl) >> 2; bytes_extra = bytes & 0x00000003l; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Put off poll for as long as possible (do most calculations first). */ /* The source offset is always 0 since we allow misaligned dword reads. */ /* Need to wait for busy instead of pending, since hardware clears */ /* the host data FIFO at the beginning of a BLT. */ GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, gu2_rop32); WRITE_GP32(MGP_SRC_OFFSET, ((unsigned long) srcx & 7) << 26); WRITE_GP32(MGP_DST_OFFSET, dstoffset); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_pitch); WRITE_GP16(MGP_BLT_MODE, gu2_blt_mode | MGP_BM_SRC_HOST | MGP_BM_SRC_MONO); /* WAIT FOR BLT TO BE LATCHED */ GU2_WAIT_PENDING; /* WRITE ALL OF THE DATA TO THE HOST SOURCE REGISTER */ while (height--) { temp_offset = offset; /* WRITE ALL FULL FIFO LINES */ for (i = 0; i < fifo_lines; i++) { GU2_WAIT_HALF_EMPTY; WRITE_GPREG_STRING32_SWP(MGP_HST_SOURCE, 8, j, data, temp_offset, temp1); temp_offset += 32; } /* WRITE ALL FULL DWORDS */ GU2_WAIT_HALF_EMPTY; if (dwords_extra) { WRITE_GPREG_STRING32_SWP(MGP_HST_SOURCE, dwords_extra, i, data, temp_offset, temp1); temp_offset += (dwords_extra << 2); } /* WRITE REMAINING BYTES */ shift = 0; if (bytes_extra) WRITE_GPREG_STRING8(MGP_HST_SOURCE, bytes_extra, shift, i, data, temp_offset, temp1, temp2); offset += pitch; } } unsigned int GetVideoMemSize(void) { unsigned int graphicsMemBaseAddr; unsigned int totalMem = 0; int i; unsigned int graphicsMemMask, graphicsMemShift; unsigned int mcBankCfg = gfx_read_reg32(0x8408); unsigned int dimmShift = 4; /* Read graphics base address. */ graphicsMemBaseAddr = gfx_read_reg32(0x8414); graphicsMemMask = 0x7FF; graphicsMemShift = 19; /* Calculate total memory size for GXm. */ for (i = 0; i < 2; i++) { if (((mcBankCfg >> dimmShift) & 0x7) != 0x7) { switch ((mcBankCfg >> (dimmShift + 4)) & 0x7) { case 0: totalMem += 0x400000; break; case 1: totalMem += 0x800000; break; case 2: totalMem += 0x1000000; break; case 3: totalMem += 0x2000000; break; case 4: totalMem += 0x4000000; break; case 5: totalMem += 0x8000000; break; case 6: totalMem += 0x10000000; break; case 7: totalMem += 0x20000000; break; default: break; } } dimmShift += 16; } /* Calculate graphics memory base address */ graphicsMemBaseAddr &= graphicsMemMask; graphicsMemBaseAddr <<= graphicsMemShift; return (totalMem - graphicsMemBaseAddr); } /* END OF FILE */ xf86-video-geode-2.11.18/src/geode.h0000644000175000017500000003142112654445443013624 00000000000000 /* * (c) 2006-2008 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ #ifndef _GEODE_H_ #define _GEODE_H_ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "geode_pcirename.h" #ifdef HAVE_XAA_H #include "xaa.h" #endif #include "exa.h" #include "xf86Cursor.h" #include "vgaHW.h" #include "xf86int10.h" #include #include "randrstr.h" #include "xf86xv.h" #include "compat-api.h" /* We only support EXA version >=2 */ #if (EXA_VERSION_MAJOR >= 2) #ifndef XF86EXA #define XF86EXA 1 #endif #else #undef XF86EXA #endif #ifdef HAVE_XAA_H #define XF86XAA 1 #else #undef XF86XAA #endif #define CFB 0 #define INT10_SUPPORT 1 /* Existing Processor Models */ #define GX1 0x01 #define GX 0x10 #define LX 0x20 #define PCI_VENDOR_ID_CYRIX 0x1078 #define PCI_VENDOR_ID_NS 0x100b #define PCI_VENDOR_ID_AMD 0x1022 #define PCI_CHIP_5530 0x0104 #define PCI_CHIP_SC1200 0x0504 #define PCI_CHIP_SC1400 0x0104 #define PCI_CHIP_GEODEGX 0x0030 #define PCI_CHIP_GEODELX 0x2081 #define GFX_CPU_GEODELX 4 #if defined(HAVE_GX) && XF86XAA #define GX_FILL_RECT_SUPPORT 1 #define GX_BRES_LINE_SUPPORT 1 #define GX_DASH_LINE_SUPPORT 0 /* does not do dashed lines */ #define GX_MONO_8X8_PAT_SUPPORT 1 #define GX_CLREXP_8X8_PAT_SUPPORT 1 #define GX_SCR2SCREXP_SUPPORT 1 #define GX_SCR2SCRCPY_SUPPORT 1 #define GX_CPU2SCREXP_SUPPORT 1 #define GX_SCANLINE_SUPPORT 1 #define GX_USE_OFFSCRN_MEM 0 #define GX_ONE_LINE_AT_A_TIME 1 #define GX_WRITE_PIXMAP_SUPPORT 1 #endif #define GFX(func) gfx_##func #define GFX2(func) gfx2_##func #define GEODEPTR(p) ((GeodeRec *)((p)->driverPrivate)) #define DEFAULT_EXA_SCRATCH_BFRSZ 0x40000 /* the LX hardware (and Cimarron) require a cursor memory size of 48x64.. */ #define LX_CURSOR_HW_WIDTH 48 #define LX_CURSOR_HW_HEIGHT 64 /* ...but xorg requires the cursor width to be a multiple of 32. This is the size of the *actual* cursor. */ #define LX_CURSOR_MAX_WIDTH 32 #define LX_CURSOR_MAX_HEIGHT 32 /* FIXME: Get rid of this from GX */ #define DEBUGMSG(cond, drv_msg) #ifdef HAVE_LX extern unsigned char cim_inb(unsigned short port); extern void cim_outb(unsigned short port, unsigned char data); extern unsigned short cim_inw(unsigned short port); extern void cim_outw(unsigned short port, unsigned short data); extern unsigned long cim_ind(unsigned short port); extern void cim_outd(unsigned short port, unsigned long data); #include "cim_rtns.h" typedef struct _CIM_DISPLAYTIMING { unsigned short wPitch; unsigned short wBpp; VG_DISPLAY_MODE vgDisplayMode; } CIM_DISPLAYTIMING; #endif #ifdef HAVE_GX extern void gfx_write_reg32(int offset, int data); extern void gfx_write_reg16(int offset, short data); extern void gfx_write_reg8(int offset, char data); extern int gfx_read_reg32(int offset); extern short gfx_read_reg16(int offset); extern void gfx_write_vid32(int offset, int data); extern int gfx_read_vid32(int offset); extern unsigned char gfx_inb(unsigned short port); extern void gfx_outb(unsigned short port, unsigned char data); extern unsigned short gfx_inw(unsigned short port); extern void gfx_outw(unsigned short port, unsigned short data); extern unsigned long gfx_ind(unsigned short port); extern void gfx_outd(unsigned short port, unsigned long data); #define Q_WORD QQ_WORD #include "gfx_rtns.h" #undef Q_WORD #include "panel.h" typedef struct tag_GFX_DISPLAYTIMING { unsigned int dwDotClock; unsigned short wPitch; unsigned short wBpp; unsigned short wHTotal; unsigned short wHActive; unsigned short wHSyncStart; unsigned short wHSyncEnd; unsigned short wHBlankStart; unsigned short wHBlankEnd; unsigned short wVTotal; unsigned short wVActive; unsigned short wVSyncStart; unsigned short wVSyncEnd; unsigned short wVBlankStart; unsigned short wVBlankEnd; unsigned short wPolarity; } GFX_DISPLAYTIMING; #endif typedef struct _VESARec { xf86Int10InfoPtr pInt; } VESARec; typedef struct _GeodeMemRec { struct _GeodeMemRec *next; struct _GeodeMemRec *prev; unsigned int offset; int size; } GeodeMemRec, *GeodeMemPtr; #define OUTPUT_PANEL 0x01 #define OUTPUT_CRT 0x02 #define OUTPUT_TV 0x04 #define OUTPUT_VOP 0x08 #define OUTPUT_DCON 0x10 typedef struct _geodeRec { /* Common for both GX and LX */ int Output; /* Bitmask indicating the valid output options */ Bool HWCursor; Bool NoAccel; Bool useVGA; Bool VGAActive; /* Flag indicating if LX VGA is active */ Bool Compression; Bool useEXA; int rotation; int displayWidth; Bool starting; Bool tryCompression; Bool tryHWCursor; int mm_width, mm_height; /* physical display size */ unsigned long CursorStartOffset; int Pitch; /* display FB pitch */ int displaySize; /* The size of the visibile area */ ExaOffscreenArea *shadowArea; /* Framebuffer memory */ unsigned char *FBBase; unsigned int FBAvail; /* EXA structures */ ExaDriverPtr pExa; unsigned int exaBfrOffset; unsigned int exaBfrSz; /* Other structures */ EntityInfoPtr pEnt; ScreenBlockHandlerProcPtr BlockHandler; /* needed for video */ XF86VideoAdaptorPtr adaptor; /* State save structures */ unsigned long FBDisplayOffset; unsigned long PrevDisplayOffset; VESARec *vesa; int FBCompressionEnable; VG_CURSOR_DATA FBCursor; /* Save the Cursor offset of the FB */ unsigned long FBCursorOffset; unsigned char FBBIOSMode; /* Hooks */ void (*PointerMoved) (POINTER_MOVED_ARGS_DECL); CloseScreenProcPtr CloseScreen; Bool (*CreateScreenResources) (ScreenPtr); /* ===== LX specific items ===== */ /* Flags */ Bool Scale; DisplayModePtr panelMode; /* The mode for the panel (if attached) */ /* Command buffer information */ unsigned long CmdBfrOffset; unsigned long CmdBfrSize; /* Memory Management */ GeodeMemPtr offscreenList; unsigned int offscreenStart; unsigned int offscreenSize; /* Save state */ VG_COMPRESSION_DATA CBData; VG_COMPRESSION_DATA FBCBData; CIM_DISPLAYTIMING FBcimdisplaytiming; /* ===== GX specific items ===== */ /* Flags */ Bool Panel; int PanelX; int PanelY; int displayPitch; /* The pitch ofthe visible area */ int displayOffset; /* The offset of the visible area */ DisplayModePtr curMode; unsigned int shadowSize; unsigned int shadowOffset; int FBVGAActive; xf86CursorInfoPtr CursorInfo; /* XAA structures */ unsigned int cpySrcOffset; int cpySrcPitch, cpySrcBpp; int cpyDx, cpyDy; unsigned int cmpSrcOffset; int cmpSrcPitch, cmpSrcBpp; unsigned int cmpSrcFmt, cmpDstFmt; int cmpOp; unsigned char **AccelImageWriteBuffers; int NoOfImgBuffers; unsigned char **AccelColorExpandBuffers; int NoOfColorExpandLines; #if XF86XAA XAAInfoRecPtr AccelInfoRec; #endif /* Save state */ unsigned long FBCompressionOffset; unsigned short FBCompressionPitch; unsigned short FBCompressionSize; GFX_DISPLAYTIMING FBgfxdisplaytiming; /* Hooks */ void (*WritePixmap) (ScrnInfoPtr pScrni, int x, int y, int w, int h, unsigned char *src, int srcwidth, int rop, unsigned int planemask, int trans, int bpp, int depth); /* Video information */ int video_x; int video_y; short video_w; short video_h; short video_srcw; short video_srch; short video_dstw; short video_dsth; int video_id; int video_offset; ScrnInfoPtr video_scrnptr; BOOL OverlayON; } GeodeRec, *GeodePtr; /* option flags are self-explanatory */ #ifdef HAVE_LX enum { LX_OPTION_SW_CURSOR, LX_OPTION_HW_CURSOR, LX_OPTION_NOCOMPRESSION, LX_OPTION_NOACCEL, LX_OPTION_EXA_SCRATCH_BFRSZ, LX_OPTION_TV_SUPPORT, LX_OPTION_TV_OUTPUT, LX_OPTION_TV_OVERSCAN, LX_OPTION_ROTATE, LX_OPTION_NOPANEL, LX_OPTION_FBSIZE, LX_OPTION_PANEL_MODE, LX_OPTION_DONT_PROGRAM } LX_GeodeOpts; #endif #ifdef HAVE_GX enum { GX_OPTION_SW_CURSOR, GX_OPTION_HW_CURSOR, GX_OPTION_NOCOMPRESSION, GX_OPTION_NOACCEL, GX_OPTION_ACCEL_METHOD, GX_OPTION_EXA_SCRATCH_BFRSZ, GX_OPTION_TV_SUPPORT, GX_OPTION_TV_OUTPUT, GX_OPTION_TV_OVERSCAN, GX_OPTION_ROTATE, GX_OPTION_NOPANEL, GX_OPTION_OSM_IMG_BUFS, GX_OPTION_OSM_CLR_BUFS, GX_OPTION_FBSIZE, GX_OPTION_PANEL_GEOMETRY, GX_OPTION_DONT_PROGRAM } GX_GeodeOpts; #endif /* geode_dcon.c */ extern Bool dcon_init(ScrnInfoPtr pScrni); extern int DCONDPMSSet(ScrnInfoPtr pScrni, int mode); /* geode_common.c */ void geode_memory_to_screen_blt(unsigned long, unsigned long, unsigned long, unsigned long, long, long, int); int GeodeGetRefreshRate(DisplayModePtr); void GeodeCopyGreyscale(unsigned char *, unsigned char *, int, int, int, int); int GeodeGetSizeFromFB(unsigned int *); /* gx_video.c */ int GeodeQueryImageAttributes(ScrnInfoPtr, int id, unsigned short *w, unsigned short *h, int *pitches, int *offsets); Bool RegionsEqual(RegionPtr A, RegionPtr B); /* gx_driver.c */ void GeodeProbeDDC(ScrnInfoPtr pScrni, int index); xf86MonPtr GeodeDoDDC(ScrnInfoPtr pScrni, int index); Bool GeodeI2CInit(ScrnInfoPtr pScrni, I2CBusPtr * ptr, char *name); int GeodeGetFPGeometry(const char *str, int *width, int *height); void GeodePointerMoved(POINTER_MOVED_ARGS_DECL); void GeodeFreeScreen(FREE_SCREEN_ARGS_DECL); int GeodeCalculatePitchBytes(unsigned int width, unsigned int bpp); void GXSetupChipsetFPtr(ScrnInfoPtr pScrn); /* geode_msr.c */ int GeodeReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi); int GeodeWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi); /* gx_cursor.c */ Bool GXHWCursorInit(ScreenPtr pScrn); void GXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src); void GXHideCursor(ScrnInfoPtr pScrni); void GXShowCursor(ScrnInfoPtr pScrni); /* gx_randr.c */ Rotation GXGetRotation(ScreenPtr pScreen); Bool GXRandRInit(ScreenPtr pScreen, int rotation); extern _X_EXPORT Bool GXRandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize); /* gx_rotate.c */ Bool GXRotate(ScrnInfoPtr pScrni, DisplayModePtr mode); /* gx_accel.c */ Bool GXAccelInit(ScreenPtr pScrn); void GXAccelSync(ScrnInfoPtr pScrni); /* gx_video.c */ void GXInitVideo(ScreenPtr pScrn); /* lx_display.c */ void lx_enable_dac_power(ScrnInfoPtr pScrni, int option); void lx_disable_dac_power(ScrnInfoPtr pScrni, int option); /* lx_driver.c */ void LXSetupChipsetFPtr(ScrnInfoPtr pScrn); /* lx_cursor.c */ Bool LXHWCursorInit(ScreenPtr pScrn); void LXLoadARGBCursorImage(ScrnInfoPtr pScrni, unsigned char *src); void LXHideCursor(ScrnInfoPtr pScrni); void LXShowCursor(ScrnInfoPtr pScrni); /* lx_exa.c */ Bool LXExaInit(ScreenPtr pScreen); /* lx_video.c */ void LXInitVideo(ScreenPtr pScrn); /* lx_output.c */ void LXSetupOutput(ScrnInfoPtr); /* lx_panel.c */ DisplayModePtr LXGetLegacyPanelMode(ScrnInfoPtr pScrni); DisplayModePtr LXGetManualPanelMode(char *modestr); void LXAdjustFrame(ADJUST_FRAME_ARGS_DECL); /* lx_display.c */ void LXSetupCrtc(ScrnInfoPtr pScrni); /* lx_memory.c */ GeodeMemPtr GeodeAllocOffscreen(GeodeRec * pGeode, int size, int align); void GeodeFreeOffscreen(GeodeRec * pGeode, GeodeMemPtr ptr); void LXInitOffscreen(ScrnInfoPtr pScrni); void GeodeCloseOffscreen(ScrnInfoPtr pScrni); unsigned int GeodeOffscreenFreeSize(GeodeRec * pGeode); /* lx_cursor.c */ Bool LXCursorInit(ScreenPtr pScrn); #endif xf86-video-geode-2.11.18/src/gx_cursor.c0000644000175000017500000002465612654445443014563 00000000000000/* Copyright (c) 2003-2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: Xfree cursor implementation routines for geode HWcursor * init.setting cursor color,image etc. are done here. * * Project: Geode Xfree Frame buffer device driver. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Pci.h" #include "xf86PciInfo.h" #include "geode.h" /* Forward declarations of the functions */ static void GXSetCursorColors(ScrnInfoPtr pScrni, int bg, int fg); static void GXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y); static Bool GXUseHWCursor(ScreenPtr pScrn, CursorPtr pCurs); extern void GXSetVideoPosition(int x, int y, int width, int height, short src_w, short src_h, short drw_w, short drw_h, int id, int offset, ScrnInfoPtr pScrn); /*---------------------------------------------------------------------------- * GXHWCursorInit. * * Description :This function sets the cursor information by probing the * hardware. * * Parameters. * pScrn :Screeen pointer structure. * * Returns :TRUE on success and FALSE on Failure * * Comments :Geode supports the hardware_cursor,no need to enable SW * cursor. *---------------------------------------------------------------------------- */ Bool GXHWCursorInit(ScreenPtr pScrn) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); xf86CursorInfoPtr infoPtr; infoPtr = xf86CreateCursorInfoRec(); if (!infoPtr) return FALSE; /* the geode structure is intiallized with the cursor infoRec */ pGeode->CursorInfo = infoPtr; infoPtr->MaxWidth = 32; infoPtr->MaxHeight = 32; /* seeting up the cursor flags */ infoPtr->Flags = HARDWARE_CURSOR_BIT_ORDER_MSBFIRST | HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED; /* cursor info ptr is intiallized with the values obtained from * * durnago calls */ infoPtr->SetCursorColors = GXSetCursorColors; infoPtr->SetCursorPosition = GXSetCursorPosition; infoPtr->LoadCursorImage = GXLoadCursorImage; infoPtr->HideCursor = GXHideCursor; infoPtr->ShowCursor = GXShowCursor; infoPtr->UseHWCursor = GXUseHWCursor; return (xf86InitCursor(pScrn, infoPtr)); } /*---------------------------------------------------------------------------- * GXSetCursorColors. * * Description :This function sets the cursor foreground and background * colors * Parameters: * pScrn: Screeen pointer structure. * bg: Specifies the color value of cursor background color. * fg: Specifies the color value of cursor foreground color. * * Returns: none. * * Comments: The integer color value passed by this function is * converted into * RGB value by the gfx_set_color routines. *---------------------------------------------------------------------------- */ static void GXSetCursorColors(ScrnInfoPtr pScrni, int bg, int fg) { GFX(set_cursor_colors(bg, fg)); } /*---------------------------------------------------------------------------- * GXSetCursorPosition. * * Description :This function sets the cursor co -ordinates and enable the * cursor. * * Parameters: * pScrn: Screeen pointer structure. * x: Specifies the x-cordinates of the cursor. * y: Specifies the y co-ordinate of the cursor. * * Returns: none. * *---------------------------------------------------------------------------- */ static void GXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y) { static unsigned long panOffset = 0; GeodeRec *pGeode = GEODEPTR(pScrni); int savex, savey; int newX, newY; /* Adjust xf86HWCursor messing about */ savex = x + pScrni->frameX0; savey = y + pScrni->frameY0; switch (pGeode->rotation) { default: ErrorF("%s:%d invalid rotation %d\n", __func__, __LINE__, pGeode->rotation); case RR_Rotate_0: newX = savex; newY = savey; break; case RR_Rotate_90: newX = savey; newY = pScrni->pScreen->width - savex; break; case RR_Rotate_180: newX = pScrni->pScreen->width - savex; newY = pScrni->pScreen->height - savey; break; case RR_Rotate_270: newX = pScrni->pScreen->height - savey; newY = savex; break; } newX += pScrni->frameX0; newY += pScrni->frameY0; //ErrorF("Turned (%d,%d) into (%d,%d)\n", x,y,newX, newY); if (newX < -31) newX = -31; if (newY < -31) newY = -31; gfx_set_cursor_position(pGeode->CursorStartOffset, newX + 31, newY + 31, 31, 31); gfx_set_cursor_enable(1); if ((pGeode->OverlayON) && (pGeode->Panel)) { pGeode->PrevDisplayOffset = gfx_get_display_offset(); if (pGeode->PrevDisplayOffset != panOffset) { GXSetVideoPosition(pGeode->video_x, pGeode->video_y, pGeode->video_w, pGeode->video_h, pGeode->video_srcw, pGeode->video_srch, pGeode->video_dstw, pGeode->video_dsth, pGeode->video_id, pGeode->video_offset, pGeode->video_scrnptr); panOffset = pGeode->PrevDisplayOffset; } } } /*---------------------------------------------------------------------------- * GXLoadCursorImage * * Description: This function loads the 32x32 cursor pattern.The shape * and color is set by AND and XOR masking of arrays of 32 * DWORD. * Parameters: * pScrn: Screeen pointer structure. * src: Specifies cursor data. * * Returns: none * *---------------------------------------------------------------------------- */ void GXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src) { int i, n, x, y, newX, newY; unsigned long andMask[32], xorMask[32]; GeodeRec *pGeode = GEODEPTR(pScrni); unsigned long mskb, rowb; unsigned char *rowp = &src[0]; unsigned char *mskp = &src[128]; if (src != NULL) { mskb = rowb = 0; for (y = 32; --y >= 0;) andMask[y] = xorMask[y] = 0; for (y = 0; y < 32; ++y) { for (x = 0; x < 32; ++x) { if ((i = x & 7) == 0) { rowb = (*rowp & *mskp); mskb = ~(*mskp); ++rowp; ++mskp; } switch (pGeode->rotation) { default: ErrorF("%s:%d invalid rotation %d\n", __func__, __LINE__, pGeode->rotation); case RR_Rotate_0: newX = x; newY = y; break; case RR_Rotate_90: newX = y; newY = 31 - x; break; case RR_Rotate_180: newX = 31 - x; newY = 31 - y; break; case RR_Rotate_270: newX = 31 - y; newY = x; break; } i = 7 - i; n = 31 - newX; andMask[newY] |= (((mskb >> i) & 1) << n); xorMask[newY] |= (((rowb >> i) & 1) << n); } } } else { for (y = 32; --y >= 0;) { andMask[y] = ~0; xorMask[y] = 0; } } gfx_set_cursor_shape32(pGeode->CursorStartOffset, &andMask[0], &xorMask[0]); } /*---------------------------------------------------------------------------- * GXHideCursor. * * Description: This function will disable the cursor. * * Parameters: * pScrn: Handles to the Screeen pointer structure. * * Returns: none. * * Comments: gfx_set_cursor enable function is hardcoded to disable * the cursor. *---------------------------------------------------------------------------- */ void GXHideCursor(ScrnInfoPtr pScrni) { gfx_set_cursor_enable(0); } /*---------------------------------------------------------------------------- * GXShowCursor * * Description :This function will enable the cursor. * * Parameters: * pScrn :Handles to the Screeen pointer structure. * * Returns :none * * Comments :gfx_set_cursor enable function is hardcoded to enable the * cursor *---------------------------------------------------------------------------- */ void GXShowCursor(ScrnInfoPtr pScrni) { GFX(set_cursor_enable(1)); } /*---------------------------------------------------------------------------- * GXUseHwCursor. * * Description :This function will sets the hardware cursor flag in * pscreen structure. * * Parameters. * pScrn :Handles to the Screeen pointer structure. * * Returns :none * * Comments :none * *---------------------------------------------------------------------------- */ static Bool GXUseHWCursor(ScreenPtr pScrn, CursorPtr pCurs) { ScrnInfoPtr pScrni = XF86SCRNINFO(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); return pGeode->HWCursor; } xf86-video-geode-2.11.18/src/gfx/0000755000175000017500000000000012654451205013224 500000000000000xf86-video-geode-2.11.18/src/gfx/gfx_mode.h0000644000175000017500000001225112654445443015115 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This header file contains the mode tables. It is used by the "gfx_disp.c" * file to set a display mode. * */ #ifndef _gfx_mode_h #define _gfx_mode_h /* MODE FLAGS (BITWISE-OR) */ #define GFX_MODE_8BPP 0x00000001 #define GFX_MODE_12BPP 0x00000002 #define GFX_MODE_15BPP 0x00000004 #define GFX_MODE_16BPP 0x00000008 #define GFX_MODE_24BPP 0x00000010 #define GFX_MODE_56HZ 0x00000020 #define GFX_MODE_60HZ 0x00000040 #define GFX_MODE_70HZ 0x00000080 #define GFX_MODE_72HZ 0x00000100 #define GFX_MODE_75HZ 0x00000200 #define GFX_MODE_85HZ 0x00000400 #define GFX_MODE_90HZ 0x00000800 #define GFX_MODE_100HZ 0x00001000 #define GFX_MODE_NEG_HSYNC 0x00002000 #define GFX_MODE_NEG_VSYNC 0x00004000 #define GFX_MODE_PIXEL_DOUBLE 0x00008000 #define GFX_MODE_LINE_DOUBLE 0x00010000 #define GFX_MODE_TV_NTSC 0x00020000 #define GFX_MODE_TV_PAL 0x00040000 #define GFX_MODE_EXCLUDE_PLL 0x00080000 #define GFX_MODE_LOCK_TIMING 0x10000000 #define gfx_mode_hz_conversion \ switch (hz) { \ case 56: \ hz_flag = GFX_MODE_56HZ; \ break; \ case 60: \ hz_flag = GFX_MODE_60HZ; \ break; \ case 70: \ hz_flag = GFX_MODE_70HZ; \ break; \ case 72: \ hz_flag = GFX_MODE_72HZ; \ break; \ case 75: \ hz_flag = GFX_MODE_75HZ; \ break; \ case 85: \ hz_flag = GFX_MODE_85HZ; \ break; \ case 90: \ hz_flag = GFX_MODE_90HZ; \ break; \ case 100: \ hz_flag = GFX_MODE_100HZ; \ break; \ } #define gfx_mode_bpp_conversion \ switch (bpp) { \ case 8: \ bpp_flag = GFX_MODE_8BPP; \ break; \ case 12: \ bpp_flag = GFX_MODE_12BPP; \ break; \ case 15: \ bpp_flag = GFX_MODE_15BPP; \ break; \ case 16: \ bpp_flag = GFX_MODE_16BPP; \ break; \ case 32: \ bpp_flag = GFX_MODE_24BPP; \ break; \ default: \ return -1; \ } #define gfx_mode_bpp_conversion_def(bpp) \ switch (bpp) { \ case 8: \ bpp_flag = GFX_MODE_8BPP; \ break; \ case 12: \ bpp_flag = GFX_MODE_12BPP; \ break; \ case 15: \ bpp_flag = GFX_MODE_15BPP; \ break; \ case 16: \ bpp_flag = GFX_MODE_16BPP; \ break; \ case 32: \ bpp_flag = GFX_MODE_24BPP; \ break; \ default: \ bpp_flag = GFX_MODE_8BPP; \ } /* STRUCTURE DEFINITION */ typedef struct tagDISPLAYMODE { /* DISPLAY MODE FLAGS */ /* Specify valid color depths and the refresh rate. */ unsigned long flags; /* TIMINGS */ unsigned short hactive; unsigned short hblankstart; unsigned short hsyncstart; unsigned short hsyncend; unsigned short hblankend; unsigned short htotal; unsigned short vactive; unsigned short vblankstart; unsigned short vsyncstart; unsigned short vsyncend; unsigned short vblankend; unsigned short vtotal; /* CLOCK FREQUENCY */ unsigned long frequency; } DISPLAYMODE; /* For Fixed timings */ typedef struct tagFIXEDTIMINGS { /* DISPLAY MODE FLAGS */ /* Specify valid color depths and the refresh rate. */ int panelresx; int panelresy; unsigned short xres; unsigned short yres; /* TIMINGS */ unsigned short hactive; unsigned short hblankstart; unsigned short hsyncstart; unsigned short hsyncend; unsigned short hblankend; unsigned short htotal; unsigned short vactive; unsigned short vblankstart; unsigned short vsyncstart; unsigned short vsyncend; unsigned short vblankend; unsigned short vtotal; /* CLOCK FREQUENCY */ unsigned long frequency; } FIXEDTIMINGS; #endif /* !_gfx_mode_h */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/init_gu2.c0000644000175000017500000001075512654445443015047 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines used in Redcloud initialization. * */ /*---------------------------------------------------------------------------- * gfx_get_core_freq * * Returns the core clock frequency of a GX2. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu2_get_core_freq(void) #else unsigned long gfx_get_core_freq(void) #endif { unsigned long value; /* CPU SPEED IS REPORTED BY A VSM IN VSA II */ /* Virtual Register Class = 0x12 (Sysinfo) */ /* CPU Speed Register = 0x01 */ OUTW(0xAC1C, 0xFC53); OUTW(0xAC1C, 0x1201); value = (unsigned long) (INW(0xAC1E)); return (value); } /*---------------------------------------------------------------------------- * gfx_get_cpu_register_base * * This routine returns the base address for display controller registers. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu2_get_cpu_register_base(void) #else unsigned long gfx_get_cpu_register_base(void) #endif { return gfx_pci_config_read(0x80000918); } /*---------------------------------------------------------------------------- * gfx_get_graphics_register_base * * This routine returns the base address for the graphics acceleration. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu2_get_graphics_register_base(void) #else unsigned long gfx_get_graphics_register_base(void) #endif { return gfx_pci_config_read(0x80000914); } /*---------------------------------------------------------------------------- * gfx_get_frame_buffer_base * * This routine returns the base address for graphics memory. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu2_get_frame_buffer_base(void) #else unsigned long gfx_get_frame_buffer_base(void) #endif { return gfx_pci_config_read(0x80000910); } /*---------------------------------------------------------------------------- * gfx_get_frame_buffer_size * * This routine returns the total size of graphics memory, in bytes. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu2_get_frame_buffer_size(void) #else unsigned long gfx_get_frame_buffer_size(void) #endif { unsigned long value; /* FRAME BUFFER SIZE IS REPORTED BY A VSM IN VSA II */ /* Virtual Register Class = 0x02 */ /* VG_MEM_SIZE (512KB units) = 0x00 */ OUTW(0xAC1C, 0xFC53); OUTW(0xAC1C, 0x0200); value = (unsigned long) (INW(0xAC1E)) & 0xFFl; return (value << 19); } /*---------------------------------------------------------------------------- * gfx_get_vid_register_base * * This routine returns the base address for the video hardware. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu2_get_vid_register_base(void) #else unsigned long gfx_get_vid_register_base(void) #endif { return gfx_pci_config_read(0x8000091C); } /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/release.txt0000644000175000017500000006351712654445443015350 00000000000000Durango Release Notes Version 2.57.00 Win98/WinXP/DOS/Linux April 5, 2003 ----------------------------------------------------------------------------- PRODUCT INFORMATION ----------------------------------------------------------------------------- Durango is a graphics/video software support package designed to assist in the development of display drivers and embedded applications. The core of this package is source code that performs most of the graphics related functionality for the National Semiconductor (c) Geode family of products. Development time for new software is reduced by using these routines to access the hardware. ----------------------------------------------------------------------------- INSTALLATION INSTRUCTIONS ----------------------------------------------------------------------------- Download the file to a directory. Modify and include the file durango.c according to the needs of the application. ----------------------------------------------------------------------------- REVISION HISTORY ----------------------------------------------------------------------------- 04/05/04 Version 2.57.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Fixed the PLL setting for 1280x1024@70Hz and 1152x864@70Hz. ============================================================================= 03/30/04 Version 2.56.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Updated the GX2 render code such that BLTs that involve source will work correctly even if source is not involved in the ROP. ============================================================================= 03/26/04 Version 2.55.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Filled in all missing refresh rates in the mode table for Redcloud and Castle. * Added a new routine gfx_is_panel_mode_supported. * Added new routines gfx_set_graphics_palette and gfx_set_graphics_palette_entry to support using the video palette to gamma correct graphics data. ============================================================================= 03/11/04 Version 2.54.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Updated the video palette routines to clear the bypass both bit before updating the palette. ============================================================================= 03/02/04 Version 2.53.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Added 1152x864@60, 85, 90 and 100Hz to the mode table. ============================================================================= 02/07/04 Version 2.52.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Updated Durango to support Castle, including a 48MHz dotref. * Added 90 and 100Hz modes for Redcloud. * Updated the PLL table to remove any pre-divides by 2. ============================================================================= 10/24/03 Version 2.51.08 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Removed GX2 1.0 support from the PLL routines, gfx_set_clock_frequency and gfx_get_clock_frequency. * Fixed a bug in gfx_set_clock_frequency, wherein the last three PLL values in Durango's PLL table could never be set. ============================================================================= 09/22/03 Version 2.51.07 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Changed gfx_set_video_palette and gfx_set_video_palette_entry such that calling one of these routines will also configure the video hardware to route video data through the DF palette RAM. * Added a new routine, gfx_set_video_palette_bypass to toggle the 'Bypass Both' functionality of the SC1200 and GX2 palette RAMs. ============================================================================= 09/02/03 Version 2.51.06 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Added new routine gfx_get_max_video_width for SC1200 and CS5530. This routine calculates the maximum theoretical video width based on the current display mode and video clock. ============================================================================= 08/07/03 Version 2.51.05 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Fixed gfx_get_core_freq for SCx2xx when the fast PCI frequency is not 33MHz. * Fixed gfx_get_compression_pitch to mask correct bits. * Changed CS5530 and SCx2xx code to always enable video in the display controller. * Modified GX2 PLL code to only update the PLL when the value has not already been programmed. ============================================================================= 06/17/03 Version 2.51.04 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Fixed code to set default gamma RAM for SCx2xx. ============================================================================= 06/02/03 Version 2.51.03 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Fixed gfx_get_cursor_position for GX2 to support large display resolutions. * Added default gamma RAM table for SCx2xx and GX2 to correct CSC hardware. ============================================================================= 03/20/03 Version 2.51.02 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Changed all preprocessor statements to conform to K and R standard. * Added support for 56Hz modes to all Durango routines. * Added missing header file to gfx_priv.h ============================================================================= 03/13/03 Version 2.51.01 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Updated file headers to NSC standard headers. * Added routine definitions for private and local routines. * Minor fixes for compilation without warnings. * Fixed panel timings for 640x480 panels and 1024x768 panels. ============================================================================= 02/05/03 Version 2.49.02 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Fixed GX2 left clipping for 4:2:0 video. ============================================================================= 01/29/03 Version 2.49.01 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Removed unused variable in CS5530 video code. * Changed max supported pixel clock for SCx2xx to 157.5 MHz. ============================================================================= 01/10/03 Version 2.49.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Added extra wait loop when polling for CRC completion. * Removed code that sets the pitch offsets for 4:2:0 video within gfx_set_video_size. * Fixed panning code to work with any display pitch. * Added code to clear the PLL bypass bit when setting the dot PLL. * Fixed panning code so cursor never disappears when panning. * Changed GX2 delay loops to do a volatile register read to prevent the entire delay loop from being discarded by a compiler. ============================================================================= 11/19/02 Version 2.47.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Updated gfx2_* routines to use a signed stride. * SW workaround for issue #134.8 - Strange horizontal lines appearing while drawing lines. * Implemented gfx_set_video_left_crop for CS5530 * Updated sub carrier reset values for NTSC and PAL. ============================================================================= 08/29/02 Version 2.45.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Modified gfx_set_cursor_position to use cursor position when panning and not adjust using hotspots. * Added new routine gfx_get_refreshrate_from_mode. * Added gfx_text_blt routine. * Added gfx_get_tv_display_mode_frequency routine. * Added gfx_get_frequency_from_refreshrate routine. * Added gfx_set_video_cursor_enable routine. * Fixed Linux compilation warnings. * Updated modeset code to clear panning variables. * Added panel timings for 1600x1200 desktops. * Removed wait for VBlank when panning using cursor routines. ============================================================================= 07/12/02 Version 2.43.03 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Modified gfx_get_display_mode to support 56 Hz modes. * Added support for 8K pitch when setting a true color mode above 1024x768 * Added a byte-packed option to gfx2_mono_expand_blt * Fix for Carmel D2 alpha blending issue. * Added typecasts for proper compilation. * Fixed CS5535 MBIU address. * Added new GX2 routine, gfx2_text_blt * Added MSR implementations for Linux. * Further optimized default GX1 string macros. * Added new routine, gfx_set_panel_present to allow panning without adjusting panel timings. * Added assembly macros for 32-bit Windows applications. ============================================================================= 03/21/02 Version 2.41.02 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Optimized GX2 Bitmap-to-screen BLTs by using a 2-line offscreen scratch area. * Fixed a bug in GX2 monochrome bitmap BLTs. * Fixed gfx_get_clock_frequency for GX2 2.0 * Added 56 Hz support to gfx_get_clock_frequency * Changed gfx_set_compression_size to subtract header size * Changed gfx_get_compression_size to add header size ============================================================================= 03/04/02 Version 2.39.01 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Added support for CS5535 MSRs. * Fixed a bug in monochrome bitmap BLTs. * Added support for 32-bit CRC mechanism in GX2 2.0. * First official GX2 release. * Added support for new Dot PLL mechanism in GX2 2.0 * Added support for Carmel D1.1 and D2. ============================================================================= 01/24/02 Version 2.37.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Changed gfx_get_clock_frequency, gfx_get_cursor_offset and gfx_get_display_offset to be outside the GFX_READ_ROUTINES flag. * Modified the modeset code to set higher FIFO priority levels for high bandwidth modes. * Init code no longer returns Redcloud ID when no chip detected. * Added fix for Redcloud 1.x rev ID * New GX2 PLL settings - updates to the 14 MHz table and a new 48 MHz table. * Optimized all bitmap-to-screen routines. Optimizations include new macros that allow correct operation in a 16-bit environment. * 3K cache is now assumed to be the default scratchpad configuration. * gfx_get_frame_buffer_size for GX2 no longer uses a VGA register. This allows correct operation even with an external VGA card present in the system. * Added support for 1152x864 desktop resolution on a flat panel. * Added 24BPP support for large display modes. * Modified gfx_set_video_scale such that an identity scale is now default. * Modifed flat panel modeset code to dynamically determine the size of the mode table. * Added support for Carmel Rev D2. ============================================================================= 10/22/01 Version 2.35.01 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * New release notes format. * Added fix for SC1200 issue #813 (TVOut field indication is reversed. * Added check for invalid values in video upscale. * Fixed compilation warnings and run-time errors under DOS. * Added new macros for word I/O. * Optimized VSAII MSR code to used DWORD I/O. * Fixed SoftVG base PCI base addresses. * Several fixes to Redcloud API found during bringup. * Modified Durango to support 4-pixel video alignment for Redcloud. * Added the functions gfx_test_vip_overflow, gfx_get_vip_line, gfx_set_decoder_luminance_filter, gfx_set_tv_YV_delya and gfx_set_tv_field_status_invert. * Added support for Carmel D1 revision ID. * Moved gfx_get_vip_base and gfx_get_vbi_pitch outside of the GXF_READ_ROUTINES flag. * Minor fixes to saa7114.c and gfx_set_tv-enable. * Added don't care option in gfx_set_vip_base. * Added fix for SC1200 issue #1121 (VIP FIFO bus request threshold bit is inverted. ============================================================================= 07/31/01 Version 2.33.02 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Completed implementation of vertical downscaling support for GX2. * Added a method to lock the display controller timings. * Added support for SC1200 Rev C. * Small modifications to gfx_set_video_format. * Removed unused and unimplemented I2C functions. * Changes to prevent errors and compiler warnings in DOS. * Updated headers to include both BSD and GPL licenses. ============================================================================= 06/08/01 Version 2.31.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Added new routines to manipulate vertical video downscaling on GX2. * Minor fixes to the function gfx_read_window_crc. * Implemented all init routines for GX2 except gfx_get_core_freq. * Added support for 27MHz reference frequency to the GX2 PLL. * Added new function gfx_get_softvga_active. * Minor changes to the function sc1200_reset_video. * Fixed some minor compiler warnings. ============================================================================= 04/25/01 Version 2.29.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Disabled all CSC when setting an RGB video format. * Modified sc1200_set_video_size to add 2 to the window height. * Modified code to support the accelerator and cursor in pixel and line double modes. * Modified gfx_get_core_freq to be a dynamic API routine. * Added the function gfx_read_window_crc for GX2. * Added init routine gfx_get_graphics_register_base for GX2. * Added new macros to access the scratchpad RAM to support Win2K and WinME. * Added mew macros to access the GP registers for GX2. ============================================================================= 04/06/01 Version 2.27.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Added new TV read functions: gfx_get_tv_enable, gfx_get_tv_output, gfx_get_tv_display_mode, gfx_get_tv_mode_count, gfx_is_tv_display_mode_supported * Added new function gfx_set_display_bpp. * Added new function gfx_get_frame_buffer_line_size. * Modified gfx_set_vbi_base to accept pure physical addresses instead of offsets. * Implemented video and display controller routines for GX2. * Modified some initialization routines to be dynamic. * Created new API extension for GX2 MSR accesses. * Added new icon routines for GX2. * Modified gfx_set_tv_display to preserve current bpp. * Minor modifications to gfx_set_tv_format, gfx_set_video_palette and gfx_set_video_palette entry. * Added support for 1152x864@75Hz ============================================================================= 03/12/01 Version 2.25.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Adapted new revision format system. * Synchronized with NSTA Durango. Updated support for all SC1200 features. * Added support for 640x400 as well as emulated VGA modes. * Added new routines to access single palette color entries. * Added new routine to return the maximum supported pixel clock. * Added new routine gfx_set_crt_enable to manipulate the CRT display logic. * Added new rendering routine gfx_color_pattern_fill. * Added 4:2:0 and RGB video format support for CS5530 and SC1200. * Modified code to allow operation under DOS. ============================================================================= 07/21/00 Version 2.04 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Verified Xfree86 driver version 1.1.4 under Linux, and ce v2.3. * Merged sc1200 changes. * Added routines to support the query of current display mode. * Added functions gfx_enable_softvga, dfx_disable_softvga. * Added code optimization in rendering loops to use 32 bit writes where possible. * Added gfx_is_mode_supported to query if given mode supported by the h/w. * Added Flat panel support, realy testing with panel done only for 800x600. * Removed subtraction of 16 from gfx_set_compression_size. * Added version.h file to reflect the version of the durango used. ============================================================================= 03/03/00 Version 2.01 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Verified Xfree86 driver version 1.1 under FreeBSD and Linux. * Added automatic detection of BLT buffer bases in "gfx_set_bpp" routine. * Fixed improper setting of VGA attrubute controller index register. * Moved "gfx_get_display_bpp" to always be included. * Moved "gfx_get_hactive" and "gfx_get_vactive" to always be included. * Clipped video source size if off bottom or right side. * Properly adjusted video offset if clipped on the top side. * Added "gfx_get_video_line_size" and "gfx_get_video_xclip" routines. ============================================================================= 02/21/00 Version 2.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Added gfx_vga.c. * Added write to GP_BLIT_STATUS in "gfx_set_bpp" routine. * Verified alpha blending on SC1200. * Removed "gfx_set_blt_buffers" routine. ============================================================================= 02/09/00 Version 1.20 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Verified display modes and graphics rendering on SC1200. * Updated PLL table for SC1200 to set modes. * DURANGO.C FILE CHANGE!: Modifed and added compiler definitions. * Split gfx_disp.c file into gu1_disp.c and gu2_disp.c * Split gfx_rndr.c file into gu1_rndr.c and gu2_rndr.c * Split gfx_vid.c file into vid_5530.c, vid_1400.c, and vid_1200.c * Split gfx_vip.c file into vip_1400.c and vip_1200.c * Split gfx_tv.c file into geode_tv.c and fs451_tv.c * Split gfx_i2c.c file into acc_i2c.c and gpio_i2c.c. * Split gfx_dcdr.c file to saa7114.c * Added GFX_READ_ROUTINES compiler definition. * Moved routines from gfx_read.c (no longer exists) to other files. * Abstracted display controller access in the video overlay routines. * Added routines to control display compression hardware. ============================================================================= 01/28/00 Version 1.13 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Passes randomly generated rendering tests in Darwin for GXLV. * Fixed bug for large bitmap to screen BLTs (greater than 64K). * Fixed bug for pattern fills using solid source data for plane masks. ============================================================================= 01/14/00 Version 1.12 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Added proper use of hotspot to gfx_set_cursor_position. * Fixed buffer size to handle all frame buffer start address alignments. * Added initial version of gfx_tv.c. ============================================================================= 01/07/00 Version 1.11 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Fixed bug with transparent BLTs (loading transparent color into BB1). * Added definition of gfx_color_bitmap_to_screen_blt to gfx_rtns.h. * Added gfx_color_bitmap_to_screen_xblt (transparent bitmap to screen). ============================================================================= 12/21/99 Version 1.10 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Added additional video decoder routines to gfx_dcdr.c. * Added VBI routines to gfx_vip.c. * Added alpha blending routines for SC1200 to gfx_vid.c ============================================================================= 10/01/99 Version 1.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Added video port, video decoder, I2C, and hardware query rouines. * New files: gfx_vip.c, gfx_dcdr.c, gfx_i2c.c, gfx_read.c. ============================================================================= 08/27/99 Version 0.05 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * INTERFACE CHANGE: Changed "gfx_csptr[]" to "gfx_vidptr" and "gfx_vipptr". * Added "gfx_get_vid_register_base" and "gfx_get_vip_register_base". * Added initial PLL table for SC1400. * Verified mode set and video overlay routines work correctly on SC1400. * Updated initilization routines. * Added update of graphics engine in "gfx_set_display_pitch". ============================================================================= 08/20/99 Version 0.04 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * INTERFACE CHANGE: "gfx_load_*" routines changed to "gfx_set_*" for naming consistency. The "gfx_text_glyph" routine was removed. * Added video overlay routines. * Added gfx_vid.c file. ============================================================================= 08/16/99 Version 0.03 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * INTERFACE CHANGE: Access to CS5530 now through separate pointer. Project must declare and map the gfx_csptr[GFX_CSPTR_SIZE] variable. * Added durango.c file as template for main source file. * Added gfx_init.c file. ============================================================================= 08/04/99 Version 0.02 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Additional modes in gfx_mode.h file. * Separated register definitions from gfx_defs.h into gfx_regs.h. ============================================================================= 07/30/99 Version 0.01 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- * Initial release. ----------------------------------------------------------------------------- xf86-video-geode-2.11.18/src/gfx/tv_1200.c0000644000175000017500000007765012654445443014431 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to control the SC1200 TVOUT and TV encoder. * */ /*---------------------------------------------------------------------------- * gfx_set_tv_format * * This routine sets the TV encoder registers to the specified format * and resolution. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tv_format(TVStandardType format, GfxOnTVType resolution) #else int gfx_set_tv_format(TVStandardType format, GfxOnTVType resolution) #endif { unsigned long ctrl2, mode; /* Save TV output mode */ ctrl2 = READ_VID32(SC1200_TVENC_TIM_CTRL_2) & (SC1200_TVENC_OUTPUT_YCBCR | SC1200_TVENC_CFS_MASK); /* Save flicker filter setting */ mode = READ_VID32(SC1200_TVOUT_HORZ_SCALING) & SC1200_TVOUT_FLICKER_FILTER_MASK; switch (format) { case TV_STANDARD_NTSC: /* Horizontal Sync Start is 848 */ /* Horizontal Sync End is 856 */ WRITE_VID32(SC1200_TVOUT_HORZ_SYNC, 0x03580350); /* Vertical Sync Start is 0 */ /* Vertical Sync End is 1 */ /* Vertical Display Start Skew is 1 */ /* Vertical Display End Skew is 1 */ WRITE_VID32(SC1200_TVOUT_VERT_SYNC, 0x05001000); /* Disable vertical down scaling, take all lines */ if (gfx_chip_revision <= SC1200_REV_B3) WRITE_VID32(SC1200_TVOUT_VERT_DOWNSCALE, 0xffffffff); /* Enable video timing */ /* Reset sub carrier every two frames */ /* Disable BLANK */ /* Enable color burst */ /* Add the IRE offset */ /* NTSC color encoding */ /* Video generator timing is 525 lines / 60Hz */ /* Horizontal and Vertical counters are initialized to HPHASE & * VPHASE */ /* VPHASE is 2, HPHASE is 0x50 */ WRITE_VID32(SC1200_TVENC_TIM_CTRL_1, 0xa2a01050); /* Increase horizontal blanking interval */ /* Low Water Mark for Y is 0x1F */ /* Low Water Mark for Cb is 0xF */ /* HUE is 0 */ /* SCPHASE is 0xF9 */ WRITE_VID32(SC1200_TVENC_TIM_CTRL_2, 0x9ff000f9 | ctrl2); /* Subcarrier Frequency is 3.579545 MHz */ WRITE_VID32(SC1200_TVENC_SUB_FREQ, 0x21f07c1f); /* VSTART is 18, HSTART is 113 */ WRITE_VID32(SC1200_TVENC_DISP_POS, 0x00120071); /* Display size: HEIGHT is 239, WIDTH is 719 */ WRITE_VID32(SC1200_TVENC_DISP_SIZE, 0x00ef02cf); switch (resolution) { case GFX_ON_TV_SQUARE_PIXELS: if (gfx_chip_revision <= SC1200_REV_B3) { /* Horizontal Display start is 116 */ /* Total number of pixels per line is 857 */ WRITE_VID32(SC1200_TVOUT_HORZ_TIM, 0x00740359); /* HSYNC generated in the TV Encoder module */ /* Interval between resets of TV Encoder is once every odd * field */ /* Enable Horizontal interpolation */ /* Enable Horizontal up scaling 9/8 */ /* Disable Horizontal downscale */ WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, 0x10020700 | mode); /* Horizontal display end is 919, i.e. 720 active pixels */ /* Total number of display lines per field is 240 */ WRITE_VID32(SC1200_TVOUT_LINE_END, 0x039700f0); } else { /* Use new scaler available in Rev. C */ /* Horizontal Display start is 111 */ /* Total number of pixels per line is 857 */ WRITE_VID32(SC1200_TVOUT_HORZ_TIM, 0x006f0359); /* HSYNC generated in the TV Encoder module */ /* Interval between resets of TV Encoder is once every odd * field */ /* Enable Horizontal interpolation */ /* Disable Horizontal up scaling 9/8 */ /* Disable Horizontal downscale */ WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, 0x10020500 | mode); /* Set Horizontal upscaling to 64/58 (~ 11/10) */ WRITE_VID32(SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE, 0x3A000000); /* Horizontal display end is 900, i.e. 706 active pixels */ /* Total number of display lines per field is 240 */ WRITE_VID32(SC1200_TVOUT_LINE_END, 0x038400f0); } break; case GFX_ON_TV_NO_SCALING: /* Horizontal Display start is 116 */ /* Total number of pixels per line is 857 */ WRITE_VID32(SC1200_TVOUT_HORZ_TIM, 0x00740359); /* HSYNC generated in the TV Encoder module */ /* Interval between resets of TV Encoder is once every odd field */ /* Enable Horizontal interpolation */ /* Disable Horizontal up scaling 9/8 */ /* Disable Horizontal downscale */ WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, 0x10020500 | mode); /* Disable Horizontal scaling (set to 64/64) */ if (gfx_chip_revision >= SC1200_REV_C1) WRITE_VID32(SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE, 0x40000000); /* Horizontal display end is 919, i.e. 720 active pixels */ /* Total number of display lines per field is 240 */ WRITE_VID32(SC1200_TVOUT_LINE_END, 0x039700f0); break; default: return (GFX_STATUS_BAD_PARAMETER); } break; case TV_STANDARD_PAL: /* Horizontal Sync Start is 854 */ /* Horizontal Sync End is 862 */ WRITE_VID32(SC1200_TVOUT_HORZ_SYNC, 0x035e0356); /* Vertical Sync Start is 0 */ /* Vertical Sync End is 1 */ /* Vertical Display Start Skew is 1 */ /* Vertical Display End Skew is 1 */ WRITE_VID32(SC1200_TVOUT_VERT_SYNC, 0x05001000); /* Disable vertical down scaling, take all lines */ if (gfx_chip_revision <= SC1200_REV_B3) WRITE_VID32(SC1200_TVOUT_VERT_DOWNSCALE, 0xffffffff); /* Enable video timing */ /* Never reset sub carrier (should be every 4 frames but doesn't work * with genlock) */ /* Disable BLANK */ /* Enable color burst */ /* Do not add the IRE offset */ /* NTSC color encoding */ /* Video generator timing is 625 lines / 50Hz */ /* Horizontal and Vertical counters are initialized to HPHASE & VPHASE * */ /* VPHASE is 2, HPHASE is 50 */ WRITE_VID32(SC1200_TVENC_TIM_CTRL_1, 0xB1201050); /* Increase horizontal blanking interval */ /* Low Water Mark for Y is 0x1F */ /* Low Water Mark for Cb is 0xF */ /* HUE is 0 */ /* SCPHASE is 0xD9 */ WRITE_VID32(SC1200_TVENC_TIM_CTRL_2, 0x9ff000d9 | ctrl2); /* Subcarrier Frequency is 4.43361875 MHz */ WRITE_VID32(SC1200_TVENC_SUB_FREQ, 0x2a098acb); /* VSTART is 22, HSTART is 123 */ WRITE_VID32(SC1200_TVENC_DISP_POS, 0x0016007b); /* Display size: HEIGHT is 287, WIDTH is 719 */ WRITE_VID32(SC1200_TVENC_DISP_SIZE, 0x011f02cf); switch (resolution) { case GFX_ON_TV_NO_SCALING: /* Horizontal Display start is 124 */ /* Total number of pixels per line is 863 */ WRITE_VID32(SC1200_TVOUT_HORZ_TIM, 0x007c035f); /* HSYNC generated in the TV Encoder module */ /* Interval between resets of TV Encoder is once every odd field */ /* Enable Horizontal interpolation */ /* Disable Horizontal up scaling 9/8 */ /* Disable Horizontal downscale */ WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, 0x10020500 | mode); /* Disable Horizontal scaling (set to 64/64) */ if (gfx_chip_revision >= SC1200_REV_C1) WRITE_VID32(SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE, 0x40000000); /* Horizontal display end is 924, i.e. 720 active pixels */ /* Total number of display lines per field is 288 */ WRITE_VID32(SC1200_TVOUT_LINE_END, 0x039c0120); break; case GFX_ON_TV_SQUARE_PIXELS: /* Horizontal Display start is 122 */ /* Total number of pixels per line is 863 */ WRITE_VID32(SC1200_TVOUT_HORZ_TIM, 0x007a035f); if (gfx_chip_revision <= SC1200_REV_B3) { /* HSYNC generated in the TV Encoder module */ /* Interval between resets of TV Encoder is once every odd * field */ /* Enable Horizontal interpolation */ /* Disable Horizontal up scaling 9/8 */ /* Horizontal downscale m/(m+1), m = 11, (i.e. 11/12 - closest * possible to 54/59) */ WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, 0x1002040b | mode); /* Horizontal display end is 906, i.e. 704 active pixels */ /* Total number of display lines per field is 288 */ WRITE_VID32(SC1200_TVOUT_LINE_END, 0x038a0120); } else { /* HSYNC generated in the TV Encoder module */ /* Interval between resets of TV Encoder is once every odd * field */ /* Enable Horizontal interpolation */ /* Disable Horizontal up scaling 9/8 */ /* Disable Horizontal downscale */ WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, 0x10020500 | mode); /* Set Horizontal down scaling to 64/70 (closest possible to * 54/59) */ WRITE_VID32(SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE, 0x46000000); /* Horizontal display end is 904, i.e. 702 active pixels */ /* Total number of display lines per field is 288 */ WRITE_VID32(SC1200_TVOUT_LINE_END, 0x03880120); } break; default: return (GFX_STATUS_BAD_PARAMETER); } break; default: return (GFX_STATUS_BAD_PARAMETER); } return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_set_tv_output * * This routine sets the TV encoder registers to the specified output type. * Supported output types are : S-VIDEO, Composite, YUV and SCART. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tv_output(int output) #else int gfx_set_tv_output(int output) #endif { unsigned long ctrl2, ctrl3; ctrl2 = READ_VID32(SC1200_TVENC_TIM_CTRL_2); ctrl3 = READ_VID32(SC1200_TVENC_TIM_CTRL_3); ctrl2 &= ~(SC1200_TVENC_OUTPUT_YCBCR | SC1200_TVENC_CFS_MASK); ctrl3 &= ~(SC1200_TVENC_CM | SC1200_TVENC_SYNCMODE_MASK | SC1200_TVENC_CS); switch (output) { case TV_OUTPUT_COMPOSITE: /* Analog outputs provide Y, C and CVBS */ /* Chrominance Lowpass filter is 1.3MHz (for composite video output) */ WRITE_VID32(SC1200_TVENC_TIM_CTRL_2, ctrl2 | SC1200_TVENC_CFS_CVBS); WRITE_VID32(SC1200_TVENC_TIM_CTRL_3, ctrl3); break; case TV_OUTPUT_S_VIDEO: /* Analog outputs provide Y, C and CVBS */ /* Chrominance Lowpass filter is 1.8MHz (for S-video output) */ WRITE_VID32(SC1200_TVENC_TIM_CTRL_2, ctrl2 | SC1200_TVENC_CFS_SVIDEO); WRITE_VID32(SC1200_TVENC_TIM_CTRL_3, ctrl3); break; case TV_OUTPUT_YUV: /* Analog outputs provide Y, Cb and Cr */ /* A 7.5 IRE setup is applied to the output */ WRITE_VID32(SC1200_TVENC_TIM_CTRL_2, ctrl2 | SC1200_TVENC_OUTPUT_YCBCR | SC1200_TVENC_CFS_BYPASS); WRITE_VID32(SC1200_TVENC_TIM_CTRL_3, ctrl3 | SC1200_TVENC_CM | SC1200_TVENC_CS); break; case TV_OUTPUT_SCART: /* Analog outputs provide SCART (RGB and CVBS) */ /* Sync is added to green signal */ WRITE_VID32(SC1200_TVENC_TIM_CTRL_2, ctrl2 | SC1200_TVENC_CFS_CVBS); WRITE_VID32(SC1200_TVENC_TIM_CTRL_3, ctrl3 | SC1200_TVENC_CM | SC1200_TVENC_SYNC_ON_GREEN); break; default: return (GFX_STATUS_BAD_PARAMETER); } /* Adjusts the internal voltage reference */ ctrl2 = READ_VID32(SC1200_TVENC_DAC_CONTROL); ctrl2 &= ~SC1200_TVENC_TRIM_MASK; /* Bypass for issue #926 : Inadequate chroma level of S-Video output */ if ((gfx_chip_revision == SC1200_REV_B3) && (output == TV_OUTPUT_S_VIDEO)) ctrl2 |= 0x7; else ctrl2 |= 0x5; WRITE_VID32(SC1200_TVENC_DAC_CONTROL, ctrl2); /* Disable 4:2:2 to 4:4:4 converter interpolation */ WRITE_VID32(SC1200_TVOUT_DEBUG, SC1200_TVOUT_CONVERTER_INTERPOLATION); return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_set_tv_enable * * This routine enables or disables the TV output. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tv_enable(int enable) #else int gfx_set_tv_enable(int enable) #endif { unsigned long value_tim, value_dac; value_tim = READ_VID32(SC1200_TVENC_TIM_CTRL_1); value_dac = READ_VID32(SC1200_TVENC_DAC_CONTROL); if (enable) { value_tim |= SC1200_TVENC_VIDEO_TIMING_ENABLE; value_dac &= ~SC1200_TVENC_POWER_DOWN; /* ENABLE GRAPHICS DISPLAY LOGIC IN VIDEO PROCESSOR */ gfx_set_screen_enable(1); } else { value_tim &= ~SC1200_TVENC_VIDEO_TIMING_ENABLE; value_dac |= SC1200_TVENC_POWER_DOWN; /* Do not disable the graphics display logic because it might be * needed for CRT */ } WRITE_VID32(SC1200_TVENC_TIM_CTRL_1, value_tim); WRITE_VID32(SC1200_TVENC_DAC_CONTROL, value_dac); return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_set_tv_flicker_filter * * This routine configures the TV out flicker filter. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tv_flicker_filter(int ff) #else int gfx_set_tv_flicker_filter(int ff) #endif { unsigned long mode; mode = READ_VID32(SC1200_TVOUT_HORZ_SCALING); mode &= ~SC1200_TVOUT_FLICKER_FILTER_MASK; switch (ff) { case TV_FLICKER_FILTER_NONE: WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, mode | SC1200_TVOUT_FLICKER_FILTER_DISABLED); break; case TV_FLICKER_FILTER_NORMAL: WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, mode | SC1200_TVOUT_FLICKER_FILTER_FOURTH_HALF_FOURTH); break; case TV_FLICKER_FILTER_INTERLACED: WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, mode | SC1200_TVOUT_FLICKER_FILTER_HALF_ONE_HALF); break; default: return GFX_STATUS_BAD_PARAMETER; } return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_set_tv_sub_carrier_reset * * This routine configures the TV encoder sub carrier reset interval. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tv_sub_carrier_reset(int screset) #else int gfx_set_tv_sub_carrier_reset(int screset) #endif { unsigned long mode; mode = READ_VID32(SC1200_TVENC_TIM_CTRL_1); mode &= ~SC1200_TVENC_SUB_CARRIER_RESET_MASK; switch (screset) { case TV_SUB_CARRIER_RESET_NEVER: WRITE_VID32(SC1200_TVENC_TIM_CTRL_1, mode | SC1200_TVENC_SUB_CARRIER_RESET_NEVER); break; case TV_SUB_CARRIER_RESET_EVERY_TWO_LINES: WRITE_VID32(SC1200_TVENC_TIM_CTRL_1, mode | SC1200_TVENC_SUB_CARRIER_RESET_EVERY_TWO_LINES); break; case TV_SUB_CARRIER_RESET_EVERY_TWO_FRAMES: WRITE_VID32(SC1200_TVENC_TIM_CTRL_1, mode | SC1200_TVENC_SUB_CARRIER_RESET_EVERY_TWO_FRAMES); break; case TV_SUB_CARRIER_RESET_EVERY_FOUR_FRAMES: WRITE_VID32(SC1200_TVENC_TIM_CTRL_1, mode | SC1200_TVENC_SUB_CARRIER_RESET_EVERY_FOUR_FRAMES); break; default: return GFX_STATUS_BAD_PARAMETER; } return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_set_tv_vphase * * This routine sets the tv encoder VPHASE value. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tv_vphase(int vphase) #else int gfx_set_tv_vphase(int vphase) #endif { unsigned long mode = READ_VID32(SC1200_TVENC_TIM_CTRL_1); mode &= ~SC1200_TVENC_VPHASE_MASK; mode |= (vphase << SC1200_TVENC_VPHASE_POS) & SC1200_TVENC_VPHASE_MASK; WRITE_VID32(SC1200_TVENC_TIM_CTRL_1, mode); return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_set_tv_YC_delay * * This routine configures the TV out Y/C delay. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tv_YC_delay(int delay) #else int gfx_set_tv_YC_delay(int delay) #endif { unsigned long mode; /* This feature is implemented in Rev C1 */ if (gfx_chip_revision < SC1200_REV_C1) return (GFX_STATUS_OK); mode = READ_VID32(SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE); mode &= ~SC1200_TVOUT_YC_DELAY_MASK; switch (delay) { case TV_YC_DELAY_NONE: WRITE_VID32(SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE, mode | SC1200_TVOUT_YC_DELAY_NONE); break; case TV_Y_DELAY_ONE_PIXEL: WRITE_VID32(SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE, mode | SC1200_TVOUT_Y_DELAY_ONE_PIXEL); break; case TV_C_DELAY_ONE_PIXEL: WRITE_VID32(SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE, mode | SC1200_TVOUT_C_DELAY_ONE_PIXEL); break; case TV_C_DELAY_TWO_PIXELS: WRITE_VID32(SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE, mode | SC1200_TVOUT_C_DELAY_TWO_PIXELS); break; default: return GFX_STATUS_BAD_PARAMETER; } return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_set_tvenc_reset_interval * * This routine sets the interval between external resets of the TV encoder * timing generator by the TV out. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tvenc_reset_interval(int interval) #else int gfx_set_tvenc_reset_interval(int interval) #endif { unsigned long value; value = READ_VID32(SC1200_TVOUT_HORZ_SCALING); value &= ~SC1200_TVENC_EXTERNAL_RESET_INTERVAL_MASK; switch (interval) { case TVENC_RESET_EVERY_ODD_FIELD: WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, value | SC1200_TVENC_EXTERNAL_RESET_EVERY_ODD_FIELD); break; case TVENC_RESET_EVERY_EVEN_FIELD: WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, value | SC1200_TVENC_EXTERNAL_RESET_EVERY_EVEN_FIELD); break; case TVENC_RESET_NEXT_ODD_FIELD: WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, value | SC1200_TVENC_EXTERNAL_RESET_NEXT_ODD_FIELD); break; case TVENC_RESET_NEXT_EVEN_FIELD: WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, value | SC1200_TVENC_EXTERNAL_RESET_NEXT_EVEN_FIELD); break; case TVENC_RESET_EVERY_FIELD: WRITE_VID32(SC1200_TVOUT_HORZ_SCALING, value | SC1200_TVENC_EXTERNAL_RESET_EVERY_FIELD); break; case TVENC_RESET_EVERY_X_ODD_FIELDS: case TVENC_RESET_EVERY_X_EVEN_FIELDS: return GFX_STATUS_UNSUPPORTED; default: return GFX_STATUS_BAD_PARAMETER; } return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_set_tv_cc_enable * * This routine enables or disables the use of the hardware CC registers * in the TV encoder. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tv_cc_enable(int enable) #else int gfx_set_tv_cc_enable(int enable) #endif { unsigned long value; value = READ_VID32(SC1200_TVENC_CC_CONTROL); value &= ~(0x0005F); if (enable) value |= 0x51; WRITE_VID32(SC1200_TVENC_CC_CONTROL, value); return (0); } /*--------------------------------------------------------------------------- * gfx_set_tv_display * * This routine sets the timings in the display controller to support a * TV resolution. *--------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tv_display(int width, int height) #else int gfx_set_tv_display(int width, int height) #endif { DISPLAYMODE *pMode; unsigned int i; for (i = 0; i < NUM_TV_MODES; i++) { pMode = &TVTimings[i]; if ((unsigned) width == pMode->hactive && (unsigned) height == pMode->vactive) break; } if (i == NUM_TV_MODES) return 0; gfx_set_display_timings(gfx_get_display_bpp(), (unsigned short) pMode->flags, pMode->hactive, pMode->hblankstart, pMode->hsyncstart, pMode->hsyncend, pMode->hblankend, pMode->htotal, pMode->vactive, pMode->vblankstart, pMode->vsyncstart, pMode->vsyncend, pMode->vblankend, pMode->vtotal, pMode->frequency); return 1; } /*---------------------------------------------------------------------------- * cc_add_parity_bit * * This routine adds the (odd) parity bit to the data character. *---------------------------------------------------------------------------- */ unsigned char cc_add_parity_bit(unsigned char data) { int i, num = 0; unsigned char d = data; for (i = 0; i < 7; i++) { if (d & 0x1) num++; d >>= 1; } if (num & 0x1) return (data & ~0x80); else return (data | 0x80); } /*---------------------------------------------------------------------------- * gfx_set_tv_cc_data * * This routine writes the two specified characters to the CC data register * of the TV encoder. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tv_cc_data(unsigned char data1, unsigned char data2) #else int gfx_set_tv_cc_data(unsigned char data1, unsigned char data2) #endif { unsigned long value; value = cc_add_parity_bit(data1) | (cc_add_parity_bit(data2) << 8); WRITE_VID32(SC1200_TVENC_CC_DATA, value); return (0); } /*--------------------------------------------------------------------------- * gfx_test_tvout_odd_field * * This routine returns 1 if the current TVout field is odd. Otherwise returns * 0. *--------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_test_tvout_odd_field(void) #else int gfx_test_tvout_odd_field(void) #endif { unsigned long debug = READ_VID32(SC1200_TVOUT_DEBUG); WRITE_VID32(SC1200_TVOUT_DEBUG, debug | SC1200_TVOUT_FIELD_STATUS_TV); if (READ_VID32(SC1200_TVOUT_DEBUG) & SC1200_TVOUT_FIELD_STATUS_EVEN) return (0); else return (1); } /*--------------------------------------------------------------------------- * gfx_test_tvenc_odd_field * * This routine returns 1 if the current TV encoder field is odd. Otherwise * returns 0. *--------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_test_tvenc_odd_field(void) #else int gfx_test_tvenc_odd_field(void) #endif { unsigned long debug = READ_VID32(SC1200_TVOUT_DEBUG); WRITE_VID32(SC1200_TVOUT_DEBUG, debug & ~SC1200_TVOUT_FIELD_STATUS_TV); if (READ_VID32(SC1200_TVOUT_DEBUG) & SC1200_TVOUT_FIELD_STATUS_EVEN) return (0); else return (1); } /*---------------------------------------------------------------------------- * gfx_set_tv_field_status_invert * * This routines determines whether the tvout/tvencoder field status bit is * inverted (enable = 1) or not (enable = 0). *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_set_tv_field_status_invert(int enable) #else int gfx_set_tv_field_status_invert(int enable) #endif { unsigned long value; value = READ_VID32(SC1200_TVOUT_DEBUG); if (enable) { value |= SC1200_TVOUT_FIELD_STATUS_INVERT; } else { value &= ~(SC1200_TVOUT_FIELD_STATUS_INVERT); } WRITE_VID32(SC1200_TVOUT_DEBUG, value); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_get_tv_vphase * * This routine returns the tv encoder vertical phase. *--------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_get_tv_vphase(void) #else int gfx_get_tv_vphase(void) #endif { unsigned long mode = READ_VID32(SC1200_TVENC_TIM_CTRL_1); return (int) ((mode & SC1200_TVENC_VPHASE_MASK) >> SC1200_TVENC_VPHASE_POS); } /*--------------------------------------------------------------------------- * gfx_get_tv_enable * * This routine returns the current tv enable status *--------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_get_tv_enable(unsigned int *p_on) #else int gfx_get_tv_enable(unsigned int *p_on) #endif { unsigned long control = READ_VID32(SC1200_TVENC_DAC_CONTROL); *p_on = (unsigned int) (!(control & SC1200_TVENC_POWER_DOWN)); return GFX_STATUS_OK; } /*--------------------------------------------------------------------------- * gfx_get_tv_output * * This routine returns the current programmed TV output type. It does not * detect invalid configurations. *--------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_get_tv_output(void) #else int gfx_get_tv_output(void) #endif { unsigned long ctrl2, ctrl3; int format = 0; ctrl2 = READ_VID32(SC1200_TVENC_TIM_CTRL_2); ctrl3 = READ_VID32(SC1200_TVENC_TIM_CTRL_3); if ((ctrl2 & SC1200_TVENC_CFS_MASK) == SC1200_TVENC_CFS_SVIDEO) format = TV_OUTPUT_S_VIDEO; else if (ctrl2 & SC1200_TVENC_OUTPUT_YCBCR) format = TV_OUTPUT_YUV; else if ((ctrl2 & SC1200_TVENC_CFS_MASK) == SC1200_TVENC_CFS_CVBS) { if (ctrl3 & SC1200_TVENC_CM) format = TV_OUTPUT_SCART; else format = TV_OUTPUT_COMPOSITE; } return format; } /*--------------------------------------------------------------------------- * gfx_get_tv_mode_count * * This routine returns the number of valid TV out resolutions. *--------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_get_tv_mode_count(TVStandardType format) #else int gfx_get_tv_mode_count(TVStandardType format) #endif { unsigned int mode, count = 0; unsigned long flag; switch (format) { case TV_STANDARD_NTSC: flag = GFX_MODE_TV_NTSC; break; case TV_STANDARD_PAL: flag = GFX_MODE_TV_PAL; break; default: return 0; } for (mode = 0; mode < NUM_TV_MODES; mode++) { if (TVTimings[mode].flags & flag) count++; } return count; } /*--------------------------------------------------------------------------- * gfx_get_tv_display_mode * * This routine returns the current TV display parameters. *--------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_get_tv_display_mode(int *width, int *height, int *bpp, int *hz) #else int gfx_get_tv_display_mode(int *width, int *height, int *bpp, int *hz) #endif { unsigned long frequency; unsigned long mode, flags; *width = gfx_get_hactive(); *height = gfx_get_vactive(); *bpp = gfx_get_display_bpp(); frequency = gfx_get_clock_frequency(); for (mode = 0; mode < NUM_TV_MODES; mode++) { if (TVTimings[mode].hactive == (unsigned short) (*width) && TVTimings[mode].vactive == (unsigned short) (*height) && TVTimings[mode].frequency == frequency) { flags = TVTimings[mode].flags; if (flags & GFX_MODE_TV_NTSC) *hz = 60; else if (flags & GFX_MODE_TV_PAL) *hz = 50; else *hz = 0; return (1); } } return -1; } /*--------------------------------------------------------------------------- * gfx_get_tv_display_mode_frequency * * This routine returns the PLL frequency of a given TV mode. *--------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_get_tv_display_mode_frequency(unsigned short width, unsigned short height, TVStandardType format, int *frequency) #else int gfx_get_tv_display_mode_frequency(unsigned short width, unsigned short height, TVStandardType format, int *frequency) #endif { unsigned long mode, flag; int retval = -1; *frequency = 0; switch (format) { case TV_STANDARD_NTSC: flag = GFX_MODE_TV_NTSC; break; case TV_STANDARD_PAL: flag = GFX_MODE_TV_PAL; break; default: return -1; } for (mode = 0; mode < NUM_TV_MODES; mode++) { if ((TVTimings[mode].hactive == width) && (TVTimings[mode].vactive == height) && (TVTimings[mode].flags & flag)) { *frequency = TVTimings[mode].frequency; retval = 1; } } return retval; } /*--------------------------------------------------------------------------- * gfx_is_tv_display_mode_supported * * Returns >= 0 if the mode is available, -1 if the mode could not be found *--------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int sc1200_is_tv_display_mode_supported(unsigned short width, unsigned short height, TVStandardType format) #else int gfx_is_tv_display_mode_supported(unsigned short width, unsigned short height, TVStandardType format) #endif { unsigned long mode, flag; switch (format) { case TV_STANDARD_NTSC: flag = GFX_MODE_TV_NTSC; break; case TV_STANDARD_PAL: flag = GFX_MODE_TV_PAL; break; default: return -1; } for (mode = 0; mode < NUM_TV_MODES; mode++) { if (TVTimings[mode].hactive == width && TVTimings[mode].vactive == height && (TVTimings[mode].flags & flag)) { return ((int) mode); } } return -1; } /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/vid_rdcl.c0000644000175000017500000027034412654445443015117 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to control the Redcloud display filter video * overlay hardware. * */ unsigned long gfx_gamma_ram_redcloud[] = { 0x00000000, 0x00040003, 0x00050104, 0x00060205, 0x00070306, 0x00080407, 0x00090508, 0x000A0609, 0x000B070A, 0x000C080B, 0x000D090C, 0x000E0A0D, 0x000F0B0E, 0x00100C0F, 0x00110D10, 0x00110E11, 0x00120F12, 0x00141013, 0x00151114, 0x00161215, 0x00171316, 0x00181417, 0x00191518, 0x001A1619, 0x001B171A, 0x001C181B, 0x001D191C, 0x001D1A1D, 0x001E1B1E, 0x00201C1F, 0x00201D20, 0x00221E21, 0x00231F22, 0x00242023, 0x00252124, 0x00262225, 0x00262326, 0x00282427, 0x00292528, 0x00292629, 0x002B272A, 0x002C282B, 0x002D292C, 0x002E2A2D, 0x002F2B2E, 0x00302C2F, 0x00312D30, 0x00322E31, 0x00332F32, 0x00343033, 0x00353134, 0x00363235, 0x00373336, 0x00383437, 0x00393538, 0x003A3639, 0x003B373A, 0x003C383B, 0x003D393C, 0x003E3A3D, 0x003F3B3E, 0x00403C3F, 0x00413D40, 0x00423E41, 0x00433F42, 0x00444043, 0x00444144, 0x00454245, 0x00474346, 0x00484447, 0x00494548, 0x004A4649, 0x004B474A, 0x004C484B, 0x004D494C, 0x004E4A4D, 0x004F4B4E, 0x00504C4F, 0x00514D50, 0x00524E51, 0x00534F52, 0x00545053, 0x00555154, 0x00565255, 0x00575356, 0x00585457, 0x00595558, 0x005A5659, 0x005B575A, 0x005C585B, 0x005D595C, 0x005E5A5D, 0x005F5B5E, 0x00605C5F, 0x00615D60, 0x00625E61, 0x00635F62, 0x00646063, 0x00656164, 0x00666265, 0x00676366, 0x00686467, 0x00696568, 0x006A6669, 0x006B676A, 0x006C686B, 0x006D696C, 0x006E6A6D, 0x006F6B6E, 0x00706C6F, 0x00716D70, 0x00726E71, 0x00736F72, 0x00747073, 0x00757174, 0x00767275, 0x00777376, 0x00787477, 0x00797578, 0x007A7679, 0x007B777A, 0x007C787B, 0x007D797C, 0x007E7A7D, 0x007F7B7E, 0x00807C7F, 0x00817D80, 0x00827E81, 0x00837F82, 0x00848083, 0x00858184, 0x00868285, 0x00878386, 0x00888487, 0x00898588, 0x008A8689, 0x008B878A, 0x008C888B, 0x008D898C, 0x008E8A8D, 0x008F8B8E, 0x00908C8F, 0x00918D90, 0x00928E91, 0x00938F92, 0x00949093, 0x00959194, 0x00969295, 0x00979396, 0x00989497, 0x00999598, 0x009A9699, 0x009B979A, 0x009C989B, 0x009D999C, 0x009E9A9D, 0x009F9B9E, 0x00A09C9F, 0x00A19DA0, 0x00A29EA1, 0x00A39FA2, 0x00A4A0A3, 0x00A5A1A4, 0x00A6A2A5, 0x00A7A3A6, 0x00A8A4A7, 0x00A9A5A8, 0x00AAA6A9, 0x00ABA7AA, 0x00ACA8AB, 0x00ADA9AC, 0x00AEAAAD, 0x00AFABAE, 0x00B0ACAF, 0x00B1ADB0, 0x00B2AEB1, 0x00B3AFB2, 0x00B4B0B3, 0x00B5B1B4, 0x00B6B2B5, 0x00B7B3B6, 0x00B8B4B7, 0x00B9B5B8, 0x00BAB6B9, 0x00BBB7BA, 0x00BCB8BB, 0x00BDB9BC, 0x00BEBABD, 0x00BFBBBE, 0x00C0BCBF, 0x00C1BDC0, 0x00C2BEC1, 0x00C3BFC2, 0x00C4C0C3, 0x00C5C1C4, 0x00C6C2C5, 0x00C7C3C6, 0x00C8C4C7, 0x00C9C5C8, 0x00CAC6C9, 0x00CBC7CA, 0x00CCC8CB, 0x00CDC9CC, 0x00CECACD, 0x00CFCBCE, 0x00D0CCCF, 0x00D1CDD0, 0x00D2CED1, 0x00D3CFD2, 0x00D4D0D3, 0x00D5D1D4, 0x00D6D2D5, 0x00D7D3D6, 0x00D8D4D7, 0x00D9D5D8, 0x00DAD6D9, 0x00DBD7DA, 0x00DCD8DB, 0x00DDD9DC, 0x00DEDADD, 0x00DFDBDE, 0x00E0DCDF, 0x00E1DDE0, 0x00E2DEE1, 0x00E3DFE2, 0x00E4E0E3, 0x00E5E1E4, 0x00E6E2E5, 0x00E7E3E6, 0x00E8E4E7, 0x00E9E5E8, 0x00EAE6E9, 0x00EBE7EA, 0x00ECE8EB, 0x00EDE9EC, 0x00EEEAED, 0x00EFEBEE, 0x00F0ECEF, 0x00F1EDF0, 0x00F2EEF1, 0x00F3EFF2, 0x00F4F0F3, 0x00F5F1F4, 0x00F6F2F5, 0x00F7F3F6, 0x00F8F4F7, 0x00F9F5F8, 0x00FAF6F9, 0x00FBF7FA, 0x00FCF8FB, 0x00FDF9FC, 0x00FEFAFD, 0x00FFFBFE, 0x00FFFCFE, 0x00FFFDFE, 0x00FFFFFF }; /* REDCLOUD PLL TABLE */ typedef struct RCDFPLL { long frequency; /* 16.16 fixed point frequency */ unsigned long post_div3; /* MCP Frequency dividers and multipliers */ unsigned long pre_mul2; unsigned long pre_div2; unsigned long pll_value; /* MCP DotPLL Register Upper 32(0x0015) */ } RCDFPLLENTRY; RCDFPLLENTRY RCDF_PLLtable[] = { {0x0018EC4D, 1, 0, 0, 0x0000099E}, /* 24.9230 */ {0x00192CCC, 0, 0, 0, 0x00000037}, /* 25.1750 */ {0x001C526E, 1, 0, 0, 0x000009DA}, /* 28.3220 */ {0x001C8F5C, 1, 0, 0, 0x0000005E}, /* 28.5600 */ {0x001F8000, 1, 0, 0, 0x000002D2}, /* 31.5000 */ {0x00240000, 1, 0, 0, 0x000007E2}, /* 36.0000 */ {0x00258000, 1, 0, 0, 0x0000057A}, /* 37.5000 */ {0x0025E395, 1, 0, 0, 0x000007FA}, /* 37.8890 */ {0x00280000, 1, 0, 0, 0x0000030A}, /* 40.0000 */ {0x002B29BA, 0, 0, 0, 0x0000005F}, /* 43.1630 */ {0x002CE666, 0, 0, 0, 0x00000063}, /* 44.9000 */ {0x002DB851, 1, 0, 0, 0x00000BC9}, /* 45.7200 */ {0x00318000, 0, 0, 0, 0x0000054B}, /* 49.5000 */ {0x00320000, 0, 0, 0, 0x0000006F}, /* 50.0000 */ {0x00325999, 0, 1, 0, 0x00000037}, /* 50.3500 */ {0x00360000, 1, 1, 0, 0x00000B0D}, /* 54.0000 */ {0x00384000, 0, 0, 0, 0x000007F7}, /* 56.2500 */ {0x0038643F, 0, 0, 0, 0x000007F7}, /* 56.3916 */ {0x0038A4DD, 0, 0, 0, 0x0000057B}, /* 56.6444 */ {0x003B0000, 0, 1, 0, 0x00000707}, /* 59.0000 */ {0x003C10A3, 0, 0, 0, 0x0000030B}, /* 60.0650 */ {0x003F0000, 1, 1, 0, 0x00000B39}, /* 63.0000 */ {0x00410000, 1, 0, 0, 0x00000545}, /* 65.0000 */ {0x00442DD2, 1, 0, 0, 0x000002E1}, /* 68.1790 */ {0x00438000, 1, 1, 0, 0x00000FC1}, /* 67.5000 */ {0x0046CCCC, 1, 0, 0, 0x00000561}, /* 70.8000 */ {0x00480000, 1, 0, 0, 0x000007E1}, /* 72.0000 */ {0x004A7B22, 0, 1, 0, 0x00000F4A}, /* 74.4810 */ {0x004B0000, 1, 0, 0, 0x000007F5}, /* 75.0000 */ {0x004EC000, 1, 0, 0, 0x00000305}, /* 78.7500 */ {0x00500000, 1, 1, 0, 0x00000709}, /* 80.0000 */ {0x00519999, 0, 0, 0, 0x000009C6}, /* 81.6000 */ {0x0059CCCC, 0, 1, 0, 0x00000262}, /* 89.8000 */ {0x005E8000, 0, 0, 0, 0x000002D2}, /* 94.5000 */ {0x00618560, 0, 0, 0, 0x00000546}, /* 97.5200 */ {0x00630000, 0, 1, 0, 0x00000B4A}, /* 99.0000 */ {0x00642FDF, 0, 0, 0, 0x0000006E}, /* 100.1870 */ {0x00656B85, 0, 0, 0, 0x00000552}, /* 101.4200 */ {0x006C0000, 0, 0, 0, 0x000007E2}, /* 108.0000 */ {0x00708000, 0, 0, 0, 0x000007F6}, /* 112.5000 */ {0x00714F1A, 0, 0, 0, 0x0000057A}, /* 113.3090 */ {0x0077A666, 0, 0, 0, 0x0000030A}, /* 119.6500 */ {0x00806666, 1, 0, 0, 0x00000068}, /* 128.4000 */ {0x00820000, 1, 1, 0, 0x00000FB0}, /* 130.0000 */ {0x00821999, 1, 0, 0, 0x00000544}, /* 130.1000 */ {0x00858000, 1, 0, 0, 0x0000006C}, /* 133.5000 */ {0x00870000, 1, 0, 0, 0x00000550}, /* 135.0000 */ {0x00906147, 1, 0, 0, 0x000007E0}, /* 144.3800 */ {0x009D8000, 1, 0, 0, 0x00000304}, /* 157.5000 */ {0x00A20000, 0, 0, 0, 0x000002B1}, /* 162.0000 */ {0x00A933F7, 0, 0, 0, 0x000002B9}, /* 169.2030 */ {0x00ACCC49, 0, 1, 0, 0x0000002D}, /* 172.798 */ {0x00AF8000, 0, 0, 0, 0x000002C1}, /* 175.5000 */ {0x00BD0000, 0, 0, 0, 0x000002D1}, /* 189.0000 */ {0x00BEF5C2, 0, 0, 0, 0x0000053D}, /* 190.9600 */ {0x00C60000, 0, 0, 0, 0x00000549}, /* 198.0000 */ {0x00CA8000, 0, 0, 0, 0x00000551}, /* 202.5000 */ {0x00E58000, 0, 0, 0, 0x0000057D}, /* 229.5000 */ }; #define NUM_RCDF_FREQUENCIES sizeof(RCDF_PLLtable)/sizeof(RCDFPLLENTRY) /*--------------------------------------------------------------------------- * gfx_reset_video (PRIVATE ROUTINE: NOT PART OF DURANGO API) * * This routine is used to disable all components of video overlay before * performing a mode switch. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_reset_video(void) #else void gfx_reset_video(void) #endif { gfx_set_video_enable(0); gfx_select_alpha_region(1); gfx_set_alpha_enable(0); gfx_select_alpha_region(2); gfx_set_alpha_enable(0); /* SET REGION 0 AFTER RESET */ gfx_select_alpha_region(0); gfx_set_alpha_enable(0); } /*---------------------------------------------------------------------------- * gfx_set_display_control (PRIVATE ROUTINE: NOT PART OF DURANGO API) * * This routine configures the display output. * * "sync_polarities" is used to set the polarities of the sync pulses * according to the following mask: * * Bit 0: If set to 1, negative horizontal polarity is programmed, * otherwise positive horizontal polarity is programmed. * Bit 1: If set to 1, negative vertical polarity is programmed, * otherwise positive vertical polarity is programmed. * *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_display_control(int sync_polarities) #else int gfx_set_display_control(int sync_polarities) #endif { unsigned long power; unsigned long dcfg; /* CONFIGURE DISPLAY OUTPUT FROM VIDEO PROCESSOR */ dcfg = READ_VID32(RCDF_DISPLAY_CONFIG); dcfg &= ~(RCDF_DCFG_CRT_SYNC_SKW_MASK | RCDF_DCFG_PWR_SEQ_DLY_MASK | RCDF_DCFG_CRT_HSYNC_POL | RCDF_DCFG_CRT_VSYNC_POL | RCDF_DCFG_FP_PWR_EN | RCDF_DCFG_FP_DATA_EN); /* Don't blindly set the PAL_BYP bit - assume that somebody along * the line has set up the gamma correctly before this point */ dcfg |= (RCDF_DCFG_CRT_SYNC_SKW_INIT | RCDF_DCFG_PWR_SEQ_DLY_INIT); if (PanelEnable) { power = READ_VID32(RCDF_POWER_MANAGEMENT); power |= RCDF_PM_PANEL_POWER_ON; WRITE_VID32(RCDF_POWER_MANAGEMENT, power); } /* SET APPROPRIATE SYNC POLARITIES */ if (PanelEnable) { unsigned int pt2 = READ_VID32(0x408); pt2 &= ~((1 << 22) | (1 << 23)); WRITE_VID32(0x408, pt2); } if (sync_polarities & 0x1) dcfg |= RCDF_DCFG_CRT_HSYNC_POL; if (sync_polarities & 0x2) dcfg |= RCDF_DCFG_CRT_VSYNC_POL; WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_clock_frequency * * This routine sets the clock frequency, specified as a 16.16 fixed point * value (0x00318000 = 49.5 MHz). It will set the closest frequency found * in the lookup table. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_set_clock_frequency(unsigned long frequency) #else void gfx_set_clock_frequency(unsigned long frequency) #endif { Q_WORD msr_value, sys_value; unsigned long sys_low; unsigned int i, index = 0; unsigned long value; long timeout = 1000; long min, diff; /* FIND THE REGISTER VALUES FOR THE DESIRED FREQUENCY */ /* Search the table for the closest frequency (16.16 format). */ value = RCDF_PLLtable[0].pll_value; min = (long) RCDF_PLLtable[0].frequency - frequency; if (min < 0L) min = -min; for (i = 1; i < NUM_RCDF_FREQUENCIES; i++) { diff = (long) RCDF_PLLtable[i].frequency - frequency; if (diff < 0L) diff = -diff; if (diff < min) { min = diff; index = i; } } /* VERIFY THAT WE ARE NOT WRITING WHAT IS ALREADY IN THE REGISTERS */ /* The Dot PLL reset bit is tied to VDD for flat panels. This can */ /* cause a brief drop in flat panel power, which can cause serious */ /* glitches on some panels. */ gfx_msr_read(RC_ID_MCP, MCP_DOTPLL, &msr_value); gfx_msr_read(RC_ID_MCP, MCP_SYS_RSTPLL, &sys_value); sys_low = 0; if (RCDF_PLLtable[index].post_div3) sys_low |= MCP_DOTPOSTDIV3; if (RCDF_PLLtable[index].pre_div2) sys_low |= MCP_DOTPREDIV2; if (RCDF_PLLtable[index].pre_mul2) sys_low |= MCP_DOTPREMULT2; if ((msr_value.low & MCP_DOTPLL_LOCK) && (msr_value.high == RCDF_PLLtable[index].pll_value) && ((sys_value.low & (MCP_DOTPOSTDIV3 | MCP_DOTPREDIV2 | MCP_DOTPREMULT2)) == sys_low)) { return; } /* PROGRAM THE SETTINGS WITH THE RESET BIT SET */ /* Clear the bypass bit to ensure that the programmed */ /* M, N and P values are being used. */ msr_value.high = RCDF_PLLtable[index].pll_value; msr_value.low |= 0x00000001; msr_value.low &= ~MCP_DOTPLL_BYPASS; gfx_msr_write(RC_ID_MCP, MCP_DOTPLL, &msr_value); /* PROGRAM THE MCP DIVIDER VALUES */ sys_value.low &= ~(MCP_DOTPOSTDIV3 | MCP_DOTPREDIV2 | MCP_DOTPREMULT2); sys_value.low |= sys_low; gfx_msr_write(RC_ID_MCP, MCP_SYS_RSTPLL, &sys_value); /* CLEAR THE RESET BIT */ msr_value.low &= 0xFFFFFFFE; gfx_msr_write(RC_ID_MCP, MCP_DOTPLL, &msr_value); /* WAIT FOR LOCK BIT */ do { gfx_msr_read(RC_ID_MCP, MCP_DOTPLL, &msr_value); } while (timeout-- && !(msr_value.low & MCP_DOTPLL_LOCK)); } /*--------------------------------------------------------------------------- * gfx_set_crt_enable * * This routine enables or disables the CRT output from the video processor. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_crt_enable(int enable) #else int gfx_set_crt_enable(int enable) #endif { unsigned long config, misc; config = READ_VID32(RCDF_DISPLAY_CONFIG); misc = READ_VID32(RCDF_VID_MISC); switch (enable) { case CRT_DISABLE: /* DISABLE EVERYTHING */ WRITE_VID32(RCDF_DISPLAY_CONFIG, config & ~(RCDF_DCFG_DIS_EN | RCDF_DCFG_HSYNC_EN | RCDF_DCFG_VSYNC_EN | RCDF_DCFG_DAC_BL_EN)); WRITE_VID32(RCDF_VID_MISC, misc | RCDF_DAC_POWER_DOWN); break; case CRT_ENABLE: /* ENABLE CRT DISPLAY, INCLUDING DISPLAY LOGIC */ WRITE_VID32(RCDF_DISPLAY_CONFIG, config | RCDF_DCFG_DIS_EN | RCDF_DCFG_HSYNC_EN | RCDF_DCFG_VSYNC_EN | RCDF_DCFG_DAC_BL_EN); WRITE_VID32(RCDF_VID_MISC, misc & ~RCDF_DAC_POWER_DOWN & ~RCDF_ANALOG_POWER_DOWN); break; case CRT_STANDBY: /* HSYNC:OFF VSYNC:ON */ WRITE_VID32(RCDF_DISPLAY_CONFIG, (config & ~(RCDF_DCFG_DIS_EN | RCDF_DCFG_HSYNC_EN | RCDF_DCFG_DAC_BL_EN)) | RCDF_DCFG_VSYNC_EN); WRITE_VID32(RCDF_VID_MISC, misc | RCDF_DAC_POWER_DOWN); break; case CRT_SUSPEND: /* HSYNC:ON VSYNC:OFF */ WRITE_VID32(RCDF_DISPLAY_CONFIG, (config & ~(RCDF_DCFG_DIS_EN | RCDF_DCFG_VSYNC_EN | RCDF_DCFG_DAC_BL_EN)) | RCDF_DCFG_HSYNC_EN); WRITE_VID32(RCDF_VID_MISC, misc | RCDF_DAC_POWER_DOWN); break; default: return (GFX_STATUS_BAD_PARAMETER); } return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_set_video_enable * * This routine enables or disables the video overlay functionality. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_enable(int enable) #else int gfx_set_video_enable(int enable) #endif { unsigned long vcfg; /* WAIT FOR VERTICAL BLANK TO START */ /* Otherwise a glitch can be observed. */ if (gfx_test_timing_active()) { if (!gfx_test_vertical_active()) { while (!gfx_test_vertical_active()); } while (gfx_test_vertical_active()); } vcfg = READ_VID32(RCDF_VIDEO_CONFIG); if (enable) { /* ENABLE VIDEO OVERLAY FROM DISPLAY CONTROLLER */ /* Use private routine to abstract the display controller. */ gfx_set_display_video_enable(1); /* ENABLE DISPLAY FILTER VIDEO OVERLAY */ vcfg |= RCDF_VCFG_VID_EN; WRITE_VID32(RCDF_VIDEO_CONFIG, vcfg); } else { /* DISABLE DISPLAY FILTER VIDEO OVERLAY */ vcfg &= ~RCDF_VCFG_VID_EN; WRITE_VID32(RCDF_VIDEO_CONFIG, vcfg); /* DISABLE VIDEO OVERLAY FROM DISPLAY CONTROLLER */ /* Use private routine to abstract the display controller. */ gfx_set_display_video_enable(0); } return (0); } /*---------------------------------------------------------------------------- * gfx_set_video_format * * Sets input video format type, to one of the YUV formats or to RGB. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_format(unsigned long format) #else int gfx_set_video_format(unsigned long format) #endif { unsigned long ctrl, vcfg = 0; /* SET THE DISPLAY FILTER VIDEO INPUT FORMAT */ vcfg = READ_VID32(RCDF_VIDEO_CONFIG); ctrl = READ_VID32(RCDF_VID_ALPHA_CONTROL); ctrl &= ~(RCDF_VIDEO_INPUT_IS_RGB | RCDF_CSC_VIDEO_YUV_TO_RGB); vcfg &= ~(RCDF_VCFG_VID_INP_FORMAT | RCDF_VCFG_4_2_0_MODE); switch (format) { case VIDEO_FORMAT_UYVY: vcfg |= RCDF_VCFG_UYVY_FORMAT; ctrl |= RCDF_CSC_VIDEO_YUV_TO_RGB; break; case VIDEO_FORMAT_YUYV: vcfg |= RCDF_VCFG_YUYV_FORMAT; ctrl |= RCDF_CSC_VIDEO_YUV_TO_RGB; break; case VIDEO_FORMAT_Y2YU: vcfg |= RCDF_VCFG_Y2YU_FORMAT; ctrl |= RCDF_CSC_VIDEO_YUV_TO_RGB; break; case VIDEO_FORMAT_YVYU: vcfg |= RCDF_VCFG_YVYU_FORMAT; ctrl |= RCDF_CSC_VIDEO_YUV_TO_RGB; break; case VIDEO_FORMAT_Y0Y1Y2Y3: vcfg |= RCDF_VCFG_UYVY_FORMAT; ctrl |= RCDF_CSC_VIDEO_YUV_TO_RGB; vcfg |= RCDF_VCFG_4_2_0_MODE; break; case VIDEO_FORMAT_Y3Y2Y1Y0: vcfg |= RCDF_VCFG_Y2YU_FORMAT; ctrl |= RCDF_CSC_VIDEO_YUV_TO_RGB; vcfg |= RCDF_VCFG_4_2_0_MODE; break; case VIDEO_FORMAT_Y1Y0Y3Y2: vcfg |= RCDF_VCFG_YUYV_FORMAT; ctrl |= RCDF_CSC_VIDEO_YUV_TO_RGB; vcfg |= RCDF_VCFG_4_2_0_MODE; break; case VIDEO_FORMAT_Y1Y2Y3Y0: vcfg |= RCDF_VCFG_YVYU_FORMAT; ctrl |= RCDF_CSC_VIDEO_YUV_TO_RGB; vcfg |= RCDF_VCFG_4_2_0_MODE; break; case VIDEO_FORMAT_RGB: ctrl |= RCDF_VIDEO_INPUT_IS_RGB; vcfg |= RCDF_VCFG_UYVY_FORMAT; break; case VIDEO_FORMAT_P2M_P2L_P1M_P1L: ctrl |= RCDF_VIDEO_INPUT_IS_RGB; vcfg |= RCDF_VCFG_Y2YU_FORMAT; break; case VIDEO_FORMAT_P1M_P1L_P2M_P2L: ctrl |= RCDF_VIDEO_INPUT_IS_RGB; vcfg |= RCDF_VCFG_YUYV_FORMAT; break; case VIDEO_FORMAT_P1M_P2L_P2M_P1L: ctrl |= RCDF_VIDEO_INPUT_IS_RGB; vcfg |= RCDF_VCFG_YVYU_FORMAT; break; default: return GFX_STATUS_BAD_PARAMETER; } WRITE_VID32(RCDF_VIDEO_CONFIG, vcfg); WRITE_VID32(RCDF_VID_ALPHA_CONTROL, ctrl); /* SET THE VIDEO FORMAT IN THE DISPLAY CONTROLLER */ /* Use private routine to abstract display controller. */ gfx_set_display_video_format(format); return (0); } /*---------------------------------------------------------------------------- * gfx_set_video_size * * This routine specifies the size of the source data. It is used only * to determine how much data to transfer per frame, and is not used to * calculate the scaling value (that is handled by a separate routine). *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_size(unsigned short width, unsigned short height) #else int gfx_set_video_size(unsigned short width, unsigned short height) #endif { unsigned long size, vcfg, vid_420, pitch; /* SET THE DISPLAY FILTER VIDEO LINE SIZE */ /* Match the DC hardware alignment requirement. The line size must */ /* always be 32-byte aligned. However, we can manage smaller */ /* alignments by decreasing the pitch and clipping the video window. */ /* The VG will fetch extra data for each line, but the decreased */ /* pitch will ensure that it always begins fetching at the start of */ /* the video line. */ vcfg = READ_VID32(RCDF_VIDEO_CONFIG); vid_420 = vcfg & RCDF_VCFG_4_2_0_MODE; vcfg &= ~(RCDF_VCFG_LINE_SIZE_LOWER_MASK | RCDF_VCFG_LINE_SIZE_UPPER); size = ((width >> 1) + 7) & 0xFFF8; pitch = ((width << 1) + 7) & 0xFFF8; vcfg |= (size & 0x00FF) << 8; if (size & 0x0100) vcfg |= RCDF_VCFG_LINE_SIZE_UPPER; WRITE_VID32(RCDF_VIDEO_CONFIG, vcfg); /* SET VIDEO BUFFER LINE SIZE IN DISPLAY CONTROLLER */ /* Use private routine to abstract the display controller. */ gfx_set_display_video_size(width, height); /* SET VIDEO PITCH */ /* We are only maintaining legacy for 4:2:2 video formats. */ /* 4:2:0 video in previous chips was inadequate for most */ /* common video formats. */ if (!vid_420) gfx_set_video_yuv_pitch(pitch, pitch << 1); return (0); } /*---------------------------------------------------------------------------- * gfx_set_video_offset * * This routine sets the starting offset for the video buffer when only * one offset needs to be specified. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_offset(unsigned long offset) #else int gfx_set_video_offset(unsigned long offset) #endif { /* SAVE VALUE FOR FUTURE CLIPPING OF THE TOP OF THE VIDEO WINDOW */ gfx_vid_offset = offset; /* SET VIDEO BUFFER OFFSET IN DISPLAY CONTROLLER */ /* Use private routine to abstract the display controller. */ gfx_set_display_video_offset(offset); return (0); } /*---------------------------------------------------------------------------- * gfx_set_video_yuv_offsets * * This routine sets the starting offset for the video buffer when displaying * 4:2:0 video. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset) #else int gfx_set_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset) #endif { /* SAVE VALUE FOR FUTURE CLIPPING OF THE TOP OF THE VIDEO WINDOW */ gfx_vid_offset = yoffset; gfx_vid_uoffset = uoffset; gfx_vid_voffset = voffset; /* SET VIDEO BUFFER OFFSET IN DISPLAY CONTROLLER */ /* Use private routine to abstract the display controller. */ gfx_set_display_video_yuv_offsets(yoffset, uoffset, voffset); return (0); } /*---------------------------------------------------------------------------- * gfx_set_video_yuv_pitch * * This routine sets the byte offset between consecutive scanlines of YUV video data *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch) #else int gfx_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch) #endif { /* SET VIDEO PITCH IN DISPLAY CONTROLLER */ /* Use private routine to abstract the display controller. */ gfx_set_display_video_yuv_pitch(ypitch, uvpitch); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_scale * * This routine sets the scale factor for the video overlay window. The * size of the source and destination regions are specified in pixels. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) #else int gfx_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) #endif { unsigned long xscale, yscale; /* SAVE PARAMETERS (unless don't-care zero destination arguments are used) */ /* These are needed for clipping the video window later. */ if (dstw != 0) { gfx_vid_srcw = srcw; gfx_vid_dstw = dstw; } if (dsth != 0) { gfx_vid_srch = srch; gfx_vid_dsth = dsth; } /* CALCULATE DISPLAY FILTER SCALE FACTORS */ /* Zero width and height indicate don't care conditions */ /* Downscaling is performed in a separate function. */ if (dstw == 0) xscale = READ_VID32(RCDF_VIDEO_SCALE) & 0xffff; /* keep previous if don't-care argument */ else if (dstw <= srcw) xscale = 0x2000; /* horizontal downscaling is currently done in a separate function */ else if ((srcw == 1) || (dstw == 1)) return GFX_STATUS_BAD_PARAMETER; else xscale = (0x2000l * (srcw - 1l)) / (dstw - 1l); if (dsth == 0) yscale = (READ_VID32(RCDF_VIDEO_SCALE) & 0xffff0000) >> 16; /* keep previous if don't-care argument */ else if (dsth <= srch) yscale = 0x2000; /* vertical downscaling is handled in a separate function */ else if ((srch == 1) || (dsth == 1)) return GFX_STATUS_BAD_PARAMETER; else yscale = (0x2000l * (srch - 1l)) / (dsth - 1l); WRITE_VID32(RCDF_VIDEO_SCALE, (yscale << 16) | xscale); /* CALL ROUTINE TO UPDATE WINDOW POSITION */ /* This is required because the scale values affect the number of */ /* source data pixels that need to be clipped, as well as the */ /* amount of data that needs to be transferred. */ gfx_set_video_window(gfx_vid_xpos, gfx_vid_ypos, gfx_vid_width, gfx_vid_height); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_vertical_downscale * * This routine sets the vertical downscale factor for the video overlay * window. * The height of the source and destination regions are specified in pixels. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_vertical_downscale(unsigned short srch, unsigned short dsth) #else int gfx_set_video_vertical_downscale(unsigned short srch, unsigned short dsth) #endif { /* SET VIDEO SCALE IN DISPLAY CONTROLLER */ /* Use private routine to abstract hardware */ gfx_set_display_video_downscale(srch, dsth); return 0; } /*--------------------------------------------------------------------------- * gfx_set_video_vertical_downscale_enable * * This routine sets the vertical downscale enable for the video overlay * window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_set_video_vertical_downscale_enable(int enable) #else void gfx_set_video_vertical_downscale_enable(int enable) #endif { /* SET VIDEO SCALE IN DISPLAY CONTROLLER */ /* Use private routine to abstract hardware */ gfx_set_display_video_vertical_downscale_enable(enable); } /*--------------------------------------------------------------------------- * gfx_set_video_downscale_config * * This routine sets the downscale type and factor for the video overlay * window. * Note: No downscaling support for RGB565 and YUV420 video formats. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_downscale_config(unsigned short type, unsigned short m) #else int gfx_set_video_downscale_config(unsigned short type, unsigned short m) #endif { unsigned long downscale; if ((m < 1) || (m > 16)) return GFX_STATUS_BAD_PARAMETER; downscale = READ_VID32(RCDF_VIDEO_DOWNSCALER_CONTROL); downscale &= ~(RCDF_VIDEO_DOWNSCALE_FACTOR_MASK | RCDF_VIDEO_DOWNSCALE_TYPE_MASK); downscale |= ((unsigned long) (m - 1) << RCDF_VIDEO_DOWNSCALE_FACTOR_POS); switch (type) { case VIDEO_DOWNSCALE_KEEP_1_OF: downscale |= RCDF_VIDEO_DOWNSCALE_TYPE_A; break; case VIDEO_DOWNSCALE_DROP_1_OF: downscale |= RCDF_VIDEO_DOWNSCALE_TYPE_B; break; default: return GFX_STATUS_BAD_PARAMETER; } WRITE_VID32(RCDF_VIDEO_DOWNSCALER_CONTROL, downscale); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_downscale_coefficients * * This routine sets the downscale filter coefficients. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_downscale_coefficients(unsigned short coef1, unsigned short coef2, unsigned short coef3, unsigned short coef4) #else int gfx_set_video_downscale_coefficients(unsigned short coef1, unsigned short coef2, unsigned short coef3, unsigned short coef4) #endif { if ((coef1 + coef2 + coef3 + coef4) != 16) return GFX_STATUS_BAD_PARAMETER; WRITE_VID32(RCDF_VIDEO_DOWNSCALER_COEFFICIENTS, ((unsigned long) coef1 << RCDF_VIDEO_DOWNSCALER_COEF1_POS) | ((unsigned long) coef2 << RCDF_VIDEO_DOWNSCALER_COEF2_POS) | ((unsigned long) coef3 << RCDF_VIDEO_DOWNSCALER_COEF3_POS) | ((unsigned long) coef4 << RCDF_VIDEO_DOWNSCALER_COEF4_POS)); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_downscale_enable * * This routine enables or disables downscaling for the video overlay window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_downscale_enable(int enable) #else int gfx_set_video_downscale_enable(int enable) #endif { unsigned long downscale; downscale = READ_VID32(RCDF_VIDEO_DOWNSCALER_CONTROL); if (enable) downscale |= RCDF_VIDEO_DOWNSCALE_ENABLE; else downscale &= ~RCDF_VIDEO_DOWNSCALE_ENABLE; WRITE_VID32(RCDF_VIDEO_DOWNSCALER_CONTROL, downscale); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_window * * This routine sets the position and size of the video overlay window. The * x and y positions are specified in screen relative coordinates, and may be * negative. * The size of destination region is specified in pixels. The line size * indicates the number of bytes of source data per scanline. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_window(short x, short y, unsigned short w, unsigned short h) #else int gfx_set_video_window(short x, short y, unsigned short w, unsigned short h) #endif { unsigned long hadjust, vadjust; unsigned long xstart, ystart, xend, yend; /* SAVE PARAMETERS */ /* These are needed to call this routine if the scale value changes. */ gfx_vid_xpos = x; gfx_vid_ypos = y; gfx_vid_width = w; gfx_vid_height = h; /* GET ADJUSTMENT VALUES */ /* Use routines to abstract version of display controller. */ hadjust = gfx_get_htotal() - gfx_get_hsync_end() - 14l; vadjust = gfx_get_vtotal() - gfx_get_vsync_end() + 1l; /* LEFT CLIPPING */ if (x < 0) { gfx_set_video_left_crop((unsigned short) (-x)); xstart = hadjust; } else { gfx_set_video_left_crop(0); xstart = (unsigned long) x + hadjust; } /* HORIZONTAL END */ /* End positions in register are non-inclusive (one more than the actual * end) */ if ((x + w) < gfx_get_hactive()) xend = (unsigned long) x + (unsigned long) w + hadjust; /* RIGHT-CLIPPING */ else xend = (unsigned long) gfx_get_hactive() + hadjust; /* VERTICAL START */ ystart = (unsigned long) y + vadjust; /* VERTICAL END */ if ((y + h) < gfx_get_vactive()) yend = (unsigned long) y + (unsigned long) h + vadjust; /* BOTTOM-CLIPPING */ else yend = (unsigned long) gfx_get_vactive() + vadjust; /* SET VIDEO POSITION */ WRITE_VID32(RCDF_VIDEO_X_POS, (xend << 16) | xstart); WRITE_VID32(RCDF_VIDEO_Y_POS, (yend << 16) | ystart); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_left_crop * * This routine sets the number of pixels which will be cropped from the * beginning of each video line. The video window will begin to display only * from the pixel following the cropped pixels, and the cropped pixels * will be ignored. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_left_crop(unsigned short x) #else int gfx_set_video_left_crop(unsigned short x) #endif { unsigned long vcfg, initread; vcfg = READ_VID32(RCDF_VIDEO_CONFIG); /* CLIPPING ON LEFT */ /* Adjust initial read for scale, checking for divide by zero. Mask the * lower three bits when clipping 4:2:0 video. By masking the bits instead * of rounding up we ensure that we always clip less than or equal to the * desired number of pixels. This prevents visual artifacts from * over-clipping. We mask three bits to meet the HW requirement that 4:2:0 * clipping be 16-byte or 8-pixel aligned. * */ if (gfx_vid_dstw) { initread = (unsigned long) x *gfx_vid_srcw / gfx_vid_dstw; if (vcfg & RCDF_VCFG_4_2_0_MODE) initread &= 0xFFF8; } else initread = 0; /* SET INITIAL READ ADDRESS */ vcfg &= ~RCDF_VCFG_INIT_READ_MASK; vcfg |= (initread << 15) & RCDF_VCFG_INIT_READ_MASK; WRITE_VID32(RCDF_VIDEO_CONFIG, vcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_color_key * * This routine specifies the color key value and mask for the video overlay * hardware. To disable color key, the color and mask should both be set to * zero. The hardware uses the color key in the following equation: * * ((source data) & (color key mask)) == ((color key) & (color key mask)) * * If "graphics" is set to TRUE, the source data is graphics, and color key * is an RGB value. If "graphics" is set to FALSE, the source data is the * video, and color key is a YUV value. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_color_key(unsigned long key, unsigned long mask, int graphics) #else int gfx_set_video_color_key(unsigned long key, unsigned long mask, int graphics) #endif { unsigned long dcfg = 0; /* SET RCDF COLOR KEY VALUE */ WRITE_VID32(RCDF_VIDEO_COLOR_KEY, key); WRITE_VID32(RCDF_VIDEO_COLOR_MASK, mask); /* SELECT GRAPHICS OR VIDEO DATA TO COMPARE TO THE COLOR KEY */ dcfg = READ_VID32(RCDF_DISPLAY_CONFIG); if (graphics & 0x01) dcfg &= ~RCDF_DCFG_VG_CK; else dcfg |= RCDF_DCFG_VG_CK; WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_filter * * This routine enables or disables the video overlay filters. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_filter(int xfilter, int yfilter) #else int gfx_set_video_filter(int xfilter, int yfilter) #endif { unsigned long vcfg = 0; /* ENABLE OR DISABLE DISPLAY FILTER VIDEO OVERLAY FILTERS */ vcfg = READ_VID32(RCDF_VIDEO_CONFIG); vcfg &= ~(RCDF_VCFG_X_FILTER_EN | RCDF_VCFG_Y_FILTER_EN); if (xfilter) vcfg |= RCDF_VCFG_X_FILTER_EN; if (yfilter) vcfg |= RCDF_VCFG_Y_FILTER_EN; WRITE_VID32(RCDF_VIDEO_CONFIG, vcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_palette * * This routine loads the video hardware palette. If a NULL pointer is * specified, the palette is bypassed (for Redcloud, this means loading the * palette with identity values). *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_palette(unsigned long *palette) #else int gfx_set_video_palette(unsigned long *palette) #endif { unsigned long i, entry; unsigned long misc, dcfg; /* ENABLE THE VIDEO PALETTE */ /* Ensure that the video palette has an effect by routing video data */ /* through the palette RAM and clearing the 'Bypass Both' bit. */ dcfg = READ_VID32(RCDF_DISPLAY_CONFIG); misc = READ_VID32(RCDF_VID_MISC); dcfg |= RCDF_DCFG_GV_PAL_BYP; misc &= ~RCDF_GAMMA_BYPASS_BOTH; WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg); WRITE_VID32(RCDF_VID_MISC, misc); if (gfx_test_timing_active()) { while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); } /* LOAD REDCLOUD VIDEO PALETTE */ WRITE_VID32(RCDF_PALETTE_ADDRESS, 0); for (i = 0; i < 256; i++) { if (palette) entry = palette[i]; else entry = gfx_gamma_ram_redcloud[i]; WRITE_VID32(RCDF_PALETTE_DATA, entry); } return (0); } /*--------------------------------------------------------------------------- * gfx_set_graphics_palette * * This routine loads the video hardware palette. If a NULL pointer is * specified, the palette is bypassed (for Redcloud, this means loading the * palette with identity values). Note that this routine is identical to * gfx_set_video_palette, except that the hardware is updated to route * graphics data through the palette. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_graphics_palette(unsigned long *palette) #else int gfx_set_graphics_palette(unsigned long *palette) #endif { unsigned long i, entry; unsigned long misc, dcfg; /* ENABLE THE VIDEO PALETTE */ /* Ensure that the video palette has an effect by routing video data */ /* through the palette RAM and clearing the 'Bypass Both' bit. */ dcfg = READ_VID32(RCDF_DISPLAY_CONFIG); misc = READ_VID32(RCDF_VID_MISC); dcfg &= ~RCDF_DCFG_GV_PAL_BYP; misc &= ~RCDF_GAMMA_BYPASS_BOTH; WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg); WRITE_VID32(RCDF_VID_MISC, misc); if (gfx_test_timing_active()) { while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); } /* LOAD REDCLOUD VIDEO PALETTE */ WRITE_VID32(RCDF_PALETTE_ADDRESS, 0); for (i = 0; i < 256; i++) { if (palette) entry = palette[i]; else entry = gfx_gamma_ram_redcloud[i]; WRITE_VID32(RCDF_PALETTE_DATA, entry); } return (0); } /*--------------------------------------------------------------------------- * gfx_set_graphics_palette_entry * * This routine loads a single entry of the video hardware palette. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_graphics_palette_entry(unsigned long index, unsigned long palette) #else int gfx_set_graphics_palette_entry(unsigned long index, unsigned long palette) #endif { unsigned long dcfg, misc; if (index > 0xFF) return GFX_STATUS_BAD_PARAMETER; /* ENABLE THE VIDEO PALETTE */ /* Ensure that the video palette has an effect by routing video data */ /* through the palette RAM and clearing the 'Bypass Both' bit. */ dcfg = READ_VID32(RCDF_DISPLAY_CONFIG); misc = READ_VID32(RCDF_VID_MISC); dcfg &= ~RCDF_DCFG_GV_PAL_BYP; misc &= ~RCDF_GAMMA_BYPASS_BOTH; WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg); WRITE_VID32(RCDF_VID_MISC, misc); /* SET A SINGLE ENTRY */ WRITE_VID32(RCDF_PALETTE_ADDRESS, index); WRITE_VID32(RCDF_PALETTE_DATA, palette); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_palette_entry * * This routine loads a single entry of the video hardware palette. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_palette_entry(unsigned long index, unsigned long palette) #else int gfx_set_video_palette_entry(unsigned long index, unsigned long palette) #endif { unsigned long dcfg, misc; if (index > 0xFF) return GFX_STATUS_BAD_PARAMETER; /* ENABLE THE VIDEO PALETTE */ /* Ensure that the video palette has an effect by routing video data */ /* through the palette RAM and clearing the 'Bypass Both' bit. */ dcfg = READ_VID32(RCDF_DISPLAY_CONFIG); misc = READ_VID32(RCDF_VID_MISC); dcfg |= RCDF_DCFG_GV_PAL_BYP; misc &= ~RCDF_GAMMA_BYPASS_BOTH; WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg); WRITE_VID32(RCDF_VID_MISC, misc); /* SET A SINGLE ENTRY */ WRITE_VID32(RCDF_PALETTE_ADDRESS, index); WRITE_VID32(RCDF_PALETTE_DATA, palette); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_palette_bypass * * This routine enables/disables the pallete RAM bypass. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_palette_bypass(int enable) #else int gfx_set_video_palette_bypass(int enable) #endif { unsigned long misc; misc = READ_VID32(RCDF_VID_MISC); if (enable) misc |= RCDF_GAMMA_BYPASS_BOTH; else misc &= ~RCDF_GAMMA_BYPASS_BOTH; WRITE_VID32(RCDF_VID_MISC, misc); return 0; } /*--------------------------------------------------------------------------- * gfx_set_video_request() * * This routine sets the horizontal (pixel) and vertical (line) video request * values. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_request(short x, short y) #else int gfx_set_video_request(short x, short y) #endif { /* SET DISPLAY FILTER VIDEO REQUEST */ x += gfx_get_htotal() - gfx_get_hsync_end() - 2; y += gfx_get_vtotal() - gfx_get_vsync_end() + 1; if ((x < 0) || (x > RCDF_VIDEO_REQUEST_MASK) || (y < 0) || (y > RCDF_VIDEO_REQUEST_MASK)) return GFX_STATUS_BAD_PARAMETER; WRITE_VID32(RCDF_VIDEO_REQUEST, ((unsigned long) x << RCDF_VIDEO_X_REQUEST_POS) | ((unsigned long) y << RCDF_VIDEO_Y_REQUEST_POS)); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_cursor() * * This routine configures the video hardware cursor. * If the "mask"ed bits in the graphics pixel match "key", then either * "color1" or "color2" will be used for this pixel, according to the value of * bit number "select_color2" of the graphics pixel. * * key - 24 bit RGB value * mask - 24 bit mask * color1, color2 - RGB or YUV, depending on the current color space * conversion select_color2 - value between 0 to 23 * * To disable match, a "mask" and "key" value of 0xffffff should be set, * because the graphics pixels incoming to the video processor have maximum 16 * bits set (0xF8FCF8). * * This feature is useful for disabling alpha blending of the cursor. * Otherwise cursor image would be blurred (or completely invisible if video * alpha is maximum value). * Note: the cursor pixel replacements take place both inside and outside the * video overlay window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_cursor(unsigned long key, unsigned long mask, unsigned short select_color2, unsigned long color1, unsigned long color2) #else int gfx_set_video_cursor(unsigned long key, unsigned long mask, unsigned short select_color2, unsigned long color1, unsigned long color2) #endif { if (select_color2 > RCDF_CURSOR_COLOR_BITS) return GFX_STATUS_BAD_PARAMETER; key = (key & RCDF_COLOR_MASK) | ((unsigned long) select_color2 << RCDF_CURSOR_COLOR_KEY_OFFSET_POS); WRITE_VID32(RCDF_CURSOR_COLOR_KEY, key); WRITE_VID32(RCDF_CURSOR_COLOR_MASK, mask); WRITE_VID32(RCDF_CURSOR_COLOR_1, color1); WRITE_VID32(RCDF_CURSOR_COLOR_2, color2); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_cursor() * * This routine configures the video hardware cursor. * If the "mask"ed bits in the graphics pixel match "key", then either * "color1"or "color2" will be used for this pixel, according to the value of * bit number "select_color2" of the graphics pixel. * * key - 24 bit RGB value * mask - 24 bit mask * color1, color2 - RGB or YUV, depending on the current color space * conversion select_color2 - value between 0 to 23 * * To disable match, a "mask" and "key" value of 0xffffff should be set, * because the graphics pixels incoming to the video processor have maximum 16 * bits set (0xF8FCF8). * * This feature is useful for disabling alpha blending of the cursor. * Otherwise cursor image would be blurred (or completely invisible if video * alpha is maximum value). * Note: the cursor pixel replacements take place both inside and outside the * video overlay window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_video_cursor_enable(int enable) #else int gfx_set_video_cursor_enable(int enable) #endif { unsigned long temp = READ_VID32(RCDF_CURSOR_COLOR_KEY); if (enable) temp |= RCDF_CURSOR_COLOR_KEY_ENABLE; else temp &= ~RCDF_CURSOR_COLOR_KEY_ENABLE; WRITE_VID32(RCDF_CURSOR_COLOR_KEY, temp); return (0); } /*--------------------------------------------------------------------------- * gfx_set_alpha_enable * * This routine enables or disables the currently selected alpha region. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_alpha_enable(int enable) #else int gfx_set_alpha_enable(int enable) #endif { unsigned long address = 0, value = 0; if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); address = RCDF_ALPHA_CONTROL_1 + ((unsigned long) gfx_alpha_select << 5); value = READ_VID32(address); if (enable) value |= RCDF_ACTRL_WIN_ENABLE; else value &= ~(RCDF_ACTRL_WIN_ENABLE); WRITE_VID32(address, value); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_alpha_window * * This routine sets the size of the currently selected alpha region. * Note: "x" and "y" are signed to enable using negative values needed for * implementing workarounds of hardware issues. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_alpha_window(short x, short y, unsigned short width, unsigned short height) #else int gfx_set_alpha_window(short x, short y, unsigned short width, unsigned short height) #endif { unsigned long address = 0; /* CHECK FOR CLIPPING */ if ((x + width) > gfx_get_hactive()) width = gfx_get_hactive() - x; if ((y + height) > gfx_get_vactive()) height = gfx_get_vactive() - y; /* ADJUST POSITIONS */ x += gfx_get_htotal() - gfx_get_hsync_end() - 2; y += gfx_get_vtotal() - gfx_get_vsync_end() + 1; if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); address = RCDF_ALPHA_XPOS_1 + ((unsigned long) gfx_alpha_select << 5); /* END POSITIONS IN REGISTERS ARE NON-INCLUSIVE (ONE MORE THAN ACTUAL END) * */ WRITE_VID32(address, (unsigned long) x | ((unsigned long) (x + width) << 16)); WRITE_VID32(address + 8, (unsigned long) y | ((unsigned long) (y + height) << 16)); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_alpha_value * * This routine sets the alpha value for the currently selected alpha * region. It also specifies an increment/decrement value for fading. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_alpha_value(unsigned char alpha, char delta) #else int gfx_set_alpha_value(unsigned char alpha, char delta) #endif { unsigned long address = 0, value = 0; if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); address = RCDF_ALPHA_CONTROL_1 + ((unsigned long) gfx_alpha_select << 5); value = READ_VID32(address); value &= RCDF_ACTRL_WIN_ENABLE; /* keep only enable bit */ value |= (unsigned long) alpha; value |= (((unsigned long) delta) & 0xff) << 8; value |= RCDF_ACTRL_LOAD_ALPHA; WRITE_VID32(address, value); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_alpha_priority * * This routine sets the priority of the currently selected alpha region. * A higher value indicates a higher priority. * Note: Priority of enabled alpha windows must be different. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_alpha_priority(int priority) #else int gfx_set_alpha_priority(int priority) #endif { unsigned long pos = 0, value = 0; if (priority > 3) return (GFX_STATUS_BAD_PARAMETER); if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); value = READ_VID32(RCDF_VID_ALPHA_CONTROL); pos = 16 + (gfx_alpha_select << 1); value &= ~(0x03l << pos); value |= (unsigned long) priority << pos; WRITE_VID32(RCDF_VID_ALPHA_CONTROL, value); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_alpha_color * * This routine sets the color to be displayed inside the currently selected * alpha window when there is a color key match (when the alpha color * mechanism is enabled). * "color" is an RGB value (for RGB blending) or a YUV value (for YUV * blending). * In Interlaced YUV blending mode, Y/2 value should be used. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_alpha_color(unsigned long color) #else int gfx_set_alpha_color(unsigned long color) #endif { unsigned long address = 0; if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); address = RCDF_ALPHA_COLOR_1 + ((unsigned long) gfx_alpha_select << 5); WRITE_VID32(address, color); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_alpha_color_enable * * Enable or disable the color mechanism in the alpha window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_alpha_color_enable(int enable) #else int gfx_set_alpha_color_enable(int enable) #endif { unsigned long color; unsigned long address = 0; if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); address = RCDF_ALPHA_COLOR_1 + ((unsigned long) gfx_alpha_select << 5); color = READ_VID32(address); if (enable) color |= RCDF_ALPHA_COLOR_ENABLE; else color &= ~RCDF_ALPHA_COLOR_ENABLE; WRITE_VID32(address, color); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_no_ck_outside_alpha * * This function affects where inside the video window color key or chroma * key comparison is done: * If enable is TRUE, color/chroma key comparison is performed only inside * the enabled alpha windows. Outside the (enabled) alpha windows, only video * is displayed if color key is used, and only graphics is displayed if chroma * key is used. * If enable is FALSE, color/chroma key comparison is performed in all the * video window area. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_set_no_ck_outside_alpha(int enable) #else int gfx_set_no_ck_outside_alpha(int enable) #endif { unsigned long value; value = READ_VID32(RCDF_VID_ALPHA_CONTROL); if (enable) WRITE_VID32(RCDF_VID_ALPHA_CONTROL, value | RCDF_NO_CK_OUTSIDE_ALPHA); else WRITE_VID32(RCDF_VID_ALPHA_CONTROL, value & ~RCDF_NO_CK_OUTSIDE_ALPHA); return (0); } /*--------------------------------------------------------------------------- * gfx_get_clock_frequency * * This routine returns the current clock frequency in 16.16 format. * It reads the current register value and finds the match in the table. * If no match is found, this routine returns 0. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_get_clock_frequency(void) #else unsigned long gfx_get_clock_frequency(void) #endif { Q_WORD msr_value; unsigned int index; unsigned long value, mask = 0x00001FFF; unsigned long post_div3 = 0, pre_mult2 = 0; /* READ PLL SETTING */ gfx_msr_read(RC_ID_MCP, MCP_DOTPLL, &msr_value); value = msr_value.high & mask; /* READ DIVISOR SETTINGS */ gfx_msr_read(RC_ID_MCP, MCP_SYS_RSTPLL, &msr_value); post_div3 = (msr_value.low & MCP_DOTPOSTDIV3) ? 1 : 0; pre_mult2 = (msr_value.low & MCP_DOTPREMULT2) ? 1 : 0; /* SEARCH FOR A MATCH */ for (index = 0; index < NUM_RCDF_FREQUENCIES; index++) { if ((RCDF_PLLtable[index].pll_value & mask) == value && post_div3 == RCDF_PLLtable[index].post_div3 && pre_mult2 == RCDF_PLLtable[index].pre_mul2) return (RCDF_PLLtable[index].frequency); } return (0); } /*************************************************************/ /* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ /*************************************************************/ #if GFX_READ_ROUTINES /*--------------------------------------------------------------------------- * gfx_get_sync_polarities * * This routine returns the polarities of the sync pulses: * Bit 0: Set if negative horizontal polarity. * Bit 1: Set if negative vertical polarity. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_get_sync_polarities(void) #else int gfx_get_sync_polarities(void) #endif { int polarities = 0; if (READ_VID32(RCDF_DISPLAY_CONFIG) & RCDF_DCFG_CRT_HSYNC_POL) polarities |= 1; if (READ_VID32(RCDF_DISPLAY_CONFIG) & RCDF_DCFG_CRT_VSYNC_POL) polarities |= 2; return (polarities); } /*--------------------------------------------------------------------------- * gfx_get_video_palette_entry * * This routine returns a single palette entry. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_get_video_palette_entry(unsigned long index, unsigned long *palette) #else int gfx_get_video_palette_entry(unsigned long index, unsigned long *palette) #endif { if (index > 0xFF) return GFX_STATUS_BAD_PARAMETER; /* READ A SINGLE ENTRY */ WRITE_VID32(RCDF_PALETTE_ADDRESS, index); *palette = READ_VID32(RCDF_PALETTE_DATA); return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_get_video_enable * * This routine returns the value "one" if video overlay is currently enabled, * otherwise it returns the value "zero". *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_get_video_enable(void) #else int gfx_get_video_enable(void) #endif { if (READ_VID32(RCDF_VIDEO_CONFIG) & RCDF_VCFG_VID_EN) return (1); return (0); } /*---------------------------------------------------------------------------- * gfx_get_video_format * * This routine returns the current video overlay format. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_get_video_format(void) #else int gfx_get_video_format(void) #endif { unsigned long ctrl, vcfg; ctrl = READ_VID32(RCDF_VID_ALPHA_CONTROL); vcfg = READ_VID32(RCDF_VIDEO_CONFIG); if (ctrl & RCDF_VIDEO_INPUT_IS_RGB) { switch (vcfg & RCDF_VCFG_VID_INP_FORMAT) { case RCDF_VCFG_UYVY_FORMAT: return VIDEO_FORMAT_RGB; case RCDF_VCFG_Y2YU_FORMAT: return VIDEO_FORMAT_P2M_P2L_P1M_P1L; case RCDF_VCFG_YUYV_FORMAT: return VIDEO_FORMAT_P1M_P1L_P2M_P2L; case RCDF_VCFG_YVYU_FORMAT: return VIDEO_FORMAT_P1M_P2L_P2M_P1L; } } if (vcfg & RCDF_VCFG_4_2_0_MODE) { switch (vcfg & RCDF_VCFG_VID_INP_FORMAT) { case RCDF_VCFG_UYVY_FORMAT: return VIDEO_FORMAT_Y0Y1Y2Y3; case RCDF_VCFG_Y2YU_FORMAT: return VIDEO_FORMAT_Y3Y2Y1Y0; case RCDF_VCFG_YUYV_FORMAT: return VIDEO_FORMAT_Y1Y0Y3Y2; case RCDF_VCFG_YVYU_FORMAT: return VIDEO_FORMAT_Y1Y2Y3Y0; } } else { switch (vcfg & RCDF_VCFG_VID_INP_FORMAT) { case RCDF_VCFG_UYVY_FORMAT: return VIDEO_FORMAT_UYVY; case RCDF_VCFG_Y2YU_FORMAT: return VIDEO_FORMAT_Y2YU; case RCDF_VCFG_YUYV_FORMAT: return VIDEO_FORMAT_YUYV; case RCDF_VCFG_YVYU_FORMAT: return VIDEO_FORMAT_YVYU; } } return (GFX_STATUS_ERROR); } /*---------------------------------------------------------------------------- * gfx_get_video_src_size * * This routine returns the size of the source video overlay buffer. The * return value is (height << 16) | width. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_get_video_src_size(void) #else unsigned long gfx_get_video_src_size(void) #endif { unsigned long width, height, scale, delta; int down_enable; /* DETERMINE SOURCE WIDTH FROM THE DISPLAY FILTER VIDEO LINE SIZE */ width = (READ_VID32(RCDF_VIDEO_CONFIG) >> 7) & 0x000001FE; if (READ_VID32(RCDF_VIDEO_CONFIG) & RCDF_VCFG_LINE_SIZE_UPPER) width += 512l; /* DETERMINE SOURCE HEIGHT FROM THE DISPLAY FILTER HEIGHT AND SCALE VALUES * There is no true "source buffer size" in Redcloud. Instead, the VG * module provides video data as needed on a per-line basis. The source * buffer size is always assumed to equal the amount of required video * data. The returned height is equal to the height of the required video * buffer data (before all scaling.) * */ scale = (READ_VID32(RCDF_VIDEO_SCALE) >> 16) & 0x3FFF; height = ((READ_VID32(RCDF_VIDEO_Y_POS) >> 16) & 0x7FF) - (READ_VID32(RCDF_VIDEO_Y_POS) & 0x7FF); delta = gfx_get_video_downscale_delta(); down_enable = gfx_get_video_vertical_downscale_enable(); /* REVERSE UPSCALING */ if (height) height = ((scale * (height - 1l)) / 0x2000l) + 2l; /* REVERSE DOWNSCALING */ /* Original lines = height * (0x3FFF + delta) / 0x3FFF */ /* As this may cause rounding errors, we add 1 to the */ /* returned source size. The return value of this */ /* function could thus be off by 1. */ if (down_enable && height) height = ((height * (0x3FFFl + delta)) / 0x3FFFl) + 1; return ((height << 16) | width); } /*---------------------------------------------------------------------------- * gfx_get_video_line_size * * This routine returns the line size of the source video overlay buffer, in * pixels. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_get_video_line_size(void) #else unsigned long gfx_get_video_line_size(void) #endif { unsigned long width = 0; /* DETERMINE SOURCE WIDTH FROM THE RCDF VIDEO LINE SIZE */ width = (READ_VID32(RCDF_VIDEO_CONFIG) >> 7) & 0x000001FE; if (READ_VID32(RCDF_VIDEO_CONFIG) & RCDF_VCFG_LINE_SIZE_UPPER) width += 512l; return (width); } /*---------------------------------------------------------------------------- * gfx_get_video_xclip * * This routine returns the number of bytes clipped on the left side of a * video overlay line (skipped at beginning). *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_get_video_xclip(void) #else unsigned long gfx_get_video_xclip(void) #endif { unsigned long clip = 0; /* DETERMINE SOURCE WIDTH FROM THE RCDF VIDEO LINE SIZE */ clip = (READ_VID32(RCDF_VIDEO_CONFIG) >> 14) & 0x000007FC; return (clip); } /*---------------------------------------------------------------------------- * gfx_get_video_offset * * This routine returns the current offset for the video overlay buffer. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_get_video_offset(void) #else unsigned long gfx_get_video_offset(void) #endif { return (gfx_get_display_video_offset()); } /*---------------------------------------------------------------------------- * gfx_get_video_yuv_offsets * * This routine returns the current offsets for the video overlay buffer when in 4:2:0. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_get_video_yuv_offsets(unsigned long *yoffset, unsigned long *uoffset, unsigned long *voffset) #else void gfx_get_video_yuv_offsets(unsigned long *yoffset, unsigned long *uoffset, unsigned long *voffset) #endif { gfx_get_display_video_yuv_offsets(yoffset, uoffset, voffset); } /*---------------------------------------------------------------------------- * gfx_get_video_yuv_pitch * * This routine returns the current pitch values for the video overlay buffer. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_get_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch) #else void gfx_get_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch) #endif { gfx_get_display_video_yuv_pitch(ypitch, uvpitch); } /*--------------------------------------------------------------------------- * gfx_get_video_scale * * This routine returns the scale factor for the video overlay window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_get_video_scale(void) #else unsigned long gfx_get_video_scale(void) #endif { return (READ_VID32(RCDF_VIDEO_SCALE)); } /*--------------------------------------------------------------------------- * gfx_get_video_downscale_delta * * This routine returns the vertical downscale factor for the video overlay * window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_get_video_downscale_delta(void) #else unsigned long gfx_get_video_downscale_delta(void) #endif { /* USE PRIVATE ROUTINE TO ABSTRACT THE DIPSLAY CONTROLLER */ return (gfx_get_display_video_downscale_delta()); } /*--------------------------------------------------------------------------- * gfx_get_video_vertical_downscale_enable * * This routine returns the vertical downscale enable for the video overlay * window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_get_video_vertical_downscale_enable(void) #else int gfx_get_video_vertical_downscale_enable(void) #endif { /* USE PRIVATE ROUTINE TO ABSTRACT THE DIPSLAY CONTROLLER */ return (gfx_get_display_video_downscale_enable()); } /*--------------------------------------------------------------------------- * gfx_get_video_downscale_config * * This routine returns the current type and value of video downscaling. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_get_video_downscale_config(unsigned short *type, unsigned short *m) #else int gfx_get_video_downscale_config(unsigned short *type, unsigned short *m) #endif { unsigned long downscale; downscale = READ_VID32(RCDF_VIDEO_DOWNSCALER_CONTROL); *m = (unsigned short) ((downscale & RCDF_VIDEO_DOWNSCALE_FACTOR_MASK) >> RCDF_VIDEO_DOWNSCALE_FACTOR_POS) + 1; switch (downscale & RCDF_VIDEO_DOWNSCALE_TYPE_MASK) { case RCDF_VIDEO_DOWNSCALE_TYPE_A: *type = VIDEO_DOWNSCALE_KEEP_1_OF; break; case RCDF_VIDEO_DOWNSCALE_TYPE_B: *type = VIDEO_DOWNSCALE_DROP_1_OF; break; default: return GFX_STATUS_ERROR; break; } return (0); } /*--------------------------------------------------------------------------- * gfx_get_video_downscale_coefficients * * This routine returns the current video downscaling coefficients. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_get_video_downscale_coefficients(unsigned short *coef1, unsigned short *coef2, unsigned short *coef3, unsigned short *coef4) #else void gfx_get_video_downscale_coefficients(unsigned short *coef1, unsigned short *coef2, unsigned short *coef3, unsigned short *coef4) #endif { unsigned long coef; coef = READ_VID32(RCDF_VIDEO_DOWNSCALER_COEFFICIENTS); *coef1 = (unsigned short) ((coef >> RCDF_VIDEO_DOWNSCALER_COEF1_POS) & RCDF_VIDEO_DOWNSCALER_COEF_MASK); *coef2 = (unsigned short) ((coef >> RCDF_VIDEO_DOWNSCALER_COEF2_POS) & RCDF_VIDEO_DOWNSCALER_COEF_MASK); *coef3 = (unsigned short) ((coef >> RCDF_VIDEO_DOWNSCALER_COEF3_POS) & RCDF_VIDEO_DOWNSCALER_COEF_MASK); *coef4 = (unsigned short) ((coef >> RCDF_VIDEO_DOWNSCALER_COEF4_POS) & RCDF_VIDEO_DOWNSCALER_COEF_MASK); return; } /*--------------------------------------------------------------------------- * gfx_get_video_downscale_enable * * This routine returns 1 if video downscaling is currently enabled, * or 0 if it is currently disabled. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_get_video_downscale_enable(int *enable) #else void gfx_get_video_downscale_enable(int *enable) #endif { if (READ_VID32(RCDF_VIDEO_DOWNSCALER_CONTROL) & RCDF_VIDEO_DOWNSCALE_ENABLE) *enable = 1; else *enable = 0; return; } /*--------------------------------------------------------------------------- * gfx_get_video_dst_size * * This routine returns the size of the displayed video overlay window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_get_video_dst_size(void) #else unsigned long gfx_get_video_dst_size(void) #endif { unsigned long xsize, ysize; xsize = READ_VID32(RCDF_VIDEO_X_POS); xsize = ((xsize >> 16) & 0x7FF) - (xsize & 0x7FF); ysize = READ_VID32(RCDF_VIDEO_Y_POS); ysize = ((ysize >> 16) & 0x7FF) - (ysize & 0x7FF); return ((ysize << 16) | xsize); } /*--------------------------------------------------------------------------- * gfx_get_video_position * * This routine returns the position of the video overlay window. The * return value is (ypos << 16) | xpos. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_get_video_position(void) #else unsigned long gfx_get_video_position(void) #endif { unsigned long hadjust, vadjust; unsigned long xpos, ypos; /* READ HARDWARE POSITION */ xpos = READ_VID32(RCDF_VIDEO_X_POS) & 0x000007FF; ypos = READ_VID32(RCDF_VIDEO_Y_POS) & 0x000007FF; /* GET ADJUSTMENT VALUES */ /* Use routines to abstract version of display controller. */ hadjust = (unsigned long) gfx_get_htotal() - (unsigned long) gfx_get_hsync_end() - 14l; vadjust = (unsigned long) gfx_get_vtotal() - (unsigned long) gfx_get_vsync_end() + 1l; xpos -= hadjust; ypos -= vadjust; return ((ypos << 16) | (xpos & 0x0000FFFF)); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key * * This routine returns the current video color key value. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_get_video_color_key(void) #else unsigned long gfx_get_video_color_key(void) #endif { return (READ_VID32(RCDF_VIDEO_COLOR_KEY)); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key_mask * * This routine returns the current video color mask value. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_get_video_color_key_mask(void) #else unsigned long gfx_get_video_color_key_mask(void) #endif { return (READ_VID32(RCDF_VIDEO_COLOR_MASK)); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key_src * * This routine returns 0 for video data compare, 1 for graphics data. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_get_video_color_key_src(void) #else int gfx_get_video_color_key_src(void) #endif { if (READ_VID32(RCDF_DISPLAY_CONFIG) & RCDF_DCFG_VG_CK) return (0); return (1); } /*--------------------------------------------------------------------------- * gfx_get_video_filter * * This routine returns if the filters are currently enabled. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_get_video_filter(void) #else int gfx_get_video_filter(void) #endif { int retval = 0; if (READ_VID32(RCDF_VIDEO_CONFIG) & RCDF_VCFG_X_FILTER_EN) retval |= 1; if (READ_VID32(RCDF_VIDEO_CONFIG) & RCDF_VCFG_Y_FILTER_EN) retval |= 2; return (retval); } /*--------------------------------------------------------------------------- * gfx_get_video_request * * This routine returns the horizontal (pixel) and vertical (lines) video * request values. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_get_video_request(short *x, short *y) #else int gfx_get_video_request(short *x, short *y) #endif { unsigned long request = 0; request = (READ_VID32(RCDF_VIDEO_REQUEST)); *x = (short) ((request >> RCDF_VIDEO_X_REQUEST_POS) & RCDF_VIDEO_REQUEST_MASK); *y = (short) ((request >> RCDF_VIDEO_Y_REQUEST_POS) & RCDF_VIDEO_REQUEST_MASK); *x -= gfx_get_htotal() - gfx_get_hsync_end() - 2; *y -= gfx_get_vtotal() - gfx_get_vsync_end() + 1; return (0); } /*--------------------------------------------------------------------------- * gfx_get_video_cursor() * * This routine configures the video hardware cursor. * If the "mask"ed bits in the graphics pixel match "key", then either * "color1" or "color2" will be used for this pixel, according to the value of * the bit in offset "select_color2". *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int redcloud_get_video_cursor(unsigned long *key, unsigned long *mask, unsigned short *select_color2, unsigned long *color1, unsigned short *color2) #else int gfx_get_video_cursor(unsigned long *key, unsigned long *mask, unsigned short *select_color2, unsigned long *color1, unsigned short *color2) #endif { *select_color2 = (unsigned short) (READ_VID32(RCDF_CURSOR_COLOR_KEY) >> RCDF_CURSOR_COLOR_KEY_OFFSET_POS); *key = READ_VID32(RCDF_CURSOR_COLOR_KEY) & RCDF_COLOR_MASK; *mask = READ_VID32(RCDF_CURSOR_COLOR_MASK) & RCDF_COLOR_MASK; *color1 = READ_VID32(RCDF_CURSOR_COLOR_1) & RCDF_COLOR_MASK; *color2 = (unsigned short) (READ_VID32(RCDF_CURSOR_COLOR_2) & RCDF_COLOR_MASK); return (0); } /*--------------------------------------------------------------------------- * gfx_read_crc * * This routine returns the hardware CRC value, which is used for automated * testing. The value is like a checksum, but will change if pixels move * locations. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_read_crc(void) #else unsigned long gfx_read_crc(void) #endif { Q_WORD msr_value; unsigned long crc = 0xFFFFFFFF; /* DISABLE 32-BIT CRCS */ /* For GX1.x, this is a reserved bit, and is assumed to be a benign * access */ gfx_msr_read(RC_ID_DF, RCDF_MBD_MSR_DIAG_DF, &msr_value); msr_value.low &= ~RCDF_DIAG_32BIT_CRC; gfx_msr_write(RC_ID_DF, RCDF_MBD_MSR_DIAG_DF, &msr_value); if (gfx_test_timing_active()) { /* WAIT UNTIL ACTIVE DISPLAY */ while (!gfx_test_vertical_active()); /* RESET CRC DURING ACTIVE DISPLAY */ WRITE_VID32(RCDF_VID_CRC, 0); WRITE_VID32(RCDF_VID_CRC, 1); /* WAIT UNTIL NOT ACTIVE, THEN ACTIVE, NOT ACTIVE, THEN ACTIVE */ while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); crc = READ_VID32(RCDF_VID_CRC) >> 8; } return (crc); } /*--------------------------------------------------------------------------- * gfx_read_crc32 * * This routine returns the 32-bit hardware CRC value, which is used for * automated testing. The value is like a checksum, but will change if pixels * move locations. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_read_crc32(void) #else unsigned long gfx_read_crc32(void) #endif { Q_WORD msr_value; unsigned long crc = 0xFFFFFFFF; /* ENABLE 32-BIT CRCS */ /* For GX1.x, this is a reserved bit, and is assumed to be a benign * access */ gfx_msr_read(RC_ID_DF, RCDF_MBD_MSR_DIAG_DF, &msr_value); msr_value.low |= RCDF_DIAG_32BIT_CRC; gfx_msr_write(RC_ID_DF, RCDF_MBD_MSR_DIAG_DF, &msr_value); if (gfx_test_timing_active()) { /* WAIT UNTIL ACTIVE DISPLAY */ while (!gfx_test_vertical_active()); /* RESET CRC DURING ACTIVE DISPLAY */ WRITE_VID32(RCDF_VID_CRC, 0); WRITE_VID32(RCDF_VID_CRC, 1); /* WAIT UNTIL NOT ACTIVE, THEN ACTIVE, NOT ACTIVE, THEN ACTIVE */ while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); crc = READ_VID32(RCDF_VID_CRC32); } return (crc); } /*--------------------------------------------------------------------------- * gfx_read_window_crc * * This routine returns the hardware CRC value for a subsection of the display * This value is used to debug whole-screen CRC failures. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long redcloud_read_window_crc(int source, unsigned short x, unsigned short y, unsigned short width, unsigned short height, int crc32) #else unsigned long gfx_read_window_crc(int source, unsigned short x, unsigned short y, unsigned short width, unsigned short height, int crc32) #endif { Q_WORD msr_value; unsigned long xpos, ypos, crc = 0; unsigned long old_fmt = 0; unsigned int vsync_active_base, vsync_inactive_base, hsync_active_base; unsigned int vsync_active_shift, vsync_inactive_shift, hsync_active_shift; unsigned int vsync_bit, hsync_bit, sync_polarities = 0; /* CONFIGURE DISPLAY FILTER TO LOAD DATA ONTO LOWER 32-BITS */ msr_value.high = 0; msr_value.low = (source == CRC_SOURCE_GFX_DATA) ? (RCDF_MBD_DIAG_EN0 | 0x0000000F) : (RCDF_MBD_DIAG_EN0 | 0x0000000B); gfx_msr_write(RC_ID_DF, MBD_MSR_DIAG, &msr_value); /* CONFIGURE DISPLAY FILTER FOR APPROPRIATE OUTPUT */ if (source != CRC_SOURCE_GFX_DATA) { gfx_msr_read(RC_ID_DF, MBD_MSR_CONFIG, &msr_value); old_fmt = msr_value.low; msr_value.low &= ~(RCDF_CONFIG_FMT_MASK); msr_value.low |= ((source == CRC_SOURCE_FP_DATA) ? RCDF_CONFIG_FMT_FP : RCDF_CONFIG_FMT_CRT); gfx_msr_write(RC_ID_DF, MBD_MSR_CONFIG, &msr_value); } /* CONFIGURE MCP TO LOAD REGB DATA ONTO UPPER 32-BITS */ msr_value.low = MCP_MBD_DIAG_EN1 | 0x00050000; gfx_msr_write(RC_ID_MCP, MBD_MSR_DIAG, &msr_value); /* ENABLE HW CLOCK GATING AND SET MCP CLOCK TO DOT CLOCK */ msr_value.low = 1l; gfx_msr_write(RC_ID_MCP, MBD_MSR_PM, &msr_value); msr_value.low = 0; gfx_msr_write(RC_ID_MCP, MCP_DBGCLKCTL, &msr_value); msr_value.low = 3; gfx_msr_write(RC_ID_MCP, MCP_DBGCLKCTL, &msr_value); /* DISABLE MCP ACTIONS */ msr_value.high = 0x00000000; msr_value.low = 0x00000000; gfx_msr_write(RC_ID_MCP, MCP_DIAGCTL, &msr_value); /* SET APPROPRIATE BASE ADDRESS */ /* M-Sets use normal diag bits, while N-Sets use inverted diag bits */ /* We thus use the M-sets when polling for a high signal and the N */ /* sets when polling for a low signal. */ if (source != CRC_SOURCE_GFX_DATA) { sync_polarities = gfx_get_sync_polarities(); vsync_bit = 29; hsync_bit = 30; } else { vsync_bit = 25; hsync_bit = 26; } if (sync_polarities & 1) { hsync_active_base = MCP_SETM0CTL; hsync_active_shift = 2; } else { hsync_active_base = MCP_SETN0CTL; hsync_active_shift = 1; } if (sync_polarities & 2) { vsync_active_base = MCP_SETM0CTL; vsync_inactive_base = MCP_SETN0CTL; vsync_active_shift = 2; vsync_inactive_shift = 1; } else { vsync_active_base = MCP_SETN0CTL; vsync_inactive_base = MCP_SETM0CTL; vsync_active_shift = 1; vsync_inactive_shift = 2; } /* SET STATE TRANSITIONS */ /* STATE 0-1 TRANSITION (SET 0) */ /* XState = 00 and VSync Inactive */ /* Note: DF VSync = Diag Bus Bit 29 */ /* VG VSync = Diag Bus Bit 25 */ msr_value.low = 0x000000A0; msr_value.high = 0x00008000 | ((unsigned long) vsync_bit << 16) | ((unsigned long) vsync_bit << 21) | ((unsigned long) vsync_bit << 26); gfx_msr_write(RC_ID_MCP, vsync_inactive_base, &msr_value); /* STATE 1-2 TRANSITION (SET 4) */ /* XState = 01 and VSync Active */ msr_value.low = 0x000000C0; gfx_msr_write(RC_ID_MCP, vsync_active_base + 4, &msr_value); /* STATE 2-3 TRANSITION (SET 1) */ /* XState = 10 and VSync Inactive */ msr_value.low = 0x00000120; gfx_msr_write(RC_ID_MCP, vsync_inactive_base + 1, &msr_value); /* HORIZONTAL COUNTER (SET 5) */ /* XState = 10 and HSync Active */ /* Notes: DF HSync = Diag Bus Bit 30 */ /* VG HSync = Diag Bus Bit 26 */ msr_value.high = 0x00008000 | ((unsigned long) hsync_bit << 16) | ((unsigned long) hsync_bit << 21) | ((unsigned long) hsync_bit << 26); msr_value.low = 0x00000120; gfx_msr_write(RC_ID_MCP, hsync_active_base + 5, &msr_value); /* HORIZONTAL COUNTER RESET (SET 4) */ /* XState = 10 and H. Counter = limit */ /* Note: H. Counter is lower 16-bits of */ /* RegB. */ msr_value.high = 0x00000000; msr_value.low = 0x00000128; gfx_msr_write(RC_ID_MCP, vsync_inactive_base + 4, &msr_value); /* CRC TRIGGER (SET 0) */ /* Cmp0 <= xpos < Cmp1 */ /* Cmp2 <= ypos < Cmp2 */ msr_value.high = 0x00000000; msr_value.low = 0x10C20120; gfx_msr_write(RC_ID_MCP, vsync_active_base, &msr_value); /* SET COMPARATOR VALUES */ /* Note: The VG data outputs from the DF are delayed by one pixel clock. */ /* In this mode, we thus add one to horizontal comparator limits. */ /* COMPARATOR 0 */ /* Lower limit = xpos + (h_blank_pixels - 1) - 3 */ /* Notes: */ /* 1. 3 is the pipeline delay for MCP register */ /* data to access the diag bus */ /* 2. h_blank_pixels = HTOTAL - HSYNC_END */ xpos = (unsigned long) x + ((unsigned long) gfx_get_htotal() - (unsigned long) gfx_get_hsync_end() - 1l) - 3l; if (source == CRC_SOURCE_GFX_DATA) xpos++; msr_value.high = 0x00000000; msr_value.low = xpos; gfx_msr_write(RC_ID_MCP, MCP_CMPVAL0, &msr_value); /* COMPARATOR 1 */ /* Upper limit = xpos + width + (h_blank_pixels - 1) - 3 */ msr_value.low = xpos + (unsigned long) width; gfx_msr_write(RC_ID_MCP, MCP_CMPVAL0 + 2, &msr_value); /* COMPARATOR 2 */ /* Lower limit = ypos + v_blank_pixels */ /* Notes: */ /* 1. v_blank_pixels = VTOTAL - VSYNC_END */ ypos = (unsigned long) y + (unsigned long) gfx_get_vtotal() - (unsigned long) gfx_get_vsync_end(); msr_value.low = ypos << 16; gfx_msr_write(RC_ID_MCP, MCP_CMPVAL0 + 4, &msr_value); /* COMPARATOR 3 */ /* Upper limit = ypos + height + v_blank_pixels */ msr_value.low = (ypos + (unsigned long) height) << 16; gfx_msr_write(RC_ID_MCP, MCP_CMPVAL0 + 6, &msr_value); /* SET COMPARATOR MASKS */ /* COMPARATORS 0 AND 1 REFER TO LOWER 16 BITS OF REGB */ msr_value.high = 0x00000000; msr_value.low = 0x0000FFFF; gfx_msr_write(RC_ID_MCP, MCP_CMPMASK0, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_CMPMASK0 + 2, &msr_value); /* COMPARATORS 2 AND 3 REFER TO UPPER 16 BITS OF REGB */ msr_value.low = 0xFFFF0000; gfx_msr_write(RC_ID_MCP, MCP_CMPMASK0 + 4, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_CMPMASK0 + 6, &msr_value); /* SET REGA MASK TO CRC ONLY 24 BITS OF DATA */ msr_value.high = 0x00000000; msr_value.low = 0x00FFFFFF; gfx_msr_write(RC_ID_MCP, MCP_REGAMASK, &msr_value); /* SET REGB VALUE */ /* Lower 16 bits use HTOTAL - SYNC TIME - 1 to set the counter rollover * limit. */ /* Upper 16 bits use 0xFFFF to remove auto-clear behavior. */ msr_value.high = 0x00000000; msr_value.low = 0xFFFF0000 | ((gfx_get_htotal() - (gfx_get_hsync_end() - gfx_get_hsync_start()) - 1) & 0xFFFF); gfx_msr_write(RC_ID_MCP, MCP_REGBVAL, &msr_value); /* PROGRAM ACTIONS */ /* GOTO STATE 01 */ msr_value.high = 0x00000000; msr_value.low = 0x00000008 | (1l << vsync_inactive_shift); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 14, &msr_value); /* GOTO STATE 10 */ msr_value.low = 0x00080000 | (1l << (vsync_active_shift + 16)); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 15, &msr_value); /* GOTO STATE 11 */ msr_value.low = 0x00000080 | (1l << (vsync_inactive_shift + 4)); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 16, &msr_value); /* CLEAR REGB (COUNTERS) */ /* RegB is cleared upon transitioning to state 10 */ /* RegA is not cleared as the initial value must be 0x00000001 */ msr_value.low = 0x00080000 | (1l << (vsync_active_shift + 16)); gfx_msr_write(RC_ID_MCP, MCP_ACTION0, &msr_value); /* CRC INTO REGA */ /* INCREMENT H. COUNTER */ /* cmp0 <= xpos < cmp1 */ /* cmp2 <= ypos < cmp3 */ /* XState = 10 */ msr_value.low = 0x00000008 | (1l << vsync_active_shift) | 0x00800000 | (1l << (hsync_active_shift + 20)); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 1, &msr_value); /* INCREMENT V. COUNTER */ /* V. Counter is incremented when the H. Counter */ /* rolls over. */ msr_value.low = 0x00080000 | (1l << (vsync_inactive_shift + 16)); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 2, &msr_value); /* CLEAR ALL OTHER ACTIONS */ /* This prevents side-effects from previous accesses to the MCP */ /* debug logic. */ msr_value.low = 0x00000000; msr_value.high = 0x00000000; gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 3, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 4, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 5, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 6, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 7, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 8, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 9, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 10, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 11, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 12, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 13, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 17, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 18, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 19, &msr_value); gfx_msr_write(RC_ID_MCP, MCP_ACTION0 + 20, &msr_value); /* SET REGA CRC VALUE TO 1 OR 0 */ if (!crc32) msr_value.low = 0x00000001; gfx_msr_write(RC_ID_MCP, MCP_REGA, &msr_value); /* SET XSTATE TO 0 */ msr_value.low = 0; msr_value.high = 0; gfx_msr_write(RC_ID_MCP, MCP_XSTATE, &msr_value); /* CONFIGURE DIAG CONTROL */ /* Set all four comparators to watch the upper diag bus. */ /* Set REGA action1 to legacy CRC or 32-bit CRC. */ /* Set REGB action1 to increment lower 16 bits and clear at limit. */ /* Set REGB action2 to increment upper 16 bits. */ /* Enable all actions. */ if (crc32) msr_value.low = 0x9A820055; else msr_value.low = 0x9A840055; msr_value.high = 0x00000000; gfx_msr_write(RC_ID_MCP, MCP_DIAGCTL, &msr_value); /* DELAY TWO FRAMES */ while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); /* VERIFY THAT XSTATE = 11 */ gfx_msr_read(RC_ID_MCP, MCP_XSTATE, &msr_value); if ((msr_value.low & 3) == 3) { gfx_msr_read(RC_ID_MCP, MCP_REGA, &msr_value); crc = msr_value.low; if (!crc32) crc &= 0xFFFFFF; } /* DISABLE MCP AND DF DIAG BUS OUTPUTS */ msr_value.low = 0x00000000; msr_value.high = 0x00000000; gfx_msr_write(RC_ID_DF, MBD_MSR_DIAG, &msr_value); gfx_msr_write(RC_ID_MCP, MBD_MSR_DIAG, &msr_value); /* DISABLE MCP ACTIONS */ msr_value.high = 0x00000000; msr_value.low = 0x00000000; gfx_msr_write(RC_ID_MCP, MCP_DIAGCTL, &msr_value); /* RESTORE PREVIOUS OUTPUT FORMAT */ if (source != CRC_SOURCE_GFX_DATA) { gfx_msr_read(RC_ID_DF, MBD_MSR_CONFIG, &msr_value); msr_value.low = old_fmt; gfx_msr_write(RC_ID_DF, MBD_MSR_CONFIG, &msr_value); } return crc; } /*--------------------------------------------------------------------------- * gfx_get_alpha_enable * * This routine returns 1 if the selected alpha window is currently * enabled, or 0 if it is currently disabled. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_get_alpha_enable(int *enable) #else void gfx_get_alpha_enable(int *enable) #endif { unsigned long value = 0; *enable = 0; if (gfx_alpha_select <= 2) { value = READ_VID32(RCDF_ALPHA_CONTROL_1 + ((unsigned long) gfx_alpha_select << 5)); if (value & RCDF_ACTRL_WIN_ENABLE) *enable = 1; } return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_size * * This routine returns the size of the currently selected alpha region. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_get_alpha_size(unsigned short *x, unsigned short *y, unsigned short *width, unsigned short *height) #else void gfx_get_alpha_size(unsigned short *x, unsigned short *y, unsigned short *width, unsigned short *height) #endif { unsigned long value = 0; *x = 0; *y = 0; *width = 0; *height = 0; if (gfx_alpha_select <= 2) { value = READ_VID32(RCDF_ALPHA_XPOS_1 + ((unsigned long) gfx_alpha_select << 5)); *x = (unsigned short) (value & 0x000007FF); *width = (unsigned short) ((value >> 16) & 0x000007FF) - *x; value = READ_VID32(RCDF_ALPHA_YPOS_1 + ((unsigned long) gfx_alpha_select << 5)); *y = (unsigned short) (value & 0x000007FF); *height = (unsigned short) ((value >> 16) & 0x000007FF) - *y; } *x -= gfx_get_htotal() - gfx_get_hsync_end() - 2; *y -= gfx_get_vtotal() - gfx_get_vsync_end() + 1; return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_value * * This routine returns the alpha value and increment/decrement value of * the currently selected alpha region. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_get_alpha_value(unsigned char *alpha, char *delta) #else void gfx_get_alpha_value(unsigned char *alpha, char *delta) #endif { unsigned long value = 0; *alpha = 0; *delta = 0; if (gfx_alpha_select <= 2) { value = READ_VID32(RCDF_ALPHA_CONTROL_1 + ((unsigned long) gfx_alpha_select << 5)); *alpha = (unsigned char) (value & 0x00FF); *delta = (char) ((value >> 8) & 0x00FF); } return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_priority * * This routine returns the priority of the currently selected alpha region. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_get_alpha_priority(int *priority) #else void gfx_get_alpha_priority(int *priority) #endif { unsigned long pos = 0, value = 0; *priority = 0; if (gfx_alpha_select <= 2) { value = READ_VID32(RCDF_VID_ALPHA_CONTROL); pos = 16 + (gfx_alpha_select << 1); *priority = (int) ((value >> pos) & 3); } return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_color * * This routine returns the color register value for the currently selected * alpha region. Bit 24 is set if the color register is enabled. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void redcloud_get_alpha_color(unsigned long *color) #else void gfx_get_alpha_color(unsigned long *color) #endif { *color = 0; if (gfx_alpha_select <= 2) { *color = READ_VID32(RCDF_ALPHA_COLOR_1 + ((unsigned long) gfx_alpha_select << 5)); } return; } #endif /* GFX_READ_ROUTINES */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_vid.c0000644000175000017500000016743212654445443014762 00000000000000/* * Copyright (C) 2005 Advanced Micro Devices, Inc. All Rights Reserved. * */ /* * */ /* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to control the video overlay window. * * Video overlay routines: * * gfx_set_clock_frequency * gfx_set_crt_enable * gfx_set_video_enable * gfx_set_video_format * gfx_set_video_size * gfx_set_video_offset * gfx_set_video_yuv_offsets * gfx_set_video_yuv_pitch * gfx_set_video_scale * gfx_set_video_upscale * gfx_set_video_downscale_config * gfx_set_video_downscale_coefficients * gfx_set_video_downscale_enable * gfx_set_video_vertical_downscale * gfx_set_video_vertical_downscale_enable * gfx_set_video_window * gfx_set_video_left_crop * gfx_set_video_color_key * gfx_set_video_filter * gfx_set_video_palette * gfx_set_video_request * gfx_set_video_source * gfx_set_vbi_source * gfx_set_vbi_lines * gfx_set_vbi_total * gfx_set_video_interlaced * gfx_set_color_space_YUV * gfx_set_vertical_scaler_offset * gfx_set_top_line_in_odd * gfx_set_genlock_delay * gfx_set_genlock_enable * gfx_set_video_cursor * gfx_set_video_cursor_enable * * Alpha blending routines (SC1200 ONLY): * * gfx_select_alpha_region * gfx_set_alpha_enable * gfx_set_alpha_window * gfx_set_alpha_value * gfx_set_alpha_priority * gfx_set_alpha_color * gfx_set_alpha_color_enable * gfx_set_no_ck_outside_alpha * gfx_test_tvout_odd_field * * And the following routines if GFX_READ_ROUTINES is set: * * gfx_get_sync_polarities * gfx_get_video_enable * gfx_get_video_format * gfx_get_video_src_size * gfx_get_video_line_size * gfx_get_video_xclip * gfx_get_video_offset * gfx_get_video_yuv_offsets * gfx_get_video_yuv_pitch * gfx_get_video_scale * gfx_get_video_upscale * gfx_get_video_downscale_config * gfx_get_video_downscale_coefficients * gfx_get_video_downscale_enable * gfx_get_video_downscale_delta * gfx_get_video_vertical_downscale_enable * gfx_get_video_dst_size * gfx_get_video_position * gfx_get_video_color_key * gfx_get_video_color_key_mask * gfx_get_video_color_key_src * gfx_get_video_filter * gfx_get_video_request * gfx_get_video_source * gfx_get_vbi_source * gfx_get_vbi_lines * gfx_get_vbi_total * gfx_get_video_interlaced * gfx_get_color_space_YUV * gfx_get_vertical_scaler_offset * gfx_get_genlock_delay * gfx_get_genlock_enable * gfx_get_video_cursor * gfx_get_clock_frequency * gfx_read_crc * * Alpha blending read routines (SC1200 ONLY): * * gfx_get_alpha_enable * gfx_get_alpha_size * gfx_get_alpha_value * gfx_get_alpha_priority * gfx_get_alpha_color * */ /* STATIC VARIABLES FOR VIDEO OVERLAY CONTROL */ /* These are saved to allow these routines to do clipping. */ unsigned long gfx_vid_offset = 0; /* copy from last gfx_set_video_offset */ unsigned long gfx_vid_uoffset = 0; /* copy from last * gfx_set_video_yuv_offsets */ unsigned long gfx_vid_voffset = 0; /* copy from last * gfx_set_video_yuv_offsets */ unsigned long gfx_vid_srcw = 300; /* copy from last gfx_set_video_scale */ unsigned long gfx_vid_srch = 300; /* copy from last gfx_set_video_scale */ unsigned long gfx_vid_dstw = 300; /* copy from last gfx_set_video_scale */ unsigned long gfx_vid_dsth = 300; /* copy from last gfx_set_video_scale */ short gfx_vid_xpos = 0; /* copy from last gfx_set_video_window */ short gfx_vid_ypos = 0; /* copy from last gfx_set_video_window */ unsigned short gfx_vid_width = 0; /* copy from last gfx_set_video_window */ unsigned short gfx_vid_height = 0; /* copy from last gfx_set_video_window */ int gfx_alpha_select = 0; /* currently selected alpha region */ int gfx_set_screen_enable(int enable); /* forward declaration */ /* INCLUDE SUPPORT FOR CS5530, IF SPECIFIED. */ #if GFX_VIDEO_CS5530 #include "vid_5530.c" #endif /* INCLUDE SUPPORT FOR SC1200, IF SPECIFIED. */ #if GFX_VIDEO_SC1200 #include "vid_1200.c" #endif /* INLUDE SUPPORT FOR REDCLOUD, IF SPECIFIED. */ #if GFX_VIDEO_REDCLOUD #include "vid_rdcl.c" #endif /*--------------------------------------------------------------------------- * gfx_select_alpha_region * * This routine selects which alpha region should be used for future * updates. The SC1200, for example, has 3 alpha windows available, * so valid parameter values are 0..2. *--------------------------------------------------------------------------- */ int gfx_select_alpha_region(int region) { if (region > 2) return (GFX_STATUS_BAD_PARAMETER); gfx_alpha_select = region; return (GFX_STATUS_OK); } /* WRAPPERS IF DYNAMIC SELECTION */ /* Extra layer to call either CS5530 or SC1200 routines. */ #if GFX_VIDEO_DYNAMIC /*--------------------------------------------------------------------------- * gfx_reset_video (PRIVATE ROUTINE: NOT PART OF DURANGO API) * * This routine is used to disable all components of video overlay before * performing a mode switch. *--------------------------------------------------------------------------- */ void gfx_reset_video(void) { #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) cs5530_reset_video(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) sc1200_reset_video(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_reset_video(); #endif } /*--------------------------------------------------------------------------- * gfx_set_display_control (PRIVATE ROUTINE: NOT PART OF DURANGO API) * * This routine is used to configure the display output during a modeset *--------------------------------------------------------------------------- */ int gfx_set_display_control(int sync_polarities) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_display_control(sync_polarities); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_display_control(sync_polarities); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_display_control(sync_polarities); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_clock_frequency *---------------------------------------------------------------------------- */ void gfx_set_clock_frequency(unsigned long frequency) { #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) cs5530_set_clock_frequency(frequency); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) sc1200_set_clock_frequency(frequency); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_set_clock_frequency(frequency); #endif } /*---------------------------------------------------------------------------- * gfx_set_crt_enable *---------------------------------------------------------------------------- */ int gfx_set_crt_enable(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_crt_enable(enable); #endif #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_crt_enable(enable); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_crt_enable(enable); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_video_enable *---------------------------------------------------------------------------- */ int gfx_set_video_enable(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_video_enable(enable); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_enable(enable); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_enable(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_screen_enable (PRIVATE ROUTINE: NOT PART OF DURANGO API) * * This routine enables or disables the graphics display logic of the video * processor. *--------------------------------------------------------------------------- */ int gfx_set_screen_enable(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_screen_enable(enable); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_video_format *---------------------------------------------------------------------------- */ int gfx_set_video_format(unsigned long format) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_video_format(format); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_format(format); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_format(format); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_video_size *---------------------------------------------------------------------------- */ int gfx_set_video_size(unsigned short width, unsigned short height) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_video_size(width, height); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_size(width, height); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_size(width, height); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_video_yuv_pitch *---------------------------------------------------------------------------- */ int gfx_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_yuv_pitch(ypitch, uvpitch); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_video_offset *---------------------------------------------------------------------------- */ int gfx_set_video_offset(unsigned long offset) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_video_offset(offset); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_offset(offset); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_offset(offset); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_video_yuv_offsets *---------------------------------------------------------------------------- */ int gfx_set_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_yuv_offsets(yoffset, uoffset, voffset); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_scale *--------------------------------------------------------------------------- */ int gfx_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_video_scale(srcw, srch, dstw, dsth); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_scale(srcw, srch, dstw, dsth); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_scale(srcw, srch, dstw, dsth); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_upscale *--------------------------------------------------------------------------- */ int gfx_set_video_upscale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_upscale(srcw, srch, dstw, dsth); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_vertical_downscale *--------------------------------------------------------------------------- */ int gfx_set_video_vertical_downscale(unsigned short srch, unsigned short dsth) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_vertical_downscale(srch, dsth); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_vertical_downscale_enable *--------------------------------------------------------------------------- */ void gfx_set_video_vertical_downscale_enable(int enable) { #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_set_video_vertical_downscale_enable(enable); #endif } /*--------------------------------------------------------------------------- * gfx_set_video_downscale_config *--------------------------------------------------------------------------- */ int gfx_set_video_downscale_config(unsigned short type, unsigned short m) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_downscale_config(type, m); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_downscale_config(type, m); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_downscale_coefficients *--------------------------------------------------------------------------- */ int gfx_set_video_downscale_coefficients(unsigned short coef1, unsigned short coef2, unsigned short coef3, unsigned short coef4) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_downscale_coefficients(coef1, coef2, coef3, coef4); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_downscale_coefficients(coef1, coef2, coef3, coef4); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_downscale_enable *--------------------------------------------------------------------------- */ int gfx_set_video_downscale_enable(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_downscale_enable(enable); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_downscale_enable(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_window *--------------------------------------------------------------------------- */ int gfx_set_video_window(short x, short y, unsigned short w, unsigned short h) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_video_window(x, y, w, h); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_window(x, y, w, h); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_window(x, y, w, h); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_left_crop *--------------------------------------------------------------------------- */ int gfx_set_video_left_crop(unsigned short x) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_left_crop(x); #endif #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_video_left_crop(x); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_left_crop(x); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_color_key *--------------------------------------------------------------------------- */ int gfx_set_video_color_key(unsigned long key, unsigned long mask, int graphics) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_video_color_key(key, mask, graphics); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_color_key(key, mask, graphics); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_color_key(key, mask, graphics); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_filter *--------------------------------------------------------------------------- */ int gfx_set_video_filter(int xfilter, int yfilter) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_video_filter(xfilter, yfilter); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_filter(xfilter, yfilter); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_filter(xfilter, yfilter); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_palette *--------------------------------------------------------------------------- */ int gfx_set_video_palette(unsigned long *palette) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_video_palette(palette); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_palette(palette); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_palette(palette); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_graphics_palette *--------------------------------------------------------------------------- */ int gfx_set_graphics_palette(unsigned long *palette) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_graphics_palette(palette); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_palette_entry *--------------------------------------------------------------------------- */ int gfx_set_video_palette_entry(unsigned long index, unsigned long palette) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_set_video_palette_entry(index, palette); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_palette_entry(index, palette); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_palette_entry(index, palette); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_graphics_palette_entry *--------------------------------------------------------------------------- */ int gfx_set_graphics_palette_entry(unsigned long index, unsigned long palette) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_graphics_palette_entry(index, palette); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_palette_bypass *--------------------------------------------------------------------------- */ int gfx_set_video_palette_bypass(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_palette_bypass(enable); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_palette_bypass(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_request *--------------------------------------------------------------------------- */ int gfx_set_video_request(short x, short y) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_request(x, y); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_request(x, y); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_source *--------------------------------------------------------------------------- */ int gfx_set_video_source(VideoSourceType source) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_source(source); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_vbi_source *--------------------------------------------------------------------------- */ int gfx_set_vbi_source(VbiSourceType source) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_vbi_source(source); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_vbi_lines *--------------------------------------------------------------------------- */ int gfx_set_vbi_lines(unsigned long even, unsigned long odd) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_vbi_lines(even, odd); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_vbi_total *--------------------------------------------------------------------------- */ int gfx_set_vbi_total(unsigned long even, unsigned long odd) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_vbi_total(even, odd); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_interlaced *--------------------------------------------------------------------------- */ int gfx_set_video_interlaced(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_interlaced(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_color_space_YUV *--------------------------------------------------------------------------- */ int gfx_set_color_space_YUV(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_color_space_YUV(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_vertical_scaler_offset *--------------------------------------------------------------------------- */ int gfx_set_vertical_scaler_offset(char offset) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_vertical_scaler_offset(offset); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_top_line_in_odd *--------------------------------------------------------------------------- */ int gfx_set_top_line_in_odd(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_top_line_in_odd(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_genlock_delay *--------------------------------------------------------------------------- */ int gfx_set_genlock_delay(unsigned long delay) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_genlock_delay(delay); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_genlock_enable *--------------------------------------------------------------------------- */ int gfx_set_genlock_enable(int flags) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_genlock_enable(flags); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_cursor *--------------------------------------------------------------------------- */ int gfx_set_video_cursor(unsigned long key, unsigned long mask, unsigned short select_color2, unsigned long color1, unsigned long color2) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_video_cursor(key, mask, select_color2, color1, color2); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_cursor(key, mask, select_color2, color1, color2); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_video_cursor_enable *--------------------------------------------------------------------------- */ int gfx_set_video_cursor_enable(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_video_cursor_enable(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_alpha_enable *--------------------------------------------------------------------------- */ int gfx_set_alpha_enable(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_alpha_enable(enable); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_alpha_enable(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_alpha_window *--------------------------------------------------------------------------- */ int gfx_set_alpha_window(short x, short y, unsigned short width, unsigned short height) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_alpha_window(x, y, width, height); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_alpha_window(x, y, width, height); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_alpha_value *--------------------------------------------------------------------------- */ int gfx_set_alpha_value(unsigned char alpha, char delta) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_alpha_value(alpha, delta); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_alpha_value(alpha, delta); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_alpha_priority *--------------------------------------------------------------------------- */ int gfx_set_alpha_priority(int priority) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_alpha_priority(priority); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_alpha_priority(priority); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_alpha_color *--------------------------------------------------------------------------- */ int gfx_set_alpha_color(unsigned long color) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_alpha_color(color); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_alpha_color(color); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_alpha_color_enable *--------------------------------------------------------------------------- */ int gfx_set_alpha_color_enable(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_alpha_color_enable(enable); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_alpha_color_enable(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_no_ck_outside_alpha *--------------------------------------------------------------------------- */ int gfx_set_no_ck_outside_alpha(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_no_ck_outside_alpha(enable); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_set_no_ck_outside_alpha(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_macrovision_enable *--------------------------------------------------------------------------- */ int gfx_set_macrovision_enable(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_set_macrovision_enable(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_disable_softvga *--------------------------------------------------------------------------- */ int gfx_disable_softvga(void) { int status = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_disable_softvga(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_disable_softvga(); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_enable_softvga *--------------------------------------------------------------------------- */ int gfx_enable_softvga(void) { int status = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_enable_softvga(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_enable_softvga(); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_get_clock_frequency *--------------------------------------------------------------------------- */ unsigned long gfx_get_clock_frequency(void) { unsigned long frequency = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) frequency = cs5530_get_clock_frequency(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) frequency = sc1200_get_clock_frequency(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) frequency = redcloud_get_clock_frequency(); #endif return (frequency); } /*--------------------------------------------------------------------------- * gfx_get_max_video_width *--------------------------------------------------------------------------- */ unsigned long gfx_get_max_video_width(void) { unsigned long width = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) width = cs5530_get_max_video_width(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) width = sc1200_get_max_video_width(); #endif return (width); } /*************************************************************/ /* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ /*************************************************************/ #if GFX_READ_ROUTINES /*--------------------------------------------------------------------------- * gfx_get_vsa2_softvga_enable *--------------------------------------------------------------------------- */ int gfx_get_vsa2_softvga_enable(void) { int enable = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) enable = cs5530_get_vsa2_softvga_enable(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) enable = sc1200_get_vsa2_softvga_enable(); #endif return enable; } /*--------------------------------------------------------------------------- * gfx_get_sync_polarities *--------------------------------------------------------------------------- */ int gfx_get_sync_polarities(void) { int polarities = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) polarities = cs5530_get_sync_polarities(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) polarities = sc1200_get_sync_polarities(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) polarities = redcloud_get_sync_polarities(); #endif return (polarities); } /*--------------------------------------------------------------------------- * gfx_get_video_palette_entry *--------------------------------------------------------------------------- */ int gfx_get_video_palette_entry(unsigned long index, unsigned long *palette) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) status = cs5530_get_video_palette_entry(index, palette); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_get_video_palette_entry(index, palette); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_get_video_palette_entry(index, palette); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_get_video_enable *---------------------------------------------------------------------------- */ int gfx_get_video_enable(void) { int enable = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) enable = cs5530_get_video_enable(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) enable = sc1200_get_video_enable(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) enable = redcloud_get_video_enable(); #endif return (enable); } /*---------------------------------------------------------------------------- * gfx_get_video_format *---------------------------------------------------------------------------- */ int gfx_get_video_format(void) { int format = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) format = cs5530_get_video_format(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) format = sc1200_get_video_format(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) format = redcloud_get_video_format(); #endif return (format); } /*---------------------------------------------------------------------------- * gfx_get_video_src_size *---------------------------------------------------------------------------- */ unsigned long gfx_get_video_src_size(void) { unsigned long size = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) size = cs5530_get_video_src_size(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) size = sc1200_get_video_src_size(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) size = redcloud_get_video_src_size(); #endif return (size); } /*---------------------------------------------------------------------------- * gfx_get_video_line_size *---------------------------------------------------------------------------- */ unsigned long gfx_get_video_line_size(void) { unsigned long size = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) size = cs5530_get_video_line_size(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) size = sc1200_get_video_line_size(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) size = redcloud_get_video_line_size(); #endif return (size); } /*---------------------------------------------------------------------------- * gfx_get_video_xclip *---------------------------------------------------------------------------- */ unsigned long gfx_get_video_xclip(void) { unsigned long size = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) size = cs5530_get_video_xclip(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) size = sc1200_get_video_xclip(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) size = redcloud_get_video_xclip(); #endif return (size); } /*---------------------------------------------------------------------------- * gfx_get_video_offset *---------------------------------------------------------------------------- */ unsigned long gfx_get_video_offset(void) { unsigned long offset = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) offset = cs5530_get_video_offset(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) offset = sc1200_get_video_offset(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) offset = redcloud_get_video_offset(); #endif return (offset); } /*---------------------------------------------------------------------------- * gfx_get_video_yuv_offsets *---------------------------------------------------------------------------- */ void gfx_get_video_yuv_offsets(unsigned long *yoffset, unsigned long *uoffset, unsigned long *voffset) { #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_get_video_yuv_offsets(yoffset, uoffset, voffset); #endif } /*---------------------------------------------------------------------------- * gfx_get_video_yuv_pitch *---------------------------------------------------------------------------- */ void gfx_get_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch) { #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_get_video_yuv_pitch(ypitch, uvpitch); #endif } /*--------------------------------------------------------------------------- * gfx_get_video_upscale *--------------------------------------------------------------------------- */ unsigned long gfx_get_video_upscale(void) { unsigned long scale = 0; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) scale = sc1200_get_video_upscale(); #endif return (scale); } /*--------------------------------------------------------------------------- * gfx_get_video_scale *--------------------------------------------------------------------------- */ unsigned long gfx_get_video_scale(void) { unsigned long scale = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) scale = cs5530_get_video_scale(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) scale = sc1200_get_video_scale(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) scale = redcloud_get_video_scale(); #endif return (scale); } /*--------------------------------------------------------------------------- * gfx_get_video_downscale_delta *--------------------------------------------------------------------------- */ unsigned long gfx_get_video_downscale_delta(void) { unsigned long delta = 0; #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) delta = redcloud_get_video_downscale_delta(); #endif return (delta); } /*--------------------------------------------------------------------------- * gfx_get_video_vertical_downscale_enable *--------------------------------------------------------------------------- */ int gfx_get_video_vertical_downscale_enable(void) { int enable = 0; #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) enable = redcloud_get_video_vertical_downscale_enable(); #endif return (enable); } /*--------------------------------------------------------------------------- * gfx_get_video_downscale_config *--------------------------------------------------------------------------- */ int gfx_get_video_downscale_config(unsigned short *type, unsigned short *m) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_get_video_downscale_config(type, m); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_get_video_downscale_config(type, m); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_get_video_downscale_coefficients *--------------------------------------------------------------------------- */ void gfx_get_video_downscale_coefficients(unsigned short *coef1, unsigned short *coef2, unsigned short *coef3, unsigned short *coef4) { #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) sc1200_get_video_downscale_coefficients(coef1, coef2, coef3, coef4); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_get_video_downscale_coefficients(coef1, coef2, coef3, coef4); #endif } /*--------------------------------------------------------------------------- * gfx_get_video_downscale_enable *--------------------------------------------------------------------------- */ void gfx_get_video_downscale_enable(int *enable) { #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) sc1200_get_video_downscale_enable(enable); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_get_video_downscale_enable(enable); #endif } /*--------------------------------------------------------------------------- * gfx_get_video_dst_size *--------------------------------------------------------------------------- */ unsigned long gfx_get_video_dst_size(void) { unsigned long size = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) size = cs5530_get_video_dst_size(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) size = sc1200_get_video_dst_size(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) size = redcloud_get_video_dst_size(); #endif return (size); } /*--------------------------------------------------------------------------- * gfx_get_video_position *--------------------------------------------------------------------------- */ unsigned long gfx_get_video_position(void) { unsigned long position = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) position = cs5530_get_video_position(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) position = sc1200_get_video_position(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) position = redcloud_get_video_position(); #endif return (position); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key *--------------------------------------------------------------------------- */ unsigned long gfx_get_video_color_key(void) { unsigned long key = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) key = cs5530_get_video_color_key(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) key = sc1200_get_video_color_key(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) key = redcloud_get_video_color_key(); #endif return (key); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key_mask *--------------------------------------------------------------------------- */ unsigned long gfx_get_video_color_key_mask(void) { unsigned long mask = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) mask = cs5530_get_video_color_key_mask(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) mask = sc1200_get_video_color_key_mask(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) mask = redcloud_get_video_color_key_mask(); #endif return (mask); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key_src *--------------------------------------------------------------------------- */ int gfx_get_video_color_key_src(void) { int src = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) src = cs5530_get_video_color_key_src(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) src = sc1200_get_video_color_key_src(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) src = redcloud_get_video_color_key_src(); #endif return (src); } /*--------------------------------------------------------------------------- * gfx_get_video_filter *--------------------------------------------------------------------------- */ int gfx_get_video_filter(void) { int filter = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) filter = cs5530_get_video_filter(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) filter = sc1200_get_video_filter(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) filter = redcloud_get_video_filter(); #endif return (filter); } /*--------------------------------------------------------------------------- * gfx_get_video_request *--------------------------------------------------------------------------- */ int gfx_get_video_request(short *x, short *y) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_get_video_request(x, y); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) status = redcloud_get_video_request(x, y); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_get_video_source *--------------------------------------------------------------------------- */ int gfx_get_video_source(VideoSourceType * source) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_get_video_source(source); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_get_vbi_source *--------------------------------------------------------------------------- */ int gfx_get_vbi_source(VbiSourceType * source) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_get_vbi_source(source); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_get_vbi_lines *--------------------------------------------------------------------------- */ unsigned long gfx_get_vbi_lines(int odd) { unsigned long lines = (unsigned long) GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) lines = sc1200_get_vbi_lines(odd); #endif return (lines); } /*--------------------------------------------------------------------------- * gfx_get_vbi_total *--------------------------------------------------------------------------- */ unsigned long gfx_get_vbi_total(int odd) { unsigned long total = (unsigned long) GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) total = sc1200_get_vbi_total(odd); #endif return (total); } /*--------------------------------------------------------------------------- * gfx_get_video_interlaced *--------------------------------------------------------------------------- */ int gfx_get_video_interlaced(void) { int interlaced = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) interlaced = sc1200_get_video_interlaced(); #endif return (interlaced); } /*--------------------------------------------------------------------------- * gfx_get_color_space_YUV *--------------------------------------------------------------------------- */ int gfx_get_color_space_YUV(void) { int color_space = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) color_space = sc1200_get_color_space_YUV(); #endif return (color_space); } /*--------------------------------------------------------------------------- * gfx_get_vertical_scaler_offset *--------------------------------------------------------------------------- */ int gfx_get_vertical_scaler_offset(char *offset) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) status = sc1200_get_vertical_scaler_offset(offset); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_get_genlock_delay *--------------------------------------------------------------------------- */ unsigned long gfx_get_genlock_delay(void) { unsigned long delay = (unsigned long) GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) delay = sc1200_get_genlock_delay(); #endif return (delay); } /*--------------------------------------------------------------------------- * gfx_get_genlock_enable *--------------------------------------------------------------------------- */ int gfx_get_genlock_enable(void) { int enable = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) enable = sc1200_get_genlock_enable(); #endif return (enable); } /*--------------------------------------------------------------------------- * gfx_get_video_cursor *--------------------------------------------------------------------------- */ int gfx_get_video_cursor(unsigned long *key, unsigned long *mask, unsigned short *select_color2, unsigned long *color1, unsigned short *color2) { int enable = GFX_STATUS_UNSUPPORTED; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) enable = sc1200_get_video_cursor(key, mask, select_color2, color1, color2); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) enable = redcloud_get_video_cursor(key, mask, select_color2, color1, color2); #endif return (enable); } /*--------------------------------------------------------------------------- * gfx_read_crc *--------------------------------------------------------------------------- */ unsigned long gfx_read_crc(void) { unsigned long crc = 0; #if GFX_VIDEO_CS5530 if (gfx_video_type == GFX_VIDEO_TYPE_CS5530) crc = cs5530_read_crc(); #endif #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) crc = sc1200_read_crc(); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) crc = redcloud_read_crc(); #endif return (crc); } /*--------------------------------------------------------------------------- * gfx_read_crc32 *--------------------------------------------------------------------------- */ unsigned long gfx_read_crc32(void) { unsigned long crc = 0; #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) crc = redcloud_read_crc32(); #endif return (crc); } /*--------------------------------------------------------------------------- * gfx_read_window_crc *--------------------------------------------------------------------------- */ unsigned long gfx_read_window_crc(int source, unsigned short x, unsigned short y, unsigned short width, unsigned short height, int crc32) { unsigned long crc = 0; #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) crc = redcloud_read_window_crc(source, x, y, width, height, crc32); #endif return (crc); } /*----------------------------------------------------------------------------- * gfx_get_macrovision_enable *----------------------------------------------------------------------------- */ int gfx_get_macrovision_enable(void) { int enable = 0; #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) enable = sc1200_get_video_enable(); #endif return (enable); } /*--------------------------------------------------------------------------- * gfx_get_alpha_enable *--------------------------------------------------------------------------- */ void gfx_get_alpha_enable(int *enable) { #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) sc1200_get_alpha_enable(enable); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_get_alpha_enable(enable); #endif return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_size *--------------------------------------------------------------------------- */ void gfx_get_alpha_size(unsigned short *x, unsigned short *y, unsigned short *width, unsigned short *height) { #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) sc1200_get_alpha_size(x, y, width, height); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_get_alpha_size(x, y, width, height); #endif return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_value *--------------------------------------------------------------------------- */ void gfx_get_alpha_value(unsigned char *alpha, char *delta) { #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) sc1200_get_alpha_value(alpha, delta); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_get_alpha_value(alpha, delta); #endif return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_priority *--------------------------------------------------------------------------- */ void gfx_get_alpha_priority(int *priority) { #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) sc1200_get_alpha_priority(priority); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_get_alpha_priority(priority); #endif return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_color *--------------------------------------------------------------------------- */ void gfx_get_alpha_color(unsigned long *color) { #if GFX_VIDEO_SC1200 if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) sc1200_get_alpha_color(color); #endif #if GFX_VIDEO_REDCLOUD if (gfx_video_type == GFX_VIDEO_TYPE_REDCLOUD) redcloud_get_alpha_color(color); #endif return; } #endif /* GFX_READ_ROUTINES */ #endif /* GFX_VIDEO_DYNAMIC */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_rndr.c0000644000175000017500000005363412654445443015143 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to program the 2D acceleration hardware: * * gfx_set_bpp * gfx_set_solid_pattern * gfx_set_mono_pattern * gfx_set_color_pattern * gfx_load_color_pattern_line * gfx_set_solid_source * gfx_set_mono_source * gfx_set_raster_operation * gfx_pattern_fill * gfx_color_pattern_fill * gfx_screen_to_screen_blt * gfx_screen_to_screen_xblt * gfx_color_bitmap_to_screen_blt * gfx_color_bitmap_to_screen_xblt * gfx_mono_bitmap_to_screen_blt * gfx_bresenham_line * gfx_wait_until_idle * */ /* STATIC VARIABLES */ unsigned short GFXbpp = 16; unsigned short GFXbb0Base = 0x400; unsigned short GFXbb1Base = 0x930; unsigned short GFXbufferWidthPixels = 400; unsigned short GFXpatternFlags = 0; unsigned short GFXsourceFlags = 0; unsigned long GFXsavedColor = 0; unsigned short GFXsavedRop = 0; unsigned short GFXusesDstData = 0; /* INCLUDE SUPPORT FOR FIRST GENERATION, IF SPECIFIED. */ #if GFX_2DACCEL_GU1 #include "rndr_gu1.c" #endif /* INCLUDE SUPPORT FOR SECOND GENERATION, IF SPECIFIED. */ #if GFX_2DACCEL_GU2 #include "rndr_gu2.c" #endif /* WRAPPERS IF DYNAMIC SELECTION */ /* Extra layer to call either first or second generation routines. */ #if GFX_2DACCEL_DYNAMIC /*--------------------------------------------------------------------------- * gfx_reset_pitch (PRIVATE ROUTINE - NOT PART OF API) *--------------------------------------------------------------------------- */ void gfx_reset_pitch(unsigned short pitch) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_reset_pitch(pitch); #endif } /*--------------------------------------------------------------------------- * gfx_set_bpp *--------------------------------------------------------------------------- */ void gfx_set_bpp(unsigned short bpp) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_set_bpp(bpp); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_set_bpp(bpp); #endif } /*--------------------------------------------------------------------------- * gfx_set_solid_source *--------------------------------------------------------------------------- */ void gfx_set_solid_source(unsigned long color) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_set_solid_source(color); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_set_solid_source(color); #endif } /*--------------------------------------------------------------------------- * gfx_set_mono_source *--------------------------------------------------------------------------- */ void gfx_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, unsigned short transparent) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_set_mono_source(bgcolor, fgcolor, transparent); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_set_mono_source(bgcolor, fgcolor, transparent); #endif } void gfx_set_pattern_flags(unsigned short flags) { GFXpatternFlags |= flags; } /*--------------------------------------------------------------------------- * gfx_set_solid_pattern *--------------------------------------------------------------------------- */ void gfx_set_solid_pattern(unsigned long color) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_set_solid_pattern(color); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_set_solid_pattern(color); #endif } /*--------------------------------------------------------------------------- * gfx_set_mono_pattern *--------------------------------------------------------------------------- */ void gfx_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned char transparent) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_set_mono_pattern(bgcolor, fgcolor, data0, data1, transparent); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_set_mono_pattern(bgcolor, fgcolor, data0, data1, transparent); #endif } /*--------------------------------------------------------------------------- * gfx_set_color_pattern *--------------------------------------------------------------------------- */ void gfx_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned long data2, unsigned long data3, unsigned char transparent) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_set_color_pattern(bgcolor, fgcolor, data0, data1, data2, data3, transparent); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_set_color_pattern(bgcolor, fgcolor, data0, data1, data2, data3, transparent); #endif } /*--------------------------------------------------------------------------- * gfx_load_color_pattern_line *--------------------------------------------------------------------------- */ void gfx_load_color_pattern_line(short y, unsigned long *pattern_8x8) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_load_color_pattern_line(y, pattern_8x8); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_load_color_pattern_line(y, pattern_8x8); #endif } /*--------------------------------------------------------------------------- * gfx_set_raster_operation *--------------------------------------------------------------------------- */ void gfx_set_raster_operation(unsigned char rop) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_set_raster_operation(rop); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_set_raster_operation(rop); #endif } /*--------------------------------------------------------------------------- * gfx_pattern_fill *--------------------------------------------------------------------------- */ void gfx_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_pattern_fill(x, y, width, height); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_pattern_fill(x, y, width, height); #endif } /*--------------------------------------------------------------------------- * gfx_color_pattern_fill *--------------------------------------------------------------------------- */ void gfx_color_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long *pattern) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_color_pattern_fill(x, y, width, height, pattern); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_color_pattern_fill(x, y, width, height, pattern); #endif } /*--------------------------------------------------------------------------- * gfx_screen_to_screen_blt *--------------------------------------------------------------------------- */ void gfx_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_screen_to_screen_blt(srcx, srcy, dstx, dsty, width, height); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_screen_to_screen_blt(srcx, srcy, dstx, dsty, width, height); #endif } /*--------------------------------------------------------------------------- * gfx_screen_to_screen_xblt *--------------------------------------------------------------------------- */ void gfx_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long color) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_screen_to_screen_xblt(srcx, srcy, dstx, dsty, width, height, color); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_screen_to_screen_xblt(srcx, srcy, dstx, dsty, width, height, color); #endif } /*--------------------------------------------------------------------------- * gfx_color_bitmap_to_screen_blt *--------------------------------------------------------------------------- */ void gfx_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_color_bitmap_to_screen_blt(srcx, srcy, dstx, dsty, width, height, data, pitch); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_color_bitmap_to_screen_blt(srcx, srcy, dstx, dsty, width, height, data, pitch); #endif } /*--------------------------------------------------------------------------- * gfx_color_bitmap_to_screen_xblt *--------------------------------------------------------------------------- */ void gfx_color_bitmap_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch, unsigned long color) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_color_bitmap_to_screen_xblt(srcx, srcy, dstx, dsty, width, height, data, pitch, color); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_color_bitmap_to_screen_xblt(srcx, srcy, dstx, dsty, width, height, data, pitch, color); #endif } /*--------------------------------------------------------------------------- * gfx_mono_bitmap_to_screen_blt *--------------------------------------------------------------------------- */ void gfx_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, short pitch) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_mono_bitmap_to_screen_blt(srcx, srcy, dstx, dsty, width, height, data, pitch); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_mono_bitmap_to_screen_blt(srcx, srcy, dstx, dsty, width, height, data, pitch); #endif } /*--------------------------------------------------------------------------- * gfx_text_blt *--------------------------------------------------------------------------- */ void gfx_text_blt(unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_text_blt(dstx, dsty, width, height, data); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_text_blt(dstx, dsty, width, height, data); #endif } /*--------------------------------------------------------------------------- * gfx_bresenham_line *--------------------------------------------------------------------------- */ void gfx_bresenham_line(unsigned short x, unsigned short y, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_bresenham_line(x, y, length, initerr, axialerr, diagerr, flags); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_bresenham_line(x, y, length, initerr, axialerr, diagerr, flags); #endif } /*--------------------------------------------------------------------------- * gfx_wait_until_idle *--------------------------------------------------------------------------- */ void gfx_wait_until_idle(void) { #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) gu1_wait_until_idle(); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu2_wait_until_idle(); #endif } /*--------------------------------------------------------------------------- * gfx_test_blt_pending *--------------------------------------------------------------------------- */ int gfx_test_blt_pending(void) { int retval = 0; #if GFX_2DACCEL_GU1 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU1) retval = gu1_test_blt_pending(); #endif #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) retval = gu2_test_blt_pending(); #endif return (retval); } /*--------------------------------------------------------------------------- * NEW ROUTINES FOR REDCLOUD *--------------------------------------------------------------------------- */ /*--------------------------------------------------------------------------- * gfx2_set_source_stride *--------------------------------------------------------------------------- */ void gfx2_set_source_stride(unsigned short stride) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_set_source_stride(stride); #endif } /*--------------------------------------------------------------------------- * gfx2_set_destination_stride *--------------------------------------------------------------------------- */ void gfx2_set_destination_stride(unsigned short stride) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_set_destination_stride(stride); #endif } /*--------------------------------------------------------------------------- * gfx2_set_pattern_origin *--------------------------------------------------------------------------- */ void gfx2_set_pattern_origin(int x, int y) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_set_pattern_origin(x, y); #endif } /*--------------------------------------------------------------------------- * gfx2_set_source_transparency *--------------------------------------------------------------------------- */ void gfx2_set_source_transparency(unsigned long color, unsigned long mask) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_set_source_transparency(color, mask); #endif } /*--------------------------------------------------------------------------- * gfx2_set_alpha_mode *--------------------------------------------------------------------------- */ void gfx2_set_alpha_mode(int mode) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_set_alpha_mode(mode); #endif } /*--------------------------------------------------------------------------- * gfx2_set_alpha_value *--------------------------------------------------------------------------- */ void gfx2_set_alpha_value(unsigned char value) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_set_alpha_value(value); #endif } /*--------------------------------------------------------------------------- * gfx2_pattern_fill *--------------------------------------------------------------------------- */ void gfx2_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_pattern_fill(dstoffset, width, height); #endif } /*--------------------------------------------------------------------------- * gfx2_color_pattern_fill *--------------------------------------------------------------------------- */ void gfx2_color_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned long *pattern) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_color_pattern_fill(dstoffset, width, height, pattern); #endif } /*--------------------------------------------------------------------------- * gfx2_screen_to_screen_blt *--------------------------------------------------------------------------- */ void gfx2_screen_to_screen_blt(unsigned long srcoffset, unsigned long dstoffset, unsigned short width, unsigned short height, int flags) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_screen_to_screen_blt(srcoffset, dstoffset, width, height, flags); #endif } /*--------------------------------------------------------------------------- * gfx2_mono_expand_blt *--------------------------------------------------------------------------- */ void gfx2_mono_expand_blt(unsigned long srcbase, unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, int byte_packed) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_mono_expand_blt(srcbase, srcx, srcy, dstoffset, width, height, byte_packed); #endif } /*--------------------------------------------------------------------------- * gfx2_color_bitmap_to_screen_blt *--------------------------------------------------------------------------- */ void gfx2_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, short pitch) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_color_bitmap_to_screen_blt(srcx, srcy, dstoffset, width, height, data, pitch); #endif } /*--------------------------------------------------------------------------- * gfx2_text_blt *--------------------------------------------------------------------------- */ void gfx2_text_blt(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_text_blt(dstoffset, width, height, data); #endif } /*--------------------------------------------------------------------------- * gfx2_mono_bitmap_to_screen_blt *--------------------------------------------------------------------------- */ void gfx2_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, short pitch) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_mono_bitmap_to_screen_blt(srcx, srcy, dstoffset, width, height, data, pitch); #endif } /*--------------------------------------------------------------------------- * gfx2_bresenham_line *--------------------------------------------------------------------------- */ void gfx2_bresenham_line(unsigned long dstoffset, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_bresenham_line(dstoffset, length, initerr, axialerr, diagerr, flags); #endif } /*--------------------------------------------------------------------------- * gfx2_sync_to_vblank *--------------------------------------------------------------------------- */ void gfx2_sync_to_vblank(void) { #if GFX_2DACCEL_GU2 if (gfx_2daccel_type & GFX_2DACCEL_TYPE_GU2) gu22_sync_to_vblank(); #endif } #endif /* GFX_2DACCEL_DYNAMIC */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_priv.h0000644000175000017500000013325712654445443015163 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This header file contains the prototypes for local and private routines. * */ /*---------------------------------*/ /* FIRST GENERATION INITIALIZATION */ /*---------------------------------*/ #if GFX_INIT_GU1 /* PRIVATE ROUTINES */ unsigned char gfx_gxm_config_read(unsigned char index); /* DYNAMIC ROUTINES */ #if GFX_INIT_DYNAMIC unsigned long gu1_get_core_freq(void); unsigned long gu1_get_cpu_register_base(void); unsigned long gu1_get_graphics_register_base(void); unsigned long gu1_get_frame_buffer_base(void); unsigned long gu1_get_frame_buffer_size(void); unsigned long gu1_get_vid_register_base(void); unsigned long gu1_get_vip_register_base(void); #endif #endif /*----------------------------------*/ /* SECOND GENERATION INITIALIZATION */ /*----------------------------------*/ #if GFX_INIT_GU2 /* DYNAMIC ROUTINES */ #if GFX_INIT_DYNAMIC unsigned long gu2_get_core_freq(void); unsigned long gu2_get_cpu_register_base(void); unsigned long gu2_get_graphics_register_base(void); unsigned long gu2_get_frame_buffer_base(void); unsigned long gu2_get_frame_buffer_size(void); unsigned long gu2_get_vid_register_base(void); unsigned long gu2_get_vip_register_base(void); #endif #endif /*----------------------------------*/ /* MSR ROUTINES */ /*----------------------------------*/ #if GFX_MSR_REDCLOUD /* PRIVATE ROUTINES */ void redcloud_build_mbus_tree(void); int redcloud_init_msr_devices(MSR aDev[], unsigned int array_size); DEV_STATUS redcloud_find_msr_device(MSR * pDev); /* DYNAMIC ROUTINES */ #if GFX_MSR_DYNAMIC int redcloud_msr_init(void); DEV_STATUS redcloud_id_msr_device(MSR * pDev, unsigned long address); DEV_STATUS redcloud_get_msr_dev_address(unsigned int device, unsigned long *address); DEV_STATUS redcloud_get_glink_id_at_address(unsigned int *device, unsigned long address); DEV_STATUS redcloud_msr_read(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue); DEV_STATUS redcloud_msr_write(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue); #endif #endif void gfx_set_display_video_enable(int enable); void gfx_set_display_video_size(unsigned short width, unsigned short height); void gfx_set_display_video_offset(unsigned long offset); unsigned long gfx_get_display_video_offset(void); unsigned long gfx_get_display_video_size(void); /*----------------------------------*/ /* FIRST GENERATION DISPLAY */ /*----------------------------------*/ #if GFX_DISPLAY_GU1 /* PRIVATE ROUTINES */ void gu1_enable_compression(void); void gu1_disable_compression(void); void gu1_delay_approximate(unsigned long milliseconds); void gu1_delay_precise(unsigned long milliseconds); /* DYNAMIC ROUTINES */ #if GFX_DISPLAY_DYNAMIC void gu1_set_display_video_enable(int enable); void gu1_set_display_video_size(unsigned short width, unsigned short height); void gu1_set_display_video_offset(unsigned long offset); unsigned long gu1_get_display_video_offset(void); unsigned long gu1_get_display_video_size(void); int gu1_set_display_bpp(unsigned short bpp); int gu1_is_display_mode_supported(int xres, int yres, int bpp, int hz); int gu1_set_display_mode(int xres, int yres, int bpp, int hz); int gu1_set_display_timings(unsigned short bpp, unsigned short flags, unsigned short hactive, unsigned short hblank_start, unsigned short hsync_start, unsigned short hsync_end, unsigned short hblank_end, unsigned short htotal, unsigned short vactive, unsigned short vblank_start, unsigned short vsync_start, unsigned short vsync_end, unsigned short vblank_end, unsigned short vtotal, unsigned long frequency); int gu1_set_vtotal(unsigned short vtotal); void gu1_set_display_pitch(unsigned short pitch); void gu1_set_display_offset(unsigned long offset); int gu1_set_display_palette_entry(unsigned long index, unsigned long palette); int gu1_set_display_palette(unsigned long *palette); void gu1_video_shutdown(void); void gu1_set_cursor_enable(int enable); void gu1_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor); void gu1_set_cursor_position(unsigned long memoffset, unsigned short xpos, unsigned short ypos, unsigned short xhotspot, unsigned short yhotspot); void gu1_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask); int gu1_set_compression_enable(int enable); int gu1_set_compression_offset(unsigned long offset); int gu1_set_compression_pitch(unsigned short pitch); int gu1_set_compression_size(unsigned short size); void gu1_set_display_priority_high(int enable); int gu1_test_timing_active(void); int gu1_test_vertical_active(void); int gu1_wait_vertical_blank(void); void gu1_delay_milliseconds(unsigned long milliseconds); void gu1_delay_microseconds(unsigned long microseconds); void gu1_enable_panning(int x, int y); int gu1_set_fixed_timings(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp); int gu1_set_panel_present(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp); void gu1_reset_timing_lock(void); int gu1_get_display_details(unsigned int mode, int *xres, int *yres, int *hz); unsigned short gu1_get_display_pitch(void); unsigned long gu1_get_max_supported_pixel_clock(void); int gu1_mode_frequency_supported(int xres, int yres, int bpp, unsigned long frequency); int gu1_get_refreshrate_from_frequency(int xres, int yres, int bpp, int *hz, unsigned long frequency); int gu1_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz, unsigned long frequency); int gu1_get_frequency_from_refreshrate(int xres, int yres, int bpp, int hz, int *frequency); int gu1_get_display_mode_count(void); int gu1_get_display_mode(int *xres, int *yres, int *bpp, int *hz); unsigned long gu1_get_frame_buffer_line_size(void); unsigned short gu1_get_hactive(void); unsigned short gu1_get_hblank_start(void); unsigned short gu1_get_hsync_start(void); unsigned short gu1_get_hsync_end(void); unsigned short gu1_get_hblank_end(void); unsigned short gu1_get_htotal(void); unsigned short gu1_get_vactive(void); unsigned short gu1_get_vline(void); unsigned short gu1_get_vblank_start(void); unsigned short gu1_get_vsync_start(void); unsigned short gu1_get_vsync_end(void); unsigned short gu1_get_vblank_end(void); unsigned short gu1_get_vtotal(void); unsigned short gu1_get_display_bpp(void); unsigned long gu1_get_display_offset(void); int gu1_get_display_palette_entry(unsigned long index, unsigned long *palette); void gu1_get_display_palette(unsigned long *palette); unsigned long gu1_get_cursor_enable(void); unsigned long gu1_get_cursor_offset(void); unsigned long gu1_get_cursor_position(void); unsigned long gu1_get_cursor_clip(void); unsigned long gu1_get_cursor_color(int color); unsigned long gu1_get_icon_enable(void); unsigned long gu1_get_icon_offset(void); unsigned long gu1_get_icon_position(void); unsigned long gu1_get_icon_color(int color); int gu1_get_compression_enable(void); unsigned long gu1_get_compression_offset(void); unsigned short gu1_get_compression_pitch(void); unsigned short gu1_get_compression_size(void); int gu1_get_display_priority_high(void); int gu1_get_valid_bit(int line); #endif #endif void gfx_set_display_video_format(unsigned long format); void gfx_set_display_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset); void gfx_set_display_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch); void gfx_set_display_video_downscale(unsigned short srch, unsigned short dsth); void gfx_set_display_video_vertical_downscale_enable(int enable); void gfx_get_display_video_yuv_offsets(unsigned long *yoffset, unsigned long *uoffset, unsigned long *voffset); void gfx_get_display_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch); unsigned long gfx_get_display_video_downscale_delta(void); int gfx_get_display_video_downscale_enable(void); /*----------------------------------*/ /* SECOND GENERATION DISPLAY */ /*----------------------------------*/ #if GFX_DISPLAY_GU2 /* PRIVATE ROUTINES */ void gu2_enable_compression(void); void gu2_disable_compression(void); /* DYNAMIC ROUTINES */ #if GFX_DISPLAY_DYNAMIC void gu2_get_display_video_yuv_offsets(unsigned long *yoffset, unsigned long *uoffset, unsigned long *voffset); void gu2_get_display_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch); unsigned long gu2_get_display_video_downscale_delta(void); int gu2_get_display_video_downscale_enable(void); void gu2_set_display_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset); void gu2_set_display_video_format(unsigned long format); void gu2_set_display_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch); void gu2_set_display_video_downscale(unsigned short srch, unsigned short dsth); void gu2_set_display_video_vertical_downscale_enable(int enable); void gu2_set_display_video_enable(int enable); void gu2_set_display_video_size(unsigned short width, unsigned short height); void gu2_set_display_video_offset(unsigned long offset); unsigned long gu2_get_display_video_offset(void); unsigned long gu2_get_display_video_size(void); int gu2_set_display_bpp(unsigned short bpp); int gu2_is_display_mode_supported(int xres, int yres, int bpp, int hz); int gu2_set_display_mode(int xres, int yres, int bpp, int hz); int gu2_set_display_timings(unsigned short bpp, unsigned short flags, unsigned short hactive, unsigned short hblank_start, unsigned short hsync_start, unsigned short hsync_end, unsigned short hblank_end, unsigned short htotal, unsigned short vactive, unsigned short vblank_start, unsigned short vsync_start, unsigned short vsync_end, unsigned short vblank_end, unsigned short vtotal, unsigned long frequency); int gu2_set_vtotal(unsigned short vtotal); void gu2_set_display_pitch(unsigned short pitch); void gu2_set_display_offset(unsigned long offset); int gu2_set_display_palette_entry(unsigned long index, unsigned long palette); int gu2_set_display_palette(unsigned long *palette); void gu2_set_cursor_enable(int enable); void gu2_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor); void gu2_set_cursor_position(unsigned long memoffset, unsigned short xpos, unsigned short ypos, unsigned short xhotspot, unsigned short yhotspot); void gu2_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask); void gu2_set_cursor_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask); void gu2_set_icon_enable(int enable); void gu2_set_icon_colors(unsigned long color0, unsigned long color1, unsigned long color2); void gu2_set_icon_position(unsigned long memoffset, unsigned short xpos); void gu2_set_icon_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask, unsigned int lines); int gu2_set_compression_enable(int enable); int gu2_set_compression_offset(unsigned long offset); int gu2_set_compression_pitch(unsigned short pitch); int gu2_set_compression_size(unsigned short size); void gu2_set_display_priority_high(int enable); int gu2_test_timing_active(void); int gu2_test_vertical_active(void); int gu2_wait_vertical_blank(void); void gu2_delay_milliseconds(unsigned long milliseconds); void gu2_delay_microseconds(unsigned long microseconds); void gu2_enable_panning(int x, int y); int gu2_is_panel_mode_supported(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp); int gu2_set_fixed_timings(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp); int gu2_set_panel_present(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp); void gu2_reset_timing_lock(void); int gu2_get_display_details(unsigned int mode, int *xres, int *yres, int *hz); unsigned short gu2_get_display_pitch(void); unsigned long gu2_get_max_supported_pixel_clock(void); int gu2_mode_frequency_supported(int xres, int yres, int bpp, unsigned long frequency); int gu2_get_refreshrate_from_frequency(int xres, int yres, int bpp, int *hz, unsigned long frequency); int gu2_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz, unsigned long frequency); int gu2_get_frequency_from_refreshrate(int xres, int yres, int bpp, int hz, int *frequency); int gu2_get_display_mode_count(void); int gu2_get_display_mode(int *xres, int *yres, int *bpp, int *hz); unsigned long gu2_get_frame_buffer_line_size(void); unsigned short gu2_get_hactive(void); unsigned short gu2_get_hblank_start(void); unsigned short gu2_get_hsync_start(void); unsigned short gu2_get_hsync_end(void); unsigned short gu2_get_hblank_end(void); unsigned short gu2_get_htotal(void); unsigned short gu2_get_vactive(void); unsigned short gu2_get_vline(void); unsigned short gu2_get_vblank_start(void); unsigned short gu2_get_vsync_start(void); unsigned short gu2_get_vsync_end(void); unsigned short gu2_get_vblank_end(void); unsigned short gu2_get_vtotal(void); unsigned short gu2_get_display_bpp(void); unsigned long gu2_get_display_offset(void); int gu2_get_display_palette_entry(unsigned long index, unsigned long *palette); void gu2_get_display_palette(unsigned long *palette); unsigned long gu2_get_cursor_enable(void); unsigned long gu2_get_cursor_offset(void); unsigned long gu2_get_cursor_position(void); unsigned long gu2_get_cursor_clip(void); unsigned long gu2_get_cursor_color(int color); unsigned long gu2_get_icon_enable(void); unsigned long gu2_get_icon_offset(void); unsigned long gu2_get_icon_position(void); unsigned long gu2_get_icon_color(int color); int gu2_get_compression_enable(void); unsigned long gu2_get_compression_offset(void); unsigned short gu2_get_compression_pitch(void); unsigned short gu2_get_compression_size(void); int gu2_get_valid_bit(int line); #endif #endif /*----------------------------------*/ /* FIRST GENERATION 2D ACCELERATION */ /*----------------------------------*/ #if GFX_2DACCEL_GU1 /* PRIVATE ROUTINES */ void gu1_solid_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long color); void gu1_detect_blt_buffer_base(void); /* DYNAMIC ROUTINES */ #if GFX_2DACCEL_DYNAMIC void gu1_set_bpp(unsigned short bpp); void gu1_set_solid_pattern(unsigned long color); void gu1_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned char transparency); void gu1_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned long data2, unsigned long data3, unsigned char transparency); void gu1_load_color_pattern_line(short y, unsigned long *pattern_8x8); void gu1_set_solid_source(unsigned long color); void gu1_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, unsigned short transparent); void gu1_set_pattern_flags(unsigned short flags); void gu1_set_raster_operation(unsigned char rop); void gu1_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height); void gu1_color_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long *pattern); void gu1_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height); void gu1_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long color); void gu1_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch); void gu1_color_bitmap_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch, unsigned long color); void gu1_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, short pitch); void gu1_text_blt(unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data); void gu1_bresenham_line(unsigned short x, unsigned short y, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags); void gu1_wait_until_idle(void); int gu1_test_blt_pending(void); #endif #endif /*-----------------------------------*/ /* SECOND GENERATION 2D ACCELERATION */ /*-----------------------------------*/ #if GFX_2DACCEL_GU2 /* DYNAMIC ROUTINES */ #if GFX_2DACCEL_DYNAMIC void gfx_reset_pitch(unsigned short pitch); void gu2_reset_pitch(unsigned short pitch); void gu2_set_bpp(unsigned short bpp); void gu2_set_solid_pattern(unsigned long color); void gu2_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned char transparency); void gu2_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned long data2, unsigned long data3, unsigned char transparency); void gu2_load_color_pattern_line(short y, unsigned long *pattern_8x8); void gu2_set_solid_source(unsigned long color); void gu2_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, unsigned short transparent); void gu2_set_pattern_flags(unsigned short flags); void gu2_set_raster_operation(unsigned char rop); void gu2_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height); void gu2_color_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long *pattern); void gu2_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height); void gu2_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long color); void gu2_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch); void gu2_color_bitmap_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch, unsigned long color); void gu2_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, short pitch); void gu2_text_blt(unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data); void gu2_bresenham_line(unsigned short x, unsigned short y, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags); void gu2_wait_until_idle(void); int gu2_test_blt_pending(void); void gu22_set_source_stride(unsigned short stride); void gu22_set_destination_stride(unsigned short stride); void gu22_set_pattern_origin(int x, int y); void gu22_set_source_transparency(unsigned long color, unsigned long mask); void gu22_set_alpha_mode(int mode); void gu22_set_alpha_value(unsigned char value); void gu22_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height); void gu22_color_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned long *pattern); void gu22_screen_to_screen_blt(unsigned long srcoffset, unsigned long dstoffset, unsigned short width, unsigned short height, int flags); void gu22_mono_expand_blt(unsigned long srcbase, unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, int byte_packed); void gu22_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, short pitch); void gu22_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, short pitch); void gu22_text_blt(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data); void gu22_bresenham_line(unsigned long dstoffset, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags); void gu22_sync_to_vblank(void); #endif #endif void gfx_reset_video(void); int gfx_set_display_control(int sync_polarities); int gfx_set_screen_enable(int enable); /*-----------------------*/ /* CS5530 VIDEO ROUTINES */ /*-----------------------*/ #if GFX_VIDEO_CS5530 /* PRIVATE ROUTINES */ /* DYNAMIC ROUTINES */ #if GFX_VIDEO_DYNAMIC void cs5530_reset_video(void); int cs5530_set_display_control(int sync_polarities); void cs5530_set_clock_frequency(unsigned long frequency); unsigned long cs5530_get_clock_frequency(void); int cs5530_set_crt_enable(int enable); int cs5530_get_sync_polarities(void); int cs5530_get_vsa2_softvga_enable(void); int cs5530_set_video_enable(int enable); int cs5530_set_video_format(unsigned long format); int cs5530_set_video_size(unsigned short width, unsigned short height); int cs5530_set_video_offset(unsigned long offset); int cs5530_set_video_window(short x, short y, unsigned short w, unsigned short h); int cs5530_set_video_left_crop(unsigned short x); int cs5530_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth); int cs5530_set_video_color_key(unsigned long key, unsigned long mask, int bluescreen); int cs5530_set_video_filter(int xfilter, int yfilter); int cs5530_set_video_palette(unsigned long *palette); int cs5530_set_video_palette_entry(unsigned long index, unsigned long color); int cs5530_disable_softvga(void); int cs5530_enable_softvga(void); unsigned long cs5530_get_max_video_width(void); /* READ ROUTINES IN GFX_VID.C */ int cs5530_get_video_enable(void); int cs5530_get_video_format(void); unsigned long cs5530_get_video_src_size(void); unsigned long cs5530_get_video_line_size(void); unsigned long cs5530_get_video_xclip(void); unsigned long cs5530_get_video_offset(void); unsigned long cs5530_get_video_upscale(void); unsigned long cs5530_get_video_scale(void); unsigned long cs5530_get_video_dst_size(void); unsigned long cs5530_get_video_position(void); unsigned long cs5530_get_video_color_key(void); unsigned long cs5530_get_video_color_key_mask(void); int cs5530_get_video_palette_entry(unsigned long index, unsigned long *palette); int cs5530_get_video_color_key_src(void); int cs5530_get_video_filter(void); unsigned long cs5530_read_crc(void); #endif #endif /*-----------------------*/ /* SC1200 VIDEO ROUTINES */ /*-----------------------*/ #if GFX_VIDEO_SC1200 /* PRIVATE ROUTINES */ /* DYNAMIC ROUTINES */ #if GFX_VIDEO_DYNAMIC void sc1200_reset_video(void); int sc1200_set_display_control(int sync_polarities); int sc1200_set_screen_enable(int enable); void sc1200_set_clock_frequency(unsigned long frequency); unsigned long sc1200_get_clock_frequency(void); int sc1200_set_crt_enable(int enable); int sc1200_get_sync_polarities(void); int sc1200_get_vsa2_softvga_enable(void); int sc1200_set_video_enable(int enable); int sc1200_set_video_format(unsigned long format); int sc1200_set_video_size(unsigned short width, unsigned short height); int sc1200_set_video_offset(unsigned long offset); int sc1200_set_video_window(short x, short y, unsigned short w, unsigned short h); int sc1200_set_video_left_crop(unsigned short x); int sc1200_set_video_upscale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth); int sc1200_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth); int sc1200_set_video_downscale_config(unsigned short type, unsigned short m); int sc1200_set_video_color_key(unsigned long key, unsigned long mask, int bluescreen); int sc1200_set_video_filter(int xfilter, int yfilter); int sc1200_set_video_palette(unsigned long *palette); int sc1200_set_video_palette_bypass(int enable); int sc1200_set_video_palette_entry(unsigned long index, unsigned long color); int sc1200_set_video_downscale_coefficients(unsigned short coef1, unsigned short coef2, unsigned short coef3, unsigned short coef4); int sc1200_set_video_downscale_enable(int enable); int sc1200_set_video_source(VideoSourceType source); int sc1200_set_vbi_source(VbiSourceType source); int sc1200_set_vbi_lines(unsigned long even, unsigned long odd); int sc1200_set_vbi_total(unsigned long even, unsigned long odd); int sc1200_set_video_interlaced(int enable); int sc1200_set_color_space_YUV(int enable); int sc1200_set_vertical_scaler_offset(char offset); int sc1200_set_top_line_in_odd(int enable); int sc1200_set_genlock_delay(unsigned long delay); int sc1200_set_genlock_enable(int flags); int sc1200_set_video_cursor(unsigned long key, unsigned long mask, unsigned short select_color2, unsigned long color1, unsigned long color2); int sc1200_set_video_request(short x, short y); int sc1200_select_alpha_region(int region); int sc1200_set_alpha_enable(int enable); int sc1200_set_alpha_window(short x, short y, unsigned short width, unsigned short height); int sc1200_set_alpha_value(unsigned char alpha, char delta); int sc1200_set_alpha_priority(int priority); int sc1200_set_alpha_color(unsigned long color); int sc1200_set_alpha_color_enable(int enable); int sc1200_set_no_ck_outside_alpha(int enable); int sc1200_disable_softvga(void); int sc1200_enable_softvga(void); int sc1200_set_macrovision_enable(int enable); unsigned long sc1200_get_max_video_width(void); /* READ ROUTINES IN GFX_VID.C */ int sc1200_get_video_enable(void); int sc1200_get_video_format(void); unsigned long sc1200_get_video_src_size(void); unsigned long sc1200_get_video_line_size(void); unsigned long sc1200_get_video_xclip(void); unsigned long sc1200_get_video_offset(void); unsigned long sc1200_get_video_upscale(void); unsigned long sc1200_get_video_scale(void); int sc1200_get_video_downscale_config(unsigned short *type, unsigned short *m); void sc1200_get_video_downscale_coefficients(unsigned short *coef1, unsigned short *coef2, unsigned short *coef3, unsigned short *coef4); void sc1200_get_video_downscale_enable(int *enable); unsigned long sc1200_get_video_dst_size(void); unsigned long sc1200_get_video_position(void); unsigned long sc1200_get_video_color_key(void); unsigned long sc1200_get_video_color_key_mask(void); int sc1200_get_video_palette_entry(unsigned long index, unsigned long *palette); int sc1200_get_video_color_key_src(void); int sc1200_get_video_filter(void); int sc1200_get_video_request(short *x, short *y); int sc1200_get_video_source(VideoSourceType * source); int sc1200_get_vbi_source(VbiSourceType * source); unsigned long sc1200_get_vbi_lines(int odd); unsigned long sc1200_get_vbi_total(int odd); int sc1200_get_video_interlaced(void); int sc1200_get_color_space_YUV(void); int sc1200_get_vertical_scaler_offset(char *offset); unsigned long sc1200_get_genlock_delay(void); int sc1200_get_genlock_enable(void); int sc1200_get_video_cursor(unsigned long *key, unsigned long *mask, unsigned short *select_color2, unsigned long *color1, unsigned short *color2); unsigned long sc1200_read_crc(void); int sc1200_get_macrovision_enable(void); void sc1200_get_alpha_enable(int *enable); void sc1200_get_alpha_size(unsigned short *x, unsigned short *y, unsigned short *width, unsigned short *height); void sc1200_get_alpha_value(unsigned char *alpha, char *delta); void sc1200_get_alpha_priority(int *priority); void sc1200_get_alpha_color(unsigned long *color); #endif #endif /*-------------------------*/ /* REDCLOUD VIDEO ROUTINES */ /*-------------------------*/ #if GFX_VIDEO_REDCLOUD /* PRIVATE ROUTINES */ /* DYNAMIC ROUTINES */ #if GFX_VIDEO_DYNAMIC void redcloud_reset_video(void); int redcloud_set_display_control(int sync_polarities); void redcloud_set_clock_frequency(unsigned long frequency); unsigned long redcloud_get_clock_frequency(void); int redcloud_set_crt_enable(int enable); int redcloud_get_sync_polarities(void); int redcloud_set_video_enable(int enable); int redcloud_set_video_format(unsigned long format); int redcloud_set_video_size(unsigned short width, unsigned short height); int redcloud_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch); int redcloud_set_video_offset(unsigned long offset); int redcloud_set_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset); int redcloud_set_video_window(short x, short y, unsigned short w, unsigned short h); int redcloud_set_video_left_crop(unsigned short x); int redcloud_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth); int redcloud_set_video_vertical_downscale(unsigned short srch, unsigned short dsth); void redcloud_set_video_vertical_downscale_enable(int enable); int redcloud_set_video_downscale_config(unsigned short type, unsigned short m); int redcloud_set_video_color_key(unsigned long key, unsigned long mask, int bluescreen); int redcloud_set_video_filter(int xfilter, int yfilter); int redcloud_set_video_palette(unsigned long *palette); int redcloud_set_graphics_palette(unsigned long *palette); int redcloud_set_video_palette_bypass(int enable); int redcloud_set_video_palette_entry(unsigned long index, unsigned long color); int redcloud_set_graphics_palette_entry(unsigned long index, unsigned long color); int redcloud_set_video_downscale_coefficients(unsigned short coef1, unsigned short coef2, unsigned short coef3, unsigned short coef4); int redcloud_set_video_downscale_enable(int enable); int redcloud_set_video_cursor(unsigned long key, unsigned long mask, unsigned short select_color2, unsigned long color1, unsigned long color2); int redcloud_set_video_cursor_enable(int enable); int redcloud_select_alpha_region(int region); int redcloud_set_alpha_enable(int enable); int redcloud_set_alpha_window(short x, short y, unsigned short width, unsigned short height); int redcloud_set_alpha_value(unsigned char alpha, char delta); int redcloud_set_alpha_priority(int priority); int redcloud_set_alpha_color(unsigned long color); int redcloud_set_alpha_color_enable(int enable); int redcloud_set_no_ck_outside_alpha(int enable); int redcloud_set_video_request(short x, short y); /* READ ROUTINES IN GFX_VID.C */ int redcloud_get_video_enable(void); int redcloud_get_video_format(void); unsigned long redcloud_get_video_src_size(void); unsigned long redcloud_get_video_line_size(void); unsigned long redcloud_get_video_xclip(void); unsigned long redcloud_get_video_offset(void); void redcloud_get_video_yuv_offsets(unsigned long *yoffset, unsigned long *uoffset, unsigned long *voffset); void redcloud_get_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch); unsigned long redcloud_get_video_scale(void); unsigned long redcloud_get_video_downscale_delta(void); int redcloud_get_video_vertical_downscale_enable(void); int redcloud_get_video_downscale_config(unsigned short *type, unsigned short *m); void redcloud_get_video_downscale_coefficients(unsigned short *coef1, unsigned short *coef2, unsigned short *coef3, unsigned short *coef4); void redcloud_get_video_downscale_enable(int *enable); unsigned long redcloud_get_video_dst_size(void); unsigned long redcloud_get_video_position(void); unsigned long redcloud_get_video_color_key(void); unsigned long redcloud_get_video_color_key_mask(void); int redcloud_get_video_palette_entry(unsigned long index, unsigned long *palette); int redcloud_get_video_color_key_src(void); int redcloud_get_video_filter(void); int redcloud_get_video_cursor(unsigned long *key, unsigned long *mask, unsigned short *select_color2, unsigned long *color1, unsigned short *color2); unsigned long redcloud_read_crc(void); unsigned long redcloud_read_crc32(void); unsigned long redcloud_read_window_crc(int source, unsigned short x, unsigned short y, unsigned short width, unsigned short height, int crc32); void redcloud_get_alpha_enable(int *enable); void redcloud_get_alpha_size(unsigned short *x, unsigned short *y, unsigned short *width, unsigned short *height); void redcloud_get_alpha_value(unsigned char *alpha, char *delta); void redcloud_get_alpha_priority(int *priority); void redcloud_get_alpha_color(unsigned long *color); int redcloud_get_video_request(short *x, short *y); #endif #endif /*--------------*/ /* VIP ROUTINES */ /*--------------*/ #if GFX_VIP_SC1200 /* DYNAMIC ROUTINES */ #if GFX_VIP_DYNAMIC int sc1200_set_vip_enable(int enable); int sc1200_set_vip_capture_run_mode(int mode); int sc1200_set_vip_base(unsigned long even, unsigned long odd); int sc1200_set_vip_pitch(unsigned long pitch); int sc1200_set_vip_mode(int mode); int sc1200_set_vbi_enable(int enable); int sc1200_set_vbi_mode(int mode); int sc1200_set_vbi_base(unsigned long even, unsigned long odd); int sc1200_set_vbi_pitch(unsigned long pitch); int sc1200_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines); int sc1200_set_vbi_interrupt(int enable); int sc1200_set_vip_bus_request_threshold_high(int enable); int sc1200_set_vip_last_line(int last_line); int sc1200_test_vip_odd_field(void); int sc1200_test_vip_bases_updated(void); int sc1200_test_vip_fifo_overflow(void); int sc1200_get_vip_line(void); int sc1200_get_vip_enable(void); unsigned long sc1200_get_vip_base(int odd); unsigned long sc1200_get_vip_pitch(void); int sc1200_get_vip_mode(void); int sc1200_get_vbi_enable(void); int sc1200_get_vbi_mode(void); unsigned long sc1200_get_vbi_base(int odd); unsigned long sc1200_get_vbi_pitch(void); unsigned long sc1200_get_vbi_direct(int odd); int sc1200_get_vbi_interrupt(void); int sc1200_get_vip_bus_request_threshold_high(void); #endif #endif /* DECODER ROUTINES */ #if GFX_DECODER_SAA7114 /* PRIVATE ROUTINES */ int saa7114_write_reg(unsigned char reg, unsigned char val); int saa7114_read_reg(unsigned char reg, unsigned char *val); /* DYNAMIC ROUTINES */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_defaults(void); int saa7114_set_decoder_analog_input(unsigned char input); int saa7114_set_decoder_brightness(unsigned char brightness); int saa7114_set_decoder_contrast(unsigned char contrast); int saa7114_set_decoder_hue(char hue); int saa7114_set_decoder_saturation(unsigned char saturation); int saa7114_set_decoder_input_offset(unsigned short x, unsigned short y); int saa7114_set_decoder_input_size(unsigned short width, unsigned short height); int saa7114_set_decoder_output_size(unsigned short width, unsigned short height); int saa7114_set_decoder_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth); int saa7114_set_decoder_vbi_format(int start, int end, int format); int saa7114_set_decoder_vbi_enable(int enable); int saa7114_set_decoder_vbi_upscale(void); int saa7114_set_decoder_TV_standard(TVStandardType TVStandard); int saa7114_set_decoder_luminance_filter(unsigned char lufi); int saa7114_decoder_software_reset(void); int saa7114_decoder_detect_macrovision(void); int saa7114_decoder_detect_video(void); unsigned char saa7114_get_decoder_brightness(void); unsigned char saa7114_get_decoder_contrast(void); char saa7114_get_decoder_hue(void); unsigned char saa7114_get_decoder_saturation(void); unsigned long saa7114_get_decoder_input_offset(void); unsigned long saa7114_get_decoder_input_size(void); unsigned long saa7114_get_decoder_output_size(void); int saa7114_get_decoder_vbi_format(int line); #endif #endif /* ACCESS I2C ROUTINES */ #if GFX_I2C_ACCESS #if GFX_I2C_DYNAMIC int acc_i2c_reset(unsigned char busnum, short adr, char freq); int acc_i2c_write(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data); int acc_i2c_read(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data); int acc_i2c_select_gpio(int clock, int data); int acc_i2c_init(void); void acc_i2c_cleanup(void); #endif #endif /* GPIO I2C ROUTINES */ #if GFX_I2C_GPIO #if GFX_I2C_DYNAMIC int gpio_i2c_reset(unsigned char busnum, short adr, char freq); int gpio_i2c_write(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data); int gpio_i2c_read(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data); int gpio_i2c_select_gpio(int clock, int data); int gpio_i2c_init(void); void gpio_i2c_cleanup(void); #endif #endif /* TV ROUTINES */ #if GFX_TV_SC1200 #if GFX_TV_DYNAMIC int sc1200_set_tv_format(TVStandardType format, GfxOnTVType resolution); int sc1200_set_tv_output(int output); int sc1200_set_tv_enable(int enable); int sc1200_set_tv_flicker_filter(int ff); int sc1200_set_tv_sub_carrier_reset(int screset); int sc1200_set_tv_vphase(int vphase); int sc1200_set_tv_YC_delay(int delay); int sc1200_set_tvenc_reset_interval(int interval); int sc1200_set_tv_cc_enable(int enable); int sc1200_set_tv_cc_data(unsigned char data1, unsigned char data2); int sc1200_set_tv_display(int width, int height); int sc1200_test_tvout_odd_field(void); int sc1200_test_tvenc_odd_field(void); int sc1200_set_tv_field_status_invert(int enable); int sc1200_get_tv_vphase(void); int sc1200_get_tv_enable(unsigned int *p_on); int sc1200_get_tv_output(void); int sc1200_get_tv_mode_count(TVStandardType format); int sc1200_get_tv_display_mode(int *width, int *height, int *bpp, int *hz); int sc1200_get_tv_display_mode_frequency(unsigned short width, unsigned short height, TVStandardType format, int *frequency); int sc1200_is_tv_display_mode_supported(unsigned short width, unsigned short height, TVStandardType format); unsigned char cc_add_parity_bit(unsigned char data); #endif #endif /* FS450 ROUTINES */ #if GFX_TV_FS451 #if GFX_TV_DYNAMIC int fs450_set_tv_format(TVStandardType format, GfxOnTVType resolution); int fs450_set_tv_output(int output); int fs450_set_tv_enable(int enable); int fs450_get_tv_standard(unsigned long *p_standard); int fs450_get_available_tv_standards(unsigned long *p_standards); int fs450_set_tv_standard(unsigned long standard); int fs450_get_tv_vga_mode(unsigned long *p_vga_mode); int fs450_get_available_tv_vga_modes(unsigned long *p_vga_modes); int fs450_set_tv_vga_mode(unsigned long vga_mode); int fs450_get_tvout_mode(unsigned long *p_tvout_mode); int fs450_set_tvout_mode(unsigned long tvout_mode); int fs450_get_sharpness(int *p_sharpness); int fs450_set_sharpness(int sharpness); int fs450_get_flicker_filter(int *p_flicker); int fs450_set_flicker_filter(int flicker); int fs450_get_overscan(int *p_x, int *p_y); int fs450_set_overscan(int x, int y); int fs450_get_position(int *p_x, int *p_y); int fs450_set_position(int x, int y); int fs450_get_color(int *p_color); int fs450_set_color(int color); int fs450_get_brightness(int *p_brightness); int fs450_set_brightness(int brightness); int fs450_get_contrast(int *p_contrast); int fs450_set_contrast(int constrast); int fs450_get_yc_filter(unsigned int *p_yc_filter); int fs450_set_yc_filter(unsigned int yc_filter); int fs450_get_aps_trigger_bits(unsigned int *p_trigger_bits); int fs450_set_aps_trigger_bits(unsigned int trigger_bits); #endif #endif xf86-video-geode-2.11.18/src/gfx/gfx_vga.c0000644000175000017500000000350712654445443014745 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to interface to the VGA registers. Some * operating systems require mode sets be done through VGA, rather than * directly using the "gfx_set_display_mode" routine. * */ /* INCLUDE SUPPORT FOR FIRST GENERATION, IF SPECIFIED. */ #if GFX_VGA_GU1 #include "vga_gu1.c" #endif /* WRAPPERS IF DYNAMIC SELECTION */ /* Extra layer to call either first or second generation routines. */ #if GFX_VGA_DYNAMIC #endif /* GFX_DISPLAY_DYNAMIC */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/tv_fs450.c0000644000175000017500000027045412654445443014705 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ #define FS450_DIRECTREG 0 #include "tv_fs450.h" /*========================================================================== * Macros *========================================================================== */ #undef fsmax #undef fsmin #define fsmax(a, b) ((a) > (b) ? (a) : (b)) #define fsmin(a, b) ((a) < (b) ? (a) : (b)) #undef range_limit #define range_limit(val,min_val,max_val) (fsmax((min_val),fsmin((val),(max_val)))) /*========================================================================== * Registers *========================================================================== */ #define MAX_REGISTERS 32 #define MAX_BITS 32 #define READ 1 #define WRITE 2 #define READ_WRITE (READ | WRITE) typedef struct { char *name; unsigned long offset; unsigned char bit_length; unsigned char valid_bits; unsigned char read_write; char *bitfield_names[MAX_BITS]; } S_REGISTER_DESCRIP; typedef struct { int source; char *name; S_REGISTER_DESCRIP registers[MAX_REGISTERS]; } S_SET_DESCRIP; const S_SET_DESCRIP *houston_regs(void); const S_SET_DESCRIP *encoder_regs(void); const S_SET_DESCRIP *macrovision_regs(void); const S_SET_DESCRIP *gcc_regs(void); /*========================================================================== * Houston Register Addresses & Bit Definitions *========================================================================== */ #define HOUSTON_IHO 0x00 /* Input Horizontal Offset */ #define HOUSTON_IVO 0x02 /* Input Vertical Offset */ #define HOUSTON_IHA 0x04 /* Input Horizontal Active Width */ #define HOUSTON_VSC 0x06 /* Vertical Scaling Coeficient */ #define HOUSTON_HSC 0x08 /* Horizontal Scaling Coeficient */ #define HOUSTON_BYP 0x0A /* Bypass Register */ #define HOUSTON_CR 0x0C /* Control Register */ #define HOUSTON_SP 0x0E /* Status */ #define HOUSTON_NCONL 0x10 /* NCO numerator low word */ #define HOUSTON_NCONH 0x12 /* NCO numerator high word */ #define HOUSTON_NCODL 0x14 /* NCO denominator low word */ #define HOUSTON_NCODH 0x16 /* NCO denominator high word */ #define HOUSTON_APO 0x18 #define HOUSTON_ALO 0x1A #define HOUSTON_AFO 0x1C #define HOUSTON_HSOUTWID 0x1E #define HOUSTON_HSOUTST 0x20 #define HOUSTON_HSOUTEND 0x22 #define HOUSTON_SHP 0x24 /* Sharpness */ #define HOUSTON_FLK 0x26 /* Flicker Filter */ #define HOUSTON_BCONTL 0x28 #define HOUSTON_BCONTH 0x2A #define HOUSTON_BDONE 0x2C #define HOUSTON_BDIAGL 0x2E #define HOUSTON_BDIAGH 0x30 #define HOUSTON_REV 0x32 #define HOUSTON_MISC 0x34 #define HOUSTON_FFO 0x36 #define HOUSTON_FFO_LAT 0x38 #define HOUSTON_VSOUTWID 0x3A #define HOUSTON_VSOUTST 0x3C #define HOUSTON_VSOUTEND 0x3E /* BYP Register Bits */ #define BYP_RGB_BYPASS 0x0001 #define BYP_HDS_BYPASS 0x0002 #define BYP_HDS_TBYPASS 0x0004 #define BYP_CAC_BYPASS 0x0008 #define BYP_R2V_SBYPASS 0x0010 #define BYP_R2V_BYPASS 0x0020 #define BYP_VDS_BYPASS 0x0040 #define BYP_FFT_BYPASS 0x0080 #define BYP_FIF_BYPASS 0x0100 #define BYP_FIF_TBYPASS 0x0200 #define BYP_HUS_BYPASS 0x0400 #define BYP_HUS_TBYPASS 0x0800 #define BYP_CCR_BYPASS 0x1000 #define BYP_PLL_BYPASS 0x2000 #define BYP_NCO_BYPASS 0x4000 #define BYP_ENC_BYPASS 0x8000 /* CR Register Bits */ #define CR_RESET 0x0001 #define CR_CLKOFF 0x0002 #define CR_NCO_EN 0x0004 #define CR_COMPOFF 0x0008 #define CR_YCOFF 0x0010 #define CR_LP_EN 0x0020 #define CR_CACQ_CLR 0x0040 #define CR_FFO_CLR 0x0080 #define CR_656_PAL_NTSC 0x0100 #define CR_656_STD_VMI 0x0200 #define CR_OFMT 0x0400 #define CR_UIM_CLK 0x0800 #define CR_UIM_DEC 0x1000 #define CR_BIPGEN_EN1 0x2000 #define CR_UIM_MOD0 0x4000 #define CR_UIM_MOD1 0x8000 /* Status Register Bits */ #define SP_CACQ_ST 0x0001 #define SP_FFO_ST 0x0002 #define SP_REVID_MASK 0x7FFC #define SP_MV_EN 0x8000 /* BDONE Register Bits */ #define BDONE_BIST_DONE_A 0x0001 #define BDONE_BIST_DONE_B 0x0002 #define BDONE_BIST_DONE_C 0x0004 #define BDONE_BIST_DONE_D 0x0008 #define BDONE_BIST_DONE_E 0x0010 #define BDONE_BIST_DONE_F 0x0020 #define BDONE_BIST_DONE_G 0x0040 /* BDIAGL Register Bits */ #define BDIAGL_BIST_DIAG_A 0x000F #define BDIAGL_BIST_DIAG_B 0x00F0 #define BDIAGL_BIST_DIAG_C 0x0F00 #define BDIAGL_BIST_DIAG_D 0xF000 /* BDIAGH Register Bits */ #define BDIAGH_BIST_DIAG_E 0x000F #define BDIAGH_BIST_DIAG_F 0x000F #define BDIAGH_BIST_DIAG_G 0x000F /* MISC Register Bits */ #define MISC_TV_SHORT_FLD 0x0001 #define MISC_ENC_TEST 0x0002 #define MISC_DAC_TEST 0x0004 #define MISC_MV_SOFT_EN 0x0008 #define MISC_NCO_LOAD0 0x0010 #define MISC_NCO_LOAD1 0x0020 #define MISC_VGACKDIV 0x0200 #define MISC_BRIDGE_SYNC 0x0400 #define MISC_GTLIO_PD 0x8000 /*========================================================================== * Encoder Registers & Bit Definitions *========================================================================== */ #define ENC_CHROMA_FREQ 0x40 #define ENC_CHROMA_PHASE 0x44 #define ENC_REG05 0x45 #define ENC_REG06 0x46 #define ENC_REG07 0x47 #define ENC_HSYNC_WIDTH 0x48 #define ENC_BURST_WIDTH 0x49 #define ENC_BACK_PORCH 0x4A #define ENC_CB_BURST_LEVEL 0x4B #define ENC_CR_BURST_LEVEL 0x4C #define ENC_SLAVE_MODE 0x4D #define ENC_BLACK_LEVEL 0x4e #define ENC_BLANK_LEVEL 0x50 #define ENC_NUM_LINES 0x57 #define ENC_WHITE_LEVEL 0x5e #define ENC_CB_GAIN 0x60 #define ENC_CR_GAIN 0x62 #define ENC_TINT 0x65 #define ENC_BREEZE_WAY 0x69 #define ENC_FRONT_PORCH 0x6C #define ENC_ACTIVELINE 0x71 #define ENC_FIRST_LINE 0x73 #define ENC_REG34 0x74 #define ENC_SYNC_LEVEL 0x75 #define ENC_VBI_BLANK_LEVEL 0x7C #define ENC_RESET 0x7e #define ENC_NOTCH_FILTER 0x8d /*========================================================================== * Macrovision Registers & Bit Definitions *========================================================================== */ #define MV_N0 0x59 #define MV_N1 0x52 #define MV_N2 0x7b #define MV_N3 0x53 #define MV_N4 0x79 #define MV_N5 0x5d #define MV_N6 0x7a #define MV_N7 0x64 #define MV_N8 0x54 #define MV_N9 0x55 #define MV_N10 0x56 #define MV_N11 0x6d #define MV_N12 0x6f #define MV_N13 0x5a #define MV_N14 0x5b #define MV_N15 0x5c #define MV_N16 0x63 #define MV_N17 0x66 #define MV_N18 0x68 #define MV_N19 0x67 #define MV_N20 0x61 #define MV_N21 0x6a #define MV_N22 0x76 #define MV_AGC_PULSE_LEVEL 0x77 #define MV_BP_PULSE_LEVEL 0x78 /*========================================================================== * The TRACE macro can be used to display debug information. It can display * one or more parameters in a formatted string like printf. No code will be * generated for a release build. Use double parentheses for compatibility * with C #define statements. Newline characters are not added * automatically. Usage example: * * TRACE(("Number is %d, Name is %s.\n",iNumber,lpszName)) *========================================================================== */ #define TRACE(parameters) {} /* GCC timing structure */ typedef struct _S_TIMING_SPECS { int vga_width; int vga_lines; int tv_width; int tv_lines; int h_total; int h_sync; int v_total; int v_sync; } S_TIMING_SPECS; /* Revision of Houston chip */ #define HOUSTON_REV_A 0 #define HOUSTON_REV_B 1 static int houston_Rev(void); /*========================================================================== * Functions *========================================================================== */ static int houston_init(void); static unsigned char PLAL_FS450_i2c_address(void); static int PLAL_FS450_UIM_mode(void); static int PLAL_ReadRegister(S_REG_INFO * p_reg); static int PLAL_WriteRegister(const S_REG_INFO * p_reg); static int PLAL_IsTVOn(void); static int PLAL_EnableVga(void); static int PLAL_PrepForTVout(void); static int PLAL_SetTVTimingRegisters(const S_TIMING_SPECS * p_specs); static int PLAL_FinalEnableTVout(unsigned long vga_mode); /* Direct Memory Access Functions */ /* NOTE: Cx5530 is assumed hardcoded at 0x10000 offset from MediaGX base. * F4Bar is bogus as described in the Cx5530 datasheet (actually points to GX * frame buffer). */ static int DMAL_ReadUInt32(unsigned long phys_addr, unsigned long *p_data) { *p_data = READ_REG32(phys_addr); return 0; } static int DMAL_WriteUInt32(unsigned long phys_addr, unsigned long data) { WRITE_REG32(phys_addr, data); return 0; } /* Houston register access functions. */ static int houston_ReadReg(unsigned int reg, unsigned long *p_value, unsigned int bytes) { return gfx_i2c_read(1, PLAL_FS450_i2c_address(), (unsigned char) reg, (unsigned char) bytes, (unsigned char *) p_value); } static int houston_WriteReg(unsigned int reg, unsigned long value, unsigned int bytes) { return gfx_i2c_write(1, PLAL_FS450_i2c_address(), (unsigned char) reg, (unsigned char) bytes, (unsigned char *) &value); } /* TV configuration functions. */ static int config_init(void); static const S_TIMING_SPECS *p_specs(void); static void config_power(int on); static void config_vga_mode(unsigned long vga_mode); static void config_tv_std(unsigned long tv_std, unsigned int trigger_bits); static void conget_tv_std(unsigned long *p_tv_std); static unsigned long supported_standards(void); static void config_tvout_mode(unsigned long tvout_mode); static void conget_tvout_mode(unsigned long *p_tvout_mode); static void config_overscan_xy(unsigned long tv_std, unsigned long vga_mode, int overscan_x, int overscan_y, int pos_x, int pos_y); static void config_nco(unsigned long tv_std, unsigned long vga_mode); static void config_sharpness(int sharpness); static void conget_sharpness(int *p_sharpness); static void config_flicker(int flicker); static void conget_flicker(int *p_flicker); static void config_color(int color); static void conget_color(int *p_color); static void config_brightness_contrast(unsigned long tv_std, unsigned int trigger_bits, int brightness, int contrast); static void conget_brightness_contrast(unsigned long tv_std, unsigned int trigger_bits, int *p_brightness, int *p_contrast); static void config_yc_filter(unsigned long tv_std, int luma_filter, int chroma_filter); static void conget_yc_filter(int *p_luma_filter, int *p_chroma_filter); static void config_macrovision(unsigned long tv_std, unsigned int cp_trigger_bits); static void conget_macrovision(unsigned long tv_std, unsigned int *p_cp_trigger_bits); /* Device settings. */ typedef struct _S_DEVICE_SETTINGS { int tv_on; unsigned long vga_mode; unsigned long tv_std; unsigned long tvout_mode; int overscan_x; int overscan_y; int position_x; int position_y; int sharpness; int flicker; int color; int brightness; int contrast; unsigned char yc_filter; unsigned int aps_trigger_bits; int last_overscan_y; } S_DEVICE_SETTINGS; static S_DEVICE_SETTINGS d; /*========================================================================== * TV Setup Parameters *========================================================================== * */ static const struct { unsigned long chroma_freq[5]; unsigned short chroma_phase[5]; unsigned short cphase_rst[5]; unsigned short color[5]; unsigned short cr_burst_level[5]; unsigned short cb_burst_level[5]; unsigned short sys625_50[5]; unsigned short vsync5[5]; unsigned short pal_mode[5]; unsigned short hsync_width[5]; unsigned short burst_width[5]; unsigned short back_porch[5]; unsigned short front_porch[5]; unsigned short breeze_way[5]; unsigned short activeline[5]; unsigned short blank_level[5]; unsigned short vbi_blank_level[5]; unsigned short black_level[5]; unsigned short white_level[5]; unsigned short hamp_offset[5]; unsigned short sync_level[5]; unsigned short tv_lines[5]; unsigned short tv_width[5]; unsigned short tv_active_lines[5]; unsigned short tv_active_width[5]; unsigned char notch_filter[5]; unsigned short houston_cr[5]; unsigned short houston_ncodl[5]; unsigned short houston_ncodh[5]; } tvsetup = { /* ntsc, pal, ntsc-eij, pal-m, pal-n */ { 0x1f7cf021, 0xcb8a092a, 0x1f7cf021, 0xe3efe621, 0xcb8a092a}, /* chroma_freq */ { 0, 0, 0, 0, 0}, /* chroma_phase */ { 2, 0, 2, 0, 0}, /* cphase_rst */ { 54, 43, 54, 43, 43}, /* color */ { 0, 31, 0, 29, 29}, /* cr_burst_level */ { 59, 44, 59, 41, 41}, /* cb_burst_level */ { 0, 1, 0, 0, 1}, /* sys625_50 */ { 0, 1, 0, 0, 0}, /* vsync5 */ { 0, 1, 0, 1, 1}, /* pal_mode */ { 0x7a, 0x7a, 0x7a, 0x7a, 0x7a}, /* hsync_width */ { 0x40, 0x3c, 0x40, 0x40, 0x3c}, /* burst_width */ { 0x80, 0x9a, 0x80, 0x80, 0x9a}, /* back_porch */ { 0x24, 0x1e, 0x24, 0x24, 0x1e}, /* front_porch */ { 0x19, 0x1a, 0x19, 0x12, 0x1a}, /* breeze_way */ { 0xb4, 0xb4, 0xb4, 0xb4, 0xb4}, /* active_line */ { 240, 251, 240, 240, 240}, /* blank_level */ { 240, 251, 240, 240, 240}, /* vbi_blank_level */ { 284, 252, 240, 252, 252}, /* black_level */ { 823, 821, 823, 821, 821}, /* white_level */ { 60, 48, 60, 48, 48}, /* hamp_offset */ { 0x08, 0x08, 0x08, 0x08, 0x08}, /* sync_level */ { 525, 625, 525, 525, 625}, /* tv_lines */ { 858, 864, 858, 858, 864}, /* tv_width */ { 487, 576, 487, 487, 576}, /* tv_active_lines */ { 800, 800, 800, 800, 800}, /* tv_active_width */ { 0x1a, 0x1d, 0x1a, 0x1d, 0x1d}, /* notch filter enabled */ { 0x0000, 0x0100, 0x0000, 0x0000, 0x0100}, /* houston cr pal */ { 0x7e48, 0xf580, 0x7e48, 0x7e48, 0xf580}, /* houston ncodl */ { 0x001b, 0x0020, 0x001b, 0x001b, 0x0020} /* houston ncodh */ }; /* MediaGX default underscan and centered position setups. */ #define SCANTABLE_ENTRIES 5 struct _scantable { unsigned long mode; unsigned short v_total[5]; unsigned short v_sync[5]; unsigned short iha[5]; signed short iho[5]; signed short hsc[5]; }; static struct _scantable scantable[SCANTABLE_ENTRIES] = { { GFX_VGA_MODE_640X480, {617, 624, 617, 624, 624}, /* v_total */ {69, 88, 69, 88, 88}, /* v_sync */ {720, 720, 720, 720, 720}, /* iha */ {0, 0, 0, 0, 0}, /* iho */ {-12, 0, -6, 0, 0} /* hsc */ }, { GFX_VGA_MODE_800X600, {740, 740, 740, 740, 740}, /* v_total */ {90, 88, 90, 88, 88}, /* v_sync */ {720, 720, 508, 720, 720}, /* iha */ {-8, 11, -8, -8, 11}, /* iho */ {-27, -27, -27, -27, -27} /* hsc */ }, { GFX_VGA_MODE_720X487, {525, 720, 525, 720, 720}, /* v_total */ {23, 230, 23, 230, 230}, /* v_sync */ {720, 720, 720, 720, 720}, /* iha */ {0xa2, 0xa2, 0xa2, 0xa2, 0xa2}, /* iho */ {0, 0, 0, 0, 0} /* hsc */ }, { GFX_VGA_MODE_720X576, {720, 625, 720, 625, 625}, /* v_total */ {129, 25, 129, 25, 25}, /* v_sync */ {720, 720, 720, 720, 720}, /* iha */ {0xaa, 0xaa, 0xaa, 0xaa, 0xaa}, /* iho */ {0, 0, 0, 0, 0} /* hsc */ }, { GFX_VGA_MODE_1024X768, {933, 942, 933, 806, 806}, /* v_total */ {121, 112, 121, 88, 88}, /* v_sync */ {600, 600, 600, 600, 600}, /* iha */ {0x3c, 0x23, 0x3c, 0x65, 0x65}, /* iho */ {35, 26, 35, 26, 26} /* hsc */ }, }; /* Houston fifo configuration constants. */ struct _ffolat { int v_total; unsigned short ffolat; }; struct _ffolativo { int v_total; unsigned short ivo; unsigned short ffolat; }; /* h_total=832, ivo=40, tv_width=858, tv_lines=525, vga_lines=480 */ #define SIZE6X4NTSC 66 static struct _ffolat ffo6x4ntsc[SIZE6X4NTSC + 1] = { {541, 0x40}, {545, 0x40}, {549, 0x40}, {553, 0x40}, {557, 0x58}, {561, 0x40}, {565, 0x40}, {569, 0x40}, {573, 0x48}, {577, 0x40}, {581, 0x40}, {585, 0x40}, {589, 0x40}, {593, 0x48}, {597, 0x40}, {601, 0x40}, {605, 0x40}, {609, 0x40}, {613, 0x5b}, {617, 0x48}, {621, 0x60}, {625, 0x48}, {629, 0x48}, {633, 0x40}, {637, 0x5e}, {641, 0x40}, {645, 0x50}, {649, 0x56}, {653, 0x58}, {657, 0x6c}, {661, 0x40}, {665, 0x40}, {669, 0x40}, {673, 0x40}, {677, 0x40}, {681, 0x40}, {685, 0x40}, {689, 0x40}, {693, 0x40}, {697, 0x40}, {701, 0x40}, {705, 0x40}, {709, 0x40}, {713, 0x40}, {717, 0x40}, {721, 0x40}, {725, 0x40}, {729, 0x40}, {733, 0x40}, {737, 0x40}, {741, 0x40}, {745, 0x40}, {749, 0x40}, {753, 0x40}, {757, 0x40}, {761, 0x40}, {765, 0x40}, {769, 0x40}, {773, 0x40}, {777, 0x40}, {781, 0x40}, {785, 0x40}, {789, 0x40}, {793, 0x40}, {797, 0x30}, {801, 0x40}, {-1, 0} }; #define SIZE6X4PAL 45 static struct _ffolat ffo6x4pal[SIZE6X4PAL + 1] = { {625, 0x60}, {629, 0x60}, {633, 0x60}, {637, 0x60}, {641, 0x50}, {645, 0x60}, {649, 0x60}, {653, 0x60}, {657, 0x60}, {661, 0x60}, {665, 0x60}, {669, 0x60}, {673, 0x60}, {677, 0x60}, {681, 0x60}, {685, 0x60}, {689, 0x60}, {693, 0x60}, {697, 0x60}, {701, 0x60}, {705, 0x60}, {709, 0x60}, {713, 0x60}, {717, 0x60}, {721, 0x60}, {725, 0x60}, {729, 0x60}, {733, 0x60}, {737, 0x60}, {741, 0x60}, {745, 0x60}, {749, 0x60}, {753, 0x60}, {757, 0x60}, {761, 0x60}, {765, 0x60}, {769, 0x60}, {773, 0x60}, {777, 0x60}, {781, 0x60}, {785, 0x60}, {789, 0x60}, {793, 0x60}, {797, 0x60}, {801, 0x60}, {-1, 0} }; #define SIZE7X4NTSC 40 static struct _ffolat ffo7x4ntsc[SIZE7X4NTSC + 1] = { {525, 0x52}, {529, 0x52}, {533, 0x52}, {537, 0x52}, {541, 0x52}, {545, 0x40}, {549, 0x40}, {553, 0x40}, {557, 0x58}, {561, 0x40}, {565, 0x58}, {569, 0x40}, {573, 0x48}, {577, 0x40}, {581, 0x40}, {585, 0x40}, {589, 0x40}, {593, 0x48}, {597, 0x40}, {601, 0x40}, {605, 0x40}, {609, 0x40}, {613, 0x5b}, {617, 0x48}, {621, 0x60}, {625, 0x48}, {629, 0x48}, {633, 0x40}, {637, 0x5e}, {641, 0x40}, {645, 0x50}, {649, 0x56}, {653, 0x58}, {657, 0x6c}, {661, 0x40}, {665, 0x40}, {669, 0x40}, {673, 0x40}, {677, 0x40}, {681, 0x40}, {-1, 0} }; #define SIZE7X4PAL 24 static struct _ffolat ffo7x4pal[SIZE7X4PAL + 1] = { {625, 0x60}, {629, 0x60}, {633, 0x60}, {637, 0x60}, {641, 0x50}, {645, 0x60}, {649, 0x60}, {653, 0x60}, {657, 0x60}, {661, 0x60}, {665, 0x60}, {669, 0x60}, {673, 0x60}, {677, 0x60}, {681, 0x60}, {685, 0x60}, {689, 0x60}, {693, 0x60}, {697, 0x60}, {701, 0x60}, {705, 0x60}, {709, 0x60}, {713, 0x60}, {717, 0x60}, {-1, 0} }; #define SIZE7X5NTSC 54 static struct _ffolat ffo7x5ntsc[SIZE7X5NTSC + 1] = { {590, 0x40}, {594, 0x48}, {598, 0x40}, {602, 0x40}, {606, 0x40}, {610, 0x40}, {614, 0x5b}, {618, 0x48}, {622, 0x60}, {626, 0x48}, {630, 0x48}, {634, 0x40}, {638, 0x5e}, {642, 0x40}, {646, 0x50}, {650, 0x56}, {654, 0x58}, {658, 0x6c}, {662, 0x40}, {666, 0x40}, {670, 0x40}, {674, 0x40}, {678, 0x40}, {682, 0x40}, {686, 0x40}, {690, 0x40}, {694, 0x40}, {698, 0x40}, {702, 0x40}, {706, 0x40}, {710, 0x40}, {714, 0x40}, {718, 0x40}, {722, 0x40}, {726, 0x40}, {730, 0x40}, {734, 0x40}, {738, 0x40}, {742, 0x40}, {746, 0x40}, {750, 0x40}, {754, 0x40}, {758, 0x40}, {762, 0x40}, {766, 0x40}, {770, 0x40}, {774, 0x40}, {778, 0x40}, {782, 0x40}, {786, 0x40}, {790, 0x40}, {794, 0x40}, {798, 0x30}, {802, 0x40}, {-1, 0} }; #define SIZE7X5PAL 45 static struct _ffolat ffo7x5pal[SIZE7X5PAL + 1] = { {625, 0x60}, {629, 0x60}, {633, 0x60}, {637, 0x60}, {641, 0x50}, {645, 0x60}, {649, 0x60}, {653, 0x60}, {657, 0x60}, {661, 0x60}, {665, 0x60}, {669, 0x60}, {673, 0x60}, {677, 0x60}, {681, 0x60}, {685, 0x60}, {689, 0x60}, {693, 0x60}, {697, 0x60}, {701, 0x60}, {705, 0x60}, {709, 0x60}, {713, 0x60}, {717, 0x60}, {721, 0x60}, {725, 0x60}, {729, 0x60}, {733, 0x60}, {737, 0x60}, {741, 0x60}, {745, 0x60}, {749, 0x60}, {753, 0x60}, {757, 0x60}, {761, 0x60}, {765, 0x60}, {769, 0x60}, {773, 0x60}, {777, 0x60}, {781, 0x60}, {785, 0x60}, {789, 0x60}, {793, 0x60}, {797, 0x60}, {801, 0x60}, {-1, 0} }; /* h_total=1056, vga_lines=600 */ #define SIZE8X6NTSC 37 static struct _ffolat ffo8x6ntsc[SIZE8X6NTSC + 1] = { {620, 0x40}, /* v_total_min >= vsync+10 >= vga_lines+10 = 610 */ {625, 0x58}, {630, 0x40}, {635, 0x40}, {640, 0x40}, {645, 0x46}, {650, 0x46}, {655, 0x4f}, {660, 0x4c}, {665, 0x4a}, {670, 0x50}, {675, 0x2f}, {680, 0x48}, {685, 0x38}, {690, 0x31}, {695, 0x40}, {700, 0x21}, {705, 0x25}, {710, 0x40}, {715, 0x48}, {720, 0x50}, {725, 0x30}, {730, 0x50}, {735, 0x50}, {740, 0x50}, {745, 0x40}, {750, 0x38}, {755, 0x50}, {760, 0x50}, {765, 0x40}, {770, 0x38}, {775, 0x40}, {780, 0x40}, {785, 0x40}, {790, 0x38}, {795, 0x50}, {800, 0x50}, {-1, 0} }; /* h_total=1056, vga_lines=600 */ #define SIZE8X6PAL 36 static struct _ffolat ffo8x6pal[SIZE8X6PAL + 1] = { {625, 0x80}, {630, 0x80}, {635, 0x5a}, {640, 0x55}, {645, 0x48}, {650, 0x65}, {655, 0x65}, {660, 0x50}, {665, 0x80}, {670, 0x70}, {675, 0x56}, {680, 0x80}, {685, 0x58}, {690, 0x31}, {695, 0x80}, {700, 0x60}, {705, 0x45}, {710, 0x4a}, {715, 0x50}, {720, 0x50}, {725, 0x50}, {730, 0x45}, {735, 0x50}, {740, 0x50}, {745, 0x50}, {750, 0x50}, {755, 0x50}, {760, 0x50}, {765, 0x50}, {770, 0x50}, {775, 0x50}, {780, 0x50}, {785, 0x50}, {790, 0x50}, {795, 0x50}, {800, 0x50}, {-1, 0} }; /* h_total=1344, vga_lines=768 */ #define SIZE10X7NTSC 45 static struct _ffolativo ffo10x7ntsc[SIZE10X7NTSC] = { {783, 0x4d, 0x40}, {789, 0x47, 0x14}, {795, 0x47, 0x7f}, {801, 0x47, 0x53}, {807, 0x47, 0x11}, {813, 0x47, 0x78}, {819, 0x47, 0x54}, {825, 0x47, 0x40}, {831, 0x47, 0x0f}, {837, 0x4d, 0x40}, {843, 0x47, 0x5a}, {849, 0x4d, 0x40}, {855, 0x47, 0x4b}, {861, 0x4d, 0x40}, {867, 0x47, 0x4b}, {873, 0x4d, 0x40}, {879, 0x47, 0x07}, {885, 0x48, 0x20}, {891, 0x47, 0x82}, {897, 0x47, 0x60}, {903, 0x47, 0x7f}, {909, 0x4d, 0x40}, {915, 0x48, 0x40}, {921, 0x4c, 0x40}, {927, 0x49, 0x40}, {933, 0x48, 0x40}, {939, 0x4a, 0x40}, {945, 0x46, 0x40}, {951, 0x4a, 0x40}, {957, 0x4a, 0x40}, {963, 0x4b, 0x40}, {969, 0x4b, 0x40}, {975, 0x48, 0x40}, {981, 0x47, 0x40}, {987, 0x47, 0x40}, {993, 0x47, 0x40}, {999, 0x48, 0x40}, {1005, 0x48, 0x40}, {1011, 0x47, 0x40}, {1017, 0x47, 0x40}, {1023, 0x48, 0x40}, {1029, 0x48, 0x40}, {1035, 0x46, 0x40}, {1041, 0x47, 0x40}, {1047, 0x47, 0x40} }; /* h_total=1344, vga_lines=768 */ #define SIZE10X7PAL 46 static struct _ffolativo ffo10x7pal[SIZE10X7PAL] = { {781, 0x49, 0x40}, {787, 0x46, 0x40}, {793, 0x48, 0x40}, {799, 0x46, 0x40}, {805, 0x49, 0x40}, {811, 0x47, 0x40}, {817, 0x46, 0x40}, {823, 0x46, 0x56}, {829, 0x46, 0x2d}, {835, 0x46, 0x40}, {841, 0x46, 0x2d}, {847, 0x46, 0x3f}, {853, 0x46, 0x10}, {859, 0x46, 0x86}, {865, 0x46, 0xc9}, {871, 0x46, 0x83}, {877, 0x46, 0xa8}, {883, 0x46, 0x81}, {889, 0x46, 0xa5}, {895, 0x46, 0xa9}, {901, 0x46, 0x81}, {907, 0x46, 0xa4}, {913, 0x46, 0xa5}, {919, 0x46, 0x7f}, {925, 0x46, 0xa2}, {931, 0x46, 0x9d}, {937, 0x46, 0xc1}, {943, 0x46, 0x96}, {949, 0x46, 0xb7}, {955, 0x46, 0xb1}, {961, 0x46, 0x8a}, {967, 0x46, 0xa9}, {973, 0x46, 0xa0}, {979, 0x46, 0x40}, {985, 0x46, 0x97}, {991, 0x46, 0xb5}, {997, 0x46, 0xaa}, {1003, 0x46, 0x83}, {1009, 0x46, 0x9f}, {1015, 0x47, 0x40}, {1021, 0x46, 0xad}, {1027, 0x46, 0x87}, {1033, 0x46, 0xa2}, {1039, 0x47, 0x40}, {1045, 0x46, 0xac}, {1051, 0x46, 0x86} }; /*==========================================================================*/ /*FS450 API Functions. */ /*==========================================================================*/ /* Initialize device settings */ static void initialize_houston_static_registers(void) { houston_WriteReg(HOUSTON_BYP, 0, 2); houston_WriteReg(HOUSTON_APO, 0, 2); houston_WriteReg(HOUSTON_ALO, 0, 2); houston_WriteReg(HOUSTON_AFO, 0, 2); houston_WriteReg(HOUSTON_BCONTL, 0, 2); houston_WriteReg(HOUSTON_BCONTH, 0, 2); houston_WriteReg(HOUSTON_BDONE, 0, 2); houston_WriteReg(HOUSTON_BDIAGL, 0, 2); houston_WriteReg(HOUSTON_BDIAGH, 0, 2); houston_WriteReg(HOUSTON_MISC, 0, 2); } int FS450_init(void) { int err; TRACE(("FS450_Init()\n")) err = houston_init(); if (err) return err; initialize_houston_static_registers(); d.tv_on = PLAL_IsTVOn()? 1 : 0; /* get the current tv standard */ conget_tv_std(&d.tv_std); d.vga_mode = 0; /* default to VP_TVOUT_MODE_CVBS_YC */ d.tvout_mode = GFX_TVOUT_MODE_CVBS_YC; /* default to 1000 out of 1000 */ d.sharpness = 1000; config_sharpness(d.sharpness); /* default to 800 out of 1000 */ d.flicker = 800; config_flicker(d.flicker); /* default to zeros */ d.overscan_x = 0; d.overscan_y = 0; d.position_x = 0; d.position_y = 0; d.color = 50; /* d.color = tvsetup.color[k]; */ config_color(d.color); /* default */ d.brightness = 50; d.contrast = 60; config_brightness_contrast(d.tv_std, d.aps_trigger_bits, d.brightness, d.contrast); /* get the current yc filtering */ { int luma_filter, chroma_filter; conget_yc_filter(&luma_filter, &chroma_filter); d.yc_filter = 0; if (luma_filter) d.yc_filter |= GFX_LUMA_FILTER; if (chroma_filter) d.yc_filter |= GFX_CHROMA_FILTER; } d.aps_trigger_bits = 0; config_macrovision(d.tv_std, d.aps_trigger_bits); d.last_overscan_y = -10000; return 0; } void FS450_cleanup(void) { } /*==========================================================================*/ /* Required configuration calls to write new settings to the device */ /*==========================================================================*/ #define REQ_TV_STANDARD_BIT 0x0002 #define REQ_VGA_MODE_BIT 0x0004 #define REQ_TVOUT_MODE_BIT 0x0008 #define REQ_SHARPNESS_BIT 0x0010 #define REQ_FLICKER_BIT 0x0020 #define REQ_OVERSCAN_POSITION_BIT 0x0040 #define REQ_COLOR_BIT 0x0080 #define REQ_BRIGHTNESS_CONTRAST_BIT 0x0100 #define REQ_YC_FILTER_BIT 0x0200 #define REQ_MACROVISION_BIT 0x0400 #define REQ_NCO_BIT 0x1000 #define REQ_TV_STANDARD (REQ_TV_STANDARD_BIT | REQ_OVERSCAN_POSITION \ | REQ_BRIGHTNESS_CONTRAST \ | REQ_MACROVISION_BIT | REQ_YC_FILTER) #define REQ_VGA_MODE (REQ_VGA_MODE_BIT | REQ_OVERSCAN_POSITION) #define REQ_TVOUT_MODE (REQ_TVOUT_MODE_BIT) #define REQ_SHARPNESS (REQ_SHARPNESS_BIT) #define REQ_FLICKER (REQ_FLICKER_BIT) #define REQ_OVERSCAN_POSITION (REQ_OVERSCAN_POSITION_BIT | REQ_NCO) #define REQ_COLOR (REQ_COLOR_BIT) #define REQ_BRIGHTNESS_CONTRAST (REQ_BRIGHTNESS_CONTRAST_BIT) #define REQ_YC_FILTER (REQ_YC_FILTER_BIT) #define REQ_MACROVISION (REQ_TV_STANDARD_BIT | \ REQ_BRIGHTNESS_CONTRAST_BIT | \ REQ_MACROVISION_BIT) #define REQ_NCO (REQ_NCO_BIT) #define REQ_ENCODER (REQ_TV_STANDARD | REQ_COLOR | \ REQ_BRIGHTNESS_CONTRAST | REQ_YC_FILTER) static int write_config(int req) { unsigned long reg, reg_encoder_reset = 0; int reset; /*if we're changing the nco, and the vertical scaling has changed... */ reset = ((REQ_NCO_BIT & req) && (d.overscan_y != d.last_overscan_y)); if (reset) { /*put the encoder into reset while making changes */ houston_ReadReg(ENC_RESET, ®, 1); houston_WriteReg(ENC_RESET, reg | 0x01, 1); reg_encoder_reset = reg & 0x01; } if (REQ_TV_STANDARD_BIT & req) config_tv_std(d.tv_std, d.aps_trigger_bits); if (REQ_VGA_MODE_BIT & req) config_vga_mode(d.vga_mode); if (REQ_TVOUT_MODE_BIT & req) config_tvout_mode(d.tvout_mode); if (REQ_OVERSCAN_POSITION_BIT & req) { config_overscan_xy(d.tv_std, d.vga_mode, d.overscan_x, d.overscan_y, d.position_x, d.position_y); /*h_timing and v_timing and syncs. */ if (PLAL_IsTVOn()) PLAL_SetTVTimingRegisters(p_specs()); } if (REQ_NCO_BIT & req) config_nco(d.tv_std, d.vga_mode); if (REQ_SHARPNESS_BIT & req) config_sharpness(d.sharpness); if (REQ_FLICKER_BIT & req) config_flicker(d.flicker); if (REQ_COLOR_BIT & req) config_color(d.color); if (REQ_BRIGHTNESS_CONTRAST_BIT & req) { config_brightness_contrast(d.tv_std, d.aps_trigger_bits, d.brightness, d.contrast); } if (REQ_YC_FILTER_BIT & req) { config_yc_filter(d.tv_std, (d.yc_filter & GFX_LUMA_FILTER), (d.yc_filter & GFX_CHROMA_FILTER)); } if (REQ_MACROVISION_BIT & req) config_macrovision(d.tv_std, d.aps_trigger_bits); /*if we decided to put the encoder into reset, put it back */ if (reset) { houston_ReadReg(ENC_RESET, ®, 1); houston_WriteReg(ENC_RESET, reg_encoder_reset | (reg & ~0x01), 1); d.last_overscan_y = d.overscan_y; } return 0; } /*==========================================================================*/ /* TV On */ /*==========================================================================*/ #if GFX_TV_DYNAMIC int fs450_get_tv_enable(unsigned int *p_on) #else int gfx_get_tv_enable(unsigned int *p_on) #endif { if (!p_on) return ERR_INVALID_PARAMETER; *p_on = d.tv_on; return 0; } /*//int FS450_set_tv_on(unsigned int on)*/ #if GFX_TV_DYNAMIC int fs450_set_tv_enable(int on) #else int gfx_set_tv_enable(int on) #endif { unsigned long reg; /*if not mode change, just return */ if ((d.tv_on && on) || (!d.tv_on && !on)) return 0; /*if turning off... */ if (!on) { /*reenable vga. */ PLAL_EnableVga(); /*power down houston */ config_power(0); d.tv_on = 0; return 0; } /*turning on... */ /*power up houston */ config_power(1); /*assert encoder reset. */ houston_WriteReg(ENC_RESET, 0x01, 1); /*initial platform preparation */ PLAL_PrepForTVout(); /*configure encoder and nco. */ write_config(REQ_VGA_MODE | REQ_TV_STANDARD | REQ_TVOUT_MODE | REQ_OVERSCAN_POSITION | REQ_YC_FILTER | REQ_MACROVISION); /*set LP_EN and UIM */ houston_ReadReg(HOUSTON_CR, ®, 2); reg |= CR_LP_EN; reg &= ~(CR_UIM_MOD0 | CR_UIM_MOD1); reg |= (PLAL_FS450_UIM_mode() << 14); houston_WriteReg(HOUSTON_CR, reg, 2); /*set platform timing registers */ PLAL_SetTVTimingRegisters(p_specs()); PLAL_FinalEnableTVout(d.vga_mode); /*sync bridge */ { int retry_count = 0; /*sync 50 times */ while (retry_count++ < 50) { /*sync bridge. */ houston_ReadReg(HOUSTON_MISC, ®, 2); reg |= MISC_BRIDGE_SYNC; houston_WriteReg(HOUSTON_MISC, reg, 2); reg &= ~MISC_BRIDGE_SYNC; houston_WriteReg(HOUSTON_MISC, reg, 2); } } /*deassert encoder reset. */ houston_WriteReg(ENC_RESET, 0x00, 1); d.tv_on = 1; return 0; } #if GFX_TV_DYNAMIC int fs450_set_tv_defaults(int format) #else int gfx_set_tv_defaults(int format) #endif { return 0; } /*==========================================================================*/ /* TV standard */ /*==========================================================================*/ #if GFX_TV_DYNAMIC int fs450_get_tv_standard(unsigned long *p_standard) #else int gfx_get_tv_standard(unsigned long *p_standard) #endif { if (!p_standard) return ERR_INVALID_PARAMETER; *p_standard = d.tv_std; return 0; } #if GFX_TV_DYNAMIC int fs450_get_available_tv_standards(unsigned long *p_standards) #else int gfx_get_available_tv_standards(unsigned long *p_standards) #endif { if (!p_standards) return ERR_INVALID_PARAMETER; *p_standards = supported_standards(); return 0; } #if GFX_TV_DYNAMIC int fs450_set_tv_standard(unsigned long standard) #else int gfx_set_tv_standard(unsigned long standard) #endif { /* verify supported standard. */ if (!(standard & supported_standards())) return ERR_INVALID_PARAMETER; /* disallow if tv is on */ if (d.tv_on) return ERR_CANNOT_CHANGE_WHILE_TV_ON; d.tv_std = standard; /* d.color = tvsetup.color[k]; */ return write_config(REQ_TV_STANDARD); } /*==========================================================================*/ /* vga mode as known by the driver */ /*==========================================================================*/ #if GFX_TV_DYNAMIC int fs450_get_tv_vga_mode(unsigned long *p_vga_mode) #else int gfx_get_tv_vga_mode(unsigned long *p_vga_mode) #endif { if (!p_vga_mode) return ERR_INVALID_PARAMETER; *p_vga_mode = d.vga_mode; return 0; } #if GFX_TV_DYNAMIC int fs450_get_available_tv_vga_modes(unsigned long *p_vga_modes) #else int gfx_get_available_tv_vga_modes(unsigned long *p_vga_modes) #endif { if (!p_vga_modes) return ERR_INVALID_PARAMETER; *p_vga_modes = GFX_VGA_MODE_640X480 | GFX_VGA_MODE_720X487 | GFX_VGA_MODE_720X576 | GFX_VGA_MODE_800X600; if (houston_Rev() >= HOUSTON_REV_B) *p_vga_modes |= GFX_VGA_MODE_1024X768; return 0; } #if GFX_TV_DYNAMIC int fs450_set_tv_vga_mode(unsigned long vga_mode) #else int gfx_set_tv_vga_mode(unsigned long vga_mode) #endif { /*reject if not a single valid VGA mode */ switch (vga_mode) { default: return ERR_INVALID_PARAMETER; case GFX_VGA_MODE_640X480: case GFX_VGA_MODE_720X487: case GFX_VGA_MODE_720X576: case GFX_VGA_MODE_800X600: break; case GFX_VGA_MODE_1024X768: if (houston_Rev() >= HOUSTON_REV_B) break; return ERR_INVALID_PARAMETER; } /*if the mode has changed... */ if (vga_mode != d.vga_mode) { d.vga_mode = vga_mode; return write_config(REQ_VGA_MODE); } return 0; } /*==========================================================================*/ /* tvout mode */ /*==========================================================================*/ #if GFX_TV_DYNAMIC int fs450_get_tvout_mode(unsigned long *p_tvout_mode) #else int gfx_get_tvout_mode(unsigned long *p_tvout_mode) #endif { if (!p_tvout_mode) return ERR_INVALID_PARAMETER; *p_tvout_mode = d.tvout_mode; return 0; } #if GFX_TV_DYNAMIC int fs450_set_tvout_mode(unsigned long tvout_mode) #else int gfx_set_tvout_mode(unsigned long tvout_mode) #endif { d.tvout_mode = tvout_mode; return write_config(REQ_TVOUT_MODE); } /*==========================================================================*/ /* Sharpness */ /*==========================================================================*/ #if GFX_TV_DYNAMIC int fs450_get_sharpness(int *p_sharpness) #else int gfx_get_sharpness(int *p_sharpness) #endif { if (!p_sharpness) return ERR_INVALID_PARAMETER; *p_sharpness = d.sharpness; return 0; } #if GFX_TV_DYNAMIC int fs450_set_sharpness(int sharpness) #else int gfx_set_sharpness(int sharpness) #endif { d.sharpness = range_limit(sharpness, 0, 1000); return write_config(REQ_SHARPNESS); } /*==========================================================================*/ /* flicker filter control. */ /*==========================================================================*/ #if GFX_TV_DYNAMIC int fs450_get_flicker_filter(int *p_flicker) #else int gfx_get_flicker_filter(int *p_flicker) #endif { if (!p_flicker) return ERR_INVALID_PARAMETER; *p_flicker = d.flicker; return 0; } #if GFX_TV_DYNAMIC int fs450_set_flicker_filter(int flicker) #else int gfx_set_flicker_filter(int flicker) #endif { d.flicker = range_limit(flicker, 0, 1000); return write_config(REQ_FLICKER); } /*==========================================================================*/ /* Overscan and Position */ /*==========================================================================*/ #if GFX_TV_DYNAMIC int fs450_get_overscan(int *p_x, int *p_y) #else int gfx_get_overscan(int *p_x, int *p_y) #endif { if (!p_x || !p_y) return ERR_INVALID_PARAMETER; *p_x = d.overscan_x; *p_y = d.overscan_y; return 0; } #if GFX_TV_DYNAMIC int fs450_set_overscan(int x, int y) #else int gfx_set_overscan(int x, int y) #endif { d.overscan_x = range_limit(x, -1000, 1000); d.overscan_y = range_limit(y, -1000, 1000); return write_config(REQ_OVERSCAN_POSITION); } #if GFX_TV_DYNAMIC int fs450_get_position(int *p_x, int *p_y) #else int gfx_get_position(int *p_x, int *p_y) #endif { if (!p_x || !p_y) return ERR_INVALID_PARAMETER; *p_x = d.position_x; *p_y = d.position_y; return 0; } #if GFX_TV_DYNAMIC int fs450_set_position(int x, int y) #else int gfx_set_position(int x, int y) #endif { d.position_x = range_limit(x, -1000, 1000); d.position_y = range_limit(y, -1000, 1000); return write_config(REQ_OVERSCAN_POSITION); } /*==========================================================================*/ /* Color, Brightness, and Contrast */ /*==========================================================================*/ #if GFX_TV_DYNAMIC int fs450_get_color(int *p_color) #else int gfx_get_color(int *p_color) #endif { if (!p_color) return ERR_INVALID_PARAMETER; *p_color = d.color; return 0; } #if GFX_TV_DYNAMIC int fs450_set_color(int color) #else int gfx_set_color(int color) #endif { d.color = range_limit(color, 0, 100); return write_config(REQ_COLOR); } #if GFX_TV_DYNAMIC int fs450_get_brightness(int *p_brightness) #else int gfx_get_brightness(int *p_brightness) #endif { if (!p_brightness) return ERR_INVALID_PARAMETER; *p_brightness = d.brightness; return 0; } #if GFX_TV_DYNAMIC int fs450_set_brightness(int brightness) #else int gfx_set_brightness(int brightness) #endif { d.brightness = range_limit(brightness, 0, 100); return write_config(REQ_BRIGHTNESS_CONTRAST); } #if GFX_TV_DYNAMIC int fs450_get_contrast(int *p_contrast) #else int gfx_get_contrast(int *p_contrast) #endif { if (!p_contrast) return ERR_INVALID_PARAMETER; *p_contrast = d.contrast; return 0; } #if GFX_TV_DYNAMIC int fs450_set_contrast(int constrast) #else int gfx_set_contrast(int constrast) #endif { d.contrast = range_limit(constrast, 0, 100); return write_config(REQ_BRIGHTNESS_CONTRAST); } /*==========================================================================*/ /* YC filters */ /*==========================================================================*/ #if GFX_TV_DYNAMIC int fs450_get_yc_filter(unsigned int *p_yc_filter) #else int gfx_get_yc_filter(unsigned int *p_yc_filter) #endif { if (!p_yc_filter) return ERR_INVALID_PARAMETER; if (houston_Rev() < HOUSTON_REV_B) return ERR_NOT_SUPPORTED; *p_yc_filter = d.yc_filter; return 0; } #if GFX_TV_DYNAMIC int fs450_set_yc_filter(unsigned int yc_filter) #else int gfx_set_yc_filter(unsigned int yc_filter) #endif { if (houston_Rev() < HOUSTON_REV_B) return ERR_NOT_SUPPORTED; /*luma filter. */ if (yc_filter & GFX_LUMA_FILTER) d.yc_filter |= GFX_LUMA_FILTER; else d.yc_filter &= ~GFX_LUMA_FILTER; /*chroma filter. */ if (yc_filter & GFX_CHROMA_FILTER) d.yc_filter |= GFX_CHROMA_FILTER; else d.yc_filter &= ~GFX_CHROMA_FILTER; return write_config(REQ_YC_FILTER); } #if GFX_TV_DYNAMIC int fs450_get_aps_trigger_bits(unsigned int *p_trigger_bits) #else int gfx_get_aps_trigger_bits(unsigned int *p_trigger_bits) #endif { if (!p_trigger_bits) return ERR_INVALID_PARAMETER; *p_trigger_bits = d.aps_trigger_bits; return 0; } #if GFX_TV_DYNAMIC int fs450_set_aps_trigger_bits(unsigned int trigger_bits) #else int gfx_set_aps_trigger_bits(unsigned int trigger_bits) #endif { d.aps_trigger_bits = trigger_bits; return write_config(REQ_MACROVISION); } /*---------------------------------------------------------------------------- * gfx_set_tv_format * * This routine sets the TV encoder registers to the specified format * and resolution. * Currently only NTSC 640x480 is supported. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int fs450_set_tv_format(TVStandardType format, GfxOnTVType resolution) #else int gfx_set_tv_format(TVStandardType format, GfxOnTVType resolution) #endif { /* ### ADD ### IMPLEMENTATION */ return (0); } /*---------------------------------------------------------------------------- * gfx_set_tv_output * * This routine sets the TV encoder registers to the specified output type. * Supported output types are : S-VIDEO and Composite. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int fs450_set_tv_output(int output) #else int gfx_set_tv_output(int output) #endif { /* ### ADD ### IMPLEMENTATION */ return (0); } /*---------------------------------------------------------------------------- * gfx_set_tv_cc_enable * * This routine enables or disables the use of the hardware CC registers * in the TV encoder. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int fs450_set_tv_cc_enable(int enable) #else int gfx_set_tv_cc_enable(int enable) #endif { /* ### ADD ### IMPLEMENTATION */ return (0); } /*---------------------------------------------------------------------------- * gfx_set_tv_cc_data * * This routine writes the two specified characters to the CC data register * of the TV encoder. *---------------------------------------------------------------------------- */ #if GFX_TV_DYNAMIC int fs450_set_tv_cc_data(unsigned char data1, unsigned char data2) #else int gfx_set_tv_cc_data(unsigned char data1, unsigned char data2) #endif { /* ### ADD ### IMPLEMENTATION */ return (0); } #ifdef FS450_DIRECTREG /*==========================================================================*/ /* Direct Read and Write registers */ /*==========================================================================*/ int FS450_ReadRegister(S_REG_INFO * p_reg) { unsigned long tmp; if (PLAL_ReadRegister(p_reg)) return 0; if (SOURCE_HOUSTON == p_reg->source) { switch (p_reg->size) { case 1: case 2: { houston_ReadReg((int) p_reg->offset, &tmp, (int) p_reg->size); p_reg->value = tmp; } return 0; case 4: { houston_ReadReg((unsigned int) p_reg->offset, &tmp, 2); p_reg->value = (tmp << 16); houston_ReadReg((unsigned int) (p_reg->offset + 2), &tmp, 2); p_reg->value |= tmp; } return 0; } } return ERR_INVALID_PARAMETER; } int FS450_WriteRegister(S_REG_INFO * p_reg) { if (PLAL_WriteRegister(p_reg)) return 0; if (SOURCE_HOUSTON == p_reg->source) { houston_WriteReg((unsigned int) p_reg->offset, p_reg->value, p_reg->size); return 0; } return ERR_INVALID_PARAMETER; } #endif /* Houston initialization function. */ static int g_houston_rev = -1; static int houston_init(void) { /*//int errc; */ unsigned long write, read; TRACE(("houston_init()\n")) /*Before we begin, we must enable power to the TFT */ read = READ_VID32(CS5530_DISPLAY_CONFIG); read |= CS5530_DCFG_FP_PWR_EN | CS5530_DCFG_FP_DATA_EN; WRITE_VID32(CS5530_DISPLAY_CONFIG, read); /*simple w/r test. */ write = 0x0055; read = 0; houston_WriteReg(HOUSTON_IHO, write, 2); houston_ReadReg(HOUSTON_IHO, &read, 2); if (read != write) { houston_WriteReg(HOUSTON_IHO, write, 2); houston_ReadReg(HOUSTON_IHO, &read, 2); if (read != write) { /*chip is not there, do something appropriate? */ TRACE(("wrote HOUSTON_IHO=0x0055, read 0x%04x\n", read)) return ERR_DEVICE_NOT_FOUND; } } /*read chip revision. */ houston_ReadReg(HOUSTON_REV, &read, 2); g_houston_rev = (int) read; /*ok. */ return 0; } static int houston_Rev(void) { return g_houston_rev; } static S_TIMING_SPECS g_specs; static const S_TIMING_SPECS * p_specs(void) { return &g_specs; } /*==========================================================================*/ /* FS450 configuration functions. */ /*==========================================================================*/ static int config_init(void) { int err; TRACE(("config_init()\n")) err = houston_init(); if (err) return err; return 0; } /*==========================================================================*/ /* convert word to encoder 10 bit value. */ /*==========================================================================*/ static unsigned short w10bit2z(unsigned short w) { return (w >> 2) | ((w & 0x03) << 8); } static unsigned short z2w10bit(unsigned short z) { return (0x03 & (z >> 8)) | ((0xFF & z) << 2); } /*==========================================================================*/ /* TV Standards */ /*==========================================================================*/ static const struct { unsigned long standard; int tvsetup_index; } g_tv_standards[] = { { GFX_TV_STANDARD_NTSC_M, 0}, { GFX_TV_STANDARD_NTSC_M_J, 2}, { GFX_TV_STANDARD_PAL_B, 1}, { GFX_TV_STANDARD_PAL_D, 1}, { GFX_TV_STANDARD_PAL_H, 1}, { GFX_TV_STANDARD_PAL_I, 1}, { GFX_TV_STANDARD_PAL_M, 3}, { GFX_TV_STANDARD_PAL_N, 4}, { GFX_TV_STANDARD_PAL_G, 1},}; static int map_tvstd_to_index(unsigned long tv_std) { unsigned int i; for (i = 0; i < sizeof(g_tv_standards) / sizeof(*g_tv_standards); i++) { if (tv_std == g_tv_standards[i].standard) return g_tv_standards[i].tvsetup_index; } return -1; } static unsigned long supported_standards(void) { unsigned long standards = 0; unsigned int i; for (i = 0; i < sizeof(g_tv_standards) / sizeof(*g_tv_standards); i++) { if (g_tv_standards[i].tvsetup_index >= 0) standards |= g_tv_standards[i].standard; } return standards; } /*==========================================================================*/ static void config_power(int on) { unsigned long reg; if (houston_Rev() < HOUSTON_REV_B) { /* no power down supported, but still turn of clock in off mode */ if (on) { houston_ReadReg(HOUSTON_CR, ®, 2); reg &= ~(CR_CLKOFF | CR_RESET); houston_WriteReg(HOUSTON_CR, reg, 2); reg |= CR_RESET; houston_WriteReg(HOUSTON_CR, reg, 2); reg &= ~CR_RESET; houston_WriteReg(HOUSTON_CR, reg, 2); } else { houston_ReadReg(HOUSTON_CR, ®, 2); reg |= CR_CLKOFF; houston_WriteReg(HOUSTON_CR, reg, 2); } return; } if (on) { /* !CLKOFF, !COMPOFF, !YCOFF */ /* and reset Houston */ houston_ReadReg(HOUSTON_CR, ®, 2); reg &= ~(CR_CLKOFF | CR_RESET | CR_COMPOFF | CR_YCOFF); houston_WriteReg(HOUSTON_CR, reg, 2); reg |= CR_RESET; houston_WriteReg(HOUSTON_CR, reg, 2); reg &= ~CR_RESET; houston_WriteReg(HOUSTON_CR, reg, 2); /* !GTLIO_PD */ houston_ReadReg(HOUSTON_MISC, ®, 2); reg &= ~MISC_GTLIO_PD; houston_WriteReg(HOUSTON_MISC, reg, 2); } else { /* CLKOFF, COMPOFF, YCOFF */ houston_ReadReg(HOUSTON_CR, ®, 2); reg |= (CR_CLKOFF | CR_COMPOFF | CR_YCOFF); houston_WriteReg(HOUSTON_CR, reg, 2); /* GTLIO_PD */ houston_ReadReg(HOUSTON_MISC, ®, 2); reg |= MISC_GTLIO_PD; houston_WriteReg(HOUSTON_MISC, reg, 2); } } /*==========================================================================*/ /* VGA mode */ /*==========================================================================*/ static void config_vga_mode(unsigned long vga_mode) { /*h_total must be evenly divisible by 32? */ static struct { unsigned long mode; int width; int lines; int h_total; } vgaparams[] = { { GFX_VGA_MODE_640X480, 640, 480, 1056}, { GFX_VGA_MODE_720X487, 720, 487, 1056}, { GFX_VGA_MODE_720X576, 720, 576, 1056}, { GFX_VGA_MODE_800X600, 800, 600, 1056}, { GFX_VGA_MODE_1024X768, 1024, 768, 1344},}; unsigned long cr, misc, byp; unsigned int i; g_specs.vga_width = 0; g_specs.vga_lines = 0; g_specs.h_total = 0; for (i = 0; i < sizeof(vgaparams) / sizeof(*vgaparams); i++) { if (vga_mode == vgaparams[i].mode) { g_specs.vga_width = vgaparams[i].width; g_specs.vga_lines = vgaparams[i].lines; g_specs.h_total = vgaparams[i].h_total; break; } } if (!g_specs.h_total) return; /*clock mux decimator and vga dual. */ houston_ReadReg(HOUSTON_CR, &cr, 2); houston_ReadReg(HOUSTON_MISC, &misc, 2); houston_ReadReg(HOUSTON_BYP, &byp, 2); if (vga_mode == GFX_VGA_MODE_1024X768) { /*XGA*/ cr |= CR_UIM_DEC; misc |= MISC_VGACKDIV; byp |= (BYP_HDS_BYPASS | BYP_CAC_BYPASS); } else { /*VGA,SVGA */ cr &= ~CR_UIM_DEC; misc &= ~MISC_VGACKDIV; byp &= ~(BYP_HDS_BYPASS | BYP_CAC_BYPASS); } houston_WriteReg(HOUSTON_CR, cr, 2); houston_WriteReg(HOUSTON_MISC, misc, 2); houston_WriteReg(HOUSTON_BYP, byp, 2); } /*==========================================================================*/ /* Write settings for TV standard to device */ /*==========================================================================*/ static void config_tv_std(unsigned long tv_std, unsigned int trigger_bits) { int k; unsigned short reg34; unsigned long cr, w; unsigned long l; /*verify supported standard. */ k = map_tvstd_to_index(tv_std); if (k < 0) return; /*store tv width and lines */ g_specs.tv_width = tvsetup.tv_width[k]; g_specs.tv_lines = tvsetup.tv_lines[k]; /*houston CR register. */ houston_ReadReg(HOUSTON_CR, &cr, 2); cr &= ~CR_656_PAL_NTSC; cr |= tvsetup.houston_cr[k]; houston_WriteReg(HOUSTON_CR, cr, 2); /*setup the encoder. */ l = tvsetup.chroma_freq[k]; houston_WriteReg(ENC_CHROMA_FREQ, (int) (l & 0x00ff), 1); houston_WriteReg(ENC_CHROMA_FREQ + 1, (int) ((l >> 8) & 0x00ff), 1); houston_WriteReg(ENC_CHROMA_FREQ + 2, (int) ((l >> 16) & 0x00ff), 1); houston_WriteReg(ENC_CHROMA_FREQ + 3, (int) ((l >> 24) & 0x00ff), 1); houston_WriteReg(ENC_CHROMA_PHASE, tvsetup.chroma_phase[k], 1); houston_WriteReg(ENC_REG05, 0x00, 1); /*reg 0x05 */ houston_WriteReg(ENC_REG06, 0x89, 1); /*reg 0x06 */ houston_WriteReg(ENC_REG07, 0x00, 1); /*reg 0x07 */ houston_WriteReg(ENC_HSYNC_WIDTH, tvsetup.hsync_width[k], 1); houston_WriteReg(ENC_BURST_WIDTH, tvsetup.burst_width[k], 1); houston_WriteReg(ENC_BACK_PORCH, tvsetup.back_porch[k], 1); houston_WriteReg(ENC_CB_BURST_LEVEL, tvsetup.cb_burst_level[k], 1); houston_WriteReg(ENC_CR_BURST_LEVEL, tvsetup.cr_burst_level[k], 1); houston_WriteReg(ENC_SLAVE_MODE, 0x01, 1); /*slave mode */ if (trigger_bits == 0) w = w10bit2z(tvsetup.blank_level[k]); /*blank level */ else w = w10bit2z((unsigned short) (tvsetup.blank_level[k] - tvsetup.hamp_offset[k])); houston_WriteReg(ENC_BLANK_LEVEL, w & 0x00ff, 1); houston_WriteReg(ENC_BLANK_LEVEL + 1, w >> 8, 1); w = w10bit2z(tvsetup.tv_lines[k]); /*num_lines */ houston_WriteReg(ENC_NUM_LINES, w & 0x00ff, 1); houston_WriteReg(ENC_NUM_LINES + 1, w >> 8, 1); houston_WriteReg(ENC_TINT, 0x00, 1); /*tint */ houston_WriteReg(ENC_BREEZE_WAY, tvsetup.breeze_way[k], 1); houston_WriteReg(ENC_FRONT_PORCH, tvsetup.front_porch[k], 1); houston_WriteReg(ENC_ACTIVELINE, tvsetup.activeline[k], 1); houston_WriteReg(ENC_FIRST_LINE, 0x15, 1); /*firstvideoline */ reg34 = 0x80 | (tvsetup.pal_mode[k] << 6) | (tvsetup.sys625_50[k] << 3) | (tvsetup.cphase_rst[k] << 1) | (tvsetup.vsync5[k]); houston_WriteReg(ENC_REG34, reg34, 1); /*reg 0x34 */ houston_WriteReg(ENC_SYNC_LEVEL, tvsetup.sync_level[k], 1); if (trigger_bits == 0) w = w10bit2z(tvsetup.vbi_blank_level[k]); /*blank level */ else w = w10bit2z((unsigned short) (tvsetup.vbi_blank_level[k] - 1)); houston_WriteReg(ENC_VBI_BLANK_LEVEL, w & 0x00ff, 1); houston_WriteReg(ENC_VBI_BLANK_LEVEL + 1, w >> 8, 1); } static void conget_tv_std(unsigned long *p_tv_standard) { unsigned long cr; if (!p_tv_standard) return; /*just pick between NTSC and PAL */ houston_ReadReg(HOUSTON_CR, &cr, 2); if (CR_656_PAL_NTSC & cr) *p_tv_standard = GFX_TV_STANDARD_PAL_B; else *p_tv_standard = GFX_TV_STANDARD_NTSC_M; } /*==========================================================================*/ /* TVout mode */ /*==========================================================================*/ static void config_tvout_mode(unsigned long tvout_mode) { unsigned long cr; houston_ReadReg(HOUSTON_CR, &cr, 2); /*all dacs off */ cr |= (CR_COMPOFF | CR_YCOFF); /*not rgb */ cr &= ~CR_OFMT; /*turn on requested output */ if (GFX_TVOUT_MODE_CVBS & tvout_mode) cr &= ~CR_COMPOFF; if (GFX_TVOUT_MODE_YC & tvout_mode) cr &= ~CR_YCOFF; if (GFX_TVOUT_MODE_RGB & tvout_mode) { cr &= ~(CR_COMPOFF | CR_YCOFF); cr |= CR_OFMT; } houston_WriteReg(HOUSTON_CR, cr, 2); } static void conget_tvout_mode(unsigned long *p_tvout_mode) { unsigned long cr; if (!p_tvout_mode) return; houston_ReadReg(HOUSTON_CR, &cr, 2); if (CR_OFMT & cr) *p_tvout_mode = GFX_TVOUT_MODE_RGB; else { *p_tvout_mode = 0; if (!(CR_YCOFF & cr)) *p_tvout_mode |= GFX_TVOUT_MODE_YC; if (!(CR_COMPOFF & cr)) *p_tvout_mode |= GFX_TVOUT_MODE_CVBS; } } /*==========================================================================*/ /* Size & Position */ /*==========================================================================*/ #define IS_NTSC(tv_std) \ (tv_std & ( \ GFX_TV_STANDARD_NTSC_M | \ GFX_TV_STANDARD_NTSC_M_J | \ GFX_TV_STANDARD_PAL_M)) #define IS_PAL(tv_std) \ (tv_std & ( \ GFX_TV_STANDARD_PAL_B | \ GFX_TV_STANDARD_PAL_D | \ GFX_TV_STANDARD_PAL_H | \ GFX_TV_STANDARD_PAL_I | \ GFX_TV_STANDARD_PAL_N | \ GFX_TV_STANDARD_PAL_G)) /*return fifo delay setting for mode, std, and total lines.*/ static void get_ffolat_ivo(unsigned long vga_mode, unsigned long tv_std, long i, unsigned short *ffolat, unsigned short *ivo) { switch (vga_mode) { case GFX_VGA_MODE_640X480: if (IS_NTSC(tv_std)) { if (i > SIZE6X4NTSC - 1) i = SIZE6X4NTSC - 1; *ffolat = ffo6x4ntsc[i].ffolat; *ivo = 0x20; } else { if (i > SIZE6X4PAL - 1) i = SIZE6X4PAL - 1; *ffolat = ffo6x4pal[i].ffolat; *ivo = 0x28; } break; case GFX_VGA_MODE_800X600: if (IS_NTSC(tv_std)) { if (i > SIZE8X6NTSC - 1) i = SIZE8X6NTSC - 1; *ffolat = ffo8x6ntsc[i].ffolat; *ivo = 0x3a; } else { if (i > SIZE8X6PAL - 1) i = SIZE8X6PAL - 1; *ffolat = ffo8x6pal[i].ffolat; *ivo = 0x39; } break; case GFX_VGA_MODE_720X487: *ffolat = 0x40; /*FFO7x4; */ *ivo = 0x1a; break; case GFX_VGA_MODE_720X576: *ffolat = 0x40; /*FFO7x5; */ *ivo = 0x1a; break; case GFX_VGA_MODE_1024X768: default: if (IS_NTSC(tv_std)) { if (i > SIZE10X7NTSC - 1) i = SIZE10X7NTSC - 1; *ffolat = ffo10x7ntsc[i].ffolat; *ivo = ffo10x7ntsc[i].ivo; } else { if (i > SIZE10X7PAL - 1) i = SIZE10X7PAL - 1; *ffolat = ffo10x7pal[i].ffolat; *ivo = ffo10x7pal[i].ivo; } break; } } /*get vertical line min and max for mode and std.*/ static void get_vtotal_min_max(unsigned long vga_mode, unsigned long tv_std, int *v_total_min, int *v_total_max, int *v_step) { int k = map_tvstd_to_index(tv_std); switch (vga_mode) { case GFX_VGA_MODE_640X480: if (IS_NTSC(tv_std)) { *v_total_min = ffo6x4ntsc[0].v_total; *v_total_max = ffo6x4ntsc[SIZE6X4NTSC - 1].v_total; } else { *v_total_min = ffo6x4pal[0].v_total; *v_total_max = ffo6x4pal[SIZE6X4PAL - 1].v_total; } *v_step = 4; break; case GFX_VGA_MODE_800X600: if (IS_NTSC(tv_std)) { *v_total_min = ffo8x6ntsc[0].v_total; *v_total_max = ffo8x6ntsc[SIZE8X6NTSC - 1].v_total; } else { *v_total_min = ffo8x6pal[0].v_total; *v_total_max = ffo8x6pal[SIZE8X6PAL - 1].v_total; } *v_step = 5; break; case GFX_VGA_MODE_720X487: case GFX_VGA_MODE_720X576: *v_total_min = tvsetup.tv_lines[k]; *v_total_max = tvsetup.tv_lines[k]; *v_step = 4; break; case GFX_VGA_MODE_1024X768: if (IS_NTSC(tv_std)) { *v_total_min = ffo10x7ntsc[0].v_total; *v_total_max = ffo10x7ntsc[SIZE10X7NTSC - 1].v_total; } else { *v_total_min = ffo10x7pal[0].v_total; *v_total_max = ffo10x7pal[SIZE10X7PAL - 1].v_total; } *v_step = 6; break; } } static void config_overscan_xy(unsigned long tv_std, unsigned long vga_mode, int overscan_x, int overscan_y, int pos_x, int pos_y) { unsigned int vga_index; unsigned long reg; double vsc; int k; unsigned short ffolat, ivo; int base_v_total, range, v_offset; int v_total_min, v_total_max, v_step; float r, f; int vga_pixels, pre_pixels; float hscale, hscale_min, hscale_max; int hsc; int iho, iho_max, ihw; /*tv_std is valid. */ k = map_tvstd_to_index(tv_std); /*store tv width and lines */ g_specs.tv_width = tvsetup.tv_width[k]; g_specs.tv_lines = tvsetup.tv_lines[k]; /*determine vga mode index */ for (vga_index = 0; vga_index < SCANTABLE_ENTRIES; vga_index++) { if (scantable[vga_index].mode == vga_mode) break; } if (vga_index >= SCANTABLE_ENTRIES) return; /*vertical scaling (v_total setup). */ /*calculate vertical range. */ get_vtotal_min_max(vga_mode, tv_std, &v_total_min, &v_total_max, &v_step); TRACE(("v_total min=%d, max=%d\n", v_total_min, v_total_max)) base_v_total = scantable[vga_index].v_total[k]; range = fsmax(base_v_total - v_total_min, v_total_max - base_v_total); TRACE(("v_total range = %d\n", range)) /*map +/-1000 overscan y into +/-range. */ v_offset = (int) ((((float) overscan_y * range) / 1000.f) + .5f); TRACE(("v_offset = %d\n", v_offset)) /*range limit v_total. */ g_specs.v_total = range_limit(base_v_total + v_offset, v_total_min, v_total_max); /*round to calibrated value. */ v_offset = (g_specs.v_total - v_total_min + (v_step / 2)) / v_step; g_specs.v_total = v_total_min + v_offset * v_step; TRACE(("desired v_total=%d\n", g_specs.v_total)) /*vertical positioning (vsync setup). */ get_ffolat_ivo(vga_mode, tv_std, v_offset, &ffolat, &ivo); houston_WriteReg(HOUSTON_IVO, ivo, 2); /*scale base sync offset by scaling ratio. */ r = (float) g_specs.v_total / (float) base_v_total; v_offset = (int) (r * (float) scantable[vga_index].v_sync[k]); /*scale ivo. */ f = (float) ivo; v_offset -= (int) (f - f / r); /*compensate for center screen. */ f = (float) tvsetup.tv_active_lines[k] / 2.f; v_offset += (int) (f * r - f); /*calculate vsync. */ g_specs.v_sync = g_specs.v_total - v_offset + pos_y; TRACE(("desired v_total=%d, desired v_sync=%d\n", g_specs.v_total, g_specs.v_sync)) if (g_specs.v_sync < g_specs.vga_lines + 10) { TRACE(("vsync too low\n")) /*d.v_total += d.vga_lines+10-d.v_sync; */ g_specs.v_sync = g_specs.vga_lines + 10; } else if (g_specs.v_sync > g_specs.v_total - 10) { TRACE(("vsync too high\n")) g_specs.v_sync = g_specs.v_total - 10; } TRACE(("v_total=%d v_sync=%d\n", g_specs.v_total, g_specs.v_sync)) /* FFOLAT. */ houston_WriteReg(HOUSTON_FFO_LAT, ffolat, 2); /* VSC. */ vsc = (65536.0f * (1.0f - (double) g_specs.tv_lines / (double) g_specs.v_total)) + 0.5f; reg = ((unsigned long) -vsc) & 0xffff; TRACE(("vsc=%04x, tv_lines=%d, v_total=%d\n", reg, g_specs.tv_lines, g_specs.v_total)) houston_WriteReg(HOUSTON_VSC, (int) reg, 2); /* horizontal scaling. */ /* vga pixels is vga width, except in 1024x768, where it's half that. */ vga_pixels = g_specs.vga_width; if (1024 == vga_pixels) vga_pixels /= 2; /* maximum scaling coefficient is tv_width / vga_pixels */ /* minimum is about 1/2, but that is quite small. arbitrarily set * minimum at 75% maximum. */ hscale_max = (720.0f / vga_pixels); hscale_min = fsmax((0.75f * hscale_max), (1.0f - (63.0f / 128.0f))); TRACE(("hscale_min = %u.%u, hscale_max = %u.%u\n", (int) hscale_min, (int) ((hscale_min - (int) hscale_min) * 1000), (int) hscale_max, (int) ((hscale_max - (int) hscale_max) * 1000))) /* map overscan_x into min to max. */ hscale = hscale_min + ((overscan_x + 1000.0f) / 2000.0f) * (hscale_max - hscale_min); TRACE(("hscale = %u.%u\n", (int) hscale, (int) ((hscale - (int) hscale) * 1000))) /* determine hsc where hscale = (1 + hsc/128) */ if (hscale >= 1.0f) hsc = (int) (128.f * (hscale - 1.0f) + .5f); else hsc = (int) (128.f * (hscale - 1.0f) - .5f); TRACE(("hsc = %d\n", hsc)) if (hsc >= 0) houston_WriteReg(HOUSTON_HSC, hsc << 8, 2); else houston_WriteReg(HOUSTON_HSC, hsc & 0xFF, 2); /* recalculate hscale for future formulas */ hscale = 1.0f + (hsc / 128.0f); TRACE(("recalculated hscale = %u.%u\n", (int) hscale, (int) ((hscale - (int) hscale) * 1000))) /* horizontal offset. */ /* place hsync 40 before halfway from vga_width to htotal */ /* but not less than vga_width + 10 */ g_specs.h_sync = fsmax((g_specs.h_total + g_specs.vga_width) / 2 - 40, g_specs.vga_width + 10); /* also, make it even */ g_specs.h_sync &= ~1; TRACE(("hsync = %u\n", g_specs.h_sync)) /* iho range is 0 to iho_max. */ /* iho_max is 2 * iho_center. */ /* iho_center is pre_pixels - (tvwidth / hscale - vga pixels) / 2. */ /* pre_pixels = (htotal - hsync) * (vga_pixels / vga_width) */ /* note that the range is inverted also, because it specifies the number * of pixels */ /* to skip, or subtract. iho=0 maps to farthest right. */ /* map -pos_x = +/-1000 into (0 to iho_max) */ pre_pixels = (int) ((long) (g_specs.h_total - g_specs.h_sync) * vga_pixels / g_specs.vga_width); iho_max = (2 * pre_pixels) - ((int) (720.0f / hscale + 0.5f) - vga_pixels); TRACE(("iho_max = %u\n", iho_max)) iho = (int) range_limit(((long) (1000 - pos_x) * iho_max / 2000) + scantable[vga_index].iho[k], 0, iho_max); TRACE(("iho = %u\n", iho)) houston_WriteReg(HOUSTON_IHO, iho, 2); /* input horizontal width. */ /* input horizontal width is vga pixels + pre_pixels - iho */ /* additionally, ihw cannot exceed tv width / hscale */ /* and if hsc is negative, (ihw)(-hsc/128) cannot exceed ~250. */ /* and ihw should be even. */ ihw = fsmin(vga_pixels + pre_pixels - iho, (int) (720.0f / hscale)); if (hsc < 0) ihw = (int) fsmin(ihw, 253L * 128 / (-hsc)); ihw &= ~1; TRACE(("ihw = %u\n", ihw)) houston_WriteReg(HOUSTON_IHA, ihw, 2); f = (((float) g_specs.h_total * g_specs.v_total) * 27.f) / ((float) g_specs.tv_width * g_specs.tv_lines); TRACE(("freq=%u.%uMHz\n", (int) f, (int) ((f - (int) f) * 1000))) } /*==========================================================================*/ /* configure houston nco. */ /*==========================================================================*/ static void config_nco(unsigned long tv_std, unsigned long vga_mode) { unsigned long cr, misc; unsigned long reg; int k = map_tvstd_to_index(tv_std); /*read and store CR. */ houston_ReadReg(HOUSTON_CR, &cr, 2); /*make sure NCO_EN (enable latch) bit is clear */ cr &= ~CR_NCO_EN; houston_WriteReg(HOUSTON_CR, cr, 2); /*clear NCO_LOADX. */ houston_ReadReg(HOUSTON_MISC, &misc, 2); misc &= ~(MISC_NCO_LOAD1 + MISC_NCO_LOAD0); houston_WriteReg(HOUSTON_MISC, misc, 2); if (vga_mode == GFX_VGA_MODE_1024X768) { /*setup for M and N load (Nco_load=1). */ misc |= (MISC_NCO_LOAD0); houston_WriteReg(HOUSTON_MISC, misc, 2); /*M and N. */ houston_WriteReg(HOUSTON_NCONL, 1024 - 2, 2); houston_WriteReg(HOUSTON_NCODL, 128 - 1, 2); /*latch M/N in. */ cr |= CR_NCO_EN; houston_WriteReg(HOUSTON_CR, cr, 2); cr &= ~CR_NCO_EN; houston_WriteReg(HOUSTON_CR, cr, 2); /*setup ncon and ncod load (Nco_load=0). */ misc &= ~(MISC_NCO_LOAD1 + MISC_NCO_LOAD0); houston_WriteReg(HOUSTON_MISC, misc, 2); /*NCON. */ reg = ((unsigned long) g_specs.v_total * g_specs.h_total) / 2; houston_WriteReg(HOUSTON_NCONH, reg >> 16, 2); houston_WriteReg(HOUSTON_NCONL, reg & 0xffff, 2); /*NCOD. */ houston_WriteReg(HOUSTON_NCODL, tvsetup.houston_ncodl[k], 2); houston_WriteReg(HOUSTON_NCODH, tvsetup.houston_ncodh[k], 2); } else { /*setup for M and N load (Nco_load=2). */ misc |= (MISC_NCO_LOAD1); houston_WriteReg(HOUSTON_MISC, misc, 2); /*NCON. */ reg = (unsigned long) g_specs.v_total * g_specs.h_total; houston_WriteReg(HOUSTON_NCONH, reg >> 16, 2); houston_WriteReg(HOUSTON_NCONL, reg & 0xffff, 2); /*NCOD. */ houston_WriteReg(HOUSTON_NCODL, tvsetup.houston_ncodl[k], 2); houston_WriteReg(HOUSTON_NCODH, tvsetup.houston_ncodh[k], 2); TRACE(("NCON = %lu (0x%08lx), NCOD = %lu (0x%08lx)\n", reg, reg, ((unsigned long) tvsetup.houston_ncodh[k] << 16) + tvsetup.houston_ncodl[k], ((unsigned long) tvsetup.houston_ncodh[k] << 16) + tvsetup.houston_ncodl[k])) } /*latch M/N and NCON/NCOD in. */ cr |= CR_NCO_EN; houston_WriteReg(HOUSTON_CR, cr, 2); cr &= ~CR_NCO_EN; houston_WriteReg(HOUSTON_CR, cr, 2); } /*==========================================================================*/ /* Write sharpness settings to device */ /*==========================================================================*/ static void config_sharpness(int sharpness) { unsigned int shp; /*map 0-1000 to 0-20. */ shp = (unsigned int) (0.5f + ((float) sharpness * 20.0f / 1000.0f)); shp = range_limit(shp, 0, 20); houston_WriteReg(HOUSTON_SHP, shp, 2); } static void conget_sharpness(int *p_sharpness) { unsigned long shp; if (!p_sharpness) return; houston_ReadReg(HOUSTON_SHP, &shp, 2); /*map 0-20 to 0-1000. */ *p_sharpness = (int) (0.5f + ((float) shp * 1000.0f / 20.0f)); } /*==========================================================================*/ /* Write flicker settings to device */ /*==========================================================================*/ static void config_flicker(int flicker) { unsigned int flk; /*map 0-1000 to 0-16. */ flk = (unsigned int) (0.5f + ((float) flicker * 16.0f / 1000.0f)); flk = range_limit(flk, 0, 16); houston_WriteReg(HOUSTON_FLK, flk, 2); } static void conget_flicker(int *p_flicker) { unsigned long flk; if (!p_flicker) return; houston_ReadReg(HOUSTON_FLK, &flk, 2); /*map 0-16 to 0-1000. */ *p_flicker = (int) (0.5f + ((float) flk * 1000.0f / 16.0f)); } /*==========================================================================*/ /* Write color settings to device */ /*==========================================================================*/ static void config_color(int color) { unsigned long clr; /*map 0-100 to 0-255. */ /*montreal production test needs 169 to be mappable, so */ /*use .8 rounding factor, 169=(int)(66.*2.55+.8). */ clr = (unsigned long) (0.8f + ((float) color * 255.0f / 100.0f)); clr = range_limit(clr, 0, 255); houston_WriteReg(ENC_CR_GAIN, clr, 1); houston_WriteReg(ENC_CB_GAIN, clr, 1); } static void conget_color(int *p_color) { unsigned long cr_gain; if (!p_color) return; /*just get CR GAIN, CB GAIN should match. */ houston_ReadReg(ENC_CR_GAIN, &cr_gain, 1); /*map 0-255 to 0-100. */ *p_color = (int) (0.5f + ((float) cr_gain * 100.0f / 255.0f)); } /*==========================================================================*/ /* Write brightness and contrast settings to device */ /*==========================================================================*/ #define NTSC_BLANK_LEVEL 240 static const int min_black_level = NTSC_BLANK_LEVEL + 1; static const int max_white_level = 1023; static void config_brightness_contrast(unsigned long tv_std, unsigned int trigger_bits, int brightness, int contrast) { int brightness_off; float contrast_mult; int black, white; unsigned short w; int k = map_tvstd_to_index(tv_std); /*0-100 maps to +/-220. */ brightness_off = (int) (0.5f + ((float) brightness * 440.0f / 100.0f)) - 220; /*0-100 maps to .75-1.25. */ contrast_mult = ((float) contrast * 0.5f / 100.0f) + 0.75f; black = tvsetup.black_level[k]; if (trigger_bits != 0) black -= tvsetup.hamp_offset[k]; white = tvsetup.white_level[k]; if (trigger_bits != 0) white -= tvsetup.hamp_offset[k]; black = (int) ((float) (black + brightness_off) * contrast_mult); white = (int) ((float) (white + brightness_off) * contrast_mult); if (black < min_black_level) black = min_black_level; if (white > max_white_level) white = max_white_level; w = w10bit2z((unsigned short) black); houston_WriteReg(ENC_BLACK_LEVEL, w & 0x00ff, 1); houston_WriteReg(ENC_BLACK_LEVEL + 1, w >> 8, 1); w = w10bit2z((unsigned short) white); houston_WriteReg(ENC_WHITE_LEVEL, w & 0x00ff, 1); houston_WriteReg(ENC_WHITE_LEVEL + 1, w >> 8, 1); } static void conget_brightness_contrast(unsigned long tv_std, unsigned int trigger_bits, int *p_brightness, int *p_contrast) { int brightness_off; float contrast_mult; unsigned short black, white; unsigned long zh, zl; int k; if (!p_brightness || !p_contrast) return; k = map_tvstd_to_index(tv_std); houston_ReadReg(ENC_BLACK_LEVEL, &zl, 1); houston_ReadReg(ENC_BLACK_LEVEL + 1, &zh, 1); black = z2w10bit((unsigned short) (zl + (zh << 8))); if (trigger_bits != 0) black += tvsetup.hamp_offset[k]; houston_ReadReg(ENC_WHITE_LEVEL, &zl, 1); houston_ReadReg(ENC_WHITE_LEVEL + 1, &zh, 1); white = z2w10bit((unsigned short) (zl + (zh << 8))); if (trigger_bits != 0) white += tvsetup.hamp_offset[k]; /*this reverse computation does not account for clipping, but should */ /*provide somewhat reasonable numbers */ contrast_mult = ((float) white - (float) black) / ((float) tvsetup.white_level[k] - (float) tvsetup.black_level[k]); brightness_off = (int) (((float) black / contrast_mult) - tvsetup.black_level[k]); /*+/-220 maps to 0-100. */ *p_brightness = range_limit((int) (0.5f + ((float) (brightness_off + 220) * 100.0f / 440.0f)), 0, 100); /*.75-1.25 maps to 0-100. */ *p_contrast = range_limit((int) (0.5f + ((float) (contrast_mult - 0.75f) * 100.0f / 0.5f)), 0, 100); } /*==========================================================================*/ /* configure luma/chroma filters. */ /*==========================================================================*/ static void config_yc_filter(unsigned long tv_std, int luma_filter, int chroma_filter) { unsigned long reg, reg07, reg34; if (houston_Rev() < HOUSTON_REV_B) return; /*luma filter. */ if (luma_filter) reg = tvsetup.notch_filter[map_tvstd_to_index(tv_std)]; else reg = 0; houston_WriteReg(ENC_NOTCH_FILTER, reg, 1); /*chroma filter. */ houston_ReadReg(ENC_REG07, ®07, 1); houston_ReadReg(ENC_REG34, ®34, 1); if (chroma_filter) { reg07 &= ~0x08; reg34 &= ~0x20; } else { reg07 |= 0x08; reg34 |= 0x20; } houston_WriteReg(ENC_REG07, reg07, 1); houston_WriteReg(ENC_REG34, reg34, 1); } static void conget_yc_filter(int *p_luma_filter, int *p_chroma_filter) { unsigned long reg, reg07, reg34; if (!p_luma_filter || !p_chroma_filter) return; if (houston_Rev() < HOUSTON_REV_B) { *p_luma_filter = 0; *p_chroma_filter = 0; return; } /*luma filter. */ houston_ReadReg(ENC_NOTCH_FILTER, ®, 1); *p_luma_filter = (reg ? 1 : 0); /*chroma filter. */ houston_ReadReg(ENC_REG07, ®07, 1); houston_ReadReg(ENC_REG34, ®34, 1); *p_chroma_filter = !((0x08 & reg07) || (0x20 & reg34)); } /*==========================================================================*/ /* Macrovision */ /*==========================================================================*/ static void config_macrovision(unsigned long tv_std, unsigned int trigger_bits) { /*Constants to index into mvsetup columns.*/ #define nNTSC_APS00 0 /*ntsc mv off. */ #define nNTSC_APS01 1 /*ntsc AGC only. */ #define nNTSC_APS10 2 /*ntsc AGC + 2-line CS. */ #define nNTSC_APS11 3 /*ntsc AGC + 4-line CS. */ #define nPAL_APS00 4 /*pal mv off. */ #define nPAL_APSXX 5 /*pal mv on. */ #define nMVModes 6 /*Macrovision setup table. */ static const struct mvparms { unsigned short n0[nMVModes]; unsigned short n1[nMVModes]; unsigned short n2[nMVModes]; unsigned short n3[nMVModes]; unsigned short n4[nMVModes]; unsigned short n5[nMVModes]; unsigned short n6[nMVModes]; unsigned short n7[nMVModes]; unsigned short n8[nMVModes]; unsigned short n9[nMVModes]; unsigned short n10[nMVModes]; unsigned short n11[nMVModes]; unsigned short n12[nMVModes]; unsigned short n13[nMVModes]; unsigned short n14[nMVModes]; unsigned short n15[nMVModes]; unsigned short n16[nMVModes]; unsigned short n17[nMVModes]; unsigned short n18[nMVModes]; unsigned short n19[nMVModes]; unsigned short n20[nMVModes]; unsigned short n21[nMVModes]; unsigned short n22[nMVModes]; unsigned short agc_pulse_level[nMVModes]; unsigned short bp_pulse_level[nMVModes]; } mvsetup = { /* ntsc ntsc ntsc ntsc pal pal */ /* MV AGC AGC + AGC + MV MV */ /* off. only 2-line 4-line off. on. */ /* CS. CS. */ { 0x00, 0x36, 0x3e, 0x3e, 0x00, 0x3e}, /*n0 */ { 0x1d, 0x1d, 0x1d, 0x17, 0x1a, 0x1a}, /*n1 */ { 0x11, 0x11, 0x11, 0x15, 0x22, 0x22}, /*n2 */ { 0x25, 0x25, 0x25, 0x21, 0x2a, 0x2a}, /*n3 */ { 0x11, 0x11, 0x11, 0x15, 0x22, 0x22}, /*n4 */ { 0x01, 0x01, 0x01, 0x05, 0x05, 0x05}, /*n5 */ { 0x07, 0x07, 0x07, 0x05, 0x02, 0x02}, /*n6 */ { 0x00, 0x00, 0x00, 0x02, 0x00, 0x00}, /*n7 */ { 0x1b, 0x1b, 0x1b, 0x1b, 0x1c, 0x1c}, /*n8 */ { 0x1b, 0x1b, 0x1b, 0x1b, 0x3d, 0x3d}, /*n9 */ { 0x24, 0x24, 0x24, 0x24, 0x14, 0x14}, /*n10 */ { 0x780f, 0x780f, 0x780f, 0x780f, 0x7e07, 0x7e07}, /*n11 */ { 0x0000, 0x0000, 0x0000, 0x0000, 0x5402, 0x5402}, /*n12 */ { 0x0f, 0x0f, 0x0f, 0x0f, 0xfe, 0xfe}, /*n13 */ { 0x0f, 0x0f, 0x0f, 0x0f, 0x7e, 0x7e}, /*n14 */ { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60}, /*n15 */ { 0x01, 0x01, 0x01, 0x01, 0x00, 0x00}, /*n16 */ { 0x0a, 0x0a, 0x0a, 0x0a, 0x08, 0x08}, /*n17 */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /*n18 */ { 0x05, 0x05, 0x05, 0x05, 0x04, 0x04}, /*n19 */ { 0x04, 0x04, 0x04, 0x04, 0x07, 0x07}, /*n20 */ { 0x03ff, 0x03ff, 0x03ff, 0x03ff, 0x0155, 0x0155}, /*n21 */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /*n22 */ { 0xa3, 0xa3, 0xa3, 0xa3, 0xa3, 0xa3}, /*agc_pulse_level */ { 0xc8, 0xc8, 0xc8, 0xc8, 0xc8, 0xc8}, /*bp_pulse_level */ }; int nMode; unsigned long misc; unsigned short n0; trigger_bits &= 0x3; /*Determine the OEM Macrovision Program Mode and Register 0 Data. */ if (IS_NTSC(tv_std)) { /*NTSC TV Standard. */ if (trigger_bits == 0) { /*turn Macrovision OFF. */ nMode = nNTSC_APS00; } else if (trigger_bits == 1) { /*AGC Only. */ nMode = nNTSC_APS01; } else if (trigger_bits == 2) { /*AGC + 2-line CS. */ nMode = nNTSC_APS10; } else { /*AGC + 4-line CS. */ nMode = nNTSC_APS11; } } else { /*PAL TV Standard. */ if (trigger_bits == 0) { /*turn Macrovision OFF. */ nMode = nPAL_APS00; } else { /*APS 01, 10, or 11. */ nMode = nPAL_APSXX; } } /*Retrieve the Macrovision Program Mode Data */ if (tv_std != GFX_TV_STANDARD_PAL_M) n0 = mvsetup.n0[nMode]; else { /*PAL-M sets up like NTSC except for n0. */ if ((trigger_bits & 0x03) == 0) n0 = mvsetup.n0[nPAL_APS00]; else n0 = mvsetup.n0[nPAL_APSXX]; } /*download settings now. */ houston_WriteReg(MV_N0, n0, 1); houston_WriteReg(MV_N1, mvsetup.n1[nMode], 1); houston_WriteReg(MV_N2, mvsetup.n2[nMode], 1); houston_WriteReg(MV_N3, mvsetup.n3[nMode], 1); houston_WriteReg(MV_N4, mvsetup.n4[nMode], 1); houston_WriteReg(MV_N5, mvsetup.n5[nMode], 1); houston_WriteReg(MV_N6, mvsetup.n6[nMode], 1); houston_WriteReg(MV_N7, mvsetup.n7[nMode], 1); houston_WriteReg(MV_N8, mvsetup.n8[nMode], 1); houston_WriteReg(MV_N9, mvsetup.n9[nMode], 1); houston_WriteReg(MV_N10, mvsetup.n10[nMode], 1); houston_WriteReg(MV_N11, mvsetup.n11[nMode] & 0xff, 1); houston_WriteReg(MV_N11 + 1, mvsetup.n11[nMode] >> 8, 1); houston_WriteReg(MV_N12, mvsetup.n12[nMode] & 0xff, 1); houston_WriteReg(MV_N12 + 1, mvsetup.n12[nMode] >> 8, 1); houston_WriteReg(MV_N13, mvsetup.n13[nMode], 1); houston_WriteReg(MV_N14, mvsetup.n14[nMode], 1); houston_WriteReg(MV_N15, mvsetup.n15[nMode], 1); houston_WriteReg(MV_N16, mvsetup.n16[nMode], 1); houston_WriteReg(MV_N17, mvsetup.n17[nMode], 1); houston_WriteReg(MV_N18, mvsetup.n18[nMode], 1); houston_WriteReg(MV_N19, mvsetup.n19[nMode], 1); houston_WriteReg(MV_N20, mvsetup.n20[nMode], 1); houston_WriteReg(MV_N21, mvsetup.n21[nMode] & 0xff, 1); houston_WriteReg(MV_N21 + 1, mvsetup.n21[nMode] >> 8, 1); houston_WriteReg(MV_N22, mvsetup.n22[nMode], 1); houston_WriteReg(MV_AGC_PULSE_LEVEL, mvsetup.agc_pulse_level[nMode], 1); houston_WriteReg(MV_BP_PULSE_LEVEL, mvsetup.bp_pulse_level[nMode], 1); houston_ReadReg(HOUSTON_MISC, &misc, 2); if (trigger_bits == 0) misc &= ~MISC_MV_SOFT_EN; else misc |= MISC_MV_SOFT_EN; houston_WriteReg(HOUSTON_MISC, misc, 2); } static void conget_macrovision(unsigned long tv_std, unsigned int *p_cp_trigger_bits) { unsigned long n0, n1; if (!p_cp_trigger_bits) return; houston_ReadReg(MV_N0, &n0, 1); houston_ReadReg(MV_N1, &n1, 1); *p_cp_trigger_bits = 0; if (IS_NTSC(tv_std)) { switch (n0) { case 0: *p_cp_trigger_bits = 0; break; case 0x36: *p_cp_trigger_bits = 1; break; case 0x3E: { if (0x1D == n1) *p_cp_trigger_bits = 2; else *p_cp_trigger_bits = 3; } break; } } else if (IS_PAL(tv_std)) { if (0 == n0) *p_cp_trigger_bits = 0; else { /*don't know here what the non-zero trigger bits were */ *p_cp_trigger_bits = 1; } } } /* PLAL_MediaGX.cpp */ /*==========================================================================*/ /* These functions provides implementation of platform-specific functions */ /* MediaGX platform. */ /*==========================================================================*/ /*MediaGX control registers.*/ #define CCR3 0xC3 #define GCR 0xb8 /*Media GX general config register.*/ #define GX_DCLK_MUL 0x00c0 #define GX_DCLKx1 0x0040 #define GX_DCLKx2 0x0080 #define GX_DCLKx4 0x00c0 /*Media GX timing config register.*/ #define GX_TGEN 0x0020 /*Cx5530 register offsets (from GX_BASE).*/ #define CX_DISPLAY_CONFIG 0x10004 #define CX_DOT_CLK 0x10024 #define CX_TV_CONFIG 0x10028 /*Cx5530 display configuration register.*/ #define CX_FPVSYNC_POL 0x0800 #define CX_FPHSYNC_POL 0x0400 #define CX_FPDATA_ENB 0x0080 #define CX_FPPOWER_ENB 0x0040 #define CX_CRTVSYNC_POL 0x0200 #define CX_CRTHSYNC_POL 0x0100 /*Cx5530 dot clock configuration register.*/ #define CX_TVCLK_SELECT 0x0400 /*Cx5530 tv configuration register*/ #define CX_INVERT_FPCLK (1 << 6) /*========================================================================== * FS450 I2C Address * There are two possible 7-bit addresses, 0x4A and 0x6A. * The address if selectable via pins on the FS450. * There are also two possible 10-bit addresses, 0x224 and 0x276, but this * source is not designed to use them. *==========================================================================*/ #define FS450_I2C_ADDRESS (0x4A) static unsigned char PLAL_FS450_i2c_address(void) { return FS450_I2C_ADDRESS; } /*========================================================================== * FS450 UIM mode * This mode is programmed in the FS450 command register when enabling TV * out. *========================================================================== */ static int PLAL_FS450_UIM_mode(void) { return 3; } /*==========================================================================*/ /* Read and Write MediaGX registers */ /*==========================================================================*/ static unsigned long ReadGx(unsigned long inRegAddr) { unsigned long data; DMAL_ReadUInt32(inRegAddr, &data); return data; } static void WriteGx(unsigned long inRegAddr, unsigned long inData) { int is_timing_register; unsigned long reg_timing_cfg; /*because the unlock register for the MediaGx video registers may not */ /*persist, we will write the unlock code before every write. */ DMAL_WriteUInt32(DC_UNLOCK, 0x4758); /*see if register is a timing register */ is_timing_register = (DC_H_TIMING_1 == inRegAddr) || (DC_H_TIMING_2 == inRegAddr) || (DC_H_TIMING_3 == inRegAddr) || (DC_FP_H_TIMING == inRegAddr) || (DC_V_TIMING_1 == inRegAddr) || (DC_V_TIMING_2 == inRegAddr) || (DC_V_TIMING_3 == inRegAddr) || (DC_FP_V_TIMING == inRegAddr); /*if the register is a timing register, clear the TGEN bit to allow * modification */ if (is_timing_register) { DMAL_ReadUInt32(DC_TIMING_CFG, ®_timing_cfg); DMAL_WriteUInt32(DC_TIMING_CFG, reg_timing_cfg & ~GX_TGEN); } /*write the requested register */ DMAL_WriteUInt32(inRegAddr, inData); /*reset the TGEN bit to previous state */ if (is_timing_register) { DMAL_WriteUInt32(DC_TIMING_CFG, reg_timing_cfg); } } #ifdef FS450_DIRECTREG /*==========================================================================*/ /* Platform-specific processing for a Read or Write Register calls. */ /* The functions should return true if the specified register belongs to */ /* this platform. */ /*==========================================================================*/ static int PLAL_ReadRegister(S_REG_INFO * p_reg) { if (!p_reg) return 0; if (SOURCE_GCC == p_reg->source) { p_reg->value = ReadGx(p_reg->offset); return 1; } return 0; } static int PLAL_WriteRegister(const S_REG_INFO * p_reg) { if (!p_reg) return 0; if (SOURCE_GCC == p_reg->source) { WriteGx(p_reg->offset, p_reg->value); return 1; } return 0; } #endif /*========================================================================== * Determine if TV is on *==========================================================================*/ static int PLAL_IsTVOn(void) { unsigned long reg; /*check Cx5530 dot clock */ reg = ReadGx(CX_DOT_CLK); return (reg & CX_TVCLK_SELECT) ? 1 : 0; } /*========================================================================== * Platform-specific actions to reset to VGA mode *==========================================================================*/ static int PLAL_EnableVga(void) { unsigned long reg; /*2 x dclk */ reg = ReadGx(DC_GENERAL_CFG); reg &= ~GX_DCLK_MUL; reg |= GX_DCLKx2; WriteGx(DC_GENERAL_CFG, reg); /*select pll dot clock. */ reg = ReadGx(CX_DOT_CLK); reg &= ~CX_TVCLK_SELECT; WriteGx(CX_DOT_CLK, reg); /*timing config, reset everything on dclk. */ reg = ReadGx(DC_TIMING_CFG); reg &= ~GX_TGEN; WriteGx(DC_TIMING_CFG, reg); reg |= GX_TGEN; WriteGx(DC_TIMING_CFG, reg); /*un-invert FP clock */ reg = ReadGx(CX_TV_CONFIG); reg &= ~CX_INVERT_FPCLK; WriteGx(CX_TV_CONFIG, reg); return 0; } /*==========================================================================*/ /*Platform-specific actions to enter TVout mode */ /*==========================================================================*/ static int PLAL_PrepForTVout(void) { unsigned int reg; /*Cx5530 tv config. */ reg = 0; WriteGx(CX_TV_CONFIG, reg); /*invert FP clock */ reg = (int) ReadGx(CX_TV_CONFIG); reg |= CX_INVERT_FPCLK; WriteGx(CX_TV_CONFIG, reg); return 0; } static int PLAL_SetTVTimingRegisters(const S_TIMING_SPECS * p_specs) { unsigned long reg; /*timing config, reset everything on dclk. */ reg = ReadGx(DC_TIMING_CFG); reg &= ~GX_TGEN; WriteGx(DC_TIMING_CFG, reg); /*htotal and hactive. */ reg = ((p_specs->h_total - 1) << 16) | (p_specs->vga_width - 1); WriteGx(DC_H_TIMING_1, reg); /*hblank. */ reg = ((p_specs->h_total - 1) << 16) | (p_specs->vga_width - 1); WriteGx(DC_H_TIMING_2, reg); /*hsync. */ reg = ((p_specs->h_sync + 63) << 16) | p_specs->h_sync; WriteGx(DC_H_TIMING_3, reg); /*fp hsync. */ WriteGx(DC_FP_H_TIMING, reg); /*vtotal and vactive. */ reg = ((p_specs->v_total - 1) << 16) | (p_specs->vga_lines - 1); WriteGx(DC_V_TIMING_1, reg); /*vblank. */ reg = ((p_specs->v_total - 1) << 16) | (p_specs->vga_lines - 1); WriteGx(DC_V_TIMING_2, reg); /*vsync. */ reg = ((p_specs->v_sync) << 16) | (p_specs->v_sync - 1); WriteGx(DC_V_TIMING_3, reg); /*fp vsync. */ reg = ((p_specs->v_sync - 1) << 16) | (p_specs->v_sync - 2); WriteGx(DC_FP_V_TIMING, reg); /*timing config, reenable all dclk stuff. */ reg = ReadGx(DC_TIMING_CFG); reg |= GX_TGEN; WriteGx(DC_TIMING_CFG, reg); return 0; } static int PLAL_FinalEnableTVout(unsigned long vga_mode) { unsigned int reg; /*Cx5530 select tv dot clock. */ reg = (int) ReadGx(CX_DOT_CLK); reg |= CX_TVCLK_SELECT; WriteGx(CX_DOT_CLK, reg); /*2 x dclk (actually 1x) */ reg = (int) ReadGx(DC_GENERAL_CFG); reg &= ~GX_DCLK_MUL; WriteGx(DC_GENERAL_CFG, reg); reg |= GX_DCLKx2; WriteGx(DC_GENERAL_CFG, reg); /*Cx5530 display configuration register. */ reg = (int) ReadGx(CX_DISPLAY_CONFIG); reg |= (CX_FPVSYNC_POL | CX_FPHSYNC_POL | CX_FPDATA_ENB | CX_FPPOWER_ENB); WriteGx(CX_DISPLAY_CONFIG, reg); return 0; } xf86-video-geode-2.11.18/src/gfx/disp_gu1.c0000644000175000017500000022636212654445443015045 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ void gu1_enable_compression(void); /* private routine definition */ void gu1_disable_compression(void); /* private routine definition */ void gfx_reset_video(void); /* private routine definition */ int gfx_set_display_control(int sync_polarities); /* private routine * definition */ int gu1_set_specified_mode(DISPLAYMODE * pMode, int bpp); /* VIDEO BUFFER SIZE */ unsigned long vid_buf_size = 0; int vid_enabled = 0; /*---------------------------------------------------------------------------- * GU1_DELAY_APPROXIMATE (PRIVATE ROUTINE - NOT PART OF DURANGO API) * * Delay the requested number of milliseconds by reading a register. This * function generally takes longer than the requested time. *---------------------------------------------------------------------------- */ #define READS_PER_MILLISECOND 60000L void gu1_delay_approximate(unsigned long milliseconds) { /* ASSUME 300 MHz, 5 CLOCKS PER READ */ unsigned long loop; loop = milliseconds * READS_PER_MILLISECOND; while (loop-- > 0) { READ_REG32(DC_UNLOCK); } } /*---------------------------------------------------------------------------- * GU1_DELAY_PRECISE (PRIVATE ROUTINE - NOT PART OF DURANGO API) * * Delay the number of milliseconds on a more precise level, varying only by * 1/10 of a ms. This function should only be called if an SC1200 is present. *---------------------------------------------------------------------------- */ void gu1_delay_precise(unsigned long milliseconds) { #if GFX_VIDEO_SC1200 #define LOOP 1000 unsigned long i, timer_start, timer_end, total_ticks, previous_ticks, temp_ticks; /* Get current time */ timer_start = IND(SC1200_CB_BASE_ADDR + SC1200_CB_TMVALUE); /* Calculate expected end time */ if (INB(SC1200_CB_BASE_ADDR + SC1200_CB_TMCNFG) & SC1200_TMCLKSEL_27MHZ) total_ticks = 27000 * milliseconds; /* timer resolution is 27 MHz */ else total_ticks = 1000 * milliseconds; /* timer resolution is 1 MHz */ if (total_ticks > ((unsigned long) 0xffffffff - timer_start)) /* wrap-around */ timer_end = total_ticks - ((unsigned long) 0xffffffff - timer_start); else timer_end = timer_start + total_ticks; /* in case of wrap around */ if (timer_end < timer_start) { previous_ticks = timer_start; while (1) { temp_ticks = IND(SC1200_CB_BASE_ADDR + SC1200_CB_TMVALUE); if (temp_ticks < previous_ticks) break; else previous_ticks = temp_ticks; for (i = 0; i < LOOP; i++) READ_REG32(DC_UNLOCK); } } /* now the non-wrap around part */ while (1) { for (i = 0; i < LOOP; i++) READ_REG32(DC_UNLOCK); if (IND(SC1200_CB_BASE_ADDR + SC1200_CB_TMVALUE) > timer_end) break; } #endif /* GFX_VIDEO_SC1200 */ } /*---------------------------------------------------------------------------- * WARNING!!!! INACCURATE DELAY MECHANISM * * In an effort to keep the code self contained and operating system * independent, the delay loop just performs reads of a display controller * register. This time will vary for faster processors. The delay can always * be longer than intended, only effecting the time of the mode switch * (obviously want it to still be under a second). Problems with the hardware * only arise if the delay is not long enough. * * For the SC1200, the high resolution timer can be used as an accurate * mechanism for keeping time. However, in order to avoid a busy loop of IO * reads, the timer is polled in-between busy loops, and therefore the actual * delay might be longer than the requested delay by the time of one busy loop * (which on a 200 MHz system took 95 us) * * There are thus two delay functions which are called from the main API * routine. * One is meant to be more precise and should only called if an SC1200 is * present. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_delay_milliseconds(unsigned long milliseconds) #else void gfx_delay_milliseconds(unsigned long milliseconds) #endif { #if GFX_VIDEO_SC1200 #if GFX_VIDEO_DYNAMIC if (gfx_video_type == GFX_VIDEO_TYPE_SC1200) { #endif gu1_delay_precise(milliseconds); return; #if GFX_VIDEO_DYNAMIC } #endif #endif /* GFX_VIDEO_SC1200 */ gu1_delay_approximate(milliseconds); } #if GFX_DISPLAY_DYNAMIC void gu1_delay_microseconds(unsigned long microseconds) #else void gfx_delay_microseconds(unsigned long microseconds) #endif { /* ASSUME 300 MHz, 2 CLOCKS PER INCREMENT */ unsigned long loop_count = microseconds * 150; while (loop_count-- > 0) { ; } } /*---------------------------------------------------------------------------- * GFX_VIDEO_SHUTDOWN * * This routine disables the display controller output. *---------------------------------------------------------------------------- */ void gu1_video_shutdown(void) { unsigned long unlock; unsigned long gcfg, tcfg; /* DISABLE COMPRESSION */ gu1_disable_compression(); /* ALSO DISABLE VIDEO */ /* Use private "reset video" routine to do all that is needed. */ /* SC1200, for example, also disables the alpha blending regions. */ gfx_reset_video(); /* UNLOCK THE DISPLAY CONTROLLER REGISTERS */ unlock = READ_REG32(DC_UNLOCK); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); /* READ THE CURRENT GX VALUES */ gcfg = READ_REG32(DC_GENERAL_CFG); tcfg = READ_REG32(DC_TIMING_CFG); /* BLANK THE GX DISPLAY AND DISABLE THE TIMING GENERATOR */ tcfg &= ~((unsigned long) DC_TCFG_BLKE | (unsigned long) DC_TCFG_TGEN); WRITE_REG32(DC_TIMING_CFG, tcfg); /* DELAY: WAIT FOR PENDING MEMORY REQUESTS */ /* This delay is used to make sure that all pending requests to the */ /* memory controller have completed before disabling the FIFO load. */ gfx_delay_milliseconds(1); /* DISABLE DISPLAY FIFO LOAD AND DISABLE COMPRESSION */ gcfg &= ~(unsigned long) (DC_GCFG_DFLE | DC_GCFG_CMPE | DC_GCFG_DECE); WRITE_REG32(DC_GENERAL_CFG, gcfg); WRITE_REG32(DC_UNLOCK, unlock); return; } /*---------------------------------------------------------------------------- * GFX_SET_DISPLAY_BPP * * This routine programs the bpp in the display controller. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_display_bpp(unsigned short bpp) #else int gfx_set_display_bpp(unsigned short bpp) #endif { unsigned long ocfg, lock; lock = READ_REG32(DC_UNLOCK); ocfg = READ_REG32(DC_OUTPUT_CFG) & ~(DC_OCFG_8BPP | DC_OCFG_555); /* SET DC PIXEL FORMAT */ if (bpp == 8) ocfg |= DC_OCFG_8BPP; else if (bpp == 15) ocfg |= DC_OCFG_555; else if (bpp != 16) return GFX_STATUS_BAD_PARAMETER; WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); WRITE_REG32(DC_OUTPUT_CFG, ocfg); WRITE_REG32(DC_UNLOCK, lock); /* SET BPP IN GRAPHICS PIPELINE */ gfx_set_bpp(bpp); return 0; } /*---------------------------------------------------------------------------- * GFX_SET_SPECIFIED_MODE * This routine uses the parameters in the specified display mode structure * to program the display controller hardware. *---------------------------------------------------------------------------- */ int gu1_set_specified_mode(DISPLAYMODE * pMode, int bpp) { unsigned long unlock, value; unsigned long gcfg, tcfg, ocfg; unsigned long size, pitch; unsigned long hactive, vactive; gbpp = bpp; /* CHECK WHETHER TIMING CHANGE IS ALLOWED */ /* Flag used for locking also overrides timing change restriction */ if (gfx_timing_lock && !(pMode->flags & GFX_MODE_LOCK_TIMING)) return GFX_STATUS_ERROR; /* SET GLOBAL FLAG */ if (pMode->flags & GFX_MODE_LOCK_TIMING) gfx_timing_lock = 1; /* DISABLE COMPRESSION */ gu1_disable_compression(); /* ALSO DISABLE VIDEO */ /* Use private "reset video" routine to do all that is needed. */ /* SC1200, for example, also disables the alpha blending regions. */ gfx_reset_video(); /* UNLOCK THE DISPLAY CONTROLLER REGISTERS */ unlock = READ_REG32(DC_UNLOCK); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); /* READ THE CURRENT GX VALUES */ gcfg = READ_REG32(DC_GENERAL_CFG); tcfg = READ_REG32(DC_TIMING_CFG); /* BLANK THE GX DISPLAY AND DISABLE THE TIMING GENERATOR */ tcfg &= ~((unsigned long) DC_TCFG_BLKE | (unsigned long) DC_TCFG_TGEN); WRITE_REG32(DC_TIMING_CFG, tcfg); /* DELAY: WAIT FOR PENDING MEMORY REQUESTS * This delay is used to make sure that all pending requests to the * memory controller have completed before disabling the FIFO load. */ gfx_delay_milliseconds(1); /* DISABLE DISPLAY FIFO LOAD AND DISABLE COMPRESSION */ gcfg &= ~(unsigned long) (DC_GCFG_DFLE | DC_GCFG_CMPE | DC_GCFG_DECE); WRITE_REG32(DC_GENERAL_CFG, gcfg); /* CLEAR THE "DCLK_MUL" FIELD */ gcfg &= ~(unsigned long) (DC_GCFG_DDCK | DC_GCFG_DPCK | DC_GCFG_DFCK); gcfg &= ~(unsigned long) DC_GCFG_DCLK_MASK; WRITE_REG32(DC_GENERAL_CFG, gcfg); /* SET THE DOT CLOCK FREQUENCY */ /* Mask off the divide by two bit (bit 31) */ gfx_set_clock_frequency(pMode->frequency & 0x7FFFFFFF); /* DELAY: WAIT FOR THE PLL TO SETTLE */ /* This allows the dot clock frequency that was just set to settle. */ gfx_delay_milliseconds(1); /* SET THE "DCLK_MUL" FIELD OF DC_GENERAL_CFG */ /* The GX hardware divides the dot clock, so 2x really means that the */ /* internal dot clock equals the external dot clock. */ if (pMode->frequency & 0x80000000) gcfg |= 0x0040; else gcfg |= 0x0080; WRITE_REG32(DC_GENERAL_CFG, gcfg); /* DELAY: WAIT FOR THE ADL TO LOCK */ /* This allows the clock generatation within GX to settle. This is */ /* needed since some of the register writes that follow require that */ /* clock to be present. */ gfx_delay_milliseconds(1); /* SET THE GX DISPLAY CONTROLLER PARAMETERS */ WRITE_REG32(DC_FB_ST_OFFSET, 0); WRITE_REG32(DC_CB_ST_OFFSET, 0); WRITE_REG32(DC_CURS_ST_OFFSET, 0); /* SET LINE SIZE AND PITCH */ /* Flat panels use the current flat panel line size to */ /* calculate the pitch, but load the true line size */ /* for the mode into the "Frame Buffer Line Size" field */ /* of DC_BUF_SIZE. */ if (PanelEnable) size = ModeWidth; else size = pMode->hactive; if (bpp > 8) size <<= 1; /* ONLY PYRAMID SUPPORTS 4K LINE SIZE */ if (size <= 1024) { pitch = 1024; /* SPECIAL CASE */ /* Graphics acceleration in 16-bit pixel line double modes */ /* requires a pitch of 2048. */ if ((pMode->flags & GFX_MODE_LINE_DOUBLE) && bpp > 8) pitch <<= 1; } else { if (gfx_cpu_version == GFX_CPU_PYRAMID) pitch = (size <= 2048) ? 2048 : 4096; else pitch = 2048; } WRITE_REG32(DC_LINE_DELTA, pitch >> 2); if (PanelEnable) { size = pMode->hactive; if (bpp > 8) size <<= 1; } /* ADD 2 TO SIZE FOR POSSIBLE START ADDRESS ALIGNMENTS */ WRITE_REG32(DC_BUF_SIZE, (size >> 3) + 2); /* ALWAYS ENABLE "PANEL" DATA FROM MEDIAGX */ /* That is really just the 18 BPP data bus to the companion chip */ ocfg = DC_OCFG_PCKE | DC_OCFG_PDEL | DC_OCFG_PDEH; /* SET PIXEL FORMAT */ if (bpp == 8) ocfg |= DC_OCFG_8BPP; else if (bpp == 15) ocfg |= DC_OCFG_555; /* ENABLE TIMING GENERATOR, SYNCS, AND FP DATA */ tcfg = DC_TCFG_FPPE | DC_TCFG_HSYE | DC_TCFG_VSYE | DC_TCFG_BLKE | DC_TCFG_TGEN; /* SET FIFO PRIORITY, DCLK MULTIPLIER, AND FIFO ENABLE */ /* Default 6/5 for FIFO, 2x for DCLK multiplier. */ gcfg = (6 << DC_GCFG_DFHPEL_POS) | (5 << DC_GCFG_DFHPSL_POS) | DC_GCFG_DFLE; /* INCREASE FIFO PRIORITY FOR LARGE MODES */ if (pMode->hactive == 1280 && pMode->vactive == 1024) { if ((bpp == 8) && (pMode->flags & GFX_MODE_85HZ)) gcfg = (8l << DC_GCFG_DFHPEL_POS) | (7l << DC_GCFG_DFHPSL_POS) | DC_GCFG_DFLE; if ((bpp > 8) && (pMode->flags & GFX_MODE_75HZ)) gcfg = (7l << DC_GCFG_DFHPEL_POS) | (6l << DC_GCFG_DFHPSL_POS) | DC_GCFG_DFLE; if ((bpp > 8) && (pMode->flags & GFX_MODE_85HZ)) gcfg = (9l << DC_GCFG_DFHPEL_POS) | (8l << DC_GCFG_DFHPSL_POS) | DC_GCFG_DFLE; } /* SET DOT CLOCK MULTIPLIER */ /* Bit 31 of frequency indicates divide frequency by two */ if (pMode->frequency & 0x80000000) gcfg |= (1l << DC_GCFG_DCLK_POS); else gcfg |= (2l << DC_GCFG_DCLK_POS); /* DIVIDE VIDEO CLOCK */ /* CPU core frequencies above 266 MHz will divide the video */ /* clock by 4 to ensure that we are running below 150 MHz. */ if (gfx_cpu_frequency > 266) gcfg |= DC_GCFG_VCLK_DIV; /* ALWAYS ENABLE VIDEO IN THE DISPLAY CONTROLLER */ /* Enabling video at an inopportune momemt can corrupt the DC fetch */ /* engine and cause screen artifacts or system hang. */ gcfg |= (DC_GCFG_VIDE | DC_GCFG_VRDY); /* SET THE PIXEL AND LINE DOUBLE BITS IF NECESSARY */ hactive = pMode->hactive; vactive = pMode->vactive; gfx_line_double = 0; gfx_pixel_double = 0; if (pMode->flags & GFX_MODE_LINE_DOUBLE) { gcfg |= DC_GCFG_LDBL; hactive <<= 1; /* SET GLOBAL FLAG */ gfx_line_double = 1; } if (pMode->flags & GFX_MODE_PIXEL_DOUBLE) { tcfg |= DC_TCFG_PXDB; vactive <<= 1; /* SET GLOBAL FLAG */ gfx_pixel_double = 1; } /* COMBINE AND SET TIMING VALUES */ value = (unsigned long) (hactive - 1) | (((unsigned long) (pMode->htotal - 1)) << 16); WRITE_REG32(DC_H_TIMING_1, value); value = (unsigned long) (pMode->hblankstart - 1) | (((unsigned long) (pMode->hblankend - 1)) << 16); WRITE_REG32(DC_H_TIMING_2, value); value = (unsigned long) (pMode->hsyncstart - 1) | (((unsigned long) (pMode->hsyncend - 1)) << 16); WRITE_REG32(DC_H_TIMING_3, value); WRITE_REG32(DC_FP_H_TIMING, value); value = (unsigned long) (vactive - 1) | (((unsigned long) (pMode->vtotal - 1)) << 16); WRITE_REG32(DC_V_TIMING_1, value); value = (unsigned long) (pMode->vblankstart - 1) | (((unsigned long) (pMode->vblankend - 1)) << 16); WRITE_REG32(DC_V_TIMING_2, value); value = (unsigned long) (pMode->vsyncstart - 1) | (((unsigned long) (pMode->vsyncend - 1)) << 16); WRITE_REG32(DC_V_TIMING_3, value); value = (unsigned long) (pMode->vsyncstart - 2) | (((unsigned long) (pMode->vsyncend - 2)) << 16); WRITE_REG32(DC_FP_V_TIMING, value); WRITE_REG32(DC_OUTPUT_CFG, ocfg); WRITE_REG32(DC_TIMING_CFG, tcfg); gfx_delay_milliseconds(1); /* delay after TIMING_CFG */ WRITE_REG32(DC_GENERAL_CFG, gcfg); /* ENABLE FLAT PANEL CENTERING */ /* For 640x480 modes displayed with the 9211 within a 800x600 */ /* flat panel display, turn on flat panel centering. */ if (PanelEnable) { if (ModeWidth < PanelWidth) { tcfg = READ_REG32(DC_TIMING_CFG); tcfg = tcfg | DC_TCFG_FCEN; WRITE_REG32(DC_TIMING_CFG, tcfg); gfx_delay_milliseconds(1); /* delay after TIMING_CFG */ } } /* CONFIGURE DISPLAY OUTPUT FROM VIDEO PROCESSOR */ gfx_set_display_control(((pMode->flags & GFX_MODE_NEG_HSYNC) ? 1 : 0) | ((pMode->flags & GFX_MODE_NEG_VSYNC) ? 2 : 0)); /* RESTORE VALUE OF DC_UNLOCK */ WRITE_REG32(DC_UNLOCK, unlock); /* ALSO WRITE GP_BLIT_STATUS FOR PITCH AND 8/18 BPP */ /* Remember, only Pyramid supports 4K line pitch */ value = 0; if (bpp > 8) value |= BC_16BPP; if ((gfx_cpu_version == GFX_CPU_PYRAMID) && (pitch > 2048)) value |= BC_FB_WIDTH_4096; else if (pitch > 1024) value |= BC_FB_WIDTH_2048; WRITE_REG16(GP_BLIT_STATUS, (unsigned short) value); return GFX_STATUS_OK; } /* end gfx_set_specified_mode() */ /*---------------------------------------------------------------------------- * GFX_IS_DISPLAY_MODE_SUPPORTED * * This routine sets the specified display mode. * * Returns the index of the mode if successful and mode returned, -1 if the * mode could not be found. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_is_display_mode_supported(int xres, int yres, int bpp, int hz) #else int gfx_is_display_mode_supported(int xres, int yres, int bpp, int hz) #endif { unsigned int mode = 0; unsigned long hz_flag = 0, bpp_flag = 0; /* SET FLAGS TO MATCH REFRESH RATE */ if (hz == 56) hz_flag = GFX_MODE_56HZ; else if (hz == 60) hz_flag = GFX_MODE_60HZ; else if (hz == 70) hz_flag = GFX_MODE_70HZ; else if (hz == 72) hz_flag = GFX_MODE_72HZ; else if (hz == 75) hz_flag = GFX_MODE_75HZ; else if (hz == 85) hz_flag = GFX_MODE_85HZ; else return -1; /* SET BPP FLAGS TO LIMIT MODE SELECTION */ if (bpp == 8) bpp_flag = GFX_MODE_8BPP; else if (bpp == 15) bpp_flag = GFX_MODE_15BPP; else if (bpp == 16) bpp_flag = GFX_MODE_16BPP; else return -1; /* ONLY PYRAMID SUPPORTS 4K PITCH */ if (gfx_cpu_version != GFX_CPU_PYRAMID && xres > 1024) { if (bpp > 8) return (-1); /* return with mode not found */ } /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */ for (mode = 0; mode < NUM_GX_DISPLAY_MODES; mode++) { if ((DisplayParams[mode].hactive == (unsigned short) xres) && (DisplayParams[mode].vactive == (unsigned short) yres) && (DisplayParams[mode].flags & hz_flag) && (DisplayParams[mode].flags & bpp_flag)) { /* SET THE DISPLAY CONTROLLER FOR THE SELECTED MODE */ return (mode); } } return (-1); } /*---------------------------------------------------------------------------- * GFX_SET_DISPLAY_MODE * * This routine sets the specified display mode. * * Returns 1 if successful, 0 if mode could not be set. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_display_mode(int xres, int yres, int bpp, int hz) #else int gfx_set_display_mode(int xres, int yres, int bpp, int hz) #endif { int mode; /* DISABLE FLAT PANEL */ /* Flat Panel settings are enabled by the function gfx_set_fixed_timings * and disabled by gfx_set_display_mode. */ PanelEnable = 0; mode = gfx_is_display_mode_supported(xres, yres, bpp, hz); if (mode >= 0) { if (gu1_set_specified_mode(&DisplayParams[mode], bpp) == GFX_STATUS_OK) return (1); } return (0); } /*---------------------------------------------------------------------------- * GFX_SET_DISPLAY_TIMINGS * * This routine sets the display controller mode using the specified timing * values (as opposed to using the tables internal to Durango). * * Returns GFX_STATUS_OK on success, GFX_STATUS_ERROR otherwise. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_display_timings(unsigned short bpp, unsigned short flags, unsigned short hactive, unsigned short hblankstart, unsigned short hsyncstart, unsigned short hsyncend, unsigned short hblankend, unsigned short htotal, unsigned short vactive, unsigned short vblankstart, unsigned short vsyncstart, unsigned short vsyncend, unsigned short vblankend, unsigned short vtotal, unsigned long frequency) #else int gfx_set_display_timings(unsigned short bpp, unsigned short flags, unsigned short hactive, unsigned short hblankstart, unsigned short hsyncstart, unsigned short hsyncend, unsigned short hblankend, unsigned short htotal, unsigned short vactive, unsigned short vblankstart, unsigned short vsyncstart, unsigned short vsyncend, unsigned short vblankend, unsigned short vtotal, unsigned long frequency) #endif { /* SET MODE STRUCTURE WITH SPECIFIED VALUES */ gfx_display_mode.flags = 0; if (flags & 1) gfx_display_mode.flags |= GFX_MODE_NEG_HSYNC; if (flags & 2) gfx_display_mode.flags |= GFX_MODE_NEG_VSYNC; if (flags & 0x1000) gfx_display_mode.flags |= GFX_MODE_LOCK_TIMING; gfx_display_mode.hactive = hactive; gfx_display_mode.hblankstart = hblankstart; gfx_display_mode.hsyncstart = hsyncstart; gfx_display_mode.hsyncend = hsyncend; gfx_display_mode.hblankend = hblankend; gfx_display_mode.htotal = htotal; gfx_display_mode.vactive = vactive; gfx_display_mode.vblankstart = vblankstart; gfx_display_mode.vsyncstart = vsyncstart; gfx_display_mode.vsyncend = vsyncend; gfx_display_mode.vblankend = vblankend; gfx_display_mode.vtotal = vtotal; gfx_display_mode.frequency = frequency; /* CALL ROUTINE TO SET MODE */ return (gu1_set_specified_mode(&gfx_display_mode, bpp)); } /*---------------------------------------------------------------------------- * GFX_SET_VTOTAL * * This routine sets the display controller vertical total to * "vtotal". As a side effect it also sets vertical blank end. * It should be used when only this value needs to be changed, * due to speed considerations. * * Note: it is the caller's responsibility to make sure that * a legal vtotal is used, i.e. that "vtotal" is greater than or * equal to vsync end. * * Always returns 0. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_vtotal(unsigned short vtotal) #else int gfx_set_vtotal(unsigned short vtotal) #endif { unsigned long unlock, tcfg, timing1, timing2; /* UNLOCK THE DISPLAY CONTROLLER REGISTERS */ unlock = READ_REG32(DC_UNLOCK); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); /* READ THE CURRENT GX VALUES */ tcfg = READ_REG32(DC_TIMING_CFG); timing1 = READ_REG32(DC_V_TIMING_1); timing2 = READ_REG32(DC_V_TIMING_2); /* DISABLE THE TIMING GENERATOR */ WRITE_REG32(DC_TIMING_CFG, tcfg & ~(unsigned long) DC_TCFG_TGEN); /* WRITE NEW TIMING VALUES */ WRITE_REG32(DC_V_TIMING_1, (timing1 & 0xffff) | (unsigned long) (vtotal - 1) << 16); WRITE_REG32(DC_V_TIMING_2, (timing2 & 0xffff) | (unsigned long) (vtotal - 1) << 16); /* RESTORE GX VALUES */ WRITE_REG32(DC_TIMING_CFG, tcfg); WRITE_REG32(DC_UNLOCK, unlock); return (0); } /*--------------------------------------------------------------------------- * gfx_set_display_pitch * * This routine sets the pitch of the frame buffer to the specified value. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_set_display_pitch(unsigned short pitch) #else void gfx_set_display_pitch(unsigned short pitch) #endif { unsigned long value = 0; unsigned long lock = READ_REG32(DC_UNLOCK); value = READ_REG32(DC_LINE_DELTA) & 0xFFFFF000; value |= (pitch >> 2); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); WRITE_REG32(DC_LINE_DELTA, value); WRITE_REG32(DC_UNLOCK, lock); /* ALSO UPDATE PITCH IN GRAPHICS ENGINE */ /* Pyramid alone supports 4K line pitch */ value = (unsigned long) READ_REG16(GP_BLIT_STATUS); value &= ~(BC_FB_WIDTH_2048 | BC_FB_WIDTH_4096); if ((gfx_cpu_version == GFX_CPU_PYRAMID) && (pitch > 2048)) value |= BC_FB_WIDTH_4096; else if (pitch > 1024) value |= BC_FB_WIDTH_2048; WRITE_REG16(GP_BLIT_STATUS, (unsigned short) value); return; } /*--------------------------------------------------------------------------- * gfx_set_display_offset * * This routine sets the start address of the frame buffer. It is * typically used to pan across a virtual desktop (frame buffer larger than * the displayed screen) or to flip the display between multiple buffers. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_set_display_offset(unsigned long offset) #else void gfx_set_display_offset(unsigned long offset) #endif { /* UPDATE FRAME BUFFER OFFSET */ unsigned long lock; lock = READ_REG32(DC_UNLOCK); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); /* START ADDRESS EFFECTS DISPLAY COMPRESSION */ /* Disable compression for non-zero start addresss values. */ /* Enable compression if offset is zero and comression is intended to */ /* be enabled from a previous call to "gfx_set_compression_enable". */ /* Compression should be disabled BEFORE the offset is changed */ /* and enabled AFTER the offset is changed. */ if (offset == 0) { WRITE_REG32(DC_FB_ST_OFFSET, offset); if (gfx_compression_enabled) { /* WAIT FOR THE OFFSET TO BE LATCHED */ gfx_wait_vertical_blank(); gu1_enable_compression(); } } else { /* ONLY DISABLE COMPRESSION ONCE */ if (gfx_compression_active) gu1_disable_compression(); WRITE_REG32(DC_FB_ST_OFFSET, offset); } WRITE_REG32(DC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_palette_entry * * This routine sets an palette entry in the display controller. * A 32-bit X:R:G:B value. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_display_palette_entry(unsigned long index, unsigned long palette) #else int gfx_set_display_palette_entry(unsigned long index, unsigned long palette) #endif { unsigned long data; if (index > 0xFF) return GFX_STATUS_BAD_PARAMETER; WRITE_REG32(DC_PAL_ADDRESS, index); data = ((palette >> 2) & 0x0003F) | ((palette >> 4) & 0x00FC0) | ((palette >> 6) & 0x3F000); WRITE_REG32(DC_PAL_DATA, data); return (0); } /*--------------------------------------------------------------------------- * gfx_set_display_palette * * This routine sets the entire palette in the display controller. * A pointer is provided to a 256 entry table of 32-bit X:R:G:B values. * * Restriction: * Due to SC1200 Issue #748 (in Notes DB) this function should be called only * when DCLK is active, i.e PLL is already powered up and genlock is not * active. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_display_palette(unsigned long *palette) #else int gfx_set_display_palette(unsigned long *palette) #endif { unsigned long data, i; WRITE_REG32(DC_PAL_ADDRESS, 0); if (palette) { for (i = 0; i < 256; i++) { /* CONVERT 24 BPP COLOR DATA TO 18 BPP COLOR DATA */ data = ((palette[i] >> 2) & 0x0003F) | ((palette[i] >> 4) & 0x00FC0) | ((palette[i] >> 6) & 0x3F000); WRITE_REG32(DC_PAL_DATA, data); } } return (0); } /*--------------------------------------------------------------------------- * gfx_set_cursor_enable * * This routine enables or disables the hardware cursor. * * WARNING: The cusrsor start offset must be set by setting the cursor * position before calling this routine to assure that memory reads do not * go past the end of graphics memory (this can hang GXm). *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_set_cursor_enable(int enable) #else void gfx_set_cursor_enable(int enable) #endif { unsigned long unlock, gcfg; /* SET OR CLEAR CURSOR ENABLE BIT */ unlock = READ_REG32(DC_UNLOCK); gcfg = READ_REG32(DC_GENERAL_CFG); if (enable) gcfg |= DC_GCFG_CURE; else gcfg &= ~(DC_GCFG_CURE); /* WRITE NEW REGISTER VALUE */ WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); WRITE_REG32(DC_GENERAL_CFG, gcfg); WRITE_REG32(DC_UNLOCK, unlock); } /*--------------------------------------------------------------------------- * gfx_set_cursor_colors * * This routine sets the colors of the hardware cursor. * * Restriction: * Due to SC1200 Issue #748 (in Notes DB) this function should be called only * when DCLK is active, i.e PLL is already powered up. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor) #else void gfx_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor) #endif { unsigned long value; /* If genlock is enabled DCLK might be disabled in vertical blank. */ /* Due to SC1200 Issue #748 in Notes DB this would fail the cursor color settings */ /* So Wait for vertical blank to end */ #if GFX_VIDEO_SC1200 if (gfx_test_timing_active()) while ((gfx_get_vline()) > gfx_get_vactive()); #endif /* SET CURSOR COLORS */ WRITE_REG32(DC_PAL_ADDRESS, 0x100); value = ((bkcolor & 0x000000FC) >> 2) | ((bkcolor & 0x0000FC00) >> (2 + 8 - 6)) | ((bkcolor & 0x00FC0000) >> (2 + 16 - 12)); WRITE_REG32(DC_PAL_DATA, value); value = ((fgcolor & 0x000000FC) >> 2) | ((fgcolor & 0x0000FC00) >> (2 + 8 - 6)) | ((fgcolor & 0x00FC0000) >> (2 + 16 - 12)); WRITE_REG32(DC_PAL_DATA, value); } /*--------------------------------------------------------------------------- * gfx_set_cursor_position * * This routine sets the position of the hardware cusror. The starting * offset of the cursor buffer must be specified so that the routine can * properly clip scanlines if the cursor is off the top of the screen. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_set_cursor_position(unsigned long memoffset, unsigned short xpos, unsigned short ypos, unsigned short xhotspot, unsigned short yhotspot) #else void gfx_set_cursor_position(unsigned long memoffset, unsigned short xpos, unsigned short ypos, unsigned short xhotspot, unsigned short yhotspot) #endif { unsigned long unlock; short x, y; short xoffset = 0; short yoffset = 0; /* SUPPORT CURSOR IN EMULATED VGA MODES */ /* Timings are for twice the resolution */ if (gfx_pixel_double) xpos <<= 1; if (gfx_line_double) ypos <<= 1; x = (short) xpos - (short) xhotspot; y = (short) ypos - (short) yhotspot; if (x < -31) return; if (y < -31) return; if (x < 0) { xoffset = -x; x = 0; } if (y < 0) { yoffset = -y; y = 0; } memoffset += (unsigned long) yoffset << 3; if (PanelEnable) { if ((ModeWidth > PanelWidth) || (ModeHeight > PanelHeight)) { gfx_enable_panning(xpos, ypos); x = x - (short) panelLeft; y = y - (short) panelTop; } } /* SET CURSOR POSITION */ unlock = READ_REG32(DC_UNLOCK); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); WRITE_REG32(DC_CURS_ST_OFFSET, memoffset); WRITE_REG32(DC_CURSOR_X, (unsigned long) x | (((unsigned long) xoffset) << 11)); WRITE_REG32(DC_CURSOR_Y, (unsigned long) y | (((unsigned long) yoffset) << 11)); WRITE_REG32(DC_UNLOCK, unlock); } /*--------------------------------------------------------------------------- * gfx_set_cursor_shape32 * * This routine loads 32x32 cursor data into the specified location in * graphics memory. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) #else void gfx_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) #endif { int i; unsigned long value; for (i = 0; i < 32; i++) { /* CONVERT TO 16 BITS AND MASK, 16 BITS XOR MASK PER DWORD */ value = (andmask[i] & 0xFFFF0000) | (xormask[i] >> 16); WRITE_FB32(memoffset, value); memoffset += 4; value = (andmask[i] << 16) | (xormask[i] & 0x0000FFFF); WRITE_FB32(memoffset, value); memoffset += 4; } } /*--------------------------------------------------------------------------- * gu1_enable_compression * * This is a private routine to this module (not exposed in the Durango API). * It enables display compression. *--------------------------------------------------------------------------- */ void gu1_enable_compression(void) { int i; unsigned long unlock, gcfg, offset; /* DO NOT ENABLE IF START ADDRESS IS NOT ZERO */ offset = READ_REG32(DC_FB_ST_OFFSET) & 0x003FFFFF; if (offset != 0) return; /* DO NOT ENABLE IF WE ARE WITHIN AN EMULATED VGA MODE */ if (gfx_line_double || gfx_pixel_double) return; /* SET GLOBAL INDICATOR */ gfx_compression_active = 1; /* CLEAR DIRTY/VALID BITS IN MEMORY CONTROLLER */ /* Software is required to do this before enabling compression. */ /* Don't want controller to think that old lines are still valid. */ for (i = 0; i < 1024; i++) { WRITE_REG32(MC_DR_ADD, i); WRITE_REG32(MC_DR_ACC, 0); } /* TURN ON COMPRESSION CONTROL BITS */ unlock = READ_REG32(DC_UNLOCK); gcfg = READ_REG32(DC_GENERAL_CFG); gcfg |= DC_GCFG_CMPE | DC_GCFG_DECE; WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); WRITE_REG32(DC_GENERAL_CFG, gcfg); WRITE_REG32(DC_UNLOCK, unlock); } /*--------------------------------------------------------------------------- * gu1_disable_compression * * This is a private routine to this module (not exposed in the Durango API). * It disables display compression. *--------------------------------------------------------------------------- */ void gu1_disable_compression(void) { unsigned long unlock, gcfg; /* SET GLOBAL INDICATOR */ gfx_compression_active = 0; /* TURN OFF COMPRESSION CONTROL BITS */ unlock = READ_REG32(DC_UNLOCK); gcfg = READ_REG32(DC_GENERAL_CFG); gcfg &= ~(DC_GCFG_CMPE | DC_GCFG_DECE); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); WRITE_REG32(DC_GENERAL_CFG, gcfg); WRITE_REG32(DC_UNLOCK, unlock); } /*--------------------------------------------------------------------------- * gfx_set_compression_enable * * This routine enables or disables display compression. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_compression_enable(int enable) #else int gfx_set_compression_enable(int enable) #endif { /* SET GLOBAL VARIABLE FOR INTENDED STATE */ /* Compression can only be enabled for non-zero start address values. */ /* Keep state to enable compression on start address changes. */ gfx_compression_enabled = enable; if (enable) gu1_enable_compression(); else gu1_disable_compression(); return (0); } /*--------------------------------------------------------------------------- * gfx_set_compression_offset * * This routine sets the base offset for the compression buffer. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_compression_offset(unsigned long offset) #else int gfx_set_compression_offset(unsigned long offset) #endif { unsigned long lock; /* MUST BE 16-BYTE ALIGNED FOR GXLV */ if (offset & 0x0F) return (1); /* SET REGISTER VALUE */ lock = READ_REG32(DC_UNLOCK); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); WRITE_REG32(DC_CB_ST_OFFSET, offset); WRITE_REG32(DC_UNLOCK, lock); return (0); } /*--------------------------------------------------------------------------- * gfx_set_compression_pitch * * This routine sets the pitch, in bytes, of the compression buffer. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_compression_pitch(unsigned short pitch) #else int gfx_set_compression_pitch(unsigned short pitch) #endif { unsigned long lock, line_delta; /* SET REGISTER VALUE */ lock = READ_REG32(DC_UNLOCK); line_delta = READ_REG32(DC_LINE_DELTA) & 0xFF800FFF; line_delta |= ((unsigned long) pitch << 10l) & 0x007FF000; WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); WRITE_REG32(DC_LINE_DELTA, line_delta); WRITE_REG32(DC_UNLOCK, lock); return (0); } /*--------------------------------------------------------------------------- * gfx_set_compression_size * * This routine sets the line size of the compression buffer, which is the * maximum number of bytes allowed to store a compressed line. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_compression_size(unsigned short size) #else int gfx_set_compression_size(unsigned short size) #endif { unsigned long lock, buf_size; /* SUBTRACT 16 FROM SIZE */ /* The display controller will actually write */ /* 2 extra QWords. So, if we assume that "size" */ /* refers to the allocated size, we must subtract */ /* 16 bytes. */ size -= 16; /* SET REGISTER VALUE */ lock = READ_REG32(DC_UNLOCK); buf_size = READ_REG32(DC_BUF_SIZE) & 0xFFFF01FF; buf_size |= (((size >> 2) + 1) & 0x7F) << 9; WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); WRITE_REG32(DC_BUF_SIZE, buf_size); WRITE_REG32(DC_UNLOCK, lock); return (0); } /*--------------------------------------------------------------------------- * gfx_set_display_video_enable (PRIVATE ROUTINE - NOT PART OF API) * * This routine enables/disables video on GX. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_set_display_video_enable(int enable) #else void gfx_set_display_video_enable(int enable) #endif { unsigned long lock, gcfg, buf_size; lock = READ_REG32(DC_UNLOCK); gcfg = READ_REG32(DC_GENERAL_CFG); buf_size = READ_REG32(DC_BUF_SIZE); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); vid_enabled = enable; /* SET THE BUFFER SIZE TO A NON-ZERO VALUE ONLY WHEN */ /* ENABLING VIDEO */ if (enable) { gcfg |= (DC_GCFG_VIDE | DC_GCFG_VRDY); WRITE_REG32(DC_GENERAL_CFG, gcfg); WRITE_REG32(DC_BUF_SIZE, (buf_size & 0x0000FFFFl) | vid_buf_size); } /* CLEAR THE VIDEO BUFFER SIZE WHEN DISABLING VIDEO */ else { gcfg &= ~(DC_GCFG_VIDE); WRITE_REG32(DC_GENERAL_CFG, gcfg); vid_buf_size = buf_size & 0xFFFF0000l; WRITE_REG32(DC_BUF_SIZE, buf_size & 0x0000FFFFl); } WRITE_REG32(DC_UNLOCK, lock); return; } /*--------------------------------------------------------------------------- * gfx_set_display_video_size (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_size". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_set_display_video_size(unsigned short width, unsigned short height) #else void gfx_set_display_video_size(unsigned short width, unsigned short height) #endif { unsigned long lock, size, value; size = (unsigned long) (width << 1) * (unsigned long) height; /* STORE THE VIDEO BUFFER SIZE AS A GLOBAL */ vid_buf_size = ((size + 63) >> 6) << 16; lock = READ_REG32(DC_UNLOCK); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); value = READ_REG32(DC_BUF_SIZE) & 0x0000FFFF; value |= vid_buf_size; WRITE_REG32(DC_BUF_SIZE, value); WRITE_REG32(DC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_video_offset (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_offset". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_set_display_video_offset(unsigned long offset) #else void gfx_set_display_video_offset(unsigned long offset) #endif { unsigned long lock; lock = READ_REG32(DC_UNLOCK); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); offset &= 0x003FFFFF; WRITE_REG32(DC_VID_ST_OFFSET, offset); WRITE_REG32(DC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_priority_high * * This routine controls the x-bus round robin arbitration mechanism. * When enable is TRUE, graphics pipeline requests and non-critical display * controller requests are arbitrated at the same priority as processor * requests. When FALSE processor requests are arbitrated at a higher priority *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_set_display_priority_high(int enable) #else void gfx_set_display_priority_high(int enable) #endif { unsigned long lock, control; lock = READ_REG32(DC_UNLOCK); control = READ_REG32(MC_MEM_CNTRL1); WRITE_REG32(DC_UNLOCK, DC_UNLOCK_VALUE); if (enable) control |= MC_XBUSARB; else control &= ~(MC_XBUSARB); WRITE_REG32(MC_MEM_CNTRL1, control); WRITE_REG32(DC_UNLOCK, lock); return; } /*--------------------------------------------------------------------------- * gfx_test_timing_active *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_test_timing_active(void) #else int gfx_test_timing_active(void) #endif { if (READ_REG32(DC_TIMING_CFG) & DC_TCFG_TGEN) return (1); else return (0); } /*--------------------------------------------------------------------------- * gfx_test_vertical_active *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_test_vertical_active(void) #else int gfx_test_vertical_active(void) #endif { if (READ_REG32(DC_TIMING_CFG) & DC_TCFG_VNA) return (0); else return (1); } /*--------------------------------------------------------------------------- * gfx_wait_vertical_blank *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_wait_vertical_blank(void) #else int gfx_wait_vertical_blank(void) #endif { if (gfx_test_timing_active()) { while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); } return (0); } /*--------------------------------------------------------------------------- * gfx_enable_panning * * This routine enables the panning when the Mode is bigger than the panel * size. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_enable_panning(int x, int y) #else void gfx_enable_panning(int x, int y) #endif { unsigned long modeBytesPerPixel; unsigned long modeBytesPerScanline = 0; unsigned long startAddress = 0; modeBytesPerPixel = (gbpp + 7) / 8; modeBytesPerScanline = (((ModeWidth + 1023) / 1024) * 1024) * modeBytesPerPixel; /* TEST FOR NO-WORK */ if (x >= DeltaX && (unsigned short) x < (PanelWidth + DeltaX) && y >= DeltaY && (unsigned short) y < (PanelHeight + DeltaY)) return; /* ADJUST PANNING VARIABLES WHEN CURSOR EXCEEDS BOUNDARY */ /* Test the boundary conditions for each coordinate and update */ /* all variables and the starting offset accordingly. */ if (x < DeltaX) DeltaX = x; else if ((unsigned short) x >= (DeltaX + PanelWidth)) DeltaX = x - PanelWidth + 1; if (y < DeltaY) DeltaY = y; else if ((unsigned short) y >= (DeltaY + PanelHeight)) DeltaY = y - PanelHeight + 1; /* CALCULATE THE START OFFSET */ startAddress = (DeltaX * modeBytesPerPixel) + (DeltaY * modeBytesPerScanline); gfx_set_display_offset(startAddress); /* SET PANEL COORDINATES */ /* Panel's x position must be DWORD aligned */ panelTop = DeltaY; panelLeft = DeltaX * modeBytesPerPixel; if (panelLeft & 3) panelLeft = (panelLeft & 0xFFFFFFFC) + 4; panelLeft /= modeBytesPerPixel; } /*--------------------------------------------------------------------------- * gfx_set_fixed_timings *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_fixed_timings(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) #else int gfx_set_fixed_timings(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) #endif { unsigned int mode; ModeWidth = width; ModeHeight = height; PanelWidth = (unsigned short) panelResX; PanelHeight = (unsigned short) panelResY; PanelEnable = 1; /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */ for (mode = 0; mode < NUM_FIXED_TIMINGS_MODES; mode++) { if ((FixedParams[mode].xres == width) && (FixedParams[mode].yres == height) && (FixedParams[mode].panelresx == panelResX) && (FixedParams[mode].panelresy == panelResY)) { /* SET THE 92xx FOR THE SELECTED MODE */ FIXEDTIMINGS *fmode = &FixedParams[mode]; gfx_set_display_timings(bpp, 3, fmode->hactive, fmode->hblankstart, fmode->hsyncstart, fmode->hsyncend, fmode->hblankend, fmode->htotal, fmode->vactive, fmode->vblankstart, fmode->vsyncstart, fmode->vsyncend, fmode->vblankend, fmode->vtotal, fmode->frequency); return (1); } /* end if() */ } /* end for() */ return (-1); } /*--------------------------------------------------------------------------- * gfx_set_panel_present *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_set_panel_present(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) #else int gfx_set_panel_present(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) #endif { /* SET VALID BPP */ /* 16BPP is the default. */ if (bpp != 8 && bpp != 15 && bpp != 16) bpp = 16; /* RECORD PANEL PARAMETERS */ /* This routine does not touch any panel timings. It is used when custom * panel settings are set up in advance by the BIOS or an application, but * the application still requires access to other panel functionality * provided by Durango (i.e. panning) * */ ModeWidth = width; ModeHeight = height; PanelWidth = (unsigned short) panelResX; PanelHeight = (unsigned short) panelResY; PanelEnable = 1; gbpp = bpp; /* PROGRAM THE BPP IN THE DISPLAY CONTROLLER */ gfx_set_display_bpp(bpp); return (GFX_STATUS_OK); } /*-----------------------------------------------------------------------* * THE FOLLOWING READ ROUTINES ARE ALWAYS INCLUDED: * * gfx_get_hsync_end, gfx_get_htotal, gfx_get_vsync_end, gfx_get_vtotal * * are used by the video overlay routines. * * * * gfx_get_vline and gfx_vactive are used to prevent an issue for the * * SC1200. * * * * The others are part of the Durango API. * *-----------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- * gfx_get_display_pitch * * This routine returns the current pitch of the frame buffer, in bytes. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_display_pitch(void) #else unsigned short gfx_get_display_pitch(void) #endif { unsigned long value; if (gfx_cpu_version == GFX_CPU_PYRAMID) { /* Pyramid update for 4KB line pitch */ value = (READ_REG32(DC_LINE_DELTA) & 0x07FF) << 2; } else { value = (READ_REG32(DC_LINE_DELTA) & 0x03FF) << 2; } return ((unsigned short) value); } /*---------------------------------------------------------------------------- * GFX_GET_DISPLAY_DETAILS * * This routine gets the specified display mode. * * Returns 1 if successful, 0 if mode could not be get. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_get_display_details(unsigned int mode, int *xres, int *yres, int *hz) #else int gfx_get_display_details(unsigned int mode, int *xres, int *yres, int *hz) #endif { if (mode < NUM_GX_DISPLAY_MODES) { if (DisplayParams[mode].flags & GFX_MODE_56HZ) *hz = 56; else if (DisplayParams[mode].flags & GFX_MODE_60HZ) *hz = 60; else if (DisplayParams[mode].flags & GFX_MODE_70HZ) *hz = 70; else if (DisplayParams[mode].flags & GFX_MODE_72HZ) *hz = 72; else if (DisplayParams[mode].flags & GFX_MODE_75HZ) *hz = 75; else if (DisplayParams[mode].flags & GFX_MODE_85HZ) *hz = 85; *xres = DisplayParams[mode].hactive; *yres = DisplayParams[mode].vactive; return (1); } return (0); } /*---------------------------------------------------------------------------- * GFX_GET_DISPLAY_MODE_COUNT * * Returns number of modes supported. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_get_display_mode_count(void) #else int gfx_get_display_mode_count(void) #endif { return (NUM_GX_DISPLAY_MODES); } /*---------------------------------------------------------------------------- * gfx_get_frame_buffer_line_size * * Returns the current frame buffer line size, in bytes *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu1_get_frame_buffer_line_size(void) #else unsigned long gfx_get_frame_buffer_line_size(void) #endif { return ((READ_REG32(DC_BUF_SIZE) & 0x1FF) << 3); } /*---------------------------------------------------------------------------- * gfx_mode_frequency_supported * * This routine examines if the requested mode with pixel frequency is supported. * * Returns >0 if successful , <0 if freq. could not be found and matched. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_mode_frequency_supported(int xres, int yres, int bpp, unsigned long frequency) #else int gfx_mode_frequency_supported(int xres, int yres, int bpp, unsigned long frequency) #endif { unsigned int index; unsigned long value; unsigned long bpp_flag = 0; bpp_flag = GFX_MODE_8BPP; if (bpp > 8) bpp_flag = GFX_MODE_16BPP; for (index = 0; index < NUM_GX_DISPLAY_MODES; index++) { if ((DisplayParams[index].hactive == (unsigned short) xres) && (DisplayParams[index].vactive == (unsigned short) yres) && (DisplayParams[index].flags & bpp_flag) && (DisplayParams[index].frequency == frequency)) { int hz = 0; value = DisplayParams[index].flags; if (value & GFX_MODE_56HZ) hz = 56; else if (value & GFX_MODE_60HZ) hz = 60; else if (value & GFX_MODE_70HZ) hz = 70; else if (value & GFX_MODE_72HZ) hz = 72; else if (value & GFX_MODE_75HZ) hz = 75; else if (value & GFX_MODE_85HZ) hz = 85; return (hz); } } return (-1); } /*---------------------------------------------------------------------------- * gfx_refreshrate_from_frequency * * This routine maps the frequency to close match refresh rate *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_get_refreshrate_from_frequency(int xres, int yres, int bpp, int *hz, unsigned long frequency) #else int gfx_get_refreshrate_from_frequency(int xres, int yres, int bpp, int *hz, unsigned long frequency) #endif { unsigned int index, closematch = 0; unsigned long value; unsigned long bpp_flag = 0; long min, diff; *hz = 60; bpp_flag = GFX_MODE_8BPP; if (bpp > 8) bpp_flag = GFX_MODE_16BPP; /* FIND THE REGISTER VALUES FOR THE DESIRED FREQUENCY */ /* Search the table for the closest frequency (16.16 format). */ min = 0x7fffffff; for (index = 0; index < NUM_GX_DISPLAY_MODES; index++) { if ((DisplayParams[index].htotal == (unsigned short) xres) && (DisplayParams[index].vtotal == (unsigned short) yres) && (DisplayParams[index].flags & bpp_flag)) { diff = (long) frequency - (long) DisplayParams[index].frequency; if (diff < 0) diff = -diff; if (diff < min) { min = diff; closematch = index; } } } value = DisplayParams[closematch].flags; if (value & GFX_MODE_56HZ) *hz = 56; else if (value & GFX_MODE_60HZ) *hz = 60; else if (value & GFX_MODE_70HZ) *hz = 70; else if (value & GFX_MODE_72HZ) *hz = 72; else if (value & GFX_MODE_75HZ) *hz = 75; else if (value & GFX_MODE_85HZ) *hz = 85; return (1); } /*---------------------------------------------------------------------------- * gfx_refreshrate_from_mode * * This routine is identical to the gfx_get_refreshrate_from_frequency, * except that the active timing values are compared instead of the total * values. Some modes (such as 70Hz and 72Hz) may be confused in this routine *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz, unsigned long frequency) #else int gfx_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz, unsigned long frequency) #endif { unsigned int index, closematch = 0; unsigned long value; unsigned long bpp_flag = 0; long min, diff; *hz = 60; bpp_flag = GFX_MODE_8BPP; if (bpp > 8) bpp_flag = GFX_MODE_16BPP; /* FIND THE REGISTER VALUES FOR THE DESIRED FREQUENCY */ /* Search the table for the closest frequency (16.16 format). */ min = 0x7fffffff; for (index = 0; index < NUM_GX_DISPLAY_MODES; index++) { if ((DisplayParams[index].hactive == (unsigned short) xres) && (DisplayParams[index].vactive == (unsigned short) yres) && (DisplayParams[index].flags & bpp_flag)) { diff = (long) frequency - (long) DisplayParams[index].frequency; if (diff < 0) diff = -diff; if (diff < min) { min = diff; closematch = index; } } } value = DisplayParams[closematch].flags; if (value & GFX_MODE_56HZ) *hz = 56; else if (value & GFX_MODE_60HZ) *hz = 60; else if (value & GFX_MODE_70HZ) *hz = 70; else if (value & GFX_MODE_72HZ) *hz = 72; else if (value & GFX_MODE_75HZ) *hz = 75; else if (value & GFX_MODE_85HZ) *hz = 85; return (1); } /*---------------------------------------------------------------------------- * gfx_get_frequency_from_refreshrate * * This routine maps the refresh rate to the closest matching PLL frequency. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_get_frequency_from_refreshrate(int xres, int yres, int bpp, int hz, int *frequency) #else int gfx_get_frequency_from_refreshrate(int xres, int yres, int bpp, int hz, int *frequency) #endif { unsigned int index; int retval = -1; unsigned long hz_flag = 0; unsigned long bpp_flag = 0; *frequency = 0; if (hz == 56) hz_flag = GFX_MODE_56HZ; else if (hz == 60) hz_flag = GFX_MODE_60HZ; else if (hz == 70) hz_flag = GFX_MODE_70HZ; else if (hz == 72) hz_flag = GFX_MODE_72HZ; else if (hz == 75) hz_flag = GFX_MODE_75HZ; else if (hz == 85) hz_flag = GFX_MODE_85HZ; bpp_flag = GFX_MODE_8BPP; if (bpp > 8) bpp_flag = GFX_MODE_16BPP; /* FIND THE REGISTER VALUES FOR THE DESIRED FREQUENCY */ for (index = 0; index < NUM_GX_DISPLAY_MODES; index++) { if ((DisplayParams[index].hactive == (unsigned short) xres) && (DisplayParams[index].vactive == (unsigned short) yres) && (DisplayParams[index].flags & bpp_flag) && (DisplayParams[index].flags & hz_flag)) { *frequency = DisplayParams[index].frequency; retval = 1; } } return retval; } /*--------------------------------------------------------------------------- * gfx_get_max_supported_pixel_clock * * This routine returns the maximum recommended speed for the pixel clock. The * return value is an integer of the format xxxyyy, where xxx.yyy is the maximum * floating point pixel clock speed. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu1_get_max_supported_pixel_clock(void) #else unsigned long gfx_get_max_supported_pixel_clock(void) #endif { /* ALL CHIPS CAN HANDLE 1280X1024@85HZ - 157.5 MHz */ return 157500; } /*---------------------------------------------------------------------------- * gfx_get_display_mode * * This routine gets the specified display mode. * * Returns: >0 if successful and mode returned, <0 if mode could not be found. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_get_display_mode(int *xres, int *yres, int *bpp, int *hz) #else int gfx_get_display_mode(int *xres, int *yres, int *bpp, int *hz) #endif { unsigned int mode = 0; unsigned long pll_freq = 0, bpp_flag = 0; *xres = gfx_get_hactive(); *yres = gfx_get_vactive(); *bpp = gfx_get_display_bpp(); pll_freq = gfx_get_clock_frequency(); /* SUPPORT EMULATED VGA MODES */ if (gfx_pixel_double) *xres >>= 1; if (gfx_line_double) *yres >>= 1; /* SET BPP FLAGS TO LIMIT MODE SELECTION */ bpp_flag = GFX_MODE_8BPP; if (*bpp > 8) bpp_flag = GFX_MODE_16BPP; for (mode = 0; mode < NUM_GX_DISPLAY_MODES; mode++) { if ((DisplayParams[mode].hactive == (unsigned short) *xres) && (DisplayParams[mode].vactive == (unsigned short) *yres) && (DisplayParams[mode].frequency == pll_freq) && (DisplayParams[mode].flags & bpp_flag)) { pll_freq = DisplayParams[mode].flags; if (pll_freq & GFX_MODE_56HZ) *hz = 56; else if (pll_freq & GFX_MODE_60HZ) *hz = 60; else if (pll_freq & GFX_MODE_70HZ) *hz = 70; else if (pll_freq & GFX_MODE_72HZ) *hz = 72; else if (pll_freq & GFX_MODE_75HZ) *hz = 75; else if (pll_freq & GFX_MODE_85HZ) *hz = 85; return (1); } } return (-1); } /*--------------------------------------------------------------------------- * gfx_get_hactive *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_hactive(void) #else unsigned short gfx_get_hactive(void) #endif { return ((unsigned short) ((READ_REG32(DC_H_TIMING_1) & 0x07F8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_hsync_start *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_hsync_start(void) #else unsigned short gfx_get_hsync_start(void) #endif { return ((unsigned short) ((READ_REG32(DC_H_TIMING_3) & 0x07F8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_hsync_end *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_hsync_end(void) #else unsigned short gfx_get_hsync_end(void) #endif { return ((unsigned short) (((READ_REG32(DC_H_TIMING_3) >> 16) & 0x07F8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_htotal *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_htotal(void) #else unsigned short gfx_get_htotal(void) #endif { return ((unsigned short) (((READ_REG32(DC_H_TIMING_1) >> 16) & 0x07F8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_vactive *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_vactive(void) #else unsigned short gfx_get_vactive(void) #endif { return ((unsigned short) ((READ_REG32(DC_V_TIMING_1) & 0x07FF) + 1)); } /*--------------------------------------------------------------------------- * gfx_get_vsync_end *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_vsync_end(void) #else unsigned short gfx_get_vsync_end(void) #endif { return ((unsigned short) (((READ_REG32(DC_V_TIMING_3) >> 16) & 0x07FF) + 1)); } /*--------------------------------------------------------------------------- * gfx_get_vtotal *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_vtotal(void) #else unsigned short gfx_get_vtotal(void) #endif { return ((unsigned short) (((READ_REG32(DC_V_TIMING_1) >> 16) & 0x07FF) + 1)); } /*----------------------------------------------------------------------------- * gfx_get_display_bpp * * This routine returns the current color depth of the active display. *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_display_bpp(void) #else unsigned short gfx_get_display_bpp(void) #endif { switch (READ_REG32(DC_OUTPUT_CFG) & 3) { case 0: return (16); case 2: return (15); } return (8); } /*--------------------------------------------------------------------------- * gfx_get_vline *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_vline(void) #else unsigned short gfx_get_vline(void) #endif { unsigned short current_scan_line; /* Read similar value twice to ensure that the value is not transitioning */ do { current_scan_line = (unsigned short) READ_REG32(DC_V_LINE_CNT) & 0x07FF; } while (current_scan_line != (unsigned short) (READ_REG32(DC_V_LINE_CNT) & 0x07FF)); return (current_scan_line); } /*----------------------------------------------------------------------------- * gfx_get_display_offset *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu1_get_display_offset(void) #else unsigned long gfx_get_display_offset(void) #endif { return (READ_REG32(DC_FB_ST_OFFSET) & 0x003FFFFF); } /*----------------------------------------------------------------------------- * gfx_get_cursor_offset *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu1_get_cursor_offset(void) #else unsigned long gfx_get_cursor_offset(void) #endif { return (READ_REG32(DC_CURS_ST_OFFSET) & 0x003FFFFF); } #if GFX_READ_ROUTINES /*************************************************************/ /* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ /*************************************************************/ /*--------------------------------------------------------------------------- * gfx_get_hblank_start *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_hblank_start(void) #else unsigned short gfx_get_hblank_start(void) #endif { return ((unsigned short) ((READ_REG32(DC_H_TIMING_2) & 0x07F8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_hblank_end *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_hblank_end(void) #else unsigned short gfx_get_hblank_end(void) #endif { return ((unsigned short) (((READ_REG32(DC_H_TIMING_2) >> 16) & 0x07F8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_vblank_start *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_vblank_start(void) #else unsigned short gfx_get_vblank_start(void) #endif { return ((unsigned short) ((READ_REG32(DC_V_TIMING_2) & 0x07FF) + 1)); } /*--------------------------------------------------------------------------- * gfx_get_vsync_start *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_vsync_start(void) #else unsigned short gfx_get_vsync_start(void) #endif { return ((unsigned short) ((READ_REG32(DC_V_TIMING_3) & 0x07FF) + 1)); } /*--------------------------------------------------------------------------- * gfx_get_vblank_end *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_vblank_end(void) #else unsigned short gfx_get_vblank_end(void) #endif { return ((unsigned short) (((READ_REG32(DC_V_TIMING_2) >> 16) & 0x07FF) + 1)); } /*----------------------------------------------------------------------------- * gfx_get_display_palette_entry *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_get_display_palette_entry(unsigned long index, unsigned long *palette) #else int gfx_get_display_palette_entry(unsigned long index, unsigned long *palette) #endif { unsigned long data; if (index > 0xFF) return GFX_STATUS_BAD_PARAMETER; WRITE_REG32(DC_PAL_ADDRESS, index); data = READ_REG32(DC_PAL_DATA); data = ((data << 2) & 0x000000FC) | ((data << 4) & 0x0000FC00) | ((data << 6) & 0x00FC0000); *palette = data; return 0; } /*----------------------------------------------------------------------------- * gfx_get_display_palette *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu1_get_display_palette(unsigned long *palette) #else void gfx_get_display_palette(unsigned long *palette) #endif { unsigned long i, data; WRITE_REG32(DC_PAL_ADDRESS, 0); for (i = 0; i < 256; i++) { data = READ_REG32(DC_PAL_DATA); data = ((data << 2) & 0x000000FC) | ((data << 4) & 0x0000FC00) | ((data << 6) & 0x00FC0000); palette[i] = data; } } /*----------------------------------------------------------------------------- * gfx_get_cursor_enable *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu1_get_cursor_enable(void) #else unsigned long gfx_get_cursor_enable(void) #endif { return (READ_REG32(DC_GENERAL_CFG) & DC_GCFG_CURE); } /*----------------------------------------------------------------------------- * gfx_get_cursor_position *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu1_get_cursor_position(void) #else unsigned long gfx_get_cursor_position(void) #endif { return ((READ_REG32(DC_CURSOR_X) & 0x07FF) | ((READ_REG32(DC_CURSOR_Y) << 16) & 0x03FF0000)); } /*----------------------------------------------------------------------------- * gfx_get_cursor_clip *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu1_get_cursor_clip(void) #else unsigned long gfx_get_cursor_clip(void) #endif { return (((READ_REG32(DC_CURSOR_X) >> 11) & 0x01F) | ((READ_REG32(DC_CURSOR_Y) << 5) & 0x1F0000)); } /*----------------------------------------------------------------------------- * gfx_get_cursor_color *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu1_get_cursor_color(int color) #else unsigned long gfx_get_cursor_color(int color) #endif { unsigned long data; if (color) { WRITE_REG32(DC_PAL_ADDRESS, 0x101); } else { WRITE_REG32(DC_PAL_ADDRESS, 0x100); } data = READ_REG32(DC_PAL_DATA); data = ((data << 6) & 0x00FC0000) | ((data << 4) & 0x0000FC00) | ((data << 2) & 0x000000FC); return (data); } /*----------------------------------------------------------------------------- * gfx_get_compression_enable *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_get_compression_enable(void) #else int gfx_get_compression_enable(void) #endif { unsigned long gcfg; gcfg = READ_REG32(DC_GENERAL_CFG); if (gcfg & DC_GCFG_CMPE) return (1); else return (0); } /*----------------------------------------------------------------------------- * gfx_get_compression_offset *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu1_get_compression_offset(void) #else unsigned long gfx_get_compression_offset(void) #endif { unsigned long offset; offset = READ_REG32(DC_CB_ST_OFFSET) & 0x003FFFFF; return (offset); } /*----------------------------------------------------------------------------- * gfx_get_compression_pitch *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_compression_pitch(void) #else unsigned short gfx_get_compression_pitch(void) #endif { unsigned short pitch; pitch = (unsigned short) (READ_REG32(DC_LINE_DELTA) >> 12) & 0x03FF; return (pitch << 2); } /*----------------------------------------------------------------------------- * gfx_get_compression_size *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu1_get_compression_size(void) #else unsigned short gfx_get_compression_size(void) #endif { unsigned short size; size = (unsigned short) ((READ_REG32(DC_BUF_SIZE) >> 9) & 0x7F) - 1; return ((size << 2) + 16); } /*----------------------------------------------------------------------------- * gfx_get_valid_bit *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_get_valid_bit(int line) #else int gfx_get_valid_bit(int line) #endif { int valid; WRITE_REG32(MC_DR_ADD, line); valid = (int) READ_REG32(MC_DR_ACC) & 1; return (valid); } /*--------------------------------------------------------------------------- * gfx_get_display_video_offset (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_get_video_offset". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu1_get_display_video_offset(void) #else unsigned long gfx_get_display_video_offset(void) #endif { return (READ_REG32(DC_VID_ST_OFFSET) & 0x003FFFFF); } /*--------------------------------------------------------------------------- * gfx_get_display_video_size (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_get_video_size". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu1_get_display_video_size(void) #else unsigned long gfx_get_display_video_size(void) #endif { /* RETURN TOTAL SIZE, IN BYTES */ return ((READ_REG32(DC_BUF_SIZE) >> 10) & 0x000FFFC0); } /*----------------------------------------------------------------------------- * gfx_get_display_priority_high *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu1_get_display_priority_high(void) #else int gfx_get_display_priority_high(void) #endif { if (READ_REG32(MC_MEM_CNTRL1) & MC_XBUSARB) return (1); else return (0); } #endif /* GFX_READ_ROUTINES */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_vip.c0000644000175000017500000003354712654445443014775 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to control the video input port (VIP). * * gfx_set_vip_enable * gfx_set_vip_capture_run_mode * gfx_set_vip_base * gfx_set_vip_pitch * gfx_set_vip_mode * gfx_set_vbi_enable * gfx_set_vbi_mode * gfx_set_vbi_base * gfx_set_vbi_pitch * gfx_set_vbi_direct * gfx_set_vbi_interrupt * gfx_set_vip_bus_request_threshold_high * gfx_set_vip_last_line * gfx_test_vip_odd_field * gfx_test_vip_bases_updated * gfx_test_vip_fifo_overflow * gfx_get_vip_line * gfx_get_vip_base * gfx_get_vbi_pitch * * And the following routines if GFX_READ_ROUTINES is set: * * gfx_get_vip_enable * gfx_get_vip_pitch * gfx_get_vip_mode * gfx_get_vbi_enable * gfx_get_vbi_mode * gfx_get_vbi_base * gfx_get_vbi_direct * gfx_get_vbi_interrupt * gfx_get_vip_bus_request_threshold_high * */ /* INCLUDE SUPPORT FOR SC1200, IF SPECIFIED. */ #if GFX_VIP_SC1200 #include "vip_1200.c" #endif /* WRAPPERS IF DYNAMIC SELECTION */ /* Extra layer to call either CS5530 or SC1200 routines. */ #if GFX_VIP_DYNAMIC /*--------------------------------------------------------------------------- * gfx_set_vip_enable *---------------------------------------------------------------------------- */ int gfx_set_vip_enable(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vip_enable(enable); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vip_capture_run_mode *---------------------------------------------------------------------------- */ int gfx_set_vip_capture_run_mode(int mode) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vip_capture_run_mode(mode); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vip_base *---------------------------------------------------------------------------- */ int gfx_set_vip_base(unsigned long even, unsigned long odd) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vip_base(even, odd); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vip_pitch *---------------------------------------------------------------------------- */ int gfx_set_vip_pitch(unsigned long pitch) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vip_pitch(pitch); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vip_mode *---------------------------------------------------------------------------- */ int gfx_set_vip_mode(int mode) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vip_mode(mode); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vbi_enable *---------------------------------------------------------------------------- */ int gfx_set_vbi_enable(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vbi_enable(enable); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vbi_mode *---------------------------------------------------------------------------- */ int gfx_set_vbi_mode(int mode) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vbi_mode(mode); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vbi_base *---------------------------------------------------------------------------- */ int gfx_set_vbi_base(unsigned long even, unsigned long odd) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vbi_base(even, odd); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vbi_pitch *---------------------------------------------------------------------------- */ int gfx_set_vbi_pitch(unsigned long pitch) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vbi_pitch(pitch); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vbi_direct *---------------------------------------------------------------------------- */ int gfx_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vbi_direct(even_lines, odd_lines); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vbi_interrupt *---------------------------------------------------------------------------- */ int gfx_set_vbi_interrupt(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vbi_interrupt(enable); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vip_bus_request_threshold_high *---------------------------------------------------------------------------- */ int gfx_set_vip_bus_request_threshold_high(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vip_bus_request_threshold_high(enable); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_vip_last_line *---------------------------------------------------------------------------- */ int gfx_set_vip_last_line(int last_line) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_set_vip_last_line(last_line); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_test_vip_odd_field *---------------------------------------------------------------------------- */ int gfx_test_vip_odd_field(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_test_vip_odd_field(); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_test_vip_bases_updated *---------------------------------------------------------------------------- */ int gfx_test_vip_bases_updated(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_test_vip_bases_updated(); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_test_vip_fifo_overflow *---------------------------------------------------------------------------- */ int gfx_test_vip_fifo_overflow(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_test_vip_fifo_overflow(); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_get_vip_line *---------------------------------------------------------------------------- */ int gfx_get_vip_line(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) status = sc1200_get_vip_line(); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_get_vip_base *---------------------------------------------------------------------------- */ unsigned long gfx_get_vip_base(int odd) { unsigned long base = 0; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) base = sc1200_get_vip_base(odd); #endif return (base); } /*---------------------------------------------------------------------------- * gfx_get_vbi_pitch *---------------------------------------------------------------------------- */ unsigned long gfx_get_vbi_pitch(void) { unsigned long pitch = 0; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) pitch = sc1200_get_vbi_pitch(); #endif return (pitch); } /*************************************************************/ /* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ /*************************************************************/ #if GFX_READ_ROUTINES /*---------------------------------------------------------------------------- * gfx_get_vip_enable *---------------------------------------------------------------------------- */ int gfx_get_vip_enable(void) { int enable = 0; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) enable = sc1200_get_vip_enable(); #endif return (enable); } /*---------------------------------------------------------------------------- * gfx_get_vip_pitch *---------------------------------------------------------------------------- */ unsigned long gfx_get_vip_pitch(void) { unsigned long pitch = 0; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) pitch = sc1200_get_vip_pitch(); #endif return (pitch); } /*---------------------------------------------------------------------------- * gfx_get_vip_mode *---------------------------------------------------------------------------- */ int gfx_get_vip_mode(void) { int mode = 0; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) mode = sc1200_get_vip_mode(); #endif return (mode); } /*---------------------------------------------------------------------------- * gfx_get_vbi_enable *---------------------------------------------------------------------------- */ int gfx_get_vbi_enable(void) { int enable = 0; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) enable = sc1200_get_vbi_enable(); #endif return (enable); } /*---------------------------------------------------------------------------- * gfx_get_vbi_mode *---------------------------------------------------------------------------- */ int gfx_get_vbi_mode(void) { int mode = 0; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) mode = sc1200_get_vbi_mode(); #endif return (mode); } /*---------------------------------------------------------------------------- * gfx_get_vbi_base *---------------------------------------------------------------------------- */ unsigned long gfx_get_vbi_base(int odd) { unsigned long base = 0; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) base = sc1200_get_vbi_base(odd); #endif return (base); } /*---------------------------------------------------------------------------- * gfx_get_vbi_direct *---------------------------------------------------------------------------- */ unsigned long gfx_get_vbi_direct(int odd) { unsigned long vbi_direct_lines = 0; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) vbi_direct_lines = sc1200_get_vbi_direct(odd); #endif return (vbi_direct_lines); } /*---------------------------------------------------------------------------- * gfx_get_vbi_interrupt *---------------------------------------------------------------------------- */ int gfx_get_vbi_interrupt(void) { int enable = 0; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) enable = sc1200_get_vbi_interrupt(); #endif return (enable); } /*---------------------------------------------------------------------------- * gfx_get_vip_bus_request_threshold_high *---------------------------------------------------------------------------- */ int gfx_get_vip_bus_request_threshold_high(void) { int enable = 0; #if GFX_VIP_SC1200 if (gfx_vip_type == GFX_VIP_TYPE_SC1200) enable = sc1200_get_vip_bus_request_threshold_high(); #endif return (enable); } #endif /* GFX_READ_ROUTINES */ #endif /* GFX_VIP_DYNAMIC */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_i2c.c0000644000175000017500000001172112654445443014642 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to write to and read from the I2C bus. * */ /* INCLUDE ROUTINES FOR ACCESS.BUS, IF SPECIFIED */ /* This is for SC1200 systems. */ #if GFX_I2C_ACCESS #include "i2c_acc.c" #endif /* INCLUDE ROUTINES FOR CS5530 GPIOs, IF SPECIFIED */ /* This is for GXLV systems that use GPIOs on the CS5530 for I2C. */ #if GFX_I2C_GPIO #include "i2c_gpio.c" #endif /* WRAPPERS IF DYNAMIC SELECTION */ /* Extra layer to call either ACCESS.bus or GPIO routines. */ #if GFX_I2C_DYNAMIC /*--------------------------------------------------------------------------- * gfx_i2c_reset *--------------------------------------------------------------------------- */ int gfx_i2c_reset(unsigned char busnum, short adr, char freq) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_I2C_ACCESS if (gfx_i2c_type & GFX_I2C_TYPE_ACCESS) status = acc_i2c_reset(busnum, adr, freq); #endif #if GFX_I2C_GPIO if (gfx_i2c_type & GFX_I2C_TYPE_GPIO) status = gpio_i2c_reset(busnum, adr, freq); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_i2c_select_gpio *--------------------------------------------------------------------------- */ int gfx_i2c_select_gpio(int clock, int data) { #if GFX_I2C_ACCESS if (gfx_i2c_type & GFX_I2C_TYPE_ACCESS) acc_i2c_select_gpio(clock, data); #endif #if GFX_I2C_GPIO if (gfx_i2c_type & GFX_I2C_TYPE_GPIO) gpio_i2c_select_gpio(clock, data); #endif return (0); } /*--------------------------------------------------------------------------- * gfx_i2c_write *--------------------------------------------------------------------------- */ int gfx_i2c_write(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data) { int status = -1; #if GFX_I2C_ACCESS if (gfx_i2c_type & GFX_I2C_TYPE_ACCESS) status = acc_i2c_write(busnum, chipadr, subadr, bytes, data); #endif #if GFX_I2C_GPIO if (gfx_i2c_type & GFX_I2C_TYPE_GPIO) status = gpio_i2c_write(busnum, chipadr, subadr, bytes, data); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_i2c_read *--------------------------------------------------------------------------- */ int gfx_i2c_read(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data) { int status = -1; #if GFX_I2C_ACCESS if (gfx_i2c_type & GFX_I2C_TYPE_ACCESS) status = acc_i2c_read(busnum, chipadr, subadr, bytes, data); #endif #if GFX_I2C_GPIO if (gfx_i2c_type & GFX_I2C_TYPE_GPIO) status = gpio_i2c_read(busnum, chipadr, subadr, bytes, data); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_i2c_init *--------------------------------------------------------------------------- */ int gfx_i2c_init(void) { int status = -1; #if GFX_I2C_ACCESS if (gfx_i2c_type & GFX_I2C_TYPE_ACCESS) status = acc_i2c_init(); #endif #if GFX_I2C_GPIO if (gfx_i2c_type & GFX_I2C_TYPE_GPIO) status = gpio_i2c_init(); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_i2c_cleanup *--------------------------------------------------------------------------- */ void gfx_i2c_cleanup(void) { #if GFX_I2C_ACCESS if (gfx_i2c_type & GFX_I2C_TYPE_ACCESS) acc_i2c_cleanup(); #endif #if GFX_I2C_GPIO if (gfx_i2c_type & GFX_I2C_TYPE_GPIO) gpio_i2c_cleanup(); #endif } #endif /* GFX_I2C_DYNAMIC */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_disp.c0000644000175000017500000023146112654445443015131 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to program the display controller. * * The "disp_gu1.c" and "disp_gu2.c" files implement the following routines: * * gfx_get_display_mode_count * gfx_get_display_mode * gfx_is_display_mode_supported * gfx_is_panel_mode_supported * gfx_get_display_details * gfx_set_display_mode * gfx_set_display_bpp * gfx_set_display_timings * gfx_set_vtotal * gfx_get_display_pitch * gfx_set_display_pitch * gfx_set_display_offset * gfx_set_display_palette * gfx_set_display_palette_entry * gfx_set_cursor_enable * gfx_set_cursor_colors * gfx_set_cursor_position * gfx_set_cursor_shape32 * gfx_set_cursor_shape64 * gfx_set_compression_enable * gfx_set_compression_offset * gfx_set_compression_pitch * gfx_set_compression_size * gfx_set_display_priority_high * gfx_set_panel_present * gfx_test_timing_active * gfx_test_vertical_active * gfx_wait_vertical_blank * gfx_reset_timing_lock * * And the following routines if GFX_READ_ROUTINES is set: * * gfx_get_hactive * gfx_get_hblank_start * gfx_get_hsync_start * gfx_get_hsync_end * gfx_get_hblank_end * gfx_get_htotal * gfx_get_vactive * gfx_get_vblank_start * gfx_get_vsync_start * gfx_get_vsync_end * gfx_get_vblank_end * gfx_get_vtotal * gfx_get_vline * gfx_get_display_bpp * gfx_get_display_offset * gfx_get_display_palette * gfx_get_cursor_enable * gfx_get_cursor_base * gfx_get_cursor_position * gfx_get_cursor_offset * gfx_get_cursor_color * gfx_get_compression_enable * gfx_get_compression_offset * gfx_get_compression_pitch * gfx_get_compression_size * gfx_get_display_priority_high * gfx_get_valid_bit * */ unsigned short PanelWidth = 0; unsigned short PanelHeight = 0; unsigned short PanelEnable = 0; unsigned short ModeWidth; unsigned short ModeHeight; int DeltaX = 0; int DeltaY = 0; unsigned long prevstartAddr = 0; unsigned long panelTop = 0; unsigned long panelLeft = 0; int gbpp = 8; int gfx_compression_enabled = 0; int gfx_compression_active = 0; int gfx_line_double = 0; int gfx_pixel_double = 0; int gfx_timing_lock = 0; DISPLAYMODE gfx_display_mode; /* DISPLAY MODE TIMINGS */ DISPLAYMODE DisplayParams[] = { /* 320 x 200 */ { GFX_MODE_70HZ | /* refresh rate = 60 */ GFX_MODE_8BPP | GFX_MODE_16BPP | /* 8 and 16 BPP valid */ GFX_MODE_NEG_HSYNC | /* negative HSYNC */ GFX_MODE_PIXEL_DOUBLE | /* Double width */ GFX_MODE_LINE_DOUBLE, /* Double height */ 0x140, 0x288, 0x290, 0x2F0, 0x318, 0x320, /* horizontal timings */ 0x0C8, 0x197, 0x19C, 0x19E, 0x1BA, 0x1C1, /* vertical timings */ 0x00192CCC, /* freq = 25.175 MHz */ }, /* 320 x 240 */ { GFX_MODE_75HZ | /* refresh rate = 75 */ GFX_MODE_8BPP | GFX_MODE_16BPP | /* 8 and 16 BPP valid */ GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC | /* negative syncs */ GFX_MODE_PIXEL_DOUBLE | /* Double width */ GFX_MODE_LINE_DOUBLE, /* Double height */ 0x0140, 0x0280, 0x0290, 0x02D0, 0x0348, 0x0348, /* horizontal timings */ 0x00F0, 0x01E0, 0x01E1, 0x01E4, 0x01F4, 0x01F4, /* vertical timings */ 0x001F8000, /* freq = 31.5 MHz */ }, /* 400 x 300 */ { GFX_MODE_75HZ | /* refresh rate = 75 */ GFX_MODE_8BPP | GFX_MODE_16BPP | /* 8 and 16 BPP valid */ GFX_MODE_PIXEL_DOUBLE | /* Double width */ GFX_MODE_LINE_DOUBLE, /* Double height */ 0x0190, 0x0320, 0x0330, 0x0380, 0x0420, 0x0420, /* horizontal timings */ 0x012C, 0x0258, 0x0259, 0x025C, 0x0271, 0x0271, /* vertical timings */ 0x00318000, /* freq = 49.5 MHz */ }, /* 512 x 384 */ { GFX_MODE_75HZ | /* refresh rate = 75 */ GFX_MODE_8BPP | GFX_MODE_16BPP | /* 8 and 16 BPP valid */ GFX_MODE_PIXEL_DOUBLE | /* Double width */ GFX_MODE_LINE_DOUBLE, /* Double height */ 0x0200, 0x0400, 0x0410, 0x0470, 0x0520, 0x0520, /* horizontal timings */ 0x0180, 0x0300, 0x0301, 0x0304, 0x0320, 0x0320, /* vertical timings */ 0x004EC000, /* freq = 78.75 MHz */ }, /* 640 x 400 */ { GFX_MODE_70HZ | /* refresh rate = 60 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC, /* negative HSYNC */ 0x280, 0x288, 0x290, 0x2F0, 0x318, 0x320, /* horizontal timings */ 0x190, 0x197, 0x19C, 0x19E, 0x1BA, 0x1C1, /* vertical timings */ 0x00192CCC, /* freq = 25.175 MHz */ }, /* 640x480 */ { GFX_MODE_60HZ | /* refresh rate = 60 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs */ 0x0280, 0x0288, 0x0290, 0x02E8, 0x0318, 0x0320, /* horizontal timings */ 0x01E0, 0x01E8, 0x01EA, 0x01EC, 0x0205, 0x020D, /* vertical timings */ 0x00192CCC, /* freq = 25.175 MHz */ }, { GFX_MODE_70HZ | /* refresh rate = 60 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0280, 0x0280, 0x0298, 0x02D8, 0x0330, 0x0330, /* horizontal timings */ 0x01E0, 0x01E0, 0x01E2, 0x01E5, 0x01F4, 0x01F4, /* vertical timings */ 0x001C8F5C, /* freq = 28.560 MHz */ }, { GFX_MODE_72HZ | /* refresh rate = 72 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs */ 0x0280, 0x0288, 0x0298, 0x02c0, 0x0338, 0x0340, /* horizontal timings */ 0x01e0, 0x01e8, 0x01e9, 0x01ec, 0x0200, 0x0208, /* vertical timings */ 0x001F8000, /* freq = 31.5 MHz */ }, { GFX_MODE_75HZ | /* refresh rate = 75 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs */ 0x0280, 0x0280, 0x0290, 0x02D0, 0x0348, 0x0348, /* horizontal timings */ 0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01F4, 0x01F4, /* vertical timings */ 0x001F8000, /* freq = 31.5 MHz */ }, { GFX_MODE_85HZ | /* refresh rate = 85 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs */ 0x0280, 0x0280, 0x02B8, 0x02F0, 0x0340, 0x0340, /* horizontal timings */ 0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FD, 0x01FD, /* vertical timings */ 0x00240000, /* freq = 36.0 MHz */ }, { GFX_MODE_90HZ | /* refresh rate = 90 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0280, 0x0280, 0x02A0, 0x02E0, 0x0340, 0x0340, /* horizontal timings */ 0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FA, 0x01FA, /* vertical timings */ 0x0025E395, /* freq = 37.889 MHz */ }, { GFX_MODE_100HZ | /* refresh rate = 100 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0280, 0x0280, 0x02A8, 0x02E8, 0x0350, 0x0350, /* horizontal timings */ 0x01E0, 0x01E0, 0x01E1, 0x01E4, 0x01FD, 0x01FD, /* vertical timings */ 0x002B29BA, /* freq = 43.163 MHz */ }, /* 800x600 */ { GFX_MODE_56HZ | /* refresh rate = 56 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0320, 0x0320, 0x0338, 0x0380, 0x0400, 0x0400, /* horizontal timings */ 0x0258, 0x0258, 0x0259, 0x025B, 0x0271, 0x0271, /* vertical timings */ 0x00240000, /* freq = 36.00 MHz */ }, { GFX_MODE_60HZ | /* refresh rate = 60 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0320, 0x0328, 0x0348, 0x03D0, 0x0418, 0x0420, /* horizontal timings */ 0x0258, 0x0258, 0x0259, 0x025D, 0x0274, 0x0274, /* vertical timings */ 0x00280000, /* freq = 40.00 MHz */ }, { GFX_MODE_70HZ | /* refresh rate = 70 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0320, 0x0320, 0x0348, 0x0398, 0x0410, 0x0410, /* horizontal timings */ 0x0258, 0x0258, 0x025c, 0x025F, 0x0274, 0x0274, /* vertical timings */ 0x002DB851, /* freq = 45.72 MHz */ }, { GFX_MODE_72HZ | /* refresh rate = 72 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0320, 0x0320, 0x0358, 0x03D0, 0x0410, 0x0410, /* horizontal timings */ 0x0258, 0x0258, 0x027D, 0x0283, 0x029A, 0x029A, /* vertical timings */ 0x00320000, /* freq = 49.5 MHz */ }, { GFX_MODE_75HZ | /* refresh rate = 75 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0320, 0x0320, 0x0330, 0x0380, 0x0420, 0x0420, /* horizontal timings */ 0x0258, 0x0258, 0x0259, 0x025C, 0x0271, 0x0271, /* vertical timings */ 0x00318000, /* freq = 49.5 MHz */ }, { GFX_MODE_85HZ | /* refresh rate = 85 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0320, 0x0320, 0x0340, 0x0380, 0x0418, 0x0418, /* horizontal timings */ 0x0258, 0x0258, 0x0259, 0x025C, 0x0277, 0x0277, /* vertical timings */ 0x00384000, /* freq = 56.25 MHz */ }, { GFX_MODE_90HZ | /* refresh rate = 90 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0320, 0x0320, 0x0348, 0x03A0, 0x0420, 0x0420, /* horizontal timings */ 0x0258, 0x0258, 0x0259, 0x025C, 0x0278, 0x0278, /* vertical timings */ 0x003C10A3, /* freq = 60.065 MHz */ }, { GFX_MODE_100HZ | /* refresh rate = 100 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0320, 0x0320, 0x0350, 0x03A8, 0x0430, 0x0430, /* horizontal timings */ 0x0258, 0x0258, 0x0259, 0x025C, 0x0277, 0x027C, /* vertical timings */ 0x00442DD2, /* freq = 68.179 MHz */ }, /* 1024x768 */ { GFX_MODE_60HZ | /* refresh rate = 60 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs */ 0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540, /* horizontal timings */ 0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326, /* vertical timings */ 0x00410000, /* freq = 65.00 MHz */ }, { GFX_MODE_70HZ | /* refresh rate = 70 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP | GFX_MODE_NEG_HSYNC | GFX_MODE_NEG_VSYNC, /* negative syncs */ 0x0400, 0x0400, 0x0418, 0x04A0, 0x0530, 0x0530, /* horizontal timings */ 0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326, /* vertical timings */ 0x004B0000, /* freq = 75.00 MHz */ }, { GFX_MODE_72HZ | /* refresh rate = 72 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0400, 0x0400, 0x0438, 0x04A8, 0x0550, 0x0550, /* horizontal timings */ 0x0300, 0x0300, 0x0304, 0x0307, 0x0324, 0x0324, /* vertical timings */ 0x004EC000, /* freq = 78.75 MHz */ }, { GFX_MODE_75HZ | /* refresh rate = 75 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0400, 0x0400, 0x0410, 0x0470, 0x0520, 0x0520, /* horizontal timings */ 0x0300, 0x0300, 0x0301, 0x0304, 0x0320, 0x0320, /* vertical timings */ 0x004EC000, /* freq = 78.75 MHz */ }, { GFX_MODE_85HZ | /* refresh rate = 85 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0400, 0x0400, 0x0430, 0x0490, 0x0560, 0x0560, /* horizontal timings */ 0x0300, 0x0300, 0x0301, 0x0304, 0x0328, 0x0328, /* vertical timings */ 0x005E8000, /* freq = 94.50 MHz */ }, { GFX_MODE_90HZ | /* refresh rate = 90 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0400, 0x0400, 0x0440, 0x04B0, 0x0560, 0x0560, /* horizontal timings */ 0x0300, 0x0300, 0x0301, 0x0304, 0x0329, 0x0329, /* vertical timings */ 0x00642FDF, /* freq = 100.187 MHz */ }, { GFX_MODE_100HZ | /* refresh rate = 100 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0400, 0x0400, 0x0448, 0x04B8, 0x0570, 0x0570, /* horizontal timings */ 0x0300, 0x0300, 0x0301, 0x0304, 0x032E, 0x032E, /* vertical timings */ 0x00714F1A, /* freq = 113.309 MHz */ }, /* 1152x864 */ { GFX_MODE_60HZ | /* refresh rate = 60 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0480, 0x0480, 0x04C0, 0x0538, 0x05F0, 0x05F0, /* horizontal timings */ 0x0360, 0x0360, 0x0361, 0x0364, 0x037F, 0x037F, /* vertical timings */ 0x00519999, /* freq = 81.60 MHz */ }, { GFX_MODE_70HZ | /* refresh rate = 70 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0480, 0x0480, 0x04C8, 0x0540, 0x0600, 0x0600, /* horizontal timings */ 0x0360, 0x0360, 0x0368, 0x036B, 0x038B, 0x038B, /* vertical timings */ 0x00618560, /* freq = 97.521 MHz */ }, { GFX_MODE_72HZ | /* refresh rate = 70 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0480, 0x0480, 0x04C8, 0x0548, 0x0610, 0x0610, /* horizontal timings */ 0x0360, 0x0360, 0x0367, 0x036A, 0x038B, 0x038B, /* vertical timings */ 0x00656B85, /* freq = 101.42 MHz */ }, { GFX_MODE_75HZ | /* refresh rate = 75 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0480, 0x0480, 0x04C0, 0x0540, 0x0640, 0x0640, /* horizontal timings */ 0x0360, 0x0360, 0x0361, 0x0364, 0x0384, 0x0384, /* vertical timings */ 0x006C0000, /* freq = 108.00 MHz */ }, { GFX_MODE_85HZ | /* refresh rate = 85 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0480, 0x0480, 0x04C8, 0x0548, 0x0610, 0x0610, /* horizontal timings */ 0x0360, 0x0360, 0x0363, 0x0366, 0x038B, 0x038B, /* vertical timings */ 0x0077A666, /* freq = 119.65 MHz */ }, { GFX_MODE_90HZ | /* refresh rate = 90 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0480, 0x0480, 0x04D0, 0x0550, 0x0620, 0x0620, /* horizontal timings */ 0x0360, 0x0360, 0x0363, 0x0366, 0x038E, 0x038E, /* vertical timings */ 0x00806666, /* freq = 128.40 MHz */ }, { GFX_MODE_100HZ | /* refresh rate = 100 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0480, 0x0480, 0x04D0, 0x0550, 0x0620, 0x0620, /* horizontal timings */ 0x0360, 0x0360, 0x0365, 0x0368, 0x0398, 0x0398, /* vertical timings */ 0x00906147, /* freq = 144.38 MHz */ }, /* 1280x1024 */ { GFX_MODE_60HZ | /* refresh rate = 60 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0500, 0x0500, 0x0530, 0x05A0, 0x0698, 0x0698, /* horizontal timings */ 0x0400, 0x0400, 0x0401, 0x0404, 0x042A, 0x042A, /* vertical timings */ 0x006C0000, /* freq = 108.0 MHz */ }, { GFX_MODE_70HZ | /* refresh rate = 70 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0500, 0x0500, 0x0558, 0x05E0, 0x06C0, 0x06C0, /* horizontal timings */ 0x0400, 0x0400, 0x040A, 0x040D, 0x0433, 0x0433, /* vertical timings */ 0x00821999, /* freq = 130.1 MHz */ }, { GFX_MODE_72HZ | /* refresh rate = 72 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0500, 0x0500, 0x0558, 0x05E0, 0x06C0, 0x06C0, /* horizontal timings */ 0x0400, 0x0400, 0x0407, 0x040A, 0x0431, 0x0431, /* vertical timings */ 0x00858000, /* freq = 133.5 MHz */ }, { GFX_MODE_75HZ | /* refresh rate = 75 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0500, 0x0500, 0x0510, 0x05A0, 0x0698, 0x0698, /* horizontal timings */ 0x0400, 0x0400, 0x0401, 0x0404, 0x042A, 0x042A, /* vertical timings */ 0x00870000, /* freq = 135.0 MHz */ }, { GFX_MODE_85HZ | /* refresh rate = 85 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0500, 0x0500, 0x0540, 0x05E0, 0x06C0, 0x06C0, /* horizontal timings */ 0x0400, 0x0400, 0x0401, 0x0404, 0x0430, 0x0430, /* vertical timings */ 0x009D8000, /* freq = 157.5 MHz */ }, { GFX_MODE_90HZ | /* refresh rate = 90 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0500, 0x0500, 0x0560, 0x05E8, 0x06D0, 0x06D0, /* horizontal timings */ 0x0400, 0x0400, 0x0401, 0x0404, 0x0436, 0x0436, /* vertical timings */ 0x00A933F7, /* freq = 169.203 MHz */ }, { GFX_MODE_100HZ | /* refresh rate = 100 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0500, 0x0500, 0x0560, 0x05F0, 0x06E0, 0x06E0, /* horizontal timings */ 0x0400, 0x0400, 0x0401, 0x0404, 0x043D, 0x043D, /* vertical timings */ 0x00BEF5C2, /* freq = 190.96 MHz */ }, /*********************************/ /* BEGIN REDCLOUD-SPECIFIC MODES */ /*-------------------------------*/ /* 1600 x 1200 */ { GFX_MODE_60HZ | /* refresh rate = 60 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870, /* horizontal timings */ 0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2, /* vertical timings */ 0x00A20000, /* freq = 162.0 MHz */ }, { GFX_MODE_70HZ | /* refresh rate = 70 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870, /* horizontal timings */ 0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2, /* vertical timings */ 0x00BD0000, /* freq = 189.0 MHz */ }, { GFX_MODE_72HZ | /* refresh rate = 72 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0640, 0x0640, 0x06B0, 0x0760, 0x0880, 0x0880, /* horizontal timings */ 0x04B0, 0x04B0, 0x04BD, 0x04C0, 0x04EF, 0x04EF, /* vertical timings */ 0x00C60000, /* freq = 198.0 MHz */ }, { GFX_MODE_75HZ | /* refresh rate = 75 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870, /* horizontal timings */ 0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2, /* vertical timings */ 0x00CA8000, /* freq = 202.5 MHz */ }, { GFX_MODE_85HZ | /* refresh rate = 85 */ GFX_MODE_8BPP | GFX_MODE_12BPP | GFX_MODE_15BPP | /* all BPP valid */ GFX_MODE_16BPP | GFX_MODE_24BPP, 0x0640, 0x0640, 0x0680, 0x0740, 0x0870, 0x0870, /* horizontal timings */ 0x04B0, 0x04B0, 0x04B1, 0x04B4, 0x04E2, 0x04E2, /* vertical timings */ 0x00E58000, /* freq = 229.5 MHz */ }, }; /* UPDATE THIS VARIABLE WHENEVER NEW REDCLOUD-SPECIFIC MODES ARE ADDED */ #define REDCLOUD_SPECIFIC_MODES 4 #define NUM_RC_DISPLAY_MODES sizeof(DisplayParams) / sizeof(DISPLAYMODE) #define NUM_GX_DISPLAY_MODES (NUM_RC_DISPLAY_MODES - REDCLOUD_SPECIFIC_MODES) FIXEDTIMINGS FixedParams[] = { /* 640x480 Panel */ {640, 480, 640, 480, 0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320, 0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D, 0x00192CCC, }, {640, 480, 800, 600, 0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320, 0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D, 0x00192CCC, }, {640, 480, 1024, 768, 0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320, 0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D, 0x00192CCC, }, {640, 480, 1152, 864, 0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320, 0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D, 0x00192CCC, }, {640, 480, 1280, 1024, 0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320, 0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D, 0x00192CCC, }, {640, 480, 1600, 1200, 0x0280, 0x0280, 0x0290, 0x02E8, 0x0318, 0x0320, 0x01E0, 0x01E0, 0x01EA, 0x01EC, 0x0205, 0x020D, 0x00192CCC, }, /* 800x600 Panel */ {800, 600, 640, 480, 0x0280, 0x2d0, 0x2f8, 0x378, 0x3d0, 0x420, 0x1e0, 0x21c, 0x21d, 0x221, 0x238, 0x274, 0x00280000, }, {800, 600, 800, 600, 0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420, 0x258, 0x258, 0x259, 0x25d, 0x274, 0x274, 0x00280000, }, {800, 600, 1024, 768, 0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420, 0x258, 0x258, 0x259, 0x25d, 0x274, 0x274, 0x00280000, }, {800, 600, 1152, 864, 0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420, 0x258, 0x258, 0x259, 0x25d, 0x274, 0x274, 0x00280000, }, {800, 600, 1280, 1024, 0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420, 0x258, 0x258, 0x259, 0x25d, 0x274, 0x274, 0x00280000, }, {800, 600, 1600, 1200, 0x320, 0x320, 0x348, 0x3c8, 0x420, 0x420, 0x258, 0x258, 0x259, 0x25d, 0x274, 0x274, 0x00280000, }, /* 1024x768 panel */ {1024, 768, 640, 480, 0x0280, 0x340, 0x368, 0x3e8, 0x480, 0x540, 0x1e0, 0x270, 0x271, 0x275, 0x296, 0x326, 0x00410000, }, {1024, 768, 800, 600, 0x0320, 0x390, 0x3b8, 0x438, 0x4D0, 0x540, 0x258, 0x2ac, 0x2ad, 0x2b1, 0x2D2, 0x326, 0x00410000, }, {1024, 768, 1024, 768, 0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540, 0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326, 0x00410000, }, {1024, 768, 1152, 864, 0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540, 0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326, 0x00410000, }, {1024, 768, 1280, 1024, 0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540, 0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326, 0x00410000, }, {1024, 768, 1600, 1200, 0x0400, 0x0400, 0x0418, 0x04A0, 0x0540, 0x0540, 0x0300, 0x0300, 0x0303, 0x0309, 0x0326, 0x0326, 0x00410000, }, /* 1280x1024 panel */ {1280, 1024, 640, 480, 640, 960, 1008, 1120, 1368, 1688, 480, 752, 753, 756, 794, 1066, 0x006C0000, }, {1280, 1024, 800, 600, 800, 1040, 1088, 1200, 1448, 1688, 600, 812, 813, 816, 854, 1066, 0x006C0000, }, {1280, 1024, 1024, 768, 1024, 1152, 1200, 1312, 1560, 1688, 768, 896, 897, 900, 938, 1066, 0x006C0000, }, {1280, 1024, 1152, 864, 1152, 1216, 1264, 1376, 1624, 1688, 864, 944, 945, 948, 986, 1066, 0x006C0000, }, {1280, 1024, 1280, 1024, 1280, 1280, 1328, 1440, 1688, 1688, 1024, 1024, 1025, 1028, 1066, 1066, 0x006C0000, }, }; #define NUM_FIXED_TIMINGS_MODES sizeof(FixedParams)/sizeof(FIXEDTIMINGS) /* INCLUDE SUPPORT FOR FIRST GENERATION, IF SPECIFIED. */ #if GFX_DISPLAY_GU1 #include "disp_gu1.c" #endif /* INCLUDE SUPPORT FOR SECOND GENERATION, IF SPECIFIED. */ #if GFX_DISPLAY_GU2 #include "disp_gu2.c" #endif /*--------------------------------------------------------------------------- * gfx_reset_timing_lock * * This routine resets the timing change lock. The lock can only be set by * setting a flag when calling mode set. *--------------------------------------------------------------------------- */ void gfx_reset_timing_lock(void) { gfx_timing_lock = 0; } /* WRAPPERS IF DYNAMIC SELECTION */ /* Extra layer to call either first or second generation routines. */ #if GFX_DISPLAY_DYNAMIC /*--------------------------------------------------------------------------- * gfx_set_display_bpp *--------------------------------------------------------------------------- */ int gfx_set_display_bpp(unsigned short bpp) { int retval = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) retval = gu1_set_display_bpp(bpp); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) retval = gu2_set_display_bpp(bpp); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_is_display_mode_supported * check if given mode supported, * return the supported mode on success, -1 on fail *--------------------------------------------------------------------------- */ int gfx_is_display_mode_supported(int xres, int yres, int bpp, int hz) { int retval = -1; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) retval = gu1_is_display_mode_supported(xres, yres, bpp, hz); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) retval = gu2_is_display_mode_supported(xres, yres, bpp, hz); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_set_display_mode *--------------------------------------------------------------------------- */ int gfx_set_display_mode(int xres, int yres, int bpp, int hz) { int retval = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) retval = gu1_set_display_mode(xres, yres, bpp, hz); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) retval = gu2_set_display_mode(xres, yres, bpp, hz); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_set_display_timings *--------------------------------------------------------------------------- */ int gfx_set_display_timings(unsigned short bpp, unsigned short flags, unsigned short hactive, unsigned short hblankstart, unsigned short hsyncstart, unsigned short hsyncend, unsigned short hblankend, unsigned short htotal, unsigned short vactive, unsigned short vblankstart, unsigned short vsyncstart, unsigned short vsyncend, unsigned short vblankend, unsigned short vtotal, unsigned long frequency) { int retval = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) retval = gu1_set_display_timings(bpp, flags, hactive, hblankstart, hsyncstart, hsyncend, hblankend, htotal, vactive, vblankstart, vsyncstart, vsyncend, vblankend, vtotal, frequency); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) retval = gu2_set_display_timings(bpp, flags, hactive, hblankstart, hsyncstart, hsyncend, hblankend, htotal, vactive, vblankstart, vsyncstart, vsyncend, vblankend, vtotal, frequency); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_set_display_pitch *--------------------------------------------------------------------------- */ void gfx_set_display_pitch(unsigned short pitch) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_set_display_pitch(pitch); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_display_pitch(pitch); #endif } /*--------------------------------------------------------------------------- * gfx_set_display_offset *--------------------------------------------------------------------------- */ void gfx_set_display_offset(unsigned long offset) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_set_display_offset(offset); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_display_offset(offset); #endif } /*--------------------------------------------------------------------------- * gfx_set_display_palette_entry *--------------------------------------------------------------------------- */ int gfx_set_display_palette_entry(unsigned long index, unsigned long palette) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_set_display_palette_entry(index, palette); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_set_display_palette_entry(index, palette); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_display_palette *--------------------------------------------------------------------------- */ int gfx_set_display_palette(unsigned long *palette) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_set_display_palette(palette); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_set_display_palette(palette); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_cursor_enable *--------------------------------------------------------------------------- */ void gfx_set_cursor_enable(int enable) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_set_cursor_enable(enable); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_cursor_enable(enable); #endif } /*--------------------------------------------------------------------------- * gfx_set_cursor_colors *--------------------------------------------------------------------------- */ void gfx_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_set_cursor_colors(bkcolor, fgcolor); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_cursor_colors(bkcolor, fgcolor); #endif } /*--------------------------------------------------------------------------- * gfx_set_cursor_position *--------------------------------------------------------------------------- */ void gfx_set_cursor_position(unsigned long memoffset, unsigned short xpos, unsigned short ypos, unsigned short xhotspot, unsigned short yhotspot) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_set_cursor_position(memoffset, xpos, ypos, xhotspot, yhotspot); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_cursor_position(memoffset, xpos, ypos, xhotspot, yhotspot); #endif } /*--------------------------------------------------------------------------- * gfx_set_cursor_shape32 *--------------------------------------------------------------------------- */ void gfx_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_set_cursor_shape32(memoffset, andmask, xormask); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_cursor_shape32(memoffset, andmask, xormask); #endif } /*--------------------------------------------------------------------------- * gfx_set_cursor_shape64 *--------------------------------------------------------------------------- */ void gfx_set_cursor_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_cursor_shape64(memoffset, andmask, xormask); #endif } /*--------------------------------------------------------------------------- * gfx_set_icon_enable *--------------------------------------------------------------------------- */ void gfx_set_icon_enable(int enable) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_icon_enable(enable); #endif } /*--------------------------------------------------------------------------- * gfx_set_icon_colors *--------------------------------------------------------------------------- */ void gfx_set_icon_colors(unsigned long color0, unsigned long color1, unsigned long color2) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_icon_colors(color0, color1, color2); #endif } /*--------------------------------------------------------------------------- * gfx_set_icon_position *--------------------------------------------------------------------------- */ void gfx_set_icon_position(unsigned long memoffset, unsigned short xpos) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_icon_position(memoffset, xpos); #endif } /*--------------------------------------------------------------------------- * gfx_set_icon_shape64 *--------------------------------------------------------------------------- */ void gfx_set_icon_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask, unsigned int lines) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_icon_shape64(memoffset, andmask, xormask, lines); #endif } /*--------------------------------------------------------------------------- * gfx_set_compression_enable *--------------------------------------------------------------------------- */ int gfx_set_compression_enable(int enable) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_set_compression_enable(enable); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_set_compression_enable(enable); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_compression_offset *--------------------------------------------------------------------------- */ int gfx_set_compression_offset(unsigned long offset) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_set_compression_offset(offset); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_set_compression_offset(offset); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_compression_pitch *--------------------------------------------------------------------------- */ int gfx_set_compression_pitch(unsigned short pitch) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_set_compression_pitch(pitch); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_set_compression_pitch(pitch); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_compression_size *--------------------------------------------------------------------------- */ int gfx_set_compression_size(unsigned short size) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_set_compression_size(size); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_set_compression_size(size); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_display_priority_high *--------------------------------------------------------------------------- */ void gfx_set_display_priority_high(int enable) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_set_display_priority_high(enable); #endif } /*--------------------------------------------------------------------------- * gfx_set_display_video_format (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_format". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ void gfx_set_display_video_format(unsigned long format) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_display_video_format(format); #endif } /*--------------------------------------------------------------------------- * gfx_set_display_video_enable (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_enable". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ void gfx_set_display_video_enable(int enable) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_set_display_video_enable(enable); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_display_video_enable(enable); #endif return; } /*--------------------------------------------------------------------------- * gfx_set_display_video_size (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_size". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ void gfx_set_display_video_size(unsigned short width, unsigned short height) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_set_display_video_size(width, height); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_display_video_size(width, height); #endif } /*--------------------------------------------------------------------------- * gfx_set_display_video_offset (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_offset". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ void gfx_set_display_video_offset(unsigned long offset) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_set_display_video_offset(offset); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_display_video_offset(offset); #endif } /*--------------------------------------------------------------------------- * gfx_set_display_video_yuv_offsets (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_yuv_offsets". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ void gfx_set_display_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_display_video_yuv_offsets(yoffset, uoffset, voffset); #endif } /*--------------------------------------------------------------------------- * gfx_set_display_video_yuv_pitch (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_yuv_pitch". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ void gfx_set_display_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_display_video_yuv_pitch(ypitch, uvpitch); #endif } /*--------------------------------------------------------------------------- * gfx_set_display_video_downscale (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_vertical_downscale". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ void gfx_set_display_video_downscale(unsigned short srch, unsigned short dsth) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_display_video_downscale(srch, dsth); #endif } /*--------------------------------------------------------------------------- * gfx_set_display_video_vertical_downscale_enable (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_vertical_downscale_enable". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ void gfx_set_display_video_vertical_downscale_enable(int enable) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_set_display_video_vertical_downscale_enable(enable); #endif } /*--------------------------------------------------------------------------- * gfx_test_timing_active *--------------------------------------------------------------------------- */ int gfx_test_timing_active(void) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_test_timing_active(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_test_timing_active(); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_test_vertical_active *--------------------------------------------------------------------------- */ int gfx_test_vertical_active(void) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_test_vertical_active(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_test_vertical_active(); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_wait_vertical_blank *--------------------------------------------------------------------------- */ int gfx_wait_vertical_blank(void) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_wait_vertical_blank(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_wait_vertical_blank(); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_delay_milliseconds *--------------------------------------------------------------------------- */ void gfx_delay_milliseconds(unsigned long milliseconds) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_delay_milliseconds(milliseconds); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_delay_milliseconds(milliseconds); #endif } /*--------------------------------------------------------------------------- * gfx_delay_microseconds *--------------------------------------------------------------------------- */ void gfx_delay_microseconds(unsigned long microseconds) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_delay_microseconds(microseconds); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_delay_microseconds(microseconds); #endif } /*--------------------------------------------------------------------------- * gfx_enable_panning * * This routine enables the panning when the Mode is bigger than the panel * size. *--------------------------------------------------------------------------- */ void gfx_enable_panning(int x, int y) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_enable_panning(x, y); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_enable_panning(x, y); #endif } /*--------------------------------------------------------------------------- * gfx_is_panel_mode_supported *--------------------------------------------------------------------------- */ int gfx_is_panel_mode_supported(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) { int status = -1; #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_is_panel_mode_supported(panelResX, panelResY, width, height, bpp); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_fixed_timings *--------------------------------------------------------------------------- */ int gfx_set_fixed_timings(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_set_fixed_timings(panelResX, panelResY, width, height, bpp); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_set_fixed_timings(panelResX, panelResY, width, height, bpp); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_panel_present *--------------------------------------------------------------------------- */ int gfx_set_panel_present(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_set_panel_present(panelResX, panelResY, width, height, bpp); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_set_panel_present(panelResX, panelResY, width, height, bpp); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_set_vtotal *--------------------------------------------------------------------------- */ int gfx_set_vtotal(unsigned short vtotal) { int retval = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) retval = gu1_set_vtotal(vtotal); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) retval = gu2_set_vtotal(vtotal); #endif return (retval); } /*-----------------------------------------------------------------------* * THE FOLLOWING READ ROUTINES ARE ALWAYS INCLUDED: * * gfx_get_hsync_end, gfx_get_htotal, gfx_get_vsync_end, gfx_get_vtotal * * are used by the video overlay routines. * * * * gfx_get_vline and gfx_vactive are used to prevent an issue for the * * SC1200. * * * * The others are part of the Durango API. * *-----------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- * gfx_mode_frequency_supported *---------------------------------------------------------------------------- */ int gfx_mode_frequency_supported(int xres, int yres, int bpp, unsigned long frequency) { int freq = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) freq = gu1_mode_frequency_supported(xres, yres, bpp, frequency); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) freq = gu2_mode_frequency_supported(xres, yres, bpp, frequency); #endif return (freq); } /*---------------------------------------------------------------------------- * gfx_refreshrate_from_frequency *---------------------------------------------------------------------------- */ int gfx_get_refreshrate_from_frequency(int xres, int yres, int bpp, int *hz, unsigned long frequency) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_get_refreshrate_from_frequency(xres, yres, bpp, hz, frequency); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_get_refreshrate_from_frequency(xres, yres, bpp, hz, frequency); #endif return (1); } /*---------------------------------------------------------------------------- * gfx_refreshrate_from_mode *---------------------------------------------------------------------------- */ int gfx_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz, unsigned long frequency) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_get_refreshrate_from_mode(xres, yres, bpp, hz, frequency); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_get_refreshrate_from_mode(xres, yres, bpp, hz, frequency); #endif return (1); } /*---------------------------------------------------------------------------- * gfx_get_frequency_from_refreshrate *---------------------------------------------------------------------------- */ int gfx_get_frequency_from_refreshrate(int xres, int yres, int bpp, int hz, int *frequency) { int retval = -1; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) retval = gu1_get_frequency_from_refreshrate(xres, yres, bpp, hz, frequency); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) retval = gu2_get_frequency_from_refreshrate(xres, yres, bpp, hz, frequency); #endif return retval; } /*--------------------------------------------------------------------------- * gfx_get_max_supported_pixel_clock *--------------------------------------------------------------------------- */ unsigned long gfx_get_max_supported_pixel_clock(void) { unsigned long status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_get_max_supported_pixel_clock(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_get_max_supported_pixel_clock(); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_get_display_pitch *--------------------------------------------------------------------------- */ unsigned short gfx_get_display_pitch(void) { unsigned short pitch = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) pitch = gu1_get_display_pitch(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) pitch = gu2_get_display_pitch(); #endif return (pitch); } /*--------------------------------------------------------------------------- * gfx_get_display_mode_count * return # of modes supported. *--------------------------------------------------------------------------- */ int gfx_get_display_mode_count(void) { int retval = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) retval = gu1_get_display_mode_count(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) retval = gu2_get_display_mode_count(); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_get_frame_buffer_line_size *--------------------------------------------------------------------------- */ unsigned long gfx_get_frame_buffer_line_size(void) { unsigned long retval = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) retval = gu1_get_frame_buffer_line_size(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) retval = gu2_get_frame_buffer_line_size(); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_get_display_mode * get the curent mode set, * return the supported mode on success, -1 on fail *--------------------------------------------------------------------------- */ int gfx_get_display_mode(int *xres, int *yres, int *bpp, int *hz) { int retval = -1; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) retval = gu1_get_display_mode(xres, yres, bpp, hz); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) retval = gu2_get_display_mode(xres, yres, bpp, hz); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_get_display_details * given the mode get's the resoultion details, width, height, freq *--------------------------------------------------------------------------- */ int gfx_get_display_details(unsigned int mode, int *xres, int *yres, int *hz) { int retval = -1; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) retval = gu1_get_display_details(mode, xres, yres, hz); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) retval = gu2_get_display_details(mode, xres, yres, hz); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_get_hactive *--------------------------------------------------------------------------- */ unsigned short gfx_get_hactive(void) { unsigned short hactive = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) hactive = gu1_get_hactive(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) hactive = gu2_get_hactive(); #endif return (hactive); } /*--------------------------------------------------------------------------- * gfx_get_hsync_start *--------------------------------------------------------------------------- */ unsigned short gfx_get_hsync_start(void) { unsigned short hsync_start = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) hsync_start = gu1_get_hsync_start(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) hsync_start = gu2_get_hsync_start(); #endif return (hsync_start); } /*--------------------------------------------------------------------------- * gfx_get_hsync_end *--------------------------------------------------------------------------- */ unsigned short gfx_get_hsync_end(void) { unsigned short hsync_end = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) hsync_end = gu1_get_hsync_end(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) hsync_end = gu2_get_hsync_end(); #endif return (hsync_end); } /*--------------------------------------------------------------------------- * gfx_get_htotal *--------------------------------------------------------------------------- */ unsigned short gfx_get_htotal(void) { unsigned short htotal = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) htotal = gu1_get_htotal(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) htotal = gu2_get_htotal(); #endif return (htotal); } /*--------------------------------------------------------------------------- * gfx_get_vactive *--------------------------------------------------------------------------- */ unsigned short gfx_get_vactive(void) { unsigned short vactive = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) vactive = gu1_get_vactive(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) vactive = gu2_get_vactive(); #endif return (vactive); } /*--------------------------------------------------------------------------- * gfx_get_vsync_end *--------------------------------------------------------------------------- */ unsigned short gfx_get_vsync_end(void) { unsigned short vsync_end = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) vsync_end = gu1_get_vsync_end(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) vsync_end = gu2_get_vsync_end(); #endif return (vsync_end); } /*--------------------------------------------------------------------------- * gfx_get_vtotal *--------------------------------------------------------------------------- */ unsigned short gfx_get_vtotal(void) { unsigned short vtotal = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) vtotal = gu1_get_vtotal(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) vtotal = gu2_get_vtotal(); #endif return (vtotal); } /*--------------------------------------------------------------------------- * gfx_get_display_bpp *--------------------------------------------------------------------------- */ unsigned short gfx_get_display_bpp(void) { unsigned short bpp = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) bpp = gu1_get_display_bpp(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) bpp = gu2_get_display_bpp(); #endif return (bpp); } /*--------------------------------------------------------------------------- * gfx_get_vline *--------------------------------------------------------------------------- */ unsigned short gfx_get_vline(void) { unsigned short vline = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) vline = gu1_get_vline(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) vline = gu2_get_vline(); #endif return (vline); } /*--------------------------------------------------------------------------- * gfx_get_display_offset *--------------------------------------------------------------------------- */ unsigned long gfx_get_display_offset(void) { unsigned long offset = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) offset = gu1_get_display_offset(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) offset = gu2_get_display_offset(); #endif return (offset); } /*--------------------------------------------------------------------------- * gfx_get_cursor_offset *--------------------------------------------------------------------------- */ unsigned long gfx_get_cursor_offset(void) { unsigned long base = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) base = gu1_get_cursor_offset(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) base = gu2_get_cursor_offset(); #endif return (base); } /*************************************************************/ /* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ /*************************************************************/ #if GFX_READ_ROUTINES /*--------------------------------------------------------------------------- * gfx_get_hblank_start *--------------------------------------------------------------------------- */ unsigned short gfx_get_hblank_start(void) { unsigned short hblank_start = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) hblank_start = gu1_get_hblank_start(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) hblank_start = gu2_get_hblank_start(); #endif return (hblank_start); } /*--------------------------------------------------------------------------- * gfx_get_hblank_end *--------------------------------------------------------------------------- */ unsigned short gfx_get_hblank_end(void) { unsigned short hblank_end = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) hblank_end = gu1_get_hblank_end(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) hblank_end = gu2_get_hblank_end(); #endif return (hblank_end); } /*--------------------------------------------------------------------------- * gfx_get_vblank_start *--------------------------------------------------------------------------- */ unsigned short gfx_get_vblank_start(void) { unsigned short vblank_start = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) vblank_start = gu1_get_vblank_start(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) vblank_start = gu2_get_vblank_start(); #endif return (vblank_start); } /*--------------------------------------------------------------------------- * gfx_get_vsync_start *--------------------------------------------------------------------------- */ unsigned short gfx_get_vsync_start(void) { unsigned short vsync_start = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) vsync_start = gu1_get_vsync_start(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) vsync_start = gu2_get_vsync_start(); #endif return (vsync_start); } /*--------------------------------------------------------------------------- * gfx_get_vblank_end *--------------------------------------------------------------------------- */ unsigned short gfx_get_vblank_end(void) { unsigned short vblank_end = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) vblank_end = gu1_get_vblank_end(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) vblank_end = gu2_get_vblank_end(); #endif return (vblank_end); } /*--------------------------------------------------------------------------- * gfx_get_display_palette_entry *--------------------------------------------------------------------------- */ int gfx_get_display_palette_entry(unsigned long index, unsigned long *palette) { int status = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) status = gu1_get_display_palette_entry(index, palette); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) status = gu2_get_display_palette_entry(index, palette); #endif return status; } /*--------------------------------------------------------------------------- * gfx_get_display_palette *--------------------------------------------------------------------------- */ void gfx_get_display_palette(unsigned long *palette) { #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) gu1_get_display_palette(palette); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_get_display_palette(palette); #endif } /*--------------------------------------------------------------------------- * gfx_get_cursor_enable *--------------------------------------------------------------------------- */ unsigned long gfx_get_cursor_enable(void) { unsigned long enable = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) enable = gu1_get_cursor_enable(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) enable = gu2_get_cursor_enable(); #endif return (enable); } /*--------------------------------------------------------------------------- * gfx_get_cursor_position *--------------------------------------------------------------------------- */ unsigned long gfx_get_cursor_position(void) { unsigned long position = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) position = gu1_get_cursor_position(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) position = gu2_get_cursor_position(); #endif return (position); } /*--------------------------------------------------------------------------- * gfx_get_cursor_clip *--------------------------------------------------------------------------- */ unsigned long gfx_get_cursor_clip(void) { unsigned long offset = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) offset = gu1_get_cursor_clip(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) offset = gu2_get_cursor_clip(); #endif return (offset); } /*--------------------------------------------------------------------------- * gfx_get_cursor_color *--------------------------------------------------------------------------- */ unsigned long gfx_get_cursor_color(int index) { unsigned long color = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) color = gu1_get_cursor_color(index); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) color = gu2_get_cursor_color(index); #endif return (color); } /*--------------------------------------------------------------------------- * gfx_get_icon_enable *--------------------------------------------------------------------------- */ unsigned long gfx_get_icon_enable(void) { unsigned long enable = 0; #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) enable = gu2_get_icon_enable(); #endif return (enable); } /*--------------------------------------------------------------------------- * gfx_get_icon_offset *--------------------------------------------------------------------------- */ unsigned long gfx_get_icon_offset(void) { unsigned long base = 0; #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) base = gu2_get_icon_offset(); #endif return (base); } /*--------------------------------------------------------------------------- * gfx_get_icon_position *--------------------------------------------------------------------------- */ unsigned long gfx_get_icon_position(void) { unsigned long position = 0; #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) position = gu2_get_icon_position(); #endif return (position); } /*--------------------------------------------------------------------------- * gfx_get_icon_color *--------------------------------------------------------------------------- */ unsigned long gfx_get_icon_color(int index) { unsigned long color = 0; #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) color = gu2_get_icon_color(index); #endif return (color); } /*--------------------------------------------------------------------------- * gfx_get_compression_enable *--------------------------------------------------------------------------- */ int gfx_get_compression_enable(void) { int enable = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) enable = gu1_get_compression_enable(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) enable = gu2_get_compression_enable(); #endif return (enable); } /*--------------------------------------------------------------------------- * gfx_get_compression_offset *--------------------------------------------------------------------------- */ unsigned long gfx_get_compression_offset(void) { unsigned long offset = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) offset = gu1_get_compression_offset(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) offset = gu2_get_compression_offset(); #endif return (offset); } /*--------------------------------------------------------------------------- * gfx_get_compression_pitch *--------------------------------------------------------------------------- */ unsigned short gfx_get_compression_pitch(void) { unsigned short pitch = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) pitch = gu1_get_compression_pitch(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) pitch = gu2_get_compression_pitch(); #endif return (pitch); } /*--------------------------------------------------------------------------- * gfx_get_compression_size *--------------------------------------------------------------------------- */ unsigned short gfx_get_compression_size(void) { unsigned short size = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) size = gu1_get_compression_size(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) size = gu2_get_compression_size(); #endif return (size); } /*--------------------------------------------------------------------------- * gfx_get_display_priority_high *--------------------------------------------------------------------------- */ int gfx_get_display_priority_high(void) { int high = GFX_STATUS_UNSUPPORTED; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) high = gu1_get_display_priority_high(); #endif return (high); } /*--------------------------------------------------------------------------- * gfx_get_valid_bit *--------------------------------------------------------------------------- */ int gfx_get_valid_bit(int line) { int valid = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) valid = gu1_get_valid_bit(line); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) valid = gu2_get_valid_bit(line); #endif return (valid); } /*--------------------------------------------------------------------------- * gfx_get_display_video_color_key *--------------------------------------------------------------------------- */ unsigned long gfx_get_display_video_color_key(void) { unsigned long value = 0; return (value); } /*--------------------------------------------------------------------------- * gfx_get_display_video_offset *--------------------------------------------------------------------------- */ unsigned long gfx_get_display_video_offset(void) { unsigned long offset = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) offset = gu1_get_display_video_offset(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) offset = gu2_get_display_video_offset(); #endif return (offset); } /*--------------------------------------------------------------------------- * gfx_get_display_video_yuv_offsets *--------------------------------------------------------------------------- */ void gfx_get_display_video_yuv_offsets(unsigned long *yoffset, unsigned long *uoffset, unsigned long *voffset) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_get_display_video_yuv_offsets(yoffset, uoffset, voffset); #endif } /*--------------------------------------------------------------------------- * gfx_get_display_video_yuv_offsets *--------------------------------------------------------------------------- */ void gfx_get_display_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch) { #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) gu2_get_display_video_yuv_pitch(ypitch, uvpitch); #endif } /*--------------------------------------------------------------------------- * gfx_get_display_video_downscale_delta *--------------------------------------------------------------------------- */ unsigned long gfx_get_display_video_downscale_delta(void) { unsigned long ret_value = 0; #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) ret_value = gu2_get_display_video_downscale_delta(); #endif return ret_value; } /*--------------------------------------------------------------------------- * gfx_get_display_video_downscale_delta *--------------------------------------------------------------------------- */ int gfx_get_display_video_downscale_enable(void) { int ret_value = 0; #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) ret_value = gu2_get_display_video_downscale_enable(); #endif return ret_value; } /*--------------------------------------------------------------------------- * gfx_get_display_video_size *--------------------------------------------------------------------------- */ unsigned long gfx_get_display_video_size(void) { unsigned long size = 0; #if GFX_DISPLAY_GU1 if (gfx_display_type & GFX_DISPLAY_TYPE_GU1) size = gu1_get_display_video_size(); #endif #if GFX_DISPLAY_GU2 if (gfx_display_type & GFX_DISPLAY_TYPE_GU2) size = gu2_get_display_video_size(); #endif return (size); } /*--------------------------------------------------------------------------- * gfx_get_display_video_color_key_mask *--------------------------------------------------------------------------- */ unsigned long gfx_get_display_video_color_key_mask(void) { unsigned long mask = 0; return (mask); } #endif /* GFX_READ_ROUTINES */ #endif /* GFX_DISPLAY_DYNAMIC */ xf86-video-geode-2.11.18/src/gfx/saa7114.c0000644000175000017500000007253212654445443014411 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to control the Philips SAA7114 video decoder. * */ /*---------------------------*/ /* TABLE OF DEFAULT VALUES */ /*---------------------------*/ typedef struct tagGFX_SAA7114_INIT { unsigned char index; unsigned char value; } GFX_SAA7114_INIT; /* Task A is for VBI raw data and task B is for video */ GFX_SAA7114_INIT gfx_saa7114_init_values[] = { {0x01, 0x08}, {0x02, 0xC0}, {0x03, 0x00}, {0x04, 0x90}, {0x05, 0x90}, {0x06, 0xEB}, {0x07, 0xE0}, {0x08, 0x88}, {0x09, 0x40}, {0x0A, 0x80}, {0x0B, 0x44}, {0x0C, 0x40}, {0x0D, 0x00}, {0x0E, 0x89}, {0x0F, 0x2E}, {0x10, 0x0E}, {0x11, 0x00}, {0x12, 0x05}, {0x13, 0x00}, {0x14, 0x08}, {0x15, 0x11}, {0x16, 0xFE}, {0x17, 0x00}, {0x18, 0x40}, {0x19, 0x80}, {0x30, 0xBC}, {0x31, 0xDF}, {0x32, 0x02}, {0x34, 0xCD}, {0x35, 0xCC}, {0x36, 0x3A}, {0x38, 0x03}, {0x39, 0x10}, {0x3A, 0x00}, {0x40, 0x00}, {0x41, 0xFF}, {0x42, 0xFF}, {0x43, 0xFF}, {0x44, 0xFF}, {0x45, 0xFF}, {0x46, 0xFF}, {0x47, 0xFF}, {0x48, 0xFF}, {0x49, 0xFF}, {0x4A, 0xFF}, {0x4B, 0xFF}, {0x4C, 0xFF}, {0x4D, 0xFF}, {0x4E, 0xFF}, {0x4F, 0xFF}, {0x50, 0xFF}, {0x51, 0xFF}, {0x52, 0xFF}, {0x53, 0xFF}, {0x54, 0xFF}, {0x55, 0xFF}, {0x56, 0xFF}, {0x57, 0xFF}, {0x58, 0x00}, {0x59, 0x47}, {0x5A, 0x06}, {0x5B, 0x43}, {0x5D, 0x3E}, {0x5E, 0x00}, {0x80, 0x30}, {0x83, 0x00}, {0x84, 0x60}, {0x85, 0x00}, {0x86, 0xE5}, {0x87, 0x01}, {0x88, 0xF8}, /* VBI task */ {0x90, 0x01}, {0x91, 0xC8}, {0x92, 0x08}, {0x93, 0x84}, {0x94, 0x10}, {0x95, 0x00}, {0x96, 0xD0}, {0x97, 0x02}, {0x98, 0x05}, {0x99, 0x00}, {0x9A, 0x0B}, {0x9B, 0x00}, {0x9C, 0xA0}, {0x9D, 0x05}, {0x9E, 0x0B}, {0x9F, 0x00}, {0xA0, 0x01}, {0xA1, 0x00}, {0xA2, 0x00}, {0xA4, 0x80}, {0xA5, 0x40}, {0xA6, 0x40}, {0xA8, 0x00}, {0xA9, 0x02}, {0xAA, 0x00}, {0xAC, 0x00}, {0xAD, 0x01}, {0xAE, 0x00}, {0xB0, 0x00}, {0xB1, 0x04}, {0xB2, 0x00}, {0xB3, 0x04}, {0xB4, 0x00}, {0xB8, 0x00}, {0xB9, 0x00}, {0xBA, 0x00}, {0xBB, 0x00}, {0xBC, 0x00}, {0xBD, 0x00}, {0xBE, 0x00}, {0xBF, 0x00}, /* Video task */ {0xC0, 0x80}, {0xC1, 0x08}, {0xC2, 0x00}, {0xC3, 0x80}, {0xC4, 0x10}, {0xC5, 0x00}, {0xC6, 0xD0}, {0xC7, 0x02}, {0xC8, 0x11}, {0xC9, 0x00}, {0xCA, 0xF1}, {0xCB, 0x00}, {0xCC, 0xD0}, {0xCD, 0x02}, {0xCE, 0xF1}, {0xCF, 0x00}, {0xD0, 0x01}, {0xD1, 0x00}, {0xD2, 0x00}, {0xD4, 0x80}, {0xD5, 0x40}, {0xD6, 0x40}, {0xD8, 0x00}, {0xD9, 0x04}, {0xDA, 0x00}, {0xDC, 0x00}, {0xDD, 0x02}, {0xDE, 0x00}, {0xE0, 0x00}, {0xE1, 0x04}, {0xE2, 0x00}, {0xE3, 0x04}, {0xE4, 0x00}, {0xE8, 0x00}, {0xE9, 0x00}, {0xEA, 0x00}, {0xEB, 0x00}, {0xEC, 0x00}, {0xED, 0x00}, {0xEE, 0x00}, {0xEF, 0x00}, }; #define GFX_NUM_SAA7114_INIT_VALUES \ sizeof(gfx_saa7114_init_values)/sizeof(GFX_SAA7114_INIT) /*-----------------------------------------------------*/ /* TABLE OF FIR PREFILTER RECOMMENDED VALUES */ /*-----------------------------------------------------*/ int optimize_for_aliasing = 0; typedef struct tagGFX_SAA7114_FIR_PREFILTER { unsigned char prescaler; unsigned char acl_low; unsigned char prefilter_low; unsigned char acl_high; unsigned char prefilter_high; } GFX_SAA7114_FIR_PREFILTER; GFX_SAA7114_FIR_PREFILTER gfx_saa7114_fir_values[] = { {0x01, 0x00, 0x00, 0x00, 0x00}, {0x02, 0x02, 0x5A, 0x01, 0x51}, {0x03, 0x04, 0xAB, 0x03, 0xA2}, {0x04, 0x07, 0xA3, 0x04, 0xAB}, {0x05, 0x08, 0xAC, 0x07, 0xA3}, {0x06, 0x08, 0xFC, 0x07, 0xF3}, {0x07, 0x08, 0xFC, 0x07, 0xF3}, {0x08, 0x0F, 0xF4, 0x08, 0xFC}, {0x09, 0x0F, 0xF4, 0x08, 0xFC}, {0x0A, 0x10, 0xFD, 0x08, 0xFC}, {0x0B, 0x10, 0xFD, 0x08, 0xFC}, {0x0C, 0x10, 0xFD, 0x08, 0xFC}, {0x0D, 0x10, 0xFD, 0x10, 0xFD}, {0x0E, 0x10, 0xFD, 0x10, 0xFD}, {0x0F, 0x1F, 0xF5, 0x10, 0xFD}, {0x10, 0x20, 0xFE, 0x10, 0xFD}, {0x11, 0x20, 0xFE, 0x10, 0xFD}, {0x12, 0x20, 0xFE, 0x10, 0xFD}, {0x13, 0x20, 0xFE, 0x20, 0xFE}, {0x14, 0x20, 0xFE, 0x20, 0xFE}, {0x15, 0x20, 0xFE, 0x20, 0xFE}, {0x16, 0x20, 0xFE, 0x20, 0xFE}, {0x17, 0x20, 0xFE, 0x20, 0xFE}, {0x18, 0x20, 0xFE, 0x20, 0xFE}, {0x19, 0x20, 0xFE, 0x20, 0xFE}, {0x1A, 0x20, 0xFE, 0x20, 0xFE}, {0x1B, 0x20, 0xFE, 0x20, 0xFE}, {0x1C, 0x20, 0xFE, 0x20, 0xFE}, {0x1D, 0x20, 0xFE, 0x20, 0xFE}, {0x1E, 0x20, 0xFE, 0x20, 0xFE}, {0x1F, 0x20, 0xFE, 0x20, 0xFE}, {0x20, 0x3F, 0xFF, 0x20, 0xFE}, {0x21, 0x3F, 0xFF, 0x20, 0xFE}, {0x22, 0x3F, 0xFF, 0x20, 0xFE}, {0x23, 0x3F, 0xFF, 0x20, 0xFF} }; int saa7114_write_reg(unsigned char reg, unsigned char val) { return gfx_i2c_write(2, SAA7114_CHIPADDR, reg, 1, &val); } int saa7114_read_reg(unsigned char reg, unsigned char *val) { return gfx_i2c_read(2, SAA7114_CHIPADDR, reg, 1, val); } /*---------------------------------------------------------------------------- * gfx_set_decoder_vbi_upscale * * This routine configures the video decoder task A to upscale raw VBI data * horizontally to match a different system clock. * The upscale is from 13.5 MHz (SAA7114) to 14.318 MHz (Bt835). *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_vbi_upscale(void) #else int gfx_set_decoder_vbi_upscale(void) #endif { /* Set horizontal output length to 1528 (720 * 2 * 14.318 / 13.5) */ saa7114_write_reg(SAA7114_TASK_A_HORZ_OUTPUT_LO, 0xF8); saa7114_write_reg(SAA7114_TASK_A_HORZ_OUTPUT_HI, 0x05); /* Set horizontal luminance scaling increment to 484 (1024 * 13.5 / * 28.636) */ saa7114_write_reg(SAA7114_TASK_A_HSCALE_LUMA_LO, 0xE4); saa7114_write_reg(SAA7114_TASK_A_HSCALE_LUMA_HI, 0x01); /* Set horizontal chrominance scaling increment to 242 */ saa7114_write_reg(SAA7114_TASK_A_HSCALE_CHROMA_LO, 0xF2); saa7114_write_reg(SAA7114_TASK_A_HSCALE_CHROMA_HI, 0x00); return GFX_STATUS_OK; } /*---------------------------------------------------------------------------- * gfx_decoder_software_reset * * This routine performs a software reset of the decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_decoder_software_reset(void) #else int gfx_decoder_software_reset(void) #endif { saa7114_write_reg(0x88, 0xC0); /* I2C-bus latency should be sufficient for resetting the internal state * machine. */ /* gfx_delay_milliseconds(10); */ saa7114_write_reg(0x88, 0xF0); return GFX_STATUS_OK; } /*---------------------------------------------------------------------------- * gfx_decoder_detect_macrovision * * This routine detects if macrovision exists in the input of the video * decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_decoder_detect_macrovision(void) #else int gfx_decoder_detect_macrovision(void) #endif { unsigned char macrovision = 0xff; saa7114_read_reg(SAA7114_STATUS, ¯ovision); return ((macrovision & 0x02) >> 1); } /*---------------------------------------------------------------------------- * gfx_decoder_detect_video * * This routine detects if video exists in the input of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_decoder_detect_video(void) #else int gfx_decoder_detect_video(void) #endif { unsigned char video = 0xff; saa7114_read_reg(SAA7114_STATUS, &video); return !((video & 0x40) >> 6); } /*---------------------------------------------------------------------------- * gfx_set_decoder_defaults * * This routine is called to set the initial register values of the * video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_defaults(void) #else int gfx_set_decoder_defaults(void) #endif { unsigned int i; /* LOOP THROUGH INDEX/DATA PAIRS IN THE TABLE */ for (i = 0; i < GFX_NUM_SAA7114_INIT_VALUES; i++) { saa7114_write_reg(gfx_saa7114_init_values[i].index, gfx_saa7114_init_values[i].value); } gfx_decoder_software_reset(); return (0); } /*---------------------------------------------------------------------------- * gfx_set_decoder_analog_input * * This routine sets the analog input of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_analog_input(unsigned char input) #else int gfx_set_decoder_analog_input(unsigned char input) #endif { saa7114_write_reg(SAA7114_ANALOG_INPUT_CTRL1, input); return (0); } /*---------------------------------------------------------------------------- * gfx_set_decoder_brightness * * This routine sets the brightness of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_brightness(unsigned char brightness) #else int gfx_set_decoder_brightness(unsigned char brightness) #endif { saa7114_write_reg(SAA7114_BRIGHTNESS, brightness); return (0); } /*---------------------------------------------------------------------------- * gfx_set_decoder_contrast * * This routine sets the contrast of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_contrast(unsigned char contrast) #else int gfx_set_decoder_contrast(unsigned char contrast) #endif { saa7114_write_reg(SAA7114_CONTRAST, (unsigned char) (contrast >> 1)); return (0); } /*---------------------------------------------------------------------------- * gfx_set_decoder_hue * * This routine sets the hue control of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_hue(char hue) #else int gfx_set_decoder_hue(char hue) #endif { saa7114_write_reg(SAA7114_HUE, (unsigned char) hue); return (0); } /*---------------------------------------------------------------------------- * gfx_set_decoder_saturation * * This routine sets the saturation adjustment of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_saturation(unsigned char saturation) #else int gfx_set_decoder_saturation(unsigned char saturation) #endif { saa7114_write_reg(SAA7114_SATURATION, (unsigned char) (saturation >> 1)); return (0); } /*---------------------------------------------------------------------------- * gfx_set_decoder_input_offset * * This routine sets the size of the decoder input window. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_input_offset(unsigned short x, unsigned short y) #else int gfx_set_decoder_input_offset(unsigned short x, unsigned short y) #endif { /* SET THE INPUT WINDOW OFFSET */ saa7114_write_reg(SAA7114_HORZ_OFFSET_LO, (unsigned char) (x & 0x00FF)); saa7114_write_reg(SAA7114_HORZ_OFFSET_HI, (unsigned char) (x >> 8)); saa7114_write_reg(SAA7114_VERT_OFFSET_LO, (unsigned char) (y & 0x00FF)); saa7114_write_reg(SAA7114_VERT_OFFSET_HI, (unsigned char) (y >> 8)); gfx_decoder_software_reset(); return (0); } /*---------------------------------------------------------------------------- * gfx_set_decoder_input_size * * This routine sets the size of the decoder input window. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_input_size(unsigned short width, unsigned short height) #else int gfx_set_decoder_input_size(unsigned short width, unsigned short height) #endif { /* DIVIDE HEIGHT BY TWO FOR INTERLACING */ height = (height + 1) >> 1; /* SET THE INPUT WINDOW SIZE */ saa7114_write_reg(SAA7114_HORZ_INPUT_LO, (unsigned char) (width & 0x00FF)); saa7114_write_reg(SAA7114_HORZ_INPUT_HI, (unsigned char) (width >> 8)); saa7114_write_reg(SAA7114_VERT_INPUT_LO, (unsigned char) (height & 0x00FF)); saa7114_write_reg(SAA7114_VERT_INPUT_HI, (unsigned char) (height >> 8)); gfx_decoder_software_reset(); return (0); } /*---------------------------------------------------------------------------- * gfx_set_decoder_output_size * * This routine sets the size of the decoder output window. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_output_size(unsigned short width, unsigned short height) #else int gfx_set_decoder_output_size(unsigned short width, unsigned short height) #endif { /* ROUND WIDTH UP TO EVEN NUMBER TO PREVENT DECODER BECOMING STUCK */ width = ((width + 1) >> 1) << 1; /* DIVIDE HEIGHT BY TWO FOR INTERLACING */ height = (height + 1) >> 1; /* SET THE OUTPUT WINDOW SIZE */ saa7114_write_reg(SAA7114_HORZ_OUTPUT_LO, (unsigned char) (width & 0x00FF)); saa7114_write_reg(SAA7114_HORZ_OUTPUT_HI, (unsigned char) (width >> 8)); saa7114_write_reg(SAA7114_VERT_OUTPUT_LO, (unsigned char) (height & 0x00FF)); saa7114_write_reg(SAA7114_VERT_OUTPUT_HI, (unsigned char) (height >> 8)); gfx_decoder_software_reset(); return (0); } /*---------------------------------------------------------------------------- * gfx_set_decoder_scale * * This routine sets the scaling of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) #else int gfx_set_decoder_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) #endif { unsigned char prescale = 0; int scale = 0; /* SET THE HORIZONTAL PRESCALE */ /* Downscale from 1 to 1/63 source size. */ if (dstw) prescale = (unsigned char) (srcw / dstw); if (!prescale) prescale = 1; if (prescale > 63) return (1); saa7114_write_reg(SAA7114_HORZ_PRESCALER, prescale); /* USE FIR PREFILTER FUNCTIONALITY (OPTIMISATION) */ if (prescale < 36) { if (optimize_for_aliasing) { saa7114_write_reg(SAA7114_HORZ_ACL, gfx_saa7114_fir_values[prescale - 1].acl_low); saa7114_write_reg(SAA7114_HORZ_FIR_PREFILTER, gfx_saa7114_fir_values[prescale - 1].prefilter_low); } else { saa7114_write_reg(SAA7114_HORZ_ACL, gfx_saa7114_fir_values[prescale - 1].acl_high); saa7114_write_reg(SAA7114_HORZ_FIR_PREFILTER, gfx_saa7114_fir_values[prescale - 1].prefilter_high); } } else { /* SAME SETTINGS FOR RATIO 1/35 DOWNTO 1/63 */ if (optimize_for_aliasing) { saa7114_write_reg(SAA7114_HORZ_ACL, gfx_saa7114_fir_values[34].acl_low); saa7114_write_reg(SAA7114_HORZ_FIR_PREFILTER, gfx_saa7114_fir_values[34].prefilter_low); } else { saa7114_write_reg(SAA7114_HORZ_ACL, gfx_saa7114_fir_values[34].acl_high); saa7114_write_reg(SAA7114_HORZ_FIR_PREFILTER, gfx_saa7114_fir_values[34].prefilter_high); } } /* SET THE HORIZONTAL SCALING */ if (!dstw) return (1); scale = ((1024 * srcw * 1000) / (dstw * prescale)) / 1000; if ((scale > 8191) || (scale < 300)) return (1); saa7114_write_reg(SAA7114_HSCALE_LUMA_LO, (unsigned char) (scale & 0x00FF)); saa7114_write_reg(SAA7114_HSCALE_LUMA_HI, (unsigned char) (scale >> 8)); scale >>= 1; saa7114_write_reg(SAA7114_HSCALE_CHROMA_LO, (unsigned char) (scale & 0x00FF)); saa7114_write_reg(SAA7114_HSCALE_CHROMA_HI, (unsigned char) (scale >> 8)); /* SET THE VERTICAL SCALING (INTERPOLATION MODE) */ if (!dsth) return (1); /* ROUND DESTINATION HEIGHT UP TO EVEN NUMBER TO PREVENT DECODER BECOMING * STUCK */ dsth = ((dsth + 1) >> 1) << 1; scale = (int) ((1024 * srch) / dsth); saa7114_write_reg(SAA7114_VSCALE_LUMA_LO, (unsigned char) (scale & 0x00FF)); saa7114_write_reg(SAA7114_VSCALE_LUMA_HI, (unsigned char) (scale >> 8)); saa7114_write_reg(SAA7114_VSCALE_CHROMA_LO, (unsigned char) (scale & 0x00FF)); saa7114_write_reg(SAA7114_VSCALE_CHROMA_HI, (unsigned char) (scale >> 8)); if (dsth >= (srch >> 1)) { /* USE INTERPOLATION MODE FOR SCALE FACTOR ABOVE 0.5 */ saa7114_write_reg(SAA7114_VSCALE_CONTROL, 0x00); /* SET VERTICAL PHASE REGISTER FOR CORRECT SCALED INTERLACED OUTPUT * (OPTIMISATION) */ /* THE OPTIMISATION IS BASED ON OFIDC = 0 (REG 90h[6] = 0 ) */ saa7114_write_reg(SAA7114_VSCALE_CHROMA_OFFS0, SAA7114_VSCALE_PHO); saa7114_write_reg(SAA7114_VSCALE_CHROMA_OFFS1, SAA7114_VSCALE_PHO); saa7114_write_reg(SAA7114_VSCALE_CHROMA_OFFS2, (unsigned char) (SAA7114_VSCALE_PHO + scale / 64 - 16)); saa7114_write_reg(SAA7114_VSCALE_CHROMA_OFFS3, (unsigned char) (SAA7114_VSCALE_PHO + scale / 64 - 16)); saa7114_write_reg(SAA7114_VSCALE_LUMINA_OFFS0, SAA7114_VSCALE_PHO); saa7114_write_reg(SAA7114_VSCALE_LUMINA_OFFS1, SAA7114_VSCALE_PHO); saa7114_write_reg(SAA7114_VSCALE_LUMINA_OFFS2, (unsigned char) (SAA7114_VSCALE_PHO + scale / 64 - 16)); saa7114_write_reg(SAA7114_VSCALE_LUMINA_OFFS3, (unsigned char) (SAA7114_VSCALE_PHO + scale / 64 - 16)); /* RESTORE CONTRAST AND SATURATION FOR INTERPOLATION MODE */ saa7114_write_reg(SAA7114_FILTER_CONTRAST, (unsigned char) 0x40); saa7114_write_reg(SAA7114_FILTER_SATURATION, (unsigned char) 0x40); } else { /* USE ACCUMULATION MODE FOR DOWNSCALING BY MORE THAN 2x */ saa7114_write_reg(SAA7114_VSCALE_CONTROL, 0x01); /* SET VERTICAL PHASE OFFSETS OFF (OPTIMISATION) */ saa7114_write_reg(SAA7114_VSCALE_CHROMA_OFFS0, 0x00); saa7114_write_reg(SAA7114_VSCALE_CHROMA_OFFS1, 0x00); saa7114_write_reg(SAA7114_VSCALE_CHROMA_OFFS2, 0x00); saa7114_write_reg(SAA7114_VSCALE_CHROMA_OFFS3, 0x00); saa7114_write_reg(SAA7114_VSCALE_LUMINA_OFFS0, 0x00); saa7114_write_reg(SAA7114_VSCALE_LUMINA_OFFS1, 0x00); saa7114_write_reg(SAA7114_VSCALE_LUMINA_OFFS2, 0x00); saa7114_write_reg(SAA7114_VSCALE_LUMINA_OFFS3, 0x00); /* ADJUST CONTRAST AND SATURATION FOR ACCUMULATION MODE */ if (srch) scale = (64 * dsth) / srch; saa7114_write_reg(SAA7114_FILTER_CONTRAST, (unsigned char) scale); saa7114_write_reg(SAA7114_FILTER_SATURATION, (unsigned char) scale); } gfx_decoder_software_reset(); return (0); } /*---------------------------------------------------------------------------- * gfx_set_decoder_vbi_format * * This routine programs the decoder to produce the specified format of VBI * data for the specified lines. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_vbi_format(int start, int end, int format) #else int gfx_set_decoder_vbi_format(int start, int end, int format) #endif { int i; unsigned char data; for (i = start; i <= end; i++) { switch (format) { case VBI_FORMAT_VIDEO: data = 0xFF; break; /* Active video */ case VBI_FORMAT_RAW: data = 0x77; break; /* Raw VBI data */ case VBI_FORMAT_CC: data = 0x55; break; /* US CC */ case VBI_FORMAT_NABTS: data = 0xCC; break; /* US NABTS */ default: return GFX_STATUS_BAD_PARAMETER; } saa7114_write_reg((unsigned char) (0x3F + i), data); } return GFX_STATUS_OK; } /*---------------------------------------------------------------------------- * gfx_set_decoder_vbi_enable * * This routine enables or disables VBI transfer in the decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_vbi_enable(int enable) #else int gfx_set_decoder_vbi_enable(int enable) #endif { unsigned char data; saa7114_read_reg(SAA7114_IPORT_CONTROL, &data); if (enable) data |= 0x80; else data &= ~0x80; saa7114_write_reg(SAA7114_IPORT_CONTROL, data); return GFX_STATUS_OK; } /*---------------------------------------------------------------------------- * gfx_set_decoder_TV_standard * * This routine configures the decoder for the required TV standard. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_TV_standard(TVStandardType TVStandard) #else int gfx_set_decoder_TV_standard(TVStandardType TVStandard) #endif { switch (TVStandard) { case TV_STANDARD_NTSC: saa7114_write_reg(0x0E, 0x89); saa7114_write_reg(0x5A, 0x06); break; case TV_STANDARD_PAL: saa7114_write_reg(0x0E, 0x81); saa7114_write_reg(0x5A, 0x03); break; default: return GFX_STATUS_BAD_PARAMETER; } gfx_decoder_software_reset(); return GFX_STATUS_OK; } /*---------------------------------------------------------------------------- * gfx_set_decoder_luminance_filter * * This routine sets the hue control of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_set_decoder_luminance_filter(unsigned char lufi) #else int gfx_set_decoder_luminance_filter(unsigned char lufi) #endif { unsigned char data; saa7114_read_reg(SAA7114_LUMINANCE_CONTROL, &data); saa7114_write_reg(SAA7114_LUMINANCE_CONTROL, (unsigned char) ((data & ~0x0F) | (lufi & 0x0F))); return (0); } /*************************************************************/ /* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ /*************************************************************/ #if GFX_READ_ROUTINES /*---------------------------------------------------------------------------- * gfx_get_decoder_brightness * * This routine returns the current brightness of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC unsigned char saa7114_get_decoder_brightness(void) #else unsigned char gfx_get_decoder_brightness(void) #endif { unsigned char brightness = 0; saa7114_read_reg(SAA7114_BRIGHTNESS, &brightness); return (brightness); } /*---------------------------------------------------------------------------- * gfx_get_decoder_contrast * * This routine returns the current contrast of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC unsigned char saa7114_get_decoder_contrast(void) #else unsigned char gfx_get_decoder_contrast(void) #endif { unsigned char contrast = 0; saa7114_read_reg(SAA7114_CONTRAST, &contrast); contrast <<= 1; return (contrast); } /*---------------------------------------------------------------------------- * gfx_get_decoder_hue * * This routine returns the current hue of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC char saa7114_get_decoder_hue(void) #else char gfx_get_decoder_hue(void) #endif { unsigned char hue = 0; saa7114_read_reg(SAA7114_HUE, &hue); return ((char) hue); } /*---------------------------------------------------------------------------- * gfx_get_decoder_saturation * * This routine returns the current saturation of the video decoder. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC unsigned char saa7114_get_decoder_saturation(void) #else unsigned char gfx_get_decoder_saturation(void) #endif { unsigned char saturation = 0; saa7114_read_reg(SAA7114_SATURATION, &saturation); saturation <<= 1; return (saturation); } /*---------------------------------------------------------------------------- * gfx_get_decoder_input_offset * * This routine returns the offset into the input window. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC unsigned long saa7114_get_decoder_input_offset(void) #else unsigned long gfx_get_decoder_input_offset(void) #endif { unsigned long value = 0; unsigned char data; saa7114_read_reg(SAA7114_HORZ_OFFSET_LO, &data); value = (unsigned long) data; saa7114_read_reg(SAA7114_HORZ_OFFSET_HI, &data); value |= ((unsigned long) data) << 8; saa7114_read_reg(SAA7114_VERT_OFFSET_LO, &data); value |= ((unsigned long) data) << 16; saa7114_read_reg(SAA7114_VERT_OFFSET_HI, &data); value |= ((unsigned long) data) << 24; return (value); } /*---------------------------------------------------------------------------- * gfx_get_decoder_input_size * * This routine returns the current size of the input window *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC unsigned long saa7114_get_decoder_input_size(void) #else unsigned long gfx_get_decoder_input_size(void) #endif { unsigned long value = 0; unsigned char data; saa7114_read_reg(SAA7114_HORZ_INPUT_LO, &data); value = (unsigned long) data; saa7114_read_reg(SAA7114_HORZ_INPUT_HI, &data); value |= ((unsigned long) data) << 8; saa7114_read_reg(SAA7114_VERT_INPUT_LO, &data); value |= ((unsigned long) data) << 17; saa7114_read_reg(SAA7114_VERT_INPUT_HI, &data); value |= ((unsigned long) data) << 25; return (value); } /*---------------------------------------------------------------------------- * gfx_get_decoder_output_size * * This routine returns the current size of the output window. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC unsigned long saa7114_get_decoder_output_size(void) #else unsigned long gfx_get_decoder_output_size(void) #endif { unsigned long value = 0; unsigned char data; saa7114_read_reg(SAA7114_HORZ_OUTPUT_LO, &data); value = (unsigned long) data; saa7114_read_reg(SAA7114_HORZ_OUTPUT_HI, &data); value |= ((unsigned long) data) << 8; saa7114_read_reg(SAA7114_VERT_OUTPUT_LO, &data); value |= ((unsigned long) data) << 17; saa7114_read_reg(SAA7114_VERT_OUTPUT_HI, &data); value |= ((unsigned long) data) << 25; return (value); } /*---------------------------------------------------------------------------- * gfx_get_decoder_vbi_format * * This routine returns the current format of VBI data for the specified line. *---------------------------------------------------------------------------- */ #if GFX_DECODER_DYNAMIC int saa7114_get_decoder_vbi_format(int line) #else int gfx_get_decoder_vbi_format(int line) #endif { unsigned char format = 0, data; saa7114_read_reg((unsigned char) (0x3F + line), &data); switch (data) { case 0xFF: format = VBI_FORMAT_VIDEO; break; /* Active video */ case 0x77: format = VBI_FORMAT_RAW; break; /* Raw VBI data */ case 0x55: format = VBI_FORMAT_CC; break; /* US CC */ case 0xCC: format = VBI_FORMAT_NABTS; break; /* US NABTS */ } return (format); } #endif /* GFX_READ_ROUTINES */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/history.h0000644000175000017500000000300112654445443015017 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* Version is in the format of MMmmpp * where in MM is the Major version, mm is the minor version * and pp is the patch number (0 - 99) */ #define DURANGO_VERSION 30003 /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/vid_5530.c0000644000175000017500000011676512654445443014575 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to control the CS5530 video overlay hardware. */ /*---------------------------------------------------------------------------- * CS5530 PLL TABLE *---------------------------------------------------------------------------- */ typedef struct tagCS5530PLLENTRY { long frequency; /* 16.16 fixed point frequency */ unsigned long pll_value; /* associated register value */ } CS5530PLLENTRY; CS5530PLLENTRY CS5530_PLLtable[] = { {0x00192CCC, 0x31C45801,}, /* 25.1750 */ {0x001C526E, 0x20E36802,}, /* 28.3220 */ {0x001F8000, 0x33915801,}, /* 31.5000 */ {0x00240000, 0x31EC4801,}, /* 36.0000 */ {0x00258000, 0x21E22801,}, /* 37.5000 */ {0x00280000, 0x33088801,}, /* 40.0000 */ {0x002CE666, 0x33E22801,}, /* 44.9000 */ {0x00318000, 0x336C4801,}, /* 49.5000 */ {0x00320000, 0x23088801,}, /* 50.0000 */ {0x00325999, 0x23088801,}, /* 50.3500 */ {0x00360000, 0x3708A801,}, /* 54.0000 */ {0x00384000, 0x23E36802,}, /* 56.2500 */ {0x0038643F, 0x23E36802,}, /* 56.3916 */ {0x0038A4DD, 0x23E36802,}, /* 56.6444 */ {0x003B0000, 0x37C45801,}, /* 59.0000 */ {0x003F0000, 0x23EC4801,}, /* 63.0000 */ {0x00410000, 0x37911801,}, /* 65.0000 */ {0x00438000, 0x37963803,}, /* 67.5000 */ {0x0046CCCC, 0x37058803,}, /* 70.8000 */ {0x00480000, 0x3710C805,}, /* 72.0000 */ {0x004B0000, 0x37E22801,}, /* 75.0000 */ {0x004EC000, 0x27915801,}, /* 78.7500 */ {0x00500000, 0x37D8D802,}, /* 80.0000 */ {0x0059CCCC, 0x27588802,}, /* 89.8000 */ {0x005E8000, 0x27EC4802,}, /* 94.5000 */ {0x00630000, 0x27AC6803,}, /* 99.0000 */ {0x00640000, 0x27088801,}, /* 100.0000 */ {0x006C0000, 0x2710C805,}, /* 108.0000 */ {0x00708000, 0x27E36802,}, /* 112.5000 */ {0x00820000, 0x27C58803,}, /* 130.0000 */ {0x00870000, 0x27316803,}, /* 135.0000 */ {0x009D8000, 0x2F915801,}, /* 157.5000 */ {0x00A20000, 0x2F08A801,}, /* 162.0000 */ {0x00AF0000, 0x2FB11802,}, /* 175.0000 */ {0x00BD0000, 0x2FEC4802,}, /* 189.0000 */ {0x00CA0000, 0x2F963803,}, /* 202.0000 */ {0x00E80000, 0x2FB1B802,}, /* 232.0000 */ }; #define NUM_CS5530_FREQUENCIES sizeof(CS5530_PLLtable)/sizeof(CS5530PLLENTRY) /*--------------------------------------------------------------------------- * gfx_set_crt_enable * * This routine enables or disables the CRT output from the video processor. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_crt_enable(int enable) #else int gfx_set_crt_enable(int enable) #endif { unsigned long config; config = READ_VID32(CS5530_DISPLAY_CONFIG); switch (enable) { case CRT_DISABLE: /* Disable everything */ WRITE_VID32(CS5530_DISPLAY_CONFIG, config & ~(CS5530_DCFG_DIS_EN | CS5530_DCFG_HSYNC_EN | CS5530_DCFG_VSYNC_EN | CS5530_DCFG_DAC_BL_EN | CS5530_DCFG_DAC_PWDNX)); break; case CRT_ENABLE: /* Enable CRT display, including display logic */ WRITE_VID32(CS5530_DISPLAY_CONFIG, config | CS5530_DCFG_DIS_EN | CS5530_DCFG_HSYNC_EN | CS5530_DCFG_VSYNC_EN | CS5530_DCFG_DAC_BL_EN | CS5530_DCFG_DAC_PWDNX); break; case CRT_STANDBY: /* HSync:Off VSync:On */ WRITE_VID32(CS5530_DISPLAY_CONFIG, (config & ~(CS5530_DCFG_DIS_EN | CS5530_DCFG_HSYNC_EN | CS5530_DCFG_DAC_BL_EN | CS5530_DCFG_DAC_PWDNX)) | CS5530_DCFG_VSYNC_EN); break; case CRT_SUSPEND: /* HSync:On VSync:Off */ WRITE_VID32(CS5530_DISPLAY_CONFIG, (config & ~(CS5530_DCFG_DIS_EN | CS5530_DCFG_VSYNC_EN | CS5530_DCFG_DAC_BL_EN | CS5530_DCFG_DAC_PWDNX)) | CS5530_DCFG_HSYNC_EN); break; default: return (GFX_STATUS_BAD_PARAMETER); } return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_reset_video (PRIVATE ROUTINE: NOT PART OF DURANGO API) * * This routine is used to disable all components of video overlay before * performing a mode switch. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void cs5530_reset_video(void) #else void gfx_reset_video(void) #endif { gfx_set_video_enable(0); /* CLEAR THE DISPLAY BUFFER SIZE TO ZERO */ /* During a modeset,if FIFO load is enabled with a large buffer size, */ /* the FIFO can hang. To prevent this, we set the buffer size to zero */ /* and wait for this new size to be latched */ gfx_set_display_video_size(0, 0); if (gfx_test_timing_active()) { while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); } } /*---------------------------------------------------------------------------- * gfx_set_display_control (PRIVATE ROUTINE: NOT PART OF DURANGO API) * * This routine configures the display output. * * "sync_polarities" is used to set the polarities of the sync pulses * according to the following mask: * * Bit 0: If set to 1, negative horizontal polarity is programmed, * otherwise positive horizontal polarity is programmed. * Bit 1: If set to 1, negative vertical polarity is programmed, * otherwise positive vertical polarity is programmed. * *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_display_control(int sync_polarities) #else int gfx_set_display_control(int sync_polarities) #endif { unsigned long dcfg; /* ENABLE DISPLAY OUTPUT FROM CX5530 */ dcfg = READ_VID32(CS5530_DISPLAY_CONFIG); /* CLEAR RELEVANT FIELDS */ dcfg &= ~(CS5530_DCFG_CRT_SYNC_SKW_MASK | CS5530_DCFG_PWR_SEQ_DLY_MASK | CS5530_DCFG_CRT_HSYNC_POL | CS5530_DCFG_CRT_VSYNC_POL | CS5530_DCFG_FP_PWR_EN | CS5530_DCFG_FP_DATA_EN); /* INITIALIZATION */ dcfg |= (CS5530_DCFG_CRT_SYNC_SKW_INIT | CS5530_DCFG_PWR_SEQ_DLY_INIT | CS5530_DCFG_GV_PAL_BYP); if (PanelEnable) { dcfg |= CS5530_DCFG_FP_PWR_EN; dcfg |= CS5530_DCFG_FP_DATA_EN; } /* SET APPROPRIATE SYNC POLARITIES */ if (sync_polarities & 1) dcfg |= CS5530_DCFG_CRT_HSYNC_POL; if (sync_polarities & 2) dcfg |= CS5530_DCFG_CRT_VSYNC_POL; WRITE_VID32(CS5530_DISPLAY_CONFIG, dcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_clock_frequency * * This routine sets the clock frequency, specified as a 16.16 fixed point * value (0x00318000 = 49.5 MHz). It will set the closest frequency found * in the lookup table. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void cs5530_set_clock_frequency(unsigned long frequency) #else void gfx_set_clock_frequency(unsigned long frequency) #endif { unsigned int index; unsigned long value; long min, diff; /* FIND THE REGISTER VALUES FOR THE DESIRED FREQUENCY */ /* Search the table for the closest frequency (16.16 format). */ value = CS5530_PLLtable[0].pll_value; min = (long) CS5530_PLLtable[0].frequency - frequency; if (min < 0L) min = -min; for (index = 1; index < NUM_CS5530_FREQUENCIES; index++) { diff = (long) CS5530_PLLtable[index].frequency - frequency; if (diff < 0L) diff = -diff; if (diff < min) { min = diff; value = CS5530_PLLtable[index].pll_value; } } /* SET THE DOT CLOCK REGISTER */ WRITE_VID32(CS5530_DOT_CLK_CONFIG, value); WRITE_VID32(CS5530_DOT_CLK_CONFIG, value | 0x80000100); /* set reset/bypass */ gfx_delay_milliseconds(1); /* wait for PLL to settle */ WRITE_VID32(CS5530_DOT_CLK_CONFIG, value & 0x7FFFFFFF); /* clear reset */ WRITE_VID32(CS5530_DOT_CLK_CONFIG, value & 0x7FFFFEFF); /* clear bypass */ return; } /*---------------------------------------------------------------------------- * gfx_set_video_enable * * This routine enables or disables the video overlay functionality. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_video_enable(int enable) #else int gfx_set_video_enable(int enable) #endif { unsigned long vcfg; /* WAIT FOR VERTICAL BLANK TO START */ /* Otherwise a glitch can be observed. */ if (gfx_test_timing_active()) { if (!gfx_test_vertical_active()) { while (!gfx_test_vertical_active()); } while (gfx_test_vertical_active()); } vcfg = READ_VID32(CS5530_VIDEO_CONFIG); if (enable) { /* SET CS5530 BUS CONTROL PARAMETERS */ /* Currently always high speed, 8-bit interface. */ vcfg |= CS5530_VCFG_HIGH_SPD_INT; vcfg &= ~(CS5530_VCFG_EARLY_VID_RDY | CS5530_VCFG_16_BIT_EN); /* ENABLE CS5530 VIDEO OVERLAY */ vcfg |= CS5530_VCFG_VID_EN; WRITE_VID32(CS5530_VIDEO_CONFIG, vcfg); } else { /* DISABLE CS5530 VIDEO OVERLAY */ vcfg &= ~CS5530_VCFG_VID_EN; WRITE_VID32(CS5530_VIDEO_CONFIG, vcfg); } return (0); } /*---------------------------------------------------------------------------- * gfx_set_video_format * * Currently only sets 4:2:0 format, Y1 V Y0 U. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_video_format(unsigned long format) #else int gfx_set_video_format(unsigned long format) #endif { unsigned long vcfg = 0; /* SET THE CS5530 VIDEO INPUT FORMAT */ vcfg = READ_VID32(CS5530_VIDEO_CONFIG); vcfg &= ~(CS5530_VCFG_VID_INP_FORMAT | CS5530_VCFG_4_2_0_MODE); vcfg &= ~(CS5530_VCFG_CSC_BYPASS); vcfg &= ~(CS5530_VCFG_GV_SEL); if (format < 4) vcfg |= (format << 2); else { if (format == VIDEO_FORMAT_Y0Y1Y2Y3) { vcfg |= CS5530_VCFG_4_2_0_MODE; vcfg |= 1 << 2; } if (format == VIDEO_FORMAT_RGB) { vcfg |= CS5530_VCFG_CSC_BYPASS; vcfg |= CS5530_VCFG_GV_SEL; } } WRITE_VID32(CS5530_VIDEO_CONFIG, vcfg); return (0); } /*---------------------------------------------------------------------------- * gfx_set_video_size * * This routine specifies the size of the source data. It is used only * to determine how much data to transfer per frame, and is not used to * calculate the scaling value (that is handled by a separate routine). *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_video_size(unsigned short width, unsigned short height) #else int gfx_set_video_size(unsigned short width, unsigned short height) #endif { unsigned long size, vcfg; /* SET THE CS5530 VIDEO LINE SIZE */ vcfg = READ_VID32(CS5530_VIDEO_CONFIG); vcfg &= ~(CS5530_VCFG_LINE_SIZE_LOWER_MASK | CS5530_VCFG_LINE_SIZE_UPPER); size = (width >> 1); vcfg |= (size & 0x00FF) << 8; if (size & 0x0100) vcfg |= CS5530_VCFG_LINE_SIZE_UPPER; WRITE_VID32(CS5530_VIDEO_CONFIG, vcfg); /* SET TOTAL VIDEO BUFFER SIZE IN DISPLAY CONTROLLER */ /* Use private routine to abstract the display controller. */ gfx_set_display_video_size(width, height); return (0); } /*---------------------------------------------------------------------------- * gfx_set_video_offset * * This routine sets the starting offset for the video buffer when only * one offset needs to be specified. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_video_offset(unsigned long offset) #else int gfx_set_video_offset(unsigned long offset) #endif { /* SAVE VALUE FOR FUTURE CLIPPING OF THE TOP OF THE VIDEO WINDOW */ gfx_vid_offset = offset; /* SET VIDEO BUFFER OFFSET IN DISPLAY CONTROLLER */ /* Use private routine to abstract the display controller. */ gfx_set_display_video_offset(offset); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_scale * * This routine sets the scale factor for the video overlay window. The * size of the source and destination regions are specified in pixels. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) #else int gfx_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) #endif { unsigned long xscale, yscale; /* SAVE PARAMETERS */ /* These are needed for clipping the video window later. */ gfx_vid_srcw = srcw; gfx_vid_srch = srch; gfx_vid_dstw = dstw; gfx_vid_dsth = dsth; /* CALCULATE CS5530 SCALE FACTORS */ /* No downscaling in CS5530 so force to 1x if attempted. */ if (dstw <= srcw) xscale = 0x1FFF; else if (dstw == 1 || srcw == 1) return GFX_STATUS_BAD_PARAMETER; else xscale = (0x2000l * (srcw - 1l)) / (dstw - 1l); if (dsth <= srch) yscale = 0x1FFF; else if (dsth == 1 || srch == 1) return GFX_STATUS_BAD_PARAMETER; else yscale = (0x2000l * (srch - 1l)) / (dsth - 1l); WRITE_VID32(CS5530_VIDEO_SCALE, (yscale << 16) | xscale); /* CALL ROUTINE TO UPDATE WINDOW POSITION */ /* This is required because the scale values effect the number of */ /* source data pixels that need to be clipped, as well as the */ /* amount of data that needs to be transferred. */ gfx_set_video_window(gfx_vid_xpos, gfx_vid_ypos, gfx_vid_width, gfx_vid_height); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_window * * This routine sets the position and size of the video overlay window. The * position is specified in screen relative coordinates, and may be negative. * The size of destination region is specified in pixels. The line size * indicates the number of bytes of source data per scanline. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_video_window(short x, short y, unsigned short w, unsigned short h) #else int gfx_set_video_window(short x, short y, unsigned short w, unsigned short h) #endif { unsigned long vcfg = 0; unsigned long hadjust, vadjust; unsigned long xstart, ystart, xend, yend; unsigned long offset, line_size; /* SAVE PARAMETERS */ /* These are needed to call this routine if the scale value changes. */ gfx_vid_xpos = x; gfx_vid_ypos = y; gfx_vid_width = w; gfx_vid_height = h; /* GET ADJUSTMENT VALUES */ /* Use routines to abstract version of display controller. */ hadjust = gfx_get_htotal() - gfx_get_hsync_end() - 13l; vadjust = gfx_get_vtotal() - gfx_get_vsync_end() + 1l; /* LEFT CLIPPING */ if (x < 0) { gfx_set_video_left_crop((unsigned short) (-x)); xstart = hadjust; } else { gfx_set_video_left_crop(0); xstart = (unsigned long) x + hadjust; } /* CLIPPING ON RIGHT */ xend = x + w; if (xend > gfx_get_hactive()) xend = gfx_get_hactive(); xend += hadjust; /* CLIPPING ON TOP */ offset = gfx_vid_offset; if (y >= 0) { ystart = y + vadjust; } else { ystart = vadjust; line_size = (READ_VID32(CS5530_VIDEO_CONFIG) >> 7) & 0x000001FE; if (READ_VID32(CS5530_VIDEO_CONFIG) & CS5530_VCFG_LINE_SIZE_UPPER) line_size += 512l; if (gfx_vid_dsth) offset = gfx_vid_offset + (line_size << 1) * (((-y) * gfx_vid_srch) / gfx_vid_dsth); } /* CLIPPING ON BOTTOM */ yend = y + h; if (yend >= gfx_get_vactive()) yend = gfx_get_vactive(); yend += vadjust; /* SET VIDEO BUFFER OFFSET IN DISPLAY CONTROLLER */ /* Use private routine to abstract the display controller. */ gfx_set_display_video_offset(offset); /* DISABLE REGISTER UPDATES */ vcfg = READ_VID32(CS5530_VIDEO_CONFIG); vcfg &= ~CS5530_VCFG_VID_REG_UPDATE; WRITE_VID32(CS5530_VIDEO_CONFIG, vcfg); /* SET VIDEO POSITION */ WRITE_VID32(CS5530_VIDEO_X_POS, (xend << 16) | xstart); WRITE_VID32(CS5530_VIDEO_Y_POS, (yend << 16) | ystart); vcfg |= CS5530_VCFG_VID_REG_UPDATE; WRITE_VID32(CS5530_VIDEO_CONFIG, vcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_left_crop * * This routine sets the number of pixels which will be cropped from the * beginning of each video line. The video window will begin to display only * from the pixel following the cropped pixels, and the cropped pixels * will be ignored. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_video_left_crop(unsigned short x) #else int gfx_set_video_left_crop(unsigned short x) #endif { unsigned long vcfg, initread; /* CLIPPING ON LEFT */ /* Adjust initial read for scale, checking for divide by zero */ if (gfx_vid_dstw) initread = (unsigned long) x *gfx_vid_srcw / gfx_vid_dstw; else initread = 0; /* SET INITIAL READ ADDRESS AND ENABLE REGISTER UPDATES */ vcfg = READ_VID32(CS5530_VIDEO_CONFIG); vcfg &= ~CS5530_VCFG_INIT_READ_MASK; vcfg |= (initread << 15) & CS5530_VCFG_INIT_READ_MASK; vcfg |= CS5530_VCFG_VID_REG_UPDATE; WRITE_VID32(CS5530_VIDEO_CONFIG, vcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_color_key * * This routine specifies the color key value and mask for the video overlay * hardware. To disable color key, the color and mask should both be set to * zero. The hardware uses the color key in the following equation: * * ((source data) & (color key mask)) == ((color key) & (color key mask)) * * The source data can be either graphics data or video data. The bluescreen * parameter is set to have the hardware compare video data and clear to * comapare graphics data. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_video_color_key(unsigned long key, unsigned long mask, int graphics) #else int gfx_set_video_color_key(unsigned long key, unsigned long mask, int graphics) #endif { unsigned long dcfg = 0; /* SET CS5530 COLOR KEY VALUE */ WRITE_VID32(CS5530_VIDEO_COLOR_KEY, key); WRITE_VID32(CS5530_VIDEO_COLOR_MASK, mask); /* SELECT GRAPHICS OR VIDEO DATA TO COMPARE TO THE COLOR KEY */ dcfg = READ_VID32(CS5530_DISPLAY_CONFIG); if (graphics & 0x01) dcfg &= ~CS5530_DCFG_VG_CK; else dcfg |= CS5530_DCFG_VG_CK; WRITE_VID32(CS5530_DISPLAY_CONFIG, dcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_filter * * This routine enables or disables the video overlay filters. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_video_filter(int xfilter, int yfilter) #else int gfx_set_video_filter(int xfilter, int yfilter) #endif { unsigned long vcfg = 0; /* ENABLE OR DISABLE CS5530 VIDEO OVERLAY FILTERS */ vcfg = READ_VID32(CS5530_VIDEO_CONFIG); vcfg &= ~(CS5530_VCFG_X_FILTER_EN | CS5530_VCFG_Y_FILTER_EN); if (xfilter) vcfg |= CS5530_VCFG_X_FILTER_EN; if (yfilter) vcfg |= CS5530_VCFG_Y_FILTER_EN; WRITE_VID32(CS5530_VIDEO_CONFIG, vcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_palette * * This routine loads the video hardware palette. If a NULL pointer is * specified, the palette is bypassed (for CS5530, this means loading the * palette with identity values). *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_video_palette(unsigned long *palette) #else int gfx_set_video_palette(unsigned long *palette) #endif { unsigned long i, entry; /* LOAD CS5530 VIDEO PALETTE */ WRITE_VID32(CS5530_PALETTE_ADDRESS, 0); for (i = 0; i < 256; i++) { if (palette) entry = palette[i]; else entry = i | (i << 8) | (i << 16); WRITE_VID32(CS5530_PALETTE_DATA, entry); } return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_palette_entry * * This routine loads a single entry of the video hardware palette. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_set_video_palette_entry(unsigned long index, unsigned long palette) #else int gfx_set_video_palette_entry(unsigned long index, unsigned long palette) #endif { if (index > 0xFF) return GFX_STATUS_BAD_PARAMETER; /* SET A SINGLE ENTRY */ WRITE_VID32(CS5530_PALETTE_ADDRESS, index); WRITE_VID32(CS5530_PALETTE_DATA, palette); return (0); } #define CX55xx_VIDEO_PCI_44 0x80009444 /*--------------------------------------------------------------------------- * gfx_disable_softvga * * Disables SoftVga. This function is only valid with VSA2, Returns 1 if * SoftVga can be disabled; 0 if not. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_disable_softvga(void) #else int gfx_disable_softvga(void) #endif { unsigned long reg_val; /* get the current value */ reg_val = gfx_pci_config_read(CX55xx_VIDEO_PCI_44); /* setting video PCI register 44 bit 0 to 1 disables SoftVga */ reg_val |= 0x1; gfx_pci_config_write(CX55xx_VIDEO_PCI_44, reg_val); /* see if we set the bit and return the appropriate value */ reg_val = gfx_pci_config_read(CX55xx_VIDEO_PCI_44); if ((reg_val & 0x1) == 0x1) return (1); else return (0); } /*--------------------------------------------------------------------------- * gfx_enable_softvga * * Enables SoftVga. This function is only valid with VSA2, Returns 1 if * SoftVga can be enbled; 0 if not. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_enable_softvga(void) #else int gfx_enable_softvga(void) #endif { unsigned long reg_val; /* get the current value */ reg_val = gfx_pci_config_read(CX55xx_VIDEO_PCI_44); /* clearing video PCI register 44 bit 0 enables SoftVga */ gfx_pci_config_write(CX55xx_VIDEO_PCI_44, reg_val & 0xfffffffe); /* see if we cleared the bit and return the appropriate value */ reg_val = gfx_pci_config_read(CX55xx_VIDEO_PCI_44); if ((reg_val & 0x1) == 0) return (1); else return (0); } /*--------------------------------------------------------------------------- * gfx_get_clock_frequency * * This routine returns the current clock frequency in 16.16 format. * It reads the current register value and finds the match in the table. * If no match is found, this routine returns 0. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_get_clock_frequency(void) #else unsigned long gfx_get_clock_frequency(void) #endif { unsigned int index; unsigned long value, mask; mask = 0x7FFFFEDC; value = READ_VID32(CS5530_DOT_CLK_CONFIG) & mask; for (index = 0; index < NUM_CS5530_FREQUENCIES; index++) { if ((CS5530_PLLtable[index].pll_value & mask) == value) return (CS5530_PLLtable[index].frequency); } return (0); } /*--------------------------------------------------------------------------- * gfx_get_max_video_width * * This routine returns the maximum theoretical video width for the current * display mode. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_get_max_video_width(void) #else unsigned long gfx_get_max_video_width(void) #endif { unsigned long htotal, vidclk, dotpll; unsigned long low, high, sublow, subhigh; unsigned long width, value; unsigned long temp0, temp1; unsigned long highshift; unsigned long divisor, dividend; htotal = gfx_get_htotal(); vidclk = gfx_cpu_frequency << 15; if (READ_REG32(DC_GENERAL_CFG) & DC_GCFG_VCLK_DIV) vidclk >>= 1; dotpll = gfx_get_clock_frequency(); /* CHECK FOR UNKNOWN DOT CLOCK */ if (!dotpll) return 0; /* DERIVE THEORETICAL MAXIMUM */ /* The GX/CS5530 video interface transfers 8 bytes for every 9 video */ /* clocks. This implies that 4 video pixels are transferred for every */ /* 9 clocks. The time allowed to fill a line buffer is an entire */ /* display line, or (HTotal * DotPll). The time needed to fill the */ /* line buffer is thus ((4/9) * VidClk * VidWidth). Solving for */ /* equality yields the theoretical maximum: */ /* */ /* 4 * VidClk * HTotal */ /* VidWidth = ----------------------- */ /* 9 * DotPLL */ /* CALCULATE TOP OF EQUATION */ /* The equation as it stands will overflow 32-bit integer math. We must */ /* therefore use tricks to perform a 64-bit equation to calculate the */ /* correct value. We assume in this equation that the upper 16 bits of */ /* htotal are 0, i.e. that htotal is never greater than 65535. */ vidclk <<= 2; low = (vidclk & 0xFFFF) * (htotal & 0xFFFF); temp0 = (vidclk >> 16) * (htotal & 0xFFFF); temp1 = temp0 << 16; high = temp0 >> 16; if ((0xFFFFFFFF - temp1) < low) high++; low += temp1; /* DIVIDE BY BOTTOM OF EQUATION */ /* Use an iterative divide to avoid floating point or inline assembly */ /* Costly, but so is the price of OS independence. */ divisor = 9 * dotpll; highshift = 0; width = 0; while (highshift <= 32) { if (highshift == 0) dividend = high; else if (highshift == 32) dividend = low; else dividend = (high << highshift) | (low >> (32 - highshift)); value = dividend / divisor; width = (width << 4) + value; value *= divisor; subhigh = value >> highshift; sublow = value << (32 - highshift); if (low < sublow) high = high - subhigh - 1; else high = high - subhigh; low -= sublow; highshift += 4; } /* ALIGN TO 8 PIXEL BOUNDARY */ width &= 0xFFFC; return width; } /*************************************************************/ /* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ /*************************************************************/ #if GFX_READ_ROUTINES /*--------------------------------------------------------------------------- * gfx_get_vsa2_softvga_enable * * This function returns the enable status of SoftVGA. It is valid * only if VSAII is present. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_get_vsa2_softvga_enable(void) #else int gfx_get_vsa2_softvga_enable(void) #endif { unsigned long reg_val; reg_val = gfx_pci_config_read(CX55xx_VIDEO_PCI_44); if ((reg_val & 0x1) == 0) return (1); else return (0); } /*--------------------------------------------------------------------------- * gfx_get_sync_polarities * * This routine returns the polarities of the sync pulses: * Bit 0: Set if negative horizontal polarity. * Bit 1: Set if negative vertical polarity. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_get_sync_polarities(void) #else int gfx_get_sync_polarities(void) #endif { int polarities = 0; if (READ_VID32(CS5530_DISPLAY_CONFIG) & 0x00000100) polarities |= 1; if (READ_VID32(CS5530_DISPLAY_CONFIG) & 0x00000200) polarities |= 2; return (polarities); } /*--------------------------------------------------------------------------- * gfx_get_video_palette_entry * * This routine returns a single palette entry. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_get_video_palette_entry(unsigned long index, unsigned long *palette) #else int gfx_get_video_palette_entry(unsigned long index, unsigned long *palette) #endif { if (index > 0xFF) return GFX_STATUS_BAD_PARAMETER; /* READ A SINGLE ENTRY */ WRITE_VID32(CS5530_PALETTE_ADDRESS, index); *palette = READ_VID32(CS5530_PALETTE_DATA); return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_get_video_enable * * This routine returns the value "one" if video overlay is currently enabled, * otherwise it returns the value "zero". *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_get_video_enable(void) #else int gfx_get_video_enable(void) #endif { if (READ_VID32(CS5530_VIDEO_CONFIG) & CS5530_VCFG_VID_EN) return (1); return (0); } /*---------------------------------------------------------------------------- * gfx_get_video_format * * This routine returns the current video overlay format. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_get_video_format(void) #else int gfx_get_video_format(void) #endif { unsigned long vcfg; vcfg = READ_VID32(CS5530_VIDEO_CONFIG); if (vcfg & CS5530_VCFG_CSC_BYPASS) return (VIDEO_FORMAT_RGB); if (vcfg & CS5530_VCFG_4_2_0_MODE) return (VIDEO_FORMAT_Y0Y1Y2Y3); return ((int) ((vcfg >> 2) & 3)); } /*---------------------------------------------------------------------------- * gfx_get_video_src_size * * This routine returns the size of the source video overlay buffer. The * return value is (height << 16) | width. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_get_video_src_size(void) #else unsigned long gfx_get_video_src_size(void) #endif { unsigned long width = 0, height = 0; /* DETERMINE SOURCE WIDTH FROM THE CS5530 VIDEO LINE SIZE */ width = (READ_VID32(CS5530_VIDEO_CONFIG) >> 7) & 0x000001FE; if (READ_VID32(CS5530_VIDEO_CONFIG) & CS5530_VCFG_LINE_SIZE_UPPER) width += 512l; if (width) { /* DETERMINE HEIGHT BY DIVIDING TOTAL SIZE BY WIDTH */ /* Get total size from display controller - abtracted. */ height = gfx_get_display_video_size() / (width << 1); } return ((height << 16) | width); } /*---------------------------------------------------------------------------- * gfx_get_video_line_size * * This routine returns the line size of the source video overlay buffer, in * pixels. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_get_video_line_size(void) #else unsigned long gfx_get_video_line_size(void) #endif { unsigned long width = 0; /* DETERMINE SOURCE WIDTH FROM THE CS5530 VIDEO LINE SIZE */ width = (READ_VID32(CS5530_VIDEO_CONFIG) >> 7) & 0x000001FE; if (READ_VID32(CS5530_VIDEO_CONFIG) & CS5530_VCFG_LINE_SIZE_UPPER) width += 512l; return (width); } /*---------------------------------------------------------------------------- * gfx_get_video_xclip * * This routine returns the number of bytes clipped on the left side of a * video overlay line (skipped at beginning). *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_get_video_xclip(void) #else unsigned long gfx_get_video_xclip(void) #endif { unsigned long clip = 0; /* DETERMINE SOURCE WIDTH FROM THE CS5530 VIDEO LINE SIZE */ clip = (READ_VID32(CS5530_VIDEO_CONFIG) >> 14) & 0x000007FC; return (clip); } /*---------------------------------------------------------------------------- * gfx_get_video_offset * * This routine returns the current offset for the video overlay buffer. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_get_video_offset(void) #else unsigned long gfx_get_video_offset(void) #endif { return (gfx_get_display_video_offset()); } /*--------------------------------------------------------------------------- * gfx_get_video_scale * * This routine returns the scale factor for the video overlay window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_get_video_scale(void) #else unsigned long gfx_get_video_scale(void) #endif { return (READ_VID32(CS5530_VIDEO_SCALE)); } /*--------------------------------------------------------------------------- * gfx_get_video_dst_size * * This routine returns the size of the displayed video overlay window. * NOTE: This is the displayed window size, which may be different from * the real window size if clipped. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_get_video_dst_size(void) #else unsigned long gfx_get_video_dst_size(void) #endif { unsigned long xsize, ysize; xsize = READ_VID32(CS5530_VIDEO_X_POS); xsize = ((xsize >> 16) & 0x7FF) - (xsize & 0x07FF); ysize = READ_VID32(CS5530_VIDEO_Y_POS); ysize = ((ysize >> 16) & 0x7FF) - (ysize & 0x07FF); return ((ysize << 16) | xsize); } /*--------------------------------------------------------------------------- * gfx_get_video_position * * This routine returns the position of the video overlay window. The * return value is (ypos << 16) | xpos. * NOTE: This is the displayed window position, which may be different from * the real window position if clipped. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_get_video_position(void) #else unsigned long gfx_get_video_position(void) #endif { unsigned long hadjust, vadjust; unsigned long xpos, ypos; /* READ HARDWARE POSITION */ xpos = READ_VID32(CS5530_VIDEO_X_POS) & 0x000007FF; ypos = READ_VID32(CS5530_VIDEO_Y_POS) & 0x000007FF; /* GET ADJUSTMENT VALUES */ /* Use routines to abstract version of display controller. */ hadjust = gfx_get_htotal() - gfx_get_hsync_end() - 13l; vadjust = gfx_get_vtotal() - gfx_get_vsync_end() + 1l; xpos -= hadjust; ypos -= vadjust; return ((ypos << 16) | (xpos & 0x0000FFFF)); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key * * This routine returns the current video color key value. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_get_video_color_key(void) #else unsigned long gfx_get_video_color_key(void) #endif { return (READ_VID32(CS5530_VIDEO_COLOR_KEY)); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key_mask * * This routine returns the current video color mask value. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_get_video_color_key_mask(void) #else unsigned long gfx_get_video_color_key_mask(void) #endif { return (READ_VID32(CS5530_VIDEO_COLOR_MASK)); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key_src * * This routine returns 0 for video data compare, 1 for graphics data. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_get_video_color_key_src(void) #else int gfx_get_video_color_key_src(void) #endif { if (READ_VID32(CS5530_DISPLAY_CONFIG) & CS5530_DCFG_VG_CK) return (0); return (1); } /*--------------------------------------------------------------------------- * gfx_get_video_filter * * This routine returns if the filters are currently enabled. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int cs5530_get_video_filter(void) #else int gfx_get_video_filter(void) #endif { int retval = 0; if (READ_VID32(CS5530_VIDEO_CONFIG) & CS5530_VCFG_X_FILTER_EN) retval |= 1; if (READ_VID32(CS5530_VIDEO_CONFIG) & CS5530_VCFG_Y_FILTER_EN) retval |= 2; return (retval); } /*--------------------------------------------------------------------------- * gfx_read_crc * * This routine returns the hardware CRC value, which is used for automated * testing. The value is like a checksum, but will change if pixels move * locations. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long cs5530_read_crc(void) #else unsigned long gfx_read_crc(void) #endif { unsigned long crc = 0xFFFFFFFF; if (gfx_test_timing_active()) { /* WAIT UNTIL ACTIVE DISPLAY */ while (!gfx_test_vertical_active()); /* RESET CRC DURING ACTIVE DISPLAY */ WRITE_VID32(CS5530_CRCSIG_TFT_TV, 0); WRITE_VID32(CS5530_CRCSIG_TFT_TV, 1); /* WAIT UNTIL NOT ACTIVE, THEN ACTIVE, NOT ACTIVE, THEN ACTIVE */ while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); crc = READ_VID32(CS5530_CRCSIG_TFT_TV) >> 8; } return (crc); } #endif /* GFX_READ_ROUTINES */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_dcdr.c0000644000175000017500000003441212654445443015103 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to control the video decoder. * * gfx_set_decoder_defaults * gfx_set_decoder_analog_input * gfx_set_decoder_brightness * gfx_set_decoder_contrast * gfx_set_decoder_luminance_filter * gfx_set_decoder_hue * gfx_set_decoder_saturation * gfx_set_decoder_input_offset * gfx_set_decoder_input_size * gfx_set_decoder_output_size * gfx_set_decoder_scale * gfx_set_decoder_TV_standard * gfx_set_decoder_vbi_enable * gfx_set_decoder_vbi_format * gfx_set_decoder_vbi_upscale * gfx_decoder_software_reset * gfx_decoder_detect_macrovision * gfx_decoder_detect_video * * And the following routines if GFX_READ_ROUTINES is set: * * gfx_get_decoder_brightness * gfx_get_decoder_contrast * gfx_get_decoder_hue * gfx_get_decoder_saturation * gfx_get_decoder_input_offset * gfx_get_decoder_input_size * gfx_get_decoder_output_size * gfx_get_decoder_vbi_format */ /* INCLUDE SUPPORT FOR PHILIPS SAA7114 DECODER, IF SPECIFIED */ #if GFX_DECODER_SAA7114 #include "saa7114.c" #endif /* WRAPPERS IF DYNAMIC SELECTION */ /* Extra layer to call various decoders. Currently only the Pillips */ /* decoder is supported, but still organized to easily expand later. */ #if GFX_DECODER_DYNAMIC /*---------------------------------------------------------------------------- * gfx_set_decoder_defaults *---------------------------------------------------------------------------- */ int gfx_set_decoder_defaults(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_defaults(); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_analog_input *---------------------------------------------------------------------------- */ int gfx_set_decoder_analog_input(unsigned char input) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_analog_input(input); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_brightness *---------------------------------------------------------------------------- */ int gfx_set_decoder_brightness(unsigned char brightness) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_brightness(brightness); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_contrast *---------------------------------------------------------------------------- */ int gfx_set_decoder_contrast(unsigned char contrast) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_contrast(contrast); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_hue *---------------------------------------------------------------------------- */ int gfx_set_decoder_hue(char hue) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_hue(hue); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_saturation *---------------------------------------------------------------------------- */ int gfx_set_decoder_saturation(unsigned char saturation) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_saturation(saturation); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_input_offset *---------------------------------------------------------------------------- */ int gfx_set_decoder_input_offset(unsigned short x, unsigned short y) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_input_offset(x, y); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_input_size *---------------------------------------------------------------------------- */ int gfx_set_decoder_input_size(unsigned short width, unsigned short height) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_input_size(width, height); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_output_size *---------------------------------------------------------------------------- */ int gfx_set_decoder_output_size(unsigned short width, unsigned short height) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_output_size(width, height); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_scale *---------------------------------------------------------------------------- */ int gfx_set_decoder_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_scale(srcw, srch, dstw, dsth); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_vbi_format *---------------------------------------------------------------------------- */ int gfx_set_decoder_vbi_format(int start, int end, int format) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_vbi_format(start, end, format); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_vbi_enable *---------------------------------------------------------------------------- */ int gfx_set_decoder_vbi_enable(int enable) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_vbi_enable(enable); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_vbi_upscale *---------------------------------------------------------------------------- */ int gfx_set_decoder_vbi_upscale(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_vbi_upscale(); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_TV_standard *---------------------------------------------------------------------------- */ int gfx_set_decoder_TV_standard(TVStandardType TVStandard) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_TV_standard(TVStandard); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_decoder_luminance_filter *---------------------------------------------------------------------------- */ int gfx_set_decoder_luminance_filter(unsigned char lufi) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_set_decoder_luminance_filter(lufi); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_decoder_software_reset *---------------------------------------------------------------------------- */ int gfx_decoder_software_reset(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_decoder_software_reset(); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_decoder_detect_macrovision *---------------------------------------------------------------------------- */ int gfx_decoder_detect_macrovision(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_decoder_detect_macrovision(); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_decoder_detect_video *---------------------------------------------------------------------------- */ int gfx_decoder_detect_video(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) status = saa7114_decoder_detect_video(); #endif return (status); } /*************************************************************/ /* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ /*************************************************************/ #if GFX_READ_ROUTINES /*---------------------------------------------------------------------------- * gfx_get_decoder_brightness *---------------------------------------------------------------------------- */ unsigned char gfx_get_decoder_brightness(void) { unsigned char brightness = 0; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) brightness = saa7114_get_decoder_brightness(); #endif return (brightness); } /*---------------------------------------------------------------------------- * gfx_get_decoder_contrast *---------------------------------------------------------------------------- */ unsigned char gfx_get_decoder_contrast(void) { unsigned char contrast = 0; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) contrast = saa7114_get_decoder_contrast(); #endif return (contrast); } /*---------------------------------------------------------------------------- * gfx_get_decoder_hue *---------------------------------------------------------------------------- */ char gfx_get_decoder_hue(void) { unsigned char hue = 0; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) hue = saa7114_get_decoder_hue(); #endif return ((char) hue); } /*---------------------------------------------------------------------------- * gfx_get_decoder_saturation *---------------------------------------------------------------------------- */ unsigned char gfx_get_decoder_saturation(void) { unsigned char saturation = 0; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) saturation = saa7114_get_decoder_saturation(); #endif return (saturation); } /*---------------------------------------------------------------------------- * gfx_get_decoder_input_offset *---------------------------------------------------------------------------- */ unsigned long gfx_get_decoder_input_offset() { unsigned long offset = 0; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) offset = saa7114_get_decoder_input_offset(); #endif return (offset); } /*---------------------------------------------------------------------------- * gfx_get_decoder_input_size *---------------------------------------------------------------------------- */ unsigned long gfx_get_decoder_input_size() { unsigned long size = 0; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) size = saa7114_get_decoder_input_size(); #endif return (size); } /*---------------------------------------------------------------------------- * gfx_get_decoder_output_size *---------------------------------------------------------------------------- */ unsigned long gfx_get_decoder_output_size() { unsigned long size = 0; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) size = saa7114_get_decoder_output_size(); #endif return (size); } /*---------------------------------------------------------------------------- * gfx_get_decoder_vbi_format *---------------------------------------------------------------------------- */ int gfx_get_decoder_vbi_format(int line) { int format = 0; #if GFX_DECODER_SAA7114 if (gfx_decoder_type == GFX_DECODER_SAA7114) format = saa7114_get_decoder_vbi_format(line); #endif return (format); } #endif /* GFX_READ_ROUTINES */ #endif /* GFX_DECODER_DYNAMIC */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/msr_rdcl.c0000644000175000017500000005203512654445443015131 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains MSR access routines for Redcloud. * */ void redcloud_build_mbus_tree(void); /* private routine definition */ int redcloud_init_msr_devices(MSR aDev[], unsigned int array_size); /* private routine definition */ DEV_STATUS redcloud_find_msr_device(MSR * pDev); /* private routine definition */ /* REDCLOUD MSR BITMASKS */ #define MBD_MSR_CAP 0x2000 #define MSR_CAP_ID_MASK 0xFF000 #define MSR_CAP_ID_SHIFT 12 #define MSR_CAP_REV_MASK 0x0F #define MBIU_CAP 0x86 #define NUM_PORTS_MASK 0x00380000 #define NUM_PORTS_SHIFT 19 #define MBIU_WHOAMI 0x8B #define WHOAMI_MASK 0x07 /* REDCLOUD and CS5535 MSR DEVICES */ MSR msrDev[] = { {FOUND, RC_CC_MBIU, RC_MB0_MBIU0}, {FOUND, RC_CC_MBIU, RC_MB0_MBIU1}, {NOT_KNOWN, RC_CC_MCP, FAKE_ADDRESS}, {NOT_KNOWN, RC_CC_MPCI, FAKE_ADDRESS}, {NOT_KNOWN, RC_CC_MC, FAKE_ADDRESS}, {NOT_KNOWN, RC_CC_GP, FAKE_ADDRESS}, {NOT_KNOWN, RC_CC_VG, FAKE_ADDRESS}, {NOT_KNOWN, RC_CC_DF, FAKE_ADDRESS}, {NOT_KNOWN, RC_CC_FG, FAKE_ADDRESS}, {FOUND, RC_CC_VA, RC_MB0_CPU}, {FOUND, CP_CC_MBIU, CP_MB0_MBIU0}, {NOT_KNOWN, CP_CC_MPCI, FAKE_ADDRESS}, {NOT_KNOWN, CP_CC_USB2, FAKE_ADDRESS}, {NOT_KNOWN, CP_CC_ATAC, FAKE_ADDRESS}, {NOT_KNOWN, CP_CC_MDD, FAKE_ADDRESS}, {NOT_KNOWN, CP_CC_ACC, FAKE_ADDRESS}, {NOT_KNOWN, CP_CC_USB1, FAKE_ADDRESS}, {NOT_KNOWN, CP_CC_MCP, FAKE_ADDRESS}, }; #define NUM_DEVS sizeof(msrDev) / sizeof(struct msr) /* CAPISTRANO DEVICE INDEX LIMITS */ /* These defines represent the start and stop indexes into the device array * for all Capistrano devices. These should be updated whenever a device is * added or removed to the Capistrano list. * */ #define CP_INDEX_START CP_ID_MBIU #define CP_INDEX_STOP CP_ID_MCP /* GLOBAL MBUS CACHE STRUCTURES */ /* These structures contain a "cached" copy of the MBUS topology */ /* for easy future lookup. */ MBUS_NODE MBIU0[8], MBIU1[8], MBIU2[8]; /* REGISTER MACROS */ #define GET_DEVICE_ID( CAPABILITIES_HIGH, CAPABILITIES_LOW ) \ ((unsigned int)(( (CAPABILITIES_LOW) & MSR_CAP_ID_MASK ) >> MSR_CAP_ID_SHIFT )) #define GET_NUM_PORTS( MBIU_CAP_HIGH, MBIU_CAP_LOW ) (((MBIU_CAP_HIGH) & NUM_PORTS_MASK ) >> NUM_PORTS_SHIFT) /*---------------------------------------------------------------------------- * gfx_msr_init * * This routine initializes the base addresses of all known MBUS devices. *---------------------------------------------------------------------------- */ #if GFX_MSR_DYNAMIC int redcloud_msr_init(void) #else int gfx_msr_init(void) #endif { Q_WORD msrValue; int return_value = 1; /* CHECK FOR VALID MBUS CONFIGURATION */ /* The CPU and the two MBIUs are assumed to be at known static addresses, * so we will check the device IDs at these addresses as proof of a valid * mbus configuration. * */ MSR_READ(MBD_MSR_CAP, RC_MB0_CPU, &(msrValue.high), &(msrValue.low)); if (GET_DEVICE_ID(msrValue.high, msrValue.low) != RC_CC_VA) return_value = 0; MSR_READ(MBD_MSR_CAP, RC_MB0_MBIU0, &(msrValue.high), &(msrValue.low)); if (GET_DEVICE_ID(msrValue.high, msrValue.low) != RC_CC_MBIU) return_value = 0; MSR_READ(MBD_MSR_CAP, RC_MB0_MBIU1, &(msrValue.high), &(msrValue.low)); if (GET_DEVICE_ID(msrValue.high, msrValue.low) != RC_CC_MBIU) return_value = 0; /* ENUMERATE VALID BUS */ /* If all static devices were identified, continue with the enumeration */ if (return_value) { /* OPTIMIZATION */ /* Build a local copy of the MBUS topology. This allows us to */ /* quickly search the entire MBUS for a given device ID without */ /* repeated MSR accesses. */ redcloud_build_mbus_tree(); /* INITIALIZE MSR DEVICES */ return_value = redcloud_init_msr_devices(msrDev, NUM_DEVS); } return return_value; } /*-------------------------------------------------------------------------- * void redcloud_build_mbus_tree() (PRIVATE ROUTINE - NOT PART OF DURANGO API) * * This routine walks through the MBUS and records the address value and * device ID found at each node. If a node (aka port) is not populated, * that node returns '0'. The deviceID for that node is set to '0' * (NOT_POPULATED) to reflect this. If the node being queried points back to * Vail or MBIU0, the deviceID for that node is set to 'REFLECTIVE'. * Reflective nodes are nodes that forward the given MBUS address BACK to the * initiator. *---------------------------------------------------------------------------- */ void redcloud_build_mbus_tree(void) { unsigned long mbiu_port_count, reflective; unsigned long port; Q_WORD msrValue; /* */ /* ENUMERATE MBIU0 */ /* */ /* COUNT MBIU PORTS */ MSR_READ(MBIU_CAP, RC_MB0_MBIU0, &(msrValue.high), &(msrValue.low)); mbiu_port_count = GET_NUM_PORTS(msrValue.high, msrValue.low); /* FIND REFLECTIVE PORT */ /* Query the MBIU for the port through which we are communicating. */ /* We will avoid accesses to this port to avoid a self-reference. */ MSR_READ(MBIU_WHOAMI, RC_MB0_MBIU0, &(msrValue.high), &(msrValue.low)); reflective = msrValue.low & WHOAMI_MASK; /* ENUMERATE ALL PORTS */ /* For every possible port, set the MBIU.deviceId to something. */ for (port = 0; port < 8; port++) { /* FILL IN CLAIMED FIELD */ /* All MBIU ports can only be assigned to one device from the */ /* Durango table */ MBIU0[port].claimed = 0; /* MBIU0 PORT NUMBERS ARE IN ADDRESS BITS 31:29 */ MBIU0[port].address = port << 29; /* SPECIAL CASE FOR MBIU0 */ /* MBIU0 port 0 is a special case, as it points back to MBIU0. MBIU0 * responds at address 0x40000xxx, which does not equal 0 << 29. * */ if (port == 0) MBIU0[port].deviceId = RC_CC_MBIU; else if (port == reflective) MBIU0[port].deviceId = REFLECTIVE; else if (port > mbiu_port_count) MBIU0[port].deviceId = NOT_POPULATED; else { MSR_READ(MBD_MSR_CAP, MBIU0[port].address, &(msrValue.high), &(msrValue.low)); MBIU0[port].deviceId = GET_DEVICE_ID(msrValue.high, msrValue.low); } } /* */ /* ENUMERATE MBIU1 */ /* */ /* COUNT MBIU PORTS */ MSR_READ(MBIU_CAP, RC_MB0_MBIU1, &(msrValue.high), &(msrValue.low)); mbiu_port_count = GET_NUM_PORTS(msrValue.high, msrValue.low); /* FIND REFLECTIVE PORT */ /* Query the MBIU for the port through which we are communicating. */ /* We will avoid accesses to this port to avoid a self-reference. */ MSR_READ(MBIU_WHOAMI, RC_MB0_MBIU1, &(msrValue.high), &(msrValue.low)); reflective = msrValue.low & WHOAMI_MASK; /* ENUMERATE ALL PORTS */ /* For every possible port, set the MBIU.deviceId to something. */ for (port = 0; port < 8; port++) { /* FILL IN CLAIMED FIELD */ /* All MBIU ports can only be assigned to one device from the */ /* Durango table */ MBIU1[port].claimed = 0; /* MBIU1 PORT NUMBERS ARE IN 28:26 AND 31:29 = 010B */ MBIU1[port].address = (0x02l << 29) + (port << 26); if (port == reflective) MBIU1[port].deviceId = REFLECTIVE; else if (port > mbiu_port_count) MBIU1[port].deviceId = NOT_POPULATED; else { MSR_READ(MBD_MSR_CAP, MBIU1[port].address, &(msrValue.high), &(msrValue.low)); MBIU1[port].deviceId = GET_DEVICE_ID(msrValue.high, msrValue.low); } } /* */ /* ENUMERATE MBIU2 (CS5535) */ /* (if present) */ MSR_READ(MBD_MSR_CAP, CP_MB0_MBIU0, &(msrValue.high), &(msrValue.low)); if (GET_DEVICE_ID(msrValue.high, msrValue.low) == CP_CC_MBIU) { /* COUNT MBIU PORTS */ MSR_READ(MBIU_CAP, CP_MB0_MBIU0, &(msrValue.high), &(msrValue.low)); mbiu_port_count = GET_NUM_PORTS(msrValue.high, msrValue.low); /* FIND REFLECTIVE PORT */ /* Query the MBIU for the port through which we are communicating. */ /* We will avoid accesses to this port to avoid a self-reference. */ MSR_READ(MBIU_WHOAMI, CP_MB0_MBIU0, &(msrValue.high), &(msrValue.low)); reflective = msrValue.low & WHOAMI_MASK; /* ENUMERATE ALL PORTS */ /* For every possible port, set the MBIU.deviceId to something. */ for (port = 0; port < 8; port++) { /* FILL IN CLAIMED FIELD */ /* All MBIU ports can only be assigned to one device from the */ /* Durango table */ MBIU2[port].claimed = 0; /* MBIU2 PORT NUMBERS ARE IN 22:20 AND 31:23 = 010100010B */ MBIU2[port].address = (0x02l << 29) + (0x04l << 26) + (0x02l << 23) + (port << 20); if (port == reflective) MBIU2[port].deviceId = REFLECTIVE; else if (port > mbiu_port_count) MBIU2[port].deviceId = NOT_POPULATED; else { MSR_READ(MBD_MSR_CAP, MBIU2[port].address, &(msrValue.high), &(msrValue.low)); MBIU2[port].deviceId = GET_DEVICE_ID(msrValue.high, msrValue.low); } } } else { /* NO 5535 */ /* If the CS5535 is not installed, fill in the cached table */ /* with the 'NOT_INSTALLED' flag. Also, fill in the device */ /* status from NOT_KNOWN to REQ_NOT_INSTALLED. */ for (port = 0; port < 8; port++) { MBIU2[port].claimed = 0; MBIU2[port].deviceId = NOT_INSTALLED; MBIU2[port].address = (0x02l << 29) + (0x04l << 26) + (0x02l << 23) + (port << 20); } for (port = CP_INDEX_START; port <= CP_INDEX_STOP; port++) { msrDev[port].Present = REQ_NOT_INSTALLED; } } } /*------------------------------------------------------------------ * redcloud_init_msr_devices (PRIVATE ROUTINE - NOT PART OF DURANGO API) * * Handles the details of finding each possible device on the MBUS. * If a given device is not found, its structure is left uninitialized. * If a given device is found, its structure is updated. * * This init routine only checks for devices in aDev[]. * * Passed: * aDev - is a pointer to the array of MBUS devices. * arraySize - number of elements in aDev. * * Returns: * 1 - If, for every device, its address was found. * 0 - If, for any device, an error was encountered. *------------------------------------------------------------------ */ int redcloud_init_msr_devices(MSR aDev[], unsigned int array_size) { unsigned int i, issues = 0; /* TRY TO FIND EACH ITEM IN THE ARRAY */ for (i = 0; i < array_size; i++) { /* IGNORE DEVICES THAT ARE ALREADY FOUND */ /* The addresses for "found" devices are already known. */ if (aDev[i].Present == FOUND || aDev[i].Present == REQ_NOT_INSTALLED) continue; /* TRY TO FIND THE DEVICE ON THE MBUS */ aDev[i].Present = redcloud_find_msr_device(&aDev[i]); /* INCREMENT ERROR COUNT IF DEVICE NOT FOUND */ if (aDev[i].Present != FOUND) issues++; } return (issues == 0); } /*------------------------------------------------------------------ * redcloud_find_msr_device (PRIVATE ROUTINE - NOT PART OF DURANGO API) * * Passed: * pDev - is a pointer to one element in the array of MBUS devices * * Returns: * FOUND - Device was found and pDev->Address has been updated. * * REQ_NOT_FOUND - Device was not found and pDev->Address has not * been updated. * *------------------------------------------------------------------ */ DEV_STATUS redcloud_find_msr_device(MSR * pDev) { unsigned int i; /* SEARCH DURANGO'S CACHED MBUS TOPOLOGY */ /* This gets a little tricky. As the only identifier we have for each * device is the device ID and we have multiple devices of the same type * MCP, MPCI, USB, etc. we need to make some assumptions based on table * order. These are as follows: * 1. All Redcloud nodes are searched first, as we assume that they * are first in the table. * 2. If two devices have the same device ID and are found on the same * device (GX2, CS5535, etc.) we assume that they are listed such * that the first device in the table with this device ID has a lower * port address. * 3. After a device ID has been matched, the port is marked as * 'claimed', such that future enumerations continue searching the * GeodeLink topology. */ /* SEARCH MBIU0 */ for (i = 0; i < 8; i++) { if (MBIU0[i].deviceId == pDev->Id && !(MBIU0[i].claimed)) { MBIU0[i].claimed = 1; pDev->Address = MBIU0[i].address; return FOUND; } } /* SEARCH MBIU1 */ for (i = 0; i < 8; i++) { if (MBIU1[i].deviceId == pDev->Id && !(MBIU1[i].claimed)) { MBIU1[i].claimed = 1; pDev->Address = MBIU1[i].address; return FOUND; } } /* SEARCH MBIU2 */ for (i = 0; i < 8; i++) { if (MBIU2[i].deviceId == pDev->Id && !(MBIU2[i].claimed)) { MBIU2[i].claimed = 1; pDev->Address = MBIU2[i].address; return FOUND; } } return REQ_NOT_FOUND; } /*-------------------------------------------------------------------- * gfx_id_msr_device * * This routine handles reading the capabilities MSR register (typically * 0x2000) and checking if the 'id' field matchs pDev.Id. This routine is * used by applications/drivers that need to extend the list of known * MBUS devices beyond those known by Durango. * * Passed: * pDev - Pointer to MSR structure containing the device's ID. * address - device address. * * Returns: * FOUND - The IDs do match. * REQ_NOT_FOUND - There was not a match. * *-------------------------------------------------------------------- */ #if GFX_MSR_DYNAMIC DEV_STATUS redcloud_id_msr_device(MSR * pDev, unsigned long address) #else DEV_STATUS gfx_id_msr_device(MSR * pDev, unsigned long address) #endif { Q_WORD msrValue; MSR_READ(MBD_MSR_CAP, address, &(msrValue.high), &(msrValue.low)); if (GET_DEVICE_ID(msrValue.high, msrValue.low) == pDev->Id) return FOUND; else return REQ_NOT_FOUND; } /*-------------------------------------------------------------------- * gfx_get_msr_dev_address * * This function returns the 32-bit address of the requested device. * The device must be a known MBUS device. (It must be in Durango's * device table.) DEV_STATUS should be checked to verify that the address * was updated. * * * Passed: * device - device index of the device in question. * *address - ptr to location where address should be stored. * * Returns: * DEV_STATUS of device in question. (NOT_KNOWN if device is out of range.) * *address - updated if 'device' is within range * * Notes: * This function should only be called after gfx_msr_init * *-------------------------------------------------------------------- */ #if GFX_MSR_DYNAMIC DEV_STATUS redcloud_get_msr_dev_address(unsigned int device, unsigned long *address) #else DEV_STATUS gfx_get_msr_dev_address(unsigned int device, unsigned long *address) #endif { if (device < NUM_DEVS) { if (msrDev[device].Present == FOUND) *address = msrDev[device].Address; return msrDev[device].Present; } return NOT_KNOWN; } /*-------------------------------------------------------------------- * gfx_get_glink_id_at_address * * This function returns the 16-bit deviceId at the requested address. * DEV_STATUS should be checked to make sure that device was updated. * * Passed: * device - ptr to location where device ID should be stored. * address - address of desired device ID. * * Returns: * FOUND if address is a valid address, NOT_KNOWN if address cannot be * found on the mbus. * *device - updated with device Id info. * * Notes: * This function should be called after gfx_msr_init * *-------------------------------------------------------------------- */ #if GFX_MSR_DYNAMIC DEV_STATUS redcloud_get_glink_id_at_address(unsigned int *device, unsigned long address) #else DEV_STATUS gfx_get_glink_id_at_address(unsigned int *device, unsigned long address) #endif { int port; for (port = 0; port < 8; port++) { if (MBIU0[port].address == address) { *device = MBIU0[port].deviceId; return FOUND; } else if (MBIU1[port].address == address) { *device = MBIU1[port].deviceId; return FOUND; } else if (MBIU2[port].address == address) { *device = MBIU2[port].deviceId; return FOUND; } } return NOT_KNOWN; } /*-------------------------------------------------------------------- * gfx_msr_read * * Performs a 64-bit read from 'msrRegister' in device 'device'. 'device' is * an index into Durango's table of known MBUS devices. * * Returns: * FOUND - if no errors were detected and msrValue has been * updated. * NOT_KNOWN - an error was detected. msrValue is not updated. * REQ_NOT_FOUND - 'msrAddress' for 'devID' is unknown. Caller * should call msrInit() first. msrValue is not * updated. * Notes: * This function should be called after gfx_msr_init *-------------------------------------------------------------------- */ #if GFX_MSR_DYNAMIC DEV_STATUS redcloud_msr_read(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue) #else DEV_STATUS gfx_msr_read(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue) #endif { if (device < NUM_DEVS) { if (msrDev[device].Present == FOUND) MSR_READ(msrRegister, msrDev[device].Address, &(msrValue->high), &(msrValue->low)); return msrDev[device].Present; } return NOT_KNOWN; } /*-------------------------------------------------------------------- * gfx_msr_write * * Performs a 64-bit write to 'msrRegister' in device 'devID'. * * Returns: * FOUND - if no errors were detected and msrValue has been * updated. * NOT_KNOWN - an error was detected. msrValue is not updated. * REQ_NOT_FOUND - 'msrAddress' for 'devID' is unknown. Caller * should call msrInit() first. msrValue is not * updated. * *Notes: * This function is valid to call after initMSR_API() * *-------------------------------------------------------------------- */ #if GFX_MSR_DYNAMIC DEV_STATUS redcloud_msr_write(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue) #else DEV_STATUS gfx_msr_write(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue) #endif { if (device < NUM_DEVS) { if (msrDev[device].Present == FOUND) MSR_WRITE(msrRegister, msrDev[device].Address, &(msrValue->high), &(msrValue->low)); return msrDev[device].Present; } return NOT_KNOWN; } xf86-video-geode-2.11.18/src/gfx/rndr_gu2.c0000644000175000017500000022365412654445443015055 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to program the 2D acceleration hardware for * the second generation graphics unit. * * Basic rendering routines (common to all Geode processors): * gfx_set_bpp * gfx_set_solid_pattern * gfx_set_mono_pattern * gfx_set_color_pattern * gfx_set_solid_source * gfx_set_mono_source * gfx_set_raster_operation * gfx_pattern_fill * gfx_color_pattern_fill * gfx_screen_to_screen_blt * gfx_screen_to_screen_xblt * gfx_color_bitmap_to_screen_blt * gfx_color_bitmap_to_screen_xblt * gfx_mono_bitmap_to_screen_blt * gfx_bresenham_line * gfx_wait_until_idle * * Extended rendering routines for second generation functionality: * gfx2_set_source_stride * gfx2_set_destination_stride * gfx2_set_pattern_origins * gfx2_set_source_transparency * gfx2_set_alpha_mode * gfx2_set_alpha_value * gfx2_pattern_fill * gfx2_color_pattern_fill * gfx2_screen_to_screen_blt * gfx2_mono_expand_blt * gfx2_color_bitmap_to_screen_blt * gfx2_mono_bitmap_to_screen_blt * gfx2_bresenham_line * gfx2_sync_to_vblank * */ #define GU2_WAIT_PENDING \ while(READ_GP32(MGP_BLT_STATUS) & MGP_BS_BLT_PENDING) #define GU2_WAIT_BUSY \ while(READ_GP32(MGP_BLT_STATUS) & MGP_BS_BLT_BUSY) #define GU2_WAIT_HALF_EMPTY \ while(!(READ_GP32(MGP_BLT_STATUS) & MGP_BS_HALF_EMPTY)) /* PATTERN SWIZZLES */ #define WORD_SWIZZLE(x) (((x) << 16) | ((x) >> 16)) #define BYTE_SWIZZLE(x) (((x) << 24) | ((x) >> 24) | (((x) << 8) & \ 0x00FF0000) | (((x) >> 8) & 0x0000FF00)) /* GLOBAL VARIABLES USED BY THE RENDERING ROUTINES */ unsigned long gu2_bpp; unsigned long gu2_pitch = 1280; unsigned long gu2_src_pitch = 1280; unsigned long gu2_dst_pitch = 1280; unsigned long gu2_xshift = 1; unsigned long gu2_pattern_origin = 0; unsigned long gu2_rop32; unsigned long gu2_alpha32 = 0; unsigned long gu2_alpha_value = 0; unsigned long gu2_alpha_mode = 0; unsigned long gu2_alpha_active = 0; unsigned short gu2_alpha_blt_mode = 0; unsigned short gu2_alpha_vec_mode = 0; unsigned short gu2_blt_mode = 0; unsigned short gu2_vector_mode = 0; unsigned short gu2_bm_throttle = 0; unsigned short gu2_vm_throttle = 0; int gu2_current_line = 0; /* Kill a warning */ void gfx_reset_pitch(unsigned short pitch); /*--------------------------------------------------------------------------- * GFX_RESET_PITCH (PRIVATE ROUTINE - NOT PART OF API) * * This routine resets all pitches in the graphics engine to one value. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_reset_pitch(unsigned short pitch) #else void gfx_reset_pitch(unsigned short pitch) #endif { gu2_pitch = pitch; gu2_dst_pitch = pitch; gu2_src_pitch = pitch; } /*--------------------------------------------------------------------------- * GFX_SET_BPP * * This routine sets the bits per pixel value in the graphics engine. * It is also stored in the static variable "gu2_bpp" to use in the future * calls to the rendering routines. That variable contains the hardware * specific value to load into the MGP_RASTER_MODE register. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_set_bpp(unsigned short bpp) #else void gfx_set_bpp(unsigned short bpp) #endif { GFXbpp = bpp; /* COVERT TO BPP/FORMAT VALUE */ /* Save in global to combine with ROP later. */ /* Could write register here and then use byte access for */ /* the ROP, but would need to set other 24 bits to make */ /* sure all are set to their appropriate values. */ switch (bpp) { case 8: gu2_bpp = MGP_RM_BPPFMT_332; gu2_xshift = 0; break; case 12: gu2_bpp = MGP_RM_BPPFMT_4444; gu2_xshift = 1; break; case 15: gu2_bpp = MGP_RM_BPPFMT_1555; gu2_xshift = 1; break; case 16: gu2_bpp = MGP_RM_BPPFMT_565; gu2_xshift = 1; break; case 32: gu2_bpp = MGP_RM_BPPFMT_8888; gu2_xshift = 2; break; } /* SET INITIAL ROP BASED ONLY ON BPP */ /* Needs to be set before loading any pattern or source colors. */ /* We must wait for BUSY because these bits are not pipelined */ /* in the hardware. */ GU2_WAIT_BUSY; WRITE_GP32(MGP_RASTER_MODE, gu2_bpp); } /* *--------------------------------------------------------------------------- * GFX_SET_SOLID_SOURCE * * This routine is used to specify a solid source color. For the Xfree96 * display driver, the source color is used to specify a planemask and the * ROP is adjusted accordingly. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_set_solid_source(unsigned long color) #else void gfx_set_solid_source(unsigned long color) #endif { /* CLEAR TRANSPARENCY FLAG */ GFXsourceFlags = 0; /* WRITE REGISTERS TO SPECIFY SOURCE COLOR */ GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_COLOR_FG, color); } /* *--------------------------------------------------------------------------- * GFX_SET_MONO_SOURCE * * This routine is used to specify the monochrome source colors. * It must be called *after* loading any pattern data (those routines * clear the source flags). *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, unsigned short transparent) #else void gfx_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, unsigned short transparent) #endif { /* SET TRANSPARENCY FLAG */ GFXsourceFlags = transparent ? MGP_RM_SRC_TRANS : 0; /* WRITE COLOR VALUES */ GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_COLOR_FG, fgcolor); WRITE_GP32(MGP_SRC_COLOR_BG, bgcolor); } /* *--------------------------------------------------------------------------- * GFX_SET_SOLID_PATTERN * * This routine is used to specify a solid pattern color. It is called * before performing solid rectangle fills or more complicated BLTs that * use a solid pattern color. * * The driver should always call "gfx_load_raster_operation" after a call * to this routine to make sure that the pattern flags are set appropriately. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_set_solid_pattern(unsigned long color) #else void gfx_set_solid_pattern(unsigned long color) #endif { /* CLEAR TRANSPARENCY FLAG */ GFXsourceFlags = 0; /* SET PATTERN FLAGS */ GFXpatternFlags = 0; /* POLL UNTIL ABLE TO WRITE THE PATTERN COLOR */ GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, gu2_bpp); WRITE_GP32(MGP_PAT_COLOR_0, color); } /* *--------------------------------------------------------------------------- * GFX_SET_MONO_PATTERN * * This routine is used to specify a monochrome pattern. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned char transparent) #else void gfx_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned char transparent) #endif { /* CLEAR TRANSPARENCY FLAG */ GFXsourceFlags = 0; /* SET PATTERN FLAGS */ if (transparent) GFXpatternFlags = MGP_RM_PAT_MONO | MGP_RM_PAT_TRANS; else GFXpatternFlags = MGP_RM_PAT_MONO; /* POLL UNTIL ABLE TO WRITE THE PATTERN COLOR */ GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, gu2_bpp | GFXpatternFlags); WRITE_GP32(MGP_PAT_COLOR_0, bgcolor); WRITE_GP32(MGP_PAT_COLOR_1, fgcolor); WRITE_GP32(MGP_PAT_DATA_0, data0); WRITE_GP32(MGP_PAT_DATA_1, data1); } /* *--------------------------------------------------------------------------- * GFX_SET_COLOR_PATTERN * * This routine is used to specify a color pattern. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned long data2, unsigned long data3, unsigned char transparent) #else void gfx_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned long data2, unsigned long data3, unsigned char transparent) #endif { /* REMOVE */ } /* *--------------------------------------------------------------------------- * GFX_LOAD_COLOR_PATTERN_LINE * * This routine is used to load a single line of a 8x8 color pattern. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_load_color_pattern_line(short y, unsigned long *pattern_8x8) #else void gfx_load_color_pattern_line(short y, unsigned long *pattern_8x8) #endif { unsigned long temp1, temp2, temp3, temp4; /* CLEAR TRANSPARENCY FLAG */ GFXsourceFlags = 0; /* SET PATTERN FLAGS */ GFXpatternFlags = MGP_RM_PAT_COLOR; /* OVERRIDE THE RASTER MODE REGISTER */ /* If the pattern format is set to anything but color */ /* before loading the registers, some of the data will */ /* be duplicated according to the current mode. */ GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, (gu2_rop32 & ~MGP_RM_PAT_FLAGS) | MGP_RM_PAT_COLOR); /* LOAD THE PATTERN DATA */ /* This routine is designed to work in tandem with gfx_pattern_fill. */ /* It is used for cases when multiple BLTs with color pattern data */ /* are desired on the same line. It would be inefficient to */ /* repeatedly call gfx_color_pattern_fill for each single-line BLT. */ /* So, we will simply replicate the pattern data across all available */ /* lines such that the pattern y origin plays no part in the BLT. */ /* 8 BPP */ if (gu2_xshift == 0) { pattern_8x8 += (y & 7) << 1; temp1 = BYTE_SWIZZLE(pattern_8x8[0]); temp2 = BYTE_SWIZZLE(pattern_8x8[1]); WRITE_GP32(MGP_PAT_DATA_1, temp1); WRITE_GP32(MGP_PAT_DATA_0, temp2); WRITE_GP32(MGP_PAT_COLOR_1, temp1); WRITE_GP32(MGP_PAT_COLOR_0, temp2); GU2_WAIT_BUSY; WRITE_GP32(MGP_PAT_COLOR_3, temp1); WRITE_GP32(MGP_PAT_COLOR_2, temp2); WRITE_GP32(MGP_PAT_COLOR_5, temp1); WRITE_GP32(MGP_PAT_COLOR_4, temp2); } else if (gu2_xshift == 1) { pattern_8x8 += (y & 7) << 2; temp1 = WORD_SWIZZLE(pattern_8x8[0]); temp2 = WORD_SWIZZLE(pattern_8x8[1]); temp3 = WORD_SWIZZLE(pattern_8x8[2]); temp4 = WORD_SWIZZLE(pattern_8x8[3]); WRITE_GP32(MGP_PAT_COLOR_1, temp1); WRITE_GP32(MGP_PAT_COLOR_0, temp2); WRITE_GP32(MGP_PAT_DATA_1, temp3); WRITE_GP32(MGP_PAT_DATA_0, temp4); GU2_WAIT_BUSY; WRITE_GP32(MGP_PAT_COLOR_5, temp1); WRITE_GP32(MGP_PAT_COLOR_4, temp2); WRITE_GP32(MGP_PAT_COLOR_3, temp3); WRITE_GP32(MGP_PAT_COLOR_2, temp4); } else { pattern_8x8 += (y & 7) << 3; WRITE_GP32(MGP_PAT_COLOR_1, pattern_8x8[4]); WRITE_GP32(MGP_PAT_COLOR_0, pattern_8x8[5]); WRITE_GP32(MGP_PAT_DATA_1, pattern_8x8[6]); WRITE_GP32(MGP_PAT_DATA_0, pattern_8x8[7]); GU2_WAIT_BUSY; WRITE_GP32(MGP_PAT_COLOR_5, pattern_8x8[0]); WRITE_GP32(MGP_PAT_COLOR_4, pattern_8x8[1]); WRITE_GP32(MGP_PAT_COLOR_3, pattern_8x8[2]); WRITE_GP32(MGP_PAT_COLOR_2, pattern_8x8[3]); } } /* *--------------------------------------------------------------------------- * GFX_SET_RASTER_OPERATION * * This routine loads the specified raster operation. It sets the pattern * flags appropriately. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_set_raster_operation(unsigned char rop) #else void gfx_set_raster_operation(unsigned char rop) #endif { gu2_blt_mode = 0; /* DISABLE ALPHA BLENDING */ gu2_alpha_active = 0; /* GENERATE 32-BIT VERSION OF ROP WITH PATTERN FLAGS */ gu2_rop32 = (unsigned long) rop | GFXpatternFlags | gu2_bpp; /* CHECK IF SOURCE FLAGS SHOULD BE MERGED */ if ((rop & 0x33) ^ ((rop >> 2) & 0x33)) gu2_rop32 |= GFXsourceFlags; else gu2_blt_mode = 0x40; /* SET FLAG INDICATING ROP REQUIRES DESTINATION DATA */ /* True if even bits (0:2:4:6) do not equal the corresponding */ /* even bits (1:3:5:7). */ if ((rop & 0x55) ^ ((rop >> 1) & 0x55)) { gu2_blt_mode |= MGP_BM_DST_REQ; gu2_vector_mode = MGP_VM_DST_REQ; } else { gu2_vector_mode = 0; } } /* *---------------------------------------------------------------------------- * GFX_PATTERN_FILL * * This routine is used to fill a rectangular region. The pattern must * be previously loaded using one of GFX_load_*_pattern routines. Also, the * raster operation must be previously specified using the * "GFX_load_raster_operation" routine. * * X screen X position (left) * Y screen Y position (top) * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height) #else void gfx_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height) #endif { unsigned long offset = 0, size; size = (((unsigned long) width) << 16) | height; /* CALCULATE STARTING OFFSET */ offset = (unsigned long) y *gu2_pitch + (((unsigned long) x) << gu2_xshift); /* CHECK IF PATTERN ORIGINS NEED TO BE SET */ if (GFXpatternFlags) { /* COMBINE X AND Y PATTERN ORIGINS WITH OFFSET */ offset |= ((unsigned long) (x & 7)) << 26; offset |= ((unsigned long) (y & 7)) << 29; } /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Put off poll for as long as possible (do most calculations first). */ GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, gu2_rop32); WRITE_GP32(MGP_DST_OFFSET, offset); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_pitch); WRITE_GP32(MGP_BLT_MODE, gu2_blt_mode); } /* *---------------------------------------------------------------------------- * GFX_COLOR_PATTERN_FILL * * This routine is used to render a rectangle using the current raster * operation and the specified color pattern. It allows an 8x8 color * pattern to be rendered without multiple calls to the gfx_set_color_pattern * and gfx_pattern_fill routines. * * X screen X position (left) * Y screen Y position (top) * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * *PATTERN pointer to 8x8 color pattern data *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_color_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long *pattern) #else void gfx_color_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long *pattern) #endif { /* CALL GFX2 ROUTINE TO AVOID DUPLICATION OF CODE */ unsigned long offset = (unsigned long) y * gu2_pitch + (((unsigned long) x) << gu2_xshift); unsigned long origin = gu2_pattern_origin; unsigned long pitch = gu2_dst_pitch; gfx2_set_pattern_origin(x, y); gfx2_set_destination_stride((unsigned short) gu2_pitch); gfx2_color_pattern_fill(offset, width, height, pattern); /* RESTORE GFX2 VALUES */ gu2_pattern_origin = origin; gu2_dst_pitch = pitch; } /* *---------------------------------------------------------------------------- * SCREEN TO SCREEN BLT * * This routine should be used to perform a screen to screen BLT when the * ROP does not require destination data. * * SRCX screen X position to copy from * SRCY screen Y position to copy from * DSTX screen X position to copy to * DSTY screen Y position to copy to * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height) #else void gfx_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height) #endif { unsigned long srcoffset, dstoffset, size; unsigned short blt_mode; size = (((unsigned long) width) << 16) | height; /* CALCULATE THE DIRECTION OF THE BLT */ blt_mode = (gu2_blt_mode & ~MGP_BM_SRC_TYPE_MASK) | MGP_BM_SRC_FB; if (dstx > srcx) { blt_mode |= MGP_BM_NEG_XDIR; srcx += width - 1; dstx += width - 1; } if (dsty > srcy) { blt_mode |= MGP_BM_NEG_YDIR; srcy += height - 1; dsty += height - 1; } /* CALCULATE STARTING OFFSETS */ srcoffset = (unsigned long) srcy *gu2_pitch + (((unsigned long) srcx) << gu2_xshift); dstoffset = ((unsigned long) dsty * gu2_pitch + (((unsigned long) dstx) << gu2_xshift)) & 0xFFFFFF; /* MERGE PATTERN INFORMATION */ /* This must be done after the x and y coordinates have been updated, */ /* as the x and y pattern origins correspond to the first ROPed pixel. */ if (GFXpatternFlags) { /* COMBINE X AND Y PATTERN ORIGINS WITH OFFSET */ dstoffset |= ((unsigned long) (dstx & 7)) << 26; dstoffset |= ((unsigned long) (dsty & 7)) << 29; } /* TURN INTO BYTE ADDRESS IF NEGATIVE X DIRECTION */ /* This is a quirk of the hardware. */ if (blt_mode & MGP_BM_NEG_XDIR) { srcoffset += (1 << gu2_xshift) - 1; dstoffset += (1 << gu2_xshift) - 1; } /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Put off poll for as long as possible (do most calculations first). */ GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, gu2_rop32 | GFXsourceFlags); WRITE_GP32(MGP_SRC_OFFSET, srcoffset); WRITE_GP32(MGP_DST_OFFSET, dstoffset); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_pitch | (gu2_pitch << 16)); WRITE_GP16(MGP_BLT_MODE, blt_mode); } /* *---------------------------------------------------------------------------- * SCREEN TO SCREEN TRANSPARENT BLT * * This routine should be used to perform a screen to screen BLT when a * specified color should by transparent. The only supported ROP is SRCCOPY. * * SRCX screen X position to copy from * SRCY screen Y position to copy from * DSTX screen X position to copy to * DSTY screen Y position to copy to * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * COLOR transparent color *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long color) #else void gfx_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long color) #endif { unsigned long rop32; /* SAVE ORIGINAL RASTER MODE SETTINGS */ rop32 = gu2_rop32; /* WRITE REGISTERS TO SPECIFY COLOR TRANSPARENCY */ /* Match GU1 implementation that only allows SRCCOPY for the ROP. */ GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_COLOR_FG, color); WRITE_GP32(MGP_SRC_COLOR_BG, 0xFFFFFFFF); /* SET GLOBAL RASTER SETTINGS */ /* This is needed, as the screen-to-screen BLT */ /* routine will overwrite the raster mode register. */ gu2_rop32 = gu2_bpp | MGP_RM_SRC_TRANS | 0xCC; /* CALL NORMAL SCREEN TO SCREEN BLT ROUTINE */ gfx_screen_to_screen_blt(srcx, srcy, dstx, dsty, width, height); /* RESTORE GLOBAL RASTER SETTINGS */ gu2_rop32 = rop32; } /* *---------------------------------------------------------------------------- * COLOR BITMAP TO SCREEN BLT * * This routine transfers color bitmap data to the screen. * * SRCX X offset within source bitmap * SRCY Y offset within source bitmap * DSTX screen X position to render data * DSTY screen Y position to render data * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * *DATA pointer to bitmap data * PITCH pitch of bitmap data (bytes between scanlines) * * Transparency is handled by another routine. *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch) #else void gfx_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch) #endif { unsigned long dstoffset, srcoffset, size, bytes; unsigned long offset, temp_offset; unsigned long dword_bytes, bytes_extra; unsigned short blt_mode; blt_mode = (gu2_blt_mode & ~MGP_BM_SRC_TYPE_MASK) | MGP_BM_SRC_FB; size = (((unsigned long) width) << 16) | 1; /* CALCULATE STARTING OFFSETS */ offset = (unsigned long) srcy *pitch + ((unsigned long) srcx << gu2_xshift); dstoffset = (unsigned long) dsty *gu2_pitch + (((unsigned long) dstx) << gu2_xshift); /* CHECK IF PATTERN ORIGINS NEED TO BE SET */ if (GFXpatternFlags) { /* COMBINE X AND Y PATTERN ORIGINS WITH OFFSET */ dstoffset |= ((unsigned long) (dstx & 7)) << 26; dstoffset |= ((unsigned long) (dsty & 7)) << 29; } bytes = width << gu2_xshift; dword_bytes = bytes & ~0x3L; bytes_extra = bytes & 0x3L; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Put off poll for as long as possible (do most calculations first). */ /* The source offset is always 0 since we allow misaligned dword reads. */ /* We must wait for BLT busy because the GP may be executing a screen */ /* to screen BLT from the scratchpad area. */ GU2_WAIT_BUSY; WRITE_GP32(MGP_RASTER_MODE, gu2_rop32 | GFXsourceFlags); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_pitch); /* WRITE DATA ONE LINE AT A TIME */ /* For speed reasons, data is written to an offscreen scratch area and then */ /* BLTed using a screen to screen BLT. This is similar to the GX1 BLT buffers, but */ /* slightly more efficient in that we can queue up data while the GP is rendering */ /* a line. */ while (height--) { temp_offset = offset; srcoffset = gfx_gx2_scratch_base; if (gu2_current_line) srcoffset += 8192; GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_OFFSET, srcoffset); WRITE_GP32(MGP_DST_OFFSET, dstoffset); dstoffset += gu2_pitch; dstoffset += 0x20000000; WRITE_FRAME_BUFFER_STRING32(srcoffset, dword_bytes, data, temp_offset); if (bytes_extra) { temp_offset += dword_bytes; srcoffset += dword_bytes; WRITE_FRAME_BUFFER_STRING8(srcoffset, bytes_extra, data, temp_offset); } WRITE_GP16(MGP_BLT_MODE, blt_mode); offset += pitch; gu2_current_line = 1 - gu2_current_line; } } /* *---------------------------------------------------------------------------- * COLOR BITMAP TO SCREEN TRANSPARENT BLT * * This routine transfers color bitmap data to the screen with transparency. * The transparent color is specified. The only supported ROP is SRCCOPY, * meaning that transparency cannot be applied if the ROP requires * destination data (this is a hardware restriction). * * SRCX X offset within source bitmap * SRCY Y offset within source bitmap * DSTX screen X position to render data * DSTY screen Y position to render data * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * *DATA pointer to bitmap data * PITCH pitch of bitmap data (bytes between scanlines) * COLOR transparent color *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_color_bitmap_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch, unsigned long color) #else void gfx_color_bitmap_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch, unsigned long color) #endif { unsigned long rop32; /* SAVE EXISTING RASTER MODE SETTINGS */ rop32 = gu2_rop32; /* WRITE REGISTERS TO SPECIFY COLOR TRANSPARENCY */ /* Match GU1 implementation that only allows SRCCOPY for the ROP. */ GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_COLOR_FG, color); WRITE_GP32(MGP_SRC_COLOR_BG, 0xFFFFFFFF); /* SET GLOBAL RASTER SETTINGS */ /* This is needed, as the screen-to-screen BLT */ /* routine will overwrite the raster mode register. */ gu2_rop32 = gu2_bpp | MGP_RM_SRC_TRANS | 0xCC; /* CALL NORMAL COLOR BITMAP TO SCREEN BLT ROUTINE */ gfx_color_bitmap_to_screen_blt(srcx, srcy, dstx, dsty, width, height, data, pitch); /* RESTORE RASTER SETTINGS */ gu2_rop32 = rop32; } /* *---------------------------------------------------------------------------- * MONOCHROME BITMAP TO SCREEN BLT * * This routine transfers monochrome bitmap data to the screen. * * SRCX X offset within source bitmap * SRCY Y offset within source bitmap * DSTX screen X position to render data * DSTY screen Y position to render data * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * *DATA pointer to bitmap data * PITCH pitch of bitmap data (bytes between scanlines) *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, short pitch) #else void gfx_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, short pitch) #endif { unsigned long dstoffset, size, bytes; unsigned long offset, temp_offset, temp1 = 0, temp2 = 0; unsigned long i, j = 0, fifo_lines, dwords_extra, bytes_extra; unsigned long shift = 0; size = (((unsigned long) width) << 16) | height; /* CALCULATE STARTING OFFSETS */ offset = (unsigned long) srcy *pitch + ((unsigned long) srcx >> 3); dstoffset = (unsigned long) dsty *gu2_pitch + (((unsigned long) dstx) << gu2_xshift); /* CHECK IF PATTERN ORIGINS NEED TO BE SET */ if (GFXpatternFlags) { /* COMBINE X AND Y PATTERN ORIGINS WITH OFFSET */ dstoffset |= ((unsigned long) (dstx & 7)) << 26; dstoffset |= ((unsigned long) (dsty & 7)) << 29; } bytes = ((srcx & 7) + width + 7) >> 3; fifo_lines = bytes >> 5; dwords_extra = (bytes & 0x0000001Cl) >> 2; bytes_extra = bytes & 0x00000003l; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Put off poll for as long as possible (do most calculations first). */ /* The source offset is always 0 since we allow misaligned dword reads. */ /* Need to wait for busy instead of pending, since hardware clears */ /* the host data FIFO at the beginning of a BLT. */ GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, gu2_rop32 | GFXsourceFlags); WRITE_GP32(MGP_SRC_OFFSET, ((unsigned long) srcx & 7) << 26); WRITE_GP32(MGP_DST_OFFSET, dstoffset); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_pitch); WRITE_GP16(MGP_BLT_MODE, (gu2_blt_mode & ~MGP_BM_SRC_TYPE_MASK) | MGP_BM_SRC_HOST | MGP_BM_SRC_MONO); /* WAIT FOR BLT TO BE LATCHED */ GU2_WAIT_PENDING; /* WRITE ALL OF THE DATA TO THE HOST SOURCE REGISTER */ while (height--) { temp_offset = offset; /* WRITE ALL FULL FIFO LINES */ for (i = 0; i < fifo_lines; i++) { GU2_WAIT_HALF_EMPTY; WRITE_GPREG_STRING32(MGP_HST_SOURCE, 8, j, data, temp_offset, temp1); temp_offset += 32; } /* WRITE ALL FULL DWORDS */ GU2_WAIT_HALF_EMPTY; if (dwords_extra) { WRITE_GPREG_STRING32(MGP_HST_SOURCE, dwords_extra, i, data, temp_offset, temp1); temp_offset += (dwords_extra << 2); } /* WRITE REMAINING BYTES */ shift = 0; if (bytes_extra) WRITE_GPREG_STRING8(MGP_HST_SOURCE, bytes_extra, shift, i, data, temp_offset, temp1, temp2); offset += pitch; } } /*--------------------------------------------------------------------------- * GFX_TEXT_BLT * * This routine is similar to the gfx_mono_bitmap_to_screen_blt routine * but assumes that source data is byte-packed. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_text_blt(unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data) #else void gfx_text_blt(unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data) #endif { unsigned long size, bytes; unsigned long dstoffset, temp1 = 0, temp2 = 0, temp_offset = 0; unsigned long i, j = 0, fifo_lines, dwords_extra, bytes_extra; unsigned long shift; size = (((unsigned long) width) << 16) | height; dstoffset = (unsigned long) dsty *gu2_pitch + (((unsigned long) dstx) << gu2_xshift); /* CHECK IF PATTERN ORIGINS NEED TO BE SET */ if (GFXpatternFlags) { /* COMBINE X AND Y PATTERN ORIGINS WITH OFFSET */ dstoffset |= ((unsigned long) (dstx & 7)) << 26; dstoffset |= ((unsigned long) (dsty & 7)) << 29; } /* CALCULATE STARTING OFFSETS */ bytes = ((width + 7) >> 3) * height; fifo_lines = bytes >> 5; dwords_extra = (bytes & 0x0000001Cl) >> 2; bytes_extra = bytes & 0x00000003l; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, gu2_rop32 | GFXsourceFlags); WRITE_GP32(MGP_SRC_OFFSET, 0); WRITE_GP32(MGP_DST_OFFSET, dstoffset); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_pitch); WRITE_GP16(MGP_BLT_MODE, (gu2_blt_mode & ~MGP_BM_SRC_TYPE_MASK) | MGP_BM_SRC_HOST | MGP_BM_SRC_BP_MONO); /* WAIT FOR BLT TO BE LATCHED */ GU2_WAIT_PENDING; /* WRITE ALL FULL FIFO LINES */ for (i = 0; i < fifo_lines; i++) { GU2_WAIT_HALF_EMPTY; WRITE_GPREG_STRING32(MGP_HST_SOURCE, 8, j, data, temp_offset, temp1); temp_offset += 32; } /* WRITE ALL FULL DWORDS */ if (dwords_extra || bytes_extra) { GU2_WAIT_HALF_EMPTY; if (dwords_extra) { WRITE_GPREG_STRING32(MGP_HST_SOURCE, dwords_extra, i, data, temp_offset, temp1); temp_offset += (dwords_extra << 2); } if (bytes_extra) { shift = 0; WRITE_GPREG_STRING8(MGP_HST_SOURCE, bytes_extra, shift, i, data, temp_offset, temp1, temp2); } } } /* *---------------------------------------------------------------------------- * BRESENHAM LINE * * This routine draws a vector using the specified Bresenham parameters. * Currently this file does not support a routine that accepts the two * endpoints of a vector and calculates the Bresenham parameters. If it * ever does, this routine is still required for vectors that have been * clipped. * * X screen X position to start vector * Y screen Y position to start vector * LENGTH length of the vector, in pixels * INITERR Bresenham initial error term * AXIALERR Bresenham axial error term * DIAGERR Bresenham diagonal error term * FLAGS VM_YMAJOR, VM_MAJOR_INC, VM_MINOR_INC *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_bresenham_line(unsigned short x, unsigned short y, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags) #else void gfx_bresenham_line(unsigned short x, unsigned short y, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags) #endif { unsigned long offset; unsigned long data1 = (((unsigned long) axialerr) << 16) | diagerr; unsigned long data2 = (((unsigned long) length) << 16) | initerr; unsigned short vector_mode = gu2_vector_mode | flags; /* CALCULATE STARTING OFFSET */ offset = (unsigned long) y *gu2_pitch + (((unsigned long) x) << gu2_xshift); /* CHECK NULL LENGTH */ if (!length) return; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Put off poll for as long as possible (do most calculations first). */ GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, gu2_rop32); WRITE_GP32(MGP_DST_OFFSET, offset); WRITE_GP32(MGP_VEC_ERR, data1); WRITE_GP32(MGP_VEC_LEN, data2); WRITE_GP32(MGP_STRIDE, gu2_pitch); WRITE_GP32(MGP_VECTOR_MODE, vector_mode); } /*--------------------------------------------------------------------------- * GFX_WAIT_UNTIL_IDLE * * This routine waits until the graphics engine is idle. This is required * before allowing direct access to the frame buffer. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu2_wait_until_idle(void) #else void gfx_wait_until_idle(void) #endif { while (READ_GP32(MGP_BLT_STATUS) & MGP_BS_BLT_BUSY); } /*--------------------------------------------------------------------------- * GFX_TEST_BLT_PENDING * * This routine returns 1 if a BLT is pending, meaning that a call to * perform a rendering operation would stall. Otherwise it returns 0. * It is used by Darwin during random testing to only start a BLT * operation when it knows the Durango routines won't spin on graphics * (so Darwin can continue to do frame buffer reads and writes). *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC int gu2_test_blt_pending(void) #else int gfx_test_blt_pending(void) #endif { if (READ_GP32(MGP_BLT_STATUS) & MGP_BS_BLT_PENDING) return (1); return (0); } /*--------------------------------------------------------------------------- * NEW ROUTINES FOR REDCLOUD *--------------------------------------------------------------------------- */ /*--------------------------------------------------------------------------- * GFX2_SET_SOURCE_STRIDE * * This routine sets the stride to be used in successive screen to screen * BLTs (used by gfx2_screen_to_screen_blt and gfx2_mono_expand_blt). *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_set_source_stride(unsigned short stride) #else void gfx2_set_source_stride(unsigned short stride) #endif { /* SAVE STRIDE TO BE USED LATER */ gu2_src_pitch = (unsigned long) stride; } /*--------------------------------------------------------------------------- * GFX2_SET_DESTINATION_STRIDE * * This routine sets the stride used when rendering to the screen. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_set_destination_stride(unsigned short stride) #else void gfx2_set_destination_stride(unsigned short stride) #endif { /* SAVE STRIDE TO BE USED LATER */ gu2_dst_pitch = (unsigned long) stride; } /*--------------------------------------------------------------------------- * GFX2_SET_PATTERN_ORIGIN * * This routine sets the origin within an 8x8 pattern. It is needed if * using a monochrome or color pattern (not used for a solid pattern). *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_set_pattern_origin(int x, int y) #else void gfx2_set_pattern_origin(int x, int y) #endif { /* STORE IN FORMAT THAT CAN BE COMBINED WITH THE DESTINATION OFFSET */ gu2_pattern_origin = (((unsigned long) (x & 7)) << 26) | (((unsigned long) (y & 7)) << 29); } /*--------------------------------------------------------------------------- * GFX2_SET_SOURCE_TRANSPARENCY * * This routine sets the source transparency color and mask to be used * in future rendering operations. If both the color and mask are set * to zero (normally completely transparent), those values indicate that * transparency should be disabled. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_set_source_transparency(unsigned long color, unsigned long mask) #else void gfx2_set_source_transparency(unsigned long color, unsigned long mask) #endif { /* WRITE REGISTERS TO SPECIFY COLOR TRANSPARENCY */ GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_COLOR_FG, color); WRITE_GP32(MGP_SRC_COLOR_BG, mask); /* SET TRANSPARENCY FLAG */ GFXsourceFlags = (color || mask) ? MGP_RM_SRC_TRANS : 0; } /*--------------------------------------------------------------------------- * GFX2_SET_ALPHA_MODE * * This routine sets the alpha blending mode to be used in successive * rendering operations. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_set_alpha_mode(int mode) #else void gfx2_set_alpha_mode(int mode) #endif { /* SAVE ALPHA MODE FOR LATER */ gu2_alpha_mode = mode; } /*--------------------------------------------------------------------------- * GFX2_SET_ALPHA_VALUE * * This routine sets the alpha value to be used with certain alpha blending * modes (ALPHA_MODE_BLEND). *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_set_alpha_value(unsigned char value) #else void gfx2_set_alpha_value(unsigned char value) #endif { /* SAVE ALPHA VALUE TO BE USED LATER */ gu2_alpha_value = (unsigned long) value; /* SET GLOBAL FLAG */ /* gfx2_* routines will use this flag to program alpha values */ /* appropriately. Normal gfx_* routines will always write */ /* the current ROP settings. In this way, the alpha mode */ /* affects only second generation routines. */ gu2_alpha_active = 1; switch (gu2_alpha_mode) { case ALPHA_MODE_BLEND: /* GENERATE 32-BIT VERSION OF RASTER MODE REGISTER */ /* Pattern data is not involved in the operation. */ gu2_alpha32 = gu2_alpha_value | gu2_bpp; /* HANDLE SPECIAL CASES FOR ENDPOINTS */ /* The 8-bit hardware alpha value is always */ /* interpreted as a fraction. Consequently, there */ /* is no way to use values of 255 or 0 to exclude */ /* one of the inputs. */ switch (gu2_alpha_value) { /* DESTINATION ONLY */ /* Operation is alpha * A, where A is destination */ /* and alpha is 1. */ case 0: gu2_alpha32 |= MGP_RM_SELECT_ALPHA_1 | MGP_RM_ALPHA_TIMES_A | MGP_RM_ALPHA_TO_RGB | MGP_RM_DEST_FROM_CHAN_A; break; /* SOURCE ONLY */ /* Operation is alpha * A, where A is source and */ /* alpha is 1. */ case 255: gu2_alpha32 |= MGP_RM_SELECT_ALPHA_1 | MGP_RM_ALPHA_TO_RGB | MGP_RM_ALPHA_TIMES_A; break; /* DEFAULT */ /* Operation is alpha * A + (1 - alpha) * B; */ /* A is source, B is destination and alpha is the */ /* programmed 8-bit value. */ default: gu2_alpha32 |= MGP_RM_SELECT_ALPHA_R | MGP_RM_ALPHA_TO_RGB | MGP_RM_ALPHA_A_PLUS_BETA_B; } /* CHECK IF SOURCE INFORMATION SHOULD BE MERGED */ /* Alpha value of 0 indicates destination only. */ if (gu2_alpha_value != 0) gu2_alpha32 |= GFXsourceFlags; /* SET FLAG FOR DESTINATION DATA IF NECESSARY */ /* Alpha value of 255 indicates no destination */ if (gu2_alpha_value != 255) { gu2_alpha_blt_mode = MGP_BM_DST_REQ; gu2_alpha_vec_mode = MGP_VM_DST_REQ; } break; } } /*--------------------------------------------------------------------------- * GFX2_PATTERN_FILL * * This routine is similar to the gfx_pattern_fill routine, but allows the * use of an arbitrary destination stride. The rendering position is * also specified as an offset instead of an (x,y) position. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height) #else void gfx2_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height) #endif { unsigned long size; size = (((unsigned long) width) << 16) | height; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Put off poll for as long as possible (do most calculations first). */ GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, gu2_rop32); WRITE_GP32(MGP_DST_OFFSET, dstoffset | gu2_pattern_origin); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_dst_pitch); WRITE_GP32(MGP_BLT_MODE, gu2_blt_mode | gu2_bm_throttle); gu2_bm_throttle = 0; gu2_vm_throttle = 0; } /*--------------------------------------------------------------------------- * GFX2_COLOR_PATTERN_FILL * * This routine is used to render a rectangle using the current raster * operation and the specified color pattern. It allows an 8x8 color * pattern to be rendered without multiple calls to the gfx_set_color_pattern * and gfx_pattern_fill routines. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_color_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned long *pattern) #else void gfx2_color_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned long *pattern) #endif { int pass; unsigned long lines, size, patxorigin, patoffset; /* ONLY USE HW PATTERN ORIGIN FOR THE X DIRECTION */ /* Y direction handled by referencing proper location in pattern data. */ patxorigin = (gu2_pattern_origin) & 0x1C000000; /* OVERRIDE PATTERN FLAGS IN ROP TO FORCE COLOR PATTERN */ GU2_WAIT_PENDING; WRITE_GP32(MGP_RASTER_MODE, (gu2_rop32 & ~MGP_RM_PAT_FLAGS) | MGP_RM_PAT_COLOR); /* ATTEMPT TO OPTIMIZE */ /* If possible, we can perform the pattern fill in only a few passes */ /* This is performed by multiplying the pitch by an appropriate amount. */ /* Consequently, if the multiplied pitch exceeds 16 bits, this */ /* optimization is impossible. */ if ((gu2_dst_pitch << (gu2_xshift + 1)) <= 0xFFFF) { /* HANDLE VARIOUS COLOR DEPTHS DIFFERENTLY */ switch (gu2_xshift) { case 0: /* 8 BPP */ /* TWO PASSES FOR 8 BPP */ /* Render every other line per pass by doubling the pitch. */ patoffset = (gu2_pattern_origin >> 28) & 0x0E; for (pass = 0; pass < 2; pass++) { /* CAN WRITE SOME PATTERN REGISTERS WHILE "PENDING" */ GU2_WAIT_PENDING; WRITE_GP32(MGP_DST_OFFSET, dstoffset | patxorigin); lines = (height + 1 - pass) >> 1; if (!lines) break; size = (((unsigned long) width) << 16) | lines; WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_dst_pitch << 1); WRITE_GP32(MGP_PAT_DATA_1, BYTE_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_DATA_0, BYTE_SWIZZLE(pattern[patoffset + 1])); patoffset = (patoffset + 4) & 0x0E; WRITE_GP32(MGP_PAT_COLOR_1, BYTE_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_COLOR_0, BYTE_SWIZZLE(pattern[patoffset + 1])); patoffset = (patoffset + 4) & 0x0E; /* NEED TO WAIT UNTIL IDLE FOR COLORS 2 THROUGH 5 */ /* Those registers are not pipelined. */ GU2_WAIT_BUSY; WRITE_GP32(MGP_PAT_COLOR_3, BYTE_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_COLOR_2, BYTE_SWIZZLE(pattern[patoffset + 1])); patoffset = (patoffset + 4) & 0x0E; WRITE_GP32(MGP_PAT_COLOR_5, BYTE_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_COLOR_4, BYTE_SWIZZLE(pattern[patoffset + 1])); WRITE_GP16(MGP_BLT_MODE, gu2_blt_mode | gu2_bm_throttle); gu2_bm_throttle = 0; gu2_vm_throttle = 0; /* ADJUST FOR NEXT PASS */ dstoffset += gu2_dst_pitch; patoffset = (patoffset + 6) & 0x0E; } break; case 1: /* 12, 15, OR 16 BPP */ /* FOUR PASSES FOR 16 BPP */ /* Render every 4th line per pass by quadrupling the pitch. */ patoffset = (gu2_pattern_origin >> 27) & 0x1C; for (pass = 0; pass < 4; pass++) { /* CAN WRITE SOME PATTERN REGISTERS WHILE "PENDING" */ GU2_WAIT_PENDING; WRITE_GP32(MGP_DST_OFFSET, dstoffset | patxorigin); lines = (height + 3 - pass) >> 2; if (!lines) break; size = (((unsigned long) width) << 16) | lines; WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_dst_pitch << 2); WRITE_GP32(MGP_PAT_COLOR_1, WORD_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_COLOR_0, WORD_SWIZZLE(pattern[patoffset + 1])); WRITE_GP32(MGP_PAT_DATA_1, WORD_SWIZZLE(pattern[patoffset + 2])); WRITE_GP32(MGP_PAT_DATA_0, WORD_SWIZZLE(pattern[patoffset + 3])); patoffset = (patoffset + 16) & 0x1C; /* NEED TO WAIT UNTIL IDLE FOR COLORS 2 THROUGH 5 */ /* Those registers are not pipelined. */ GU2_WAIT_BUSY; WRITE_GP32(MGP_PAT_COLOR_5, WORD_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_COLOR_4, WORD_SWIZZLE(pattern[patoffset + 1])); WRITE_GP32(MGP_PAT_COLOR_3, WORD_SWIZZLE(pattern[patoffset + 2])); WRITE_GP32(MGP_PAT_COLOR_2, WORD_SWIZZLE(pattern[patoffset + 3])); WRITE_GP16(MGP_BLT_MODE, gu2_blt_mode | gu2_bm_throttle); gu2_bm_throttle = 0; gu2_vm_throttle = 0; /* ADJUST FOR NEXT PASS */ dstoffset += gu2_dst_pitch; patoffset = (patoffset + 20) & 0x1C; } break; case 2: /* 32 BPP */ /* EIGHT PASSES FOR 32 BPP */ /* Render every 8th line per pass by setting pitch * 8. */ patoffset = (gu2_pattern_origin >> 26) & 0x38; for (pass = 0; pass < 8; pass++) { /* CAN WRITE SOME PATTERN REGISTERS WHILE "PENDING" */ GU2_WAIT_PENDING; WRITE_GP32(MGP_DST_OFFSET, dstoffset | patxorigin); lines = (height + 7 - pass) >> 3; if (!lines) break; size = (((unsigned long) width) << 16) | lines; WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_dst_pitch << 3); WRITE_GP32(MGP_PAT_COLOR_1, pattern[patoffset + 4]); WRITE_GP32(MGP_PAT_COLOR_0, pattern[patoffset + 5]); WRITE_GP32(MGP_PAT_DATA_1, pattern[patoffset + 6]); WRITE_GP32(MGP_PAT_DATA_0, pattern[patoffset + 7]); /* NEED TO WAIT UNTIL IDLE FOR COLORS 2 THROUGH 5 */ /* Those registers are not pipelined. */ GU2_WAIT_BUSY; WRITE_GP32(MGP_PAT_COLOR_5, pattern[patoffset]); WRITE_GP32(MGP_PAT_COLOR_4, pattern[patoffset + 1]); WRITE_GP32(MGP_PAT_COLOR_3, pattern[patoffset + 2]); WRITE_GP32(MGP_PAT_COLOR_2, pattern[patoffset + 3]); WRITE_GP16(MGP_BLT_MODE, gu2_blt_mode | gu2_bm_throttle); gu2_bm_throttle = 0; gu2_vm_throttle = 0; /* ADJUST FOR NEXT PASS */ dstoffset += gu2_dst_pitch; patoffset = (patoffset + 8) & 0x38; } break; } } else { WRITE_GP32(MGP_STRIDE, gu2_dst_pitch); switch (gu2_xshift) { case 0: /* 8 BPP - 4 LINES PER PASS */ patoffset = (gu2_pattern_origin >> 28) & 0x0E; while (height) { lines = height > 4 ? 4 : height; /* CAN WRITE SOME REGISTERS WHILE PENDING */ WRITE_GP32(MGP_DST_OFFSET, dstoffset | patxorigin); WRITE_GP32(MGP_WID_HEIGHT, (((unsigned long) width) << 16) | lines); WRITE_GP32(MGP_PAT_DATA_1, BYTE_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_DATA_0, BYTE_SWIZZLE(pattern[patoffset + 1])); patoffset = (patoffset + 2) & 0x0E; WRITE_GP32(MGP_PAT_COLOR_1, BYTE_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_COLOR_0, BYTE_SWIZZLE(pattern[patoffset + 1])); patoffset = (patoffset + 2) & 0x0E; /* NEED TO WAIT UNTIL IDLE FOR COLORS 2 THROUGH 5 */ /* Those registers are not pipelined. */ GU2_WAIT_BUSY; WRITE_GP32(MGP_PAT_COLOR_3, BYTE_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_COLOR_2, BYTE_SWIZZLE(pattern[patoffset + 1])); patoffset = (patoffset + 2) & 0x0E; WRITE_GP32(MGP_PAT_COLOR_5, BYTE_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_COLOR_4, BYTE_SWIZZLE(pattern[patoffset + 1])); patoffset = (patoffset + 2) & 0x0E; WRITE_GP16(MGP_BLT_MODE, gu2_blt_mode | gu2_bm_throttle); /* ADJUST FOR NEXT PASS */ dstoffset += gu2_dst_pitch << 2; height -= (unsigned short) lines; } break; case 1: /* 12, 15 AND 16 BPP - 2 LINES PER PASS */ patoffset = (gu2_pattern_origin >> 27) & 0x1C; while (height) { lines = height > 2 ? 2 : height; /* CAN WRITE SOME REGISTERS WHILE PENDING */ WRITE_GP32(MGP_DST_OFFSET, dstoffset | patxorigin); WRITE_GP32(MGP_WID_HEIGHT, (((unsigned long) width) << 16) | lines); WRITE_GP32(MGP_PAT_COLOR_1, WORD_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_COLOR_0, WORD_SWIZZLE(pattern[patoffset + 1])); WRITE_GP32(MGP_PAT_DATA_1, WORD_SWIZZLE(pattern[patoffset + 2])); WRITE_GP32(MGP_PAT_DATA_0, WORD_SWIZZLE(pattern[patoffset + 3])); patoffset = (patoffset + 4) & 0x1C; /* NEED TO WAIT UNTIL IDLE FOR COLORS 2 THROUGH 5 */ /* Those registers are not pipelined. */ GU2_WAIT_BUSY; WRITE_GP32(MGP_PAT_COLOR_5, WORD_SWIZZLE(pattern[patoffset])); WRITE_GP32(MGP_PAT_COLOR_4, WORD_SWIZZLE(pattern[patoffset + 1])); WRITE_GP32(MGP_PAT_COLOR_3, WORD_SWIZZLE(pattern[patoffset + 2])); WRITE_GP32(MGP_PAT_COLOR_2, WORD_SWIZZLE(pattern[patoffset + 3])); patoffset = (patoffset + 4) & 0x1C; WRITE_GP16(MGP_BLT_MODE, gu2_blt_mode | gu2_bm_throttle); /* ADJUST FOR NEXT PASS */ dstoffset += gu2_dst_pitch << 1; height -= (unsigned short) lines; } break; case 2: /* 32 BPP - 1 LINE PER PASS */ patoffset = (gu2_pattern_origin >> 26) & 0x38; while (height) { /* CAN WRITE SOME REGISTERS WHILE PENDING */ WRITE_GP32(MGP_DST_OFFSET, dstoffset | patxorigin); WRITE_GP32(MGP_WID_HEIGHT, (((unsigned long) width) << 16) | 1l); WRITE_GP32(MGP_PAT_COLOR_1, pattern[patoffset + 4]); WRITE_GP32(MGP_PAT_COLOR_0, pattern[patoffset + 5]); WRITE_GP32(MGP_PAT_DATA_1, pattern[patoffset + 6]); WRITE_GP32(MGP_PAT_DATA_0, pattern[patoffset + 7]); /* NEED TO WAIT UNTIL IDLE FOR COLORS 2 THROUGH 5 */ /* Those registers are not pipelined. */ GU2_WAIT_BUSY; WRITE_GP32(MGP_PAT_COLOR_5, pattern[patoffset]); WRITE_GP32(MGP_PAT_COLOR_4, pattern[patoffset + 1]); WRITE_GP32(MGP_PAT_COLOR_3, pattern[patoffset + 2]); WRITE_GP32(MGP_PAT_COLOR_2, pattern[patoffset + 3]); patoffset = (patoffset + 8) & 0x38; WRITE_GP16(MGP_BLT_MODE, gu2_blt_mode | gu2_bm_throttle); /* ADJUST FOR NEXT PASS */ dstoffset += gu2_dst_pitch; height--; } break; } } } /*--------------------------------------------------------------------------- * GFX2_SCREEN_TO_SCREEN_BLT * * This routine is similar to the gfx_screen_to_screen_blt routine but * allows the use of arbitrary source and destination strides and alpha * blending. It also allows the use of an arbitrary ROP with transparency. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_screen_to_screen_blt(unsigned long srcoffset, unsigned long dstoffset, unsigned short width, unsigned short height, int flags) #else void gfx2_screen_to_screen_blt(unsigned long srcoffset, unsigned long dstoffset, unsigned short width, unsigned short height, int flags) #endif { unsigned long size, xbytes; unsigned short blt_mode; size = (((unsigned long) width) << 16) | height; /* USE ALPHA SETTINGS, IF REQUESTED */ if (gu2_alpha_active) blt_mode = gu2_alpha_blt_mode | MGP_BM_SRC_FB; else blt_mode = (gu2_blt_mode & ~MGP_BM_SRC_TYPE_MASK) | MGP_BM_SRC_FB; /* CALCULATE THE DIRECTION OF THE BLT */ /* Using offsets, so flags from the calling routine are needed. */ if (flags & 1) { xbytes = (width - 1) << gu2_xshift; srcoffset += xbytes; dstoffset += xbytes; blt_mode |= MGP_BM_NEG_XDIR; } if (flags & 2) { srcoffset += (height - 1) * gu2_src_pitch; dstoffset += (height - 1) * gu2_dst_pitch; blt_mode |= MGP_BM_NEG_YDIR; } /* TURN INTO BYTE ADDRESS IF NEGATIVE X DIRECTION */ /* This is a quirk of the hardware. */ if (blt_mode & MGP_BM_NEG_XDIR) { srcoffset += (1 << gu2_xshift) - 1; dstoffset += (1 << gu2_xshift) - 1; } /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Put off poll for as long as possible (do most calculations first). */ GU2_WAIT_PENDING; if (gu2_alpha_active) { WRITE_GP32(MGP_RASTER_MODE, gu2_alpha32); } else { WRITE_GP32(MGP_RASTER_MODE, gu2_rop32 | GFXsourceFlags); } WRITE_GP32(MGP_SRC_OFFSET, srcoffset); WRITE_GP32(MGP_DST_OFFSET, dstoffset | gu2_pattern_origin); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_dst_pitch | (gu2_src_pitch << 16)); WRITE_GP16(MGP_BLT_MODE, blt_mode | gu2_bm_throttle); gu2_bm_throttle = 0; gu2_vm_throttle = 0; } /*--------------------------------------------------------------------------- * GFX2_MONO_EXPAND_BLT * * This routine is similar to the gfx2_screen_to_screen_blt routine but * expands monochrome data stored in graphics memory. * WARNING: This routine assumes that the regions in graphics memory * will not overlap, and therefore does not check the BLT direction. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_mono_expand_blt(unsigned long srcbase, unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, int byte_packed) #else void gfx2_mono_expand_blt(unsigned long srcbase, unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, int byte_packed) #endif { unsigned long size, srcoffset; unsigned short blt_mode; size = (((unsigned long) width) << 16) | height; /* CALCULATE SOURCE OFFSET */ srcoffset = srcbase + (unsigned long) srcy *gu2_src_pitch; srcoffset += srcx >> 3; srcoffset |= ((unsigned long) srcx & 7) << 26; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Put off poll for as long as possible (do most calculations first). */ GU2_WAIT_PENDING; if (gu2_alpha_active) { blt_mode = gu2_alpha_blt_mode; WRITE_GP32(MGP_RASTER_MODE, gu2_alpha32); } else { blt_mode = (gu2_blt_mode & ~MGP_BM_SRC_TYPE_MASK); WRITE_GP32(MGP_RASTER_MODE, gu2_rop32 | GFXsourceFlags); } if (byte_packed) blt_mode |= MGP_BM_SRC_FB | MGP_BM_SRC_BP_MONO | gu2_bm_throttle; else blt_mode |= MGP_BM_SRC_FB | MGP_BM_SRC_MONO | gu2_bm_throttle; WRITE_GP32(MGP_SRC_OFFSET, srcoffset); WRITE_GP32(MGP_DST_OFFSET, dstoffset | gu2_pattern_origin); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_dst_pitch | (gu2_src_pitch << 16)); WRITE_GP16(MGP_BLT_MODE, blt_mode); gu2_bm_throttle = 0; gu2_vm_throttle = 0; } /*--------------------------------------------------------------------------- * GFX2_COLOR_BITMAP_TO_SCREEN_BLT * * This routine is similar to the gfx_color_bitmap_to_screen_blt routine * but allows the use of an arbitrary destination stride and alpha blending. * It also allows the use of an arbitrary ROP with transparency. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, short pitch) #else void gfx2_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, short pitch) #endif { unsigned long size, bytes; unsigned long offset, temp_offset; unsigned long srcoffset, dword_bytes, bytes_extra; unsigned short blt_mode; size = (((unsigned long) width) << 16) | 1; /* CALCULATE STARTING OFFSETS */ offset = (unsigned long) srcy *pitch + ((unsigned long) srcx << gu2_xshift); dstoffset |= gu2_pattern_origin; bytes = width << gu2_xshift; dword_bytes = bytes & ~0x3L; bytes_extra = bytes & 0x3L; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Put off poll for as long as possible (do most calculations first). */ /* The source offset is always 0 since we allow misaligned dword reads. */ /* We must wait for BLT busy because the GP may be executing a screen */ /* to screen BLT from the scratchpad area. */ GU2_WAIT_BUSY; if (gu2_alpha_active) { blt_mode = gu2_alpha_blt_mode; WRITE_GP32(MGP_RASTER_MODE, gu2_alpha32); } else { blt_mode = (gu2_blt_mode & ~MGP_BM_SRC_TYPE_MASK); WRITE_GP32(MGP_RASTER_MODE, gu2_rop32 | GFXsourceFlags); } blt_mode |= MGP_BM_SRC_FB | gu2_bm_throttle; gu2_bm_throttle = 0; gu2_vm_throttle = 0; WRITE_GP32(MGP_WID_HEIGHT, size); /* WRITE DATA ONE LINE AT A TIME */ /* For speed reasons, data is written to an offscreen scratch area and * then BLTed using a screen to screen BLT. This is similar to the GX1 BLT * buffers, but slightly more efficient in that we can queue up data while * the GP is rendering a line. * */ while (height--) { temp_offset = offset; srcoffset = gfx_gx2_scratch_base; if (gu2_current_line) srcoffset += 8192; GU2_WAIT_PENDING; WRITE_GP32(MGP_SRC_OFFSET, srcoffset); WRITE_GP32(MGP_DST_OFFSET, dstoffset); dstoffset += gu2_dst_pitch; dstoffset += 0x20000000; WRITE_FRAME_BUFFER_STRING32(srcoffset, dword_bytes, data, temp_offset); if (bytes_extra) { temp_offset += dword_bytes; srcoffset += dword_bytes; WRITE_FRAME_BUFFER_STRING8(srcoffset, bytes_extra, data, temp_offset); } WRITE_GP16(MGP_BLT_MODE, blt_mode); offset += pitch; gu2_current_line = 1 - gu2_current_line; } } /*--------------------------------------------------------------------------- * GFX2_TEXT_BLT * * This routine is similar to the gfx2_mono_bitmap_to_screen_blt routine * but assumes that source data is byte-packed. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_text_blt(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data) #else void gfx2_text_blt(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data) #endif { unsigned long size, bytes; unsigned long temp1 = 0, temp2 = 0, temp_offset = 0; unsigned long i, j = 0, fifo_lines, dwords_extra, bytes_extra; unsigned long shift; unsigned short blt_mode; size = (((unsigned long) width) << 16) | height; /* CALCULATE STARTING OFFSETS */ bytes = ((width + 7) >> 3) * height; fifo_lines = bytes >> 5; dwords_extra = (bytes & 0x0000001Cl) >> 2; bytes_extra = bytes & 0x00000003l; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ GU2_WAIT_PENDING; if (gu2_alpha_active) { blt_mode = gu2_alpha_blt_mode; WRITE_GP32(MGP_RASTER_MODE, gu2_alpha32); } else { blt_mode = (gu2_blt_mode & ~MGP_BM_SRC_TYPE_MASK); WRITE_GP32(MGP_RASTER_MODE, gu2_rop32 | GFXsourceFlags); } WRITE_GP32(MGP_SRC_OFFSET, 0); WRITE_GP32(MGP_DST_OFFSET, dstoffset | gu2_pattern_origin); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_dst_pitch); WRITE_GP16(MGP_BLT_MODE, blt_mode | MGP_BM_SRC_HOST | MGP_BM_SRC_BP_MONO | gu2_bm_throttle); gu2_bm_throttle = 0; gu2_vm_throttle = 0; /* WAIT FOR BLT TO BE LATCHED */ GU2_WAIT_PENDING; /* WRITE ALL FULL FIFO LINES */ for (i = 0; i < fifo_lines; i++) { GU2_WAIT_HALF_EMPTY; WRITE_GPREG_STRING32(MGP_HST_SOURCE, 8, j, data, temp_offset, temp1); temp_offset += 32; } /* WRITE ALL FULL DWORDS */ if (dwords_extra || bytes_extra) { GU2_WAIT_HALF_EMPTY; if (dwords_extra) { WRITE_GPREG_STRING32(MGP_HST_SOURCE, dwords_extra, i, data, temp_offset, temp1); temp_offset += (dwords_extra << 2); } if (bytes_extra) { shift = 0; WRITE_GPREG_STRING8(MGP_HST_SOURCE, bytes_extra, shift, i, data, temp_offset, temp1, temp2); } } } /*--------------------------------------------------------------------------- * GFX2_MONO_BITMAP_TO_SCREEN_BLT * * This routine is similar to the gfx_mono_bitmap_to_screen_blt routine * but allows the use of an arbitrary destination stride and alpha blending. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, short pitch) #else void gfx2_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, short pitch) #endif { unsigned long size, bytes; unsigned long offset, temp_offset, temp1 = 0, temp2 = 0; unsigned long i, j = 0, fifo_lines, dwords_extra, bytes_extra; unsigned long shift = 0; unsigned short blt_mode; size = (((unsigned long) width) << 16) | height; /* CALCULATE STARTING OFFSETS */ offset = (unsigned long) srcy *pitch + ((unsigned long) srcx >> 3); bytes = ((srcx & 7) + width + 7) >> 3; fifo_lines = bytes >> 5; dwords_extra = (bytes & 0x0000001Cl) >> 2; bytes_extra = bytes & 0x00000003l; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ GU2_WAIT_PENDING; if (gu2_alpha_active) { blt_mode = gu2_alpha_blt_mode; WRITE_GP32(MGP_RASTER_MODE, gu2_alpha32); } else { blt_mode = (gu2_blt_mode & ~MGP_BM_SRC_TYPE_MASK); WRITE_GP32(MGP_RASTER_MODE, gu2_rop32 | GFXsourceFlags); } WRITE_GP32(MGP_SRC_OFFSET, ((unsigned long) srcx & 7) << 26); WRITE_GP32(MGP_DST_OFFSET, dstoffset | gu2_pattern_origin); WRITE_GP32(MGP_WID_HEIGHT, size); WRITE_GP32(MGP_STRIDE, gu2_dst_pitch); WRITE_GP16(MGP_BLT_MODE, blt_mode | MGP_BM_SRC_HOST | MGP_BM_SRC_MONO | gu2_bm_throttle); gu2_bm_throttle = 0; gu2_vm_throttle = 0; /* WAIT FOR BLT TO BE LATCHED */ GU2_WAIT_PENDING; /* WRITE ALL OF THE DATA TO THE HOST SOURCE REGISTER */ while (height--) { temp_offset = offset; /* WRITE ALL FULL FIFO LINES */ for (i = 0; i < fifo_lines; i++) { GU2_WAIT_HALF_EMPTY; WRITE_GPREG_STRING32(MGP_HST_SOURCE, 8, j, data, temp_offset, temp1); temp_offset += 32; } /* WRITE ALL FULL DWORDS */ GU2_WAIT_HALF_EMPTY; if (dwords_extra) WRITE_GPREG_STRING32(MGP_HST_SOURCE, dwords_extra, i, data, temp_offset, temp1); temp_offset += (dwords_extra << 2); /* WRITE REMAINING BYTES */ shift = 0; if (bytes_extra) WRITE_GPREG_STRING8(MGP_HST_SOURCE, bytes_extra, shift, i, data, temp_offset, temp1, temp2); offset += pitch; } } /*--------------------------------------------------------------------------- * GFX2_BRESENHAM_LINE * * This routine is similar to the gfx_bresenam_line routine but allows * the use of an arbitrary destination stride. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_bresenham_line(unsigned long dstoffset, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags) #else void gfx2_bresenham_line(unsigned long dstoffset, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags) #endif { unsigned long vector_mode = gu2_vector_mode | flags; unsigned long data1 = (((unsigned long) axialerr) << 16) | diagerr; unsigned long data2 = (((unsigned long) length) << 16) | initerr; /* CHECK NULL LENGTH */ if (!length) return; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Put off poll for as long as possible (do most calculations first). */ GU2_WAIT_PENDING; if (gu2_alpha_active) { vector_mode = gu2_alpha_vec_mode | flags; WRITE_GP32(MGP_RASTER_MODE, gu2_alpha32); } else WRITE_GP32(MGP_RASTER_MODE, gu2_rop32); WRITE_GP32(MGP_DST_OFFSET, dstoffset | gu2_pattern_origin); WRITE_GP32(MGP_VEC_ERR, data1); WRITE_GP32(MGP_VEC_LEN, data2); WRITE_GP32(MGP_STRIDE, gu2_dst_pitch); WRITE_GP32(MGP_VECTOR_MODE, vector_mode | gu2_vm_throttle); gu2_bm_throttle = 0; gu2_vm_throttle = 0; } /*--------------------------------------------------------------------------- * GFX2_SYNC_TO_VBLANK * * This routine sets a flag to synchronize the next rendering routine to * VBLANK. The flag is cleared by the rendering routine. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu22_sync_to_vblank(void) #else void gfx2_sync_to_vblank(void) #endif { /* SET FLAGS TO THROTTLE NEXT RENDERING ROUTINE */ gu2_bm_throttle = MGP_BM_THROTTLE; gu2_vm_throttle = MGP_VM_THROTTLE; } /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/rndr_gu1.c0000644000175000017500000015024712654445443015051 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to program the 2D acceleration hardware for * the first generation graphics unit (GXLV, SC1200). * * gfx_set_bpp * gfx_set_solid_pattern * gfx_set_mono_pattern * gfx_set_color_pattern * gfx_set_solid_source * gfx_set_mono_source * gfx_set_raster_operation * gfx_pattern_fill * gfx_screen_to_screen_blt * gfx_screen_to_screen_xblt * gfx_color_bitmap_to_screen_blt * gfx_color_bitmap_to_screen_xblt * gfx_mono_bitmap_to_screen_blt * gfx_bresenham_line * gfx_wait_until_idle * */ #if GFX_NO_IO_IN_WAIT_MACROS #define GFX_WAIT_PENDING \ while(READ_REG16(GP_BLIT_STATUS) & BS_BLIT_PENDING) { ; } #define GFX_WAIT_BUSY \ while(READ_REG16(GP_BLIT_STATUS) & BS_BLIT_BUSY) { ; } #define GFX_WAIT_PIPELINE \ while (READ_REG16(GP_BLIT_STATUS) & BS_PIPELINE_BUSY) { ; } #else #define GFX_WAIT_PENDING \ while(READ_REG16(GP_BLIT_STATUS) & BS_BLIT_PENDING) { INB (0x80); } #define GFX_WAIT_BUSY \ while(READ_REG16(GP_BLIT_STATUS) & BS_BLIT_BUSY) { INB (0x80); } #define GFX_WAIT_PIPELINE \ while (READ_REG16(GP_BLIT_STATUS) & BS_PIPELINE_BUSY) { INB (0x80); } #endif void gu1_detect_blt_buffer_base(void); /*--------------------------------------------------------------------------- * GFX_SET_BPP * * This routine sets the bits per pixel value in the graphics engine. * It is also stored in a static variable to use in the future calls to * the rendering routines. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_set_bpp(unsigned short bpp) #else void gfx_set_bpp(unsigned short bpp) #endif { int control = 0; unsigned short pitch = gfx_get_display_pitch(); GFXbpp = bpp; /* DETECT BASE ADDRESSES FOR BLT BUFFERS */ /* Different for 2K or 3K of scratchpad. Also need to calculate */ /* the number of pixels that can fit in a BLT buffer - need to */ /* subtract 16 for alignment considerations. The 2K case, for */ /* example, is 816 bytes wide, allowing 800 pixels in 8 BPP, which */ /* means rendering operations won't be split for 800x600. */ gu1_detect_blt_buffer_base(); GFXbufferWidthPixels = GFXbb1Base - GFXbb0Base - 16; if (bpp > 8) { /* If 16bpp, divide GFXbufferWidthPixels by 2 */ GFXbufferWidthPixels >>= 1; } /* SET THE GRAPHICS CONTROLLER BPP AND PITCH */ if (bpp > 8) { /* Set the 16bpp bit if necessary */ control = BC_16BPP; } if ((gfx_cpu_version == GFX_CPU_PYRAMID) && (pitch > 2048)) { control |= BC_FB_WIDTH_4096; } else if (pitch > 1024) { control |= BC_FB_WIDTH_2048; } GFX_WAIT_BUSY; WRITE_REG32(GP_BLIT_STATUS, control); } /* *--------------------------------------------------------------------------- * GFX_SET_SOLID_SOURCE * * This routine is used to specify a solid source color. For the Xfree96 * display driver, the source color is used to specify a planemask and the * ROP is adjusted accordingly. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_set_solid_source(unsigned long color) #else void gfx_set_solid_source(unsigned long color) #endif { /* CLEAR TRANSPARENCY FLAG */ GFXsourceFlags = 0; /* FORMAT 8 BPP COLOR */ /* GX requires 8BPP color data be duplicated into bits [15:8]. */ if (GFXbpp == 8) { color &= 0x00FF; color |= (color << 8); } /* POLL UNTIL ABLE TO WRITE THE SOURCE COLOR */ GFX_WAIT_PENDING; WRITE_REG16(GP_SRC_COLOR_0, (unsigned short) color); WRITE_REG16(GP_SRC_COLOR_1, (unsigned short) color); } /* *--------------------------------------------------------------------------- * GFX_SET_MONO_SOURCE * * This routine is used to specify the monochrome source colors. * It must be called *after* loading any pattern data (those routines * clear the source flags). *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, unsigned short transparent) #else void gfx_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, unsigned short transparent) #endif { /* SET TRANSPARENCY FLAG */ GFXsourceFlags = transparent ? RM_SRC_TRANSPARENT : 0; /* FORMAT 8 BPP COLOR */ /* GX requires 8BPP color data be duplicated into bits [15:8]. */ if (GFXbpp == 8) { bgcolor &= 0x00FF; bgcolor |= (bgcolor << 8); fgcolor &= 0x00FF; fgcolor |= (fgcolor << 8); } /* POLL UNTIL ABLE TO WRITE THE SOURCE COLOR */ GFX_WAIT_PENDING; WRITE_REG16(GP_SRC_COLOR_0, (unsigned short) bgcolor); WRITE_REG16(GP_SRC_COLOR_1, (unsigned short) fgcolor); } /* *--------------------------------------------------------------------------- * GFX_SET_SOLID_PATTERN * * This routine is used to specify a solid pattern color. It is called * before performing solid rectangle fills or more complicated BLTs that * use a solid pattern color. * * The driver should always call "gfx_load_raster_operation" after a call * to this routine to make sure that the pattern flags are set appropriately. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_set_solid_pattern(unsigned long color) #else void gfx_set_solid_pattern(unsigned long color) #endif { /* CLEAR TRANSPARENCY FLAG */ GFXsourceFlags = 0; /* SET PATTERN FLAGS */ GFXpatternFlags = 0; /* FORMAT 8 BPP COLOR */ /* GX requires 8BPP color data be duplicated into bits [15:8]. */ if (GFXbpp == 8) { color &= 0x00FF; color |= (color << 8); } /* SAVE THE REFORMATTED COLOR FOR LATER */ /* Used to call the "GFX_solid_fill" routine for special cases. */ GFXsavedColor = color; /* POLL UNTIL ABLE TO WRITE THE PATTERN COLOR */ GFX_WAIT_PENDING; WRITE_REG16(GP_PAT_COLOR_0, (unsigned short) color); } /* *--------------------------------------------------------------------------- * GFX_SET_MONO_PATTERN * * This routine is used to specify a monochrome pattern. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned char transparent) #else void gfx_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned char transparent) #endif { /* CLEAR TRANSPARENCY FLAG */ GFXsourceFlags = 0; /* SET PATTERN FLAGS */ GFXpatternFlags = transparent ? RM_PAT_MONO | RM_PAT_TRANSPARENT : RM_PAT_MONO; /* FORMAT 8 BPP COLOR */ /* GXm requires 8BPP color data be duplicated into bits [15:8]. */ if (GFXbpp == 8) { bgcolor &= 0x00FF; bgcolor |= (bgcolor << 8); fgcolor &= 0x00FF; fgcolor |= (fgcolor << 8); } /* POLL UNTIL ABLE TO WRITE THE PATTERN COLORS AND DATA */ GFX_WAIT_PENDING; WRITE_REG16(GP_PAT_COLOR_0, (unsigned short) bgcolor); WRITE_REG16(GP_PAT_COLOR_1, (unsigned short) fgcolor); WRITE_REG32(GP_PAT_DATA_0, data0); WRITE_REG32(GP_PAT_DATA_1, data1); } /* *--------------------------------------------------------------------------- * GFX_SET_COLOR_PATTERN * * This routine is used to specify a color pattern. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned long data2, unsigned long data3, unsigned char transparent) #else void gfx_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned long data2, unsigned long data3, unsigned char transparent) #endif { /* CLEAR TRANSPARENCY FLAG */ GFXsourceFlags = 0; /* SET PATTERN FLAGS */ GFXpatternFlags = transparent ? RM_PAT_MONO | RM_PAT_TRANSPARENT : RM_PAT_MONO; GFXpatternFlags |= RM_PAT_COLOR; /* FORMAT 8 BPP COLOR */ /* GXm requires 8BPP color data be duplicated into bits [15:8]. */ if (GFXbpp == 8) { bgcolor &= 0x00FF; bgcolor |= (bgcolor << 8); fgcolor &= 0x00FF; fgcolor |= (fgcolor << 8); } /* POLL UNTIL ABLE TO WRITE THE PATTERN COLORS AND DATA */ GFX_WAIT_PENDING; WRITE_REG16(GP_PAT_COLOR_0, (unsigned short) bgcolor); WRITE_REG16(GP_PAT_COLOR_1, (unsigned short) fgcolor); WRITE_REG32(GP_PAT_DATA_0, data0); WRITE_REG32(GP_PAT_DATA_1, data1); if (GFXbpp > 8) { WRITE_REG32(GP_PAT_DATA_2, data2); WRITE_REG32(GP_PAT_DATA_3, data3); } } /* *--------------------------------------------------------------------------- * GFX_LOAD_COLOR_PATTERN_LINE * * This routine is used to load a single line of a 8x8 color pattern. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_load_color_pattern_line(short y, unsigned long *pattern_8x8) #else void gfx_load_color_pattern_line(short y, unsigned long *pattern_8x8) #endif { /* CLEAR TRANSPARENCY FLAG */ GFXsourceFlags = 0; /* SET PATTERN FLAGS */ GFXpatternFlags = RM_PAT_COLOR; y &= 7; if (GFXbpp > 8) pattern_8x8 += (y << 2); else pattern_8x8 += (y << 1); /* POLL UNTIL ABLE TO WRITE THE PATTERN COLORS AND DATA */ GFX_WAIT_PENDING; WRITE_REG32(GP_PAT_DATA_0, pattern_8x8[0]); WRITE_REG32(GP_PAT_DATA_1, pattern_8x8[1]); if (GFXbpp > 8) { WRITE_REG32(GP_PAT_DATA_2, pattern_8x8[2]); WRITE_REG32(GP_PAT_DATA_3, pattern_8x8[3]); } } /* *--------------------------------------------------------------------------- * GFX_SET_RASTER_OPERATION * * This routine loads the specified raster operation. It sets the pattern * flags appropriately. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_set_raster_operation(unsigned char rop) #else void gfx_set_raster_operation(unsigned char rop) #endif { unsigned short rop16; /* GENERATE 16-BIT VERSION OF ROP WITH PATTERN FLAGS */ rop16 = (unsigned short) rop | GFXpatternFlags; if ((rop & 0x33) ^ ((rop >> 2) & 0x33)) rop16 |= GFXsourceFlags; /* SAVE ROP FOR LATER COMPARISONS */ /* Need to have the pattern flags included */ GFXsavedRop = rop16; /* SET FLAG INDICATING ROP REQUIRES DESTINATION DATA */ /* True if even bits (0:2:4:6) do not equal the correspinding */ /* even bits (1:3:5:7). */ GFXusesDstData = ((rop & 0x55) ^ ((rop >> 1) & 0x55)); /* POLL UNTIL ABLE TO WRITE THE PATTERN COLOR */ /* Only one operation can be pending at a time. */ GFX_WAIT_PENDING; WRITE_REG16(GP_RASTER_MODE, rop16); } /* *--------------------------------------------------------------------------- * GFX_SOLID_FILL * * This routine MUST be used when performing a solid rectangle fill with * the ROPs of PATCOPY (0xF0), BLACKNESS (0x00), WHITENESS (0xFF), or * PATINVERT (0x0F). There is a bug in GXm for these cases that requires a * workaround. * * For BLACKNESS (ROP = 0x00), set the color to 0x0000. * For WHITENESS (ROP = 0xFF), set the color to 0xFFFF. * For PATINVERT (ROP = 0x0F), invert the desired color. * * X screen X position (left) * Y screen Y position (top) * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * COLOR fill color * * THIS ROUTINE SHOULD NOT BE DIRECTLY CALLED FROM THE DRIVER. The driver * should always use GFX_pattern_fill and let that routine call this one * when approipriate. This is to hide quirks specific to MediaGX hardware. *--------------------------------------------------------------------------- */ void gu1_solid_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long color) { unsigned short section; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Only one operation can be pending at a time. */ GFX_WAIT_PENDING; /* SET REGISTERS TO DRAW RECTANGLE */ WRITE_REG16(GP_DST_XCOOR, x); WRITE_REG16(GP_DST_YCOOR, y); WRITE_REG16(GP_HEIGHT, height); WRITE_REG16(GP_RASTER_MODE, 0x00F0); /* PATCOPY */ WRITE_REG16(GP_PAT_COLOR_0, (unsigned short) color); /* CHECK WIDTH FOR GX BUG WORKAROUND */ if (width <= 16) { /* OK TO DRAW SMALL RECTANGLE IN ONE PASS */ WRITE_REG16(GP_WIDTH, width); WRITE_REG16(GP_BLIT_MODE, 0); } else { /* DRAW FIRST PART OF RECTANGLE */ /* Get to a 16 pixel boundary. */ section = 0x10 - (x & 0x0F); WRITE_REG16(GP_WIDTH, section); WRITE_REG16(GP_BLIT_MODE, 0); /* POLL UNTIL ABLE TO LOAD THE SECOND RECTANGLE */ GFX_WAIT_PENDING; WRITE_REG16(GP_DST_XCOOR, x + section); WRITE_REG16(GP_DST_YCOOR, y); WRITE_REG16(GP_WIDTH, width - section); WRITE_REG16(GP_BLIT_MODE, 0); } } /* *---------------------------------------------------------------------------- * GFX_PATTERN_FILL * * This routine is used to fill a rectangular region. The pattern must * be previously loaded using one of GFX_load_*_pattern routines. Also, the * raster operation must be previously specified using the * "GFX_load_raster_operation" routine. * * X screen X position (left) * Y screen Y position (top) * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height) #else void gfx_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height) #endif { unsigned short section, buffer_width, blit_mode; /* CHECK IF OPTIMIZED SOLID CASES */ /* Check all 16 bits of the ROP to include solid pattern flags. */ switch (GFXsavedRop) { /* CHECK FOR SPECIAL CASES WITHOUT DESTINATION DATA */ /* Need hardware workaround for fast "burst write" cases. */ case 0x00F0: gu1_solid_fill(x, y, width, height, (unsigned short) GFXsavedColor); break; case 0x000F: gu1_solid_fill(x, y, width, height, (unsigned short) ~GFXsavedColor); break; case 0x0000: gu1_solid_fill(x, y, width, height, 0x0000); break; case 0x00FF: gu1_solid_fill(x, y, width, height, 0xFFFF); break; /* REMAINING CASES REQUIRE DESTINATION DATA OR NOT SOLID COLOR */ default: /* DETERMINE BLT MODE VALUE */ /* Still here for non-solid patterns without destination data. */ blit_mode = GFXusesDstData ? BM_READ_DST_FB0 : 0; /* SET SOURCE EXPANSION MODE */ /* If the ROP requires source data, then the source data is all 1's */ /* and then expanded into the desired color in GP_SRC_COLOR_1. */ blit_mode |= BM_SOURCE_EXPAND; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Write the registers that do not change for each section. */ GFX_WAIT_PENDING; WRITE_REG16(GP_HEIGHT, height); /* SINCE ONLY DESTINATION DATA, WE CAN USE BOTH BB0 AND BB1. */ /* Therefore, width available = BLT buffer width * 2. */ buffer_width = GFXbufferWidthPixels << 1; /* REPEAT UNTIL FINISHED WITH RECTANGLE */ /* Perform BLT in vertical sections, as wide as the BLT buffer */ /* allows. Hardware does not split the operations, so */ /* software must do it to avoid large scanlines that would */ /* overflow the BLT buffers. */ while (width > 0) { /* DETERMINE WIDTH OF SECTION */ if (width > buffer_width) section = buffer_width; else section = width; /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ GFX_WAIT_PENDING; WRITE_REG16(GP_DST_XCOOR, x); WRITE_REG16(GP_DST_YCOOR, y); WRITE_REG16(GP_WIDTH, section); WRITE_REG16(GP_BLIT_MODE, blit_mode); /* ADJUST PARAMETERS FOR NEXT SECTION */ width -= section; x += section; } break; } } /* *---------------------------------------------------------------------------- * GFX_COLOR_PATTERN_FILL * * This routine is used to render a rectangle using the current raster * operation and the specified color pattern. It allows an 8x8 color * pattern to be rendered without multiple calls to the gfx_set_color_pattern * and gfx_pattern_fill routines. * * X screen X position (left) * Y screen Y position (top) * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * *PATTERN pointer to 8x8 color pattern data *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_color_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long *pattern) #else void gfx_color_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long *pattern) #endif { unsigned short blit_mode, passes, cur_y, pat_y, i; unsigned short buffer_width, line_width; unsigned short bpp_shift, section, cur_x; /* SET APPROPRIATE INCREMENT */ bpp_shift = (GFXbpp > 8) ? 2 : 1; /* SET DESTINATION REQUIRED */ blit_mode = GFXusesDstData ? BM_READ_DST_FB0 : 0; /* SET SOURCE EXPANSION */ blit_mode |= BM_SOURCE_EXPAND; /* OVERRIDE RASTER MODE TO FORCE A COLOR PATTERN */ GFX_WAIT_PENDING; WRITE_REG16(GP_RASTER_MODE, (GFXsavedRop & ~RM_PAT_MASK & ~RM_PAT_TRANSPARENT) | RM_PAT_COLOR); /* WRITE THE REGISTERS THAT DO NOT CHANGE */ /* If destination data is required, the width and */ /* x position will be overwritten. */ WRITE_REG16(GP_HEIGHT, 1); WRITE_REG16(GP_WIDTH, width); WRITE_REG16(GP_DST_XCOOR, x); /* THE ENTIRE PATTERN WILL NOT BE DRAWN IF THE HEIGHT IS LESS THAN 8 */ passes = (height < 8) ? height : 8; /* SINCE ONLY DESTINATION DATA, WE CAN USE BOTH BB0 AND BB1. */ /* Therefore, width available = BLT buffer width * 2. */ buffer_width = GFXbufferWidthPixels << 1; for (i = 0; i < passes; i++) { pat_y = ((y + i) & 7) << bpp_shift; cur_y = y + i; /* WRITE THE PATTERN DATA FOR THE ACTIVE LINE */ GFX_WAIT_PENDING; WRITE_REG32(GP_PAT_DATA_0, pattern[pat_y]); WRITE_REG32(GP_PAT_DATA_1, pattern[pat_y + 1]); if (GFXbpp > 8) { WRITE_REG32(GP_PAT_DATA_2, pattern[pat_y + 2]); WRITE_REG32(GP_PAT_DATA_3, pattern[pat_y + 3]); } /* SPLIT BLT LINE INTO SECTIONS IF REQUIRED */ /* If no destination data is required, we can ignore */ /* the BLT buffers. Otherwise, we must separate the BLT */ /* so as not to overflow the buffers */ if (blit_mode & BM_READ_DST_BB0) { line_width = width; cur_x = x; while (line_width) { section = (line_width > buffer_width) ? buffer_width : line_width; cur_y = y + i; GFX_WAIT_PENDING; WRITE_REG16(GP_DST_XCOOR, cur_x); WRITE_REG16(GP_WIDTH, section); while (cur_y < y + height) { GFX_WAIT_PENDING; WRITE_REG16(GP_DST_YCOOR, cur_y); WRITE_REG16(GP_BLIT_MODE, blit_mode); cur_y += 8; } cur_x += section; line_width -= section; } } else { while (cur_y < y + height) { GFX_WAIT_PENDING; WRITE_REG16(GP_DST_YCOOR, cur_y); WRITE_REG16(GP_BLIT_MODE, blit_mode); cur_y += 8; } } } /* RESTORE ORIGINAL ROP AND FLAGS */ GFX_WAIT_PENDING; WRITE_REG16(GP_RASTER_MODE, GFXsavedRop); } /* *---------------------------------------------------------------------------- * SCREEN TO SCREEN BLT * * This routine should be used to perform a screen to screen BLT when the * ROP does not require destination data. * * SRCX screen X position to copy from * SRCY screen Y position to copy from * DSTX screen X position to copy to * DSTY screen Y position to copy to * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height) #else void gfx_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height) #endif { unsigned short section, buffer_width; unsigned short blit_mode; /* CHECK IF RASTER OPERATION REQUIRES DESTINATION DATA */ blit_mode = GFXusesDstData ? BM_READ_DST_FB1 | BM_READ_SRC_FB : BM_READ_SRC_FB; /* CHECK Y DIRECTION */ /* Hardware has support for negative Y direction. */ if (dsty > srcy) { blit_mode |= BM_REVERSE_Y; srcy += height - 1; dsty += height - 1; } /* CHECK X DIRECTION */ /* Hardware does not support negative X direction since at the time */ /* of development all supported resolutions could fit a scanline of */ /* data at once into the BLT buffers (using both BB0 and BB1). This */ /* code is more generic to allow for any size BLT buffer. */ if (dstx > srcx) { srcx += width; dstx += width; } /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Write the registers that do not change for each section. */ GFX_WAIT_PENDING; WRITE_REG16(GP_HEIGHT, height); /* CHECK AVAILABLE BLT BUFFER SIZE */ /* Can use both BLT buffers if no destination data is required. */ buffer_width = GFXusesDstData ? GFXbufferWidthPixels : GFXbufferWidthPixels << 1; /* REPEAT UNTIL FINISHED WITH RECTANGLE */ /* Perform BLT in vertical sections, as wide as the BLT buffer allows. */ /* Hardware does not split the operations, so software must do it to */ /* avoid large scanlines that would overflow the BLT buffers. */ while (width > 0) { /* CHECK WIDTH OF CURRENT SECTION */ if (width > buffer_width) section = buffer_width; else section = width; /* PROGRAM REGISTERS THAT ARE THE SAME FOR EITHER X DIRECTION */ GFX_WAIT_PENDING; WRITE_REG16(GP_SRC_YCOOR, srcy); WRITE_REG16(GP_DST_YCOOR, dsty); WRITE_REG16(GP_WIDTH, section); /* CHECK X DIRECTION */ if (dstx > srcx) { /* NEGATIVE X DIRECTION */ /* Still positive X direction within the section. */ srcx -= section; dstx -= section; WRITE_REG16(GP_SRC_XCOOR, srcx); WRITE_REG16(GP_DST_XCOOR, dstx); WRITE_REG16(GP_BLIT_MODE, blit_mode); } else { /* POSITIVE X DIRECTION */ WRITE_REG16(GP_SRC_XCOOR, srcx); WRITE_REG16(GP_DST_XCOOR, dstx); WRITE_REG16(GP_BLIT_MODE, blit_mode); dstx += section; srcx += section; } width -= section; } } /* *---------------------------------------------------------------------------- * SCREEN TO SCREEN TRANSPARENT BLT * * This routine should be used to perform a screen to screen BLT when a * specified color should by transparent. The only supported ROP is SRCCOPY. * * SRCX screen X position to copy from * SRCY screen Y position to copy from * DSTX screen X position to copy to * DSTY screen Y position to copy to * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * COLOR transparent color *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long color) #else void gfx_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long color) #endif { unsigned short section, buffer_width; unsigned short blit_mode = BM_READ_SRC_FB; /* CHECK Y DIRECTION */ /* Hardware has support for negative Y direction. */ if (dsty > srcy) { blit_mode |= BM_REVERSE_Y; srcy += height - 1; dsty += height - 1; } /* CHECK X DIRECTION */ /* Hardware does not support negative X direction since at the time */ /* of development all supported resolutions could fit a scanline of */ /* data at once into the BLT buffers (using both BB0 and BB1). This */ /* code is more generic to allow for any size BLT buffer. */ if (dstx > srcx) { srcx += width; dstx += width; } /* CALCULATE BLT BUFFER SIZE */ /* Need to use BB1 to store the BLT buffer data. */ buffer_width = GFXbufferWidthPixels; /* WRITE TRANSPARENCY COLOR TO BLT BUFFER 1 */ if (GFXbpp == 8) { color &= 0x00FF; color |= (color << 8); } color = (color & 0x0000FFFF) | (color << 16); /* WAIT UNTIL PIPELINE IS NOT BUSY BEFORE LOADING DATA INTO BB1 */ /* Need to make sure any previous BLT using BB1 is complete. */ /* Only need to load 32 bits of BB1 for the 1 pixel BLT that follows. */ GFX_WAIT_BUSY; WRITE_SCRATCH32(GFXbb1Base, color); /* DO BOGUS BLT TO LATCH DATA FROM BB1 */ /* Already know graphics pipeline is idle. */ /* Only need to latch data into the holding registers for the current */ /* data from BB1. A 1 pixel wide BLT will suffice. */ WRITE_REG32(GP_DST_XCOOR, 0); WRITE_REG32(GP_SRC_XCOOR, 0); WRITE_REG32(GP_WIDTH, 0x00010001); WRITE_REG16(GP_RASTER_MODE, 0x00CC); WRITE_REG16(GP_BLIT_MODE, BM_READ_SRC_FB | BM_READ_DST_BB1); /* WRITE REGISTERS FOR REAL SCREEN TO SCREEN BLT */ GFX_WAIT_PENDING; WRITE_REG16(GP_HEIGHT, height); WRITE_REG16(GP_RASTER_MODE, 0x10C6); WRITE_REG32(GP_PAT_COLOR_0, 0xFFFFFFFF); /* REPEAT UNTIL FINISHED WITH RECTANGLE */ /* Perform BLT in vertical sections, as wide as the BLT buffer allows. */ /* Hardware does not split the operations, so software must do it to */ /* avoid large scanlines that would overflow the BLT buffers. */ while (width > 0) { /* CHECK WIDTH OF CURRENT SECTION */ if (width > buffer_width) section = buffer_width; else section = width; /* PROGRAM REGISTERS THAT ARE THE SAME FOR EITHER X DIRECTION */ GFX_WAIT_PENDING; WRITE_REG16(GP_SRC_YCOOR, srcy); WRITE_REG16(GP_DST_YCOOR, dsty); WRITE_REG16(GP_WIDTH, section); /* CHECK X DIRECTION */ /* Again, this must be done in software, and can be removed if the */ /* display driver knows that the BLT buffers will always be large */ /* enough to contain an entire scanline of a screen to screen BLT. */ if (dstx > srcx) { /* NEGATIVE X DIRECTION */ /* Still positive X direction within the section. */ srcx -= section; dstx -= section; WRITE_REG16(GP_SRC_XCOOR, srcx); WRITE_REG16(GP_DST_XCOOR, dstx); WRITE_REG16(GP_BLIT_MODE, blit_mode); } else { /* POSITIVE X DIRECTION */ WRITE_REG16(GP_SRC_XCOOR, srcx); WRITE_REG16(GP_DST_XCOOR, dstx); WRITE_REG16(GP_BLIT_MODE, blit_mode); dstx += section; srcx += section; } width -= section; } } /* *---------------------------------------------------------------------------- * COLOR BITMAP TO SCREEN BLT * * This routine transfers color bitmap data to the screen. For most cases, * when the ROP is SRCCOPY, it may be faster to write a separate routine that * copies the data to the frame buffer directly. This routine should be * used when the ROP requires destination data. * * Transparency is handled by another routine. * * SRCX X offset within source bitmap * SRCY Y offset within source bitmap * DSTX screen X position to render data * DSTY screen Y position to render data * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * *DATA pointer to bitmap data * PITCH pitch of bitmap data (bytes between scanlines) *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch) #else void gfx_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch) #endif { unsigned short section, buffer_width; unsigned short blit_mode = BM_READ_SRC_BB0; unsigned short temp_height; unsigned long dword_bytes_needed, bytes_extra; unsigned long bpp_shift; long array_offset; /* CHECK SIZE OF BLT BUFFER */ buffer_width = GFXbufferWidthPixels; /* CHECK IF RASTER OPERATION REQUIRES DESTINATION DATA */ /* If no destination data, we have twice the room for */ /* source data. */ if (GFXusesDstData) blit_mode |= BM_READ_DST_FB1; else buffer_width <<= 1; /* SET THE SCRATCHPAD BASE */ SET_SCRATCH_BASE(GFXbb0Base); /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Write the registers that do not change for each section. */ GFX_WAIT_PENDING; WRITE_REG16(GP_HEIGHT, 1); bpp_shift = (GFXbpp + 7) >> 4; while (width > 0) { if (width > buffer_width) section = buffer_width; else section = width; dword_bytes_needed = (section << bpp_shift) & ~3l; bytes_extra = (section << bpp_shift) & 3l; temp_height = height; /* WRITE THE REGISTERS FOR EACH SECTION */ /* The GX hardware will auto-increment the Y coordinate, meaning */ /* that we don't have to. */ WRITE_REG16(GP_WIDTH, section); WRITE_REG16(GP_DST_XCOOR, dstx); WRITE_REG16(GP_DST_YCOOR, dsty); /* CALCULATE THE BITMAP OFFSET */ array_offset = (unsigned long) srcy *(long) pitch + ((long) srcx << bpp_shift); while (temp_height--) { GFX_WAIT_PIPELINE; /* WRITE ALL DATA TO THE BLT BUFFERS */ /* The WRITE_SCRATCH_STRING macro assumes that the data begins * at the scratchpad offset set by the SET_SCRATCH_BASE macro. * */ WRITE_SCRATCH_STRING(dword_bytes_needed, bytes_extra, data, array_offset); WRITE_REG16(GP_BLIT_MODE, blit_mode); array_offset += pitch; } width -= section; srcx += section; dstx += section; } } /* *---------------------------------------------------------------------------- * COLOR BITMAP TO SCREEN TRANSPARENT BLT * * This routine transfers color bitmap data to the screen with transparency. * The transparent color is specified. The only supported ROP is SRCCOPY, * meaning that transparency cannot be applied if the ROP requires * destination data (this is a hardware restriction). * * SRCX X offset within source bitmap * SRCY Y offset within source bitmap * DSTX screen X position to render data * DSTY screen Y position to render data * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * *DATA pointer to bitmap data * PITCH pitch of bitmap data (bytes between scanlines) * COLOR transparent color *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_color_bitmap_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch, unsigned long color) #else void gfx_color_bitmap_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch, unsigned long color) #endif { unsigned short section, buffer_width; unsigned short temp_height; unsigned long dword_bytes_needed, bytes_extra; unsigned long bpp_shift; long array_offset; /* CHECK SIZE OF BLT BUFFER */ buffer_width = GFXbufferWidthPixels; /* WRITE TRANSPARENCY COLOR TO BLT BUFFER 1 */ if (GFXbpp == 8) { color &= 0x00FF; color |= (color << 8); } color = (color & 0x0000FFFF) | (color << 16); /* WAIT UNTIL PIPELINE IS NOT BUSY BEFORE LOADING DATA INTO BB1 */ /* Need to make sure any previous BLT using BB1 is complete. */ /* Only need to load 32 bits of BB1 for the 1 pixel BLT that follows. */ GFX_WAIT_PIPELINE; GFX_WAIT_PENDING; WRITE_SCRATCH32(GFXbb1Base, color); /* DO BOGUS BLT TO LATCH DATA FROM BB1 */ /* Already know graphics pipeline is idle. */ /* Only need to latch data into the holding registers for the current */ /* data from BB1. A 1 pixel wide BLT will suffice. */ WRITE_REG32(GP_DST_XCOOR, 0); WRITE_REG32(GP_SRC_XCOOR, 0); WRITE_REG32(GP_WIDTH, 0x00010001); WRITE_REG16(GP_RASTER_MODE, 0x00CC); WRITE_REG16(GP_BLIT_MODE, BM_READ_SRC_FB | BM_READ_DST_BB1); /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Write the registers that do not change for each section. */ GFX_WAIT_PENDING; WRITE_REG16(GP_HEIGHT, 1); WRITE_REG16(GP_RASTER_MODE, 0x10C6); WRITE_REG32(GP_PAT_COLOR_0, 0xFFFFFFFF); bpp_shift = (GFXbpp + 7) >> 4; /* SET THE SCRATCHPAD BASE */ SET_SCRATCH_BASE(GFXbb0Base); while (width > 0) { if (width > buffer_width) section = buffer_width; else section = width; dword_bytes_needed = (section << bpp_shift) & ~3l; bytes_extra = (section << bpp_shift) & 3l; temp_height = height; /* WRITE THE REGISTERS FOR EACH SECTION */ /* The GX hardware will auto-increment the Y coordinate, meaning */ /* that we don't have to. */ WRITE_REG16(GP_WIDTH, section); WRITE_REG16(GP_DST_XCOOR, dstx); WRITE_REG16(GP_DST_YCOOR, dsty); /* CALCULATE THE BITMAP OFFSET */ array_offset = (unsigned long) srcy *(long) pitch + ((long) srcx << bpp_shift); while (temp_height--) { GFX_WAIT_PIPELINE; /* WRITE ALL DATA TO THE BLT BUFFERS */ /* The WRITE_SCRATCH_STRING macro assumes that the data begins at the */ /* scratchpad offset set by the SET_SCRATCH_BASE macro. */ WRITE_SCRATCH_STRING(dword_bytes_needed, bytes_extra, data, array_offset); WRITE_REG16(GP_BLIT_MODE, BM_READ_SRC_BB0); array_offset += pitch; } width -= section; srcx += section; dstx += section; } } /* *---------------------------------------------------------------------------- * MONOCHROME BITMAP TO SCREEN BLT * * This routine transfers monochrome bitmap data to the screen. * * SRCX X offset within source bitmap * SRCY Y offset within source bitmap * DSTX screen X position to render data * DSTY screen Y position to render data * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * *DATA pointer to bitmap data * PITCH pitch of bitmap data (bytes between scanlines) *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, short pitch) #else void gfx_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, short pitch) #endif { unsigned short section, buffer_width; unsigned short blit_mode = BM_READ_SRC_BB0 | BM_SOURCE_EXPAND; unsigned short temp_height; unsigned long dword_bytes_needed, bytes_extra; long array_offset; /* CHECK IF RASTER OPERATION REQUIRES DESTINATION DATA */ /* If no destination data, the source data will always fit. */ /* So, in that event we will set the buffer width to a */ /* fictitiously large value such that the BLT is never split. */ if (GFXusesDstData) { buffer_width = GFXbufferWidthPixels; blit_mode |= BM_READ_DST_FB1; } else buffer_width = 3200; /* CHECK IF DATA ALREADY IN BLIT BUFFER */ /* If the pointer is NULL, data for the full BLT is already there */ /* WARNING: This could cause problems if destination data is */ /* involved and it overflows the BLT buffer. Need to remove */ /* this option and change the drivers to use a temporary buffer. */ if (!data) { GFX_WAIT_PENDING; WRITE_REG16(GP_SRC_XCOOR, srcx & 7); WRITE_REG16(GP_DST_XCOOR, dstx); WRITE_REG16(GP_DST_YCOOR, dsty); WRITE_REG16(GP_WIDTH, width); WRITE_REG16(GP_HEIGHT, height); WRITE_REG16(GP_BLIT_MODE, blit_mode); return; } /* SET THE SCRATCHPAD BASE */ SET_SCRATCH_BASE(GFXbb0Base); /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ /* Write the registers that do not change for each section. */ GFX_WAIT_PENDING; WRITE_REG16(GP_HEIGHT, 1); while (width > 0) { if (width > buffer_width) section = buffer_width; else section = width; /* CALCULATE BYTES NEEDED */ /* Add 1 for possible alignment issues. */ dword_bytes_needed = ((section + 7 + (srcx & 7)) >> 3) & ~3l; bytes_extra = ((section + 7 + (srcx & 7)) >> 3) & 3l; temp_height = height; /* WRITE THE REGISTERS FOR EACH SECTION */ /* The GX hardware will auto-increment the Y coordinate, meaning */ /* that we don't have to. */ WRITE_REG16(GP_WIDTH, section); WRITE_REG16(GP_DST_XCOOR, dstx); WRITE_REG16(GP_DST_YCOOR, dsty); WRITE_REG16(GP_SRC_XCOOR, srcx & 7); /* CALCULATE THE BITMAP OFFSET */ array_offset = (unsigned long) srcy *(long) pitch + ((long) srcx >> 3); while (temp_height--) { GFX_WAIT_PIPELINE; /* WRITE ALL DATA TO THE BLT BUFFERS */ /* The WRITE_SCRATCH_STRING macro assumes that the data begins at the */ /* scratchpad offset set by the SET_SCRATCH_BASE macro. */ WRITE_SCRATCH_STRING(dword_bytes_needed, bytes_extra, data, array_offset); WRITE_REG16(GP_BLIT_MODE, blit_mode); array_offset += pitch; } width -= section; srcx += section; dstx += section; } } /* *---------------------------------------------------------------------------- * MONOCHROME TEXT BLT * * This routine transfers contiguous monochrome text data to the screen. * * DSTX screen X position to render data * DSTY screen Y position to render data * WIDTH width of rectangle, in pixels * HEIGHT height of rectangle, in scanlines * *DATA pointer to bitmap data *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_text_blt(unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data) #else void gfx_text_blt(unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data) #endif { unsigned long dword_bytes_needed, bytes_extra; long pitch, buffer_bytes, data_bytes; /* CALCULATE DATA SIZE */ pitch = (width + 7) >> 3; data_bytes = (long) height *pitch; /* CHECK FOR SIMPLE CASE */ /* This routine is designed to render a source copy text glyph. If * destination data is required or the source data will not fit, we will * punt the operation to the more versatile (and slow) mono bitmap routine * */ if (GFXbpp > 8) buffer_bytes = GFXbufferWidthPixels << 1; else buffer_bytes = GFXbufferWidthPixels; if (GFXusesDstData || data_bytes > buffer_bytes) { gfx_mono_bitmap_to_screen_blt(0, 0, dstx, dsty, width, height, data, (short) pitch); return; } /* SET THE SCRATCHPAD BASE */ SET_SCRATCH_BASE(GFXbb0Base); /* POLL UNTIL ABLE TO WRITE TO THE REGISTERS */ dword_bytes_needed = data_bytes & ~3l; bytes_extra = data_bytes & 3l; GFX_WAIT_PENDING; WRITE_REG16(GP_HEIGHT, height); WRITE_REG16(GP_WIDTH, width); WRITE_REG16(GP_DST_XCOOR, dstx); WRITE_REG16(GP_DST_YCOOR, dsty); WRITE_REG16(GP_SRC_XCOOR, 0); /* WRITE ALL DATA TO THE BLT BUFFERS */ /* The WRITE_SCRATCH_STRING macro assumes that the data begins at the */ /* scratchpad offset set by the SET_SCRATCH_BASE macro. */ GFX_WAIT_PIPELINE; WRITE_SCRATCH_STRING(dword_bytes_needed, bytes_extra, data, 0); WRITE_REG16(GP_BLIT_MODE, BM_READ_SRC_BB0 | BM_SOURCE_TEXT); } /* *---------------------------------------------------------------------------- * BRESENHAM LINE * * This routine draws a vector using the specified Bresenham parameters. * Currently this file does not support a routine that accepts the two * endpoints of a vector and calculates the Bresenham parameters. If it * ever does, this routine is still required for vectors that have been * clipped. * * X screen X position to start vector * Y screen Y position to start vector * LENGTH length of the vector, in pixels * INITERR Bresenham initial error term * AXIALERR Bresenham axial error term * DIAGERR Bresenham diagonal error term * FLAGS VM_YMAJOR, VM_MAJOR_INC, VM_MINOR_INC *---------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_bresenham_line(unsigned short x, unsigned short y, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags) #else void gfx_bresenham_line(unsigned short x, unsigned short y, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags) #endif { unsigned short vector_mode = flags; if (GFXusesDstData) vector_mode |= VM_READ_DST_FB; /* CHECK NULL LENGTH */ if (!length) return; /* LOAD THE REGISTERS FOR THE VECTOR */ GFX_WAIT_PENDING; WRITE_REG16(GP_DST_XCOOR, x); WRITE_REG16(GP_DST_YCOOR, y); WRITE_REG16(GP_VECTOR_LENGTH, length); WRITE_REG16(GP_INIT_ERROR, initerr); WRITE_REG16(GP_AXIAL_ERROR, axialerr); WRITE_REG16(GP_DIAG_ERROR, diagerr); WRITE_REG16(GP_VECTOR_MODE, vector_mode); } /*--------------------------------------------------------------------------- * GFX_WAIT_UNTIL_IDLE * * This routine waits until the graphics engine is idle. This is required * before allowing direct access to the frame buffer. *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC void gu1_wait_until_idle(void) #else void gfx_wait_until_idle(void) #endif { GFX_WAIT_BUSY; } /*--------------------------------------------------------------------------- * GFX_TEST_BLT_PENDING * * This routine returns 1 if a BLT is pending, meaning that a call to * perform a rendering operation would stall. Otherwise it returns 0. * It is used by Darwin during random testing to only start a BLT * operation when it knows the Durango routines won't spin on graphics * (so Darwin can continue to do frame buffer reads and writes). *--------------------------------------------------------------------------- */ #if GFX_2DACCEL_DYNAMIC int gu1_test_blt_pending(void) #else int gfx_test_blt_pending(void) #endif { if (READ_REG16(GP_BLIT_STATUS) & BS_BLIT_PENDING) return (1); else return (0); } /*--------------------------------------------------------------------------- * BLT BUFFERS!!!!! *--------------------------------------------------------------------------- */ /* THE BOOT CODE MUST SET THE BLT BUFFER BASES USING THE "CPU_WRITE" */ /* INSTRUCTION TO ONE OF THE FOLLOWING VALUES: */ #define BB0_BASE_2K 0x800 #define BB1_BASE_2K 0xB30 #define BB0_BASE_3K 0x400 #define BB1_BASE_3K 0x930 /*--------------------------------------------------------------------------- * gu1_detect_blt_buffer_base * * This detection is hidden from the driver by being called from the * "gfx_set_bpp" routine. * * This is fairly ugly for the following reasons: * * - It is the boot code that must set the BLT buffer bases to the * appropriate values and load the scratchpad tags. * - The old drivers would also set the base address values to what they * knew they should be for the 2K or 3K scratchpad configuration. * - Unfortunately, to set the base addresses requires the use of the * CPU_WRITE instruction, an instruction specific to GX. * - Using the CPU_WRITE instruction requires the use of assembly to * produce the appropriate op codes. * - Assembly is something that is avoided in Durango because it is not * platform independent. Some compilers do not support inline assembly. * - Therefore Durango cannot use the CPU_WRITE instruction. * - Therefore drivers using Durango must rely on the boot code to set * the appropriate values. Durango uses this routine to check where * the base addresses have been set. * - Unfortunately, it is not as simple as using IO to check for 2K or 3K * scratchpad size. In VSA1, even though the boot code may set it for * 3K, SoftVGA comes along and resets it to 2K for it's use in text * redraws. It used to be that the display driver would set it back * to 3K. * - So, the Durango code was changed to just always use 2K. * - But, the XpressROM code sets it for 3K, and the newer versions of * SoftVGA do not interfere with that, so then Durango needs to use * the 3K values to work properly. * - Therefore, Durango does somewhat of a kludge by writing to directly * to the scratchpad at both the 2K and 3K locations, then performing * a unobtrusive BLT that loads data into BB0 (the graphics engine * always knows the true base). After the BLT, Durango looks to see * which location changed to know where the base address is. * - This is a relatively simple way to allow Durango to work on old * and new platforms without using theCPU_WRITE instructions. * * To summarize, the BLT buffers are one of the most painful aspects of * the GX graphics unit design, and have been removed from future designs * (the graphics unit has its own dedicated RAM). Durango has tried to * hide the BLT buffer use from the drivers. *--------------------------------------------------------------------------- */ void gu1_detect_blt_buffer_base(void) { /* ASSUME 2K */ GFXbb0Base = BB0_BASE_2K; GFXbb1Base = BB1_BASE_2K; /* CHECK IF SCRATCHPAD IS SET TO 3K OR 4K */ /* Boot code should still set 3K values for 4K. */ if (gfx_gxm_config_read(GXM_CONFIG_GCR) & 0x08) { /* WRITE DATA TO 3K LOCATION */ GFX_WAIT_BUSY; WRITE_SCRATCH32(BB0_BASE_3K, 0xFEEDFACE); /* HAVE THE GRAPHICS UNIT STORE SOMETHING IN BB0 */ WRITE_REG32(GP_DST_XCOOR, 0x00000000); /* AT (0,0) */ WRITE_REG32(GP_WIDTH, 0x00010004); /* 4x1 BLT */ WRITE_REG16(GP_RASTER_MODE, 0x00AA); /* KEEP DST */ WRITE_REG16(GP_BLIT_MODE, BM_READ_DST_FB0); /* STORE IN BB0 */ /* CHECK 3K LOCATION */ /* Breaks if data happened to be 0xFEEDFACE - unlikely. */ GFX_WAIT_BUSY; if (READ_SCRATCH32(BB0_BASE_3K) != 0xFEEDFACE) { GFXbb0Base = BB0_BASE_3K; GFXbb1Base = BB1_BASE_3K; } } } /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/i2c_gpio.c0000644000175000017500000003603612654445443015022 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to write to and read from the I2C bus using * the GPIO pins of the CS5530. * */ /* STATIC VARIABLES TO STORE WHAT GPIO PINS TO USE */ int gpio_clock = 0; int gpio_data = 0; static int g_initialized = 0; #define I2CWRITE 0x00 /* Write address */ #define I2CREAD 0x01 /* Read address */ #define I2CACK 0x00 /* Ack value */ #define I2CNACK 0x01 /* Not - ack value */ #define CS5530_ID (0x80000000 | (0x00<<16) | (0x12<<11) | (0<<8) | 0x00) #define CS5530_GPIO (0x80000000 | (0x00<<16) | (0x12<<11) | (0<<8) | 0x90) #define SDA 0x0800 #define SCL 0x0400 #define SDADIR 0x0008 #define SCLDIR 0x0004 int I2C_init(void); void I2C_cleanup(void); int I2C_Read(unsigned char address, unsigned int reg, unsigned long *p_value, unsigned int bytes); int I2C_Write(unsigned char address, unsigned int reg, unsigned long value, unsigned int bytes); int I2CAL_init(void); void I2CAL_cleanup(void); void I2CAL_output_clock(int state); void I2CAL_output_data(int state); unsigned char I2CAL_input_data(void); void I2CAL_set_data_for_input(void); void I2CAL_set_data_for_output(void); void SendI2CStart(void); void SendI2CData(unsigned char inData); unsigned char ReceiveI2CAck(void); void SendI2CStop(void); void SendI2CNack(void); void SendI2CAck(void); unsigned char ReceiveI2CData(void); /* ### ADD ### ANY LOCAL ROUTINE DEFINITIONS SPECIFIC TO GPIO */ /*--------------------------------------------------------------------------- * gfx_i2c_reset * * This routine resets the I2C bus. *--------------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC int gpio_i2c_reset(unsigned char busnum, short adr, char freq) #else int gfx_i2c_reset(unsigned char busnum, short adr, char freq) #endif { /* ### ADD ### Any code needed to reset the state of the GPIOs. */ return GFX_STATUS_OK; } /*--------------------------------------------------------------------------- * gfx_i2c_select_gpio * * This routine selects which GPIO pins to use. *--------------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC int gpio_i2c_select_gpio(int clock, int data) #else int gfx_i2c_select_gpio(int clock, int data) #endif { gpio_clock = clock; gpio_data = data; return (0); } /*--------------------------------------------------------------------------- * gfx_i2c_write * * This routine writes data to the specified I2C address. *--------------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC int gpio_i2c_write(unsigned char busnum, unsigned char address, unsigned char reg, unsigned char bytes, unsigned char *value) #else int gfx_i2c_write(unsigned char busnum, unsigned char address, unsigned char reg, unsigned char bytes, unsigned char *value) #endif { /* ### ADD ### CODE TO WRITE BYTE TO I2B BUS */ int restart_count = 0; while (restart_count++ < 5) { /* set the access pointer register. */ /* The address is shifted left by one to make room for Read/Write * bit */ SendI2CStart(); SendI2CData((char) ((address << 1) | I2CWRITE)); if (!ReceiveI2CAck()) { SendI2CStop(); gfx_delay_milliseconds(10); continue; } SendI2CData((unsigned char) reg); if (!ReceiveI2CAck()) { SendI2CStop(); gfx_delay_milliseconds(10); continue; } /* write the first byte */ SendI2CData(*value); if (!ReceiveI2CAck()) { SendI2CStop(); gfx_delay_milliseconds(10); continue; } /* write the second byte. */ if (bytes == 2) { SendI2CData(*(value + 1)); if (!ReceiveI2CAck()) { SendI2CStop(); gfx_delay_milliseconds(10); continue; } } /* done. */ SendI2CStop(); return 0; } return (0); } /*--------------------------------------------------------------------------- * gfx_i2c_read * * This routine reads data from the specified I2C address. *--------------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC int gpio_i2c_read(unsigned char busnum, unsigned char address, unsigned char reg, unsigned char bytes, unsigned char *p_value) #else int gfx_i2c_read(unsigned char busnum, unsigned char address, unsigned char reg, unsigned char bytes, unsigned char *p_value) #endif { /* ### ADD ### CODE TO WRITE BYTE TO I2B BUS */ /* For now return clock and data pins */ int restart_count = 0; if (!p_value) return (1); while (restart_count++ < 5) { /* set the access pointer register. */ /* The address is shifted left by one to make room for Read/Write * bit */ SendI2CStart(); SendI2CData((char) ((address << 1) | I2CWRITE)); if (!ReceiveI2CAck()) { SendI2CStop(); gfx_delay_milliseconds(10); continue; } SendI2CData((unsigned char) (reg & 0xFF)); SendI2CNack(); /* read the first data byte. */ SendI2CStart(); SendI2CData((char) ((address << 1) | I2CREAD)); if (!ReceiveI2CAck()) { SendI2CStop(); gfx_delay_milliseconds(10); continue; } *p_value = ReceiveI2CData(); /* read the second byte. */ if (bytes == 2) { SendI2CAck(); *(p_value + 1) = ReceiveI2CData(); } /* done. */ SendI2CNack(); SendI2CStop(); return 0; } return (1); } /* Added i2c/gpio code to test fs451 chip. */ /* * ---------------------------------------------------------------------- * * void SendI2CStart(void) * * Sends an I2C start signal on the bus. * *---------------------------------------------------------------------- */ void SendI2CStart(void) { I2CAL_output_data(1); I2CAL_output_clock(1); I2CAL_output_data(0); I2CAL_output_clock(0); } /* *---------------------------------------------------------------------- * * void SendI2CStop(void) * * Sends an I2C stop signal on the bus. * *---------------------------------------------------------------------- */ void SendI2CStop(void) { I2CAL_output_data(0); I2CAL_output_clock(1); I2CAL_output_data(1); } /* *---------------------------------------------------------------------- * * void SendI2CAck(void) * * Sends the Ack signal on the I2C bus. * *---------------------------------------------------------------------- */ void SendI2CAck(void) { I2CAL_output_data(0); I2CAL_output_clock(1); I2CAL_output_clock(0); } /* *---------------------------------------------------------------------- * * void SendI2CNack(void) * * Sends the Nt-Ack signal on the I2C bus. * *---------------------------------------------------------------------- */ void SendI2CNack(void) { I2CAL_output_data(1); I2CAL_output_clock(1); I2CAL_output_clock(0); } /* *---------------------------------------------------------------------- * * UInt8 SendI2CData( UInt8 inData ) * * Sends a byte of data on the I2C bus and returns the TRUE if the slave * ACK'dthe data. * * Input: inData - the byte of data to send * Output: (return) - TRUE (1) if ACK was received, FALSE (0) if not * *---------------------------------------------------------------------- */ void SendI2CData(unsigned char inData) { unsigned char bit; /* Send all 8 bits of data byte, MSB to LSB */ for (bit = 0x80; bit != 0; bit >>= 1) { if (inData & bit) I2CAL_output_data(1); else I2CAL_output_data(0); I2CAL_output_clock(1); I2CAL_output_clock(0); } } /* *---------------------------------------------------------------------- * * UInt8 ReceiveI2CAck( ) * * Receives the Ack (or Nack) from the slave. * * Output: (return) - TRUE (1) if ACK was received, FALSE (0) if not * *---------------------------------------------------------------------- */ unsigned char ReceiveI2CAck(void) { unsigned char bit; /* Test for Ack/Nack */ I2CAL_set_data_for_input(); I2CAL_output_data(1); I2CAL_output_clock(1); bit = I2CAL_input_data(); I2CAL_output_clock(0); I2CAL_set_data_for_output(); return !bit; } /* *---------------------------------------------------------------------- * * unsigned char ReceiveI2CData(void) * * Receives a byte of data from the I2C bus. * * Output: (return) - The data byte recehved from the bus * *---------------------------------------------------------------------- */ unsigned char ReceiveI2CData(void) { unsigned char data = 0; unsigned char x; /* make sure the data line is released */ I2CAL_set_data_for_input(); I2CAL_output_data(1); /* shift in the data */ for (x = 0; x < 8; x++) { /* shift the data left */ I2CAL_output_clock(1); data <<= 1; data |= I2CAL_input_data(); I2CAL_output_clock(0); } I2CAL_set_data_for_output(); I2CAL_output_data(1); return data; } /* *---------------------------------------------------------------------- * * void I2C_init(void) * * This routine initializes the I2C interface. Clients of the I2C.c * will call this routine before calling any other routine in the I2C.c * *---------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC int gpio_i2c_init(void) #else int gfx_i2c_init(void) #endif { int errc; /* init I2CAL */ errc = I2CAL_init(); if (errc) return errc; /* set the clock and data lines to the proper states */ I2CAL_output_clock(1); I2CAL_output_data(1); I2CAL_set_data_for_output(); SendI2CStart(); SendI2CStop(); SendI2CStop(); g_initialized = 1; return 0; } /* *---------------------------------------------------------------------- * * void I2C_cleanup(void) * * This routine disables the I2C interface. Clients of the I2C.c will not * call any other I2C routine after calling this routine. * *---------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC void gpio_i2c_cleanup(void) #else void gfx_i2c_cleanup(void) #endif { if (g_initialized) { /* set the clock and data lines to a harmless state */ I2CAL_output_clock(1); I2CAL_output_data(1); g_initialized = 0; } I2CAL_cleanup(); } int I2CAL_init(void) { unsigned long l_reg; unsigned short reg; /* initialize the i2c port. */ l_reg = gfx_pci_config_read(CS5530_GPIO); if (l_reg != 0x01001078) return 1; l_reg = gfx_pci_config_read(CS5530_GPIO); reg = (unsigned short) l_reg; /* both outputs, both high. */ reg |= (SDADIR | SCLDIR | SDA | SCL); l_reg = reg; gfx_pci_config_write(CS5530_GPIO, l_reg); g_initialized = 1; return 0; } void I2CAL_cleanup(void) { if (g_initialized) { g_initialized = 0; } } /* *---------------------------------------------------------------------------- * * set the I2C clock line state * *---------------------------------------------------------------------------- */ void I2CAL_output_clock(int inState) { unsigned short reg; unsigned long value; value = gfx_pci_config_read(CS5530_GPIO); reg = (unsigned short) value; if (inState) { /* write a 1. */ reg |= SCL; } else { /* write a 0. */ reg &= ~SCL; } value = reg; gfx_pci_config_write(CS5530_GPIO, value); /* hold it for a minimum of 4.7us */ gfx_delay_microseconds(5); } /* *---------------------------------------------------------------------------- * * set the I2C data line state * *---------------------------------------------------------------------------- */ void I2CAL_output_data(int inState) { unsigned short reg; unsigned long value; value = gfx_pci_config_read(CS5530_GPIO); reg = (unsigned short) value; if (inState) { /* write a 1. */ reg |= SDA; } else { /* write a 0. */ reg &= ~SDA; } value = reg; gfx_pci_config_write(CS5530_GPIO, value); /* 250 ns setup time */ gfx_delay_microseconds(1); } /* *---------------------------------------------------------------------------- * * read the state of the data line * *---------------------------------------------------------------------------- */ unsigned char I2CAL_input_data(void) { unsigned short reg; unsigned long value; value = gfx_pci_config_read(CS5530_GPIO); reg = (unsigned short) value; if (reg & SDA) return 1; else return 0; } /* *---------------------------------------------------------------------------- * * set the I2C data for input mode * *---------------------------------------------------------------------------- */ void I2CAL_set_data_for_input(void) { unsigned short reg; unsigned long value; value = gfx_pci_config_read(CS5530_GPIO); reg = (unsigned short) value; reg &= ~SDADIR; value = reg; gfx_pci_config_write(CS5530_GPIO, value); } /* *---------------------------------------------------------------------------- * * set the I2C data for output mode * *---------------------------------------------------------------------------- */ void I2CAL_set_data_for_output(void) { unsigned short reg; unsigned long value; value = gfx_pci_config_read(CS5530_GPIO); reg = (unsigned short) value; reg |= SDADIR; value = reg; gfx_pci_config_write(CS5530_GPIO, value); } /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_msr.c0000644000175000017500000001073612654445443014773 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to read machine-specific registers (MSRs) * * Routines: * * gfx_msr_init * gfx_id_msr_device * gfx_get_msr_dev_address * gfx_get_glink_id_at_address * gfx_msr_read * gfx_msr_write * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* INCLUDE SUPPORT FOR REDCLOUD, IF SPECIFIED */ #if GFX_MSR_REDCLOUD #include "msr_rdcl.c" #endif /* EXTRA WRAPPERS FOR DYNAMIC SELECTION */ #if GFX_MSR_DYNAMIC /*---------------------------------------------------------------------------- * gfx_msr_init *---------------------------------------------------------------------------- */ int gfx_msr_init() { int ret_value = 0; #if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_msr_init(); #endif return ret_value; } /*---------------------------------------------------------------------------- * gfx_id_msr_device *---------------------------------------------------------------------------- */ DEV_STATUS gfx_id_msr_device(MSR * pDev, unsigned long address) { DEV_STATUS ret_value = NOT_KNOWN; #if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_id_msr_device(pDev, address); #endif return ret_value; } /*---------------------------------------------------------------------------- * gfx_get_msr_dev_address *---------------------------------------------------------------------------- */ DEV_STATUS gfx_get_msr_dev_address(unsigned int device, unsigned long *address) { DEV_STATUS ret_value = NOT_KNOWN; #if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_get_msr_dev_address(device, address); #endif return ret_value; } /*---------------------------------------------------------------------------- * gfx_get_glink_id_at_address *---------------------------------------------------------------------------- */ DEV_STATUS gfx_get_glink_id_at_address(unsigned int *device, unsigned long address) { DEV_STATUS ret_value = NOT_KNOWN; #if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_get_glink_id_at_address(device, address); #endif return ret_value; } /*---------------------------------------------------------------------------- * gfx_msr_read *---------------------------------------------------------------------------- */ DEV_STATUS gfx_msr_read(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue) { DEV_STATUS ret_value = NOT_KNOWN; #if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_msr_read(device, msrRegister, msrValue); #endif return ret_value; } /*---------------------------------------------------------------------------- * gfx_msr_write *---------------------------------------------------------------------------- */ DEV_STATUS gfx_msr_write(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue) { DEV_STATUS ret_value = NOT_KNOWN; #if GFX_MSR_REDCLOUD if (gfx_msr_type & GFX_MSR_TYPE_REDCLOUD) ret_value = redcloud_msr_write(device, msrRegister, msrValue); #endif return ret_value; } #endif xf86-video-geode-2.11.18/src/gfx/gfx_defs.h0000644000175000017500000004164112654445443015117 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This header file contains the macros used to access the hardware. These * macros assume that 32-bit access is possible, which is true for most * applications. Projects using 16-bit compilers (the Windows98 display * driver) and special purpose applications (such as Darwin) need to define * their own versions of these macros, which typically call a subroutine. * */ /* ACCESS TO THE CPU REGISTERS */ #define WRITE_REG8(offset, value) \ (*(volatile unsigned char *)(gfx_virt_regptr + (offset))) = (value) #define WRITE_REG16(offset, value) \ (*(volatile unsigned short *)(gfx_virt_regptr + (offset))) = (value) #define WRITE_REG32(offset, value) \ (*(volatile unsigned long *)(gfx_virt_regptr + (offset))) = (value) #define READ_REG16(offset) \ (*(volatile unsigned short *)(gfx_virt_regptr + (offset))) #define READ_REG32(offset) \ (*(volatile unsigned long *)(gfx_virt_regptr + (offset))) /* ACCESS TO THE ACCELERATOR REGISTERS (REDCLOUD ONLY) */ #define WRITE_GP8(offset, value) \ (*(volatile unsigned char *)(gfx_virt_gpptr + (offset))) = (value) #define WRITE_GP16(offset, value) \ (*(volatile unsigned short *)(gfx_virt_gpptr + (offset))) = (value) #define WRITE_GP32(offset, value) \ (*(volatile unsigned long *)(gfx_virt_gpptr + (offset))) = (value) #define READ_GP16(offset) \ (*(volatile unsigned short *)(gfx_virt_gpptr + (offset))) #define READ_GP32(offset) \ (*(volatile unsigned long *)(gfx_virt_gpptr + (offset))) /* ACCESS TO THE FRAME BUFFER */ #define WRITE_FB32(offset, value) \ (*(volatile unsigned long *)(gfx_virt_fbptr + (offset))) = (value) #define WRITE_FB16(offset, value) \ (*(volatile unsigned short *)(gfx_virt_fbptr + (offset))) = (value) #define WRITE_FB8(offset, value) \ (*(volatile unsigned char *)(gfx_virt_fbptr + (offset))) = (value) /* ACCESS TO THE VIDEO HARDWARE */ #define READ_VID32(offset) \ (*(volatile unsigned long *)(gfx_virt_vidptr + (offset))) #define WRITE_VID32(offset, value) \ (*(volatile unsigned long *)(gfx_virt_vidptr + (offset))) = (value) /* ACCESS TO THE VIP HARDWARE */ #define READ_VIP32(offset) \ (*(volatile unsigned long *)(gfx_virt_vipptr + (offset))) #define WRITE_VIP32(offset, value) \ (*(volatile unsigned long *)(gfx_virt_vipptr + (offset))) = (value) /* ACCESS TO THE SCRATCHPAD RAM */ #define WRITE_SCRATCH32(offset, value) \ (*(volatile unsigned long *)(gfx_virt_spptr + (offset))) = (value) #define WRITE_SCRATCH16(offset, value) \ (*(volatile unsigned short *)(gfx_virt_spptr + (offset))) = (value) #define WRITE_SCRATCH8(offset, value) \ (*(volatile unsigned char *)(gfx_virt_spptr + (offset))) = (value) #define READ_SCRATCH16(offset) \ (*(volatile unsigned short *)(gfx_virt_spptr + (offset))) #define READ_SCRATCH32(offset) \ (*(volatile unsigned long *)(gfx_virt_spptr + (offset))) /* ACCESS TO MSRS */ void gfx_msr_asm_write(unsigned short msrReg, unsigned long msrAddr, unsigned long *ptrHigh, unsigned long *ptrLow); void gfx_msr_asm_read(unsigned short msrReg, unsigned long msrAddr, unsigned long *ptrHigh, unsigned long *ptrLow); #define MSR_READ( MBD_MSR_CAP, address, valueHigh_ptr, valueLow_ptr ) \ gfx_msr_asm_read( ((unsigned short)(MBD_MSR_CAP)), address, \ valueHigh_ptr, valueLow_ptr ) #define MSR_WRITE( MBD_MSR_CAP, address, valueHigh_ptr, valueLow_ptr ) \ gfx_msr_asm_write( ((unsigned short)(MBD_MSR_CAP)), address, \ valueHigh_ptr, valueLow_ptr ) /* OPTIMIZATION MACROS */ /* The following macros have been added to allow more complete optimization of * the bitmap-to-screen routines in Durango. These routines also allow * Durango to run properly within a 16-bit environment. * */ /***************************************************************************** * Macro: SET_SCRATCH_BASE * Purpose: Record the base address of the BLT buffers. The * WRITE_SCRATCH_STRINGxx macros assume that this address is used * as the base for all writes. * * Arguments: * scratch_base - offset into the GX base for the first BLT buffer byte. ****************************************************************************/ #define SET_SCRATCH_BASE(scratch_base) \ { gfx_gx1_scratch_base = (unsigned long)gfx_virt_spptr + scratch_base; } #ifdef GFX_OPTIMIZE_ASSEMBLY /***************************************************************************** * Macro: WRITE_SCRATCH_STRING * Purpose: Write multiple bytes to the scratchpad buffer * * Arguments: * dword_bytes - number of bytes to transfer. This number will always. * be a multiple of 4. It cannot be modified within the * macro (ex. bytes -= 4) * bytes_extra - number of non-DWORD aligned bytes * array - pointer to an array of unsigned characters. * array_offset - offset into the array from which to pull the first * character. ****************************************************************************/ #define WRITE_SCRATCH_STRING(dwords, bytes, array, array_offset) \ { \ _asm { mov edi, gfx_gx1_scratch_base } \ _asm { mov esi, array } \ _asm { add esi, array_offset } \ _asm { mov ecx, dwords } \ _asm { shr ecx, 2 } \ _asm { rep movsd } \ _asm { mov ecx, bytes } \ _asm { rep movsb } \ } /***************************************************************************** * Macro: WRITE_FRAME_BUFFER_STRING32 * Purpose: Write multiple dwords to the Frame buffer * * Arguments: * fboffset - offset to the beginning frame buffer location. * bytes - number of bytes to transfer. This number will always. * be a multiple of 4. It cannot be modified within the * macro (ex. bytes -= 4) * array - pointer to an array of unsigned characters. * array_offset - offset into the array from which to pull the first * character. ****************************************************************************/ #define WRITE_FRAME_BUFFER_STRING32(fboffset, bytes, array, array_offset) \ { \ _asm { mov ecx, bytes } \ _asm { shr ecx, 2 } \ _asm { cld } \ _asm { mov edi, gfx_virt_fbptr } \ _asm { add edi, fboffset } \ _asm { mov esi, array } \ _asm { add esi, array_offset } \ _asm { rep movsd } \ } #else /***************************************************************************** * Macro: WRITE_SCRATCH_STRING * Purpose: Write multiple bytes to the scratchpad buffer * * Arguments: * dword_bytes - number of bytes to transfer. This number will always. * be a multiple of 4. It cannot be modified within the * macro (ex. bytes -= 4) * bytes_extra - number of non-DWORD aligned bytes * array - pointer to an array of unsigned characters. * array_offset - offset into the array from which to pull the first * character. ****************************************************************************/ #define WRITE_SCRATCH_STRING(dword_bytes, bytes_extra, array, array_offset) \ { \ unsigned long i, j; \ unsigned long aroffset = (unsigned long)array + (array_offset); \ \ /* WRITE DWORDS */ \ \ for (i = 0; i < dword_bytes; i += 4) \ *((volatile unsigned long *)(gfx_gx1_scratch_base + i)) = \ *((unsigned long *)(aroffset + i)); \ \ /* WRITE BYTES */ \ \ j = i + bytes_extra; \ while (i < j) { \ *((volatile unsigned char *)(gfx_gx1_scratch_base + i)) = \ *((unsigned char *)(aroffset + i)); \ i++; \ } \ } /***************************************************************************** * Macro: WRITE_FRAME_BUFFER_STRING32 * Purpose: Write multiple dwords to the Frame buffer * * Arguments: * fboffset - offset to the beginning frame buffer location. * bytes - number of bytes to transfer. This number will always. * be a multiple of 4. It cannot be modified within the * macro (ex. bytes -= 4) * array - pointer to an array of unsigned characters. * array_offset - offset into the array from which to pull the first * character. ****************************************************************************/ #define WRITE_FRAME_BUFFER_STRING32(fboffset, bytes, array, array_offset) \ { \ unsigned long i; \ unsigned long aroffset = (unsigned long)array + (array_offset); \ for (i = 0; i < bytes; i += 4) \ WRITE_FB32 ((fboffset) + i, *((unsigned long *)(aroffset + i))); \ } #endif /***************************************************************************** * Macro: WRITE_FRAME_BUFFER_STRING8 * Purpose: Write multiple bytes to the frame buffer * * Arguments: * spoffset - offset to the beginning frame buffer location. * bytes - number of bytes to transfer. This number cannot be * modified within the macro (ex. bytes -= 4) * array - pointer to an array of unsigned characters. * array_offset - offset into the array from which to pull the first * character. ****************************************************************************/ #define WRITE_FRAME_BUFFER_STRING8(fboffset, bytes, array, array_offset) \ { \ unsigned long i; \ unsigned long aroffset = (unsigned long)array + (array_offset); \ for (i = 0; i < bytes; i++) \ WRITE_FB8 ((fboffset) + i, *((unsigned char *)(aroffset + i))); \ } /***************************************************************************** * Macro: WRITE_GPREG_STRING32 * Purpose: Write multiple dwords to one GP register. * * Arguments: * regoffset - Offset of the GP register to be written. * dwords - number of dwords to transfer. It cannot be modified * within the macro (ex. dwords--) * counter - name of a counter variable that can be used in a loop. * This is used to optimize macros written in C. * array - pointer to an array of unsigned characters. * array_offset - offset into the array from which to pull the first * character. * temp - name of a temporary variable that can be used for * calculations. * This argument is also used for C-only macros. ****************************************************************************/ #define WRITE_GPREG_STRING32(regoffset, dwords, counter, array, \ array_offset, temp) \ { \ temp = (unsigned long)array + (array_offset); \ for (counter = 0; counter < dwords; counter++) \ WRITE_GP32 (regoffset, *((unsigned long *)temp + counter)); \ } /***************************************************************************** * Macro: WRITE_GPREG_STRING8 * Purpose: Write 4 or less bytes to one GP register. * * Arguments: * regoffset - Offset of the GP register to be written. * bytes - number of bytes to transfer. This number will always. * be less than 4. It cannot be modified within the * macro (ex. bytes--) * shift - name of a shift variable that can be used as a shift * count. * This variable holds the initial shift value into the * GP register. * counter - name of a counter variable that can be used in a loop. * This is used to optimize macros written in C. * array - pointer to an array of unsigned characters. * array_offset - offset into the array from which to pull the first * character. * temp1 - name of a temporary variable that can be used for * calculations. * This argument is also used for C-only macros. * temp2 - name of a temporary variable that can be used for * calculations. * This argument is also used for C-only macros. ****************************************************************************/ #define WRITE_GPREG_STRING8(regoffset, bytes, shift, counter, array, \ array_offset, temp1, temp2) \ { \ if (bytes) { \ temp1 = (unsigned long)array + (array_offset); \ temp2 = 0; \ for (counter = 0; counter < bytes; counter++) { \ temp2 |= ((unsigned long)(*((unsigned char *)(temp1 + \ counter)))) << shift; \ shift += 8; \ } \ WRITE_GP32 (regoffset, temp2); \ } \ } /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_regs.h0000644000175000017500000015632512654445443015144 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This header file contains the graphics register definitions. * */ /*----------------------------------*/ /* FIRST GENERATION GRAPHICS UNIT */ /*----------------------------------*/ #define GP_DST_XCOOR 0x8100 /* x destination origin */ #define GP_DST_YCOOR 0x8102 /* y destination origin */ #define GP_WIDTH 0x8104 /* pixel width */ #define GP_HEIGHT 0x8106 /* pixel height */ #define GP_SRC_XCOOR 0x8108 /* x source origin */ #define GP_SRC_YCOOR 0x810A /* y source origin */ #define GP_VECTOR_LENGTH 0x8104 /* vector length */ #define GP_INIT_ERROR 0x8106 /* vector initial error */ #define GP_AXIAL_ERROR 0x8108 /* axial error increment */ #define GP_DIAG_ERROR 0x810A /* diagonal error increment */ #define GP_SRC_COLOR_0 0x810C /* source color 0 */ #define GP_SRC_COLOR_1 0x810E /* source color 1 */ #define GP_PAT_COLOR_0 0x8110 /* pattern color 0 */ #define GP_PAT_COLOR_1 0x8112 /* pattern color 1 */ #define GP_PAT_COLOR_2 0x8114 /* pattern color 2 */ #define GP_PAT_COLOR_3 0x8116 /* pattern color 3 */ #define GP_PAT_DATA_0 0x8120 /* bits 31:0 of pattern */ #define GP_PAT_DATA_1 0x8124 /* bits 63:32 of pattern */ #define GP_PAT_DATA_2 0x8128 /* bits 95:64 of pattern */ #define GP_PAT_DATA_3 0x812C /* bits 127:96 of pattern */ #define GP_VGA_WRITE 0x8140 /* VGA write path control */ #define GP_VGA_READ 0x8144 /* VGA read path control */ #define GP_RASTER_MODE 0x8200 /* raster operation */ #define GP_VECTOR_MODE 0x8204 /* vector mode register */ #define GP_BLIT_MODE 0x8208 /* blit mode register */ #define GP_BLIT_STATUS 0x820C /* blit status register */ #define GP_VGA_BASE 0x8210 /* VGA memory offset (x64K) */ #define GP_VGA_LATCH 0x8214 /* VGA display latch */ /* "GP_VECTOR_MODE" BIT DEFINITIONS */ #define VM_X_MAJOR 0x0000 /* X major vector */ #define VM_Y_MAJOR 0x0001 /* Y major vector */ #define VM_MAJOR_INC 0x0002 /* positive major axis step */ #define VM_MINOR_INC 0x0004 /* positive minor axis step */ #define VM_READ_DST_FB 0x0008 /* read destination data */ /* "GP_RASTER_MODE" BIT DEFINITIONS */ #define RM_PAT_DISABLE 0x0000 /* pattern is disabled */ #define RM_PAT_MONO 0x0100 /* 1BPP pattern expansion */ #define RM_PAT_DITHER 0x0200 /* 2BPP pattern expansion */ #define RM_PAT_COLOR 0x0300 /* 8BPP or 16BPP pattern */ #define RM_PAT_MASK 0x0300 /* mask for pattern mode */ #define RM_PAT_TRANSPARENT 0x0400 /* transparent 1BPP pattern */ #define RM_SRC_TRANSPARENT 0x0800 /* transparent 1BPP source */ /* "GP_BLIT_STATUS" BIT DEFINITIONS */ #define BS_BLIT_BUSY 0x0001 /* blit engine is busy */ #define BS_PIPELINE_BUSY 0x0002 /* graphics pipeline is busy */ #define BS_BLIT_PENDING 0x0004 /* blit pending */ #define BC_FLUSH 0x0080 /* flush pipeline requests */ #define BC_8BPP 0x0000 /* 8BPP mode */ #define BC_16BPP 0x0100 /* 16BPP mode */ #define BC_FB_WIDTH_1024 0x0000 /* framebuffer width = 1024 */ #define BC_FB_WIDTH_2048 0x0200 /* framebuffer width = 2048 */ #define BC_FB_WIDTH_4096 0x0400 /* framebuffer width = 4096 */ /* "GP_BLIT_MODE" BIT DEFINITIONS */ #define BM_READ_SRC_NONE 0x0000 /* source foreground color */ #define BM_READ_SRC_FB 0x0001 /* read source from FB */ #define BM_READ_SRC_BB0 0x0002 /* read source from BB0 */ #define BM_READ_SRC_BB1 0x0003 /* read source from BB1 */ #define BM_READ_SRC_MASK 0x0003 /* read source mask */ #define BM_READ_DST_NONE 0x0000 /* no destination data */ #define BM_READ_DST_BB0 0x0008 /* destination from BB0 */ #define BM_READ_DST_BB1 0x000C /* destination from BB1 */ #define BM_READ_DST_FB0 0x0010 /* dest from FB (store BB0) */ #define BM_READ_DST_FB1 0x0014 /* dest from FB (store BB1) */ #define BM_READ_DST_MASK 0x001C /* read destination mask */ #define BM_WRITE_FB 0x0000 /* write to framebuffer */ #define BM_WRITE_MEM 0x0020 /* write to memory */ #define BM_WRITE_MASK 0x0020 /* write mask */ #define BM_SOURCE_COLOR 0x0000 /* source is 8BPP or 16BPP */ #define BM_SOURCE_EXPAND 0x0040 /* source is 1BPP */ #define BM_SOURCE_TEXT 0x00C0 /* source is 1BPP text */ #define BM_SOURCE_MASK 0x00C0 /* source mask */ #define BM_REVERSE_Y 0x0100 /* reverse Y direction */ /*---------------------------------------*/ /* FIRST GENERATION DISPLAY CONTROLLER */ /*---------------------------------------*/ #define DC_UNLOCK 0x8300 /* lock register */ #define DC_GENERAL_CFG 0x8304 /* config registers... */ #define DC_TIMING_CFG 0x8308 #define DC_OUTPUT_CFG 0x830C #define DC_FB_ST_OFFSET 0x8310 /* framebuffer start offset */ #define DC_CB_ST_OFFSET 0x8314 /* compression start offset */ #define DC_CURS_ST_OFFSET 0x8318 /* cursor start offset */ #define DC_ICON_ST_OFFSET 0x831C /* icon start offset */ #define DC_VID_ST_OFFSET 0x8320 /* video start offset */ #define DC_LINE_DELTA 0x8324 /* fb and cb skip counts */ #define DC_BUF_SIZE 0x8328 /* fb and cb line size */ #define DC_H_TIMING_1 0x8330 /* horizontal timing... */ #define DC_H_TIMING_2 0x8334 #define DC_H_TIMING_3 0x8338 #define DC_FP_H_TIMING 0x833C #define DC_V_TIMING_1 0x8340 /* vertical timing... */ #define DC_V_TIMING_2 0x8344 #define DC_V_TIMING_3 0x8348 #define DC_FP_V_TIMING 0x834C #define DC_CURSOR_X 0x8350 /* cursor x position */ #define DC_ICON_X 0x8354 /* HACK - 1.3 definition */ #define DC_V_LINE_CNT 0x8354 /* vertical line counter */ #define DC_CURSOR_Y 0x8358 /* cursor y position */ #define DC_ICON_Y 0x835C /* HACK - 1.3 definition */ #define DC_SS_LINE_CMP 0x835C /* line compare value */ #define DC_CURSOR_COLOR 0x8360 /* cursor colors */ #define DC_ICON_COLOR 0x8364 /* icon colors */ #define DC_BORDER_COLOR 0x8368 /* border color */ #define DC_PAL_ADDRESS 0x8370 /* palette address */ #define DC_PAL_DATA 0x8374 /* palette data */ #define DC_DFIFO_DIAG 0x8378 /* display FIFO diagnostic */ #define DC_CFIFO_DIAG 0x837C /* compression FIF0 diagnostic */ /* PALETTE LOCATIONS */ #define PAL_CURSOR_COLOR_0 0x100 #define PAL_CURSOR_COLOR_1 0x101 #define PAL_ICON_COLOR_0 0x102 #define PAL_ICON_COLOR_1 0x103 #define PAL_OVERSCAN_COLOR 0x104 /* UNLOCK VALUE */ #define DC_UNLOCK_VALUE 0x00004758 /* used to unlock DC regs */ /* "DC_GENERAL_CFG" BIT DEFINITIONS */ #define DC_GCFG_DFLE 0x00000001 /* display FIFO load enable */ #define DC_GCFG_CURE 0x00000002 /* cursor enable */ #define DC_GCFG_VCLK_DIV 0x00000004 /* vid clock divisor */ #define DC_GCFG_PLNO 0x00000004 /* planar offset LSB */ #define DC_GCFG_PPC 0x00000008 /* pixel pan compatibility */ #define DC_GCFG_CMPE 0x00000010 /* compression enable */ #define DC_GCFG_DECE 0x00000020 /* decompression enable */ #define DC_GCFG_DCLK_MASK 0x000000C0 /* dotclock multiplier */ #define DC_GCFG_DCLK_POS 6 /* dotclock multiplier */ #define DC_GCFG_DFHPSL_MASK 0x00000F00 /* FIFO high-priority start */ #define DC_GCFG_DFHPSL_POS 8 /* FIFO high-priority start */ #define DC_GCFG_DFHPEL_MASK 0x0000F000 /* FIFO high-priority end */ #define DC_GCFG_DFHPEL_POS 12 /* FIFO high-priority end */ #define DC_GCFG_CIM_MASK 0x00030000 /* compressor insert mode */ #define DC_GCFG_CIM_POS 16 /* compressor insert mode */ #define DC_GCFG_FDTY 0x00040000 /* frame dirty mode */ #define DC_GCFG_RTPM 0x00080000 /* real-time perf. monitor */ #define DC_GCFG_DAC_RS_MASK 0x00700000 /* DAC register selects */ #define DC_GCFG_DAC_RS_POS 20 /* DAC register selects */ #define DC_GCFG_CKWR 0x00800000 /* clock write */ #define DC_GCFG_LDBL 0x01000000 /* line double */ #define DC_GCFG_DIAG 0x02000000 /* FIFO diagnostic mode */ #define DC_GCFG_CH4S 0x04000000 /* sparse refresh mode */ #define DC_GCFG_SSLC 0x08000000 /* enable line compare */ #define DC_GCFG_VIDE 0x10000000 /* video enable */ #define DC_GCFG_DFCK 0x20000000 /* divide flat-panel clock */ /* - rev 2.3 down */ #define DC_GCFG_VRDY 0x20000000 /* video port speed */ /* - rev 2.4 up */ #define DC_GCFG_DPCK 0x40000000 /* divide pixel clock */ #define DC_GCFG_DDCK 0x80000000 /* divide dot clock */ /* "DC_TIMING_CFG" BIT DEFINITIONS */ #define DC_TCFG_FPPE 0x00000001 /* flat-panel power enable */ #define DC_TCFG_HSYE 0x00000002 /* horizontal sync enable */ #define DC_TCFG_VSYE 0x00000004 /* vertical sync enable */ #define DC_TCFG_BLKE 0x00000008 /* blank enable */ #define DC_TCFG_DDCK 0x00000010 /* DDC clock */ #define DC_TCFG_TGEN 0x00000020 /* timing generator enable */ #define DC_TCFG_VIEN 0x00000040 /* vertical interrupt enable */ #define DC_TCFG_BLNK 0x00000080 /* blink enable */ #define DC_TCFG_CHSP 0x00000100 /* horizontal sync polarity */ #define DC_TCFG_CVSP 0x00000200 /* vertical sync polarity */ #define DC_TCFG_FHSP 0x00000400 /* panel horz sync polarity */ #define DC_TCFG_FVSP 0x00000800 /* panel vert sync polarity */ #define DC_TCFG_FCEN 0x00001000 /* flat-panel centering */ #define DC_TCFG_CDCE 0x00002000 /* HACK - 1.3 definition */ #define DC_TCFG_PLNR 0x00002000 /* planar mode enable */ #define DC_TCFG_INTL 0x00004000 /* interlace scan */ #define DC_TCFG_PXDB 0x00008000 /* pixel double */ #define DC_TCFG_BKRT 0x00010000 /* blink rate */ #define DC_TCFG_PSD_MASK 0x000E0000 /* power sequence delay */ #define DC_TCFG_PSD_POS 17 /* power sequence delay */ #define DC_TCFG_DDCI 0x08000000 /* DDC input (RO) */ #define DC_TCFG_SENS 0x10000000 /* monitor sense (RO) */ #define DC_TCFG_DNA 0x20000000 /* display not active (RO) */ #define DC_TCFG_VNA 0x40000000 /* vertical not active (RO) */ #define DC_TCFG_VINT 0x80000000 /* vertical interrupt (RO) */ /* "DC_OUTPUT_CFG" BIT DEFINITIONS */ #define DC_OCFG_8BPP 0x00000001 /* 8/16 bpp select */ #define DC_OCFG_555 0x00000002 /* 16 bpp format */ #define DC_OCFG_PCKE 0x00000004 /* PCLK enable */ #define DC_OCFG_FRME 0x00000008 /* frame rate mod enable */ #define DC_OCFG_DITE 0x00000010 /* dither enable */ #define DC_OCFG_2PXE 0x00000020 /* 2 pixel enable */ #define DC_OCFG_2XCK 0x00000040 /* 2 x pixel clock */ #define DC_OCFG_2IND 0x00000080 /* 2 index enable */ #define DC_OCFG_34ADD 0x00000100 /* 3- or 4-bit add */ #define DC_OCFG_FRMS 0x00000200 /* frame rate mod select */ #define DC_OCFG_CKSL 0x00000400 /* clock select */ #define DC_OCFG_PRMP 0x00000800 /* palette re-map */ #define DC_OCFG_PDEL 0x00001000 /* panel data enable low */ #define DC_OCFG_PDEH 0x00002000 /* panel data enable high */ #define DC_OCFG_CFRW 0x00004000 /* comp line buffer r/w sel */ #define DC_OCFG_DIAG 0x00008000 /* comp line buffer diag */ #define MC_MEM_CNTRL1 0x00008400 #define MC_DR_ADD 0x00008418 #define MC_DR_ACC 0x0000841C /* MC_MEM_CNTRL1 BIT DEFINITIONS */ #define MC_XBUSARB 0x00000008 /* 0 = GP priority < CPU priority */ /* 1 = GP priority = CPU priority */ /* GXm databook V2.0 is wrong ! */ /*----------*/ /* CS5530 */ /*----------*/ /* CS5530 REGISTER DEFINITIONS */ #define CS5530_VIDEO_CONFIG 0x0000 #define CS5530_DISPLAY_CONFIG 0x0004 #define CS5530_VIDEO_X_POS 0x0008 #define CS5530_VIDEO_Y_POS 0x000C #define CS5530_VIDEO_SCALE 0x0010 #define CS5530_VIDEO_COLOR_KEY 0x0014 #define CS5530_VIDEO_COLOR_MASK 0x0018 #define CS5530_PALETTE_ADDRESS 0x001C #define CS5530_PALETTE_DATA 0x0020 #define CS5530_DOT_CLK_CONFIG 0x0024 #define CS5530_CRCSIG_TFT_TV 0x0028 /* "CS5530_VIDEO_CONFIG" BIT DEFINITIONS */ #define CS5530_VCFG_VID_EN 0x00000001 #define CS5530_VCFG_VID_REG_UPDATE 0x00000002 #define CS5530_VCFG_VID_INP_FORMAT 0x0000000C #define CS5530_VCFG_8_BIT_4_2_0 0x00000004 #define CS5530_VCFG_16_BIT_4_2_0 0x00000008 #define CS5530_VCFG_GV_SEL 0x00000010 #define CS5530_VCFG_CSC_BYPASS 0x00000020 #define CS5530_VCFG_X_FILTER_EN 0x00000040 #define CS5530_VCFG_Y_FILTER_EN 0x00000080 #define CS5530_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 #define CS5530_VCFG_INIT_READ_MASK 0x01FF0000 #define CS5530_VCFG_EARLY_VID_RDY 0x02000000 #define CS5530_VCFG_LINE_SIZE_UPPER 0x08000000 #define CS5530_VCFG_4_2_0_MODE 0x10000000 #define CS5530_VCFG_16_BIT_EN 0x20000000 #define CS5530_VCFG_HIGH_SPD_INT 0x40000000 /* "CS5530_DISPLAY_CONFIG" BIT DEFINITIONS */ #define CS5530_DCFG_DIS_EN 0x00000001 #define CS5530_DCFG_HSYNC_EN 0x00000002 #define CS5530_DCFG_VSYNC_EN 0x00000004 #define CS5530_DCFG_DAC_BL_EN 0x00000008 #define CS5530_DCFG_DAC_PWDNX 0x00000020 #define CS5530_DCFG_FP_PWR_EN 0x00000040 #define CS5530_DCFG_FP_DATA_EN 0x00000080 #define CS5530_DCFG_CRT_HSYNC_POL 0x00000100 #define CS5530_DCFG_CRT_VSYNC_POL 0x00000200 #define CS5530_DCFG_FP_HSYNC_POL 0x00000400 #define CS5530_DCFG_FP_VSYNC_POL 0x00000800 #define CS5530_DCFG_XGA_FP 0x00001000 #define CS5530_DCFG_FP_DITH_EN 0x00002000 #define CS5530_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 #define CS5530_DCFG_CRT_SYNC_SKW_INIT 0x00010000 #define CS5530_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 #define CS5530_DCFG_PWR_SEQ_DLY_INIT 0x00080000 #define CS5530_DCFG_VG_CK 0x00100000 #define CS5530_DCFG_GV_PAL_BYP 0x00200000 #define CS5530_DCFG_DDC_SCL 0x00400000 #define CS5530_DCFG_DDC_SDA 0x00800000 #define CS5530_DCFG_DDC_OE 0x01000000 #define CS5530_DCFG_16_BIT_EN 0x02000000 /*----------*/ /* SC1200 */ /*----------*/ /* SC1200 VIDEO REGISTER DEFINITIONS */ #define SC1200_VIDEO_CONFIG 0x000 #define SC1200_DISPLAY_CONFIG 0x004 #define SC1200_VIDEO_X_POS 0x008 #define SC1200_VIDEO_Y_POS 0x00C #define SC1200_VIDEO_UPSCALE 0x010 #define SC1200_VIDEO_COLOR_KEY 0x014 #define SC1200_VIDEO_COLOR_MASK 0x018 #define SC1200_PALETTE_ADDRESS 0x01C #define SC1200_PALETTE_DATA 0x020 #define SC1200_VID_MISC 0x028 #define SC1200_VID_CLOCK_SELECT 0x02C #define SC1200_VIDEO_DOWNSCALER_CONTROL 0x03C #define SC1200_VIDEO_DOWNSCALER_COEFFICIENTS 0x40 #define SC1200_VID_CRC 0x044 #define SC1200_DEVICE_ID 0x048 #define SC1200_VID_ALPHA_CONTROL 0x04C #define SC1200_CURSOR_COLOR_KEY 0x050 #define SC1200_CURSOR_COLOR_MASK 0x054 #define SC1200_CURSOR_COLOR_1 0x058 #define SC1200_CURSOR_COLOR_2 0x05C #define SC1200_ALPHA_XPOS_1 0x060 #define SC1200_ALPHA_YPOS_1 0x064 #define SC1200_ALPHA_COLOR_1 0x068 #define SC1200_ALPHA_CONTROL_1 0x06C #define SC1200_ALPHA_XPOS_2 0x070 #define SC1200_ALPHA_YPOS_2 0x074 #define SC1200_ALPHA_COLOR_2 0x078 #define SC1200_ALPHA_CONTROL_2 0x07C #define SC1200_ALPHA_XPOS_3 0x080 #define SC1200_ALPHA_YPOS_3 0x084 #define SC1200_ALPHA_COLOR_3 0x088 #define SC1200_ALPHA_CONTROL_3 0x08C #define SC1200_VIDEO_REQUEST 0x090 #define SC1200_ALPHA_WATCH 0x094 #define SC1200_VIDEO_DISPLAY_MODE 0x400 #define SC1200_VIDEO_ODD_VBI_LINE_ENABLE 0x40C #define SC1200_VIDEO_EVEN_VBI_LINE_ENABLE 0x410 #define SC1200_VIDEO_VBI_HORIZ_CONTROL 0x414 #define SC1200_VIDEO_ODD_VBI_TOTAL_COUNT 0x418 #define SC1200_VIDEO_EVEN_VBI_TOTAL_COUNT 0x41C #define SC1200_GENLOCK 0x420 #define SC1200_GENLOCK_DELAY 0x424 #define SC1200_TVOUT_HORZ_TIM 0x800 #define SC1200_TVOUT_HORZ_SYNC 0x804 #define SC1200_TVOUT_VERT_SYNC 0x808 #define SC1200_TVOUT_LINE_END 0x80C #define SC1200_TVOUT_VERT_DOWNSCALE 0x810 /* REV. A & B */ #define SC1200_TVOUT_HORZ_PRE_ENCODER_SCALE 0x810 /* REV. C */ #define SC1200_TVOUT_HORZ_SCALING 0x814 #define SC1200_TVOUT_DEBUG 0x818 #define SC1200_TVENC_TIM_CTRL_1 0xC00 #define SC1200_TVENC_TIM_CTRL_2 0xC04 #define SC1200_TVENC_TIM_CTRL_3 0xC08 #define SC1200_TVENC_SUB_FREQ 0xC0C #define SC1200_TVENC_DISP_POS 0xC10 #define SC1200_TVENC_DISP_SIZE 0xC14 #define SC1200_TVENC_CC_DATA 0xC18 #define SC1200_TVENC_EDS_DATA 0xC1C #define SC1200_TVENC_CGMS_DATA 0xC20 #define SC1200_TVENC_WSS_DATA 0xC24 #define SC1200_TVENC_CC_CONTROL 0xC28 #define SC1200_TVENC_DAC_CONTROL 0xC2C #define SC1200_TVENC_MV_CONTROL 0xC30 /* "SC1200_VIDEO_CONFIG" BIT DEFINITIONS */ #define SC1200_VCFG_VID_EN 0x00000001 #define SC1200_VCFG_VID_INP_FORMAT 0x0000000C #define SC1200_VCFG_UYVY_FORMAT 0x00000000 #define SC1200_VCFG_Y2YU_FORMAT 0x00000004 #define SC1200_VCFG_YUYV_FORMAT 0x00000008 #define SC1200_VCFG_YVYU_FORMAT 0x0000000C #define SC1200_VCFG_X_FILTER_EN 0x00000040 #define SC1200_VCFG_Y_FILTER_EN 0x00000080 #define SC1200_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 #define SC1200_VCFG_INIT_READ_MASK 0x01FF0000 #define SC1200_VCFG_LINE_SIZE_UPPER 0x08000000 #define SC1200_VCFG_4_2_0_MODE 0x10000000 /* "SC1200_DISPLAY_CONFIG" BIT DEFINITIONS */ #define SC1200_DCFG_DIS_EN 0x00000001 #define SC1200_DCFG_HSYNC_EN 0x00000002 #define SC1200_DCFG_VSYNC_EN 0x00000004 #define SC1200_DCFG_DAC_BL_EN 0x00000008 #define SC1200_DCFG_FP_PWR_EN 0x00000040 #define SC1200_DCFG_FP_DATA_EN 0x00000080 #define SC1200_DCFG_CRT_HSYNC_POL 0x00000100 #define SC1200_DCFG_CRT_VSYNC_POL 0x00000200 #define SC1200_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 #define SC1200_DCFG_CRT_SYNC_SKW_INIT 0x00010000 #define SC1200_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 #define SC1200_DCFG_PWR_SEQ_DLY_INIT 0x00080000 #define SC1200_DCFG_VG_CK 0x00100000 #define SC1200_DCFG_GV_PAL_BYP 0x00200000 #define SC1200_DCFG_DDC_SCL 0x00400000 #define SC1200_DCFG_DDC_SDA 0x00800000 #define SC1200_DCFG_DDC_OE 0x01000000 /* "SC1200_VID_MISC" BIT DEFINITIONS */ #define SC1200_GAMMA_BYPASS_BOTH 0x00000001 #define SC1200_DAC_POWER_DOWN 0x00000400 #define SC1200_ANALOG_POWER_DOWN 0x00000800 #define SC1200_PLL_POWER_NORMAL 0x00001000 /* "SC1200_VIDEO_DOWNSCALER_CONTROL" BIT DEFINITIONS */ #define SC1200_VIDEO_DOWNSCALE_ENABLE 0x00000001 #define SC1200_VIDEO_DOWNSCALE_FACTOR_POS 1 #define SC1200_VIDEO_DOWNSCALE_FACTOR_MASK 0x0000001E #define SC1200_VIDEO_DOWNSCALE_TYPE_A 0x00000000 #define SC1200_VIDEO_DOWNSCALE_TYPE_B 0x00000040 #define SC1200_VIDEO_DOWNSCALE_TYPE_MASK 0x00000040 /* "SC1200_VIDEO_DOWNSCALER_COEFFICIENTS" BIT DEFINITIONS */ #define SC1200_VIDEO_DOWNSCALER_COEF1_POS 0 #define SC1200_VIDEO_DOWNSCALER_COEF2_POS 8 #define SC1200_VIDEO_DOWNSCALER_COEF3_POS 16 #define SC1200_VIDEO_DOWNSCALER_COEF4_POS 24 #define SC1200_VIDEO_DOWNSCALER_COEF_MASK 0xF /* VIDEO DE-INTERLACING AND ALPHA CONTROL (REGISTER 0x4C) */ #define SC1200_VERTICAL_SCALER_SHIFT_MASK 0x00000007 #define SC1200_VERTICAL_SCALER_SHIFT_INIT 0x00000004 #define SC1200_VERTICAL_SCALER_SHIFT_EN 0x00000010 #define SC1200_TOP_LINE_IN_ODD 0x00000040 #define SC1200_NO_CK_OUTSIDE_ALPHA 0x00000100 #define SC1200_VIDEO_IS_INTERLACED 0x00000200 #define SC1200_CSC_VIDEO_YUV_TO_RGB 0x00000400 #define SC1200_CSC_GFX_RGB_TO_YUV 0x00000800 #define SC1200_VIDEO_INPUT_IS_RGB 0x00002000 #define SC1200_VIDEO_LINE_OFFSET_ODD 0x00001000 #define SC1200_ALPHA1_PRIORITY_POS 16 #define SC1200_ALPHA1_PRIORITY_MASK 0x00030000 #define SC1200_ALPHA2_PRIORITY_POS 18 #define SC1200_ALPHA2_PRIORITY_MASK 0x000C0000 #define SC1200_ALPHA3_PRIORITY_POS 20 #define SC1200_ALPHA3_PRIORITY_MASK 0x00300000 /* VIDEO CURSOR COLOR KEY DEFINITIONS (REGISTER 0x50) */ #define SC1200_CURSOR_COLOR_KEY_OFFSET_POS 24 #define SC1200_CURSOR_COLOR_BITS 23 #define SC1200_COLOR_MASK 0x00FFFFFF /* 24 significant * bits */ /* ALPHA COLOR BIT DEFINITION (REGISTERS 0x68, 0x78, AND 0x88) */ #define SC1200_ALPHA_COLOR_ENABLE 0x01000000 /* ALPHA CONTROL BIT DEFINITIONS (REGISTERS 0x6C, 0x7C, AND 0x8C) */ #define SC1200_ACTRL_WIN_ENABLE 0x00010000 #define SC1200_ACTRL_LOAD_ALPHA 0x00020000 /* VIDEO REQUEST DEFINITIONS (REGISTER 0x90) */ #define SC1200_VIDEO_Y_REQUEST_POS 0 #define SC1200_VIDEO_X_REQUEST_POS 16 #define SC1200_VIDEO_REQUEST_MASK 0x00000FFF /* VIDEO DISPLAY MODE (REGISTER 0x400) */ #define SC1200_VIDEO_SOURCE_MASK 0x00000003 #define SC1200_VIDEO_SOURCE_GX1 0x00000000 #define SC1200_VIDEO_SOURCE_DVIP 0x00000002 #define SC1200_VBI_SOURCE_MASK 0x00000004 #define SC1200_VBI_SOURCE_DVIP 0x00000000 #define SC1200_VBI_SOURCE_GX1 0x00000004 /* ODD/EVEN VBI LINE ENABLE (REGISTERS 0x40C, 0x410) */ #define SC1200_VIDEO_VBI_LINE_ENABLE_MASK 0x00FFFFFC #define SC1200_VIDEO_ALL_ACTIVE_IS_VBI 0x01000000 #define SC1200_VIDEO_VBI_LINE_OFFSET_POS 25 #define SC1200_VIDEO_VBI_LINE_OFFSET_MASK 0x3E000000 /* ODD/EVEN VBI TOTAL COUNT (REGISTERS 0x418, 0x41C) */ #define SC1200_VIDEO_VBI_TOTAL_COUNT_MASK 0x000FFFFF /* GENLOCK BIT DEFINITIONS */ #define SC1200_GENLOCK_SINGLE_ENABLE 0x00000001 #define SC1200_GENLOCK_FIELD_SYNC_ENABLE 0x00000001 #define SC1200_GENLOCK_CONTINUOUS_ENABLE 0x00000002 #define SC1200_GENLOCK_GX_VSYNC_FALLING_EDGE 0x00000004 #define SC1200_GENLOCK_VIP_VSYNC_FALLING_EDGE 0x00000008 #define SC1200_GENLOCK_TIMEOUT_ENABLE 0x00000010 #define SC1200_GENLOCK_TVENC_RESET_EVEN_FIELD 0x00000020 #define SC1200_GENLOCK_TVENC_RESET_BEFORE_DELAY 0x00000040 #define SC1200_GENLOCK_TVENC_RESET_ENABLE 0x00000080 #define SC1200_GENLOCK_SYNC_TO_TVENC 0x00000100 #define SC1200_GENLOCK_DELAY_MASK 0x001FFFFF /* TVOUT HORIZONTAL PRE ENCODER SCALE BIT DEFINITIONS */ #define SC1200_TVOUT_YC_DELAY_MASK 0x00C00000 #define SC1200_TVOUT_YC_DELAY_NONE 0x00000000 #define SC1200_TVOUT_Y_DELAY_ONE_PIXEL 0x00400000 #define SC1200_TVOUT_C_DELAY_ONE_PIXEL 0x00800000 #define SC1200_TVOUT_C_DELAY_TWO_PIXELS 0x00C00000 /* TVOUT HORIZONTAL SCALING/CONTROL BIT DEFINITIONS */ #define SC1200_TVOUT_FLICKER_FILTER_MASK 0x60000000 #define SC1200_TVOUT_FLICKER_FILTER_FOURTH_HALF_FOURTH 0x00000000 #define SC1200_TVOUT_FLICKER_FILTER_HALF_ONE_HALF 0x20000000 #define SC1200_TVOUT_FLICKER_FILTER_DISABLED 0x40000000 #define SC1200_TVENC_EXTERNAL_RESET_INTERVAL_MASK 0x0F000000 #define SC1200_TVENC_EXTERNAL_RESET_EVERY_ODD_FIELD 0x00000000 #define SC1200_TVENC_EXTERNAL_RESET_EVERY_EVEN_FIELD 0x02000000 #define SC1200_TVENC_EXTERNAL_RESET_NEXT_ODD_FIELD 0x05000000 #define SC1200_TVENC_EXTERNAL_RESET_NEXT_EVEN_FIELD 0x07000000 #define SC1200_TVENC_EXTERNAL_RESET_EVERY_FIELD 0x0E000000 #define SC1200_TVENC_EXTERNAL_RESET_EVERY_X_ODD_FIELDS 0x08000000 #define SC1200_TVENC_EXTERNAL_RESET_EVERY_X_EVEN_FIELDS 0x0A000000 /* TVOUT DEBUG BIT DEFINITIONS */ #define SC1200_TVOUT_FIELD_STATUS_EVEN 0x00000040 #define SC1200_TVOUT_FIELD_STATUS_TV 0x00000080 #define SC1200_TVOUT_CRT_VSYNC_STATUS_TRAILING 0x00000100 #define SC1200_TVOUT_FIELD_STATUS_INVERT 0x00000200 #define SC1200_TVOUT_CONVERTER_INTERPOLATION 0x00000400 /* TVENC TIMING/CONTROL 1 BIT DEFINITIONS (REGISTER 0xC00) */ #define SC1200_TVENC_VPHASE_MASK 0x001FF800 #define SC1200_TVENC_VPHASE_POS 11 #define SC1200_TVENC_SUB_CARRIER_RESET_MASK 0x30000000 #define SC1200_TVENC_SUB_CARRIER_RESET_NEVER 0x00000000 #define SC1200_TVENC_SUB_CARRIER_RESET_EVERY_TWO_LINES 0x10000000 #define SC1200_TVENC_SUB_CARRIER_RESET_EVERY_TWO_FRAMES 0x20000000 #define SC1200_TVENC_SUB_CARRIER_RESET_EVERY_FOUR_FRAMES 0x30000000 #define SC1200_TVENC_VIDEO_TIMING_ENABLE 0x80000000 /* TVENC TIMING/CONTROL 2 BIT DEFINITIONS (REGISTER 0xC04) */ #define SC1200_TVENC_OUTPUT_YCBCR 0x40000000 #define SC1200_TVENC_CFS_MASK 0x00030000 #define SC1200_TVENC_CFS_BYPASS 0x00000000 #define SC1200_TVENC_CFS_CVBS 0x00020000 #define SC1200_TVENC_CFS_SVIDEO 0x00030000 /* TVENC TIMING/CONTROL 3 BIT DEFINITIONS (REGISTER 0xC08) */ #define SC1200_TVENC_CS 0x00000001 #define SC1200_TVENC_SYNCMODE_MASK 0x00000006 #define SC1200_TVENC_SYNC_ON_GREEN 0x00000002 #define SC1200_TVENC_SYNC_ON_CVBS 0x00000004 #define SC1200_TVENC_CM 0x00000008 /* TVENC DAC CONTROL BIT DEFINITIONS (REGISTER 0xC2C) */ #define SC1200_TVENC_TRIM_MASK 0x00000007 #define SC1200_TVENC_POWER_DOWN 0x00000020 /* TVENC MV CONTROL BIT DEFINITIONS (REGISTER 0xC30) */ #define SC1200_TVENC_MV_ENABLE 0xBE /* SC1200 VIP REGISTER DEFINITIONS */ #define SC1200_VIP_CONFIG 0x00000000 #define SC1200_VIP_CONTROL 0x00000004 #define SC1200_VIP_STATUS 0x00000008 #define SC1200_VIP_CURRENT_LINE 0x00000010 #define SC1200_VIP_LINE_TARGET 0x00000014 #define SC1200_ODD_DIRECT_VBI_LINE_ENABLE 0x00000018 #define SC1200_EVEN_DIRECT_VBI_LINE_ENABLE 0x0000001C #define SC1200_VIP_ODD_BASE 0x00000020 #define SC1200_VIP_EVEN_BASE 0x00000024 #define SC1200_VIP_PITCH 0x00000028 #define SC1200_VBI_ODD_BASE 0x00000040 #define SC1200_VBI_EVEN_BASE 0x00000044 #define SC1200_VBI_PITCH 0x00000048 /* "SC1200_VIP_CONFIG" BIT DEFINITIONS */ #define SC1200_VIP_MODE_MASK 0x00000003 #define SC1200_VIP_MODE_C 0x00000002 #define SC1200_VBI_ANCILLARY_TO_MEMORY 0x000C0000 #define SC1200_VBI_TASK_A_TO_MEMORY 0x00140000 #define SC1200_VBI_TASK_B_TO_MEMORY 0x00240000 #define SC1200_VIP_BUS_REQUEST_THRESHOLD 0x00400000 /* "SC1200_VIP_CONTROL" BIT DEFINITIONS */ #define SC1200_CAPTURE_RUN_MODE_MASK 0x00000003 #define SC1200_CAPTURE_RUN_MODE_STOP_LINE 0x00000000 #define SC1200_CAPTURE_RUN_MODE_STOP_FIELD 0x00000001 #define SC1200_CAPTURE_RUN_MODE_START 0x00000003 #define SC1200_VIP_DATA_CAPTURE_EN 0x00000100 #define SC1200_VIP_VBI_CAPTURE_EN 0x00000200 #define SC1200_VIP_VBI_FIELD_INTERRUPT_EN 0x00010000 /* "SC1200_VIP_STATUS" BIT DEFINITIONS */ #define SC1200_VIP_CURRENT_FIELD_ODD 0x01000000 #define SC1200_VIP_BASE_NOT_UPDATED 0x00200000 #define SC1200_VIP_FIFO_OVERFLOW 0x00100000 #define SC1200_VIP_CLEAR_LINE_INT 0x00020000 #define SC1200_VIP_CLEAR_FIELD_INT 0x00010000 #define SC1200_VBI_DATA_CAPTURE_ACTIVE 0x00000200 #define SC1200_VIDEO_DATA_CAPTURE_ACTIVE 0x00000100 /* "SC1200_VIP_CURRENT_LINE" BIT DEFINITIONS */ #define SC1200_VIP_CURRENT_LINE_MASK 0x000003FF /* "SC1200_VIP_LINE_TARGET" BIT DEFINITIONS */ #define SC1200_VIP_LAST_LINE_MASK 0x03FF0000 /* "SC1200_VIP_PITCH" BIT DEFINITION */ #define SC1200_VIP_PITCH_MASK 0x0000FFFC /* "SC1200_VBI_PITCH" BIT DEFINITION */ #define SC1200_VBI_PITCH_MASK 0x0000FFFC /* SC1200 DIRECT VBI LINE ENABLE BIT DEFINITION */ #define SC1200_DIRECT_VBI_LINE_ENABLE_MASK 0x00FFFFFF /* SC1200 CONFIGURATION BLOCK */ #define SC1200_CB_BASE_ADDR 0x9000 #define SC1200_CB_WDTO 0x0000 #define SC1200_CB_WDCNFG 0x0002 #define SC1200_CB_WDSTS 0x0004 #define SC1200_CB_TMVALUE 0x0008 #define SC1200_CB_TMCNFG 0x000D #define SC1200_CB_CCFC 0x001E #define SC1200_CB_PMR 0x0030 #define SC1200_CB_MCR 0x0034 #define SC1200_CB_INTSEL 0x0038 #define SC1200_CB_PID 0x003C #define SC1200_CB_REV 0x003D /* SC1200 HIGH RESOLUTION TIMER CONFIGURATION REGISTER BITS */ #define SC1200_TMCLKSEL_27MHZ 0x2 /*---------------------------------*/ /* PHILIPS SAA7114 VIDEO DECODER */ /*---------------------------------*/ #define SAA7114_CHIPADDR 0x42 /* VIDEO DECODER REGISTER DEFINITIONS */ #define SAA7114_ANALOG_INPUT_CTRL1 0x02 #define SAA7114_LUMINANCE_CONTROL 0x09 #define SAA7114_BRIGHTNESS 0x0A #define SAA7114_CONTRAST 0x0B #define SAA7114_SATURATION 0x0C #define SAA7114_HUE 0x0D #define SAA7114_STATUS 0x1F #define SAA7114_IPORT_CONTROL 0x86 /* TASK A REGISTER DEFINITIONS */ #define SAA7114_TASK_A_HORZ_OUTPUT_LO 0x9C #define SAA7114_TASK_A_HORZ_OUTPUT_HI 0x9D #define SAA7114_TASK_A_HSCALE_LUMA_LO 0xA8 #define SAA7114_TASK_A_HSCALE_LUMA_HI 0xA9 #define SAA7114_TASK_A_HSCALE_CHROMA_LO 0xAC #define SAA7114_TASK_A_HSCALE_CHROMA_HI 0xAD /* TASK B REGISTER DEFINITIONS */ #define SAA7114_HORZ_OFFSET_LO 0xC4 #define SAA7114_HORZ_OFFSET_HI 0xC5 #define SAA7114_HORZ_INPUT_LO 0xC6 #define SAA7114_HORZ_INPUT_HI 0xC7 #define SAA7114_VERT_OFFSET_LO 0xC8 #define SAA7114_VERT_OFFSET_HI 0xC9 #define SAA7114_VERT_INPUT_LO 0xCA #define SAA7114_VERT_INPUT_HI 0xCB #define SAA7114_HORZ_OUTPUT_LO 0xCC #define SAA7114_HORZ_OUTPUT_HI 0xCD #define SAA7114_VERT_OUTPUT_LO 0xCE #define SAA7114_VERT_OUTPUT_HI 0xCF #define SAA7114_HORZ_PRESCALER 0xD0 #define SAA7114_HORZ_ACL 0xD1 #define SAA7114_HORZ_FIR_PREFILTER 0xD2 #define SAA7114_FILTER_CONTRAST 0xD5 #define SAA7114_FILTER_SATURATION 0xD6 #define SAA7114_HSCALE_LUMA_LO 0xD8 #define SAA7114_HSCALE_LUMA_HI 0xD9 #define SAA7114_HSCALE_CHROMA_LO 0xDC #define SAA7114_HSCALE_CHROMA_HI 0xDD #define SAA7114_VSCALE_LUMA_LO 0xE0 #define SAA7114_VSCALE_LUMA_HI 0xE1 #define SAA7114_VSCALE_CHROMA_LO 0xE2 #define SAA7114_VSCALE_CHROMA_HI 0xE3 #define SAA7114_VSCALE_CONTROL 0xE4 #define SAA7114_VSCALE_CHROMA_OFFS0 0xE8 #define SAA7114_VSCALE_CHROMA_OFFS1 0xE9 #define SAA7114_VSCALE_CHROMA_OFFS2 0xEA #define SAA7114_VSCALE_CHROMA_OFFS3 0xEB #define SAA7114_VSCALE_LUMINA_OFFS0 0xEC #define SAA7114_VSCALE_LUMINA_OFFS1 0xED #define SAA7114_VSCALE_LUMINA_OFFS2 0xEE #define SAA7114_VSCALE_LUMINA_OFFS3 0xEF /* Still need to determine PHO value (common phase offset) */ #define SAA7114_VSCALE_PHO 0x00 /*----------------------------------------------*/ /* SECOND GENERATION GRAPHICS UNIT (REDCLOUD) */ /*----------------------------------------------*/ #define MGP_DST_OFFSET 0x0000 /* dst address */ #define MGP_SRC_OFFSET 0x0004 /* src address */ #define MGP_VEC_ERR 0x0004 /* vector diag/axial errors */ #define MGP_STRIDE 0x0008 /* src and dst strides */ #define MGP_WID_HEIGHT 0x000C /* width and height of BLT */ #define MGP_VEC_LEN 0x000C /* vector length/init error */ #define MGP_SRC_COLOR_FG 0x0010 /* src mono data fgcolor */ #define MGP_SRC_COLOR_BG 0x0014 /* src mono data bkcolor */ #define MGP_PAT_COLOR_0 0x0018 /* pattern color 0 */ #define MGP_PAT_COLOR_1 0x001C /* pattern color 1 */ #define MGP_PAT_COLOR_2 0x0020 /* pattern color 2 */ #define MGP_PAT_COLOR_3 0x0024 /* pattern color 3 */ #define MGP_PAT_COLOR_4 0x0028 /* pattern color 4 */ #define MGP_PAT_COLOR_5 0x002C /* pattern color 5 */ #define MGP_PAT_DATA_0 0x0030 /* pattern data 0 */ #define MGP_PAT_DATA_1 0x0034 /* pattern data 1 */ #define MGP_RASTER_MODE 0x0038 /* raster operation */ #define MGP_VECTOR_MODE 0x003C /* render vector */ #define MGP_BLT_MODE 0x0040 /* render BLT */ #define MGP_BLT_STATUS 0x0044 /* BLT status register */ #define MGP_RESET 0x0044 /* reset register (write) */ #define MGP_HST_SOURCE 0x0048 /* host src data (bitmap) */ #define MGP_BASE_OFFSET 0x004C /* base render offset */ /* MGP_RASTER_MODE DEFINITIONS */ #define MGP_RM_BPPFMT_332 0x00000000 /* 8 BPP, 3:3:2 */ #define MGP_RM_BPPFMT_4444 0x40000000 /* 16 BPP, 4:4:4:4 */ #define MGP_RM_BPPFMT_1555 0x50000000 /* 16 BPP, 1:5:5:5 */ #define MGP_RM_BPPFMT_565 0x60000000 /* 16 BPP, 5:6:5 */ #define MGP_RM_BPPFMT_8888 0x80000000 /* 32 BPP, 8:8:8:8 */ #define MGP_RM_ALPHA_EN_MASK 0x00C00000 /* Alpha enable */ #define MGP_RM_ALPHA_TO_RGB 0x00400000 /* Alpha applies to RGB */ #define MGP_RM_ALPHA_TO_ALPHA 0x00800000 /* Alpha applies to alpha */ #define MGP_RM_ALPHA_OP_MASK 0x00300000 /* Alpha operation */ #define MGP_RM_ALPHA_TIMES_A 0x00000000 /* Alpha * A */ #define MGP_RM_BETA_TIMES_B 0x00100000 /* (1-alpha) * B */ #define MGP_RM_A_PLUS_BETA_B 0x00200000 /* A + (1-alpha) * B */ #define MGP_RM_ALPHA_A_PLUS_BETA_B 0x00300000 /* alpha * A + (1 - alpha)B */ #define MGP_RM_ALPHA_SELECT 0x000E0000 /* Alpha Select */ #define MGP_RM_SELECT_ALPHA_A 0x00000000 /* Alpha from channel A */ #define MGP_RM_SELECT_ALPHA_B 0x00020000 /* Alpha from channel B */ #define MGP_RM_SELECT_ALPHA_R 0x00040000 /* Registered alpha */ #define MGP_RM_SELECT_ALPHA_1 0x00060000 /* Constant 1 */ #define MGP_RM_SELECT_ALPHA_CHAN_A 0x00080000 /* RGB Values from A */ #define MGP_RM_SELECT_ALPHA_CHAN_B 0x000A0000 /* RGB Values from B */ #define MGP_RM_DEST_FROM_CHAN_A 0x00010000 /* Alpha channel select */ #define MGP_RM_PAT_FLAGS 0x00000700 /* pattern related bits */ #define MGP_RM_PAT_MONO 0x00000100 /* monochrome pattern */ #define MGP_RM_PAT_COLOR 0x00000200 /* color pattern */ #define MGP_RM_PAT_TRANS 0x00000400 /* pattern transparency */ #define MGP_RM_SRC_TRANS 0x00000800 /* source transparency */ /* MGP_VECTOR_MODE DEFINITIONS */ #define MGP_VM_DST_REQ 0x00000008 /* dst data required */ #define MGP_VM_THROTTLE 0x00000010 /* sync to VBLANK */ /* MGP_BLT_MODE DEFINITIONS */ #define MGP_BM_SRC_FB 0x00000001 /* src = frame buffer */ #define MGP_BM_SRC_HOST 0x00000002 /* src = host register */ #define MGP_BM_DST_REQ 0x00000004 /* dst data required */ #define MGP_BM_SRC_MONO 0x00000040 /* monochrome source data */ #define MGP_BM_SRC_BP_MONO 0x00000080 /* Byte-packed monochrome */ #define MGP_BM_SRC_TYPE_MASK 0x000000C0 /* Mask for all source fmts */ #define MGP_BM_NEG_YDIR 0x00000100 /* negative Y direction */ #define MGP_BM_NEG_XDIR 0x00000200 /* negative X direction */ #define MGP_BM_THROTTLE 0x00000400 /* sync to VBLANK */ /* MGP_BLT_STATUS DEFINITIONS */ #define MGP_BS_BLT_BUSY 0x00000001 /* GP is not idle */ #define MGP_BS_BLT_PENDING 0x00000004 /* second BLT is pending */ #define MGP_BS_HALF_EMPTY 0x00000008 /* src FIFO half empty */ /* ALPHA BLENDING MODES */ #define ALPHA_MODE_BLEND 0x00000000 /*---------------------------------------------------*/ /* SECOND GENERATION DISPLAY CONTROLLER (REDCLOUD) */ /*---------------------------------------------------*/ #define MDC_UNLOCK 0x00000000 /* Unlock register */ #define MDC_GENERAL_CFG 0x00000004 /* Config registers */ #define MDC_DISPLAY_CFG 0x00000008 #define MDC_GFX_SCL 0x0000000C /* Graphics scaling */ #define MDC_FB_ST_OFFSET 0x00000010 /* Frame buffer start offset */ #define MDC_CB_ST_OFFSET 0x00000014 /* Compression start offset */ #define MDC_CURS_ST_OFFSET 0x00000018 /* Cursor buffer start */ /* offset */ #define MDC_ICON_ST_OFFSET 0x0000001C /* Icon buffer start offset */ #define MDC_VID_Y_ST_OFFSET 0x00000020 /* Video Y Buffer start */ /* offset */ #define MDC_VID_U_ST_OFFSET 0x00000024 /* Video U Buffer start */ /* offset */ #define MDC_VID_V_ST_OFFSET 0x00000028 /* Video V Buffer start */ /* offset */ #define MDC_LINE_SIZE 0x00000030 /* Video, CB, and FB line */ /* sizes */ #define MDC_GFX_PITCH 0x00000034 /* FB and DB skip counts */ #define MDC_VID_YUV_PITCH 0x00000038 /* Y, U and V buffer skip */ /* counts */ #define MDC_H_ACTIVE_TIMING 0x00000040 /* Horizontal timings */ #define MDC_H_BLANK_TIMING 0x00000044 #define MDC_H_SYNC_TIMING 0x00000048 #define MDC_V_ACTIVE_TIMING 0x00000050 /* Vertical Timings */ #define MDC_V_BLANK_TIMING 0x00000054 #define MDC_V_SYNC_TIMING 0x00000058 #define MDC_CURSOR_X 0x00000060 /* Cursor X position */ #define MDC_CURSOR_Y 0x00000064 /* Cursor Y Position */ #define MDC_ICON_X 0x00000068 /* Icon X Position */ #define MDC_LINE_CNT_STATUS 0x0000006C /* Icon Y Position */ #define MDC_PAL_ADDRESS 0x00000070 /* Palette Address */ #define MDC_PAL_DATA 0x00000074 /* Palette Data */ #define MDC_DFIFO_DIAG 0x00000078 /* Display FIFO diagnostic */ #define MDC_CFIFO_DIAG 0x0000007C /* Compression FIFO */ /* diagnostic */ #define MDC_VID_DS_DELTA 0x00000080 /* Vertical Downscaling */ /* fraction */ #define MDC_PHY_MEM_OFFSET 0x00000084 /* VG Base Address Register */ #define MDC_DV_CTL 0x00000088 /* Dirty-Valid Control */ /* Register */ #define MDC_DV_ACC 0x0000008C /* Dirty-Valid RAM Access */ /* UNLOCK VALUE */ #define MDC_UNLOCK_VALUE 0x00004758 /* used to unlock DC regs */ /* VG MBUS DEVICE SMI MSR FIELDS */ #define MDC_VG_BL_MASK 0x00000001 #define MDC_MISC_MASK 0x00000002 #define MDC_ISR0_MASK 0x00000004 #define MDC_VGA_BL_MASK 0x00000008 #define MDC_CRTCIO_MSK 0x00000010 #define MDC_VG_BLANK_SMI 0x00000001 #define MDC_MISC_SMI 0x00000002 #define MDC_ISR0_SMI 0x00000004 #define MDC_VGA_BLANK_SMI 0x00000008 #define MDC_CRTCIO_SMI 0x00000010 /* MDC_GENERAL_CFG BIT FIELDS */ #define MDC_GCFG_DBUG 0x80000000 #define MDC_GCFG_DBSL 0x40000000 #define MDC_GCFG_CFRW 0x20000000 #define MDC_GCFG_DIAG 0x10000000 #define MDC_GCFG_GXRFS4 0x08000000 #define MDC_GCFG_SGFR 0x04000000 #define MDC_GCFG_SGRE 0x02000000 #define MDC_GCFG_SIGE 0x01000000 #define MDC_GCFG_YUVM 0x00100000 #define MDC_GCFG_VDSE 0x00080000 #define MDC_GCFG_VGAFT 0x00040000 #define MDC_GCFG_FDTY 0x00020000 #define MDC_GCFG_STFM 0x00010000 #define MDC_GCFG_DFHPEL_MASK 0x0000F000 #define MDC_GCFG_DFHPSL_MASK 0x00000F00 #define MDC_GCFG_VGAE 0x00000080 #define MDC_GCFG_DECE 0x00000040 #define MDC_GCFG_CMPE 0x00000020 #define MDC_GCFG_VIDE 0x00000008 #define MDC_GCFG_ICNE 0x00000004 #define MDC_GCFG_CURE 0x00000002 #define MDC_GCFG_DFLE 0x00000001 /* MDC_DISPLAY_CFG BIT FIELDS */ #define MDC_DCFG_A20M 0x80000000 #define MDC_DCFG_A18M 0x40000000 #define MDC_DCFG_VISL 0x08000000 #define MDC_DCFG_FRLK 0x04000000 #define MDC_DCFG_PALB 0x02000000 #define MDC_DCFG_PIX_PAN_MASK 0x00F00000 #define MDC_DCFG_DCEN 0x00080000 #define MDC_DCFG_16BPP_MODE_MASK 0x00000C00 #define MDC_DCFG_16BPP 0x00000000 #define MDC_DCFG_15BPP 0x00000400 #define MDC_DCFG_12BPP 0x00000800 #define MDC_DCFG_DISP_MODE_MASK 0x00000300 #define MDC_DCFG_DISP_MODE_8BPP 0x00000000 #define MDC_DCFG_DISP_MODE_16BPP 0x00000100 #define MDC_DCFG_DISP_MODE_24BPP 0x00000200 #define MDC_DCFG_SCLE 0x00000080 #define MDC_DCFG_TRUP 0x00000040 #define MDC_DCFG_VIEN 0x00000020 #define MDC_DCFG_VDEN 0x00000010 #define MDC_DCFG_GDEN 0x00000008 #define MDC_DCFG_VCKE 0x00000004 #define MDC_DCFG_PCKE 0x00000002 #define MDC_DCFG_TGEN 0x00000001 /* MDC_LINE_CNT BIT FIELDS */ #define MDC_LNCNT_DNA 0x80000000 #define MDC_LNCNT_VNA 0x40000000 #define MDC_LNCNT_VSA 0x20000000 #define MDC_LNCNT_VINT 0x10000000 #define MDC_LNCNT_FLIP 0x08000000 #define MDC_LNCNT_V_LINE_CNT 0x07FF0000 #define MDC_LNCNT_VFLIP 0x00008000 #define MDC_LNCNT_SIGC 0x00004000 #define MDC_LNCNT_SS_LINE_CMP 0x000007FF /* MDC_FB_ST_OFFSET BIT FIELDS */ #define MDC_FB_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_CB_ST_OFFSET BIT FIELDS */ #define MDC_CB_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_CURS_ST_OFFSET BIT FIELDS */ #define MDC_CURS_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_ICON_ST_OFFSET BIT FIELDS */ #define MDC_ICON_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_VID_Y_ST_OFFSET BIT FIELDS */ #define MDC_VID_Y_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_VID_U_ST_OFFSET BIT FIELDS */ #define MDC_VID_U_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_VID_V_ST_OFFSET BIT FIELDS */ #define MDC_VID_V_ST_OFFSET_MASK 0x0FFFFFFF /* MDC_LINE_SIZE BIT FIELDS */ #define MDC_LINE_SIZE_VLS_MASK 0xFF000000 #define MDC_LINE_SIZE_CBLS_MASK 0x007F0000 #define MDC_LINE_SIZE_FBLS_MASK 0x000007FF /* MDC_GFX_PITCH BIT FIELDS */ #define MDC_GFX_PITCH_CBP_MASK 0xFFFF0000 #define MDC_GFX_PITCH_FBP_MASK 0x0000FFFF /* MDC_VID_YUV_PITCH BIT FIELDS */ #define MDC_YUV_PITCH_UVP_MASK 0xFFFF0000 #define MDC_YUV_PITCH_YBP_MASK 0x0000FFFF /* MDC_H_ACTIVE_TIMING BIT FIELDS */ #define MDC_HAT_HT_MASK 0x0FF80000 #define MDC_HAT_HA_MASK 0x00000FF8 /* MDC_H_BLANK_TIMING BIT FIELDS */ #define MDC_HBT_HBE_MASK 0x0FF80000 #define MDC_HBT_HBS_MASK 0x00000FF8 /* MDC_H_SYNC_TIMING BIT FIELDS */ #define MDC_HST_HSE_MASK 0x0FF80000 #define MDC_HST_HSS_MASK 0x00000FF8 /* MDC_V_ACTIVE_TIMING BIT FIELDS */ #define MDC_VAT_VT_MASK 0x07FF0000 #define MDC_VAT_VA_MASK 0x000007FF /* MDC_V_BLANK_TIMING BIT FIELDS */ #define MDC_VBT_VBE_MASK 0x07FF0000 #define MDC_VBT_VBS_MASK 0x000007FF /* MDC_V_SYNC_TIMING BIT FIELDS */ #define MDC_VST_VSE_MASK 0x07FF0000 #define MDC_VST_VSS_MASK 0x000007FF /* MDC_DV_CTL BIT DEFINITIONS */ #define MDC_DV_LINE_SIZE_MASK 0x00000C00 #define MDC_DV_LINE_SIZE_1024 0x00000000 #define MDC_DV_LINE_SIZE_2048 0x00000400 #define MDC_DV_LINE_SIZE_4096 0x00000800 #define MDC_DV_LINE_SIZE_8192 0x00000C00 /* VGA DEFINITIONS */ #define MDC_SEQUENCER_INDEX 0x03C4 #define MDC_SEQUENCER_DATA 0x03C5 #define MDC_SEQUENCER_RESET 0x00 #define MDC_SEQUENCER_CLK_MODE 0x01 #define MDC_RESET_VGA_DISP_ENABLE 0x03 #define MDC_CLK_MODE_SCREEN_OFF 0x20 /*---------------------------------------------------*/ /* REDCLOUD DISPLAY FILTER */ /*---------------------------------------------------*/ /* RCDF VIDEO REGISTER DEFINITIONS */ #define RCDF_VIDEO_CONFIG 0x000 #define RCDF_DISPLAY_CONFIG 0x008 #define RCDF_VIDEO_X_POS 0x010 #define RCDF_VIDEO_Y_POS 0x018 #define RCDF_VIDEO_SCALE 0x020 #define RCDF_VIDEO_COLOR_KEY 0x028 #define RCDF_VIDEO_COLOR_MASK 0x030 #define RCDF_PALETTE_ADDRESS 0x038 #define RCDF_PALETTE_DATA 0x040 #define RCDF_VID_MISC 0x050 #define RCDF_VID_CLOCK_SELECT 0x058 #define RCDF_VIDEO_DOWNSCALER_CONTROL 0x078 #define RCDF_VIDEO_DOWNSCALER_COEFFICIENTS 0x080 #define RCDF_VID_CRC 0x088 #define RCDF_VID_CRC32 0x090 #define RCDF_VID_ALPHA_CONTROL 0x098 #define RCDF_CURSOR_COLOR_KEY 0x0A0 #define RCDF_CURSOR_COLOR_MASK 0x0A8 #define RCDF_CURSOR_COLOR_1 0x0B0 #define RCDF_CURSOR_COLOR_2 0x0B8 #define RCDF_ALPHA_XPOS_1 0x0C0 #define RCDF_ALPHA_YPOS_1 0x0C8 #define RCDF_ALPHA_COLOR_1 0x0D0 #define RCDF_ALPHA_CONTROL_1 0x0D8 #define RCDF_ALPHA_XPOS_2 0x0E0 #define RCDF_ALPHA_YPOS_2 0x0E8 #define RCDF_ALPHA_COLOR_2 0x0F0 #define RCDF_ALPHA_CONTROL_2 0x0F8 #define RCDF_ALPHA_XPOS_3 0x100 #define RCDF_ALPHA_YPOS_3 0x108 #define RCDF_ALPHA_COLOR_3 0x110 #define RCDF_ALPHA_CONTROL_3 0x118 #define RCDF_VIDEO_REQUEST 0x120 #define RCDF_ALPHA_WATCH 0x128 #define RCDF_VIDEO_TEST_MODE 0x210 #define RCDF_POWER_MANAGEMENT 0x410 /* DISPLAY FILTER POWER MANAGEMENT DEFINITIONS */ #define RCDF_PM_PANEL_POWER_ON 0x01000000 /* DISPLAY FILTER MSRS */ #define RCDF_MBD_MSR_DIAG_DF 0x2010 #define RCDF_DIAG_32BIT_CRC 0x80000000 /* "RCDF_VIDEO_CONFIG" BIT DEFINITIONS */ #define RCDF_VCFG_VID_EN 0x00000001 #define RCDF_VCFG_VID_INP_FORMAT 0x0000000C #define RCDF_VCFG_X_FILTER_EN 0x00000040 #define RCDF_VCFG_Y_FILTER_EN 0x00000080 #define RCDF_VCFG_LINE_SIZE_LOWER_MASK 0x0000FF00 #define RCDF_VCFG_INIT_READ_MASK 0x01FF0000 #define RCDF_VCFG_LINE_SIZE_UPPER 0x08000000 #define RCDF_VCFG_4_2_0_MODE 0x10000000 #define RCDF_VCFG_UYVY_FORMAT 0x00000000 #define RCDF_VCFG_Y2YU_FORMAT 0x00000004 #define RCDF_VCFG_YUYV_FORMAT 0x00000008 #define RCDF_VCFG_YVYU_FORMAT 0x0000000C /* "RCDF_DISPLAY_CONFIG" BIT DEFINITIONS */ #define RCDF_DCFG_DIS_EN 0x00000001 #define RCDF_DCFG_HSYNC_EN 0x00000002 #define RCDF_DCFG_VSYNC_EN 0x00000004 #define RCDF_DCFG_DAC_BL_EN 0x00000008 #define RCDF_DCFG_FP_PWR_EN 0x00000040 #define RCDF_DCFG_FP_DATA_EN 0x00000080 #define RCDF_DCFG_CRT_HSYNC_POL 0x00000100 #define RCDF_DCFG_CRT_VSYNC_POL 0x00000200 #define RCDF_DCFG_CRT_SYNC_SKW_MASK 0x0001C000 #define RCDF_DCFG_CRT_SYNC_SKW_INIT 0x00010000 #define RCDF_DCFG_PWR_SEQ_DLY_MASK 0x000E0000 #define RCDF_DCFG_PWR_SEQ_DLY_INIT 0x00080000 #define RCDF_DCFG_VG_CK 0x00100000 #define RCDF_DCFG_GV_PAL_BYP 0x00200000 #define RCDF_DAC_VREF 0x04000000 #define RCDF_FP_ON_STATUS 0x08000000 /* "RCDF_VID_MISC" BIT DEFINITIONS */ #define RCDF_GAMMA_BYPASS_BOTH 0x00000001 #define RCDF_DAC_POWER_DOWN 0x00000400 #define RCDF_ANALOG_POWER_DOWN 0x00000800 /* "RCDF_VIDEO_DOWNSCALER_CONTROL" BIT DEFINITIONS */ #define RCDF_VIDEO_DOWNSCALE_ENABLE 0x00000001 #define RCDF_VIDEO_DOWNSCALE_FACTOR_POS 1 #define RCDF_VIDEO_DOWNSCALE_FACTOR_MASK 0x0000001E #define RCDF_VIDEO_DOWNSCALE_TYPE_A 0x00000000 #define RCDF_VIDEO_DOWNSCALE_TYPE_B 0x00000040 #define RCDF_VIDEO_DOWNSCALE_TYPE_MASK 0x00000040 /* "RCDF_VIDEO_DOWNSCALER_COEFFICIENTS" BIT DEFINITIONS */ #define RCDF_VIDEO_DOWNSCALER_COEF1_POS 0 #define RCDF_VIDEO_DOWNSCALER_COEF2_POS 8 #define RCDF_VIDEO_DOWNSCALER_COEF3_POS 16 #define RCDF_VIDEO_DOWNSCALER_COEF4_POS 24 #define RCDF_VIDEO_DOWNSCALER_COEF_MASK 0xF /* VIDEO DE-INTERLACING AND ALPHA CONTROL */ #define RCDF_NO_CK_OUTSIDE_ALPHA 0x00000100 #define RCDF_CSC_VIDEO_YUV_TO_RGB 0x00000400 #define RCDF_VIDEO_INPUT_IS_RGB 0x00002000 #define RCDF_ALPHA1_PRIORITY_POS 16 #define RCDF_ALPHA1_PRIORITY_MASK 0x00030000 #define RCDF_ALPHA2_PRIORITY_POS 18 #define RCDF_ALPHA2_PRIORITY_MASK 0x000C0000 #define RCDF_ALPHA3_PRIORITY_POS 20 #define RCDF_ALPHA3_PRIORITY_MASK 0x00300000 /* VIDEO CURSOR COLOR KEY DEFINITIONS */ #define RCDF_CURSOR_COLOR_KEY_ENABLE 0x20000000 #define RCDF_CURSOR_COLOR_KEY_OFFSET_POS 24 #define RCDF_CURSOR_COLOR_BITS 23 #define RCDF_COLOR_MASK 0x00FFFFFF /* 24 significant bits */ /* ALPHA COLOR BIT DEFINITION (REGISTERS 0x68, 0x78, AND 0x88) */ #define RCDF_ALPHA_COLOR_ENABLE 0x01000000 /* ALPHA CONTROL BIT DEFINITIONS (REGISTERS 0x6C, 0x7C, AND 0x8C) */ #define RCDF_ACTRL_WIN_ENABLE 0x00010000 #define RCDF_ACTRL_LOAD_ALPHA 0x00020000 /* VIDEO REQUEST DEFINITIONS (REGISTER 0x90) */ #define RCDF_VIDEO_Y_REQUEST_POS 0 #define RCDF_VIDEO_X_REQUEST_POS 16 #define RCDF_VIDEO_REQUEST_MASK 0x000007FF /* GEODELINK DEVICE MSR REGISTER SUMMARY */ #define MBD_MSR_CAP 0x2000 /* Device Capabilities */ #define MBD_MSR_CONFIG 0x2001 /* Device Master Configuration */ /* Register */ #define MBD_MSR_SMI 0x2002 /* MBus Device SMI Register */ #define MBD_MSR_ERROR 0x2003 /* MBus Device Error */ #define MBD_MSR_PM 0x2004 /* MBus Device Power Management */ /* Register */ #define MBD_MSR_DIAG 0x2005 /* Mbus Device Diagnostic Register */ /* DISPLAY FILTER MBD_MSR_DIAG DEFINITIONS */ #define RCDF_MBD_DIAG_SEL0 0x00007FFF /* Lower 32-bits of Diag Bus * Select */ #define RCDF_MBD_DIAG_EN0 0x00008000 /* Enable for lower 32-bits of * diag bus */ #define RCDF_MBD_DIAG_SEL1 0x7FFF0000 /* Upper 32-bits of Diag Bus * Select */ #define RCDF_MBD_DIAG_EN1 0x80000000 /* Enable for upper 32-bits of * diag bus */ /* DISPLAY FILTER MBD_MSR_CONFIG DEFINITIONS */ #define RCDF_CONFIG_FMT_MASK 0x00000038 /* Output Format */ #define RCDF_CONFIG_FMT_CRT 0x00000000 #define RCDF_CONFIG_FMT_FP 0x00000008 /* MCP MSR DEFINITIONS */ #define MCP_CLKOFF 0x0010 #define MCP_CLKACTIVE 0x0011 #define MCP_CLKDISABLE 0x0012 #define MCP_CLK4ACK 0x0013 #define MCP_SYS_RSTPLL 0x0014 #define MCP_DOTPLL 0x0015 #define MCP_DBGCLKCTL 0x0016 #define MCP_RC_REVID 0x0017 #define MCP_SETM0CTL 0x0040 #define MCP_SETN0CTL 0x0048 #define MCP_CMPVAL0 0x0050 #define MCP_CMPMASK0 0x0051 #define MCP_REGA 0x0058 #define MCP_REGB 0x0059 #define MCP_REGAMASK 0x005A #define MCP_REGAVAL 0x005B #define MCP_REGBMASK 0x005C #define MCP_REGBVAL 0x005D #define MCP_FIFOCTL 0x005E #define MCP_DIAGCTL 0x005F #define MCP_H0CTL 0x0060 #define MCP_XSTATE 0x0066 #define MCP_YSTATE 0x0067 #define MCP_ACTION0 0x0068 /* MCP_SYS_RSTPLL DEFINITIONS */ #define MCP_DOTPOSTDIV3 0x00000008 #define MCP_DOTPREMULT2 0x00000004 #define MCP_DOTPREDIV2 0x00000002 #define MCP_DOTPLL_HALFPIX 0x01000000 /* MCP MBD_MSR_DIAG DEFINITIONS */ #define MCP_MBD_DIAG_SEL0 0x00000007 #define MCP_MBD_DIAG_EN0 0x00008000 #define MCP_MBD_DIAG_SEL1 0x00070000 #define MCP_MBD_DIAG_EN1 0x80000000 /* MCP_DOTPLL DEFINITIONS */ #define MCP_DOTPLL_P 0x00000003 #define MCP_DOTPLL_N 0x000001FC #define MCP_DOTPLL_M 0x00001E00 #define MCP_DOTPLL_LOCK 0x02000000 #define MCP_DOTPLL_BYPASS 0x00008000 xf86-video-geode-2.11.18/src/gfx/init_gu1.c0000644000175000017500000001641412654445443015044 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines used in the initialization of Geode-family * processors. * */ /*---------------------------------------------------------------------------- * gfx_gxm_config_read * * This routine reads the value of the specified GXm configuration register. *---------------------------------------------------------------------------- */ unsigned char gfx_gxm_config_read(unsigned char index) { unsigned char value = 0xFF; unsigned char lock; OUTB(0x22, GXM_CONFIG_CCR3); lock = INB(0x23); OUTB(0x22, GXM_CONFIG_CCR3); OUTB(0x23, (unsigned char) (lock | 0x10)); OUTB(0x22, index); value = INB(0x23); OUTB(0x22, GXM_CONFIG_CCR3); OUTB(0x23, lock); return (value); } /*---------------------------------------------------------------------------- * gfx_get_core_freq * * This routine returns the core clock frequency of a GXm if valid jumper * settings are detected; 0 It assumes that a 33.3 MHz PCI clock is being used * for GX1. * For SCx2xx, the fast PCI divisor is read. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu1_get_core_freq(void) #else unsigned long gfx_get_core_freq(void) #endif { unsigned char dir0, dir1; unsigned long cpu_speed; dir0 = gfx_gxm_config_read(GXM_CONFIG_DIR0) & 0x0F; dir1 = gfx_gxm_config_read(GXM_CONFIG_DIR1); /* REVISION 4.0 AND UP */ if (dir1 >= 0x50) { switch (dir0) { case 0: case 2: cpu_speed = 133; break; case 5: cpu_speed = 166; break; case 3: cpu_speed = 200; break; case 6: cpu_speed = 233; break; case 7: cpu_speed = 266; break; case 4: cpu_speed = 300; break; case 1: cpu_speed = 333; break; default: return (0); } } else { switch (dir0) { case 0: case 2: cpu_speed = 133; break; case 7: cpu_speed = 166; break; case 1: case 3: cpu_speed = 200; break; case 4: case 6: cpu_speed = 233; break; case 5: cpu_speed = 266; break; default: return (0); } } if ((gfx_cpu_version & 0xFF) == GFX_CPU_SC1200) { cpu_speed = (cpu_speed * gfx_pci_speed_khz) / 33300; } return (cpu_speed); } /*---------------------------------------------------------------------------- * gfx_get_cpu_register_base * * This routine returns the base address for graphics registers. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu1_get_cpu_register_base(void) #else unsigned long gfx_get_cpu_register_base(void) #endif { unsigned long base; base = (unsigned long) gfx_gxm_config_read(GXM_CONFIG_GCR); base = (base & 0x03) << 30; return (base); } /*---------------------------------------------------------------------------- * gfx_get_frame_buffer_base * * This routine returns the base address for graphics memory. This is an * offset of 0x00800000 from the base address specified in the GCR register. * * The function returns zero if the GCR indicates the graphics subsystem * is disabled. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu1_get_frame_buffer_base(void) #else unsigned long gfx_get_frame_buffer_base(void) #endif { unsigned long base; base = (unsigned long) gfx_gxm_config_read(GXM_CONFIG_GCR); base = (base & 0x03) << 30; if (base) base |= 0x00800000; return (base); } /*---------------------------------------------------------------------------- * gfx_get_frame_buffer_size * * This routine returns the total size of graphics memory, in bytes. * * Currently this routine is hardcoded to return 2 Meg. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu1_get_frame_buffer_size(void) #else unsigned long gfx_get_frame_buffer_size(void) #endif { #if FB4MB return (0x00400000); #else return (0x00200000); #endif } /*---------------------------------------------------------------------------- * gfx_get_vid_register_base * * This routine returns the base address for the video hardware. It assumes * an offset of 0x00010000 from the base address specified by the GCR. * * The function returns zero if the GCR indicates the graphics subsystem * is disabled. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu1_get_vid_register_base(void) #else unsigned long gfx_get_vid_register_base(void) #endif { unsigned long base; base = (unsigned long) gfx_gxm_config_read(GXM_CONFIG_GCR); base = (base & 0x03) << 30; if (base) base |= 0x00010000; return (base); } /*---------------------------------------------------------------------------- * gfx_get_vip_register_base * * This routine returns the base address for the VIP hardware. This is * only applicable to the SC1200, for which this routine assumes an offset * of 0x00015000 from the base address specified by the GCR. * * The function returns zero if the GCR indicates the graphics subsystem * is disabled. *---------------------------------------------------------------------------- */ #if GFX_INIT_DYNAMIC unsigned long gu1_get_vip_register_base(void) #else unsigned long gfx_get_vip_register_base(void) #endif { unsigned long base = 0; if ((gfx_cpu_version & 0xFF) == GFX_CPU_SC1200) { base = (unsigned long) gfx_gxm_config_read(GXM_CONFIG_GCR); base = (base & 0x03) << 30; if (base) base |= 0x00015000; } return (base); } /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_type.h0000644000175000017500000002217312654445443015156 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This header file defines the pneumonics used when calling Durango routines. * This file is automatically included by gfx_rtns.h * */ #ifndef _gfx_type_h #define _gfx_type_h /* MSR DEFINITIONS */ typedef enum DevStatus { FOUND, NOT_KNOWN, REQ_NOT_FOUND, REQ_NOT_INSTALLED } DEV_STATUS; typedef struct msr { DEV_STATUS Present; /* Node enumeration status */ unsigned char Id; /* Device ID (from MSR specs) */ unsigned long Address; /* Address - 32-bit MBus address at */ /* which 'Id' is found */ } MSR; typedef struct mValue { unsigned long high; unsigned long low; } Q_WORD; typedef struct mbusNode { unsigned long address; unsigned int deviceId; unsigned int claimed; } MBUS_NODE; /* MSR ARRAY INDEXES */ /* These are indexes into the array of MBus devices. These */ /* should not be confused with the class codes at MSR register */ /* 0x2000. */ #define RC_ID_MBIU0 0x00 #define RC_ID_MBIU1 0x01 #define RC_ID_MCP 0x02 #define RC_ID_MPCI 0x03 #define RC_ID_MC 0x04 #define RC_ID_GP 0x05 #define RC_ID_VG 0x06 #define RC_ID_DF 0x07 #define RC_ID_FG 0x08 #define RC_ID_VA 0x09 #define CP_ID_MBIU 0x0A #define CP_ID_MPCI 0x0B #define CP_ID_USB2 0x0C #define CP_ID_ATAC 0x0D #define CP_ID_MDD 0x0E #define CP_ID_ACC 0x0F #define CP_ID_USB1 0x10 #define CP_ID_MCP 0x11 /* MBUS DEVICE CLASS CODES */ /* These are the device ids for the known Redcloud MBus devices. */ #define RC_CC_MBIU 0x01 #define RC_CC_MCP 0x02 #define RC_CC_MPCI 0x05 #define RC_CC_MC 0x20 #define RC_CC_GP 0x3D #define RC_CC_VG 0x3E #define RC_CC_DF 0x3F #define RC_CC_FG 0xF0 #define RC_CC_VA 0x86 #define CP_CC_MBIU 0x01 #define CP_CC_MPCI 0x05 #define CP_CC_USB2 0x42 #define CP_CC_ATAC 0x47 #define CP_CC_MDD 0xDF #define CP_CC_ACC 0x33 #define CP_CC_USB1 0x42 #define CP_CC_MCP 0x02 /* VAIL AND MBIUS ARE AT KNOWN ADDRESSES */ /* We can initialize the addresses of these devices in advance, */ /* as their location should never change. */ #define RC_MB0_MBIU0 0x10000000 #define RC_MB0_MBIU1 0x40000000 #define CP_MB0_MBIU0 0x51010000 #define RC_MB0_CPU 0x00000000 #define FAKE_ADDRESS 0xFFFFFFFF /* MSR PORT DESCRIPTORS */ #define NOT_POPULATED 0 #define NOT_INSTALLED 0xFFFE #define REFLECTIVE 0xFFFF /* CRC DATA SOURCES */ #define CRC_SOURCE_GFX_DATA 0x00 #define CRC_SOURCE_CRT_RGB 0x01 #define CRC_SOURCE_FP_DATA 0x02 /* TV DEFINITIONS */ typedef enum TVStandardType { TV_STANDARD_NTSC = 1, TV_STANDARD_PAL } TVStandardType; typedef enum GfxOnTVType { GFX_ON_TV_SQUARE_PIXELS = 1, GFX_ON_TV_NO_SCALING } GfxOnTVType; #define CRT_DISABLE 0x00 #define CRT_ENABLE 0x01 #define CRT_STANDBY 0x02 #define CRT_SUSPEND 0x03 #define TV_OUTPUT_COMPOSITE 0x01 #define TV_OUTPUT_S_VIDEO 0x02 #define TV_OUTPUT_YUV 0x03 #define TV_OUTPUT_SCART 0x04 #define TV_FLICKER_FILTER_NONE 0x01 #define TV_FLICKER_FILTER_NORMAL 0x02 #define TV_FLICKER_FILTER_INTERLACED 0x03 #define TV_YC_DELAY_NONE 0x01 #define TV_Y_DELAY_ONE_PIXEL 0x02 #define TV_C_DELAY_ONE_PIXEL 0x03 #define TV_C_DELAY_TWO_PIXELS 0x04 #define TV_SUB_CARRIER_RESET_NEVER 0x01 #define TV_SUB_CARRIER_RESET_EVERY_TWO_LINES 0x02 #define TV_SUB_CARRIER_RESET_EVERY_TWO_FRAMES 0x03 #define TV_SUB_CARRIER_RESET_EVERY_FOUR_FRAMES 0x04 #define TVENC_RESET_EVERY_ODD_FIELD 0x01 #define TVENC_RESET_EVERY_EVEN_FIELD 0x02 #define TVENC_RESET_NEXT_ODD_FIELD 0x03 #define TVENC_RESET_NEXT_EVEN_FIELD 0x04 #define TVENC_RESET_EVERY_FIELD 0x05 #define TVENC_RESET_EVERY_X_ODD_FIELDS 0x06 #define TVENC_RESET_EVERY_X_EVEN_FIELDS 0x07 /* VBI FORMATS */ #define VBI_FORMAT_VIDEO 0x1 #define VBI_FORMAT_RAW 0x2 #define VBI_FORMAT_CC 0x4 #define VBI_FORMAT_NABTS 0x8 /* VIDEO DEFINITIONS */ #define VIDEO_FORMAT_UYVY 0x0 #define VIDEO_FORMAT_Y2YU 0x1 #define VIDEO_FORMAT_YUYV 0x2 #define VIDEO_FORMAT_YVYU 0x3 #define VIDEO_FORMAT_Y0Y1Y2Y3 0x4 #define VIDEO_FORMAT_Y3Y2Y1Y0 0x5 #define VIDEO_FORMAT_Y1Y0Y3Y2 0x6 #define VIDEO_FORMAT_Y1Y2Y3Y0 0x7 #define VIDEO_FORMAT_RGB 0x8 #define VIDEO_FORMAT_P2M_P2L_P1M_P1L 0x9 #define VIDEO_FORMAT_P1M_P1L_P2M_P2L 0xA #define VIDEO_FORMAT_P1M_P2L_P2M_P1L 0xB #define VIDEO_DOWNSCALE_KEEP_1_OF 0x1 #define VIDEO_DOWNSCALE_DROP_1_OF 0x2 typedef enum VideoSourceType { /* The source from which the video processor shows full screen video */ VIDEO_SOURCE_MEMORY = 1, VIDEO_SOURCE_DVIP } VideoSourceType; typedef enum VbiSourceType { /* The source from which the video processor takes VBI */ VBI_SOURCE_MEMORY = 1, VBI_SOURCE_DVIP } VbiSourceType; /* GENLOCK DEFINITIONS */ #define GENLOCK_SINGLE 0x001 #define GENLOCK_FIELD_SYNC 0x001 #define GENLOCK_CONTINUOUS 0x002 #define GENLOCK_SYNCED_EDGE_FALLING 0x004 #define GENLOCK_SYNCING_EDGE_FALLING 0x008 #define GENLOCK_TIMEOUT 0x010 #define GENLOCK_TVENC_RESET_EVEN_FIELD 0x020 #define GENLOCK_TVENC_RESET_BEFORE_DELAY 0x040 #define GENLOCK_TVENC_RESET 0x080 #define GENLOCK_SYNC_TO_TVENC 0x100 /* VIP DEFINITIONS */ #define VIP_MODE_C 0x1 #define VIP_CAPTURE_STOP_LINE 0x1 #define VIP_CAPTURE_STOP_FIELD 0x2 #define VIP_CAPTURE_START_FIELD 0x4 #define VBI_ANCILLARY 0x1 #define VBI_TASK_A 0x2 #define VBI_TASK_B 0x4 /* VGA STRUCTURE */ #define GFX_STD_CRTC_REGS 25 #define GFX_EXT_CRTC_REGS 16 #define GFX_VGA_FLAG_MISC_OUTPUT 0x00000001 #define GFX_VGA_FLAG_STD_CRTC 0x00000002 #define GFX_VGA_FLAG_EXT_CRTC 0x00000004 /* FS450 TV Standard flags */ #define GFX_TV_STANDARD_NTSC_M 0x0001 #define GFX_TV_STANDARD_NTSC_M_J 0x0002 #define GFX_TV_STANDARD_PAL_B 0x0004 #define GFX_TV_STANDARD_PAL_D 0x0008 #define GFX_TV_STANDARD_PAL_H 0x0010 #define GFX_TV_STANDARD_PAL_I 0x0020 #define GFX_TV_STANDARD_PAL_M 0x0040 #define GFX_TV_STANDARD_PAL_N 0x0080 #define GFX_TV_STANDARD_PAL_G 0x0100 /* FS450 VGA Mode flags */ #define GFX_VGA_MODE_UNKNOWN 0 #define GFX_VGA_MODE_640X480 0x0001 #define GFX_VGA_MODE_720X487 0x0002 #define GFX_VGA_MODE_720X576 0x0004 #define GFX_VGA_MODE_800X600 0x0008 #define GFX_VGA_MODE_1024X768 0x0010 /* FS450 TVout mode flags */ #define GFX_TVOUT_MODE_CVBS 0x0001 #define GFX_TVOUT_MODE_YC 0x0002 #define GFX_TVOUT_MODE_RGB 0x0004 #define GFX_TVOUT_MODE_CVBS_YC (GFX_TVOUT_MODE_CVBS | GFX_TVOUT_MODE_YC) /* FS450 Luma and Chroma Filters */ #define GFX_LUMA_FILTER 0x0001 #define GFX_CHROMA_FILTER 0x0002 /* APS Trigger Bits */ #define GFX_APS_TRIGGER_OFF 0 #define GFX_APS_TRIGGER_AGC_ONLY 1 #define GFX_APS_TRIGGER_AGC_2_LINE 2 #define GFX_APS_TRIGGER_AGC_4_LINE 3 typedef struct { int xsize; int ysize; int hz; int clock; unsigned char miscOutput; unsigned char stdCRTCregs[GFX_STD_CRTC_REGS]; unsigned char extCRTCregs[GFX_EXT_CRTC_REGS]; } gfx_vga_struct; /* POSSIBLE STATUS VALUES */ #define GFX_STATUS_UNSUPPORTED (-3) #define GFX_STATUS_BAD_PARAMETER (-2) #define GFX_STATUS_ERROR (-1) #define GFX_STATUS_OK 0 /* CPU AND VIDEO TYPES */ #define GFX_CPU_GXLV 1 #define GFX_CPU_SC1200 2 #define GFX_CPU_REDCLOUD 3 #define GFX_CPU_PYRAMID 0x20801 #define GFX_VID_CS5530 1 #define GFX_VID_SC1200 2 #define GFX_VID_REDCLOUD 3 /* CHIP NAME AND REVISION */ typedef enum ChipType { CHIP_NOT_DETECTED, SC1200_REV_A, SC1200_REV_B1_B2, SC1200_REV_B3, SC1200_REV_C1, SC1200_REV_D1, SC1200_REV_D1_1, SC1200_REV_D2_MVD, /* Macrovision disabled */ SC1200_REV_D2_MVE, /* Macrovision enabled */ SC1200_FUTURE_REV } ChipType; #endif /* !_gfx_type_h */ xf86-video-geode-2.11.18/src/gfx/vga_gu1.c0000644000175000017500000005523112654445443014656 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to set modes using the VGA registers. * Since this file is for the first generation graphics unit, it interfaces * to SoftVGA registers. It works for both VSA1 and VSA2. * */ /* SoftVGA Extended CRTC register indices and bit definitions */ #define CRTC_EXTENDED_REGISTER_LOCK 0x30 #define CRTC_MODE_SWITCH_CONTROL 0x3F /* BIT DEFINITIONS */ #define CRTC_BIT_16BPP 0x01 #define CRTC_BIT_555 0x02 /* LOCAL ROUTINE DEFINITIONS */ int gu1_detect_vsa2(void); /*---------------------------------*/ /* MODE TABLES FOR VGA REGISTERS */ /*---------------------------------*/ /* FOR SoftVGA, the CRTC_EXTENDED_ADDRESS_CONTROL (0x43) is always equal to * 0x03 for a packed linear frame buffer organization. The * CRTC_EXTENDED_DAC_CONTROL (0x4B) is always equal to 0x03 to work with * older versions of VSA1 (that needed to specify 8 or 16 bit bus to an * external RAMDAC. This is not used in VSA2. The clock frequency is * specified in register 0x4D if clock control (0x4C) is set to 0x80. * Higher resolutions (1280x1024) use the CRTC_EXTENDED_VERTICAL_TIMING * register (index 0x41). */ gfx_vga_struct gfx_vga_modes[] = { /*--------------------------------------------------------------------------*/ { 640, 480, 60, /* 640x480 */ 25, /* 25 MHz clock = 60 Hz refresh rate */ 0xE3, /* miscOutput register */ { 0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0x0B, 0x3E, /* standard CRTC */ 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEA, 0x0C, 0xDF, 0x50, 0x00, 0xE7, 0x04, 0xE3, 0xFF}, { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, /* extended CRTC */ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00} }, /*--------------------------------------------------------------------------*/ { 640, 480, 72, /* 640x480 */ 29, /* 29 MHz clock = 72 Hz refresh rate */ 0xE3, /* miscOutput register */ { 0x63, 0x4f, 0x50, 0x86, 0x55, 0x99, 0x06, 0x3e, /* standard CRTC */ 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0x0c, 0xdf, 0x00, 0x00, 0xe7, 0x00, 0xe3, 0xff}, { 0x6D, 0x00, 0x00, 0x03, 0x00, 0x01, 0x01, 0x00, /* extended CRTC */ 0x00, 0x00, 0x01, 0x08, 0x80, 0x1F, 0x00, 0x4B} }, /*--------------------------------------------------------------------------*/ { 640, 480, 75, /* 640x480 */ 31, /* 31.5 MHz clock = 75 Hz refresh rate */ 0xE3, /* miscOutput register */ { 0x64, 0x4F, 0x4F, 0x88, 0x54, 0x9B, 0xF2, 0x1F, /* standard CRTC */ 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE1, 0x04, 0xDF, 0x50, 0x00, 0xDF, 0xF3, 0xE3, 0xFF}, { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, /* extended CRTC */ 0x00, 0x00, 0x00, 0x03, 0x80, 0x1F, 0x00, 0x00} }, /*--------------------------------------------------------------------------*/ { 800, 600, 60, /* 800x600 */ 40, /* 40 MHz clock = 60 Hz refresh rate */ 0x23, /* miscOutput register */ { 0x7F, 0x63, 0x64, 0x82, 0x6B, 0x1B, 0x72, 0xF0, /* standard CRTC */ 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x0D, 0x57, 0x64, 0x00, 0x57, 0x73, 0xE3, 0xFF}, { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, /* extended CRTC */ 0x00, 0x00, 0x00, 0x03, 0x80, 0x28, 0x00, 0x00} }, /*--------------------------------------------------------------------------*/ { 800, 600, 72, /* 800x600 */ 47, /* 47 MHz clock = 72 Hz refresh rate */ 0x2B, /* miscOutput register */ { 0x7D, 0x63, 0x63, 0x81, 0x6D, 0x1B, 0x98, 0xF0, /* standard CRTC */ 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7D, 0x03, 0x57, 0x00, 0x00, 0x57, 0x9A, 0xE3, 0xFF}, { 0x6F, 0x00, 0x00, 0x03, 0x00, 0x01, 0x01, 0x00, /* extended CRTC */ 0x00, 0x00, 0x01, 0x08, 0x80, 0x32, 0x00, 0x4B} }, /*--------------------------------------------------------------------------*/ { 800, 600, 75, /* 800x600 */ 49, /* 49.5 MHz clock = 75 Hz refresh rate */ 0x23, /* miscOutput register */ { 0x7F, 0x63, 0x63, 0x83, 0x68, 0x11, 0x6F, 0xF0, /* standard CRTC */ 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x1C, 0x57, 0x64, 0x00, 0x57, 0x70, 0xE3, 0xFF}, { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, /* extended CRTC */ 0x00, 0x00, 0x00, 0x03, 0x80, 0x31, 0x00, 0x00} }, /*--------------------------------------------------------------------------*/ { 1024, 768, 60, /* 1024x768 */ 65, /* 65 MHz clock = 60 Hz refresh rate */ 0xE3, /* miscOutput register */ { 0xA3, 0x7F, 0x80, 0x86, 0x85, 0x96, 0x24, 0xF5, /* standard CRTC */ 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0A, 0xFF, 0x80, 0x00, 0xFF, 0x25, 0xE3, 0xFF}, { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, /* extended CRTC */ 0x00, 0x00, 0x00, 0x03, 0x80, 0x41, 0x00, 0x00} }, /*--------------------------------------------------------------------------*/ { 1024, 768, 70, /* 1024x768 */ 76, /* 76 MHz clock = 70 Hz refresh rate */ 0x2B, /* miscOutput register */ { 0xA1, 0x7F, 0x7F, 0x85, 0x85, 0x95, 0x24, 0xF5, /* standard CRTC */ 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x09, 0xFF, 0x00, 0x00, 0xFF, 0x26, 0xE3, 0xFF}, { 0x62, 0x00, 0x00, 0x03, 0x00, 0x01, 0x01, 0x00, /* extended CRTC */ 0x00, 0x00, 0x01, 0x02, 0x80, 0x4B, 0x00, 0x4B} }, /*--------------------------------------------------------------------------*/ { 1024, 768, 75, /* 1024x768 */ 79, /* 79 MHz clock = 75 Hz refresh rate */ 0xE3, /* miscOutput register */ { 0x9F, 0x7F, 0x7F, 0x83, 0x84, 0x8F, 0x1E, 0xF5, /* standard CRTC */ 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0x80, 0x00, 0xFF, 0x1F, 0xE3, 0xFF}, { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, /* extended CRTC */ 0x00, 0x00, 0x00, 0x03, 0x80, 0x4F, 0x00, 0x00} }, /*--------------------------------------------------------------------------*/ { 1280, 1024, 60, /* 1280x1024 */ 108, /* 108 MHz clock = 60 Hz refresh rate */ 0x23, /* miscOutput register */ { 0xCF, 0x9F, 0xA0, 0x92, 0xAA, 0x19, 0x28, 0x52, /* standard CRTC */ 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xA0, 0x00, 0x00, 0x29, 0xE3, 0xFF}, { 0x00, 0x51, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, /* extended CRTC */ 0x00, 0x00, 0x00, 0x03, 0x80, 0x6C, 0x00, 0x00} }, /*--------------------------------------------------------------------------*/ { 1280, 1024, 75, /* 1280x1024 */ 135, /* 135 MHz clock = 75 Hz refresh rate */ 0x23, /* miscOutput register */ { 0xCE, 0x9F, 0x9F, 0x92, 0xA4, 0x15, 0x28, 0x52, /* standard CRTC */ 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0xA0, 0x00, 0x00, 0x29, 0xE3, 0xFF}, { 0x00, 0x51, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, /* extended CRTC */ 0x00, 0x00, 0x00, 0x03, 0x80, 0x87, 0x00, 0x00} }, /*--------------------------------------------------------------------------*/ { 1280, 1024, 85, /* 1280x1024 */ 159, /* 159 MHz clock = 85 Hz refresh rate */ 0x2B, /* miscOutput register */ { 0xD3, 0x9F, 0xA0, 0x98, 0xA8, 0x9C, 0x2E, 0x5A, /* standard CRTC */ 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0xFF, 0x00, 0x00, 0xFF, 0x30, 0xE3, 0xFF}, { 0x6B, 0x41, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, /* extended CRTC */ 0x00, 0x00, 0x01, 0x00, 0x80, 0x9D, 0x00, 0x4B} }, /*--------------------------------------------------------------------------*/ }; #define GFX_VGA_MODES sizeof(gfx_vga_modes)/sizeof(gfx_vga_struct) /*---------------------------------------------------------------------------- * gfx_get_softvga_active * * This returns the active status of SoftVGA *---------------------------------------------------------------------------- */ int gfx_get_softvga_active(void) { unsigned short crtcindex, crtcdata; if (gu1_detect_vsa2()) return (gfx_get_vsa2_softvga_enable()); crtcindex = (INB(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; OUTB(crtcindex, CRTC_MODE_SWITCH_CONTROL); return (INB(crtcdata) & 0x1); } /*---------------------------------------------------------------------------- * gfx_vga_test_pci * * This routine looks for the VGA PCI header. It checks to see that bit 1 * of the command register is writable to know that SoftVGA is trapping * the PCI config cuscles. If SoftVGA is not emulating the header, the * hardware will still respond with the proper device ID, etc. * * We need to know that SoftVGA is really there so that we can set the * command register and have the proper effect (enable trapping of VGA). * Otherwise, if we enable VGA via the PCI header, trapping really won't be * enabled and the VGA register writes will go out to the external card. *---------------------------------------------------------------------------- */ int gfx_vga_test_pci(void) { int softvga = 1; unsigned long value; value = gfx_pci_config_read(0x80009400); if ((value & 0x0000FFFF) != 0x1078) softvga = 0; else { value = gfx_pci_config_read(0x80009404); gfx_pci_config_write(0x80009404, value | 0x02); if (!(gfx_pci_config_read(0x80009404) & 0x02)) softvga = 0; gfx_pci_config_write(0x80009404, value); } return (softvga); } /*---------------------------------------------------------------------------- * gfx_vga_get_pci_command * * This routine returns the value of the PCI command register. *---------------------------------------------------------------------------- */ unsigned char gfx_vga_get_pci_command(void) { unsigned long value; value = gfx_pci_config_read(0x80009404); return ((unsigned char) value); } /*---------------------------------------------------------------------------- * gfx_vga_set_pci_command * * This routine writes the value of the PCI command register. It is used * to enable or disable SoftVGA. * * Bit 0: Enable VGA IO * Bit 1: Enable VGA memory *---------------------------------------------------------------------------- */ int gfx_vga_set_pci_command(unsigned char command) { unsigned long value; value = gfx_pci_config_read(0x80009404) & 0xFFFFFF00; value |= (unsigned long) command; gfx_pci_config_write(0x80009404, value); return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_vga_seq_reset * * This routine enables or disables SoftVGA. It is used to make SoftVGA * "be quiet" and not interfere with any of the direct hardware access from * Durango. For VSA1, the sequencer is reset to stop text redraws. VSA2 may * provide a better way to have SoftVGA sit in the background. *---------------------------------------------------------------------------- */ int gfx_vga_seq_reset(int reset) { OUTB(0x3C4, 0); OUTB(0x3C5, (unsigned char) (reset ? 0x00 : 0x03)); return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_vga_set_graphics_bits * * This routine sets the standard VGA sequencer, graphics controller, and * attribute registers to appropriate values for a graphics mode (packed, * 8 BPP or greater). This is also known as "VESA" modes. The timings for * a particular mode are handled by the CRTC registers, which are set by * the "gfx_vga_restore" routine. Most OSs that use VGA to set modes save * and restore the standard VGA registers themselves, which is why these * registers are not part of the save/restore paradigm. *---------------------------------------------------------------------------- */ int gfx_vga_set_graphics_bits(void) { /* SET GRAPHICS BIT IN GRAPHICS CONTROLLER REG 0x06 */ OUTB(0x3CE, 0x06); OUTB(0x3CF, 0x01); /* SET GRAPHICS BIT IN ATTRIBUTE CONTROLLER REG 0x10 */ INB(0x3BA); /* Reset flip-flop */ INB(0x3DA); OUTB(0x3C0, 0x10); OUTB(0x3C0, 0x01); return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_vga_mode * * This routine searches the VGA mode table for a match of the specified * mode and then fills in the VGA structure with the associated VGA register * values. The "gfx_vga_restore" routine can then be called to actually * set the mode. *---------------------------------------------------------------------------- */ int gfx_vga_mode(gfx_vga_struct * vga, int xres, int yres, int bpp, int hz) { unsigned int i; unsigned short pitch; for (i = 0; i < GFX_VGA_MODES; i++) { if ((gfx_vga_modes[i].xsize == xres) && (gfx_vga_modes[i].ysize == yres) && (gfx_vga_modes[i].hz == hz)) { /* COPY ENTIRE STRUCTURE FROM THE TABLE */ *vga = gfx_vga_modes[i]; /* SET PITCH TO 1K OR 2K */ /* CRTC_EXTENDED_OFFSET index is 0x45, so offset = 0x05 */ pitch = (unsigned short) xres; if (bpp > 8) pitch <<= 1; if (pitch <= 1024) pitch = 1024 >> 3; else pitch = 2048 >> 3; vga->stdCRTCregs[0x13] = (unsigned char) pitch; vga->extCRTCregs[0x05] = (unsigned char) ((pitch >> 8) & 0x03); /* SET PROPER COLOR DEPTH VALUE */ /* CRTC_EXTENDED_COLOR_CONTROL index is 0x46, so offset = 0x06 */ switch (bpp) { case 15: vga->extCRTCregs[0x06] = CRTC_BIT_16BPP | CRTC_BIT_555; break; case 16: vga->extCRTCregs[0x06] = CRTC_BIT_16BPP; break; default: vga->extCRTCregs[0x06] = 0; break; } return (GFX_STATUS_OK); } } return (GFX_STATUS_UNSUPPORTED); } /*---------------------------------------------------------------------------- * gfx_vga_pitch * * This routine updates the VGA regisers in the specified VGA structure for * the specified pitch. It does not program the hardware. *---------------------------------------------------------------------------- */ int gfx_vga_pitch(gfx_vga_struct * vga, unsigned short pitch) { pitch >>= 3; vga->stdCRTCregs[0x13] = (unsigned char) pitch; vga->extCRTCregs[0x05] = (unsigned char) ((pitch >> 8) & 0x03); return (0); } /*---------------------------------------------------------------------------- * gfx_vga_save * * This routine saves the state of the VGA registers into the specified * structure. Flags indicate what portions of the register state need to * be saved. *---------------------------------------------------------------------------- */ int gfx_vga_save(gfx_vga_struct * vga, int flags) { int i; unsigned short crtcindex, crtcdata; crtcindex = (INB(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; /* CHECK MISCELLANEOUS OUTPUT FLAG */ if (flags & GFX_VGA_FLAG_MISC_OUTPUT) { /* SAVE MISCCELLANEOUS OUTPUT REGISTER */ vga->miscOutput = INB(0x3CC); } /* CHECK STANDARD CRTC FLAG */ if (flags & GFX_VGA_FLAG_STD_CRTC) { /* SAVE STANDARD CRTC REGISTERS */ for (i = 0; i < GFX_STD_CRTC_REGS; i++) { OUTB(crtcindex, (unsigned char) i); vga->stdCRTCregs[i] = INB(crtcdata); } } /* CHECK EXTENDED CRTC FLAG */ if (flags & GFX_VGA_FLAG_EXT_CRTC) { /* SAVE EXTENDED CRTC REGISTERS */ for (i = 0; i < GFX_EXT_CRTC_REGS; i++) { OUTB(crtcindex, (unsigned char) (0x40 + i)); vga->extCRTCregs[i] = INB(crtcdata); } } return (0); } /*---------------------------------------------------------------------------- * gfx_vga_clear_extended * * This routine clears the extended SoftVGA register values to have SoftVGA * behave like standard VGA. *---------------------------------------------------------------------------- */ void gfx_vga_clear_extended(void) { int i; unsigned short crtcindex, crtcdata; crtcindex = (INB(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; OUTB(crtcindex, 0x30); OUTB(crtcdata, 0x57); OUTB(crtcdata, 0x4C); for (i = 0x40; i <= 0x4F; i++) { OUTB(crtcindex, (unsigned char) i); OUTB(crtcdata, 0); } OUTB(crtcindex, 0x30); OUTB(crtcdata, 0x00); } /*---------------------------------------------------------------------------- * gfx_vga_restore * * This routine restores the state of the VGA registers from the specified * structure. Flags indicate what portions of the register state need to * be saved. *---------------------------------------------------------------------------- */ int gfx_vga_restore(gfx_vga_struct * vga, int flags) { int i; unsigned short crtcindex, crtcdata; crtcindex = (INB(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; /* CHECK MISCELLANEOUS OUTPUT FLAG */ if (flags & GFX_VGA_FLAG_MISC_OUTPUT) { /* RESTORE MISCELLANEOUS OUTPUT REGISTER VALUE */ OUTB(0x3C2, vga->miscOutput); } /* CHECK STANDARD CRTC FLAG */ if (flags & GFX_VGA_FLAG_STD_CRTC) { /* UNLOCK STANDARD CRTC REGISTERS */ OUTB(crtcindex, 0x11); OUTB(crtcdata, 0); /* RESTORE STANDARD CRTC REGISTERS */ for (i = 0; i < GFX_STD_CRTC_REGS; i++) { OUTB(crtcindex, (unsigned char) i); OUTB(crtcdata, vga->stdCRTCregs[i]); } } /* CHECK EXTENDED CRTC FLAG */ if (flags & GFX_VGA_FLAG_EXT_CRTC) { /* UNLOCK EXTENDED CRTC REGISTERS */ OUTB(crtcindex, 0x30); OUTB(crtcdata, 0x57); OUTB(crtcdata, 0x4C); /* RESTORE EXTENDED CRTC REGISTERS */ for (i = 0; i < GFX_EXT_CRTC_REGS; i++) { OUTB(crtcindex, (unsigned char) (0x40 + i)); OUTB(crtcdata, vga->extCRTCregs[i]); } /* LOCK EXTENDED CRTC REGISTERS */ OUTB(crtcindex, 0x30); OUTB(crtcdata, 0x00); /* CHECK IF DIRECT FRAME BUFFER MODE (VESA MODE) */ if (vga->extCRTCregs[0x03] & 1) { /* SET BORDER COLOR TO BLACK */ /* This really should be another thing saved/restored, but */ /* Durango currently doesn't do the attr controller registers. */ INB(0x3BA); /* Reset flip-flop */ INB(0x3DA); OUTB(0x3C0, 0x11); OUTB(0x3C0, 0x00); } } return (0); } /*---------------------------------------------------------------------------- * gfx_vga_mode_switch * * This routine programs the SoftVGA register to indicate that a mode switch * is in progress. This results in a cleaner mode switch since SoftVGA will * not validate the hardware with intermediate values. *---------------------------------------------------------------------------- */ int gfx_vga_mode_switch(int active) { unsigned short crtcindex, crtcdata; crtcindex = (INB(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; /* UNLOCK EXTENDED CRTC REGISTERS */ OUTB(crtcindex, CRTC_EXTENDED_REGISTER_LOCK); OUTB(crtcdata, 0x57); OUTB(crtcdata, 0x4C); /* SIGNAL THE BEGINNING OR END OF THE MODE SWITCH */ /* SoftVGA will hold off validating the back end hardware. */ OUTB(crtcindex, CRTC_MODE_SWITCH_CONTROL); active = active ? 1 : 0; OUTB(crtcdata, (unsigned char) active); /* WAIT UNTIL SOFTVGA HAS VALIDATED MODE IF ENDING MODE SWITCH */ /* This is for VSA1 only, where SoftVGA waits until the next */ /* vertical blank to validate the hardware state. */ if ((!active) && (!(gu1_detect_vsa2()))) { OUTB(crtcindex, 0x33); while (INB(crtcdata) & 0x80); } /* LOCK EXTENDED CRTC REGISTERS */ OUTB(crtcindex, CRTC_EXTENDED_REGISTER_LOCK); OUTB(crtcdata, 0x00); return (0); } /*---------------------------------------------------------------------------- * gu1_detect_vsa2 * * This routine detects if VSA2 is present. The interface to SoftVGA * changed slightly. *---------------------------------------------------------------------------- */ int gu1_detect_vsa2(void) { unsigned short crtcindex, crtcdata; crtcindex = (INB(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; OUTB(crtcindex, 0x35); if (INB(crtcdata) != 'C') return (0); OUTB(crtcindex, 0x36); if (INB(crtcdata) != 'X') return (0); return (1); } /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/tv_fs450.h0000644000175000017500000001622012654445443014677 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file defines the common FS450 API. * */ #ifndef __FS450_H__ #define __FS450_H__ #ifdef __cplusplus extern "C" { #endif /*==========================================================================*/ /* Init and cleanup functions*/ int FS450_init(void); void FS450_cleanup(void); /* call FS450_init at startup to probe for and initialize FS450. */ /* returns 0 if successful. */ /*==========================================================================*/ /* TV output on or off*/ int FS450_get_tv_enable(unsigned int *p_on); int FS450_set_tv_enable(unsigned int on); /* on is 1 for TV on, 0 for off */ /*==========================================================================*/ /* TV standard*/ int FS450_get_tv_standard(unsigned long *p_standard); int FS450_get_available_tv_standards(unsigned long *p_standards); int FS450_set_tv_standard(unsigned long standard); /* standard is one of the FS450_TV_STANDARD constants */ /* standards is a bitmask of zero or more FS450_TV_STANDARD constants */ /* FS450 TV Standard flags*/ #define FS450_TV_STANDARD_NTSC_M 0x0001 #define FS450_TV_STANDARD_NTSC_M_J 0x0002 #define FS450_TV_STANDARD_PAL_B 0x0004 #define FS450_TV_STANDARD_PAL_D 0x0008 #define FS450_TV_STANDARD_PAL_H 0x0010 #define FS450_TV_STANDARD_PAL_I 0x0020 #define FS450_TV_STANDARD_PAL_M 0x0040 #define FS450_TV_STANDARD_PAL_N 0x0080 #define FS450_TV_STANDARD_PAL_G 0x0100 /*==========================================================================*/ /* VGA mode assumed by FS450*/ int FS450_get_vga_mode(unsigned long *p_vga_mode); int FS450_get_available_vga_modes(unsigned long *p_vga_modes); int FS450_set_vga_mode(unsigned long vga_mode); /* vga_mode is one of the FS450_VGA_MODE constants */ /* vga_modes is a bitmask of zero or more FS450_VGA_MODE constants */ /* FS450 VGA Mode flags*/ #define FS450_VGA_MODE_UNKNOWN 0 #define FS450_VGA_MODE_640X480 0x0001 #define FS450_VGA_MODE_720X487 0x0002 #define FS450_VGA_MODE_720X576 0x0004 #define FS450_VGA_MODE_800X600 0x0008 #define FS450_VGA_MODE_1024X768 0x0010 /*==========================================================================*/ /* TVout mode*/ int FS450_get_tvout_mode(unsigned long *p_tvout_mode); int FS450_set_tvout_mode(unsigned long tvout_mode); /* tvout_mode is a bitmask of FS450_TVOUT_MODE constants */ /* FS450 TVout mode flags*/ #define FS450_TVOUT_MODE_CVBS 0x0001 #define FS450_TVOUT_MODE_YC 0x0002 #define FS450_TVOUT_MODE_RGB 0x0004 #define FS450_TVOUT_MODE_CVBS_YC (FS450_TVOUT_MODE_CVBS | FS450_TVOUT_MODE_YC) /*==========================================================================*/ /* Flicker control*/ int FS450_get_sharpness(int *p_sharpness); int FS450_set_sharpness(int sharpness); /* sharpness is a percentage in tenths of a percent, 0 to 1000 */ int FS450_get_flicker_filter(int *p_flicker); int FS450_set_flicker_filter(int flicker); /* flicker_filter is a percentage in tenths of a percent, 0 to 1000 */ /*==========================================================================*/ /* Size and Position*/ int FS450_get_overscan(int *p_x, int *p_y); int FS450_set_overscan(int x, int y); int FS450_get_position(int *p_x, int *p_y); int FS450_set_position(int x, int y); /* x and y are horizontal and vertical adjustments, -1000 to +1000 */ /*==========================================================================*/ /* Visual adjustments*/ int FS450_get_color(int *p_color); int FS450_set_color(int color); /* color is a percentage, 0 to 100 */ int FS450_get_brightness(int *p_brightness); int FS450_set_brightness(int brightness); /* brightness is a percentage, 0 to 100 */ int FS450_get_contrast(int *p_contrast); int FS450_set_contrast(int constrast); /* contrast is a percentage, 0 to 100 */ /*==========================================================================*/ /* Luma and Chroma filter*/ int FS450_get_yc_filter(unsigned int *p_yc_filter); int FS450_set_yc_filter(unsigned int yc_filter); /* yc_filter is a bitmask of FS450_LUMA_FILTER and/or FS450_CHROMA_FILTER */ /* FS450 Luma and Chroma Filters*/ #define FS450_LUMA_FILTER 0x0001 #define FS450_CHROMA_FILTER 0x0002 /*==========================================================================*/ /* Macrovision*/ int FS450_get_aps_trigger_bits(unsigned int *p_trigger_bits); int FS450_set_aps_trigger_bits(unsigned int trigger_bits); /* trigger_bits is one of the FS450_APS_TRIGGER constants */ /* APS Trigger Bits*/ #define FS450_APS_TRIGGER_OFF 0 #define FS450_APS_TRIGGER_AGC_ONLY 1 #define FS450_APS_TRIGGER_AGC_2_LINE 2 #define FS450_APS_TRIGGER_AGC_4_LINE 3 /*==========================================================================*/ /* direct access to Houston and platform registers (debug builds only) * The two functions FS450_ReadRegister and FS450_WriteRegister allow access * to device registers. These functions are intended for debugging purposes * only and should not be included in a shipping product. * */ #ifdef FS450_DIRECTREG #define SOURCE_HOUSTON 0 #define SOURCE_GCC 1 typedef struct _S_REG_INFO { int source; unsigned int size; unsigned long offset; unsigned long value; } S_REG_INFO; int FS450_ReadRegister(S_REG_INFO * p_reg); int FS450_WriteRegister(S_REG_INFO * p_reg); #endif /*==========================================================================*/ /* Error Codes*/ #define ERR_INVALID_PARAMETER 0x1000 #define ERR_NOT_SUPPORTED 0x1001 #define ERR_CANNOT_CHANGE_WHILE_TV_ON 0x1002 #define ERR_DRIVER_NOT_FOUND 0x1100 #define ERR_DRIVER_ERROR 0x1101 #define ERR_DEVICE_NOT_FOUND 0x1120 #define ERR_I2C_MISSING_DEVICE 0x1200 #define ERR_I2C_WRITE_FAILED 0x1201 #define ERR_I2C_READ_FAILED 0x1202 #ifdef __cplusplus } #endif #endif xf86-video-geode-2.11.18/src/gfx/vid_1200.c0000644000175000017500000026177412654445443014564 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to control the SC1200 video overlay hardware. * */ /*---------------------------------------------------------------------------- * SC1200 GAMMA RAM TABLE *---------------------------------------------------------------------------- */ unsigned long gfx_gamma_ram_1200[] = { 0x00000000, 0x00040003, 0x00050104, 0x00060205, 0x00070306, 0x00080407, 0x00090508, 0x000A0609, 0x000B070A, 0x000C080B, 0x000D090C, 0x000E0A0D, 0x000F0B0E, 0x00100C0F, 0x00110D10, 0x00110E11, 0x00120F12, 0x00141013, 0x00151114, 0x00161215, 0x00171316, 0x00181417, 0x00191518, 0x001A1619, 0x001B171A, 0x001C181B, 0x001D191C, 0x001D1A1D, 0x001E1B1E, 0x00201C1F, 0x00201D20, 0x00221E21, 0x00231F22, 0x00242023, 0x00252124, 0x00262225, 0x00262326, 0x00282427, 0x00292528, 0x00292629, 0x002B272A, 0x002C282B, 0x002D292C, 0x002E2A2D, 0x002F2B2E, 0x00302C2F, 0x00312D30, 0x00322E31, 0x00332F32, 0x00343033, 0x00353134, 0x00363235, 0x00373336, 0x00383437, 0x00393538, 0x003A3639, 0x003B373A, 0x003C383B, 0x003D393C, 0x003E3A3D, 0x003F3B3E, 0x00403C3F, 0x00413D40, 0x00423E41, 0x00433F42, 0x00444043, 0x00444144, 0x00454245, 0x00474346, 0x00484447, 0x00494548, 0x004A4649, 0x004B474A, 0x004C484B, 0x004D494C, 0x004E4A4D, 0x004F4B4E, 0x00504C4F, 0x00514D50, 0x00524E51, 0x00534F52, 0x00545053, 0x00555154, 0x00565255, 0x00575356, 0x00585457, 0x00595558, 0x005A5659, 0x005B575A, 0x005C585B, 0x005D595C, 0x005E5A5D, 0x005F5B5E, 0x00605C5F, 0x00615D60, 0x00625E61, 0x00635F62, 0x00646063, 0x00656164, 0x00666265, 0x00676366, 0x00686467, 0x00696568, 0x006A6669, 0x006B676A, 0x006C686B, 0x006D696C, 0x006E6A6D, 0x006F6B6E, 0x00706C6F, 0x00716D70, 0x00726E71, 0x00736F72, 0x00747073, 0x00757174, 0x00767275, 0x00777376, 0x00787477, 0x00797578, 0x007A7679, 0x007B777A, 0x007C787B, 0x007D797C, 0x007E7A7D, 0x007F7B7E, 0x00807C7F, 0x00817D80, 0x00827E81, 0x00837F82, 0x00848083, 0x00858184, 0x00868285, 0x00878386, 0x00888487, 0x00898588, 0x008A8689, 0x008B878A, 0x008C888B, 0x008D898C, 0x008E8A8D, 0x008F8B8E, 0x00908C8F, 0x00918D90, 0x00928E91, 0x00938F92, 0x00949093, 0x00959194, 0x00969295, 0x00979396, 0x00989497, 0x00999598, 0x009A9699, 0x009B979A, 0x009C989B, 0x009D999C, 0x009E9A9D, 0x009F9B9E, 0x00A09C9F, 0x00A19DA0, 0x00A29EA1, 0x00A39FA2, 0x00A4A0A3, 0x00A5A1A4, 0x00A6A2A5, 0x00A7A3A6, 0x00A8A4A7, 0x00A9A5A8, 0x00AAA6A9, 0x00ABA7AA, 0x00ACA8AB, 0x00ADA9AC, 0x00AEAAAD, 0x00AFABAE, 0x00B0ACAF, 0x00B1ADB0, 0x00B2AEB1, 0x00B3AFB2, 0x00B4B0B3, 0x00B5B1B4, 0x00B6B2B5, 0x00B7B3B6, 0x00B8B4B7, 0x00B9B5B8, 0x00BAB6B9, 0x00BBB7BA, 0x00BCB8BB, 0x00BDB9BC, 0x00BEBABD, 0x00BFBBBE, 0x00C0BCBF, 0x00C1BDC0, 0x00C2BEC1, 0x00C3BFC2, 0x00C4C0C3, 0x00C5C1C4, 0x00C6C2C5, 0x00C7C3C6, 0x00C8C4C7, 0x00C9C5C8, 0x00CAC6C9, 0x00CBC7CA, 0x00CCC8CB, 0x00CDC9CC, 0x00CECACD, 0x00CFCBCE, 0x00D0CCCF, 0x00D1CDD0, 0x00D2CED1, 0x00D3CFD2, 0x00D4D0D3, 0x00D5D1D4, 0x00D6D2D5, 0x00D7D3D6, 0x00D8D4D7, 0x00D9D5D8, 0x00DAD6D9, 0x00DBD7DA, 0x00DCD8DB, 0x00DDD9DC, 0x00DEDADD, 0x00DFDBDE, 0x00E0DCDF, 0x00E1DDE0, 0x00E2DEE1, 0x00E3DFE2, 0x00E4E0E3, 0x00E5E1E4, 0x00E6E2E5, 0x00E7E3E6, 0x00E8E4E7, 0x00E9E5E8, 0x00EAE6E9, 0x00EBE7EA, 0x00ECE8EB, 0x00EDE9EC, 0x00EEEAED, 0x00EFEBEE, 0x00F0ECEF, 0x00F1EDF0, 0x00F2EEF1, 0x00F3EFF2, 0x00F4F0F3, 0x00F5F1F4, 0x00F6F2F5, 0x00F7F3F6, 0x00F8F4F7, 0x00F9F5F8, 0x00FAF6F9, 0x00FBF7FA, 0x00FCF8FB, 0x00FDF9FC, 0x00FEFAFD, 0x00FFFBFE, 0x00FFFCFE, 0x00FFFDFE, 0x00FFFFFF }; /*---------------------------------------------------------------------------- * SC1200 PLL TABLE *---------------------------------------------------------------------------- */ typedef struct tagSC1200PLL { long frequency; /* 16.16 fixed point frequency */ unsigned long clock_select; /* clock select register (0x2C) */ } SC1200PLL; SC1200PLL gfx_sc1200_clock_table[] = { {(25L << 16) | ((1750L * 65536L) / 10000L), 0x0070E00C}, /* 25.1750 * (sc=24.9231) */ {(27L << 16) | ((0000L * 65536L) / 10000L), 0x00300100}, /* 27.0000 */ {(28L << 16) | ((3220L * 65536L) / 10000L), 0x0070EC0C}, /* 28.3220 * (SC=27.000) */ {(31L << 16) | ((5000L * 65536L) / 10000L), 0x00500D02}, /* 31.5000 */ {(36L << 16) | ((0000L * 65536L) / 10000L), 0x00500F02}, /* 36.0000 */ {(37L << 16) | ((5000L * 65536L) / 10000L), 0x0050B108}, /* 37.5000 */ {(40L << 16) | ((0000L * 65536L) / 10000L), 0x0050D20D}, /* 40.0000 */ {(44L << 16) | ((9000L * 65536L) / 10000L), 0x0050DC0D}, /* 44.9000 */ {(49L << 16) | ((5000L * 65536L) / 10000L), 0x00501502}, /* 49.5000 */ {(50L << 16) | ((0000L * 65536L) / 10000L), 0x0050A404}, /* 50.0000 */ {(50L << 16) | ((3500L * 65536L) / 10000L), 0x0050E00C}, /* 50.3500 */ {(54L << 16) | ((0000L * 65536L) / 10000L), 0x00300300}, /* 54.0000 */ {(56L << 16) | ((3916L * 65536L) / 10000L), 0x0050F40D}, /* 56.3916 */ {(56L << 16) | ((6440L * 65536L) / 10000L), 0x0050EC0C}, /* 56.6440 */ {(59L << 16) | ((0000L * 65536L) / 10000L), 0x0030A207}, /* 59.0000 */ {(63L << 16) | ((0000L * 65536L) / 10000L), 0x00300D02}, /* 63.0000 */ {(65L << 16) | ((0000L * 65536L) / 10000L), 0x0030CC0F}, /* 65.0000 */ {(67L << 16) | ((5000L * 65536L) / 10000L), 0x00300400}, /* 67.5000 */ {(70L << 16) | ((8000L * 65536L) / 10000L), 0x00301403}, /* 70.8000 */ {(72L << 16) | ((0000L * 65536L) / 10000L), 0x00300F02}, /* 72.0000 */ {(75L << 16) | ((0000L * 65536L) / 10000L), 0x0030B108}, /* 75.0000 */ {(78L << 16) | ((7500L * 65536L) / 10000L), 0x0030A205}, /* 78.7500 */ {(80L << 16) | ((0000L * 65536L) / 10000L), 0x0030D20D}, /* 80.0000 */ {(87L << 16) | ((2728L * 65536L) / 10000L), 0x0030E00E}, /* 87.2728 */ {(89L << 16) | ((8000L * 65536L) / 10000L), 0x0030DC0D}, /* 89.8000 */ {(94L << 16) | ((5000L * 65536L) / 10000L), 0x00300600}, /* 99.0000 */ {(99L << 16) | ((0000L * 65536L) / 10000L), 0x00301502}, /* 99.0000 */ {(100L << 16) | ((0000L * 65536L) / 10000L), 0x0030A404}, /* 100.00 */ {(108L << 16) | ((0000L * 65536L) / 10000L), 0x00100300}, /* 108.00 */ {(112L << 16) | ((5000L * 65536L) / 10000L), 0x00301802}, /* 108.00 */ {(130L << 16) | ((0000L * 65536L) / 10000L), 0x0010CC0F}, /* 130.00 */ {(135L << 16) | ((0000L * 65536L) / 10000L), 0x00100400}, /* 135.00 */ {(157L << 16) | ((5000L * 65536L) / 10000L), 0x0010A205}, /* 157.50 */ {(162L << 16) | ((0000L * 65536L) / 10000L), 0x00100500}, /* 162.00 */ {(175L << 16) | ((0000L * 65536L) / 10000L), 0x0010E00E}, /* 175.50 */ {(189L << 16) | ((0000L * 65536L) / 10000L), 0x00100600}, /* 189.00 */ {(202L << 16) | ((0000L * 65536L) / 10000L), 0x0010EF0E}, /* 202.50 */ {(232L << 16) | ((0000L * 65536L) / 10000L), 0x0010AA04}, /* 232.50 */ /* Precomputed inidces in the hardware */ {0x0018EC4D, 0x000F0000}, /* 24.923052 */ {0x00192CCC, 0x00000000}, /* 25.1750 */ {0x001B0000, 0x00300100}, /* 27.0000 */ {0x001F8000, 0x00010000}, /* 31.5000 */ {0x00240000, 0x00020000}, /* 36.0000 */ {0x00280000, 0x00030000}, /* 40.0000 */ {0x00318000, 0x00050000}, /* 49.5000 */ {0x00320000, 0x00040000}, /* 50.0000 */ {0x00384000, 0x00060000}, /* 56.2500 */ {0x00410000, 0x00080000}, /* 65.0000 */ {0x004E8000, 0x000A0000}, /* 78.5000 */ {0x005E8000, 0x000B0000}, /* 94.5000 */ {0x006C0000, 0x000C0000}, /* 108.0000 */ {0x00870000, 0x000D0000}, /* 135.0000 */ }; #define NUM_SC1200_FREQUENCIES \ sizeof(gfx_sc1200_clock_table)/sizeof(SC1200PLL) /*--------------------------------------------------------------------------- * gfx_reset_video (PRIVATE ROUTINE: NOT PART OF DURANGO API) * * This routine is used to disable all components of video overlay before * performing a mode switch. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void sc1200_reset_video(void) #else void gfx_reset_video(void) #endif { int i; gfx_set_video_enable(0); /* SET WINDOW 0 AFTER RESET */ for (i = 2; i >= 0; i--) { gfx_select_alpha_region(i); gfx_set_alpha_enable(0); gfx_set_alpha_color_enable(0); } /* CLEAR THE DISPLAY BUFFER SIZE TO ZERO */ /* During a modeset,if FIFO load is enabled with a large buffer size, */ /* the FIFO can hang. To prevent this, we set the buffer size to zero */ /* and wait for this new size to be latched */ gfx_set_display_video_size(0, 0); if (gfx_test_timing_active()) { while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); } } /*----------------------------------------------------------------------------- * gfx_set_display_control (PRIVATE ROUTINE: NOT PART OF DURANGO API) * * This routine configures the display output. * * "sync_polarities" is used to set the polarities of the sync pulses * according to the following mask: * * Bit 0: If set to 1, negative horizontal polarity is programmed, * otherwise positive horizontal polarity is programmed. * Bit 1: If set to 1, negative vertical polarity is programmed, * otherwise positive vertical polarity is programmed. * *----------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_display_control(int sync_polarities) #else int gfx_set_display_control(int sync_polarities) #endif { unsigned long dcfg; /* CONFIGURE DISPLAY OUTPUT FROM VIDEO PROCESSOR */ dcfg = READ_VID32(SC1200_DISPLAY_CONFIG); dcfg &= ~(SC1200_DCFG_CRT_SYNC_SKW_MASK | SC1200_DCFG_PWR_SEQ_DLY_MASK | SC1200_DCFG_CRT_HSYNC_POL | SC1200_DCFG_CRT_VSYNC_POL | SC1200_DCFG_FP_PWR_EN | SC1200_DCFG_FP_DATA_EN); dcfg |= (SC1200_DCFG_CRT_SYNC_SKW_INIT | SC1200_DCFG_PWR_SEQ_DLY_INIT | SC1200_DCFG_GV_PAL_BYP); if (PanelEnable) dcfg |= SC1200_DCFG_FP_PWR_EN; /* SET APPROPRIATE SYNC POLARITIES */ if (sync_polarities & 0x1) dcfg |= SC1200_DCFG_CRT_HSYNC_POL; if (sync_polarities & 0x2) dcfg |= SC1200_DCFG_CRT_VSYNC_POL; WRITE_VID32(SC1200_DISPLAY_CONFIG, dcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_clock_frequency * * This routine sets the clock frequency, specified as a 16.16 fixed point * value (0x00318000 = 49.5 MHz). It will set the closest frequency found * in the lookup table. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void sc1200_set_clock_frequency(unsigned long frequency) #else void gfx_set_clock_frequency(unsigned long frequency) #endif { unsigned int index; unsigned long value, pll; long min, diff; /* FIND THE REGISTER VALUES FOR THE DESIRED FREQUENCY */ /* Search the table for the closest frequency (16.16 format). */ value = gfx_sc1200_clock_table[0].clock_select; min = (long) gfx_sc1200_clock_table[0].frequency - frequency; if (min < 0L) min = -min; for (index = 1; index < NUM_SC1200_FREQUENCIES; index++) { diff = (long) gfx_sc1200_clock_table[index].frequency - frequency; if (diff < 0L) diff = -diff; if (diff < min) { min = diff; value = gfx_sc1200_clock_table[index].clock_select; } } /* SET THE DOT CLOCK REGISTER */ pll = READ_VID32(SC1200_VID_MISC); WRITE_VID32(SC1200_VID_MISC, pll | SC1200_PLL_POWER_NORMAL); WRITE_VID32(SC1200_VID_CLOCK_SELECT, value); return; } /*--------------------------------------------------------------------------- * gfx_set_screen_enable (PRIVATE ROUTINE - NOT PART OF API) * * This routine enables or disables the graphics display logic of the video * processor. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_screen_enable(int enable) #else int gfx_set_screen_enable(int enable) #endif { unsigned long config; config = READ_VID32(SC1200_DISPLAY_CONFIG); if (enable) WRITE_VID32(SC1200_DISPLAY_CONFIG, config | SC1200_DCFG_DIS_EN); else WRITE_VID32(SC1200_DISPLAY_CONFIG, config & ~SC1200_DCFG_DIS_EN); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_crt_enable * * This routine enables or disables the CRT output from the video processor. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_crt_enable(int enable) #else int gfx_set_crt_enable(int enable) #endif { unsigned long config, misc; config = READ_VID32(SC1200_DISPLAY_CONFIG); misc = READ_VID32(SC1200_VID_MISC); /* * IMPORTANT: For all modes do NOT disable the graphics display logic * because it might be needed for TV */ switch (enable) { case CRT_DISABLE: /* HSync:Off VSync:Off */ WRITE_VID32(SC1200_DISPLAY_CONFIG, config & ~(SC1200_DCFG_HSYNC_EN | SC1200_DCFG_VSYNC_EN | SC1200_DCFG_DAC_BL_EN)); WRITE_VID32(SC1200_VID_MISC, misc | SC1200_DAC_POWER_DOWN); break; case CRT_ENABLE: /* Enable CRT display, including * display logic */ WRITE_VID32(SC1200_DISPLAY_CONFIG, config | SC1200_DCFG_HSYNC_EN | SC1200_DCFG_VSYNC_EN | SC1200_DCFG_DAC_BL_EN); WRITE_VID32(SC1200_VID_MISC, misc & ~SC1200_DAC_POWER_DOWN); /* ENABLE GRAPHICS DISPLAY LOGIC */ gfx_set_screen_enable(1); break; case CRT_STANDBY: /* HSync:Off VSync:On */ WRITE_VID32(SC1200_DISPLAY_CONFIG, (config & ~(SC1200_DCFG_HSYNC_EN | SC1200_DCFG_DAC_BL_EN)) | SC1200_DCFG_VSYNC_EN); WRITE_VID32(SC1200_VID_MISC, misc | SC1200_DAC_POWER_DOWN); break; case CRT_SUSPEND: /* HSync:On VSync:Off */ WRITE_VID32(SC1200_DISPLAY_CONFIG, (config & ~(SC1200_DCFG_VSYNC_EN | SC1200_DCFG_DAC_BL_EN)) | SC1200_DCFG_HSYNC_EN); WRITE_VID32(SC1200_VID_MISC, misc | SC1200_DAC_POWER_DOWN); break; default: return GFX_STATUS_BAD_PARAMETER; } return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_set_video_enable * * This routine enables or disables the video overlay functionality. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_enable(int enable) #else int gfx_set_video_enable(int enable) #endif { unsigned long vcfg; /* WAIT FOR VERTICAL BLANK TO START */ /* Otherwise a glitch can be observed. */ if (gfx_test_timing_active()) { if (!gfx_test_vertical_active()) { while (!gfx_test_vertical_active()); } while (gfx_test_vertical_active()); } vcfg = READ_VID32(SC1200_VIDEO_CONFIG); if (enable) { /* ENABLE SC1200 VIDEO OVERLAY */ vcfg |= SC1200_VCFG_VID_EN; WRITE_VID32(SC1200_VIDEO_CONFIG, vcfg); } else { /* DISABLE SC1200 VIDEO OVERLAY */ vcfg &= ~SC1200_VCFG_VID_EN; WRITE_VID32(SC1200_VIDEO_CONFIG, vcfg); } return (0); } /*---------------------------------------------------------------------------- * gfx_set_video_format * * Sets input video format type, to one of the YUV formats or to RGB. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_format(unsigned long format) #else int gfx_set_video_format(unsigned long format) #endif { unsigned long ctrl, vcfg = 0; /* SET THE SC1200 VIDEO INPUT FORMAT */ vcfg = READ_VID32(SC1200_VIDEO_CONFIG); ctrl = READ_VID32(SC1200_VID_ALPHA_CONTROL); ctrl &= ~(SC1200_VIDEO_INPUT_IS_RGB); vcfg &= ~(SC1200_VCFG_VID_INP_FORMAT | SC1200_VCFG_4_2_0_MODE); switch (format) { case VIDEO_FORMAT_UYVY: vcfg |= SC1200_VCFG_UYVY_FORMAT; break; case VIDEO_FORMAT_YUYV: vcfg |= SC1200_VCFG_YUYV_FORMAT; break; case VIDEO_FORMAT_Y2YU: vcfg |= SC1200_VCFG_Y2YU_FORMAT; break; case VIDEO_FORMAT_YVYU: vcfg |= SC1200_VCFG_YVYU_FORMAT; break; case VIDEO_FORMAT_Y0Y1Y2Y3: vcfg |= SC1200_VCFG_UYVY_FORMAT; vcfg |= SC1200_VCFG_4_2_0_MODE; break; case VIDEO_FORMAT_Y3Y2Y1Y0: vcfg |= SC1200_VCFG_Y2YU_FORMAT; vcfg |= SC1200_VCFG_4_2_0_MODE; break; case VIDEO_FORMAT_Y1Y0Y3Y2: vcfg |= SC1200_VCFG_YUYV_FORMAT; vcfg |= SC1200_VCFG_4_2_0_MODE; break; case VIDEO_FORMAT_Y1Y2Y3Y0: vcfg |= SC1200_VCFG_YVYU_FORMAT; vcfg |= SC1200_VCFG_4_2_0_MODE; break; case VIDEO_FORMAT_RGB: ctrl |= SC1200_VIDEO_INPUT_IS_RGB; vcfg |= SC1200_VCFG_UYVY_FORMAT; break; case VIDEO_FORMAT_P2M_P2L_P1M_P1L: ctrl |= SC1200_VIDEO_INPUT_IS_RGB; vcfg |= SC1200_VCFG_Y2YU_FORMAT; break; case VIDEO_FORMAT_P1M_P1L_P2M_P2L: ctrl |= SC1200_VIDEO_INPUT_IS_RGB; vcfg |= SC1200_VCFG_YUYV_FORMAT; break; case VIDEO_FORMAT_P1M_P2L_P2M_P1L: ctrl |= SC1200_VIDEO_INPUT_IS_RGB; vcfg |= SC1200_VCFG_YVYU_FORMAT; break; default: return GFX_STATUS_BAD_PARAMETER; } /* ALWAYS DISABLE GRAPHICS CSC */ /* This is enabled in the function gfx_set_color_space_YUV for */ /* YUV blending on TV. */ ctrl &= ~SC1200_CSC_GFX_RGB_TO_YUV; if (ctrl & SC1200_VIDEO_INPUT_IS_RGB) ctrl &= ~SC1200_CSC_VIDEO_YUV_TO_RGB; else ctrl |= SC1200_CSC_VIDEO_YUV_TO_RGB; WRITE_VID32(SC1200_VIDEO_CONFIG, vcfg); WRITE_VID32(SC1200_VID_ALPHA_CONTROL, ctrl); return (0); } /*---------------------------------------------------------------------------- * gfx_set_video_size * * This routine specifies the size of the source data. It is used only * to determine how much data to transfer per frame, and is not used to * calculate the scaling value (that is handled by a separate routine). *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_size(unsigned short width, unsigned short height) #else int gfx_set_video_size(unsigned short width, unsigned short height) #endif { unsigned long size, vcfg; /* SET THE SC1200 VIDEO LINE SIZE */ vcfg = READ_VID32(SC1200_VIDEO_CONFIG); vcfg &= ~(SC1200_VCFG_LINE_SIZE_LOWER_MASK | SC1200_VCFG_LINE_SIZE_UPPER); size = (width >> 1); vcfg |= (size & 0x00FF) << 8; if (size & 0x0100) vcfg |= SC1200_VCFG_LINE_SIZE_UPPER; WRITE_VID32(SC1200_VIDEO_CONFIG, vcfg); /* SET TOTAL VIDEO BUFFER SIZE IN DISPLAY CONTROLLER */ /* Use private routine to abstract the display controller. */ /* Add 1 line to bypass issue #803 */ gfx_set_display_video_size(width, (unsigned short) (height + 2)); return (0); } /*---------------------------------------------------------------------------- * gfx_set_video_offset * * This routine sets the starting offset for the video buffer when only * one offset needs to be specified. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_offset(unsigned long offset) #else int gfx_set_video_offset(unsigned long offset) #endif { /* SAVE VALUE FOR FUTURE CLIPPING OF THE TOP OF THE VIDEO WINDOW */ gfx_vid_offset = offset; /* SET VIDEO BUFFER OFFSET IN DISPLAY CONTROLLER */ /* Use private routine to abstract the display controller. */ gfx_set_display_video_offset(offset); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_upscale * * This routine sets the scale factor for the video overlay window. The * size of the source and destination regions are specified in pixels. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_upscale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) #else int gfx_set_video_upscale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) #endif { unsigned long xscale, yscale; /* SAVE PARAMETERS (unless don't-care zero destination arguments are used) * */ /* These are needed for clipping the video window later. */ if (dstw != 0) { gfx_vid_srcw = srcw; gfx_vid_dstw = dstw; } if (dsth != 0) { gfx_vid_srch = srch; gfx_vid_dsth = dsth; } /* CALCULATE SC1200 SCALE FACTORS */ if (dstw == 0) xscale = READ_VID32(SC1200_VIDEO_UPSCALE) & 0xffff; /* keep previous if don't-care argument */ else if (dstw <= srcw) xscale = 0x2000l; /* horizontal downscaling is currently done in a separate function */ else if ((srcw == 1) || (dstw == 1)) return GFX_STATUS_BAD_PARAMETER; else xscale = (0x2000l * (srcw - 1l)) / (dstw - 1l); if (dsth == 0) yscale = (READ_VID32(SC1200_VIDEO_UPSCALE) & 0xffff0000) >> 16; /* keep previous if don't-care argument */ else if (dsth <= srch) yscale = 0x2000l; /* No vertical downscaling in SC1200 so force to 1x if attempted */ else if ((srch == 1) || (dsth == 1)) return GFX_STATUS_BAD_PARAMETER; else yscale = (0x2000l * (srch - 1l)) / (dsth - 1l); WRITE_VID32(SC1200_VIDEO_UPSCALE, (yscale << 16) | xscale); /* CALL ROUTINE TO UPDATE WINDOW POSITION */ /* This is required because the scale values effect the number of */ /* source data pixels that need to be clipped, as well as the */ /* amount of data that needs to be transferred. */ gfx_set_video_window(gfx_vid_xpos, gfx_vid_ypos, gfx_vid_width, gfx_vid_height); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_scale * * This routine sets the scale factor for the video overlay window. The * size of the source and destination regions are specified in pixels. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) #else int gfx_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth) #endif { return gfx_set_video_upscale(srcw, srch, dstw, dsth); } /*--------------------------------------------------------------------------- * gfx_set_video_downscale_config * * This routine sets the downscale type and factor for the video overlay * window. * Note: No downscaling support for RGB565 and YUV420 video formats. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_downscale_config(unsigned short type, unsigned short m) #else int gfx_set_video_downscale_config(unsigned short type, unsigned short m) #endif { unsigned long downscale; if ((m < 1) || (m > 16)) return GFX_STATUS_BAD_PARAMETER; downscale = READ_VID32(SC1200_VIDEO_DOWNSCALER_CONTROL); downscale &= ~(SC1200_VIDEO_DOWNSCALE_FACTOR_MASK | SC1200_VIDEO_DOWNSCALE_TYPE_MASK); downscale |= ((m - 1l) << SC1200_VIDEO_DOWNSCALE_FACTOR_POS); switch (type) { case VIDEO_DOWNSCALE_KEEP_1_OF: downscale |= SC1200_VIDEO_DOWNSCALE_TYPE_A; break; case VIDEO_DOWNSCALE_DROP_1_OF: downscale |= SC1200_VIDEO_DOWNSCALE_TYPE_B; break; default: return GFX_STATUS_BAD_PARAMETER; } WRITE_VID32(SC1200_VIDEO_DOWNSCALER_CONTROL, downscale); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_downscale_coefficients * * This routine sets the downscale filter coefficients. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_downscale_coefficients(unsigned short coef1, unsigned short coef2, unsigned short coef3, unsigned short coef4) #else int gfx_set_video_downscale_coefficients(unsigned short coef1, unsigned short coef2, unsigned short coef3, unsigned short coef4) #endif { if ((coef1 + coef2 + coef3 + coef4) != 16) return GFX_STATUS_BAD_PARAMETER; WRITE_VID32(SC1200_VIDEO_DOWNSCALER_COEFFICIENTS, ((unsigned long) coef1 << SC1200_VIDEO_DOWNSCALER_COEF1_POS) | ((unsigned long) coef2 << SC1200_VIDEO_DOWNSCALER_COEF2_POS) | ((unsigned long) coef3 << SC1200_VIDEO_DOWNSCALER_COEF3_POS) | ((unsigned long) coef4 << SC1200_VIDEO_DOWNSCALER_COEF4_POS)); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_downscale_enable * * This routine enables or disables downscaling for the video overlay window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_downscale_enable(int enable) #else int gfx_set_video_downscale_enable(int enable) #endif { unsigned long downscale; downscale = READ_VID32(SC1200_VIDEO_DOWNSCALER_CONTROL); downscale &= ~SC1200_VIDEO_DOWNSCALE_ENABLE; if (enable) downscale |= SC1200_VIDEO_DOWNSCALE_ENABLE; WRITE_VID32(SC1200_VIDEO_DOWNSCALER_CONTROL, downscale); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_window * * This routine sets the position and size of the video overlay window. The * y position is specified in screen relative coordinates, and may be negative. * The size of destination region is specified in pixels. The line size * indicates the number of bytes of source data per scanline. * For the effect of negative x values, call the function * gfx_set_video_left_crop(). *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_window(short x, short y, unsigned short w, unsigned short h) #else int gfx_set_video_window(short x, short y, unsigned short w, unsigned short h) #endif { unsigned long control; unsigned long hadjust, vadjust; unsigned long xstart, ystart, xend, yend; /* For left cropping call the function gfx_set_video_left_crop() */ if (x < 0) return GFX_STATUS_BAD_PARAMETER; /* SAVE PARAMETERS */ /* These are needed to call this routine if the scale value changes. */ /* In the case of SC1200 they are also needed for restoring when video * is re-enabled */ gfx_vid_xpos = x; gfx_vid_ypos = y; gfx_vid_width = w; gfx_vid_height = h; /* GET ADJUSTMENT VALUES */ /* Use routines to abstract version of display controller. */ hadjust = gfx_get_htotal() - gfx_get_hsync_end() - 14l; vadjust = gfx_get_vtotal() - gfx_get_vsync_end() + 1l; /* HORIZONTAL START */ xstart = (unsigned long) x + hadjust; /* HORIZONTAL END */ /* End positions in register are non-inclusive (one more than the actual * end) */ if ((x + w) < gfx_get_hactive()) xend = (unsigned long) x + (unsigned long) w + hadjust; else /* right clipping needed */ xend = (unsigned long) gfx_get_hactive() + hadjust; /* VERTICAL START */ ystart = (unsigned long) y + vadjust; /* VERTICAL END */ if ((y + h) < gfx_get_vactive()) yend = (unsigned long) y + (unsigned long) h + vadjust; else /* bottom clipping needed */ yend = (unsigned long) gfx_get_vactive() + vadjust; /* SET VIDEO LINE INVERT BIT */ control = READ_VID32(SC1200_VID_ALPHA_CONTROL); if (y & 0x1) WRITE_VID32(SC1200_VID_ALPHA_CONTROL, control | SC1200_VIDEO_LINE_OFFSET_ODD); else WRITE_VID32(SC1200_VID_ALPHA_CONTROL, control & ~SC1200_VIDEO_LINE_OFFSET_ODD); /* SET VIDEO POSITION */ WRITE_VID32(SC1200_VIDEO_X_POS, (xend << 16) | xstart); WRITE_VID32(SC1200_VIDEO_Y_POS, (yend << 16) | ystart); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_left_crop * * This routine sets the number of pixels which will be cropped from the * beginning of each video line. The video window will begin to display only * from the pixel following the cropped pixels, and the cropped pixels * will be ignored. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_left_crop(unsigned short x) #else int gfx_set_video_left_crop(unsigned short x) #endif { unsigned long vcfg, initread; /* CLIPPING ON LEFT */ /* Adjust initial read for scale, checking for divide by zero */ if (gfx_vid_dstw) initread = (unsigned long) x *gfx_vid_srcw / gfx_vid_dstw; else initread = 0l; /* SET INITIAL READ ADDRESS */ vcfg = READ_VID32(SC1200_VIDEO_CONFIG); vcfg &= ~SC1200_VCFG_INIT_READ_MASK; vcfg |= (initread << 15) & SC1200_VCFG_INIT_READ_MASK; WRITE_VID32(SC1200_VIDEO_CONFIG, vcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_color_key * * This routine specifies the color key value and mask for the video overlay * hardware. To disable color key, the color and mask should both be set to * zero. The hardware uses the color key in the following equation: * * ((source data) & (color key mask)) == ((color key) & (color key mask)) * * If "graphics" is set to TRUE, the source data is graphics, and color key * is an RGB value. If "graphics" is set to FALSE, the source data is the * video, and color key is a YUV value. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_color_key(unsigned long key, unsigned long mask, int graphics) #else int gfx_set_video_color_key(unsigned long key, unsigned long mask, int graphics) #endif { unsigned long dcfg = 0; /* SET SC1200 COLOR KEY VALUE */ WRITE_VID32(SC1200_VIDEO_COLOR_KEY, key); WRITE_VID32(SC1200_VIDEO_COLOR_MASK, mask); /* SELECT GRAPHICS OR VIDEO DATA TO COMPARE TO THE COLOR KEY */ dcfg = READ_VID32(SC1200_DISPLAY_CONFIG); if (graphics & 0x01) dcfg &= ~SC1200_DCFG_VG_CK; else dcfg |= SC1200_DCFG_VG_CK; WRITE_VID32(SC1200_DISPLAY_CONFIG, dcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_filter * * This routine enables or disables the video overlay filters. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_filter(int xfilter, int yfilter) #else int gfx_set_video_filter(int xfilter, int yfilter) #endif { unsigned long vcfg = 0; /* ENABLE OR DISABLE SC1200 VIDEO OVERLAY FILTERS */ vcfg = READ_VID32(SC1200_VIDEO_CONFIG); vcfg &= ~(SC1200_VCFG_X_FILTER_EN | SC1200_VCFG_Y_FILTER_EN); if (xfilter) vcfg |= SC1200_VCFG_X_FILTER_EN; if (yfilter) vcfg |= SC1200_VCFG_Y_FILTER_EN; WRITE_VID32(SC1200_VIDEO_CONFIG, vcfg); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_palette * * This routine loads the video hardware palette. If a NULL pointer is * specified, the palette is bypassed (for SC1200, this means loading the * palette with identity values). *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_palette(unsigned long *palette) #else int gfx_set_video_palette(unsigned long *palette) #endif { unsigned long i, entry; unsigned long dcfg, misc; /* WAIT FOR VERTICAL BLANK TO END */ /* Otherwise palette will not be written properly. */ if (gfx_test_timing_active()) { if (gfx_test_vertical_active()) { while (gfx_test_vertical_active()); } while (!gfx_test_vertical_active()); } /* LOAD SC1200 VIDEO PALETTE */ WRITE_VID32(SC1200_PALETTE_ADDRESS, 0); for (i = 0; i < 256; i++) { if (palette) entry = palette[i]; else entry = gfx_gamma_ram_1200[i] << 8; WRITE_VID32(SC1200_PALETTE_DATA, entry); } /* ENABLE THE VIDEO PALETTE */ /* Ensure that the video palette has an effect by routing video data */ /* through the palette RAM and clearing the 'Bypass Both' bit. */ dcfg = READ_VID32(SC1200_DISPLAY_CONFIG); misc = READ_VID32(SC1200_VID_MISC); dcfg |= SC1200_DCFG_GV_PAL_BYP; misc &= ~SC1200_GAMMA_BYPASS_BOTH; WRITE_VID32(SC1200_DISPLAY_CONFIG, dcfg); WRITE_VID32(SC1200_VID_MISC, misc); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_palette_entry * * This routine loads a single entry of the video hardware palette. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_palette_entry(unsigned long index, unsigned long palette) #else int gfx_set_video_palette_entry(unsigned long index, unsigned long palette) #endif { unsigned long dcfg, misc; if (index > 0xFF) return GFX_STATUS_BAD_PARAMETER; /* WAIT FOR VERTICAL BLANK TO END */ /* Otherwise palette will not be written properly. */ if (gfx_test_timing_active()) { if (gfx_test_vertical_active()) { while (gfx_test_vertical_active()); } while (!gfx_test_vertical_active()); } /* SET A SINGLE ENTRY */ WRITE_VID32(SC1200_PALETTE_ADDRESS, index); WRITE_VID32(SC1200_PALETTE_DATA, palette); /* ENABLE THE VIDEO PALETTE */ /* Ensure that the video palette has an effect by routing video data */ /* through the palette RAM and clearing the 'Bypass Both' bit. */ dcfg = READ_VID32(SC1200_DISPLAY_CONFIG); misc = READ_VID32(SC1200_VID_MISC); dcfg |= SC1200_DCFG_GV_PAL_BYP; misc &= ~SC1200_GAMMA_BYPASS_BOTH; WRITE_VID32(SC1200_DISPLAY_CONFIG, dcfg); WRITE_VID32(SC1200_VID_MISC, misc); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_palette_bypass * * This routine enables/disables the pallete RAM bypass. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_palette_bypass(int enable) #else int gfx_set_video_palette_bypass(int enable) #endif { unsigned long misc; misc = READ_VID32(SC1200_VID_MISC); if (enable) misc |= SC1200_GAMMA_BYPASS_BOTH; else misc &= ~SC1200_GAMMA_BYPASS_BOTH; WRITE_VID32(SC1200_VID_MISC, misc); return 0; } /*--------------------------------------------------------------------------- * gfx_set_video_request() * * This routine sets the horizontal (pixel) and vertical (line) video request * values. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_request(short x, short y) #else int gfx_set_video_request(short x, short y) #endif { /* SET SC1200 VIDEO REQUEST */ x += gfx_get_htotal() - gfx_get_hsync_end() - 2; y += gfx_get_vtotal() - gfx_get_vsync_end() + 1; if ((x < 0) || (x > SC1200_VIDEO_REQUEST_MASK) || (y < 0) || (y > SC1200_VIDEO_REQUEST_MASK)) return GFX_STATUS_BAD_PARAMETER; WRITE_VID32(SC1200_VIDEO_REQUEST, ((unsigned long) x << SC1200_VIDEO_X_REQUEST_POS) | ((unsigned long) y << SC1200_VIDEO_Y_REQUEST_POS)); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_source() * * This routine sets the video source to either memory or Direct VIP. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_source(VideoSourceType source) #else int gfx_set_video_source(VideoSourceType source) #endif { unsigned long display_mode; display_mode = READ_VID32(SC1200_VIDEO_DISPLAY_MODE); /* SET SC1200 VIDEO SOURCE */ switch (source) { case VIDEO_SOURCE_MEMORY: WRITE_VID32(SC1200_VIDEO_DISPLAY_MODE, (display_mode & ~SC1200_VIDEO_SOURCE_MASK) | SC1200_VIDEO_SOURCE_GX1); break; case VIDEO_SOURCE_DVIP: WRITE_VID32(SC1200_VIDEO_DISPLAY_MODE, (display_mode & ~SC1200_VIDEO_SOURCE_MASK) | SC1200_VIDEO_SOURCE_DVIP); break; default: return GFX_STATUS_BAD_PARAMETER; } return (0); } /*--------------------------------------------------------------------------- * gfx_set_vbi_source() * * This routine sets the vbi source to either memory or Direct VIP. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_vbi_source(VbiSourceType source) #else int gfx_set_vbi_source(VbiSourceType source) #endif { unsigned long display_mode; display_mode = READ_VID32(SC1200_VIDEO_DISPLAY_MODE); /* SET SC1200 VBI SOURCE */ switch (source) { case VBI_SOURCE_MEMORY: WRITE_VID32(SC1200_VIDEO_DISPLAY_MODE, (display_mode & ~SC1200_VBI_SOURCE_MASK) | SC1200_VBI_SOURCE_GX1); break; case VBI_SOURCE_DVIP: WRITE_VID32(SC1200_VIDEO_DISPLAY_MODE, (display_mode & ~SC1200_VBI_SOURCE_MASK) | SC1200_VBI_SOURCE_DVIP); break; default: return GFX_STATUS_BAD_PARAMETER; } return (0); } /*--------------------------------------------------------------------------- * gfx_set_vbi_lines() * * This routine sets the VBI lines to pass to the TV encoder. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_vbi_lines(unsigned long even, unsigned long odd) #else int gfx_set_vbi_lines(unsigned long even, unsigned long odd) #endif { /* SET SC1200 VBI LINES */ WRITE_VID32(SC1200_VIDEO_EVEN_VBI_LINE_ENABLE, even & SC1200_VIDEO_VBI_LINE_ENABLE_MASK); WRITE_VID32(SC1200_VIDEO_ODD_VBI_LINE_ENABLE, odd & SC1200_VIDEO_VBI_LINE_ENABLE_MASK); return (0); } /*--------------------------------------------------------------------------- * gfx_set_vbi_total() * * This routine sets the total number of VBI bytes for each field. * The total is needed when both VBI and active video are received from memory *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_vbi_total(unsigned long even, unsigned long odd) #else int gfx_set_vbi_total(unsigned long even, unsigned long odd) #endif { /* SET SC1200 VBI TOTAL */ WRITE_VID32(SC1200_VIDEO_EVEN_VBI_TOTAL_COUNT, even & SC1200_VIDEO_VBI_TOTAL_COUNT_MASK); WRITE_VID32(SC1200_VIDEO_ODD_VBI_TOTAL_COUNT, odd & SC1200_VIDEO_VBI_TOTAL_COUNT_MASK); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_interlaced() * * This routine configures the video processor video overlay mode to be * interlaced YUV. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_interlaced(int enable) #else int gfx_set_video_interlaced(int enable) #endif { unsigned long control; control = READ_VID32(SC1200_VID_ALPHA_CONTROL); /* SET INTERLACED VIDEO */ if (enable) WRITE_VID32(SC1200_VID_ALPHA_CONTROL, control | SC1200_VIDEO_IS_INTERLACED); else WRITE_VID32(SC1200_VID_ALPHA_CONTROL, control & ~SC1200_VIDEO_IS_INTERLACED); return (0); } /*--------------------------------------------------------------------------- * gfx_set_color_space_YUV() * * This routine configures the video processor to process graphics and video * in either YUV or RGB color space. The mode should be set to tune image * quality. * Setting "enable" to TRUE improves image quality on TV, * but in this mode colors on CRT will not be correct. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_color_space_YUV(int enable) #else int gfx_set_color_space_YUV(int enable) #endif { unsigned long control; control = READ_VID32(SC1200_VID_ALPHA_CONTROL); /* SET SC1200 VIDEO COLOR SPACE TO YUV OR RGB */ if (enable) { /* ENABLE YUV BLENDING */ /* YUV blending cannot be enabled in RGB video formats */ control |= SC1200_CSC_GFX_RGB_TO_YUV; /* Convert graphics to YUV */ control &= ~SC1200_CSC_VIDEO_YUV_TO_RGB; /* Leave video in YUV */ if (control & SC1200_VIDEO_INPUT_IS_RGB) return (GFX_STATUS_UNSUPPORTED); /* Can't convert video from * RGB to YUV */ } else { /* RGB BLENDING */ control &= ~SC1200_CSC_GFX_RGB_TO_YUV; /* Leave graphics in RGB */ if (control & SC1200_VIDEO_INPUT_IS_RGB) control &= ~SC1200_CSC_VIDEO_YUV_TO_RGB; /* Leave video in RGB */ else control |= SC1200_CSC_VIDEO_YUV_TO_RGB; /* Convert video to RGB */ } WRITE_VID32(SC1200_VID_ALPHA_CONTROL, control); return (0); } /*--------------------------------------------------------------------------- * gfx_set_vertical_scaler_offset() * * This routine sets the value by which the odd frame is shifted with respect * to the even frame. This is useful for de-interlacing in Bob method, by * setting the shift value to be one line. * If offset is 0, no shifting occurs. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_vertical_scaler_offset(char offset) #else int gfx_set_vertical_scaler_offset(char offset) #endif { unsigned long control; control = READ_VID32(SC1200_VID_ALPHA_CONTROL); if (offset == 1) { control &= ~SC1200_VERTICAL_SCALER_SHIFT_MASK; /* Clear shifting value */ control |= SC1200_VERTICAL_SCALER_SHIFT_INIT; /* Set shifting value */ control |= SC1200_VERTICAL_SCALER_SHIFT_EN; /* Enable odd frame shifting */ } else if (offset == 0) { control &= ~SC1200_VERTICAL_SCALER_SHIFT_EN; /* No shifting occurs */ control &= ~SC1200_VERTICAL_SCALER_SHIFT_MASK; /* Clear shifting value */ } else return (GFX_STATUS_BAD_PARAMETER); /* TODO: how to program other values ? */ WRITE_VID32(SC1200_VID_ALPHA_CONTROL, control); return (0); } /*--------------------------------------------------------------------------- * gfx_set_top_line_in_odd() * * This routine sets the field in which the top line of input video resides. * If enable is "0", this is the even field (default). [not to be confused * with the odd field being the top field on TV]. * If enable is "1", this is the odd field. * Use enable "1" for input devices whose field indication is reversed from * normal, i.e. an indication of "odd" field is given for even field data, * and vice versa. * This setting affects the video processor only when it is in either * interlaced or Bob (scaler offset active) modes. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_top_line_in_odd(int enable) #else int gfx_set_top_line_in_odd(int enable) #endif { unsigned long control; control = READ_VID32(SC1200_VID_ALPHA_CONTROL); if (enable) control |= SC1200_TOP_LINE_IN_ODD; /* Set shifting value */ else control &= ~SC1200_TOP_LINE_IN_ODD; /* No shifting occurs */ WRITE_VID32(SC1200_VID_ALPHA_CONTROL, control); return (0); } /*--------------------------------------------------------------------------- * gfx_set_genlock_delay() * * This routine sets the delay between VIP VSYNC and display controller VSYNC. * The delay is in 27 MHz clocks. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_genlock_delay(unsigned long delay) #else int gfx_set_genlock_delay(unsigned long delay) #endif { /* SET SC1200 GENLOCK DELAY */ WRITE_VID32(SC1200_GENLOCK_DELAY, delay & SC1200_GENLOCK_DELAY_MASK); return (0); } /*--------------------------------------------------------------------------- * gfx_set_genlock_enable() * * This routine sets and configures the genlock according to the flags * parameter. * Flags value of 0 disables genlock and resets its configuration. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_genlock_enable(int flags) #else int gfx_set_genlock_enable(int flags) #endif { unsigned long genlock = 0; if (flags) { /* SET SC1200 GENLOCK CONFIGURATION */ if (flags & GENLOCK_SINGLE) genlock |= SC1200_GENLOCK_SINGLE_ENABLE; if (flags & GENLOCK_FIELD_SYNC) genlock |= SC1200_GENLOCK_FIELD_SYNC_ENABLE; if (flags & GENLOCK_CONTINUOUS) genlock |= SC1200_GENLOCK_CONTINUOUS_ENABLE; if (flags & GENLOCK_SYNCED_EDGE_FALLING) genlock |= SC1200_GENLOCK_GX_VSYNC_FALLING_EDGE; if (flags & GENLOCK_SYNCING_EDGE_FALLING) genlock |= SC1200_GENLOCK_VIP_VSYNC_FALLING_EDGE; if (flags & GENLOCK_TIMEOUT) genlock |= SC1200_GENLOCK_TIMEOUT_ENABLE; if (flags & GENLOCK_TVENC_RESET_EVEN_FIELD) genlock |= SC1200_GENLOCK_TVENC_RESET_EVEN_FIELD; if (flags & GENLOCK_TVENC_RESET_BEFORE_DELAY) genlock |= SC1200_GENLOCK_TVENC_RESET_BEFORE_DELAY; if (flags & GENLOCK_TVENC_RESET) genlock |= SC1200_GENLOCK_TVENC_RESET_ENABLE; if (flags & GENLOCK_SYNC_TO_TVENC) genlock |= SC1200_GENLOCK_SYNC_TO_TVENC; } WRITE_VID32(SC1200_GENLOCK, genlock); return (0); } /*--------------------------------------------------------------------------- * gfx_set_video_cursor() * * This routine configures the video hardware cursor. * If the "mask"ed bits in the graphics pixel match "key", then either * "color1" or "color2" will be used for this pixel, according to the value of * bit number "select_color2" of the graphics pixel. * * key - 24 bit RGB value * mask - 24 bit mask * color1, color2 - RGB or YUV, depending on the current color space * conversion select_color2 - value between 0 to 23 * * To disable match, a "mask" and "key" value of 0xffffff should be set, * because the graphics pixels incoming to the video processor have maximum 16 * bits set (0xF8FCF8). * * This feature is useful for disabling alpha blending of the cursor. * Otherwise cursor image would be blurred (or completely invisible if video * alpha is maximum value). * Note: the cursor pixel replacements take place both inside and outside the * video overlay window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_video_cursor(unsigned long key, unsigned long mask, unsigned short select_color2, unsigned long color1, unsigned long color2) #else int gfx_set_video_cursor(unsigned long key, unsigned long mask, unsigned short select_color2, unsigned long color1, unsigned long color2) #endif { if (select_color2 > SC1200_CURSOR_COLOR_BITS) return GFX_STATUS_BAD_PARAMETER; key = (key & SC1200_COLOR_MASK) | ((unsigned long) select_color2 << SC1200_CURSOR_COLOR_KEY_OFFSET_POS); WRITE_VID32(SC1200_CURSOR_COLOR_KEY, key); WRITE_VID32(SC1200_CURSOR_COLOR_MASK, mask); WRITE_VID32(SC1200_CURSOR_COLOR_1, color1); WRITE_VID32(SC1200_CURSOR_COLOR_2, color2); return (0); } /*--------------------------------------------------------------------------- * gfx_set_alpha_enable * * This routine enables or disables the currently selected alpha region. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_alpha_enable(int enable) #else int gfx_set_alpha_enable(int enable) #endif { unsigned long address = 0, value = 0; if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); address = SC1200_ALPHA_CONTROL_1 + ((unsigned long) gfx_alpha_select << 4); value = READ_VID32(address); if (enable) value |= (SC1200_ACTRL_WIN_ENABLE | SC1200_ACTRL_LOAD_ALPHA); else value &= ~(SC1200_ACTRL_WIN_ENABLE); WRITE_VID32(address, value); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_alpha_window * * This routine sets the size of the currently selected alpha region. * Note: "x" and "y" are signed to enable using negative values needed for * implementing workarounds of hardware issues. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_alpha_window(short x, short y, unsigned short width, unsigned short height) #else int gfx_set_alpha_window(short x, short y, unsigned short width, unsigned short height) #endif { unsigned long address = 0; /* CHECK FOR CLIPPING */ if ((x + width) > gfx_get_hactive()) width = gfx_get_hactive() - x; if ((y + height) > gfx_get_vactive()) height = gfx_get_vactive() - y; /* ADJUST POSITIONS */ x += gfx_get_htotal() - gfx_get_hsync_end() - 2; y += gfx_get_vtotal() - gfx_get_vsync_end() + 1; if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); address = SC1200_ALPHA_XPOS_1 + ((unsigned long) gfx_alpha_select << 4); /* End positions in register are non-inclusive (one more than the actual * end) */ WRITE_VID32(address, (unsigned long) x | ((unsigned long) (x + width) << 16)); WRITE_VID32(address + 4l, (unsigned long) y | ((unsigned long) (y + height) << 16)); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_alpha_value * * This routine sets the alpha value for the currently selected alpha * region. It also specifies an increment/decrement value for fading. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_alpha_value(unsigned char alpha, char delta) #else int gfx_set_alpha_value(unsigned char alpha, char delta) #endif { unsigned long address = 0, value = 0; unsigned char new_value = 0; int loop = 1; if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); address = SC1200_ALPHA_CONTROL_1 + ((unsigned long) gfx_alpha_select << 4); value = READ_VID32(address); value &= SC1200_ACTRL_WIN_ENABLE; /* keep only enable bit */ value |= (unsigned long) alpha; value |= (((unsigned long) delta) & 0xff) << 8; value |= SC1200_ACTRL_LOAD_ALPHA; WRITE_VID32(address, value); /* WORKAROUND FOR ISSUE #1187 */ /* Need to verify that the alpha operation succeeded */ while (1) { /* WAIT FOR VERTICAL BLANK TO END */ if (gfx_test_timing_active()) { if (gfx_test_vertical_active()) while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); } new_value = (unsigned char) ((READ_VID32(SC1200_ALPHA_WATCH) >> (gfx_alpha_select << 3)) & 0xff); if (new_value == alpha) return GFX_STATUS_OK; if (++loop > 10) return GFX_STATUS_ERROR; WRITE_VID32(address, value); } } /*--------------------------------------------------------------------------- * gfx_set_alpha_priority * * This routine sets the priority of the currently selected alpha region. * A higher value indicates a higher priority. * Note: Priority of enabled alpha windows must be different. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_alpha_priority(int priority) #else int gfx_set_alpha_priority(int priority) #endif { unsigned long pos = 0, value = 0; if (priority > 3) return (GFX_STATUS_BAD_PARAMETER); if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); value = READ_VID32(SC1200_VID_ALPHA_CONTROL); pos = 16 + (gfx_alpha_select << 1); value &= ~(0x03l << pos); value |= (unsigned long) priority << pos; WRITE_VID32(SC1200_VID_ALPHA_CONTROL, value); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_alpha_color * * This routine sets the color to be displayed inside the currently selected * alpha window when there is a color key match (when the alpha color * mechanism is enabled). * "color" is a 24 bit RGB value (for RGB blending) or YUV value (for YUV * blending). * In Interlaced YUV blending mode, Y/2 value should be used. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_alpha_color(unsigned long color) #else int gfx_set_alpha_color(unsigned long color) #endif { unsigned long address = 0; if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); address = SC1200_ALPHA_COLOR_1 + ((unsigned long) gfx_alpha_select << 4); /* ONLY 24 VALID BITS */ color &= 0xffffffl; /* KEEP UPPER BYTE UNCHANGED */ WRITE_VID32(address, (color | (READ_VID32(address) & ~0xffffffl))); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_alpha_color_enable * * Enable or disable the color mechanism in the alpha window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_alpha_color_enable(int enable) #else int gfx_set_alpha_color_enable(int enable) #endif { unsigned long color; unsigned long address = 0; if (gfx_alpha_select > 2) return (GFX_STATUS_UNSUPPORTED); address = SC1200_ALPHA_COLOR_1 + ((unsigned long) gfx_alpha_select << 4); color = READ_VID32(address); if (enable) color |= SC1200_ALPHA_COLOR_ENABLE; else color &= ~SC1200_ALPHA_COLOR_ENABLE; WRITE_VID32(address, color); return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_set_no_ck_outside_alpha * * This function affects where inside the video window color key or chroma * key comparison is done: * If enable is TRUE, color/chroma key comparison is performed only inside * the enabled alpha windows. Outside the (enabled) alpha windows, only video * is displayed if color key is used, and only graphics is displayed if chroma * key is used. * If enable is FALSE, color/chroma key comparison is performed in all the * video window area. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_no_ck_outside_alpha(int enable) #else int gfx_set_no_ck_outside_alpha(int enable) #endif { unsigned long value; value = READ_VID32(SC1200_VID_ALPHA_CONTROL); if (enable) WRITE_VID32(SC1200_VID_ALPHA_CONTROL, value | SC1200_NO_CK_OUTSIDE_ALPHA); else WRITE_VID32(SC1200_VID_ALPHA_CONTROL, value & ~SC1200_NO_CK_OUTSIDE_ALPHA); return (0); } /*--------------------------------------------------------------------------- * gfx_set_macrovision_enable * * This routine enables or disables macrovision on the tv encoder output. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_set_macrovision_enable(int enable) #else int gfx_set_macrovision_enable(int enable) #endif { if (enable) WRITE_VID32(SC1200_TVENC_MV_CONTROL, SC1200_TVENC_MV_ENABLE); else WRITE_VID32(SC1200_TVENC_MV_CONTROL, 0); return (GFX_STATUS_OK); } #define SC1200_VIDEO_PCI_44 0x80009444 /*--------------------------------------------------------------------------- * gfx_disable_softvga * * Disables SoftVga. This function is only valid with VSA2, Returns 1 if * SoftVga can be disabled; 0 if not. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_disable_softvga(void) #else int gfx_disable_softvga(void) #endif { unsigned long reg_val; /* get the current value */ reg_val = gfx_pci_config_read(SC1200_VIDEO_PCI_44); /* setting video PCI register 44 bit 0 to 1 disables SoftVga */ reg_val |= 0x1; gfx_pci_config_write(SC1200_VIDEO_PCI_44, reg_val); /* see if we set the bit and return the appropriate value */ reg_val = gfx_pci_config_read(SC1200_VIDEO_PCI_44); if ((reg_val & 0x1) == 0x1) return (1); else return (0); } /*--------------------------------------------------------------------------- * gfx_enable_softvga * * Enables SoftVga. This function is only valid with VSA2, Returns 1 if * SoftVga can be enbled; 0 if not. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_enable_softvga(void) #else int gfx_enable_softvga(void) #endif { unsigned long reg_val; /* get the current value */ reg_val = gfx_pci_config_read(SC1200_VIDEO_PCI_44); /* clearing video PCI register 44 bit 0 enables SoftVga */ gfx_pci_config_write(SC1200_VIDEO_PCI_44, reg_val & 0xfffffffel); /* see if we cleared the bit and return the appropriate value */ reg_val = gfx_pci_config_read(SC1200_VIDEO_PCI_44); if ((reg_val & 0x1) == 0) return (1); else return (0); } /*--------------------------------------------------------------------------- * gfx_get_clock_frequency * * This routine returns the current clock frequency in 16.16 format. * It reads the current register value and finds the match in the table. * If no match is found, this routine returns 0. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_clock_frequency(void) #else unsigned long gfx_get_clock_frequency(void) #endif { unsigned int index; unsigned long value, mask; mask = 0x007FFF0F; value = READ_VID32(SC1200_VID_CLOCK_SELECT) & mask; for (index = 0; index < NUM_SC1200_FREQUENCIES; index++) { if ((gfx_sc1200_clock_table[index].clock_select & mask) == value) return (gfx_sc1200_clock_table[index].frequency); } return (0); } /*--------------------------------------------------------------------------- * gfx_get_max_video_width * * This routine returns the maximum theoretical video width for the current * display mode. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_max_video_width(void) #else unsigned long gfx_get_max_video_width(void) #endif { /* RETURN MPEG2 MAXIMUM */ return 720; } /*************************************************************/ /* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ /*************************************************************/ #if GFX_READ_ROUTINES /*--------------------------------------------------------------------------- * gfx_get_vsa2_softvga_enable * * This function returns the enable status of SoftVGA. It is valid * only if VSAII is present. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_vsa2_softvga_enable(void) #else int gfx_get_vsa2_softvga_enable(void) #endif { unsigned long reg_val; reg_val = gfx_pci_config_read(SC1200_VIDEO_PCI_44); if ((reg_val & 0x1) == 0) return (1); else return (0); } /*--------------------------------------------------------------------------- * gfx_get_sync_polarities * * This routine returns the polarities of the sync pulses: * Bit 0: Set if negative horizontal polarity. * Bit 1: Set if negative vertical polarity. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_sync_polarities(void) #else int gfx_get_sync_polarities(void) #endif { int polarities = 0; if (READ_VID32(SC1200_DISPLAY_CONFIG) & SC1200_DCFG_CRT_HSYNC_POL) polarities |= 1; if (READ_VID32(SC1200_DISPLAY_CONFIG) & SC1200_DCFG_CRT_VSYNC_POL) polarities |= 2; return (polarities); } /*--------------------------------------------------------------------------- * gfx_get_video_palette_entry * * This routine returns a single palette entry. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_video_palette_entry(unsigned long index, unsigned long *palette) #else int gfx_get_video_palette_entry(unsigned long index, unsigned long *palette) #endif { if (index > 0xFF) return GFX_STATUS_BAD_PARAMETER; /* READ A SINGLE ENTRY */ WRITE_VID32(SC1200_PALETTE_ADDRESS, index); *palette = READ_VID32(SC1200_PALETTE_DATA); return (GFX_STATUS_OK); } /*----------------------------------------------------------------------------- * gfx_get_video_enable * * This routine returns the value "one" if video overlay is currently enabled, * otherwise it returns the value "zero". *----------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_video_enable(void) #else int gfx_get_video_enable(void) #endif { if (READ_VID32(SC1200_VIDEO_CONFIG) & SC1200_VCFG_VID_EN) return (1); return (0); } /*----------------------------------------------------------------------------- * gfx_get_video_format * * This routine returns the current video overlay format. *----------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_video_format(void) #else int gfx_get_video_format(void) #endif { unsigned long ctrl, vcfg; ctrl = READ_VID32(SC1200_VID_ALPHA_CONTROL); vcfg = READ_VID32(SC1200_VIDEO_CONFIG); if (ctrl & SC1200_VIDEO_INPUT_IS_RGB) { switch (vcfg & SC1200_VCFG_VID_INP_FORMAT) { case SC1200_VCFG_UYVY_FORMAT: return VIDEO_FORMAT_RGB; case SC1200_VCFG_Y2YU_FORMAT: return VIDEO_FORMAT_P2M_P2L_P1M_P1L; case SC1200_VCFG_YUYV_FORMAT: return VIDEO_FORMAT_P1M_P1L_P2M_P2L; case SC1200_VCFG_YVYU_FORMAT: return VIDEO_FORMAT_P1M_P2L_P2M_P1L; } } if (vcfg & SC1200_VCFG_4_2_0_MODE) { switch (vcfg & SC1200_VCFG_VID_INP_FORMAT) { case SC1200_VCFG_UYVY_FORMAT: return VIDEO_FORMAT_Y0Y1Y2Y3; case SC1200_VCFG_Y2YU_FORMAT: return VIDEO_FORMAT_Y3Y2Y1Y0; case SC1200_VCFG_YUYV_FORMAT: return VIDEO_FORMAT_Y1Y0Y3Y2; case SC1200_VCFG_YVYU_FORMAT: return VIDEO_FORMAT_Y1Y2Y3Y0; } } else { switch (vcfg & SC1200_VCFG_VID_INP_FORMAT) { case SC1200_VCFG_UYVY_FORMAT: return VIDEO_FORMAT_UYVY; case SC1200_VCFG_Y2YU_FORMAT: return VIDEO_FORMAT_Y2YU; case SC1200_VCFG_YUYV_FORMAT: return VIDEO_FORMAT_YUYV; case SC1200_VCFG_YVYU_FORMAT: return VIDEO_FORMAT_YVYU; } } return (GFX_STATUS_ERROR); } /*---------------------------------------------------------------------------- * gfx_get_video_src_size * * This routine returns the size of the source video overlay buffer. The * return value is (height << 16) | width. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_video_src_size(void) #else unsigned long gfx_get_video_src_size(void) #endif { unsigned long width = 0, height = 0; /* DETERMINE SOURCE WIDTH FROM THE SC1200 VIDEO LINE SIZE */ width = (READ_VID32(SC1200_VIDEO_CONFIG) >> 7) & 0x000001FE; if (READ_VID32(SC1200_VIDEO_CONFIG) & SC1200_VCFG_LINE_SIZE_UPPER) width += 512l; if (width) { /* DETERMINE HEIGHT BY DIVIDING TOTAL SIZE BY WIDTH */ /* Get total size from display controller - abtracted. */ height = gfx_get_display_video_size() / (width << 1); } return ((height << 16) | width); } /*---------------------------------------------------------------------------- * gfx_get_video_line_size * * This routine returns the line size of the source video overlay buffer, in * pixels. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_video_line_size(void) #else unsigned long gfx_get_video_line_size(void) #endif { unsigned long width = 0; /* DETERMINE SOURCE WIDTH FROM THE SC1200 VIDEO LINE SIZE */ width = (READ_VID32(SC1200_VIDEO_CONFIG) >> 7) & 0x000001FE; if (READ_VID32(SC1200_VIDEO_CONFIG) & SC1200_VCFG_LINE_SIZE_UPPER) width += 512l; return (width); } /*---------------------------------------------------------------------------- * gfx_get_video_xclip * * This routine returns the number of bytes clipped on the left side of a * video overlay line (skipped at beginning). *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_video_xclip(void) #else unsigned long gfx_get_video_xclip(void) #endif { unsigned long clip = 0; /* DETERMINE SOURCE WIDTH FROM THE SC1200 VIDEO LINE SIZE */ clip = (READ_VID32(SC1200_VIDEO_CONFIG) >> 14) & 0x000007FC; return (clip); } /*---------------------------------------------------------------------------- * gfx_get_video_offset * * This routine returns the current offset for the video overlay buffer. *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_video_offset(void) #else unsigned long gfx_get_video_offset(void) #endif { return (gfx_get_display_video_offset()); } /*--------------------------------------------------------------------------- * gfx_get_video_upscale * * This routine returns the scale factor for the video overlay window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_video_upscale(void) #else unsigned long gfx_get_video_upscale(void) #endif { return (READ_VID32(SC1200_VIDEO_UPSCALE)); } /*--------------------------------------------------------------------------- * gfx_get_video_scale * * This routine returns the scale factor for the video overlay window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_video_scale(void) #else unsigned long gfx_get_video_scale(void) #endif { return gfx_get_video_upscale(); } /*--------------------------------------------------------------------------- * gfx_get_video_downscale_config * * This routine returns the current type and value of video downscaling. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_video_downscale_config(unsigned short *type, unsigned short *m) #else int gfx_get_video_downscale_config(unsigned short *type, unsigned short *m) #endif { unsigned long downscale; downscale = READ_VID32(SC1200_VIDEO_DOWNSCALER_CONTROL); *m = (unsigned short) ((downscale & SC1200_VIDEO_DOWNSCALE_FACTOR_MASK) >> SC1200_VIDEO_DOWNSCALE_FACTOR_POS) + 1; switch (downscale & SC1200_VIDEO_DOWNSCALE_TYPE_MASK) { case SC1200_VIDEO_DOWNSCALE_TYPE_A: *type = VIDEO_DOWNSCALE_KEEP_1_OF; break; case SC1200_VIDEO_DOWNSCALE_TYPE_B: *type = VIDEO_DOWNSCALE_DROP_1_OF; break; default: return GFX_STATUS_ERROR; break; } return (0); } /*--------------------------------------------------------------------------- * gfx_get_video_downscale_coefficients * * This routine returns the current video downscaling coefficients. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void sc1200_get_video_downscale_coefficients(unsigned short *coef1, unsigned short *coef2, unsigned short *coef3, unsigned short *coef4) #else void gfx_get_video_downscale_coefficients(unsigned short *coef1, unsigned short *coef2, unsigned short *coef3, unsigned short *coef4) #endif { unsigned long coef; coef = READ_VID32(SC1200_VIDEO_DOWNSCALER_COEFFICIENTS); *coef1 = (unsigned short) ((coef >> SC1200_VIDEO_DOWNSCALER_COEF1_POS) & SC1200_VIDEO_DOWNSCALER_COEF_MASK); *coef2 = (unsigned short) ((coef >> SC1200_VIDEO_DOWNSCALER_COEF2_POS) & SC1200_VIDEO_DOWNSCALER_COEF_MASK); *coef3 = (unsigned short) ((coef >> SC1200_VIDEO_DOWNSCALER_COEF3_POS) & SC1200_VIDEO_DOWNSCALER_COEF_MASK); *coef4 = (unsigned short) ((coef >> SC1200_VIDEO_DOWNSCALER_COEF4_POS) & SC1200_VIDEO_DOWNSCALER_COEF_MASK); return; } /*--------------------------------------------------------------------------- * gfx_get_video_downscale_enable * * This routine returns 1 if video downscaling is currently enabled, * or 0 if it is currently disabled. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void sc1200_get_video_downscale_enable(int *enable) #else void gfx_get_video_downscale_enable(int *enable) #endif { if (READ_VID32(SC1200_VIDEO_DOWNSCALER_CONTROL) & SC1200_VIDEO_DOWNSCALE_ENABLE) *enable = 1; else *enable = 0; return; } /*--------------------------------------------------------------------------- * gfx_get_video_dst_size * * This routine returns the size of the displayed video overlay window. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_video_dst_size(void) #else unsigned long gfx_get_video_dst_size(void) #endif { unsigned long xsize, ysize; xsize = READ_VID32(SC1200_VIDEO_X_POS); xsize = ((xsize >> 16) & 0x7FF) - (xsize & 0x7FF); ysize = READ_VID32(SC1200_VIDEO_Y_POS); ysize = ((ysize >> 16) & 0x7FF) - (ysize & 0x7FF); return ((ysize << 16) | xsize); } /*--------------------------------------------------------------------------- * gfx_get_video_position * * This routine returns the position of the video overlay window. The * return value is (ypos << 16) | xpos. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_video_position(void) #else unsigned long gfx_get_video_position(void) #endif { unsigned long hadjust, vadjust; unsigned long xpos, ypos; /* READ HARDWARE POSITION */ xpos = READ_VID32(SC1200_VIDEO_X_POS) & 0x000007FF; ypos = READ_VID32(SC1200_VIDEO_Y_POS) & 0x000007FF; /* GET ADJUSTMENT VALUES */ /* Use routines to abstract version of display controller. */ hadjust = (unsigned long) gfx_get_htotal() - (unsigned long) gfx_get_hsync_end() - 14l; vadjust = (unsigned long) gfx_get_vtotal() - (unsigned long) gfx_get_vsync_end() + 1l; xpos -= hadjust; ypos -= vadjust; return ((ypos << 16) | (xpos & 0x0000FFFF)); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key * * This routine returns the current video color key value. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_video_color_key(void) #else unsigned long gfx_get_video_color_key(void) #endif { return (READ_VID32(SC1200_VIDEO_COLOR_KEY)); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key_mask * * This routine returns the current video color mask value. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_video_color_key_mask(void) #else unsigned long gfx_get_video_color_key_mask(void) #endif { return (READ_VID32(SC1200_VIDEO_COLOR_MASK)); } /*--------------------------------------------------------------------------- * gfx_get_video_color_key_src * * This routine returns 0 for video data compare, 1 for graphics data. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_video_color_key_src(void) #else int gfx_get_video_color_key_src(void) #endif { if (READ_VID32(SC1200_DISPLAY_CONFIG) & SC1200_DCFG_VG_CK) return (0); return (1); } /*--------------------------------------------------------------------------- * gfx_get_video_filter * * This routine returns if the filters are currently enabled. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_video_filter(void) #else int gfx_get_video_filter(void) #endif { int retval = 0; if (READ_VID32(SC1200_VIDEO_CONFIG) & SC1200_VCFG_X_FILTER_EN) retval |= 1; if (READ_VID32(SC1200_VIDEO_CONFIG) & SC1200_VCFG_Y_FILTER_EN) retval |= 2; return (retval); } /*--------------------------------------------------------------------------- * gfx_get_video_request * * This routine returns the horizontal (pixel) and vertical (lines) video * request values. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_video_request(short *x, short *y) #else int gfx_get_video_request(short *x, short *y) #endif { int request = 0; request = (int) (READ_VID32(SC1200_VIDEO_REQUEST)); *x = (request >> SC1200_VIDEO_X_REQUEST_POS) & SC1200_VIDEO_REQUEST_MASK; *y = (request >> SC1200_VIDEO_Y_REQUEST_POS) & SC1200_VIDEO_REQUEST_MASK; *x -= gfx_get_htotal() - gfx_get_hsync_end() - 2; *y -= gfx_get_vtotal() - gfx_get_vsync_end() + 1; return (0); } /*--------------------------------------------------------------------------- * gfx_get_video_source * * This routine returns the current video source. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_video_source(VideoSourceType * source) #else int gfx_get_video_source(VideoSourceType * source) #endif { switch (READ_VID32(SC1200_VIDEO_DISPLAY_MODE) & SC1200_VIDEO_SOURCE_MASK) { case SC1200_VIDEO_SOURCE_GX1: *source = VIDEO_SOURCE_MEMORY; break; case SC1200_VIDEO_SOURCE_DVIP: *source = VIDEO_SOURCE_DVIP; break; default: return GFX_STATUS_ERROR; } return (0); } /*--------------------------------------------------------------------------- * gfx_get_vbi_source * * This routine returns the current vbi source. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_vbi_source(VbiSourceType * source) #else int gfx_get_vbi_source(VbiSourceType * source) #endif { switch (READ_VID32(SC1200_VIDEO_DISPLAY_MODE) & SC1200_VBI_SOURCE_MASK) { case SC1200_VBI_SOURCE_GX1: *source = VBI_SOURCE_MEMORY; break; case SC1200_VBI_SOURCE_DVIP: *source = VBI_SOURCE_DVIP; break; default: return GFX_STATUS_ERROR; } return (0); } /*--------------------------------------------------------------------------- * gfx_get_vbi_lines * * This routine returns the VBI lines which are sent to the TV encoder. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_vbi_lines(int odd) #else unsigned long gfx_get_vbi_lines(int odd) #endif { if (odd) return (READ_VID32(SC1200_VIDEO_ODD_VBI_LINE_ENABLE) & SC1200_VIDEO_VBI_LINE_ENABLE_MASK); return (READ_VID32(SC1200_VIDEO_EVEN_VBI_LINE_ENABLE) & SC1200_VIDEO_VBI_LINE_ENABLE_MASK); } /*--------------------------------------------------------------------------- * gfx_get_vbi_total * * This routine returns the total number of VBI bytes in the field. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_vbi_total(int odd) #else unsigned long gfx_get_vbi_total(int odd) #endif { if (odd) return (READ_VID32(SC1200_VIDEO_ODD_VBI_TOTAL_COUNT) & SC1200_VIDEO_VBI_TOTAL_COUNT_MASK); return (READ_VID32(SC1200_VIDEO_EVEN_VBI_TOTAL_COUNT) & SC1200_VIDEO_VBI_TOTAL_COUNT_MASK); } /*--------------------------------------------------------------------------- * gfx_get_video_interlaced() * * This routine returns "1" if input video is currently in interlaced mode. * "0" otherwise. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_video_interlaced(void) #else int gfx_get_video_interlaced(void) #endif { if (READ_VID32(SC1200_VID_ALPHA_CONTROL) & SC1200_VIDEO_IS_INTERLACED) return (1); else return (0); } /*--------------------------------------------------------------------------- * gfx_get_color_space_YUV() * * This routine returns "1" if video processor color space mode is currently * YUV. "0" otherwise. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_color_space_YUV(void) #else int gfx_get_color_space_YUV(void) #endif { unsigned long control; control = READ_VID32(SC1200_VID_ALPHA_CONTROL); /* IS SC1200 VIDEO COLOR SPACE RGB OR CONVERTED TO RGB */ if ((control & SC1200_VIDEO_INPUT_IS_RGB) || (control & SC1200_CSC_VIDEO_YUV_TO_RGB)) return (0); else return (1); } /*--------------------------------------------------------------------------- * gfx_get_vertical_scaler_offset() * * This routine sets "offset" to the value by which odd frames are shifted, * if insert is enabled, and to 0 if no shifting occurs. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_vertical_scaler_offset(char *offset) #else int gfx_get_vertical_scaler_offset(char *offset) #endif { unsigned long control; control = READ_VID32(SC1200_VID_ALPHA_CONTROL); if (control & SC1200_VERTICAL_SCALER_SHIFT_EN) { if ((control & SC1200_VERTICAL_SCALER_SHIFT_MASK) == SC1200_VERTICAL_SCALER_SHIFT_INIT) *offset = 1; else return GFX_STATUS_ERROR; /* TODO: find the interpretation of other values */ } else *offset = 0; return (0); } /*--------------------------------------------------------------------------- * gfx_get_genlock_delay * * This routine returns the genlock delay in 27 MHz clocks. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_get_genlock_delay(void) #else unsigned long gfx_get_genlock_delay(void) #endif { return (READ_VID32(SC1200_GENLOCK_DELAY) & SC1200_GENLOCK_DELAY_MASK); } /*--------------------------------------------------------------------------- * gfx_get_genlock_enable * * This routine returns "1" if genlock is currently enabled, "0" otherwise. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_genlock_enable(void) #else int gfx_get_genlock_enable(void) #endif { if (READ_VID32(SC1200_GENLOCK) & (SC1200_GENLOCK_SINGLE_ENABLE | SC1200_GENLOCK_CONTINUOUS_ENABLE)) return (1); else return (0); } /*--------------------------------------------------------------------------- * gfx_get_video_cursor() * * This routine configures the video hardware cursor. * If the "mask"ed bits in the graphics pixel match "key", then either * "color1" or "color2" will be used for this pixel, according to the value of * the bit in offset "select_color2". *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_video_cursor(unsigned long *key, unsigned long *mask, unsigned short *select_color2, unsigned long *color1, unsigned short *color2) #else int gfx_get_video_cursor(unsigned long *key, unsigned long *mask, unsigned short *select_color2, unsigned long *color1, unsigned short *color2) #endif { *select_color2 = (unsigned short) (READ_VID32(SC1200_CURSOR_COLOR_KEY) >> SC1200_CURSOR_COLOR_KEY_OFFSET_POS); *key = READ_VID32(SC1200_CURSOR_COLOR_KEY) & SC1200_COLOR_MASK; *mask = READ_VID32(SC1200_CURSOR_COLOR_MASK) & SC1200_COLOR_MASK; *color1 = READ_VID32(SC1200_CURSOR_COLOR_1) & SC1200_COLOR_MASK; *color2 = (unsigned short) (READ_VID32(SC1200_CURSOR_COLOR_2) & SC1200_COLOR_MASK); return (0); } /*--------------------------------------------------------------------------- * gfx_read_crc * * This routine returns the hardware CRC value, which is used for automated * testing. The value is like a checksum, but will change if pixels move * locations. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC unsigned long sc1200_read_crc(void) #else unsigned long gfx_read_crc(void) #endif { unsigned long crc = 0xFFFFFFFF; if (gfx_test_timing_active()) { /* WAIT UNTIL ACTIVE DISPLAY */ while (!gfx_test_vertical_active()); /* RESET CRC DURING ACTIVE DISPLAY */ WRITE_VID32(SC1200_VID_CRC, 0); WRITE_VID32(SC1200_VID_CRC, 1); /* WAIT UNTIL NOT ACTIVE, THEN ACTIVE, NOT ACTIVE, THEN ACTIVE */ while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); while (!gfx_test_vertical_active()); crc = READ_VID32(SC1200_VID_CRC) >> 8; } return (crc); } /*---------------------------------------------------------------------------- * gfx_get_macrovision_enable * * This routine returns the value "one" if macrovision currently enabled in * the TV encoder, otherwise it returns the value "zero". *---------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC int sc1200_get_macrovision_enable(void) #else int gfx_get_macrovision_enable(void) #endif { if (READ_VID32(SC1200_TVENC_MV_CONTROL) == SC1200_TVENC_MV_ENABLE) return (1); return (0); } /*--------------------------------------------------------------------------- * gfx_get_alpha_enable * * This routine returns 1 if the selected alpha window is currently * enabled, or 0 if it is currently disabled. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void sc1200_get_alpha_enable(int *enable) #else void gfx_get_alpha_enable(int *enable) #endif { unsigned long value = 0; *enable = 0; if (gfx_alpha_select <= 2) { value = READ_VID32(SC1200_ALPHA_CONTROL_1 + ((unsigned long) gfx_alpha_select << 4)); if (value & SC1200_ACTRL_WIN_ENABLE) *enable = 1; } return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_size * * This routine returns the size of the currently selected alpha region. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void sc1200_get_alpha_size(unsigned short *x, unsigned short *y, unsigned short *width, unsigned short *height) #else void gfx_get_alpha_size(unsigned short *x, unsigned short *y, unsigned short *width, unsigned short *height) #endif { unsigned long value = 0; *x = 0; *y = 0; *width = 0; *height = 0; if (gfx_alpha_select <= 2) { value = READ_VID32(SC1200_ALPHA_XPOS_1 + ((unsigned long) gfx_alpha_select << 4)); *x = (unsigned short) (value & 0x000007FF); *width = (unsigned short) ((value >> 16) & 0x000007FF) - *x; value = READ_VID32(SC1200_ALPHA_YPOS_1 + ((unsigned long) gfx_alpha_select << 4)); *y = (unsigned short) (value & 0x000007FF); *height = (unsigned short) ((value >> 16) & 0x000007FF) - *y; } *x -= gfx_get_htotal() - gfx_get_hsync_end() - 2; *y -= gfx_get_vtotal() - gfx_get_vsync_end() + 1; return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_value * * This routine returns the alpha value and increment/decrement value of * the currently selected alpha region. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void sc1200_get_alpha_value(unsigned char *alpha, char *delta) #else void gfx_get_alpha_value(unsigned char *alpha, char *delta) #endif { unsigned long value = 0; *alpha = 0; *delta = 0; if (gfx_alpha_select <= 2) { value = READ_VID32(SC1200_ALPHA_CONTROL_1 + ((unsigned long) gfx_alpha_select << 4)); *alpha = (unsigned char) (value & 0x00FF); *delta = (char) ((value >> 8) & 0x00FF); } return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_priority * * This routine returns the priority of the currently selected alpha region. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void sc1200_get_alpha_priority(int *priority) #else void gfx_get_alpha_priority(int *priority) #endif { unsigned long pos = 0, value = 0; *priority = 0; if (gfx_alpha_select <= 2) { value = READ_VID32(SC1200_VID_ALPHA_CONTROL); pos = 16 + (gfx_alpha_select << 1); *priority = (int) ((value >> pos) & 3); } return; } /*--------------------------------------------------------------------------- * gfx_get_alpha_color * * This routine returns the color register value for the currently selected * alpha region. Bit 24 is set if the color register is enabled. *--------------------------------------------------------------------------- */ #if GFX_VIDEO_DYNAMIC void sc1200_get_alpha_color(unsigned long *color) #else void gfx_get_alpha_color(unsigned long *color) #endif { *color = 0; if (gfx_alpha_select <= 2) { *color = READ_VID32(SC1200_ALPHA_COLOR_1 + ((unsigned long) gfx_alpha_select << 4)); } return; } #endif /* GFX_READ_ROUTINES */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/i2c_acc.c0000644000175000017500000006261012654445443014607 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to write to and read from the I2C bus using * the ACCESS.bus hardware in the SC1200. * */ /* SUPER IO DEFINITIONS */ #define INDEX_1 0x15C /* base address 1 selected */ #define DATA_1 0x15D #define INDEX_2 0x2E /* base address 2 selected */ #define DATA_2 0x2F #define PCI_INDEX 0xCF8 /* PCI configuration space INDEX */ #define PCI_DATA 0xCFC /* PCI configuration space DATA */ #define BASE_ADR_MSB_REG 0x60 /* base address MSB register */ #define BASE_ADR_LSB_REG 0x61 /* base address LSB register */ #define SIO_BASE_ADR_15C_15D 0x6000000 #define SIO_BASE_ADR_2E_2F 0x4000000 /* SUPER IO GLOBALS */ unsigned short index_reg, data_reg; /* ACCESS BUS DEFINITIONS */ #define ACC_I2C_TIMEOUT 1000000 /* Number of reads before timing out */ #define ACB1_BASE 0x810 /* ACCESS.bus base addresses */ #define ACB2_BASE 0x820 #define ACBSDA 0 /* ACB serial data */ #define ACBST 1 /* ACB status */ #define ACBCST 2 /* ACB control status */ #define ACBCTL1 3 /* ACB control 1 */ #define ACBADDR 4 /* ACB own address */ #define ACBCTL2 5 /* ACB control 2 */ #define LDN 0x7 /* Logical Device Numbers */ #define ACB1_LDN 0x5 #define ACB2_LDN 0x6 /* INITIAL ACCESS.bus BASE ADDRESS VALUES */ unsigned short base_address_array[3] = { 0, ACB1_BASE, ACB2_BASE }; char Freq = 0x71; /* LOCAL ACCESS.bus FUNCTION DECLARATIONS */ void acc_i2c_start(unsigned char busnum); void acc_i2c_stop(unsigned char busnum); void acc_i2c_abort_data(unsigned char busnum); void acc_i2c_bus_recovery(unsigned char busnum); void acc_i2c_stall_after_start(unsigned char busnum, int state); void acc_i2c_send_address(unsigned char busnum, unsigned char cData); int acc_i2c_ack(unsigned char busnum, int fPut, int negAck); void acc_i2c_stop_clock(unsigned char busnum); void acc_i2c_activate_clock(unsigned char busnum); void acc_i2c_write_byte(unsigned char busnum, unsigned char cData); unsigned char acc_i2c_read_byte(unsigned char busnum, int last_byte); void acc_i2c_reset_bus(unsigned char busnum); int acc_i2c_request_master(unsigned char busnum); void acc_i2c_config(unsigned char busnum, short adr, char freq); char acc_i2c_set_freq(unsigned char busnum, char freq); unsigned short acc_i2c_set_base_address(unsigned char busnum, short adr); /* LOCAL HELPER ROUTINES */ void OsPciReadDWord(int bus, int dev, int func, int address, unsigned long *data); int sio_set_index_data_reg(void); void sio_write_reg(unsigned char reg, unsigned char data); unsigned char sio_read_reg(unsigned char reg); /*--------------------------------------------------------------------------- * OsPciReadDWord * * This routine reads one double word from the PCI configuration header * defined by 'bus', 'dev', 'func' and 'address' to the double word * pointed to by 'data'. * * Returns : None. *--------------------------------------------------------------------------- */ void OsPciReadDWord(int bus, int dev, int func, int address, unsigned long *data) { /* * The address of a double word in the Configuration Header is built in * the following way : * {10000000,bus[23:16],device[15:11],function[10:8],address[7:2],00} */ long addr = (0x80000000 | ((bus & 0xff) << 16) | ((dev & 0x1f) << 11) | ((func & 0x7) << 8) | (address & 0xff)); OUTD(PCI_INDEX, addr); *data = IND(PCI_DATA); } /*--------------------------------------------------------------------------- * sio_set_index_data_reg * * This routine checks which index and data registers to use * in order to access the Super I/O registers * * Returns : 1 - OK * 0 - Super I/O disabled or configuration access disabled *--------------------------------------------------------------------------- */ int sio_set_index_data_reg(void) { unsigned long xbus_expention_bar, io_control_reg1; OsPciReadDWord(0, 0x12, 5, 0x10, &xbus_expention_bar); xbus_expention_bar = xbus_expention_bar & 0xfffffffe; io_control_reg1 = IND((unsigned short) xbus_expention_bar); if ((io_control_reg1) & (SIO_BASE_ADR_15C_15D)) { index_reg = INDEX_1; data_reg = DATA_1; return (1); } if ((io_control_reg1) & (SIO_BASE_ADR_2E_2F)) { index_reg = INDEX_2; data_reg = DATA_2; return (1); } return (0); } /*--------------------------------------------------------------------------- * sio_write_reg * * This routine writes 'data' to 'reg' Super I/O register * * Returns : None *--------------------------------------------------------------------------- */ void sio_write_reg(unsigned char reg, unsigned char data) { OUTB(index_reg, reg); OUTB(data_reg, data); } /*--------------------------------------------------------------------------- * sio_read_reg * * This routine reads data from 'reg' Super I/O register * * Returns : The data read from the requested register *--------------------------------------------------------------------------- */ unsigned char sio_read_reg(unsigned char reg) { OUTB(index_reg, reg); return INB(data_reg); } /*--------------------------------------------------------------------------- * gfx_i2c_reset * * This routine resets the I2C bus as follows : * · Sets the base address of the ACCESS.bus * · Sets the frequency of the ACCESS.bus * · Resets the ACCESS.bus * * If 'adr' is -1 the address is read from the hardware. * If 'freq' is -1 the frequency is set to 56 clock cycles. *--------------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC int acc_i2c_reset(unsigned char busnum, short adr, char freq) #else int gfx_i2c_reset(unsigned char busnum, short adr, char freq) #endif { if ((busnum != 1) && (busnum != 2)) return GFX_STATUS_BAD_PARAMETER; acc_i2c_config(busnum, adr, freq); if (base_address_array[busnum] == 0) return GFX_STATUS_ERROR; acc_i2c_reset_bus(busnum); return GFX_STATUS_OK; } /*--------------------------------------------------------------------------- * gfx_i2c_select_gpio * * This routine selects which GPIO pins to use. *--------------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC int acc_i2c_select_gpio(int clock, int data) #else int gfx_i2c_select_gpio(int clock, int data) #endif { /* THIS ROUTINE DOES NOT APPLY TO THE ACCESS.bus IMPLEMENTATION. */ return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_i2c_write * * This routine writes data to the specified I2C address. * busnum - ACCESS.bus number (1 or 2). *--------------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC int acc_i2c_write(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data) #else int gfx_i2c_write(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data) #endif { int loop = 0; if ((busnum != 1) && (busnum != 2)) return GFX_STATUS_BAD_PARAMETER; /* REQUEST MASTER */ if (!acc_i2c_request_master(busnum)) return (GFX_STATUS_ERROR); /* WRITE ADDRESS COMMAND */ acc_i2c_ack(busnum, 1, 0); acc_i2c_stall_after_start(busnum, 1); acc_i2c_send_address(busnum, (unsigned char) (chipadr & 0xFE)); acc_i2c_stall_after_start(busnum, 0); if (!acc_i2c_ack(busnum, 0, 0)) return (GFX_STATUS_ERROR); /* WRITE COMMAND */ acc_i2c_write_byte(busnum, subadr); if (!acc_i2c_ack(busnum, 0, 0)) return (GFX_STATUS_ERROR); /* WRITE DATA */ for (loop = 0; loop < bytes; loop++) { acc_i2c_write_byte(busnum, *data); if (loop < (bytes - 1)) data += sizeof(unsigned char); if (!acc_i2c_ack(busnum, 0, 0)) return (GFX_STATUS_ERROR); } data -= (bytes - 1); acc_i2c_stop(busnum); return GFX_STATUS_OK; } /*--------------------------------------------------------------------------- * gfx_i2c_read * * This routine reads data from the specified I2C address. * busnum - ACCESS.bus number (1 or 2). *--------------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC int acc_i2c_read(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data) #else int gfx_i2c_read(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data) #endif { unsigned char bytesRead; if ((busnum != 1) && (busnum != 2)) return GFX_STATUS_BAD_PARAMETER; if (bytes == 0) return GFX_STATUS_OK; /* REQUEST MASTER */ if (!acc_i2c_request_master(busnum)) return (GFX_STATUS_ERROR); /* WRITE ADDRESS COMMAND */ acc_i2c_ack(busnum, 1, 0); acc_i2c_stall_after_start(busnum, 1); acc_i2c_send_address(busnum, (unsigned char) (chipadr & 0xFE)); acc_i2c_stall_after_start(busnum, 0); if (!acc_i2c_ack(busnum, 0, 0)) return (GFX_STATUS_ERROR); /* WRITE COMMAND */ acc_i2c_write_byte(busnum, subadr); if (!acc_i2c_ack(busnum, 0, 0)) return (GFX_STATUS_ERROR); /* START THE READ */ acc_i2c_start(busnum); /* WRITE ADDRESS COMMAND */ acc_i2c_ack(busnum, 1, 1); acc_i2c_stall_after_start(busnum, 1); acc_i2c_send_address(busnum, (unsigned char) (chipadr | 0x01)); /* IF LAST BYTE */ if (bytes == 1) acc_i2c_ack(busnum, 1, 1); else acc_i2c_ack(busnum, 1, 0); acc_i2c_stall_after_start(busnum, 0); if (!acc_i2c_ack(busnum, 0, 0)) return (GFX_STATUS_ERROR); /* READ COMMAND */ for (bytesRead = 0; bytesRead < bytes; bytesRead += 1) { if (bytesRead < (bytes - 2)) { data[bytesRead] = acc_i2c_read_byte(busnum, 0); acc_i2c_ack(busnum, 1, 0); } else if (bytesRead == (bytes - 2)) { /* TWO BYTES LEFT */ acc_i2c_ack(busnum, 1, 1); data[bytesRead] = acc_i2c_read_byte(busnum, 0); acc_i2c_ack(busnum, 1, 1); } else { /* LAST BYTE */ data[bytesRead] = acc_i2c_read_byte(busnum, 1); acc_i2c_stop(busnum); } /* WHILE NOT LAST BYTE */ if ((!(bytesRead == (bytes - 1))) && (!acc_i2c_ack(busnum, 0, 0))) return (bytesRead); } return GFX_STATUS_OK; } /*--------------------------------------------------------------------------- * gfx_i2c_init * * This routine initializes the use of the ACCESS.BUS. *--------------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC int acc_i2c_init(void) #else int gfx_i2c_init(void) #endif { /* ### ADD ### THIS ROUTINE IS NOT YET IMPLEMENTED FOR ACCESS.bus */ return (GFX_STATUS_OK); } /*--------------------------------------------------------------------------- * gfx_i2c_cleanup * * This routine ends the use of the ACCESS.BUS. *--------------------------------------------------------------------------- */ #if GFX_I2C_DYNAMIC void acc_i2c_cleanup(void) #else void gfx_i2c_cleanup(void) #endif { /* ### ADD ### THIS ROUTINE IS NOT YET IMPLEMENTED FOR ACCESS.bus */ } /*--------------------------------------------------------*/ /* LOCAL ROUTINES SPECIFIC TO ACCESS.bus IMPLEMENTATION */ /*--------------------------------------------------------*/ /*--------------------------------------------------------------------------- * acc_i2c_reset_bus * * This routine resets the I2C bus. *--------------------------------------------------------------------------- */ void acc_i2c_reset_bus(unsigned char busnum) { unsigned char reg; unsigned short bus_base_address = base_address_array[busnum]; /* Disable the ACCESS.bus device and */ /* Configure the SCL frequency */ OUTB((unsigned short) (bus_base_address + ACBCTL2), (unsigned char) (Freq & 0xFE)); /* Configure no interrupt mode (polling) and */ /* Disable global call address */ OUTB((unsigned short) (bus_base_address + ACBCTL1), 0x0); /* Disable slave address */ OUTB((unsigned short) (bus_base_address + ACBADDR), 0x0); /* Enable the ACCESS.bus device */ reg = INB((unsigned short) (bus_base_address + ACBCTL2)); reg |= 0x01; OUTB((unsigned short) (bus_base_address + ACBCTL2), reg); /* Issue STOP event */ acc_i2c_stop(busnum); /* Clear NEGACK, STASTR and BER bits */ OUTB((unsigned short) (bus_base_address + ACBST), 0x38); /* Clear BB (BUS BUSY) bit */ reg = INB((unsigned short) (bus_base_address + ACBCST)); reg |= 0x02; OUTB((unsigned short) (bus_base_address + ACBCST), reg); } /*--------------------------------------------------------------------------- * acc_i2c_start * * This routine starts a transfer on the I2C bus. *--------------------------------------------------------------------------- */ void acc_i2c_start(unsigned char busnum) { unsigned char reg; unsigned short bus_base_address = base_address_array[busnum]; reg = INB((unsigned short) (bus_base_address + ACBCTL1)); reg |= 0x01; OUTB((unsigned short) (bus_base_address + ACBCTL1), reg); } /*--------------------------------------------------------------------------- * acc_i2c_stop * * This routine stops a transfer on the I2C bus. *--------------------------------------------------------------------------- */ void acc_i2c_stop(unsigned char busnum) { unsigned char reg; unsigned short bus_base_address = base_address_array[busnum]; reg = INB((unsigned short) (bus_base_address + ACBCTL1)); reg |= 0x02; OUTB((unsigned short) (bus_base_address + ACBCTL1), reg); } /*--------------------------------------------------------------------------- * acc_i2c_abort_data *--------------------------------------------------------------------------- */ void acc_i2c_abort_data(unsigned char busnum) { unsigned char reg; unsigned short bus_base_address = base_address_array[busnum]; acc_i2c_stop(busnum); reg = INB((unsigned short) (bus_base_address + ACBCTL1)); reg |= 0x10; OUTB((unsigned short) (bus_base_address + ACBCTL1), reg); } /*--------------------------------------------------------------------------- * acc_i2c_bus_recovery *--------------------------------------------------------------------------- */ void acc_i2c_bus_recovery(unsigned char busnum) { acc_i2c_abort_data(busnum); acc_i2c_reset_bus(busnum); } /*--------------------------------------------------------------------------- * acc_i2c_stall_after_start *--------------------------------------------------------------------------- */ void acc_i2c_stall_after_start(unsigned char busnum, int state) { unsigned char reg; unsigned short bus_base_address = base_address_array[busnum]; reg = INB((unsigned short) (bus_base_address + ACBCTL1)); if (state) reg |= 0x80; else reg &= 0x7F; OUTB((unsigned short) (bus_base_address + ACBCTL1), reg); if (!state) { reg = INB((unsigned short) (bus_base_address + ACBST)); reg |= 0x08; OUTB((unsigned short) (bus_base_address + ACBST), reg); } } /*--------------------------------------------------------------------------- * acc_i2c_send_address *--------------------------------------------------------------------------- */ void acc_i2c_send_address(unsigned char busnum, unsigned char cData) { unsigned char reg; unsigned short bus_base_address = base_address_array[busnum]; unsigned long timeout = 0; /* WRITE THE DATA */ OUTB((unsigned short) (bus_base_address + ACBSDA), cData); while (1) { reg = INB((unsigned short) (bus_base_address + ACBST)); if ((reg & 0x38) != 0) /* check STASTR, BER and NEGACK */ break; if (timeout++ == ACC_I2C_TIMEOUT) { acc_i2c_bus_recovery(busnum); return; } } /* CHECK FOR BUS ERROR */ if (reg & 0x20) { acc_i2c_bus_recovery(busnum); return; } /* CHECK NEGATIVE ACKNOWLEDGE */ if (reg & 0x10) { acc_i2c_abort_data(busnum); return; } } /*--------------------------------------------------------------------------- * acc_i2c_ack * * This routine looks for acknowledge on the I2C bus. *--------------------------------------------------------------------------- */ int acc_i2c_ack(unsigned char busnum, int fPut, int negAck) { unsigned char reg; unsigned short bus_base_address = base_address_array[busnum]; unsigned long timeout = 0; if (fPut) { /* read operation */ if (!negAck) { /* Push Ack onto I2C bus */ reg = INB((unsigned short) (bus_base_address + ACBCTL1)); reg &= 0xE7; OUTB((unsigned short) (bus_base_address + ACBCTL1), reg); } else { /* Push negAck onto I2C bus */ reg = INB((unsigned short) (bus_base_address + ACBCTL1)); reg |= 0x10; OUTB((unsigned short) (bus_base_address + ACBCTL1), reg); } } else { /* write operation */ /* Receive Ack from I2C bus */ while (1) { reg = INB((unsigned short) (bus_base_address + ACBST)); if ((reg & 0x70) != 0) /* check SDAST, BER and NEGACK */ break; if (timeout++ == ACC_I2C_TIMEOUT) { acc_i2c_bus_recovery(busnum); return (0); } } /* CHECK FOR BUS ERROR */ if (reg & 0x20) { acc_i2c_bus_recovery(busnum); return (0); } /* CHECK NEGATIVE ACKNOWLEDGE */ if (reg & 0x10) { acc_i2c_abort_data(busnum); return (0); } } return (1); } /*--------------------------------------------------------------------------- * acc_i2c_stop_clock * * This routine stops the ACCESS.bus clock. *--------------------------------------------------------------------------- */ void acc_i2c_stop_clock(unsigned char busnum) { unsigned char reg; unsigned short bus_base_address = base_address_array[busnum]; reg = INB((unsigned short) (bus_base_address + ACBCTL2)); reg &= ~0x01; OUTB((unsigned short) (bus_base_address + ACBCTL2), reg); } /*--------------------------------------------------------------------------- * acc_i2c_activate_clock * * This routine activates the ACCESS.bus clock. *--------------------------------------------------------------------------- */ void acc_i2c_activate_clock(unsigned char busnum) { unsigned char reg; unsigned short bus_base_address = base_address_array[busnum]; reg = INB((unsigned short) (bus_base_address + ACBCTL2)); reg |= 0x01; OUTB((unsigned short) (bus_base_address + ACBCTL2), reg); } /*--------------------------------------------------------------------------- * acc_i2c_write_byte * * This routine writes a byte to the I2C bus *--------------------------------------------------------------------------- */ void acc_i2c_write_byte(unsigned char busnum, unsigned char cData) { unsigned char reg; unsigned short bus_base_address = base_address_array[busnum]; unsigned long timeout = 0; while (1) { reg = INB((unsigned short) (bus_base_address + ACBST)); if (reg & 0x70) break; if (timeout++ == ACC_I2C_TIMEOUT) { acc_i2c_bus_recovery(busnum); return; } } /* CHECK FOR BUS ERROR */ if (reg & 0x20) { acc_i2c_bus_recovery(busnum); return; } /* CHECK NEGATIVE ACKNOWLEDGE */ if (reg & 0x10) { acc_i2c_abort_data(busnum); return; } /* WRITE THE DATA */ OUTB((unsigned short) (bus_base_address + ACBSDA), cData); } /*--------------------------------------------------------------------------- * acc_i2c_read_byte * * This routine reads a byte from the I2C bus *--------------------------------------------------------------------------- */ unsigned char acc_i2c_read_byte(unsigned char busnum, int last_byte) { unsigned char cData, reg; unsigned short bus_base_address = base_address_array[busnum]; unsigned long timeout = 0; while (1) { reg = INB((unsigned short) (bus_base_address + ACBST)); if (reg & 0x60) break; if (timeout++ == ACC_I2C_TIMEOUT) { acc_i2c_bus_recovery(busnum); return (0xEF); } } /* CHECK FOR BUS ERROR */ if (reg & 0x20) { acc_i2c_bus_recovery(busnum); return (0xEE); } /* READ DATA */ if (last_byte) acc_i2c_stop_clock(busnum); cData = INB((unsigned short) (bus_base_address + ACBSDA)); if (last_byte) acc_i2c_activate_clock(busnum); return (cData); } /*--------------------------------------------------------------------------- * acc_i2c_request_master *--------------------------------------------------------------------------- */ int acc_i2c_request_master(unsigned char busnum) { unsigned char reg; unsigned short bus_base_address = base_address_array[busnum]; unsigned long timeout = 0; acc_i2c_start(busnum); while (1) { reg = INB((unsigned short) (bus_base_address + ACBST)); if (reg & 0x60) break; if (timeout++ == ACC_I2C_TIMEOUT) { acc_i2c_bus_recovery(busnum); return (0); } } /* CHECK FOR BUS ERROR */ if (reg & 0x20) { acc_i2c_abort_data(busnum); return (0); } /* CHECK NEGATIVE ACKNOWLEDGE */ if (reg & 0x10) { acc_i2c_abort_data(busnum); return (0); } return (1); } /*--------------------------------------------------------*/ /* LOCAL ROUTINES SPECIFIC TO ACCESS.bus INITIALIZATION */ /*--------------------------------------------------------*/ /*---------------------------------------------------------------------------- * acc_i2c_config * * This routine configures the I2C bus *---------------------------------------------------------------------------- */ void acc_i2c_config(unsigned char busnum, short adr, char freq) { base_address_array[busnum] = acc_i2c_set_base_address(busnum, adr); Freq = acc_i2c_set_freq(busnum, freq); } /*---------------------------------------------------------------------------- * acc_i2c_set_freq * * This routine sets the frequency of the I2C bus *---------------------------------------------------------------------------- */ char acc_i2c_set_freq(unsigned char busnum, char freq) { unsigned short bus_base_address = base_address_array[busnum]; OUTB((unsigned short) (bus_base_address + ACBCTL2), 0x0); if (freq == -1) freq = 0x71; else { freq = freq << 1; freq |= 0x01; } OUTB((unsigned short) (bus_base_address + ACBCTL2), freq); return (freq); } /*--------------------------------------------------------------------------- * acc_i2c_set_base_address * * This routine sets the base address of the I2C bus *--------------------------------------------------------------------------- */ unsigned short acc_i2c_set_base_address(unsigned char busnum, short adr) { unsigned short ab_base_addr; /* Get Super I/O Index and Data registers */ if (!sio_set_index_data_reg()) return (0); /* Configure LDN to current ACB */ if (busnum == 1) sio_write_reg(LDN, ACB1_LDN); if (busnum == 2) sio_write_reg(LDN, ACB2_LDN); if (adr == -1) { /* Get ACCESS.bus base address */ ab_base_addr = sio_read_reg(BASE_ADR_MSB_REG); ab_base_addr = ab_base_addr << 8; ab_base_addr |= sio_read_reg(BASE_ADR_LSB_REG); if (ab_base_addr != 0) return ab_base_addr; else adr = (busnum == 1 ? ACB1_BASE : ACB2_BASE); } /* Set ACCESS.bus base address */ sio_write_reg(BASE_ADR_LSB_REG, (unsigned char) (adr & 0xFF)); sio_write_reg(BASE_ADR_MSB_REG, (unsigned char) (adr >> 8)); return adr; } /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/disp_gu2.c0000644000175000017500000024351612654445443015046 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * This file contains routines for the second generation display controller. * */ void gu2_enable_compression(void); /* private routine definition */ void gu2_disable_compression(void); /* private routine definition */ int gfx_set_display_control(int sync_polarities); /* private routine * definition */ void gfx_reset_video(void); int gu2_set_specified_mode(DISPLAYMODE * pMode, int bpp); /*--------------------------------------------------------------------------- * WARNING!!!! INACCURATE DELAY MECHANISM * * In an effort to keep the code self contained and operating system * independent, the delay loop just performs reads of a display controller * register. This time will vary for faster processors. The delay can always * be longer than intended, only effecting the time of the mode switch * (obviously want it to still be under a second). Problems with the hardware * only arise if the delay is not long enough. *---------------------------------------------------------------------------- */ #define RC_READS_PER_MILLISECOND 15000L #if GFX_DISPLAY_DYNAMIC void gu2_delay_milliseconds(unsigned long milliseconds) #else void gfx_delay_milliseconds(unsigned long milliseconds) #endif { /* ASSUME 300 MHZ 20 CLOCKS PER READ */ unsigned long loop; loop = milliseconds * RC_READS_PER_MILLISECOND; while (loop-- > 0) { READ_REG32(MDC_UNLOCK); } } #if GFX_DISPLAY_DYNAMIC void gu2_delay_microseconds(unsigned long microseconds) #else void gfx_delay_microseconds(unsigned long microseconds) #endif { /* ASSUME 400 MHz, 2 CLOCKS PER INCREMENT */ unsigned long loop_count = microseconds * 15; while (loop_count-- > 0) { READ_REG32(MDC_UNLOCK); } } /*---------------------------------------------------------------------------- * GFX_SET_DISPLAY_BPP * * This routine programs the bpp in the display controller. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_display_bpp(unsigned short bpp) #else int gfx_set_display_bpp(unsigned short bpp) #endif { unsigned long dcfg, lock; dcfg = READ_REG32(MDC_DISPLAY_CFG) & ~(MDC_DCFG_DISP_MODE_MASK | MDC_DCFG_16BPP_MODE_MASK); lock = READ_REG32(MDC_UNLOCK); switch (bpp) { case 12: dcfg |= (MDC_DCFG_DISP_MODE_16BPP | MDC_DCFG_12BPP); break; case 15: dcfg |= (MDC_DCFG_DISP_MODE_16BPP | MDC_DCFG_15BPP); break; case 16: dcfg |= (MDC_DCFG_DISP_MODE_16BPP | MDC_DCFG_16BPP); break; case 32: dcfg |= (MDC_DCFG_DISP_MODE_24BPP); break; case 8: dcfg |= (MDC_DCFG_DISP_MODE_8BPP); break; default: return GFX_STATUS_BAD_PARAMETER; } WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_DISPLAY_CFG, dcfg); WRITE_REG32(MDC_UNLOCK, lock); /* SET BPP IN GRAPHICS PIPELINE */ gfx_set_bpp(bpp); return 0; } /*---------------------------------------------------------------------------- * gu2_set_specified_mode (private routine) * This routine uses the parameters in the specified display mode structure * to program the display controller hardware. *---------------------------------------------------------------------------- */ int gu2_set_specified_mode(DISPLAYMODE * pMode, int bpp) { unsigned long unlock, value; unsigned long gcfg, dcfg; unsigned long size, pitch; unsigned long vid_buf_size; unsigned long bpp_mask, temp, dv_size; /* CHECK WHETHER TIMING CHANGE IS ALLOWED */ /* Flag used for locking also overrides timing change restriction */ if (gfx_timing_lock && !(pMode->flags & GFX_MODE_LOCK_TIMING)) return GFX_STATUS_ERROR; /* CLEAR PANNING OFFSETS */ DeltaX = 0; DeltaY = 0; panelLeft = 0; panelTop = 0; /* SET GLOBAL FLAG */ if (pMode->flags & GFX_MODE_LOCK_TIMING) gfx_timing_lock = 1; /* CHECK FOR VALID BPP */ /* As this function can be called directly from */ /* gfx_set_display_timings, we must correct any */ /* invalid bpp settings. */ switch (bpp) { case 12: bpp_mask = 0x00000900; break; case 15: bpp_mask = 0x00000500; break; case 16: bpp_mask = 0x00000100; break; case 32: bpp_mask = 0x00000200; break; default: bpp_mask = 0x00000000; bpp = 8; break; } gbpp = bpp; /* DISABLE COMPRESSION */ gu2_disable_compression(); /* ALSO DISABLE VIDEO */ /* Use private "reset video" routine to do all that is needed. */ /* SC1200, for example, also disables the alpha blending regions. */ gfx_reset_video(); /* UNLOCK THE DISPLAY CONTROLLER REGISTERS */ unlock = READ_REG32(MDC_UNLOCK); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); /* READ THE CURRENT REGISTER VALUES */ gcfg = READ_REG32(MDC_GENERAL_CFG); dcfg = READ_REG32(MDC_DISPLAY_CFG); /* BLANK THE DISPLAY IN THE DISPLAY FILTER */ gfx_set_crt_enable(0); /* DISABLE THE TIMING GENERATOR */ dcfg &= ~(unsigned long) MDC_DCFG_TGEN; WRITE_REG32(MDC_DISPLAY_CFG, dcfg); /* DELAY: WAIT FOR PENDING MEMORY REQUESTS */ /* This delay is used to make sure that all pending requests to the */ /* memory controller have completed before disabling the FIFO load. */ gfx_delay_milliseconds(5); /* DISABLE DISPLAY FIFO LOAD */ gcfg &= ~(unsigned long) MDC_GCFG_DFLE; WRITE_REG32(MDC_GENERAL_CFG, gcfg); /* PRESERVE VIDEO INFORMATION */ gcfg &= (unsigned long) (MDC_GCFG_YUVM | MDC_GCFG_VDSE); dcfg = 0; /* SET THE DOT CLOCK FREQUENCY */ /* Mask off the divide by two bit (bit 31) */ if (!(pMode->flags & GFX_MODE_EXCLUDE_PLL)) gfx_set_clock_frequency(pMode->frequency & 0x7FFFFFFF); /* DELAY: WAIT FOR THE PLL TO SETTLE */ /* This allows the dot clock frequency that was just set to settle. */ gfx_delay_milliseconds(10); /* SET THE GX DISPLAY CONTROLLER PARAMETERS */ WRITE_REG32(MDC_FB_ST_OFFSET, 0); WRITE_REG32(MDC_CB_ST_OFFSET, 0); WRITE_REG32(MDC_CURS_ST_OFFSET, 0); WRITE_REG32(MDC_ICON_ST_OFFSET, 0); /* SET LINE SIZE AND PITCH */ /* 1. Flat Panels must use the mode width and not */ /* the timing width to set the pitch. */ /* 2. Mode sets will use a pitch that is aligned */ /* on a 1K boundary to preserve legacy. The */ /* pitch can be overridden by a subsequent call */ /* to gfx_set_display_pitch. */ if (PanelEnable) size = ModeWidth; else size = pMode->hactive; if (bpp > 8) size <<= 1; if (bpp > 16) size <<= 1; pitch = 1024; dv_size = MDC_DV_LINE_SIZE_1024; if (size > 1024) { pitch = 2048; dv_size = MDC_DV_LINE_SIZE_2048; } if (size > 2048) { pitch = 4096; dv_size = MDC_DV_LINE_SIZE_4096; } if (size > 4096) { pitch = 8192; dv_size = MDC_DV_LINE_SIZE_8192; } WRITE_REG32(MDC_GFX_PITCH, pitch >> 3); /* WRITE DIRTY/VALID CONTROL WITH LINE LENGTH */ temp = READ_REG32(MDC_DV_CTL); WRITE_REG32(MDC_DV_CTL, (temp & ~MDC_DV_LINE_SIZE_MASK) | dv_size); if (PanelEnable) { size = pMode->hactive; if (bpp > 8) size <<= 1; if (bpp > 16) size <<= 1; } /* SAVE PREVIOUSLY STORED VIDEO LINE SIZE */ vid_buf_size = READ_REG32(MDC_LINE_SIZE) & 0xFF000000; /* ADD 2 TO SIZE FOR POSSIBLE START ADDRESS ALIGNMENTS */ WRITE_REG32(MDC_LINE_SIZE, ((size >> 3) + 2) | vid_buf_size); /* ALWAYS ENABLE VIDEO AND GRAPHICS DATA */ /* These bits are relics from a previous design and */ /* should always be enabled. */ dcfg |= (unsigned long) (MDC_DCFG_VDEN | MDC_DCFG_GDEN); /* SET PIXEL FORMAT */ dcfg |= bpp_mask; /* ENABLE TIMING GENERATOR, TIM. REG. UPDATES, PALETTE BYPASS */ /* AND VERT. INT. SELECT */ dcfg |= (unsigned long) (MDC_DCFG_TGEN | MDC_DCFG_TRUP | MDC_DCFG_PALB | MDC_DCFG_VISL); /* DISABLE ADDRESS MASKS */ dcfg |= MDC_DCFG_A20M; dcfg |= MDC_DCFG_A18M; /* SET FIFO PRIORITIES AND DISPLAY FIFO LOAD ENABLE */ /* Set the priorities higher for high resolution modes. */ if (pMode->hactive > 1024 || bpp == 32) gcfg |= 0x000A901; else gcfg |= 0x0006501; /* ENABLE FLAT PANEL CENTERING */ /* For panel modes having a resolution smaller than the */ /* panel resolution, turn on data centering. */ if (PanelEnable && ModeWidth < PanelWidth) dcfg |= MDC_DCFG_DCEN; /* COMBINE AND SET TIMING VALUES */ value = (unsigned long) (pMode->hactive - 1) | (((unsigned long) (pMode->htotal - 1)) << 16); WRITE_REG32(MDC_H_ACTIVE_TIMING, value); value = (unsigned long) (pMode->hblankstart - 1) | (((unsigned long) (pMode->hblankend - 1)) << 16); WRITE_REG32(MDC_H_BLANK_TIMING, value); value = (unsigned long) (pMode->hsyncstart - 1) | (((unsigned long) (pMode->hsyncend - 1)) << 16); WRITE_REG32(MDC_H_SYNC_TIMING, value); value = (unsigned long) (pMode->vactive - 1) | (((unsigned long) (pMode->vtotal - 1)) << 16); WRITE_REG32(MDC_V_ACTIVE_TIMING, value); value = (unsigned long) (pMode->vblankstart - 1) | (((unsigned long) (pMode->vblankend - 1)) << 16); WRITE_REG32(MDC_V_BLANK_TIMING, value); value = (unsigned long) (pMode->vsyncstart - 1) | (((unsigned long) (pMode->vsyncend - 1)) << 16); WRITE_REG32(MDC_V_SYNC_TIMING, value); WRITE_REG32(MDC_DISPLAY_CFG, dcfg); WRITE_REG32(MDC_GENERAL_CFG, gcfg); /* CONFIGURE DISPLAY OUTPUT FROM VIDEO PROCESSOR */ gfx_set_display_control(((pMode->flags & GFX_MODE_NEG_HSYNC) ? 1 : 0) | ((pMode->flags & GFX_MODE_NEG_VSYNC) ? 2 : 0)); /* RESTORE VALUE OF MDC_UNLOCK */ WRITE_REG32(MDC_UNLOCK, unlock); /* RESET THE PITCH VALUES IN THE GP */ gfx_reset_pitch((unsigned short) pitch); gfx_set_bpp((unsigned short) bpp); return GFX_STATUS_OK; } /*---------------------------------------------------------------------------- * GFX_IS_DISPLAY_MODE_SUPPORTED * * This routine sets the specified display mode. * * Returns 1 if successful, 0 if mode could not be set. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_is_display_mode_supported(int xres, int yres, int bpp, int hz) #else int gfx_is_display_mode_supported(int xres, int yres, int bpp, int hz) #endif { unsigned int mode; unsigned long hz_flag = 0, bpp_flag = 0; /* SET FLAGS TO MATCH REFRESH RATE */ gfx_mode_hz_conversion /* SET BPP FLAGS TO LIMIT MODE SELECTION */ gfx_mode_bpp_conversion /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */ for (mode = 0; mode < NUM_RC_DISPLAY_MODES; mode++) { if ((DisplayParams[mode].hactive == (unsigned short) xres) && (DisplayParams[mode].vactive == (unsigned short) yres) && (DisplayParams[mode].flags & hz_flag) && (DisplayParams[mode].flags & bpp_flag)) { /* REDCLOUD DOES NOT SUPPORT EMULATED VGA MODES */ if ((DisplayParams[mode].flags & GFX_MODE_PIXEL_DOUBLE) || (DisplayParams[mode].flags & GFX_MODE_LINE_DOUBLE)) continue; /* SET THE DISPLAY CONTROLLER FOR THE SELECTED MODE */ return (mode); } } return (-1); } /*---------------------------------------------------------------------------- * gfx_set_display_mode * * This routine sets the specified display mode. * * Returns 1 if successful, 0 if mode could not be set. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_display_mode(int xres, int yres, int bpp, int hz) #else int gfx_set_display_mode(int xres, int yres, int bpp, int hz) #endif { int mode; /* DISABLE FLAT PANEL */ /* Flat Panel settings are enabled by the function gfx_set_fixed_timings * and disabled by gfx_set_display_mode. * */ PanelEnable = 0; mode = gfx_is_display_mode_supported(xres, yres, bpp, hz); if (mode >= 0) { if (gu2_set_specified_mode(&DisplayParams[mode], bpp) == GFX_STATUS_OK) return (1); } return (0); } /*---------------------------------------------------------------------------- * GFX_SET_DISPLAY_TIMINGS * * This routine sets the display controller mode using the specified timing * values (as opposed to using the tables internal to Durango). * * Returns GFX_STATUS_OK ON SUCCESS, GFX_STATUS_ERROR otherwise. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_display_timings(unsigned short bpp, unsigned short flags, unsigned short hactive, unsigned short hblankstart, unsigned short hsyncstart, unsigned short hsyncend, unsigned short hblankend, unsigned short htotal, unsigned short vactive, unsigned short vblankstart, unsigned short vsyncstart, unsigned short vsyncend, unsigned short vblankend, unsigned short vtotal, unsigned long frequency) #else int gfx_set_display_timings(unsigned short bpp, unsigned short flags, unsigned short hactive, unsigned short hblankstart, unsigned short hsyncstart, unsigned short hsyncend, unsigned short hblankend, unsigned short htotal, unsigned short vactive, unsigned short vblankstart, unsigned short vsyncstart, unsigned short vsyncend, unsigned short vblankend, unsigned short vtotal, unsigned long frequency) #endif { /* SET MODE STRUCTURE WITH SPECIFIED VALUES */ gfx_display_mode.flags = 0; if (flags & 1) gfx_display_mode.flags |= GFX_MODE_NEG_HSYNC; if (flags & 2) gfx_display_mode.flags |= GFX_MODE_NEG_VSYNC; if (flags & 4) gfx_display_mode.flags |= GFX_MODE_EXCLUDE_PLL; if (flags & 0x1000) gfx_display_mode.flags |= GFX_MODE_LOCK_TIMING; gfx_display_mode.hactive = hactive; gfx_display_mode.hblankstart = hblankstart; gfx_display_mode.hsyncstart = hsyncstart; gfx_display_mode.hsyncend = hsyncend; gfx_display_mode.hblankend = hblankend; gfx_display_mode.htotal = htotal; gfx_display_mode.vactive = vactive; gfx_display_mode.vblankstart = vblankstart; gfx_display_mode.vsyncstart = vsyncstart; gfx_display_mode.vsyncend = vsyncend; gfx_display_mode.vblankend = vblankend; gfx_display_mode.vtotal = vtotal; gfx_display_mode.frequency = frequency; /* CALL ROUTINE TO SET MODE */ return (gu2_set_specified_mode(&gfx_display_mode, bpp)); } /*---------------------------------------------------------------------------- * GFX_SET_VTOTAL * * This routine sets the display controller vertical total to * "vtotal". As a side effect it also sets vertical blank end. * It should be used when only this value needs to be changed, * due to speed considerations. * * Note: it is the caller's responsibility to make sure that * a legal vtotal is used, i.e. that "vtotal" is greater than or * equal to vsync end. * * Always returns 0. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_vtotal(unsigned short vtotal) #else int gfx_set_vtotal(unsigned short vtotal) #endif { unsigned long unlock, dcfg, vactive, vblank; /* UNLOCK THE DISPLAY CONTROLLER REGISTERS */ unlock = READ_REG32(MDC_UNLOCK); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); /* READ THE CURRENT RC VALUES */ dcfg = READ_REG32(MDC_DISPLAY_CFG); vactive = READ_REG32(MDC_V_ACTIVE_TIMING); vblank = READ_REG32(MDC_V_BLANK_TIMING); /* DISABLE TIMING REGISTER UPDATES */ WRITE_REG32(MDC_DISPLAY_CFG, dcfg & ~(unsigned long) MDC_DCFG_TRUP); /* WRITE NEW TIMING VALUES */ WRITE_REG32(MDC_V_ACTIVE_TIMING, (vactive & MDC_VAT_VA_MASK) | (unsigned long) (vtotal - 1) << 16); WRITE_REG32(MDC_V_BLANK_TIMING, (vblank & MDC_VBT_VBS_MASK) | (unsigned long) (vtotal - 1) << 16); /* RESTORE OLD RC VALUES */ WRITE_REG32(MDC_DISPLAY_CFG, dcfg); WRITE_REG32(MDC_UNLOCK, unlock); return (0); } /*--------------------------------------------------------------------------- * gfx_set_display_pitch * * This routine sets the pitch of the frame buffer to the specified value. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_display_pitch(unsigned short pitch) #else void gfx_set_display_pitch(unsigned short pitch) #endif { unsigned long value = 0; unsigned long lock = READ_REG32(MDC_UNLOCK); value = READ_REG32(MDC_GFX_PITCH) & 0xFFFF0000; value |= (pitch >> 3); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_GFX_PITCH, value); /* SET RENDERING PITCHES TO MATCH */ gfx_reset_pitch(pitch); /* SET THE FRAME DIRTY MODE */ /* Non-standard pitches, i.e. pitches that */ /* are not 1K, 2K or 4K must mark the entire */ /* frame as dirty when writing to the frame */ /* buffer. */ value = READ_REG32(MDC_GENERAL_CFG); if (pitch == 1024 || pitch == 2048 || pitch == 4096 || pitch == 8192) value &= ~(unsigned long) (MDC_GCFG_FDTY); else value |= (unsigned long) (MDC_GCFG_FDTY); WRITE_REG32(MDC_GENERAL_CFG, value); WRITE_REG32(MDC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_offset * * This routine sets the start address of the frame buffer. It is * typically used to pan across a virtual desktop (frame buffer larger than * the displayed screen) or to flip the display between multiple buffers. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_display_offset(unsigned long offset) #else void gfx_set_display_offset(unsigned long offset) #endif { /* UPDATE FRAME BUFFER OFFSET */ unsigned long lock; lock = READ_REG32(MDC_UNLOCK); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); /* START ADDRESS EFFECTS DISPLAY COMPRESSION */ /* Disable compression for non-zero start addresss values. */ /* Enable compression if offset is zero and comression is intended to */ /* be enabled from a previous call to "gfx_set_compression_enable". */ /* Compression should be disabled BEFORE the offset is changed */ /* and enabled AFTER the offset is changed. */ if (offset == 0) { WRITE_REG32(MDC_FB_ST_OFFSET, offset); if (gfx_compression_enabled) { /* WAIT FOR THE OFFSET TO BE LATCHED */ gfx_wait_vertical_blank(); gu2_enable_compression(); } } else { /* ONLY DISABLE COMPRESSION ONCE */ if (gfx_compression_active) gu2_disable_compression(); WRITE_REG32(MDC_FB_ST_OFFSET, offset); } WRITE_REG32(MDC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_palette_entry * * This routine sets an palette entry in the display controller. * A 32-bit X:R:G:B value. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_display_palette_entry(unsigned long index, unsigned long palette) #else int gfx_set_display_palette_entry(unsigned long index, unsigned long palette) #endif { unsigned long dcfg, unlock; if (index > 0xFF) return GFX_STATUS_BAD_PARAMETER; unlock = READ_REG32(MDC_UNLOCK); dcfg = READ_REG32(MDC_DISPLAY_CFG); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_DISPLAY_CFG, dcfg & ~MDC_DCFG_PALB); WRITE_REG32(MDC_UNLOCK, unlock); WRITE_REG32(MDC_PAL_ADDRESS, index); WRITE_REG32(MDC_PAL_DATA, palette); return GFX_STATUS_OK; } /*--------------------------------------------------------------------------- * gfx_set_display_palette * * This routine sets the entire palette in the display controller. * A pointer is provided to a 256 entry table of 32-bit X:R:G:B values. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_display_palette(unsigned long *palette) #else int gfx_set_display_palette(unsigned long *palette) #endif { unsigned long unlock, dcfg, i; WRITE_REG32(MDC_PAL_ADDRESS, 0); if (palette) { unlock = READ_REG32(MDC_UNLOCK); dcfg = READ_REG32(MDC_DISPLAY_CFG); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_DISPLAY_CFG, dcfg & ~MDC_DCFG_PALB); WRITE_REG32(MDC_UNLOCK, unlock); for (i = 0; i < 256; i++) WRITE_REG32(MDC_PAL_DATA, palette[i]); return GFX_STATUS_OK; } return GFX_STATUS_BAD_PARAMETER; } /*--------------------------------------------------------------------------- * gfx_set_cursor_enable * * This routine enables or disables the hardware cursor. * * WARNING: The cursor start offset must be set by setting the cursor * position before calling this routine to assure that memory reads do not * go past the end of graphics memory (this can hang GXm). *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_cursor_enable(int enable) #else void gfx_set_cursor_enable(int enable) #endif { unsigned long unlock, gcfg; /* SET OR CLEAR CURSOR ENABLE BIT */ unlock = READ_REG32(MDC_UNLOCK); gcfg = READ_REG32(MDC_GENERAL_CFG); if (enable) gcfg |= MDC_GCFG_CURE; else gcfg &= ~(MDC_GCFG_CURE); /* WRITE NEW REGISTER VALUE */ WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_GENERAL_CFG, gcfg); WRITE_REG32(MDC_UNLOCK, unlock); } /*--------------------------------------------------------------------------- * gfx_set_cursor_colors * * This routine sets the colors of the hardware cursor. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor) #else void gfx_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor) #endif { /* SET CURSOR COLORS */ WRITE_REG32(MDC_PAL_ADDRESS, 0x100); WRITE_REG32(MDC_PAL_DATA, bkcolor); WRITE_REG32(MDC_PAL_DATA, fgcolor); } /*--------------------------------------------------------------------------- * gfx_set_cursor_position * * This routine sets the position of the hardware cusror. The starting * offset of the cursor buffer must be specified so that the routine can * properly clip scanlines if the cursor is off the top of the screen. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_cursor_position(unsigned long memoffset, unsigned short xpos, unsigned short ypos, unsigned short xhotspot, unsigned short yhotspot) #else void gfx_set_cursor_position(unsigned long memoffset, unsigned short xpos, unsigned short ypos, unsigned short xhotspot, unsigned short yhotspot) #endif { unsigned long unlock; short x = (short) xpos - (short) xhotspot; short y = (short) ypos - (short) yhotspot; short xoffset = 0; short yoffset = 0; if (x < -63) return; if (y < -63) return; if (PanelEnable) { if ((ModeWidth > PanelWidth) || (ModeHeight > PanelHeight)) { gfx_enable_panning(xpos, ypos); x = x - (unsigned short) panelLeft; y = y - (unsigned short) panelTop; } } /* ADJUST OFFSETS */ /* Cursor movement and panning work as follows: The cursor position */ /* refers to where the hotspot of the cursor is located. However, for */ /* non-zero hotspots, the cursor buffer actually begins before the */ /* specified position. */ if (x < 0) { xoffset = -x; x = 0; } if (y < 0) { yoffset = -y; y = 0; } memoffset += (unsigned long) yoffset << 4; /* SET CURSOR POSITION */ unlock = READ_REG32(MDC_UNLOCK); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_CURS_ST_OFFSET, memoffset); WRITE_REG32(MDC_CURSOR_X, (unsigned long) x | (((unsigned long) xoffset) << 11)); WRITE_REG32(MDC_CURSOR_Y, (unsigned long) y | (((unsigned long) yoffset) << 11)); WRITE_REG32(MDC_UNLOCK, unlock); } /*--------------------------------------------------------------------------- * gfx_set_cursor_shape32 * * This routine loads 32x32 cursor data into the cursor buffer in graphics * memory. * As the Redcloud cursor is actually 64x64, we must pad the outside of the * cursor data with transparent pixels. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) #else void gfx_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) #endif { int i; for (i = 0; i < 32; i++) { /* EVEN QWORDS CONTAIN THE AND MASK */ WRITE_FB32(memoffset, 0xFFFFFFFF); WRITE_FB32(memoffset + 4, andmask[i]); /* ODD QWORDS CONTAIN THE XOR MASK */ WRITE_FB32(memoffset + 8, 0x00000000); WRITE_FB32(memoffset + 12, xormask[i]); memoffset += 16; } /* FILL THE LOWER HALF OF THE BUFFER WITH TRANSPARENT PIXELS */ for (i = 0; i < 32; i++) { WRITE_FB32(memoffset, 0xFFFFFFFF); WRITE_FB32(memoffset + 4, 0xFFFFFFFF); WRITE_FB32(memoffset + 8, 0x00000000); WRITE_FB32(memoffset + 12, 0x00000000); memoffset += 16; } } /*--------------------------------------------------------------------------- * gfx_set_cursor_shape64 * * This routine loads 64x64 cursor data into the cursor buffer in graphics * memory. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_cursor_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) #else void gfx_set_cursor_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask) #endif { int i; for (i = 0; i < 128; i += 2) { /* EVEN QWORDS CONTAIN THE AND MASK */ /* We invert the dwords to prevent the calling */ /* application from having to think in terms of Qwords. */ /* The hardware data order is actually 63:0, or 31:0 of */ /* the second dword followed by 31:0 of the first dword. */ WRITE_FB32(memoffset, andmask[i + 1]); WRITE_FB32(memoffset + 4, andmask[i]); /* ODD QWORDS CONTAIN THE XOR MASK */ WRITE_FB32(memoffset + 8, xormask[i + 1]); WRITE_FB32(memoffset + 12, xormask[i]); memoffset += 16; } } /*--------------------------------------------------------------------------- * gfx_set_icon_enable * * This routine enables or disables the hardware icon. The icon position * and colors should be programmed prior to calling this routine for the * first time. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_icon_enable(int enable) #else void gfx_set_icon_enable(int enable) #endif { unsigned long unlock, gcfg; /* SET OR CLEAR ICON ENABLE BIT */ unlock = READ_REG32(MDC_UNLOCK); gcfg = READ_REG32(MDC_GENERAL_CFG); if (enable) gcfg |= MDC_GCFG_ICNE; else gcfg &= ~(MDC_GCFG_ICNE); /* WRITE NEW REGISTER VALUE */ WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_GENERAL_CFG, gcfg); WRITE_REG32(MDC_UNLOCK, unlock); } /*--------------------------------------------------------------------------- * gfx_set_icon_colors * * This routine sets the three icon colors. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_icon_colors(unsigned long color0, unsigned long color1, unsigned long color2) #else void gfx_set_icon_colors(unsigned long color0, unsigned long color1, unsigned long color2) #endif { /* ICON COLORS LOCATED AT PALETTE INDEXES 102-104h */ WRITE_REG32(MDC_PAL_ADDRESS, 0x102); WRITE_REG32(MDC_PAL_DATA, color0); WRITE_REG32(MDC_PAL_DATA, color1); WRITE_REG32(MDC_PAL_DATA, color2); } /*--------------------------------------------------------------------------- * gfx_set_icon_position * * This routine sets the starting X coordinate for the hardware icon and the * memory offset for the icon buffer. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_icon_position(unsigned long memoffset, unsigned short xpos) #else void gfx_set_icon_position(unsigned long memoffset, unsigned short xpos) #endif { unsigned long lock = READ_REG32(MDC_UNLOCK); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); /* PROGRAM THE MEMORY OFFSET */ WRITE_REG32(MDC_ICON_ST_OFFSET, memoffset & 0x0FFFFFFF); /* PROGRAM THE XCOORDINATE */ WRITE_REG32(MDC_ICON_X, (unsigned long) (xpos & 0x07FF)); WRITE_REG32(MDC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_icon_shape64 * * This routine initializes the icon buffer according to the current mode. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_icon_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask, unsigned int lines) #else void gfx_set_icon_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask, unsigned int lines) #endif { unsigned short i, height; height = lines << 1; for (i = 0; i < height; i += 2) { /* EVEN QWORDS CONTAIN THE AND MASK */ /* Swap dwords to hide qword constraint */ WRITE_FB32(memoffset, andmask[i + 1]); WRITE_FB32(memoffset + 4, andmask[i]); /* ODD QWORDS CONTAIN THE XOR MASK */ WRITE_FB32(memoffset + 8, xormask[i + 1]); WRITE_FB32(memoffset + 12, xormask[i]); memoffset += 16; } } /*--------------------------------------------------------------------------- * gu2_enable_compression * * This is a private routine to this module (not exposed in the Durango API). * It enables display compression. *--------------------------------------------------------------------------- */ void gu2_enable_compression(void) { unsigned long unlock, gcfg, temp; /* DO NOT ENABLE IF START ADDRESS IS NOT ZERO */ if (READ_REG32(MDC_FB_ST_OFFSET) & 0x0FFFFFFF) return; /* SET GLOBAL INDICATOR */ gfx_compression_active = 1; /* CLEAR DIRTY/VALID BITS IN MEMORY CONTROLLER */ /* Software is required to do this before enabling compression. */ /* Don't want controller to think that old lines are still valid. */ /* Writing a 1 to bit 0 of the DV Control register will force the */ /* hardware to clear all the valid bits. */ temp = READ_REG32(MDC_DV_CTL); WRITE_REG32(MDC_DV_CTL, temp | 0x00000001); /* TURN ON COMPRESSION CONTROL BITS */ unlock = READ_REG32(MDC_UNLOCK); gcfg = READ_REG32(MDC_GENERAL_CFG); gcfg |= MDC_GCFG_CMPE | MDC_GCFG_DECE; WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_GENERAL_CFG, gcfg); WRITE_REG32(MDC_UNLOCK, unlock); } /*--------------------------------------------------------------------------- * gu2_disable_compression * * This is a private routine to this module (not exposed in the Durango API). * It disables display compression. *--------------------------------------------------------------------------- */ void gu2_disable_compression(void) { unsigned long unlock, gcfg; /* SET GLOBAL INDICATOR */ gfx_compression_active = 0; /* TURN OFF COMPRESSION CONTROL BITS */ unlock = READ_REG32(MDC_UNLOCK); gcfg = READ_REG32(MDC_GENERAL_CFG); gcfg &= ~(MDC_GCFG_CMPE | MDC_GCFG_DECE); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_GENERAL_CFG, gcfg); WRITE_REG32(MDC_UNLOCK, unlock); } /*--------------------------------------------------------------------------- * gfx_set_compression_enable * * This routine enables or disables display compression. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_compression_enable(int enable) #else int gfx_set_compression_enable(int enable) #endif { /* SET GLOBAL VARIABLE FOR INDENDED STATE */ /* Compression can only be enabled for non-zero start address values. */ /* Keep state to enable compression on start address changes. */ gfx_compression_enabled = enable; if (enable) gu2_enable_compression(); else gu2_disable_compression(); return (0); } /*--------------------------------------------------------------------------- * gfx_set_compression_offset * * This routine sets the base offset for the compression buffer. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_compression_offset(unsigned long offset) #else int gfx_set_compression_offset(unsigned long offset) #endif { unsigned long lock; /* MUST BE 16-BYTE ALIGNED FOR REDCLOUD */ if (offset & 0x0F) return (1); /* SET REGISTER VALUE */ lock = READ_REG32(MDC_UNLOCK); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_CB_ST_OFFSET, offset & 0x0FFFFFFF); WRITE_REG32(MDC_UNLOCK, lock); return (0); } /*--------------------------------------------------------------------------- * gfx_set_compression_pitch * * This routine sets the pitch, in bytes, of the compression buffer. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_compression_pitch(unsigned short pitch) #else int gfx_set_compression_pitch(unsigned short pitch) #endif { unsigned long lock, line_delta; lock = READ_REG32(MDC_UNLOCK); /* SET REGISTER VALUE */ line_delta = READ_REG32(MDC_GFX_PITCH) & 0x0000FFFF; line_delta |= (((unsigned long) pitch << 13) & 0xFFFF0000); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_GFX_PITCH, line_delta); WRITE_REG32(MDC_UNLOCK, lock); return (0); } /*--------------------------------------------------------------------------- * gfx_set_compression_size * * This routine sets the line size of the compression buffer, which is the * maximum number of bytes allowed to store a compressed line. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_compression_size(unsigned short size) #else int gfx_set_compression_size(unsigned short size) #endif { unsigned long lock, buf_size; /* SUBTRACT 32 FROM SIZE */ /* The display controller will actually write */ /* 4 extra QWords. So, if we assume that "size" */ /* refers to the allocated size, we must subtract */ /* 32 bytes. */ size -= 32; /* SET REGISTER VALUE */ lock = READ_REG32(MDC_UNLOCK); buf_size = READ_REG32(MDC_LINE_SIZE) & 0xFF80FFFF; buf_size |= ((((unsigned long) size >> 3) + 1) & 0x7F) << 16; WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_LINE_SIZE, buf_size); WRITE_REG32(MDC_UNLOCK, lock); return (0); } /*--------------------------------------------------------------------------- * gfx_set_display_video_format (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_format". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_display_video_format(unsigned long format) #else void gfx_set_display_video_format(unsigned long format) #endif { unsigned long gcfg, lock; lock = READ_REG32(MDC_UNLOCK); gcfg = READ_REG32(MDC_GENERAL_CFG); switch (format) { case VIDEO_FORMAT_Y0Y1Y2Y3: case VIDEO_FORMAT_Y3Y2Y1Y0: case VIDEO_FORMAT_Y1Y0Y3Y2: case VIDEO_FORMAT_Y1Y2Y3Y0: gcfg |= MDC_GCFG_YUVM; break; default: gcfg &= ~MDC_GCFG_YUVM; break; } WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_GENERAL_CFG, gcfg); WRITE_REG32(MDC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_video_enable (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_enable". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_display_video_enable(int enable) #else void gfx_set_display_video_enable(int enable) #endif { unsigned long lock, gcfg, dcfg; /* READ CURRENT VALUES */ lock = READ_REG32(MDC_UNLOCK); gcfg = READ_REG32(MDC_GENERAL_CFG); dcfg = READ_REG32(MDC_DISPLAY_CFG); /* SET OR CLEAR VIDEO ENABLE IN GENERAL_CFG */ if (enable) gcfg |= MDC_GCFG_VIDE; else gcfg &= ~MDC_GCFG_VIDE; /* WRITE REGISTER */ WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_GENERAL_CFG, gcfg); WRITE_REG32(MDC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_video_size (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_size". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_display_video_size(unsigned short width, unsigned short height) #else void gfx_set_display_video_size(unsigned short width, unsigned short height) #endif { unsigned long lock, value, yuv_420; /* READ CURRENT VALUES */ lock = READ_REG32(MDC_UNLOCK); value = READ_REG32(MDC_LINE_SIZE) & 0x00FFFFFF; yuv_420 = READ_REG32(MDC_GENERAL_CFG) & MDC_GCFG_YUVM; /* LINE WIDTH IS 1/4 FOR 4:2:0 VIDEO */ /* All data must be 32-byte aligned. */ if (yuv_420) { width >>= 1; width = (width + 7) & 0xFFF8; } else { width <<= 1; width = (width + 31) & 0xFFE0; } /* ONLY THE LINE SIZE IS PROGRAMMED IN THE DISPLAY CONTROLLER */ value |= ((unsigned long) width << 21); /* WRITE THE REGISTER */ WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_LINE_SIZE, value); WRITE_REG32(MDC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_video_offset (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_offset". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_display_video_offset(unsigned long offset) #else void gfx_set_display_video_offset(unsigned long offset) #endif { unsigned long lock; lock = READ_REG32(MDC_UNLOCK); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); offset &= 0x0FFFFFF0; WRITE_REG32(MDC_VID_Y_ST_OFFSET, offset); WRITE_REG32(MDC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_video_yuv_offsets (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by gfx_set_video_yuv_offsets. It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_display_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset) #else void gfx_set_display_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset) #endif { unsigned long lock; lock = READ_REG32(MDC_UNLOCK); yoffset &= 0x0FFFFFF0; uoffset &= 0x0FFFFFF8; voffset &= 0x0FFFFFF8; WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_VID_Y_ST_OFFSET, yoffset); WRITE_REG32(MDC_VID_U_ST_OFFSET, uoffset); WRITE_REG32(MDC_VID_V_ST_OFFSET, voffset); WRITE_REG32(MDC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_video_yuv_pitch (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by gfx_set_video_yuv_pitch. It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_display_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch) #else void gfx_set_display_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch) #endif { unsigned long lock, pitch; lock = READ_REG32(MDC_UNLOCK); pitch = ((uvpitch << 13) & 0xFFFF0000) | ((ypitch >> 3) & 0xFFFF); WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_VID_YUV_PITCH, pitch); WRITE_REG32(MDC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_video_downscale (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by gfx_set_video_vertical_downscale. It abstracts * the version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_display_video_downscale(unsigned short srch, unsigned short dsth) #else void gfx_set_display_video_downscale(unsigned short srch, unsigned short dsth) #endif { unsigned long lock, delta; lock = READ_REG32(MDC_UNLOCK); /* CLIP SCALING LIMITS */ /* Upscaling is performed in a separate function. */ /* Maximum scale ratio is 1/2. */ if (dsth > srch || dsth <= (srch >> 1)) delta = 0; else delta = (((unsigned long) srch << 14) / (unsigned long) dsth) << 18; WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_VID_DS_DELTA, delta); WRITE_REG32(MDC_UNLOCK, lock); } /*--------------------------------------------------------------------------- * gfx_set_display_video_downscale_enable (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_set_video_vertical_downscale_enable". * It abstracts the version of the display controller from the video overlay * routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_set_display_video_vertical_downscale_enable(int enable) #else void gfx_set_display_video_vertical_downscale_enable(int enable) #endif { unsigned long gcfg, unlock; unlock = READ_REG32(MDC_UNLOCK); gcfg = READ_REG32(MDC_GENERAL_CFG); if (enable) gcfg |= MDC_GCFG_VDSE; else gcfg &= ~MDC_GCFG_VDSE; WRITE_REG32(MDC_UNLOCK, MDC_UNLOCK_VALUE); WRITE_REG32(MDC_GENERAL_CFG, gcfg); WRITE_REG32(MDC_UNLOCK, unlock); } /*--------------------------------------------------------------------------- * gfx_test_timing_active *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_test_timing_active(void) #else int gfx_test_timing_active(void) #endif { if (READ_REG32(MDC_DISPLAY_CFG) & MDC_DCFG_TGEN) return (1); else return (0); } /*--------------------------------------------------------------------------- * gfx_test_vertical_active *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_test_vertical_active(void) #else int gfx_test_vertical_active(void) #endif { if (READ_REG32(MDC_LINE_CNT_STATUS) & MDC_LNCNT_VNA) return (0); return (1); } /*--------------------------------------------------------------------------- * gfx_wait_vertical_blank *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_wait_vertical_blank(void) #else int gfx_wait_vertical_blank(void) #endif { if (gfx_test_timing_active()) { while (!gfx_test_vertical_active()); while (gfx_test_vertical_active()); } return (0); } /*--------------------------------------------------------------------------- * gfx_enable_panning * * This routine enables the panning when the Mode is bigger than the panel * size. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_enable_panning(int x, int y) #else void gfx_enable_panning(int x, int y) #endif { unsigned long modeBytesPerPixel; unsigned long modeBytesPerScanline = 0; unsigned long startAddress = 0; modeBytesPerPixel = (gbpp + 7) / 8; modeBytesPerScanline = (READ_REG32(MDC_GFX_PITCH) & 0x0000FFFF) << 3; /* TEST FOR NO-WORK */ if (x >= DeltaX && x < ((int) PanelWidth + DeltaX) && y >= DeltaY && y < ((int) PanelHeight + DeltaY)) return; /* ADJUST PANNING VARIABLES WHEN CURSOR EXCEEDS BOUNDARY */ /* Test the boundary conditions for each coordinate and update */ /* all variables and the starting offset accordingly. */ if (x < DeltaX) DeltaX = x; else if (x >= (DeltaX + (int) PanelWidth)) DeltaX = x - (int) PanelWidth + 1; if (y < DeltaY) DeltaY = y; else if (y >= (DeltaY + (int) PanelHeight)) DeltaY = y - (int) PanelHeight + 1; /* CALCULATE THE START OFFSET */ startAddress = (DeltaX * modeBytesPerPixel) + (DeltaY * modeBytesPerScanline); gfx_set_display_offset(startAddress); /* SET PANEL COORDINATES */ /* Panel's x position must be DWORD aligned */ panelTop = DeltaY; panelLeft = DeltaX * modeBytesPerPixel; if (panelLeft & 3) panelLeft = (panelLeft & 0xFFFFFFFC) + 4; panelLeft /= modeBytesPerPixel; } /*--------------------------------------------------------------------------- * gfx_is_panel_mode_supported *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_is_panel_mode_supported(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) #else int gfx_is_panel_mode_supported(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) #endif { unsigned int mode; /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */ for (mode = 0; mode < NUM_FIXED_TIMINGS_MODES; mode++) { if ((FixedParams[mode].xres == width) && (FixedParams[mode].yres == height) && (FixedParams[mode].panelresx == panelResX) && (FixedParams[mode].panelresy == panelResY)) { return ((int) mode); } } return -1; } /*--------------------------------------------------------------------------- * gfx_set_fixed_timings *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_fixed_timings(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) #else int gfx_set_fixed_timings(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) #endif { unsigned int mode; ModeWidth = width; ModeHeight = height; PanelWidth = (unsigned short) panelResX; PanelHeight = (unsigned short) panelResY; PanelEnable = 1; /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */ for (mode = 0; mode < NUM_FIXED_TIMINGS_MODES; mode++) { if ((FixedParams[mode].xres == width) && (FixedParams[mode].yres == height) && (FixedParams[mode].panelresx == panelResX) && (FixedParams[mode].panelresy == panelResY)) { /* SET THE 92xx FOR THE SELECTED MODE */ FIXEDTIMINGS *fmode = &FixedParams[mode]; gfx_set_display_timings(bpp, 3, fmode->hactive, fmode->hblankstart, fmode->hsyncstart, fmode->hsyncend, fmode->hblankend, fmode->htotal, fmode->vactive, fmode->vblankstart, fmode->vsyncstart, fmode->vsyncend, fmode->vblankend, fmode->vtotal, fmode->frequency); return (1); } /* end if() */ } /* end for() */ return (-1); } /*--------------------------------------------------------------------------- * gfx_set_panel_present *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_set_panel_present(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) #else int gfx_set_panel_present(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp) #endif { /* SET VALID BPP */ /* 16BPP is the default. */ if (bpp != 8 && bpp != 12 && bpp != 15 && bpp != 16 && bpp != 32) bpp = 16; /* RECORD PANEL PARAMETERS */ /* This routine does not touch any panel timings. It is used when custom * panel settings are set up in advance by the BIOS or an application, but * the application still requires access to other panel functionality * provided by Durango (i.e. panning). * */ ModeWidth = width; ModeHeight = height; PanelWidth = (unsigned short) panelResX; PanelHeight = (unsigned short) panelResY; PanelEnable = 1; gbpp = bpp; /* PROGRAM THE BPP IN THE DISPLAY CONTROLLER */ gfx_set_display_bpp(bpp); return (GFX_STATUS_OK); } /* THE FOLLOWING READ ROUTINES ARE ALWAYS INCLUDED: */ /*--------------------------------------------------------------------------- * gfx_get_display_pitch * * This routine returns the current pitch of the frame buffer, in bytes. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_display_pitch(void) #else unsigned short gfx_get_display_pitch(void) #endif { return ((unsigned short) (READ_REG32(MDC_GFX_PITCH) & 0x0000FFFF) << 3); } /*---------------------------------------------------------------------------- * gfx_mode_frequency_supported * * This routine examines if the requested mode with pixel frequency is * supported. * * Returns >0 if successful , <0 if freq. could not be found and matched. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_mode_frequency_supported(int xres, int yres, int bpp, unsigned long frequency) #else int gfx_mode_frequency_supported(int xres, int yres, int bpp, unsigned long frequency) #endif { unsigned int index; unsigned long value; unsigned long bpp_flag = 0; gfx_mode_bpp_conversion_def(bpp) for (index = 0; index < NUM_RC_DISPLAY_MODES; index++) { if ((DisplayParams[index].hactive == (unsigned int) xres) && (DisplayParams[index].vactive == (unsigned int) yres) && (DisplayParams[index].flags & bpp_flag) && (DisplayParams[index].frequency == frequency)) { int hz = 0; value = DisplayParams[index].flags; if (value & GFX_MODE_56HZ) hz = 56; else if (value & GFX_MODE_60HZ) hz = 60; else if (value & GFX_MODE_70HZ) hz = 70; else if (value & GFX_MODE_72HZ) hz = 72; else if (value & GFX_MODE_75HZ) hz = 75; else if (value & GFX_MODE_85HZ) hz = 85; else if (value & GFX_MODE_90HZ) hz = 90; else if (value & GFX_MODE_100HZ) hz = 100; return (hz); } } return (-1); } /*---------------------------------------------------------------------------- * gfx_refreshrate_from_frequency * * This routine maps the frequency to close match refresh rate *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_get_refreshrate_from_frequency(int xres, int yres, int bpp, int *hz, unsigned long frequency) #else int gfx_get_refreshrate_from_frequency(int xres, int yres, int bpp, int *hz, unsigned long frequency) #endif { unsigned int index, closematch = 0; unsigned long value; unsigned long bpp_flag = 0; long min, diff; *hz = 60; gfx_mode_bpp_conversion_def(bpp) /* FIND THE REGISTER VALUES FOR THE DESIRED FREQUENCY */ /* Search the table for the closest frequency (16.16 format). */ min = 0x7fffffff; for (index = 0; index < NUM_RC_DISPLAY_MODES; index++) { if ((DisplayParams[index].htotal == (unsigned int) xres) && (DisplayParams[index].vtotal == (unsigned int) yres) && (DisplayParams[index].flags & bpp_flag)) { diff = (long) frequency - (long) DisplayParams[index].frequency; if (diff < 0) diff = -diff; if (diff < min) { min = diff; closematch = index; } } } value = DisplayParams[closematch].flags; if (value & GFX_MODE_56HZ) *hz = 56; else if (value & GFX_MODE_60HZ) *hz = 60; else if (value & GFX_MODE_70HZ) *hz = 70; else if (value & GFX_MODE_72HZ) *hz = 72; else if (value & GFX_MODE_75HZ) *hz = 75; else if (value & GFX_MODE_85HZ) *hz = 85; else if (value & GFX_MODE_90HZ) *hz = 90; else if (value & GFX_MODE_100HZ) *hz = 100; return (1); } /*---------------------------------------------------------------------------- * gfx_refreshrate_from_mode * * This routine is identical to the gfx_get_refreshrate_from_frequency, * except that the active timing values are compared instead of the total * values. Some modes (such as 70Hz and 72Hz) may be confused in this routine *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz, unsigned long frequency) #else int gfx_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz, unsigned long frequency) #endif { unsigned int index, closematch = 0; unsigned long value; unsigned long bpp_flag = 0; long min, diff; *hz = 60; gfx_mode_bpp_conversion_def(bpp) /* FIND THE REGISTER VALUES FOR THE DESIRED FREQUENCY */ /* Search the table for the closest frequency (16.16 format). */ min = 0x7fffffff; for (index = 0; index < NUM_RC_DISPLAY_MODES; index++) { if ((DisplayParams[index].hactive == (unsigned int) xres) && (DisplayParams[index].vactive == (unsigned int) yres) && (DisplayParams[index].flags & bpp_flag)) { diff = (long) frequency - (long) DisplayParams[index].frequency; if (diff < 0) diff = -diff; if (diff < min) { min = diff; closematch = index; } } } value = DisplayParams[closematch].flags; if (value & GFX_MODE_56HZ) *hz = 56; else if (value & GFX_MODE_60HZ) *hz = 60; else if (value & GFX_MODE_70HZ) *hz = 70; else if (value & GFX_MODE_72HZ) *hz = 72; else if (value & GFX_MODE_75HZ) *hz = 75; else if (value & GFX_MODE_85HZ) *hz = 85; else if (value & GFX_MODE_90HZ) *hz = 90; else if (value & GFX_MODE_100HZ) *hz = 100; return (1); } /*---------------------------------------------------------------------------- * gfx_get_frequency_from_refreshrate * * This routine maps the refresh rate to the closest matching PLL frequency. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_get_frequency_from_refreshrate(int xres, int yres, int bpp, int hz, int *frequency) #else int gfx_get_frequency_from_refreshrate(int xres, int yres, int bpp, int hz, int *frequency) #endif { unsigned int index; int retval = -1; unsigned long hz_flag = 0; unsigned long bpp_flag = 0; *frequency = 0; gfx_mode_hz_conversion gfx_mode_bpp_conversion_def(bpp) /* FIND THE REGISTER VALUES FOR THE DESIRED FREQUENCY */ /* Search the table for the closest frequency (16.16 format). */ for (index = 0; index < NUM_RC_DISPLAY_MODES; index++) { if ((DisplayParams[index].hactive == (unsigned short) xres) && (DisplayParams[index].vactive == (unsigned short) yres) && (DisplayParams[index].flags & bpp_flag) && (DisplayParams[index].flags & hz_flag)) { *frequency = DisplayParams[index].frequency; retval = 1; } } return retval; } /*--------------------------------------------------------------------------- * gfx_get_max_supported_pixel_clock * * This routine returns the maximum recommended speed for the pixel clock. The * return value is an integer of the format xxxyyy, where xxx.yyy is the * maximum floating point pixel clock speed. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_max_supported_pixel_clock(void) #else unsigned long gfx_get_max_supported_pixel_clock(void) #endif { return 229500; } /*---------------------------------------------------------------------------- * gfx_get_display_mode * * This routine gets the specified display mode. * * Returns >0 if successful and mode returned, <0 if mode could not be found. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_get_display_mode(int *xres, int *yres, int *bpp, int *hz) #else int gfx_get_display_mode(int *xres, int *yres, int *bpp, int *hz) #endif { unsigned int mode = 0; unsigned long pll_freq = 0, bpp_flag = 0; *xres = gfx_get_hactive(); *yres = gfx_get_vactive(); *bpp = gfx_get_display_bpp(); pll_freq = gfx_get_clock_frequency(); /* SET BPP FLAGS TO LIMIT MODE SELECTION */ gfx_mode_bpp_conversion_def(*bpp) for (mode = 0; mode < NUM_RC_DISPLAY_MODES; mode++) { if ((DisplayParams[mode].hactive == (unsigned int) *xres) && (DisplayParams[mode].vactive == (unsigned int) *yres) && (DisplayParams[mode].frequency == pll_freq) && (DisplayParams[mode].flags & bpp_flag)) { pll_freq = DisplayParams[mode].flags; if (pll_freq & GFX_MODE_56HZ) *hz = 56; else if (pll_freq & GFX_MODE_60HZ) *hz = 60; else if (pll_freq & GFX_MODE_70HZ) *hz = 70; else if (pll_freq & GFX_MODE_72HZ) *hz = 72; else if (pll_freq & GFX_MODE_75HZ) *hz = 75; else if (pll_freq & GFX_MODE_85HZ) *hz = 85; else if (pll_freq & GFX_MODE_90HZ) *hz = 90; else if (pll_freq & GFX_MODE_100HZ) *hz = 100; return (1); } } return (-1); } /*---------------------------------------------------------------------------- * GFX_GET_DISPLAY_DETAILS * * This routine gets the specified display mode. * * Returns 1 if successful, 0 if mode could not be get. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_get_display_details(unsigned int mode, int *xres, int *yres, int *hz) #else int gfx_get_display_details(unsigned int mode, int *xres, int *yres, int *hz) #endif { if (mode < NUM_RC_DISPLAY_MODES) { if (DisplayParams[mode].flags & GFX_MODE_56HZ) *hz = 56; else if (DisplayParams[mode].flags & GFX_MODE_60HZ) *hz = 60; else if (DisplayParams[mode].flags & GFX_MODE_70HZ) *hz = 70; else if (DisplayParams[mode].flags & GFX_MODE_72HZ) *hz = 72; else if (DisplayParams[mode].flags & GFX_MODE_75HZ) *hz = 75; else if (DisplayParams[mode].flags & GFX_MODE_85HZ) *hz = 85; else if (DisplayParams[mode].flags & GFX_MODE_90HZ) *hz = 90; else if (DisplayParams[mode].flags & GFX_MODE_100HZ) *hz = 100; *xres = DisplayParams[mode].hactive; *yres = DisplayParams[mode].vactive; if (DisplayParams[mode].flags & GFX_MODE_PIXEL_DOUBLE) *xres >>= 1; if (DisplayParams[mode].flags & GFX_MODE_LINE_DOUBLE) *yres >>= 1; return (1); } return (0); } /*---------------------------------------------------------------------------- * GFX_GET_DISPLAY_MODE_COUNT * * This routine gets the number of available display modes. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_get_display_mode_count(void) #else int gfx_get_display_mode_count(void) #endif { return (NUM_RC_DISPLAY_MODES); } /*---------------------------------------------------------------------------- * gfx_get_frame_buffer_line_size * * Returns the current frame buffer line size, in bytes *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_frame_buffer_line_size(void) #else unsigned long gfx_get_frame_buffer_line_size(void) #endif { return ((READ_REG32(MDC_LINE_SIZE) & 0x7FF) << 3); } /*--------------------------------------------------------------------------- * gfx_get_hactive *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_hactive(void) #else unsigned short gfx_get_hactive(void) #endif { return ((unsigned short) ((READ_REG32(MDC_H_ACTIVE_TIMING) & 0x0FF8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_hsync_start *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_hsync_start(void) #else unsigned short gfx_get_hsync_start(void) #endif { return ((unsigned short) ((READ_REG32(MDC_H_SYNC_TIMING) & 0x0FF8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_hsync_end *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_hsync_end(void) #else unsigned short gfx_get_hsync_end(void) #endif { return ((unsigned short) (((READ_REG32(MDC_H_SYNC_TIMING) >> 16) & 0x0FF8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_htotal *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_htotal(void) #else unsigned short gfx_get_htotal(void) #endif { return ((unsigned short) (((READ_REG32(MDC_H_ACTIVE_TIMING) >> 16) & 0x0FF8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_vactive *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_vactive(void) #else unsigned short gfx_get_vactive(void) #endif { return ((unsigned short) ((READ_REG32(MDC_V_ACTIVE_TIMING) & 0x07FF) + 1)); } /*--------------------------------------------------------------------------- * gfx_get_vsync_end *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_vsync_end(void) #else unsigned short gfx_get_vsync_end(void) #endif { return ((unsigned short) (((READ_REG32(MDC_V_SYNC_TIMING) >> 16) & 0x07FF) + 1)); } /*--------------------------------------------------------------------------- * gfx_get_vtotal *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_vtotal(void) #else unsigned short gfx_get_vtotal(void) #endif { return ((unsigned short) (((READ_REG32(MDC_V_ACTIVE_TIMING) >> 16) & 0x07FF) + 1)); } /*---------------------------------------------------------------------------- * gfx_get_display_bpp * * This routine returns the current color depth of the active display. *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_display_bpp(void) #else unsigned short gfx_get_display_bpp(void) #endif { unsigned long dcfg = READ_REG32(MDC_DISPLAY_CFG); switch ((dcfg & MDC_DCFG_DISP_MODE_MASK) >> 8) { case 0: return (8); case 2: return (32); case 1: switch ((dcfg & MDC_DCFG_16BPP_MODE_MASK) >> 10) { case 0: return (16); case 1: return (15); case 2: return (12); default: return (0); } } /* INVALID SETTING */ return (0); } /*--------------------------------------------------------------------------- * gfx_get_vline *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_vline(void) #else unsigned short gfx_get_vline(void) #endif { unsigned short current_scan_line; /* Read similar value twice to ensure that the value is not * transitioning */ do current_scan_line = (unsigned short) (READ_REG32(MDC_LINE_CNT_STATUS) & MDC_LNCNT_V_LINE_CNT); while (current_scan_line != (unsigned short) (READ_REG32(MDC_LINE_CNT_STATUS) & MDC_LNCNT_V_LINE_CNT)); return (current_scan_line >> 16); } /*----------------------------------------------------------------------------- * gfx_get_display_offset *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_display_offset(void) #else unsigned long gfx_get_display_offset(void) #endif { return (READ_REG32(MDC_FB_ST_OFFSET) & 0x0FFFFFFF); } /*----------------------------------------------------------------------------- * gfx_get_cursor_offset *----------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_cursor_offset(void) #else unsigned long gfx_get_cursor_offset(void) #endif { return (READ_REG32(MDC_CURS_ST_OFFSET) & 0x0FFFFFFF); } #if GFX_READ_ROUTINES /*************************************************************/ /* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ /*************************************************************/ /*--------------------------------------------------------------------------- * gfx_get_hblank_start *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_hblank_start(void) #else unsigned short gfx_get_hblank_start(void) #endif { return ((unsigned short) ((READ_REG32(MDC_H_BLANK_TIMING) & 0x0FF8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_hblank_end *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_hblank_end(void) #else unsigned short gfx_get_hblank_end(void) #endif { return ((unsigned short) (((READ_REG32(MDC_H_BLANK_TIMING) >> 16) & 0x0FF8) + 8)); } /*--------------------------------------------------------------------------- * gfx_get_vblank_start *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_vblank_start(void) #else unsigned short gfx_get_vblank_start(void) #endif { return ((unsigned short) ((READ_REG32(MDC_V_BLANK_TIMING) & 0x07FF) + 1)); } /*--------------------------------------------------------------------------- * gfx_get_vsync_start *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_vsync_start(void) #else unsigned short gfx_get_vsync_start(void) #endif { return ((unsigned short) ((READ_REG32(MDC_V_SYNC_TIMING) & 0x07FF) + 1)); } /*--------------------------------------------------------------------------- * gfx_get_vblank_end *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_vblank_end(void) #else unsigned short gfx_get_vblank_end(void) #endif { return ((unsigned short) (((READ_REG32(MDC_V_BLANK_TIMING) >> 16) & 0x07FF) + 1)); } /*---------------------------------------------------------------------------- * gfx_get_display_palette_entry *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_get_display_palette_entry(unsigned long index, unsigned long *palette) #else int gfx_get_display_palette_entry(unsigned long index, unsigned long *palette) #endif { if (index > 0xFF) return GFX_STATUS_BAD_PARAMETER; WRITE_REG32(MDC_PAL_ADDRESS, index); *palette = READ_REG32(MDC_PAL_DATA); return 0; } /*---------------------------------------------------------------------------- * gfx_get_display_palette *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_get_display_palette(unsigned long *palette) #else void gfx_get_display_palette(unsigned long *palette) #endif { unsigned long i; WRITE_REG32(MDC_PAL_ADDRESS, 0); for (i = 0; i < 256; i++) { palette[i] = READ_REG32(MDC_PAL_DATA); } } /*---------------------------------------------------------------------------- * gfx_get_cursor_enable *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_cursor_enable(void) #else unsigned long gfx_get_cursor_enable(void) #endif { return (READ_REG32(MDC_GENERAL_CFG) & MDC_GCFG_CURE); } /*---------------------------------------------------------------------------- * gfx_get_cursor_position *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_cursor_position(void) #else unsigned long gfx_get_cursor_position(void) #endif { return ((READ_REG32(MDC_CURSOR_X) & 0x07FF) | ((READ_REG32(MDC_CURSOR_Y) << 16) & 0x07FF0000)); } /*---------------------------------------------------------------------------- * gfx_get_cursor_offset *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_cursor_clip(void) #else unsigned long gfx_get_cursor_clip(void) #endif { return (((READ_REG32(MDC_CURSOR_X) >> 11) & 0x03F) | ((READ_REG32(MDC_CURSOR_Y) << 5) & 0x3F0000)); } /*---------------------------------------------------------------------------- * gfx_get_cursor_color *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_cursor_color(int color) #else unsigned long gfx_get_cursor_color(int color) #endif { if (color) { WRITE_REG32(MDC_PAL_ADDRESS, 0x101); } else { WRITE_REG32(MDC_PAL_ADDRESS, 0x100); } return READ_REG32(MDC_PAL_DATA); } /*---------------------------------------------------------------------------- * gfx_get_icon_enable *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_icon_enable(void) #else unsigned long gfx_get_icon_enable(void) #endif { return (READ_REG32(MDC_GENERAL_CFG) & MDC_GCFG_ICNE); } /*---------------------------------------------------------------------------- * gfx_get_icon_offset *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_icon_offset(void) #else unsigned long gfx_get_icon_offset(void) #endif { return (READ_REG32(MDC_ICON_ST_OFFSET) & 0x0FFFFFFF); } /*---------------------------------------------------------------------------- * gfx_get_icon_position *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_icon_position(void) #else unsigned long gfx_get_icon_position(void) #endif { return (READ_REG32(MDC_ICON_X) & 0x07FF); } /*---------------------------------------------------------------------------- * gfx_get_icon_color *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_icon_color(int color) #else unsigned long gfx_get_icon_color(int color) #endif { if (color >= 3) return 0; WRITE_REG32(MDC_PAL_ADDRESS, 0x102 + color); return READ_REG32(MDC_PAL_DATA); } /*---------------------------------------------------------------------------- * gfx_get_compression_enable *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_get_compression_enable(void) #else int gfx_get_compression_enable(void) #endif { if (READ_REG32(MDC_GENERAL_CFG) & MDC_GCFG_CMPE) return (1); return (0); } /*---------------------------------------------------------------------------- * gfx_get_compression_offset *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_compression_offset(void) #else unsigned long gfx_get_compression_offset(void) #endif { return (READ_REG32(MDC_CB_ST_OFFSET) & 0x007FFFFF); } /*---------------------------------------------------------------------------- * gfx_get_compression_pitch *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_compression_pitch(void) #else unsigned short gfx_get_compression_pitch(void) #endif { unsigned short pitch; pitch = (unsigned short) (READ_REG32(MDC_GFX_PITCH) >> 16); return (pitch << 3); } /*---------------------------------------------------------------------------- * gfx_get_compression_size *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned short gu2_get_compression_size(void) #else unsigned short gfx_get_compression_size(void) #endif { unsigned short size; size = (unsigned short) ((READ_REG32(MDC_LINE_SIZE) >> 16) & 0x7F) - 1; return ((size << 3) + 32); } /*---------------------------------------------------------------------------- * gfx_get_valid_bit *---------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_get_valid_bit(int line) #else int gfx_get_valid_bit(int line) #endif { unsigned long offset; int valid; offset = READ_REG32(MDC_PHY_MEM_OFFSET) & 0xFF000000; offset |= line; WRITE_REG32(MDC_PHY_MEM_OFFSET, offset); valid = (int) READ_REG32(MDC_DV_ACC) & 2; if (valid) return 1; return 0; } /*--------------------------------------------------------------------------- * gfx_get_display_video_offset (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_get_video_offset". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_display_video_offset(void) #else unsigned long gfx_get_display_video_offset(void) #endif { return (READ_REG32(MDC_VID_Y_ST_OFFSET) & 0x0FFFFFFF); } /*--------------------------------------------------------------------------- * gfx_get_display_video_yuv_offsets (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_get_video_yuv_offsets". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_get_display_video_yuv_offsets(unsigned long *yoffset, unsigned long *uoffset, unsigned long *voffset) #else void gfx_get_display_video_yuv_offsets(unsigned long *yoffset, unsigned long *uoffset, unsigned long *voffset) #endif { *yoffset = (READ_REG32(MDC_VID_Y_ST_OFFSET) & 0x0FFFFFFF); *uoffset = (READ_REG32(MDC_VID_U_ST_OFFSET) & 0x0FFFFFFF); *voffset = (READ_REG32(MDC_VID_V_ST_OFFSET) & 0x0FFFFFFF); } /*--------------------------------------------------------------------------- * gfx_get_display_video_yuv_pitch (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_get_video_yuv_pitch". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC void gu2_get_display_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch) #else void gfx_get_display_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch) #endif { unsigned long pitch = READ_REG32(MDC_VID_YUV_PITCH); *ypitch = ((pitch & 0xFFFF) << 3); *uvpitch = (pitch >> 13) & 0x7FFF8; } /*--------------------------------------------------------------------------- * gfx_get_display_video_downscale_delta (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_get_video_downscale_delta". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_display_video_downscale_delta(void) #else unsigned long gfx_get_display_video_downscale_delta(void) #endif { return (READ_REG32(MDC_VID_DS_DELTA) >> 18); } /*--------------------------------------------------------------------------- * gfx_get_display_video_downscale_enable (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_get_video_vertical_downscale_enable". * It abstracts the version of the display controller from the video overlay * routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC int gu2_get_display_video_downscale_enable(void) #else int gfx_get_display_video_downscale_enable(void) #endif { return ((int) ((READ_REG32(MDC_GENERAL_CFG) >> 19) & 1)); } /*--------------------------------------------------------------------------- * gfx_get_display_video_size (PRIVATE ROUTINE - NOT PART OF API) * * This routine is called by "gfx_get_video_size". It abstracts the * version of the display controller from the video overlay routines. *--------------------------------------------------------------------------- */ #if GFX_DISPLAY_DYNAMIC unsigned long gu2_get_display_video_size(void) #else unsigned long gfx_get_display_video_size(void) #endif { /* RETURN THE LINE SIZE, AS THIS IS ALL THAT IS AVAILABLE */ return ((READ_REG32(MDC_LINE_SIZE) >> 21) & 0x000007FF); } #endif /* GFX_READ_ROUTINES */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/vip_1200.c0000644000175000017500000004361212654445443014565 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to control the SC1200 video input port (VIP) * hardware. * */ /*---------------------------------------------------------------------------- * gfx_set_vip_enable * * This routine enables or disables the writes to memory from the video port. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vip_enable(int enable) #else int gfx_set_vip_enable(int enable) #endif { unsigned long value; value = READ_VIP32(SC1200_VIP_CONTROL); if (enable) value |= SC1200_VIP_DATA_CAPTURE_EN; else value &= ~SC1200_VIP_DATA_CAPTURE_EN; WRITE_VIP32(SC1200_VIP_CONTROL, value); return (0); } /*---------------------------------------------------------------------------- * gfx_set_vip_capture_run_mode * * This routine selects VIP capture run mode. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vip_capture_run_mode(int mode) #else int gfx_set_vip_capture_run_mode(int mode) #endif { unsigned long value; value = READ_VIP32(SC1200_VIP_CONTROL); value &= ~SC1200_CAPTURE_RUN_MODE_MASK; switch (mode) { case VIP_CAPTURE_STOP_LINE: value |= SC1200_CAPTURE_RUN_MODE_STOP_LINE; break; case VIP_CAPTURE_STOP_FIELD: value |= SC1200_CAPTURE_RUN_MODE_STOP_FIELD; break; case VIP_CAPTURE_START_FIELD: value |= SC1200_CAPTURE_RUN_MODE_START; break; default: return GFX_STATUS_BAD_PARAMETER; } WRITE_VIP32(SC1200_VIP_CONTROL, value); return (0); } /*---------------------------------------------------------------------------- * gfx_set_vip_base * * This routine sets the odd and even base address values for the VIP memory * buffer. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vip_base(unsigned long even, unsigned long odd) #else int gfx_set_vip_base(unsigned long even, unsigned long odd) #endif { /* TRUE OFFSET IS SPECIFIED, NEED TO SET BIT 23 FOR HARDWARE */ if (even) WRITE_VIP32(SC1200_VIP_EVEN_BASE, even + (unsigned long) gfx_phys_fbptr); if (odd) WRITE_VIP32(SC1200_VIP_ODD_BASE, odd + (unsigned long) gfx_phys_fbptr); return (0); } /*---------------------------------------------------------------------------- * gfx_set_vip_pitch * * This routine sets the number of bytes between scanlines for the VIP data. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vip_pitch(unsigned long pitch) #else int gfx_set_vip_pitch(unsigned long pitch) #endif { WRITE_VIP32(SC1200_VIP_PITCH, pitch & SC1200_VIP_PITCH_MASK); return (0); } /*---------------------------------------------------------------------------- * gfx_set_vip_mode * * This routine sets the VIP operating mode. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vip_mode(int mode) #else int gfx_set_vip_mode(int mode) #endif { unsigned long config; config = READ_VIP32(SC1200_VIP_CONFIG); config &= ~SC1200_VIP_MODE_MASK; switch (mode) { case VIP_MODE_C: WRITE_VIP32(SC1200_VIP_CONFIG, config | SC1200_VIP_MODE_C); break; default: return GFX_STATUS_BAD_PARAMETER; } return (0); } /*---------------------------------------------------------------------------- * gfx_set_vbi_enable * * This routine enables or disables the VBI data capture. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vbi_enable(int enable) #else int gfx_set_vbi_enable(int enable) #endif { unsigned long value; value = READ_VIP32(SC1200_VIP_CONTROL); if (enable) value |= SC1200_VIP_VBI_CAPTURE_EN; else value &= ~SC1200_VIP_VBI_CAPTURE_EN; WRITE_VIP32(SC1200_VIP_CONTROL, value); return (0); } /*---------------------------------------------------------------------------- * gfx_set_vbi_mode * * This routine sets the VBI data types captured to memory. * It receives a mask of all enabled types. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vbi_mode(int mode) #else int gfx_set_vbi_mode(int mode) #endif { unsigned long config; config = READ_VIP32(SC1200_VIP_CONFIG); config &= ~(SC1200_VBI_ANCILLARY_TO_MEMORY | SC1200_VBI_TASK_A_TO_MEMORY | SC1200_VBI_TASK_B_TO_MEMORY); if (mode & VBI_ANCILLARY) config |= SC1200_VBI_ANCILLARY_TO_MEMORY; if (mode & VBI_TASK_A) config |= SC1200_VBI_TASK_A_TO_MEMORY; if (mode & VBI_TASK_B) config |= SC1200_VBI_TASK_B_TO_MEMORY; WRITE_VIP32(SC1200_VIP_CONFIG, config); return (0); } /*---------------------------------------------------------------------------- * gfx_set_vbi_base * * This routine sets the odd and even base address values for VBI capture. * * "even" and "odd" should contain 16-byte aligned physical addresses. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vbi_base(unsigned long even, unsigned long odd) #else int gfx_set_vbi_base(unsigned long even, unsigned long odd) #endif { /* VIP HW REQUIRES THAT BASE ADDRESSES BE 16-BYTE ALIGNED */ if (even) WRITE_VIP32(SC1200_VBI_EVEN_BASE, even & ~0xf); if (odd) WRITE_VIP32(SC1200_VBI_ODD_BASE, odd & ~0xf); return (0); } /*---------------------------------------------------------------------------- * gfx_set_vbi_pitch * * This routine sets the number of bytes between scanlines for VBI capture. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vbi_pitch(unsigned long pitch) #else int gfx_set_vbi_pitch(unsigned long pitch) #endif { WRITE_VIP32(SC1200_VBI_PITCH, pitch & SC1200_VBI_PITCH_MASK); return (0); } /*---------------------------------------------------------------------------- * gfx_set_vbi_direct * * This routine sets the VBI lines to be passed to the Direct VIP. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines) #else int gfx_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines) #endif { WRITE_VIP32(SC1200_EVEN_DIRECT_VBI_LINE_ENABLE, even_lines & SC1200_DIRECT_VBI_LINE_ENABLE_MASK); WRITE_VIP32(SC1200_ODD_DIRECT_VBI_LINE_ENABLE, odd_lines & SC1200_DIRECT_VBI_LINE_ENABLE_MASK); return (0); } /*---------------------------------------------------------------------------- * gfx_set_vbi_interrupt * * This routine enables or disables the VBI field interrupt. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vbi_interrupt(int enable) #else int gfx_set_vbi_interrupt(int enable) #endif { unsigned long value; value = READ_VIP32(SC1200_VIP_CONTROL); if (enable) value |= SC1200_VIP_VBI_FIELD_INTERRUPT_EN; else value &= ~SC1200_VIP_VBI_FIELD_INTERRUPT_EN; WRITE_VIP32(SC1200_VIP_CONTROL, value); return (0); } /*---------------------------------------------------------------------------- * gfx_set_vip_bus_request_threshold_high * * This routine sets the VIP FIFO bus request threshold. * If enable is TRUE, VIP FIFO will be set to issue a bus request when it * filled with 64 bytes. If enable is FALSE, VIP FIFO will be set to issue a * bus request when it filled with 32 bytes. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vip_bus_request_threshold_high(int enable) #else int gfx_set_vip_bus_request_threshold_high(int enable) #endif { unsigned long value; value = READ_VIP32(SC1200_VIP_CONFIG); if (enable) value &= ~SC1200_VIP_BUS_REQUEST_THRESHOLD; else value |= SC1200_VIP_BUS_REQUEST_THRESHOLD; WRITE_VIP32(SC1200_VIP_CONFIG, value); return (0); } /*---------------------------------------------------------------------------- * gfx_set_vip_last_line * * This routine sets the maximum number of lines captured in each field. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_set_vip_last_line(int last_line) #else int gfx_set_vip_last_line(int last_line) #endif { unsigned long value; /* This feature is implemented in Rev C1 */ if (gfx_chip_revision < SC1200_REV_C1) return (GFX_STATUS_OK); value = READ_VIP32(SC1200_VIP_LINE_TARGET); value &= ~SC1200_VIP_LAST_LINE_MASK; value |= ((last_line & 0x3FF) << 16); WRITE_VIP32(SC1200_VIP_LINE_TARGET, value); return (GFX_STATUS_OK); } /*---------------------------------------------------------------------------- * gfx_test_vip_odd_field * * This routine returns 1 if the current VIP field is odd. Otherwise returns 0 *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_test_vip_odd_field(void) #else int gfx_test_vip_odd_field(void) #endif { if (READ_VIP32(SC1200_VIP_STATUS) & SC1200_VIP_CURRENT_FIELD_ODD) return (1); else return (0); } /*---------------------------------------------------------------------------- * gfx_test_vip_bases_updated * * This routine returns 1 if all of the VIP base registers have been updated, * i.e. there is no base register which has been written with a new address, * that VIP has not already captured or started capturing into the new address *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_test_vip_bases_updated(void) #else int gfx_test_vip_bases_updated(void) #endif { if (READ_VIP32(SC1200_VIP_STATUS) & SC1200_VIP_BASE_NOT_UPDATED) return (0); else return (1); } /*---------------------------------------------------------------------------- * gfx_test_vip_fifo_overflow * * This routine returns 1 if an overflow occurred on the FIFO between the VIP * and the fast X-bus, 0 otherwise. * If an overflow occurred, the overflow status indication is reset. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_test_vip_fifo_overflow(void) #else int gfx_test_vip_fifo_overflow(void) #endif { if (READ_VIP32(SC1200_VIP_STATUS) & SC1200_VIP_FIFO_OVERFLOW) { /* Bits in vip status register are either read only or reset by * writing 1 */ WRITE_VIP32(SC1200_VIP_STATUS, SC1200_VIP_FIFO_OVERFLOW); return (1); } else { return (0); } } /*---------------------------------------------------------------------------- * gfx_get_vip_line * * This routine returns the number of the current video line being * received by the VIP interface. *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_get_vip_line(void) #else int gfx_get_vip_line(void) #endif { return (int) (READ_VIP32(SC1200_VIP_CURRENT_LINE) & SC1200_VIP_CURRENT_LINE_MASK); } /*---------------------------------------------------------------------------- * gfx_get_vip_base *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC unsigned long sc1200_get_vip_base(int odd) #else unsigned long gfx_get_vip_base(int odd) #endif { /* MASK BIT 23 AND ABOVE TO MAKE IT A TRUE OFFSET */ if (odd) return (READ_VIP32(SC1200_VIP_ODD_BASE)); return (READ_VIP32(SC1200_VIP_EVEN_BASE)); } /*---------------------------------------------------------------------------- * gfx_get_vbi_pitch *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC unsigned long sc1200_get_vbi_pitch(void) #else unsigned long gfx_get_vbi_pitch(void) #endif { return (READ_VIP32(SC1200_VBI_PITCH) & SC1200_VBI_PITCH_MASK); } /*************************************************************/ /* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ /*************************************************************/ #if GFX_READ_ROUTINES /*---------------------------------------------------------------------------- * gfx_get_vip_enable *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_get_vip_enable(void) #else int gfx_get_vip_enable(void) #endif { if (READ_VIP32(SC1200_VIP_CONTROL) & SC1200_VIP_DATA_CAPTURE_EN) return (1); return (0); } /*---------------------------------------------------------------------------- * gfx_get_vip_pitch *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC unsigned long sc1200_get_vip_pitch(void) #else unsigned long gfx_get_vip_pitch(void) #endif { return (READ_VIP32(SC1200_VIP_PITCH) & SC1200_VIP_PITCH_MASK); } /*---------------------------------------------------------------------------- * gfx_get_vip_mode *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_get_vip_mode(void) #else int gfx_get_vip_mode(void) #endif { switch (READ_VIP32(SC1200_VIP_CONFIG) & SC1200_VIP_MODE_MASK) { case SC1200_VIP_MODE_C: return VIP_MODE_C; default: return (0); } } /*---------------------------------------------------------------------------- * gfx_get_vbi_enable *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_get_vbi_enable(void) #else int gfx_get_vbi_enable(void) #endif { if (READ_VIP32(SC1200_VIP_CONTROL) & SC1200_VIP_VBI_CAPTURE_EN) return (1); return (0); } /*---------------------------------------------------------------------------- * gfx_get_vbi_mode *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_get_vbi_mode(void) #else int gfx_get_vbi_mode(void) #endif { int config; int mode = 0; config = (int) (READ_VIP32(SC1200_VIP_CONFIG) & (SC1200_VBI_ANCILLARY_TO_MEMORY | SC1200_VBI_TASK_A_TO_MEMORY | SC1200_VBI_TASK_B_TO_MEMORY)); if (config & SC1200_VBI_ANCILLARY_TO_MEMORY) mode |= VBI_ANCILLARY; if (config & SC1200_VBI_TASK_A_TO_MEMORY) mode |= VBI_TASK_A; if (config & SC1200_VBI_TASK_B_TO_MEMORY) mode |= VBI_TASK_B; return mode; } /*---------------------------------------------------------------------------- * gfx_get_vbi_base *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC unsigned long sc1200_get_vbi_base(int odd) #else unsigned long gfx_get_vbi_base(int odd) #endif { /* MASK BIT 23 AND ABOVE TO MAKE IT A TRUE OFFSET */ if (odd) return (READ_VIP32(SC1200_VBI_ODD_BASE)); return (READ_VIP32(SC1200_VBI_EVEN_BASE)); } /*---------------------------------------------------------------------------- * gfx_get_vbi_direct *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC unsigned long sc1200_get_vbi_direct(int odd) #else unsigned long gfx_get_vbi_direct(int odd) #endif { /* MASK BIT 23 AND ABOVE TO MAKE IT A TRUE OFFSET */ if (odd) return (READ_VIP32(SC1200_ODD_DIRECT_VBI_LINE_ENABLE) & SC1200_DIRECT_VBI_LINE_ENABLE_MASK); return (READ_VIP32(SC1200_EVEN_DIRECT_VBI_LINE_ENABLE) & SC1200_DIRECT_VBI_LINE_ENABLE_MASK); } /*--------------------------------------------------------------------------- * gfx_get_vbi_interrupt *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_get_vbi_interrupt(void) #else int gfx_get_vbi_interrupt(void) #endif { if (READ_VIP32(SC1200_VIP_CONTROL) & SC1200_VIP_VBI_FIELD_INTERRUPT_EN) return (1); return (0); } /*---------------------------------------------------------------------------- * gfx_get_vip_bus_request_threshold_high *---------------------------------------------------------------------------- */ #if GFX_VIP_DYNAMIC int sc1200_get_vip_bus_request_threshold_high(void) #else int gfx_get_vip_bus_request_threshold_high(void) #endif { if (READ_VIP32(SC1200_VIP_CONFIG) & SC1200_VIP_BUS_REQUEST_THRESHOLD) return (1); return (0); } #endif /* GFX_READ_ROUTINES */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_rtns.h0000644000175000017500000007402412654445443015165 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This header file defines the Durango routines and variables used * to access the memory mapped regions. * */ #ifndef _gfx_rtns_h #define _gfx_rtns_h /* INCLUDE DURANGO DEFINITIONS */ /* These definitions are placed in another file to allow their inclusion * in a user application. Such applications generally work through driver * shell routines that simply pass their parameters to Durango routines. * An external file provides an easy way to provide the definitions for these * parameters without the applications gaining any Durango visisbility. * */ #include "gfx_type.h" /* COMPILER OPTION FOR C++ PROGRAMS */ #ifdef __cplusplus extern "C" { #endif /* DURANGO MEMORY POINTERS */ extern unsigned char *gfx_virt_regptr; extern unsigned char *gfx_virt_fbptr; extern unsigned char *gfx_virt_vidptr; extern unsigned char *gfx_virt_vipptr; extern unsigned char *gfx_virt_spptr; extern unsigned char *gfx_virt_gpptr; extern unsigned char *gfx_phys_regptr; extern unsigned char *gfx_phys_fbptr; extern unsigned char *gfx_phys_vidptr; extern unsigned char *gfx_phys_vipptr; extern unsigned char *gfx_phys_spptr; extern unsigned char *gfx_phys_gpptr; /* DURANGO VARIBLES FOR RUNTIME SELECTION AND POSSIBLE VALUES */ extern int gfx_display_type; #define GFX_DISPLAY_TYPE_GU1 0x0001 #define GFX_DISPLAY_TYPE_GU2 0x0002 extern int gfx_init_type; #define GFX_INIT_TYPE_GU1 0x0001 #define GFX_INIT_TYPE_GU2 0x0002 extern int gfx_msr_type; #define GFX_MSR_TYPE_REDCLOUD 0x0001 extern int gfx_2daccel_type; #define GFX_2DACCEL_TYPE_GU1 0x0001 #define GFX_2DACCEL_TYPE_GU2 0x0002 extern int gfx_video_type; #define GFX_VIDEO_TYPE_CS5530 0x0001 #define GFX_VIDEO_TYPE_SC1200 0x0002 #define GFX_VIDEO_TYPE_REDCLOUD 0x0004 extern int gfx_vip_type; #define GFX_VIP_TYPE_SC1200 0x0001 extern int gfx_decoder_type; #define GFX_DECODER_TYPE_SAA7114 0x0001 extern int gfx_tv_type; #define GFX_TV_TYPE_SC1200 0x0001 #define GFX_TV_TYPE_FS451 0x0002 extern int gfx_i2c_type; #define GFX_I2C_TYPE_ACCESS 0x0001 #define GFX_I2C_TYPE_GPIO 0x0002 /* GLOBAL CPU INFORMATION */ extern unsigned long gfx_cpu_version; extern unsigned long gfx_cpu_frequency; extern unsigned long gfx_vid_version; extern ChipType gfx_chip_revision; /* ROUTINES IN GFX_INIT.C */ unsigned long gfx_pci_config_read(unsigned long address); void gfx_pci_config_write(unsigned long address, unsigned long data); unsigned long gfx_get_core_freq(void); unsigned long gfx_detect_cpu(void); unsigned long gfx_detect_video(void); unsigned long gfx_get_cpu_register_base(void); unsigned long gfx_get_graphics_register_base(void); unsigned long gfx_get_frame_buffer_base(void); unsigned long gfx_get_frame_buffer_size(void); unsigned long gfx_get_vid_register_base(void); unsigned long gfx_get_vip_register_base(void); /* ROUTINES IN GFX_MSR.C */ int gfx_msr_init(void); DEV_STATUS gfx_id_msr_device(MSR * pDev, unsigned long address); DEV_STATUS gfx_get_msr_dev_address(unsigned int device, unsigned long *address); DEV_STATUS gfx_get_glink_id_at_address(unsigned int *device, unsigned long address); DEV_STATUS gfx_msr_read(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue); DEV_STATUS gfx_msr_write(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue); /* ROUTINES IN GFX_DISP.C */ int gfx_set_display_bpp(unsigned short bpp); int gfx_is_display_mode_supported(int xres, int yres, int bpp, int hz); int gfx_set_display_mode(int xres, int yres, int bpp, int hz); int gfx_set_display_timings(unsigned short bpp, unsigned short flags, unsigned short hactive, unsigned short hblank_start, unsigned short hsync_start, unsigned short hsync_end, unsigned short hblank_end, unsigned short htotal, unsigned short vactive, unsigned short vblank_start, unsigned short vsync_start, unsigned short vsync_end, unsigned short vblank_end, unsigned short vtotal, unsigned long frequency); int gfx_set_vtotal(unsigned short vtotal); void gfx_set_display_pitch(unsigned short pitch); void gfx_set_display_offset(unsigned long offset); int gfx_set_display_palette_entry(unsigned long index, unsigned long palette); int gfx_set_display_palette(unsigned long *palette); void gfx_video_shutdown(void); void gfx_set_clock_frequency(unsigned long frequency); int gfx_set_crt_enable(int enable); void gfx_set_cursor_enable(int enable); void gfx_set_cursor_colors(unsigned long bkcolor, unsigned long fgcolor); void gfx_set_cursor_position(unsigned long memoffset, unsigned short xpos, unsigned short ypos, unsigned short xhotspot, unsigned short yhotspot); void gfx_set_cursor_shape32(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask); void gfx_set_cursor_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask); void gfx_set_icon_enable(int enable); void gfx_set_icon_colors(unsigned long color0, unsigned long color1, unsigned long color2); void gfx_set_icon_position(unsigned long memoffset, unsigned short xpos); void gfx_set_icon_shape64(unsigned long memoffset, unsigned long *andmask, unsigned long *xormask, unsigned int lines); int gfx_set_compression_enable(int enable); int gfx_set_compression_offset(unsigned long offset); int gfx_set_compression_pitch(unsigned short pitch); int gfx_set_compression_size(unsigned short size); void gfx_set_display_priority_high(int enable); int gfx_test_timing_active(void); int gfx_test_vertical_active(void); int gfx_wait_vertical_blank(void); void gfx_delay_milliseconds(unsigned long milliseconds); void gfx_delay_microseconds(unsigned long microseconds); void gfx_enable_panning(int x, int y); int gfx_is_panel_mode_supported(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp); int gfx_set_fixed_timings(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp); int gfx_set_panel_present(int panelResX, int panelResY, unsigned short width, unsigned short height, unsigned short bpp); void gfx_reset_timing_lock(void); /* "READ" ROUTINES IN GFX_DISP.C */ int gfx_get_display_details(unsigned int mode, int *xres, int *yres, int *hz); unsigned short gfx_get_display_pitch(void); int gfx_get_vsa2_softvga_enable(void); int gfx_get_sync_polarities(void); unsigned long gfx_get_clock_frequency(void); unsigned long gfx_get_max_supported_pixel_clock(void); int gfx_mode_frequency_supported(int xres, int yres, int bpp, unsigned long frequency); int gfx_get_refreshrate_from_frequency(int xres, int yres, int bpp, int *hz, unsigned long frequency); int gfx_get_refreshrate_from_mode(int xres, int yres, int bpp, int *hz, unsigned long frequency); int gfx_get_frequency_from_refreshrate(int xres, int yres, int bpp, int hz, int *frequency); int gfx_get_display_mode_count(void); int gfx_get_display_mode(int *xres, int *yres, int *bpp, int *hz); unsigned long gfx_get_frame_buffer_line_size(void); unsigned short gfx_get_hactive(void); unsigned short gfx_get_hblank_start(void); unsigned short gfx_get_hsync_start(void); unsigned short gfx_get_hsync_end(void); unsigned short gfx_get_hblank_end(void); unsigned short gfx_get_htotal(void); unsigned short gfx_get_vactive(void); unsigned short gfx_get_vline(void); unsigned short gfx_get_vblank_start(void); unsigned short gfx_get_vsync_start(void); unsigned short gfx_get_vsync_end(void); unsigned short gfx_get_vblank_end(void); unsigned short gfx_get_vtotal(void); unsigned short gfx_get_display_bpp(void); unsigned long gfx_get_display_offset(void); int gfx_get_display_palette_entry(unsigned long index, unsigned long *palette); void gfx_get_display_palette(unsigned long *palette); unsigned long gfx_get_cursor_enable(void); unsigned long gfx_get_cursor_offset(void); unsigned long gfx_get_cursor_position(void); unsigned long gfx_get_cursor_clip(void); unsigned long gfx_get_cursor_color(int color); unsigned long gfx_get_icon_enable(void); unsigned long gfx_get_icon_offset(void); unsigned long gfx_get_icon_position(void); unsigned long gfx_get_icon_color(int color); int gfx_get_compression_enable(void); unsigned long gfx_get_compression_offset(void); unsigned short gfx_get_compression_pitch(void); unsigned short gfx_get_compression_size(void); int gfx_get_display_priority_high(void); int gfx_get_valid_bit(int line); /* ROUTINES IN GFX_RNDR.C */ void gfx_set_bpp(unsigned short bpp); void gfx_set_solid_pattern(unsigned long color); void gfx_set_mono_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned char transparency); void gfx_set_color_pattern(unsigned long bgcolor, unsigned long fgcolor, unsigned long data0, unsigned long data1, unsigned long data2, unsigned long data3, unsigned char transparency); void gfx_load_color_pattern_line(short y, unsigned long *pattern_8x8); void gfx_set_solid_source(unsigned long color); void gfx_set_mono_source(unsigned long bgcolor, unsigned long fgcolor, unsigned short transparent); void gfx_set_pattern_flags(unsigned short flags); void gfx_set_raster_operation(unsigned char rop); void gfx_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height); void gfx_color_pattern_fill(unsigned short x, unsigned short y, unsigned short width, unsigned short height, unsigned long *pattern); void gfx_screen_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height); void gfx_screen_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned long color); void gfx_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch); void gfx_color_bitmap_to_screen_xblt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, long pitch, unsigned long color); void gfx_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data, short pitch); void gfx_text_blt(unsigned short dstx, unsigned short dsty, unsigned short width, unsigned short height, unsigned char *data); void gfx_bresenham_line(unsigned short x, unsigned short y, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags); void gfx_wait_until_idle(void); int gfx_test_blt_pending(void); /* SECOND GENERATION RENDERING ROUTINES */ void gfx2_set_source_stride(unsigned short stride); void gfx2_set_destination_stride(unsigned short stride); void gfx2_set_pattern_origin(int x, int y); void gfx2_set_source_transparency(unsigned long color, unsigned long mask); void gfx2_set_alpha_mode(int mode); void gfx2_set_alpha_value(unsigned char value); void gfx2_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height); void gfx2_color_pattern_fill(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned long *pattern); void gfx2_screen_to_screen_blt(unsigned long srcoffset, unsigned long dstoffset, unsigned short width, unsigned short height, int flags); void gfx2_mono_expand_blt(unsigned long srcbase, unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, int byte_packed); void gfx2_color_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, short pitch); void gfx2_mono_bitmap_to_screen_blt(unsigned short srcx, unsigned short srcy, unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data, short pitch); void gfx2_text_blt(unsigned long dstoffset, unsigned short width, unsigned short height, unsigned char *data); void gfx2_bresenham_line(unsigned long dstoffset, unsigned short length, unsigned short initerr, unsigned short axialerr, unsigned short diagerr, unsigned short flags); void gfx2_sync_to_vblank(void); /* ROUTINES IN GFX_VID.C */ int gfx_set_video_enable(int enable); int gfx_set_video_format(unsigned long format); int gfx_set_video_size(unsigned short width, unsigned short height); int gfx_set_video_yuv_pitch(unsigned long ypitch, unsigned long uvpitch); int gfx_set_video_offset(unsigned long offset); int gfx_set_video_yuv_offsets(unsigned long yoffset, unsigned long uoffset, unsigned long voffset); int gfx_set_video_window(short x, short y, unsigned short w, unsigned short h); int gfx_set_video_left_crop(unsigned short x); int gfx_set_video_upscale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth); int gfx_set_video_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth); int gfx_set_video_vertical_downscale(unsigned short srch, unsigned short dsth); void gfx_set_video_vertical_downscale_enable(int enable); int gfx_set_video_downscale_config(unsigned short type, unsigned short m); int gfx_set_video_color_key(unsigned long key, unsigned long mask, int bluescreen); int gfx_set_video_filter(int xfilter, int yfilter); int gfx_set_video_palette(unsigned long *palette); int gfx_set_graphics_palette(unsigned long *palette); int gfx_set_video_palette_bypass(int enable); int gfx_set_video_palette_entry(unsigned long index, unsigned long color); int gfx_set_graphics_palette_entry(unsigned long index, unsigned long color); int gfx_set_video_downscale_coefficients(unsigned short coef1, unsigned short coef2, unsigned short coef3, unsigned short coef4); int gfx_set_video_downscale_enable(int enable); int gfx_set_video_source(VideoSourceType source); int gfx_set_vbi_source(VbiSourceType source); int gfx_set_vbi_lines(unsigned long even, unsigned long odd); int gfx_set_vbi_total(unsigned long even, unsigned long odd); int gfx_set_video_interlaced(int enable); int gfx_set_color_space_YUV(int enable); int gfx_set_vertical_scaler_offset(char offset); int gfx_set_top_line_in_odd(int enable); int gfx_set_genlock_delay(unsigned long delay); int gfx_set_genlock_enable(int flags); int gfx_set_video_cursor(unsigned long key, unsigned long mask, unsigned short select_color2, unsigned long color1, unsigned long color2); int gfx_set_video_cursor_enable(int enable); int gfx_set_video_request(short x, short y); int gfx_select_alpha_region(int region); int gfx_set_alpha_enable(int enable); int gfx_set_alpha_window(short x, short y, unsigned short width, unsigned short height); int gfx_set_alpha_value(unsigned char alpha, char delta); int gfx_set_alpha_priority(int priority); int gfx_set_alpha_color(unsigned long color); int gfx_set_alpha_color_enable(int enable); int gfx_set_no_ck_outside_alpha(int enable); int gfx_disable_softvga(void); int gfx_enable_softvga(void); int gfx_set_macrovision_enable(int enable); unsigned long gfx_get_max_video_width(void); /* READ ROUTINES IN GFX_VID.C */ int gfx_get_video_enable(void); int gfx_get_video_format(void); unsigned long gfx_get_video_src_size(void); unsigned long gfx_get_video_line_size(void); unsigned long gfx_get_video_xclip(void); unsigned long gfx_get_video_offset(void); void gfx_get_video_yuv_offsets(unsigned long *yoffset, unsigned long *uoffset, unsigned long *voffset); void gfx_get_video_yuv_pitch(unsigned long *ypitch, unsigned long *uvpitch); unsigned long gfx_get_video_upscale(void); unsigned long gfx_get_video_scale(void); unsigned long gfx_get_video_downscale_delta(void); int gfx_get_video_vertical_downscale_enable(void); int gfx_get_video_downscale_config(unsigned short *type, unsigned short *m); void gfx_get_video_downscale_coefficients(unsigned short *coef1, unsigned short *coef2, unsigned short *coef3, unsigned short *coef4); void gfx_get_video_downscale_enable(int *enable); unsigned long gfx_get_video_dst_size(void); unsigned long gfx_get_video_position(void); unsigned long gfx_get_video_color_key(void); unsigned long gfx_get_video_color_key_mask(void); int gfx_get_video_palette_entry(unsigned long index, unsigned long *palette); int gfx_get_video_color_key_src(void); int gfx_get_video_filter(void); int gfx_get_video_request(short *x, short *y); int gfx_get_video_source(VideoSourceType * source); int gfx_get_vbi_source(VbiSourceType * source); unsigned long gfx_get_vbi_lines(int odd); unsigned long gfx_get_vbi_total(int odd); int gfx_get_video_interlaced(void); int gfx_get_color_space_YUV(void); int gfx_get_vertical_scaler_offset(char *offset); unsigned long gfx_get_genlock_delay(void); int gfx_get_genlock_enable(void); int gfx_get_video_cursor(unsigned long *key, unsigned long *mask, unsigned short *select_color2, unsigned long *color1, unsigned short *color2); unsigned long gfx_read_crc(void); unsigned long gfx_read_crc32(void); unsigned long gfx_read_window_crc(int source, unsigned short x, unsigned short y, unsigned short width, unsigned short height, int crc32); int gfx_get_macrovision_enable(void); void gfx_get_alpha_enable(int *enable); void gfx_get_alpha_size(unsigned short *x, unsigned short *y, unsigned short *width, unsigned short *height); void gfx_get_alpha_value(unsigned char *alpha, char *delta); void gfx_get_alpha_priority(int *priority); void gfx_get_alpha_color(unsigned long *color); /* ROUTINES IN GFX_VIP.C */ int gfx_set_vip_enable(int enable); int gfx_set_vip_capture_run_mode(int mode); int gfx_set_vip_base(unsigned long even, unsigned long odd); int gfx_set_vip_pitch(unsigned long pitch); int gfx_set_vip_mode(int mode); int gfx_set_vbi_enable(int enable); int gfx_set_vbi_mode(int mode); int gfx_set_vbi_base(unsigned long even, unsigned long odd); int gfx_set_vbi_pitch(unsigned long pitch); int gfx_set_vbi_direct(unsigned long even_lines, unsigned long odd_lines); int gfx_set_vbi_interrupt(int enable); int gfx_set_vip_bus_request_threshold_high(int enable); int gfx_set_vip_last_line(int last_line); int gfx_test_vip_odd_field(void); int gfx_test_vip_bases_updated(void); int gfx_test_vip_fifo_overflow(void); int gfx_get_vip_line(void); /* READ ROUTINES IN GFX_VIP.C */ int gfx_get_vip_enable(void); unsigned long gfx_get_vip_base(int odd); unsigned long gfx_get_vip_pitch(void); int gfx_get_vip_mode(void); int gfx_get_vbi_enable(void); int gfx_get_vbi_mode(void); unsigned long gfx_get_vbi_base(int odd); unsigned long gfx_get_vbi_pitch(void); unsigned long gfx_get_vbi_direct(int odd); int gfx_get_vbi_interrupt(void); int gfx_get_vip_bus_request_threshold_high(void); /* ROUTINES IN GFX_DCDR.C */ int gfx_set_decoder_defaults(void); int gfx_set_decoder_analog_input(unsigned char input); int gfx_set_decoder_brightness(unsigned char brightness); int gfx_set_decoder_contrast(unsigned char contrast); int gfx_set_decoder_hue(char hue); int gfx_set_decoder_saturation(unsigned char saturation); int gfx_set_decoder_input_offset(unsigned short x, unsigned short y); int gfx_set_decoder_input_size(unsigned short width, unsigned short height); int gfx_set_decoder_output_size(unsigned short width, unsigned short height); int gfx_set_decoder_scale(unsigned short srcw, unsigned short srch, unsigned short dstw, unsigned short dsth); int gfx_set_decoder_vbi_format(int start, int end, int format); int gfx_set_decoder_vbi_enable(int enable); int gfx_set_decoder_vbi_upscale(void); int gfx_set_decoder_TV_standard(TVStandardType TVStandard); int gfx_set_decoder_luminance_filter(unsigned char lufi); int gfx_decoder_software_reset(void); int gfx_decoder_detect_macrovision(void); int gfx_decoder_detect_video(void); /* READ ROUTINES IN GFX_DCDR.C */ unsigned char gfx_get_decoder_brightness(void); unsigned char gfx_get_decoder_contrast(void); char gfx_get_decoder_hue(void); unsigned char gfx_get_decoder_saturation(void); unsigned long gfx_get_decoder_input_offset(void); unsigned long gfx_get_decoder_input_size(void); unsigned long gfx_get_decoder_output_size(void); int gfx_get_decoder_vbi_format(int line); /* ROUTINES IN GFX_I2C.C */ int gfx_i2c_reset(unsigned char busnum, short adr, char freq); int gfx_i2c_write(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data); int gfx_i2c_read(unsigned char busnum, unsigned char chipadr, unsigned char subadr, unsigned char bytes, unsigned char *data); int gfx_i2c_select_gpio(int clock, int data); int gfx_i2c_init(void); void gfx_i2c_cleanup(void); /* ROUTINES IN GFX_TV.C */ int gfx_set_tv_format(TVStandardType format, GfxOnTVType resolution); int gfx_set_tv_output(int output); int gfx_set_tv_enable(int enable); int gfx_set_tv_flicker_filter(int ff); int gfx_set_tv_sub_carrier_reset(int screset); int gfx_set_tv_vphase(int vphase); int gfx_set_tv_YC_delay(int delay); int gfx_set_tvenc_reset_interval(int interval); int gfx_set_tv_cc_enable(int enable); int gfx_set_tv_cc_data(unsigned char data1, unsigned char data2); int gfx_set_tv_display(int width, int height); int gfx_test_tvout_odd_field(void); int gfx_test_tvenc_odd_field(void); int gfx_set_tv_field_status_invert(int enable); int gfx_get_tv_vphase(void); int gfx_get_tv_enable(unsigned int *p_on); int gfx_get_tv_output(void); int gfx_get_tv_mode_count(TVStandardType format); int gfx_get_tv_display_mode(int *width, int *height, int *bpp, int *hz); int gfx_get_tv_display_mode_frequency(unsigned short width, unsigned short height, TVStandardType format, int *frequency); int gfx_is_tv_display_mode_supported(unsigned short width, unsigned short height, TVStandardType format); int gfx_get_tv_standard(unsigned long *p_standard); int gfx_get_available_tv_standards(unsigned long *p_standards); int gfx_set_tv_standard(unsigned long standard); int gfx_get_tv_vga_mode(unsigned long *p_vga_mode); int gfx_get_available_tv_vga_modes(unsigned long *p_vga_modes); int gfx_set_tv_vga_mode(unsigned long vga_mode); int gfx_get_tvout_mode(unsigned long *p_tvout_mode); int gfx_set_tvout_mode(unsigned long tvout_mode); int gfx_get_sharpness(int *p_sharpness); int gfx_set_sharpness(int sharpness); int gfx_get_flicker_filter(int *p_flicker); int gfx_set_flicker_filter(int flicker); int gfx_get_overscan(int *p_x, int *p_y); int gfx_set_overscan(int x, int y); int gfx_get_position(int *p_x, int *p_y); int gfx_set_position(int x, int y); int gfx_get_color(int *p_color); int gfx_set_color(int color); int gfx_get_brightness(int *p_brightness); int gfx_set_brightness(int brightness); int gfx_get_contrast(int *p_contrast); int gfx_set_contrast(int constrast); int gfx_get_yc_filter(unsigned int *p_yc_filter); int gfx_set_yc_filter(unsigned int yc_filter); int gfx_get_aps_trigger_bits(unsigned int *p_trigger_bits); int gfx_set_aps_trigger_bits(unsigned int trigger_bits); /* ROUTINES IN GFX_VGA.C */ int gfx_get_softvga_active(void); int gfx_vga_test_pci(void); unsigned char gfx_vga_get_pci_command(void); int gfx_vga_set_pci_command(unsigned char command); int gfx_vga_seq_reset(int reset); int gfx_vga_set_graphics_bits(void); int gfx_vga_mode(gfx_vga_struct * vga, int xres, int yres, int bpp, int hz); int gfx_vga_pitch(gfx_vga_struct * vga, unsigned short pitch); int gfx_vga_save(gfx_vga_struct * vga, int flags); int gfx_vga_restore(gfx_vga_struct * vga, int flags); int gfx_vga_mode_switch(int active); void gfx_vga_clear_extended(void); /* CLOSE BRACKET FOR C++ COMPLILATION */ #ifdef __cplusplus } #endif #endif /* !_gfx_rtns_h */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_tv.c0000644000175000017500000004714612654445443014630 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines to program TVOUT and TV encoder. * * Routines: * * gfx_set_tv_format * gfx_set_tv_output * gfx_set_tv_enable * gfx_set_tv_flicker_filter * gfx_set_tv_sub_carrier_reset * gfx_set_tv_vphase * gfx_set_tv_YC_delay * gfx_set_tvenc_reset_interval * gfx_set_tv_cc_enable * gfx_set_tv_cc_data * gfx_test_tvout_odd_field * gfx_test_tvenc_odd_field * gfx_set_tv_field_status_invert * gfx_get_tv_vphase * */ /* TV TIMINGS */ DISPLAYMODE TVTimings[] = { /* NTSC resolution */ {0x3 | /* negative syncs */ GFX_MODE_TV_NTSC, /* NTSC format */ 640, 640, 656, 744, 792, 792, /* horizontal timings */ 480, 480, 490, 492, 517, 525, /* vertical timings */ 0x0018EC4D, /* freq = 24.923052 MHz */ } , /* PAL resolution */ {0x3 | /* negative syncs */ GFX_MODE_TV_PAL, /* PAL format */ 768, 768, 800, 848, 864, 864, /* horizontal timings */ 576, 576, 586, 588, 625, 625, /* vertical timings */ 0x001B0000, /* freq = 27.00 MHz */ } , /* NTSC resolution non-square pixels */ {0x3 | /* negative syncs */ GFX_MODE_TV_NTSC, /* NTSC format */ 720, 720, 736, 752, 792, 792, /* horizontal timings */ 480, 480, 490, 492, 517, 525, /* vertical timings */ 0x0018EC4D, /* freq = 24.923052 MHz */ } , /* PAL resolution non-square pixels */ {0x3 | /* negative syncs */ GFX_MODE_TV_PAL, /* PAL format */ 720, 720, 752, 816, 864, 864, /* horizontal timings */ 576, 576, 586, 588, 625, 625, /* vertical timings */ 0x001B0000, /* freq = 27.00 MHz */ } }; #define NUM_TV_MODES sizeof(TVTimings)/sizeof(DISPLAYMODE) /* INCLUDE SUPPORT FOR SC1200 TV ENCODER, IF SPECIFIED */ #if GFX_TV_SC1200 #include "tv_1200.c" #endif /* INCLUDE SUPPORT FOR FS450 TV ENCODER, IF SPECIFIED */ #if GFX_TV_FS451 #include "tv_fs450.c" #endif /* WRAPPERS IF DYNAMIC SELECTION */ /* Extra layer to call either SC1200 or FS450 TV encoder routines. */ #if GFX_TV_DYNAMIC /*---------------------------------------------------------------------------- * gfx_set_tv_format *---------------------------------------------------------------------------- */ int gfx_set_tv_format(TVStandardType format, GfxOnTVType resolution) { int retval = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_set_tv_format(format, resolution); #endif #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_tv_format(format, resolution); #endif return (retval); } /*---------------------------------------------------------------------------- * gfx_set_tv_output *---------------------------------------------------------------------------- */ int gfx_set_tv_output(int output) { int retval = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_set_tv_output(output); #endif #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_tv_output(output); #endif return (retval); } /*---------------------------------------------------------------------------- * gfx_set_tv_enable *---------------------------------------------------------------------------- */ int gfx_set_tv_enable(int enable) { int retval = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_set_tv_enable(enable); #endif #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_tv_enable(enable); #endif return (retval); } /*---------------------------------------------------------------------------- * gfx_set_tv_flicker_filter *---------------------------------------------------------------------------- */ int gfx_set_tv_flicker_filter(int ff) { int retval = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_set_tv_flicker_filter(ff); #endif return (retval); } /*---------------------------------------------------------------------------- * gfx_set_tv_sub_carrier_reset *---------------------------------------------------------------------------- */ int gfx_set_tv_sub_carrier_reset(int screset) { int retval = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_set_tv_sub_carrier_reset(screset); #endif return (retval); } /*---------------------------------------------------------------------------- * gfx_set_tv_vphase *---------------------------------------------------------------------------- */ int gfx_set_tv_vphase(int vphase) { int retval = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_set_tv_vphase(vphase); #endif return (retval); } /*---------------------------------------------------------------------------- * gfx_set_tv_YC_delay *---------------------------------------------------------------------------- */ int gfx_set_tv_YC_delay(int delay) { int retval = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_set_tv_YC_delay(delay); #endif return (retval); } /*---------------------------------------------------------------------------- * gfx_set_tvenc_reset_interval *---------------------------------------------------------------------------- */ int gfx_set_tvenc_reset_interval(int interval) { int retval = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_set_tvenc_reset_interval(interval); #endif return (retval); } /*---------------------------------------------------------------------------- * gfx_set_tv_cc_enable *---------------------------------------------------------------------------- */ int gfx_set_tv_cc_enable(int enable) { int retval = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_set_tv_cc_enable(enable); #endif return (retval); } /*---------------------------------------------------------------------------- * gfx_set_tv_cc_data * * This routine writes the two specified characters to the CC data register * of the TV encoder. *---------------------------------------------------------------------------- */ int gfx_set_tv_cc_data(unsigned char data1, unsigned char data2) { int retval = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_set_tv_cc_data(data1, data2); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_set_tv_display * * Set the timings in the display controller to support a TV resolution. *--------------------------------------------------------------------------- */ int gfx_set_tv_display(int width, int height) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) status = sc1200_set_tv_display(width, height); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_test_tvout_odd_field *--------------------------------------------------------------------------- */ int gfx_test_tvout_odd_field(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) status = sc1200_test_tvout_odd_field(); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_test_tvenc_odd_field *--------------------------------------------------------------------------- */ int gfx_test_tvenc_odd_field(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) status = sc1200_test_tvenc_odd_field(); #endif return (status); } /*---------------------------------------------------------------------------- * gfx_set_tv_field_status_invert *---------------------------------------------------------------------------- */ int gfx_set_tv_field_status_invert(int enable) { int retval = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_set_tv_field_status_invert(enable); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_get_tv_vphase *--------------------------------------------------------------------------- */ int gfx_get_tv_vphase(void) { int status = GFX_STATUS_UNSUPPORTED; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) status = sc1200_get_tv_vphase(); #endif return (status); } /*--------------------------------------------------------------------------- * gfx_get_tv_enable *--------------------------------------------------------------------------- */ int gfx_get_tv_enable(unsigned int *p_on) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_tv_enable(p_on); #endif #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_get_tv_enable(p_on); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_get_tv_output *--------------------------------------------------------------------------- */ int gfx_get_tv_output() { int retval = -1; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_get_tv_output(); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_get_tv_mode_count *--------------------------------------------------------------------------- */ int gfx_get_tv_mode_count(TVStandardType format) { int retval = -1; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_get_tv_mode_count(format); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_get_tv_display_mode *--------------------------------------------------------------------------- */ int gfx_get_tv_display_mode(int *width, int *height, int *bpp, int *hz) { int retval = -1; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_get_tv_display_mode(width, height, bpp, hz); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_get_tv_display_mode_frequency *--------------------------------------------------------------------------- */ int gfx_get_tv_display_mode_frequency(unsigned short width, unsigned short height, TVStandardType format, int *frequency) { int retval = -1; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_get_tv_display_mode_frequency(width, height, format, frequency); #endif return (retval); } /*--------------------------------------------------------------------------- * gfx_is_tv_display_mode_supported *--------------------------------------------------------------------------- */ int gfx_is_tv_display_mode_supported(unsigned short width, unsigned short height, TVStandardType format) { int retval = -1; #if GFX_TV_SC1200 if (gfx_tv_type & GFX_TV_TYPE_SC1200) retval = sc1200_is_tv_display_mode_supported(width, height, format); #endif return (retval); } /*------------------------------------------ * The following functions were added to support * the FS450 and will eventually be removed. There * is no equivalent support in the SC1200. *----------------------------------------------*/ /*========================================================================== * TV standard *========================================================================== */ int gfx_get_tv_standard(unsigned long *p_standard) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_tv_standard(p_standard); #endif return (retval); } int gfx_get_available_tv_standards(unsigned long *p_standards) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_available_tv_standards(p_standards); #endif return (retval); } int gfx_set_tv_standard(unsigned long standard) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_tv_standard(standard); #endif return (retval); } /* *========================================================================== * vga mode as known by the driver *========================================================================== */ int gfx_get_tv_vga_mode(unsigned long *p_vga_mode) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_tv_vga_mode(p_vga_mode); #endif return (retval); } int gfx_get_available_tv_vga_modes(unsigned long *p_vga_modes) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_available_tv_vga_modes(p_vga_modes); #endif return (retval); } int gfx_set_tv_vga_mode(unsigned long vga_mode) { int re tval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_tv_vga_mode(vga_mode); #endif return (retval); } /* *========================================================================== * * tvout mode */ int gfx_get_tvout_mode(unsigned long *p_tvout_mode) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_tvout_mode(p_tvout_mode); #endif return (retval); } int gfx_set_tvout_mode(unsigned long tvout_mode) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_tvout_mode(tvout_mode); #endif return (retval); } /* *========================================================================== * * Sharpness */ int gfx_get_sharpness(int *p_sharpness) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_sharpness(p_sharpness); #endif return (retval); } int gfx_set_sharpness(int sharpness) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_sharpness(sharpness); #endif return (retval); } /* *========================================================================== * * flicker filter control. */ int gfx_get_flicker_filter(int *p_flicker) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_flicker_filter(p_flicker); #endif return (retval); } int gfx_set_flicker_filter(int flicker) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_flicker_filter(flicker); #endif return (retval); } /* *========================================================================== * * Overscan and Position */ int gfx_get_overscan(int *p_x, int *p_y) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_overscan(p_x, p_y); #endif return (retval); } int gfx_set_overscan(int x, int y) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_overscan(x, y); #endif return (retval); } int gfx_get_position(int *p_x, int *p_y) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_position(p_x, p_y); #endif return (retval); } int gfx_set_position(int x, int y) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_position(x, y); #endif return (retval); } /* *========================================================================== * * Color, Brightness, and Contrast */ int gfx_get_color(int *p_color) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_color(p_color); #endif return (retval); } int gfx_set_color(int color) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_color(color); #endif return (retval); } int gfx_get_brightness(int *p_brightness) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_brightness(p_brightness); #endif return (retval); } int gfx_set_brightness(int brightness) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_brightness(brightness); #endif return (retval); } int gfx_get_contrast(int *p_contrast) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_contrast(p_contrast); #endif return (retval); } int gfx_set_contrast(int contrast) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_contrast(contrast); #endif return (retval); } /* *========================================================================== * * YC filters */ int gfx_get_yc_filter(unsigned int *p_yc_filter) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_yc_filter(p_yc_filter); #endif return (retval); } int gfx_set_yc_filter(unsigned int yc_filter) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_yc_filter(yc_filter); #endif return (retval); } int gfx_get_aps_trigger_bits(unsigned int *p_trigger_bits) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_get_aps_trigger_bits(p_trigger_bits); #endif return (retval); } int gfx_set_aps_trigger_bits(unsigned int trigger_bits) { int retval = -1; #if GFX_TV_FS451 if (gfx_tv_type & GFX_TV_TYPE_FS451) retval = fs450_set_aps_trigger_bits(trigger_bits); #endif return (retval); } #endif /* GFX_TV_DYNAMIC */ /* END OF FILE */ xf86-video-geode-2.11.18/src/gfx/gfx_init.c0000644000175000017500000004146312654445443015136 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * This file contains routines typically used in driver initialization. * * Routines: * * gfx_pci_config_read * gfx_cpu_config_read * gfx_detect_cpu * gfx_detect_video * gfx_get_cpu_register_base * gfx_get_frame_buffer_base * gfx_get_frame_buffer_size * gfx_get_vid_register_base * gfx_get_vip_register_base * */ /* CONSTANTS USED BY THE INITIALIZATION CODE */ #define PCI_CONFIG_ADDR 0x0CF8 #define PCI_CONFIG_DATA 0x0CFC #define PCI_VENDOR_DEVICE_GXM 0x00011078 #define PCI_VENDOR_DEVICE_REDCLOUD 0x0028100B #define REDCLOUD_VIDEO_PCI_VENDOR_DEVICE 0x0030100B #define GXM_CONFIG_GCR 0xB8 #define GXM_CONFIG_CCR3 0xC3 #define GXM_CONFIG_DIR0 0xFE #define GXM_CONFIG_DIR1 0xFF /* STATIC VARIABLES FOR THIS FILE */ unsigned long gfx_cpu_version = 0; unsigned long gfx_cpu_frequency = 0; unsigned long gfx_vid_version = 0; unsigned long gfx_gx1_scratch_base = 0; unsigned long gfx_gx2_scratch_base = 0x7FC000; unsigned long gfx_pci_speed_khz = 33300; ChipType gfx_chip_revision = CHIP_NOT_DETECTED; ChipType gfx_detect_chip(void); /* INCLUDE SUPPORT FOR FIRST GENERATION, IF SPECIFIED. */ #if GFX_INIT_GU1 #include "init_gu1.c" #endif /* INCLUDE SUPPORT FOR SECOND GENERATION, IF SPECIFIED. */ #if GFX_INIT_GU2 #include "init_gu2.c" #endif /* THE FOLLOWING ROUTINES ARE NEVER DYNAMIC */ /* They are used to set the variables for future dynamic */ /* function calls. */ /*---------------------------------------------------------------------------- * gfx_detect_chip * * This routine returns the name and revision of the chip. This function is * only relevant to the SC1200. *---------------------------------------------------------------------------- */ ChipType gfx_detect_chip(void) { unsigned char pid = INB(SC1200_CB_BASE_ADDR + SC1200_CB_PID); unsigned char rev = INB(SC1200_CB_BASE_ADDR + SC1200_CB_REV); unsigned short clk = INW(SC1200_CB_BASE_ADDR + SC1200_CB_CCFC); gfx_chip_revision = CHIP_NOT_DETECTED; if (pid == 0x4) { switch (rev) { case 0: gfx_chip_revision = SC1200_REV_A; break; case 1: gfx_chip_revision = SC1200_REV_B1_B2; break; case 2: gfx_chip_revision = SC1200_REV_B3; break; case 3: gfx_chip_revision = SC1200_REV_C1; break; case 4: gfx_chip_revision = SC1200_REV_D1; break; case 5: gfx_chip_revision = SC1200_REV_D1_1; break; case 6: gfx_chip_revision = SC1200_REV_D2_MVD; break; } if (rev > 0x6) gfx_chip_revision = SC1200_FUTURE_REV; } else if (pid == 0x5) { if (rev == 0x6) gfx_chip_revision = SC1200_REV_D2_MVE; else if (rev > 0x6) gfx_chip_revision = SC1200_FUTURE_REV; } switch ((clk >> 8) & 3) { case 0: default: gfx_pci_speed_khz = 33300; break; case 1: gfx_pci_speed_khz = 48000; break; case 2: gfx_pci_speed_khz = 66600; break; } return (gfx_chip_revision); } /*---------------------------------------------------------------------------- * gfx_detect_cpu * * This routine returns the type and revison of the CPU. If a Geode * processor is not present, the routine returns zero. * * The return value is as follows: * bits[24:16] = minor version * bits[15:8] = major version * bits[7:0] = type (1 = GXm, 2 = SC1200, 3 = Redcloud) * * A return value of 0x00020501, for example, indicates GXm version 5.2. *---------------------------------------------------------------------------- */ unsigned long gfx_detect_cpu(void) { unsigned long value = 0; unsigned long version = 0; /* initialize core freq. to 0 */ gfx_cpu_frequency = 0; #if GFX_INIT_GU1 value = gfx_pci_config_read(0x80000000); if (value == PCI_VENDOR_DEVICE_GXM) { unsigned char dir0 = gfx_gxm_config_read(GXM_CONFIG_DIR0) & 0xF0; unsigned char dir1 = gfx_gxm_config_read(GXM_CONFIG_DIR1); if (dir0 == 0x40) { /* CHECK FOR GXLV (and GXm) (DIR1 = 0x30 THROUGH 0x82) */ if ((dir1 >= 0x30) && (dir1 <= 0x82)) { /* Major version is one less than what appears in DIR1 */ if ((dir1 & 0xF0) < 0x70) { version = GFX_CPU_GXLV | (((((unsigned long) dir1 >> 4) - 1) << 8)) | /* major - 1 */ ((((unsigned long) dir1 & 0x0F)) << 16); /* minor */ } else { version = GFX_CPU_GXLV | ((((unsigned long) dir1 >> 4)) << 8) | /* major */ ((((unsigned long) dir1 & 0x0F)) << 16); /* minor */ } /* Currently always CS5530 for video overlay. */ #if GFX_VIDEO_DYNAMIC gfx_video_type = GFX_VIDEO_TYPE_CS5530; #endif /* Currently always CS5530 GPIOs for I2C access. */ #if GFX_I2C_DYNAMIC gfx_i2c_type = GFX_I2C_TYPE_GPIO; #endif #if GFX_TV_DYNAMIC gfx_tv_type = GFX_TV_TYPE_FS451; #endif } } else if (dir0 == 0xB0) { /* CHECK FOR SC1200 */ if ((dir1 == 0x70) || (dir1 == 0x81)) { version = GFX_CPU_SC1200 | ((((unsigned long) dir1 >> 4)) << 8) | /* major */ ((((unsigned long) dir1 & 0x0F)) << 16); /* minor */ /* Detect SC1200 revision */ gfx_detect_chip(); /* SC1200 for video overlay and VIP. */ #if GFX_VIDEO_DYNAMIC gfx_video_type = GFX_VIDEO_TYPE_SC1200; #endif #if GFX_VIP_DYNAMIC gfx_vip_type = GFX_VIP_TYPE_SC1200; #endif /* Currently always SAA7114 decoder. */ #if GFX_DECODER_DYNAMIC gfx_decoder_type = GFX_DECODER_TYPE_SAA7114; #endif /* SC1200 for TV encoder */ #if GFX_TV_DYNAMIC gfx_tv_type = GFX_TV_TYPE_SC1200; #endif /* Currently always ACCESS.bus for I2C access. */ #if GFX_I2C_DYNAMIC gfx_i2c_type = GFX_I2C_TYPE_ACCESS; #endif } } if (version) { /* ALWAYS FIRST GENERATION GRAPHICS UNIT */ #if GFX_DISPLAY_DYNAMIC gfx_display_type = GFX_DISPLAY_TYPE_GU1; #endif #if GFX_2DACCEL_DYNAMIC gfx_2daccel_type = GFX_2DACCEL_TYPE_GU1; #endif #if GFX_INIT_DYNAMIC gfx_init_type = GFX_INIT_TYPE_GU1; #endif /* READ THE CORE FREQUENCY */ gfx_cpu_frequency = gfx_get_core_freq(); } } #endif #if GFX_INIT_GU2 value = gfx_pci_config_read(0x80000800); if (value == PCI_VENDOR_DEVICE_REDCLOUD) { Q_WORD msr_value; int valid, i; /* CHECK FOR SOFT VG */ /* If SoftVG is not present, the base addresses for all devices */ /* will not be allocated. Essentially, it is as if no Redcloud */ /* video hardware is present. */ value = gfx_pci_config_read(0x80000900); if (value == REDCLOUD_VIDEO_PCI_VENDOR_DEVICE) { valid = 1; /* BAR0 - BAR3 HOLD THE PERIPHERAL BASE ADDRESSES */ for (i = 0; i < 4; i++) { value = gfx_pci_config_read(0x80000910 + (i << 2)); if (value == 0x00000000 || value == 0xFFFFFFFF) { valid = 0; break; } } if (valid) { /* REDCLOUD INTEGRATED VIDEO */ #if GFX_VIDEO_DYNAMIC gfx_video_type = GFX_VIDEO_TYPE_REDCLOUD; #endif /* CURRENTLY, ALWAYS GPIO FOR I2C ACCESS */ #if GFX_I2C_DYNAMIC gfx_i2c_type = GFX_I2C_TYPE_GPIO; #endif /* SECOND-GENERATION DISPLAY CONTROLLER */ #if GFX_DISPLAY_DYNAMIC gfx_display_type = GFX_DISPLAY_TYPE_GU2; #endif /* SECOND-GENERATION GRAPHICS UNIT */ #if GFX_2DACCEL_DYNAMIC gfx_2daccel_type = GFX_2DACCEL_TYPE_GU2; #endif /* SECOND-GENERATION INITIALIZATION */ #if GFX_INIT_DYNAMIC gfx_init_type = GFX_INIT_TYPE_GU2; #endif /* MBUS MSR ACCESSES */ #if GFX_MSR_DYNAMIC gfx_msr_type = GFX_MSR_TYPE_REDCLOUD; #endif /* CS5530 GPIO I2C */ #if GFX_I2C_DYNAMIC gfx_i2c_type = GFX_I2C_TYPE_GPIO; #endif /* READ VERSION */ gfx_msr_init(); gfx_msr_read(RC_ID_MCP, MCP_RC_REVID, &msr_value); /* SUBTRACT 1 FROM REV ID */ /* REDCLOUD 1.X rev id is 1 less than the reported value */ if ((msr_value.low & 0xF0) == 0x10) msr_value.low--; version = GFX_CPU_REDCLOUD | ((msr_value.low & 0xF0) << 4) | /* MAJOR */ ((msr_value.low & 0x0F) << 16); /* MINOR */ /* READ THE CORE FREQUENCY */ /* I can't find GX implementations that need * this - we're trying to avoid virtual reads * anyway, so bail on it */ /* gfx_cpu_frequency = gfx_get_core_freq(); */ /* SET THE GP SCRATCH AREA */ /* Color bitmap BLTs use the last 16K of frame buffer space */ gfx_gx2_scratch_base = gfx_get_frame_buffer_size() - 0x4000; } } } #endif if (!version) { /* ALWAYS SECOND GENERATION IF SIMULATING */ /* For now, that is. This could change. */ #if GFX_DISPLAY_DYNAMIC gfx_display_type = GFX_DISPLAY_TYPE_GU2; #endif #if GFX_2DACCEL_DYNAMIC gfx_2daccel_type = GFX_2DACCEL_TYPE_GU2; #endif #if GFX_INIT_DYNAMIC gfx_init_type = GFX_INIT_TYPE_GU2; #endif #if GFX_MSR_DYNAMIC gfx_msr_type = GFX_MSR_TYPE_REDCLOUD; #endif #if GFX_VIDEO_DYNAMIC gfx_video_type = GFX_VIDEO_TYPE_REDCLOUD; #endif #if GFX_I2C_DYNAMIC gfx_i2c_type = GFX_I2C_TYPE_GPIO; #endif } gfx_cpu_version = version; return (version); } /*---------------------------------------------------------------------------- * gfx_detect_video * * This routine returns the type of the video hardware. * * The return value is as follows: * bits[7:0] = type (1 = CS5530, 2 = SC1200, 3 = Redcloud) * * Currently this routine does not actually detect any hardware, and bases * the video hardware entirely on the detected CPU. *---------------------------------------------------------------------------- */ unsigned long gfx_detect_video(void) { unsigned long version = 0; if ((gfx_cpu_version & 0xFF) == GFX_CPU_GXLV) version = GFX_VID_CS5530; else if ((gfx_cpu_version & 0xFF) == GFX_CPU_SC1200) version = GFX_VID_SC1200; else if ((gfx_cpu_version & 0xFF) == GFX_CPU_REDCLOUD) version = GFX_VID_REDCLOUD; gfx_vid_version = version; return (version); } /*---------------------------------------------------------------------------- * gfx_pci_config_read * * This routine reads a 32-bit value from the specified location in PCI * configuration space. *---------------------------------------------------------------------------- */ unsigned long gfx_pci_config_read(unsigned long address) { unsigned long value = 0xFFFFFFFF; OUTD(PCI_CONFIG_ADDR, address); value = IND(PCI_CONFIG_DATA); return (value); } /*---------------------------------------------------------------------------- * gfx_pci_config_write * * This routine writes a 32-bit value to the specified location in PCI * configuration space. *---------------------------------------------------------------------------- */ void gfx_pci_config_write(unsigned long address, unsigned long data) { OUTD(PCI_CONFIG_ADDR, address); OUTD(PCI_CONFIG_DATA, data); return; } /* WRAPPERS IF DYNAMIC SELECTION */ /* Extra layer to call either first or second generation routines. */ #if GFX_INIT_DYNAMIC /*---------------------------------------------------------------------------- * gfx_get_core_freq *---------------------------------------------------------------------------- */ unsigned long gfx_get_core_freq(void) { unsigned long freq = 0; #if GFX_INIT_GU1 if (gfx_init_type & GFX_INIT_TYPE_GU1) freq = gu1_get_core_freq(); #endif #if GFX_INIT_GU2 if (gfx_init_type & GFX_INIT_TYPE_GU2) freq = gu2_get_core_freq(); #endif return freq; } /*---------------------------------------------------------------------------- * gfx_get_cpu_register_base *---------------------------------------------------------------------------- */ unsigned long gfx_get_cpu_register_base(void) { unsigned long base = 0; #if GFX_INIT_GU1 if (gfx_init_type & GFX_INIT_TYPE_GU1) base = gu1_get_cpu_register_base(); #endif #if GFX_INIT_GU2 if (gfx_init_type & GFX_INIT_TYPE_GU2) base = gu2_get_cpu_register_base(); #endif return (base); } /*---------------------------------------------------------------------------- * gfx_get_graphics_register_base *---------------------------------------------------------------------------- */ unsigned long gfx_get_graphics_register_base(void) { unsigned long base = 0; #if GFX_INIT_GU2 if (gfx_init_type & GFX_INIT_TYPE_GU2) base = gu2_get_graphics_register_base(); #endif return (base); } /*---------------------------------------------------------------------------- * gfx_get_frame_buffer_base *---------------------------------------------------------------------------- */ unsigned long gfx_get_frame_buffer_base(void) { unsigned long base = 0; #if GFX_INIT_GU1 if (gfx_init_type & GFX_INIT_TYPE_GU1) base = gu1_get_frame_buffer_base(); #endif #if GFX_INIT_GU2 if (gfx_init_type & GFX_INIT_TYPE_GU2) base = gu2_get_frame_buffer_base(); #endif return (base); } /*---------------------------------------------------------------------------- * gfx_get_frame_buffer_size *---------------------------------------------------------------------------- */ unsigned long gfx_get_frame_buffer_size(void) { unsigned long size = 0; #if GFX_INIT_GU1 if (gfx_init_type & GFX_INIT_TYPE_GU1) size = gu1_get_frame_buffer_size(); #endif #if GFX_INIT_GU2 if (gfx_init_type & GFX_INIT_TYPE_GU2) size = gu2_get_frame_buffer_size(); #endif return size; } /*---------------------------------------------------------------------------- * gfx_get_vid_register_base *---------------------------------------------------------------------------- */ unsigned long gfx_get_vid_register_base(void) { unsigned long base = 0; #if GFX_INIT_GU1 if (gfx_init_type & GFX_INIT_TYPE_GU1) base = gu1_get_vid_register_base(); #endif #if GFX_INIT_GU2 if (gfx_init_type & GFX_INIT_TYPE_GU2) base = gu2_get_vid_register_base(); #endif return (base); } /*---------------------------------------------------------------------------- * gfx_get_vip_register_base *---------------------------------------------------------------------------- */ unsigned long gfx_get_vip_register_base(void) { unsigned long base = 0; #if GFX_INIT_GU1 if (gfx_init_type & GFX_INIT_TYPE_GU1) base = gu1_get_vip_register_base(); #endif return (base); } #endif /* END OF FILE */ xf86-video-geode-2.11.18/src/panel/0000755000175000017500000000000012654451205013537 500000000000000xf86-video-geode-2.11.18/src/panel/gx2_9211.c0000644000175000017500000002544212654445443015015 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contains the panel library files to the * GX2 platforms with 9211 support. * * SubModule: Geode FlatPanel library * */ #include "92xx.h" #include "gx2_9211.h" #include "pnl_defs.h" #if defined(_WIN32) /* windows */ #include "gfx_defs.h" extern DEV_STATUS gfx_msr_read(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue); extern DEV_STATUS gfx_msr_write(unsigned int device, unsigned int msrRegister, Q_WORD * msrValue); #endif static unsigned long FPBaseAddr; void SetFPBaseAddr(unsigned long addr) { FPBaseAddr = addr; } /**************************************************************************** * protected_mode_access( unsigned long mode, unsigned long width, * unsigned long addr, unsigned char* pdata ) * This function provides access to physical memory at the requested address. * * mode is: * GX2_READ or GX2_WRITE (accesses a single byte, word or double word * depending on the value of "width". Only 1, 2 or 4 supported). * READ_BYTES, WRITE_BYTES accesses "width" number of bytes (8 bits) * READ_WORDS, WRITE_WORDS accesses "width" number of words (16 bits) * READ_DWORDS, WRITE_DWORDS accesses "width" number of dwords (32 * bits) * * width is: * The size of the access. For READ or WRITE, only 1, 2 and 4 are * supported. For other modes, width is not limited but will cause * paging if the block traverses page boundaries. * * addr is: * The physical address being accessed * * pdata is: * A pointer to the data to be read or written into. * * NOTE! WORD or DWORD accesses can only be made on WORD or DWORD boundaries! ****************************************************************************/ void protected_mode_access(unsigned long mode, unsigned long width, unsigned long addr, char *pdata) { void *ptr = (void *) (FPBaseAddr + addr); /* type specific buffer pointers */ char *byte_data = (char *) pdata; unsigned long *word_data = (unsigned long *) pdata; unsigned long *dword_data = (unsigned long *) pdata; if (mode == GX2_READ) { switch (width) { case FOUR_BYTES: *(dword_data) = (unsigned long) (*(unsigned long *) ptr); break; case TWO_BYTES: *(word_data) = (unsigned long) (*(unsigned long *) ptr); break; default: *(byte_data) = (char) (*(char *) ptr); break; } } /* end GX2_READ */ else if (mode == GX2_WRITE) { switch (width) { case FOUR_BYTES: *(unsigned long *) ptr = *dword_data; break; case TWO_BYTES: *(unsigned long *) ptr = *word_data; break; default: *(char *) ptr = *byte_data; break; } /* end switch(mode) */ } /* end case GX2_WRITE */ return; } /* End of protected_mode_access. */ /************************************************************************* * void write_video_reg64_low( unsigned long offset, unsigned long value ) * * Writes value to the low 32 bits of the 64 bit memory mapped video * register indicated by offset. * This function uses Sys_info.video_reg_base as the base address, so * the value of offset should be with respect to this base. *************************************************************************/ void write_video_reg64_low(unsigned long offset, unsigned long value) { protected_mode_access(GX2_WRITE, FOUR_BYTES, FPBaseAddr + offset, (char *) &value); } /*end write_video_reg64_low() */ /************************************************************************* * unsigned long read_video_reg64_low( unsigned long offset ) * * Returns the contents of the low 32 bits of the 64 bit memory mapped * video register indicated by offset. * This function uses Sys_info.video_reg_base as the base address, so * the value of offset should be with respect to this base. *************************************************************************/ unsigned long read_video_reg64_low(unsigned long offset) { unsigned long data; protected_mode_access(GX2_READ, FOUR_BYTES, FPBaseAddr + offset, (char *) &data); return (data); } /*end read_video_reg64_low() */ /***************************************************************************** * void Redcloud_fp_reg(int mode, unsigned long address, unsigned long *data) * * Writes and reads dwords to the Redcloud flat panel registers in the * Redcloud Display Filter. There's no clock control, chip select or timing * to deal with. * This routine expects the actual GX2 macro definitions for the address. * * Parameters: * mode: An integer value for a GX2_READ or GX2_WRITE operation * 0 = GX2_Read and 1 = GX2_Write * address: A dword value representing the offset of the register. * data: A pointer to a dword value that is to be written in to * the required register. In case of a Read operation * this will point to the result of the Read operation. ****************************************************************************/ void Redcloud_fp_reg(int mode, unsigned long address, unsigned long *data) { if (mode == GX2_READ) { *data = read_video_reg64_low(address); } else { write_video_reg64_low(address, *data); } } /* End of Redcloud_fp_reg() */ /*------------------------------------------------------------------- * * SET_92XX_MODE_PARAMS * This routine sets the 9211 mode parameters. * *-------------------------------------------------------------------*/ void set_Redcloud_92xx_mode_params(int mode) { CS92xx_MODE *pMode = &FPModeParams[mode]; unsigned long temp_data = 0; unsigned long base_data; QQ_WORD msrValue; /* on a Redcloud, we need to set up the DF pad select MSR */ if (gfx_msr_read(RC_ID_DF, GX2_VP_MSR_PAD_SELECT, &msrValue) == FOUND) { msrValue.low &= ~GX2_VP_PAD_SELECT_MASK; if (pMode->panel_type == PNL_TFT || pMode->panel_type == PNL_TWOP) { msrValue.low = GX2_VP_PAD_SELECT_TFT; } else { msrValue.low = GX2_VP_PAD_SELECT_DSTN; } gfx_msr_write(RC_ID_DF, GX2_VP_MSR_PAD_SELECT, &msrValue); } /* Turn the 92xx power off before setting any new parameters. */ temp_data = pMode->power_management & ~GX2_FP_PM_PWR_ON; Redcloud_fp_reg(GX2_WRITE, GX2_FP_PWR_MAN, (unsigned long *) &temp_data); /* Set 9211 registers using the desired panel settings */ Redcloud_fp_reg(GX2_WRITE, GX2_FP_PAN_TIMING1, (unsigned long *) &pMode->panel_timing1); /* On Redcloud, bit 31 is now reserved. */ temp_data = pMode->panel_timing2 & 0x7FFFFFFF; Redcloud_fp_reg(GX2_WRITE, GX2_FP_PAN_TIMING2, (unsigned long *) &temp_data); /* On Redcloud TFT parts, set this to 0x70 so all 8 bits per color run * thru fp crc but only non-TFT parts. Otherwise, set it to be 0x50. * (source: Larry G.). */ if (pMode->panel_type == PNL_TFT || pMode->panel_type == PNL_TWOP) { temp_data = GX2_FP_CRC_PASS_THRU_MASK; } else { temp_data = pMode->rev_C_dither_frc; } Redcloud_fp_reg(GX2_WRITE, GX2_FP_DITH_FR_CNTRL, (unsigned long *) &temp_data); Redcloud_fp_reg(GX2_WRITE, GX2_FP_BLFSR, (unsigned long *) &pMode->blue_lsfr_seed); Redcloud_fp_reg(GX2_WRITE, GX2_FP_RLFSR, (unsigned long *) &pMode->red_green_lsfr_seed); /* Set the memory information, then the power register last. * This will turn the panel on at the 9211. */ Redcloud_fp_reg(GX2_READ, GX2_FP_FBB, (unsigned long *) &base_data); if (base_data != 0x41780000) { base_data = 0x41780000; Redcloud_fp_reg(GX2_WRITE, GX2_FP_FBB, (unsigned long *) &base_data); } Redcloud_fp_reg(GX2_WRITE, GX2_FP_PWR_MAN, (unsigned long *) &pMode->power_management); } /*end set_92xx_mode_params() */ /* ----------------------------------------------------------------------- * SET_FLAT_PANEL_MODE * * This routine sets the specified flat panel moden parameters in * the 9211. * Returns PASS if successful, FAIL if the mode parameters could * not be set. *------------------------------------------------------------------------*/ unsigned char set_Redcloud_92xx_mode(Pnl_PanelStat * pstat) { int mode; /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */ for (mode = 0; mode < NUM_92XX_MODES; mode++) { if ((FPModeParams[mode].xres == pstat->XRes) && (FPModeParams[mode].yres == pstat->YRes) && (FPModeParams[mode].bpp == pstat->Depth) && (FPModeParams[mode].panel_type == pstat->Type) && (FPModeParams[mode].color_type == pstat->MonoColor)) { /* SET THE 92xx FOR THE SELECTED MODE */ set_Redcloud_92xx_mode_params(mode); return TRUE; } /* end if() */ } /* end for() */ return FALSE; } /* end set_Centaurus_92xx_mode() */ void Redcloud_9211init(Pnl_PanelStat * pstat) { set_Redcloud_92xx_mode(pstat); } xf86-video-geode-2.11.18/src/panel/pnl_defs.h0000644000175000017500000000536212654445443015437 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contains definitions of the Geode frame buffer * panel data structures. * * SubModule: Geode FlatPanel library * */ #ifndef _pnl_defs_h #define _pnl_defs_h typedef enum { MARMOT_PLATFORM = 0, UNICORN_PLATFORM, CENTAURUS_PLATFORM, ARIES_PLATFORM, CARMEL_PLATFORM, HYDRA_PLATFORM, DORADO_PLATFORM, DRACO_PLATFORM, REDCLOUD_PLATFORM, OTHER_PLATFORM } SYS_BOARD; #define PNL_9210 0x01 #define PNL_9211_A 0x02 #define PNL_9211_C 0x04 #define PNL_UNKNOWN_CHIP 0x08 #define PNL_TFT 0x01 #define PNL_SSTN 0x02 #define PNL_DSTN 0x04 #define PNL_TWOP 0x08 #define PNL_UNKNOWN_PANEL 0x10 #define PNL_MONO_PANEL 0x01 #define PNL_COLOR_PANEL 0x02 #define PNL_UNKNOWN_COLOR 0x08 #define PNL_PANELPRESENT 0x01 #define PNL_PLATFORM 0x02 #define PNL_PANELCHIP 0x04 #define PNL_PANELSTAT 0x08 #define PNL_OVERRIDE_STAT 0x10 #define PNL_OVERRIDE_ALL 0x1F typedef struct _Pnl_PanelStat_ { int Type; int XRes; int YRes; int Depth; int MonoColor; } Pnl_PanelStat; typedef struct _Pnl_Params_ { unsigned long Flags; int PanelPresent; int Platform; int PanelChip; Pnl_PanelStat PanelStat; } Pnl_PanelParams, *PPnl_PanelParams; #endif /* _pnl_defs_h */ /* END OF FILE */ xf86-video-geode-2.11.18/src/panel/gx2_9211.h0000644000175000017500000001502212654445443015013 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contains the panel library files to the * GX2 platforms with 9211 support. * * SubModule: Geode FlatPanel library * */ /* ----------------------------------------------------------- * GX2 FLAT PANEL CONTROLLER REGISTER DEFINITIONS *----------------------------------------------------------- */ #define GX2_VP_MSR_PAD_SELECT 0x2011 #define GX2_VP_PAD_SELECT_MASK 0x3FFFFFFF #define GX2_VP_PAD_SELECT_TFT 0x1FFFFFFF #define GX2_VP_PAD_SELECT_DSTN 0x00000000 /* This is useful for generating addresses incrementally * (ie, vidtest register display code). */ #define GX2_FP_LCD_OFFSET 0x00000400 #define CS9211_REDCLOUD 0x0400 /* Moved 9211 Rev C3 up to next major * no. */ #define GX2_FP_PAN_TIMING1 0x0400 /* FP timings 1 */ #define GX2_FP_PAN_TIMING2 0x0408 /* FP timings 2 */ #define GX2_FP_PWR_MAN 0x0410 /* FP power management */ #define GX2_FP_DITH_FR_CNTRL 0x0418 /* FP dither and frame rate */ #define GX2_FP_BLFSR 0x0420 /* Blue LFSR seed */ #define GX2_FP_RLFSR 0x0428 /* Red and Green LFSR seed */ #define GX2_FP_FMI 0x0430 /* FRM Memory Index */ #define GX2_FP_FMD 0x0438 /* FRM Memory Data */ #define GX2_FP_DCA 0x0448 /* Dither ram control and address */ #define GX2_FP_DMD 0x0450 /* Dither memory data */ #define GX2_FP_PAN_CRC_SIG 0x0458 /* FP CRC signature */ #define GX2_FP_FBB 0x0460 /* Frame Buffer Base Address */ /* GX2_FP_PAN_TIMING2 bits */ #define GX2_FP_TFT_PASS_THRU 0x40000000 /* TFT pass through enable */ #define GX2_FP_PT2_PIX_OUT_MASK 0xFFF8FFFF /* panel output bit formats */ #define GX2_FP_PT2_PIX_OUT_TFT 0x00000000 /* 8 BIT DSTN or TFT panel */ #define GX2_FP_PT2_COLOR_MONO 0x00080000 /* color or monochrome */ #define GX2_FP_PT2_DSTN_TFT_MASK 0xFFCFFFFF /* panel type bits */ #define GX2_FP_PT2_DSTN_TFT_TFT 0x00100000 /* TFT panel */ #define GX2_FP_PT2_PSH_CLK_CTL 0x08000000 /* shift clock retrace * activity control */ /* GX2_FP_PWR_MAN bits */ #define GX2_FP_PM_SHFCLK_INVERT 0x00002000 /* Invert shfclk to panel */ #define GX2_FP_PM_VSYNC_DELAY 0x0000C000 /* Vert Sync delay */ #define GX2_FP_PM_HSYNC_DELAY 0x00030000 /* Horiz Sync delay */ #define GX2_FP_PM_PWRDN_PHASE_BIT0 0x00040000 /* panel power down phase bit * 0 */ #define GX2_FP_PM_PWRDN_PHASE_BIT1 0x00080000 /* panel power down phase bit * 1 */ #define GX2_FP_PM_PWRDN_PHASE_BIT2 0x00100000 /* panel power down phase bit * 2 */ #define GX2_FP_PM_PWRUP_PHASE_BIT0 0x00200000 /* panel power up phase bit * 0 */ #define GX2_FP_PM_PWRUP_PHASE_BIT1 0x00400000 /* panel power up phase bit * 1 */ #define GX2_FP_PM_PWRUP_PHASE_BIT2 0x00800000 /* panel power up phase bit * 2 */ #define GX2_FP_PM_PWR_ON 0x01000000 /* panel power ON */ #define GX2_FP_PM_DIS_OFF_CTL 0x02000000 /* disable the panel back * light */ #define GX2_FP_PM_EXT_PWR_SEQ 0x08000000 /* external power sequence */ /* GX2_FP_PAN_CRC_SIG bits */ #define GX2_FP_PAN_CRC_SIGE 0x00000001 /* CRC Sig Enable */ #define GX2_FP_PAN_CRC_SFR 0x00000002 /* CRC Sig Free Run */ /* This define is used by the hardware CRC mechanism */ #define GX2_FP_CRC_PASS_THRU_MASK 0x00000070 #define GX2_READ 0 #define GX2_WRITE 1 void SetFPBaseAddr(unsigned long); void Redcloud_9211init(Pnl_PanelStat *); void protected_mode_access(unsigned long mode, unsigned long width, unsigned long addr, char *pdata); void write_video_reg64_low(unsigned long offset, unsigned long value); unsigned long read_video_reg64_low(unsigned long offset); void Redcloud_fp_reg(int mode, unsigned long address, unsigned long *data); void set_Redcloud_92xx_mode_params(int mode); unsigned char set_Redcloud_92xx_mode(Pnl_PanelStat * pstat); xf86-video-geode-2.11.18/src/panel/dora9211.h0000644000175000017500000001061312654445443015102 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This header file defines the Durango routines and * variables used to access the memory mapped regions. * * SubModule: Geode FlatPanel library * */ #include "panel.h" #include "92xx.h" #ifndef _DORA9211_h #define _DORA9211_h /* 9211 Rev.C3 Dorado */ /* GPIO Pin Configuration Registers */ #define DRD_GEODE_GPPIN_SEL 0x20 /* GPIO Pin Configuration Select */ #define DRD_GEODE_GPPIN_CFG 0x24 /* GPIO Pin Configuration Access */ #define DRD_GEODE_GPPIN_RESET 0x28 /* GPIO Pin Reset */ #define DRD_GEODE_GPIO_BASE 0x6400 /* F0 GPIO, IO mapped */ #define DRD_GEODE_GPDI0 0x04 /* GPIO Data In 0 */ #define DRD_GEODE_GPDO0 0x00 /* GPIO Data Out 0 */ /* Data Ports in */ #define DRD_CLOCKP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0 #define DRD_DATAINP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0 #define DRD_DATAOUTP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0 #define DRD_CSP9211IN DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0 /* Data Ports out */ #define DRD_CLOCKP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0 #define DRD_DATAINP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0 #define DRD_DATAOUTP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0 #define DRD_CSP9211OUT DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0 /* Pin MASKS */ #define DRD_CLOCK9211 0x00000080 /* gpio 7, clock output to 9211 */ #define DRD_DATAIN9211 0x00040000 /* gpio 18, data output to 9211 */ #define DRD_DATAOUT9211 0x00000800 /* gpio 11, data input from 9211 */ #define DRD_CS9211 0x00000200 /* gpio 9, chip select output to 9211 * */ /* Gpio CFG values to select in */ #define DRD_CLOCK9211CFG 0x00000007 /* gpio 7 */ #define DRD_DATAIN9211CFG 0x00000012 /* gpio 18 */ #define DRD_DATAOUT9211CFG 0x0000000B /* gpio 11 */ #define DRD_CS9211CFG 0x00000009 /* gpio 9 */ #define DRD_LCDRESGPIO1 0x00 #define DRD_LCDRESGPIO2 0x01 #define DRD_LCDRESGPIO3 0x02 #define DRD_LCDRESGPIO4 0x04 void Dorado9211SetCS(void); void Dorado9211ClearCS(void); void Dorado9211SetDataOut(void); void Dorado9211ClearDataOut(void); unsigned char Dorado9211ReadDataIn(void); void Dorado9211ToggleClock(void); void Dorado9211SetClock(void); void Dorado9211ClearClock(void); void Dorado9211GpioInit(void); unsigned long Dorado9211ReadReg(unsigned short index); void Dorado9211WriteReg(unsigned short index, unsigned long data); void DoradoProgramFRMload(void); void Dorado_Get_9211_Details(unsigned long flags, Pnl_PanelParams * pParam); void Dorado_Power_Up(void); void Dorado_Power_Down(void); void Dorado_Save_Panel_State(void); void Dorado_Restore_Panel_State(void); void Dorado9211Init(Pnl_PanelStat * pstat); #endif /* !_DORA9211_h */ xf86-video-geode-2.11.18/src/panel/panel.c0000644000175000017500000000460512654445443014736 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contains the file inclusions, macro definitions * for the panel. * * SubModule: Geode FlatPanel library * */ #if defined(linux) /* Linux */ #ifdef __KERNEL__ #include #include #elif !defined(XFree86Server) #error blah #include #include #endif /* __KERNEL__ */ #elif defined(_WIN32) /* windows */ #include #endif #include "panel.h" #include "gfx_defs.h" extern unsigned char *gfx_virt_regptr; extern unsigned char *gfx_virt_fbptr; extern unsigned char *gfx_virt_vidptr; extern unsigned char *gfx_virt_vipptr; extern unsigned long gfx_detect_video(void); #define PLATFORM_DYNAMIC 1 /* runtime selection */ #define PLATFORM_DRACO 1 /* Draco + 9210 */ #define PLATFORM_CENTAURUS 1 /* Centaurus + 9211 RevA */ #define PLATFORM_DORADO 1 /* Dorado + 9211 RevC */ #define PLATFORM_REDCLOUD 1 /* GX2 */ unsigned char *XpressROMPtr; #include "pnl_init.c" #include "pnl_bios.c" xf86-video-geode-2.11.18/src/panel/panel.h0000644000175000017500000000547612654445443014752 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contains the Geode frame buffer panel functions * prototypes and it includes panel definitions header file. * * SubModule: Geode FlatPanel library * */ /* COMPILER OPTION FOR C++ PROGRAMS */ #ifndef _panel_h #define _panel_h #include "pnl_defs.h" #ifdef __cplusplus extern "C" { #endif /* CLOSE BRACKET FOR C++ COMPLILATION */ void Pnl_SetPlatform(int platform); int Pnl_GetPlatform(void); int Pnl_IsPanelPresent(void); void Pnl_SetPanelPresent(int present); void Pnl_SetPanelChip(int panelChip); int Pnl_GetPanelChip(void); void Pnl_SetPanelParam(Pnl_PanelParams * pParam); void Pnl_GetPanelParam(Pnl_PanelParams * pParam); int Pnl_InitPanel(Pnl_PanelParams * pParam); int Detect_Platform(void); void Pnl_SavePanelState(void); void Pnl_RestorePanelState(void); void Pnl_PowerUp(void); void Pnl_PowerDown(void); int Pnl_IsPanelEnabledInBIOS(void); void Pnl_GetPanelInfoFromBIOS(int *xres, int *yres, int *bpp, int *hz); /* from durango */ #if defined(_WIN32) /* windows */ extern void gfx_delay_milliseconds(unsigned long milliseconds); extern unsigned long gfx_ind(unsigned short port); extern void gfx_outd(unsigned short port, unsigned long data); extern unsigned char gfx_inb(unsigned short port); extern void gfx_outb(unsigned short port, unsigned char data); #endif #ifdef __cplusplus } #endif #endif /* !_panel_h */ /* END OF FILE */ xf86-video-geode-2.11.18/src/panel/drac9210.c0000644000175000017500000003404312654445443015063 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contains the panel library files to the * platforms with 9210, and 9211 support. * * SubModule: Geode FlatPanel library * */ #include "drac9210.h" #define CS9210 0x40 /* Chip select pin */ /* 9210 on Draco */ #define CLOCK9210 0x04 /* Clock pin */ #define DATAIN9210 0x20 /* Data from 9210 */ #define DATAOUT9210 0x80 /* Data to 9210 */ static void DracoWriteData(unsigned char data); static void DracoReadData(unsigned char *data); static void Draco9210GpioInit(); static void Draco9210SetCS(void); static unsigned char Draco9210ReadReg(unsigned char index); static void Draco9210WriteReg(unsigned char index, unsigned char data); static void Draco9210ClearCS(void); static void Draco9210SetDataOut(void); static void Draco9210ClearDataOut(void); static unsigned char Draco9210ReadDataIn(void); static void Draco9210ToggleClock(void); void Draco9210Init(Pnl_PanelStat * pstat) { unsigned char panelvalues[] = { 0x2, 0x80, 0x2, 0x24, 0x03, 0x00, 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3, 0x00, 0xc4, 0x00, 0xc5, 0x01, 0xc6, 0xff, 0xc7, 0xff, 0xc8, 0x3, 0xc9, 0xfe, 0xca, 0x0, 0xcb, 0x3f, 0xcc, 0xc, 0xcd, 0x1, 0xce, 0xff, 0xcf, 0xc1, 0xd0, 0x0, 0xd1, 0x7e, 0xd2, 0x3, 0xd3, 0xfe, 0xd4, 0x3, 0xd5, 0x81, 0xd6, 0xfc, 0xd7, 0x3f, 0xd8, 0x14, 0xd9, 0x1e, 0xda, 0x0f, 0xdb, 0xc7, 0xdc, 0x29, 0xdd, 0xe1, 0xde, 0xf1, 0xdf, 0xf9, 0xe0, 0x2, 0xe1, 0xe, 0xe2, 0x1e, 0xe3, 0x3e, 0xe4, 0x04, 0xe5, 0x71, 0xe6, 0xe3, 0xe7, 0xcf, 0xe8, 0x1, 0xe9, 0x86, 0xea, 0x3c, 0xeb, 0xf3, 0xec, 0xa, 0xed, 0x39, 0xee, 0xc7, 0xef, 0x3d, 0xf0, 0x14, 0xf1, 0xc6, 0xf2, 0x39, 0xf3, 0xce, 0xf4, 0x3, 0xf5, 0x19, 0xf6, 0xce, 0xf7, 0x77, 0xf8, 0x0, 0xf9, 0x66, 0xfa, 0x33, 0xfb, 0xbb, 0xfc, 0x2d, 0xfd, 0x99, 0xfe, 0xdd, 0xff, 0xdd, 0x3, 0x1, 0xc0, 0x2, 0xc1, 0x22, 0xc2, 0x66, 0xc3, 0x66, 0xc4, 0x0, 0xc5, 0xcd, 0xc6, 0x99, 0xc7, 0xbb, 0xc8, 0x5, 0xc9, 0x32, 0xca, 0x66, 0xcb, 0xdd, 0xcc, 0x1a, 0xcd, 0x4d, 0xce, 0x9b, 0xcf, 0x6f, 0xd0, 0x0, 0xd1, 0x92, 0xd2, 0x6d, 0xd3, 0xb6, 0xd4, 0x5, 0xd5, 0x25, 0xd6, 0xb6, 0xd7, 0xdb, 0xd8, 0x2, 0xd9, 0x5a, 0xda, 0x4b, 0xdb, 0x6d, 0xdc, 0x29, 0xdd, 0xa5, 0xde, 0xb5, 0xdf, 0xb7, 0xe0, 0x4, 0xe1, 0x4a, 0xe2, 0x5a, 0xe3, 0xda, 0xe4, 0x12, 0xe5, 0x95, 0xe6, 0xad, 0xe7, 0x6f, 0xe8, 0x1, 0xe9, 0x2a, 0xea, 0x56, 0xeb, 0xb5, 0xec, 0xe, 0xed, 0x55, 0xee, 0xab, 0xef, 0x5f, 0xf0, 0x0, 0xf1, 0xaa, 0xf2, 0x55, 0xf3, 0xea, 0xf4, 0x1, 0xf5, 0x55, 0xf6, 0xaa, 0xf7, 0xbf, 0xf8, 0x6, 0xf9, 0xaa, 0xfa, 0x55, 0xfb, 0x55, 0xfc, 0x39, 0xfd, 0x55, 0xfe, 0xff, 0xff, 0xff, 0x3, 0x2, 0xc0, 0x0, 0xc1, 0x0, 0xc2, 0xaa, 0xc3, 0xaa, 0xc4, 0x6, 0xc5, 0xab, 0xc6, 0x55, 0xc7, 0x55, 0xc8, 0x01, 0xc9, 0x54, 0xca, 0xaa, 0xcb, 0xbf, 0xcc, 0x8, 0xcd, 0xab, 0xce, 0x55, 0xcf, 0xeb, 0xd0, 0x6, 0xd1, 0x54, 0xd2, 0xab, 0xd3, 0x5e, 0xd4, 0x1, 0xd5, 0x2b, 0xd6, 0x56, 0xd7, 0xb5, 0xd8, 0x12, 0xd9, 0x94, 0xda, 0xad, 0xdb, 0x6f, 0xdc, 0x2d, 0xdd, 0x4b, 0xde, 0x5b, 0xdf, 0xdb, 0xe0, 0x0, 0xe1, 0xa4, 0xe2, 0xb4, 0xe3, 0xb6, 0xe4, 0x2, 0xe5, 0x5b, 0xe6, 0x4b, 0xe7, 0x6d, 0xe8, 0x5, 0xe9, 0x24, 0xea, 0xb6, 0xeb, 0xdb, 0xec, 0x8, 0xed, 0x93, 0xee, 0x6d, 0xef, 0xb7, 0xf0, 0x12, 0xf1, 0x4c, 0xf2, 0x9b, 0xf3, 0x6e, 0xf4, 0x5, 0xf5, 0x33, 0xf6, 0x66, 0xf7, 0xdd, 0xf8, 0x0, 0xf9, 0xcc, 0xfa, 0x99, 0xfb, 0xbb, 0xfc, 0x2b, 0xfd, 0x33, 0xfe, 0x77, 0xff, 0x77, 0x3, 0x3, 0xc0, 0x4, 0xc1, 0x88, 0xc2, 0xcc, 0xc3, 0xcc, 0xc4, 0x0, 0xc5, 0x67, 0xc6, 0x33, 0xc7, 0xbb, 0xc8, 0x3, 0xc9, 0x18, 0xca, 0xce, 0xcb, 0x77, 0xcc, 0x1c, 0xcd, 0xc7, 0xce, 0x39, 0xcf, 0xcf, 0xd0, 0x2, 0xd1, 0x38, 0xd2, 0xc7, 0xd3, 0x3c, 0xd4, 0x1, 0xd5, 0x87, 0xd6, 0x3c, 0xd7, 0xf3, 0xd8, 0x4, 0xd9, 0x70, 0xda, 0xe3, 0xdb, 0xcf, 0xdc, 0x2b, 0xdd, 0xf, 0xde, 0x1f, 0xdf, 0x3f, 0xe0, 0x00, 0xe1, 0xe0, 0xe2, 0xf0, 0xe3, 0xf8, 0xe4, 0x14, 0xe5, 0x1f, 0xe6, 0xf, 0xe7, 0xc7, 0xe8, 0x3, 0xe9, 0x80, 0xea, 0xfc, 0xeb, 0x3f, 0xec, 0x8, 0xed, 0x7f, 0xee, 0x3, 0xef, 0xff, 0xf0, 0x4, 0xf1, 0x0, 0xf2, 0xff, 0xf3, 0xc0, 0xf4, 0x3, 0xf5, 0xff, 0xf6, 0x0, 0xf7, 0x3f, 0xf8, 0x0, 0xf9, 0x0, 0xfa, 0xff, 0xfb, 0xff, 0xfc, 0x3f, 0xfd, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x3, 0x4, /* Setup the Diter to Pattern33 */ 0x80, 0xdd, 0x81, 0xdd, 0x82, 0x33, 0x83, 0x33, 0x84, 0xdd, 0x85, 0xdd, 0x86, 0x33, 0x87, 0x33, 0x88, 0x33, 0x89, 0x33, 0x8a, 0x77, 0x8b, 0x77, 0x8c, 0x33, 0x8d, 0x33, 0x8e, 0x77, 0x8f, 0x77, 0x90, 0xdd, 0x91, 0xdd, 0x92, 0x33, 0x93, 0x33, 0x94, 0xdd, 0x95, 0xdd, 0x96, 0x33, 0x97, 0x33, 0x98, 0x33, 0x99, 0x33, 0x9a, 0x77, 0x9b, 0x77, 0x9c, 0x33, 0x9d, 0x33, 0x9e, 0x77, 0x9f, 0x77, 0x4, 0x20, 0x5, 0x3, 0x6, 0x56, 0x7, 0x2, 0x8, 0x1c, 0x9, 0x0, 0xa, 0x26, 0xb, 0x0, 0xc, 0x15, 0xd, 0x4, 0xe, 0x50, 0xf, 0x4, 0x10, 0xfa, 0x11, 0x0, 0x12, 0xc8, 0x13, 0x0, 0x14, 0x31, 0x15, 0x23, 0x16, 0x0, /* Enable DSTN panel */ 0x2, 0x64 }; unsigned char index, data; int i; gfx_delay_milliseconds(100); Draco9210GpioInit(); Draco9210SetCS(); Draco9210ToggleClock(); Draco9210ToggleClock(); Draco9210ToggleClock(); Draco9210ToggleClock(); Draco9210ClearCS(); #if defined(_WIN32) /* For Windows */ for (i = 0; i < 10; i++) { _asm { out 0ED h, al} } #elif defined(linux) /* Linux */ #endif for (i = 0; i < 630; i += 2) { index = panelvalues[i]; data = panelvalues[i + 1]; Draco9210WriteReg(index, data); } } static void DracoWriteData(unsigned char data) { int i; unsigned char mask = 0x80, databit; for (i = 0; i < 8; i++) { databit = data & mask; if (data & mask) { Draco9210SetDataOut(); } else { Draco9210ClearDataOut(); } mask >>= 1; Draco9210ToggleClock(); } } static void DracoReadData(unsigned char *data) { int i; unsigned char tmp = 0, readbit; Draco9210ClearDataOut(); Draco9210ToggleClock(); for (i = 0; i < 7; i++) { readbit = Draco9210ReadDataIn(); tmp |= (readbit & 0x1); tmp <<= 1; Draco9210ToggleClock(); } readbit = Draco9210ReadDataIn(); tmp |= (readbit & 0x1); *data = tmp; } #if defined(_WIN32) /* For Windows */ void Draco9210GpioInit() { _asm { pushf cli mov dx, 0 CF8h mov eax, CX55x0_ID + 090 h out dx, eax mov dx, 0 CFCh mov al, 0 CFh mov ah, 00 h out dx, ax popf} } void Draco9210SetCS() { _asm { pushf; Point to PCI address register mov dx, 0 CF8h; 55 XX GPIO data register mov eax, CX55x0_ID + 090 h out dx, eax; Point to PCI data register (CFCh) mov dx, 0 CFCh in ax, dx and ah, 30 h mov ah, c92DataReg or ah, CS9210 mov c92DataReg, ah out dx, ax popf}} void Draco9210ClearCS() { _asm { pushf; Point to PCI address register mov dx, 0 CF8h; 55 XX GPIO data register mov eax, CX55x0_ID + 090 h out dx, eax; Point to PCI data register (CFCh) mov dx, 0 CFCh; Set CS LOW in ax, dx mov ah, c92DataReg and ah, NOT CS9210 mov c92DataReg, ah out dx, ax popf}} void Draco9210SetDataOut() { _asm { pushf; Point to PCI address register mov dx, 0 CF8h; 55 XX GPIO data register mov eax, CX55x0_ID + 090 h out dx, eax; Point to PCI data register (CFCh) mov dx, 0 CFCh; Set DATA HIGH in ax, dx mov ah, c92DataReg or ah, DATAOUT9210 mov c92DataReg, ah out dx, ax popf}} void Draco9210ClearDataOut() { _asm { pushf; Point to PCI address register mov dx, 0 CF8h mov eax, CX55x0_ID + 090 h; ; 55 XX GPIO data register out dx, eax; Point to PCI data register (CFCh) mov dx, 0 CFCh; Set Data LOW in ax, dx mov ah, c92DataReg and ah, NOT DATAOUT9210 mov c92DataReg, ah out dx, ax popf}} unsigned char Draco9210ReadDataIn() { unsigned char readdata; _asm { pushf; Point to PCI address register mov dx, 0 CF8h; 55 XX GPIO data register mov eax, CX55x0_ID + 090 h out dx, eax; Point to PCI data register (CFCh) mov dx, 0F Ch in ax, dx; Preserve just Data IN bit and ah, DATAIN9210 mov al, ah cmp al, 0; Is it LOW ? je readDataLow; must be HIGH mov al, 1 readDataLow:mov readdata, al popf} return (readdata); } void Draco9210ToggleClock() { _asm { pushf; Point to PCI address register mov dx, 0 CF8h; 55 XX GPIO data register mov eax, CX55x0_ID + 090 h; Point to PCI data register (CFCh) out dx, eax mov dx, 0 CFCh; SET CLOCK in ax, dx mov ah, c92DataReg or ah, CLOCK9210 mov c92DataReg, ah out dx, ax out 0ED h, al /* IOPAUSE */ ; Point to PCI address register mov dx, 0 CF8h; 55 XX GPIO data register mov eax, CX55x0_ID + 090 h out dx, eax; Point to PCI data register (CFCh) mov dx, 0 CFCh; ; CLEAR CLOCK in ax, dx mov ah, c92DataReg and ah, NOT CLOCK9210 mov c92DataReg, ah out dx, ax popf}} #elif defined(linux) /* Linux */ void Draco9210GpioInit() { } void Draco9210SetCS() { } void Draco9210ClearCS() { } void Draco9210SetDataOut() { } void Draco9210ClearDataOut() { } unsigned char Draco9210ReadDataIn() { } void Draco9210ToggleClock() { } #endif unsigned char Draco9210ReadReg(unsigned char index) { unsigned char data; Draco9210SetCS(); Draco9210ToggleClock(); Draco9210SetDataOut(); Draco9210ToggleClock(); Draco9210ClearDataOut(); Draco9210ToggleClock(); Draco9210ClearDataOut(); Draco9210ToggleClock(); Draco9210ClearDataOut(); Draco9210ToggleClock(); DracoWriteData(index); DracoReadData(&data); return (data); } void Draco9210WriteReg(unsigned char index, unsigned char data) { Draco9210SetCS(); Draco9210ToggleClock(); Draco9210SetDataOut(); Draco9210ToggleClock(); Draco9210ClearDataOut(); Draco9210ToggleClock(); Draco9210ClearDataOut(); Draco9210ToggleClock(); Draco9210SetDataOut(); Draco9210ToggleClock(); DracoWriteData(index); DracoWriteData(data); Draco9210ClearDataOut(); Draco9210ToggleClock(); Draco9210ClearCS(); Draco9210ToggleClock(); Draco9210ToggleClock(); } xf86-video-geode-2.11.18/src/panel/pnl_init.c0000644000175000017500000003372212654445443015455 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contains the Geode frame buffer panel * intialization functions. * * SubModule: Geode FlatPanel library * */ #include "panel.h" #include "gfx_regs.h" #include "gfx_type.h" /* defaults * Panel: Enabled * Platform: Centaurus * 92xx Chip: 9211 Rev. A * PanelType: DSTN * XResxYRes: 800x600 * Depth: 16 * Mono_Color: Color */ static Pnl_PanelParams sPanelParam = { 0, 1, CENTAURUS_PLATFORM, PNL_9211_A, {PNL_DSTN, 800, 600, 16, PNL_COLOR_PANEL} }; #if PLATFORM_DRACO #include "drac9210.c" #endif #if PLATFORM_CENTAURUS #include "cen9211.c" #endif #if PLATFORM_DORADO #include "dora9211.c" #endif #if PLATFORM_GX2BASED #include "gx2_9211.c" #endif #include "platform.c" /* * return -1 - UnKnown * 0 - Draco has 9210 * 1 - Centaurus has 9211 Rev. A * 2 - Dorado has 9211 Rev. C */ /*----------------------------------------------------------------- * Pnl_SetPlatform * * Description: This function sets the panel with hardware platform. * * parameters: * platform: It specify the platform. * * return: none. *-----------------------------------------------------------------*/ void Pnl_SetPlatform(int platform) { /* To Be Implemented */ sPanelParam.Platform = platform; } /*----------------------------------------------------------------- * Pnl_GetPlatform * * Description: This function returns the panel platform. * * parameters: none. * * return: On success it returns the panel platform. *-----------------------------------------------------------------*/ int Pnl_GetPlatform(void) { sPanelParam.Platform = Detect_Platform(); return sPanelParam.Platform; } /*----------------------------------------------------------------- * Pnl_IsPanelPresent * * Description: This function specifies whether the panel is prsent * or not. * * parameters: none. * * return: On success it returns an integer panel present value. *-----------------------------------------------------------------*/ int Pnl_IsPanelPresent(void) { /* To Be Implemented */ return sPanelParam.PanelPresent; } /*----------------------------------------------------------------- * Pnl_SetPanelPresent * * Description: This function sets the panel_present parameter. * * parameters: * present: It specifies the panel present value. * * return: none. *-----------------------------------------------------------------*/ void Pnl_SetPanelPresent(int present) { /* To Be Implemented */ sPanelParam.PanelPresent = present; } /*----------------------------------------------------------------- * Pnl_SetPanelParam * * Description: This function sets the panel parameters * * parameters: * pParam: It specifies the elements of the panel parameter * structure. * * return: none. *-----------------------------------------------------------------*/ void Pnl_SetPanelParam(Pnl_PanelParams * pParam) { if (pParam->Flags & PNL_PANELPRESENT) { Pnl_SetPanelPresent(pParam->PanelPresent); } if (pParam->Flags & PNL_PLATFORM) { Pnl_SetPlatform(pParam->Platform); } if (pParam->Flags & PNL_PANELCHIP) { Pnl_SetPanelChip(pParam->PanelChip); } if (pParam->Flags & PNL_PANELSTAT) { sPanelParam.PanelStat.XRes = pParam->PanelStat.XRes; sPanelParam.PanelStat.YRes = pParam->PanelStat.YRes; sPanelParam.PanelStat.Depth = pParam->PanelStat.Depth; sPanelParam.PanelStat.MonoColor = pParam->PanelStat.MonoColor; sPanelParam.PanelStat.Type = pParam->PanelStat.Type; } } /*----------------------------------------------------------------- * Pnl_PowerUp * * Description: This function sets the power based on the * hardware platforms dorado or centaraus. * * parameters: none. * * return: none. *-----------------------------------------------------------------*/ void Pnl_PowerUp(void) { int Platform; unsigned long dcfg, hw_video; Platform = Pnl_GetPlatform(); #if PLATFORM_CENTAURUS if (Platform == CENTAURUS_PLATFORM) { Centaurus_Power_Up(); return; } #endif #if PLATFORM_DORADO if (Platform == DORADO_PLATFORM) { Dorado_Power_Up(); return; } #endif #if PLATFORM_GX2BASED if (Platform == REDCLOUD_PLATFORM) { } #endif hw_video = gfx_detect_video(); if (hw_video == GFX_VID_CS5530) { /* READ DISPLAY CONFIG FROM CX5530 */ dcfg = READ_VID32(CS5530_DISPLAY_CONFIG); /* SET RELEVANT FIELDS */ dcfg |= (CS5530_DCFG_FP_PWR_EN | CS5530_DCFG_FP_DATA_EN); /* Enable the flatpanel power and data */ WRITE_VID32(CS5530_DISPLAY_CONFIG, dcfg); } else if (hw_video == GFX_VID_SC1200) { /* READ DISPLAY CONFIG FROM SC1200 */ dcfg = READ_VID32(SC1200_DISPLAY_CONFIG); /* SET RELEVANT FIELDS */ dcfg |= (SC1200_DCFG_FP_PWR_EN | SC1200_DCFG_FP_DATA_EN); /* Enable the flatpanel power and data */ WRITE_VID32(SC1200_DISPLAY_CONFIG, dcfg); } else if (hw_video == GFX_VID_REDCLOUD) { /* READ DISPLAY CONFIG FROM REDCLOUD */ dcfg = READ_VID32(RCDF_DISPLAY_CONFIG); /* SET RELEVANT FIELDS */ dcfg |= (RCDF_DCFG_FP_PWR_EN | RCDF_DCFG_FP_DATA_EN); /* Enable the flatpanel power and data */ WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg); } } /*----------------------------------------------------------------- * Pnl_PowerDown * * Description: This function make power down based on the * hardware platforms dorado or centaraus. * * parameters: none. * * return: none. *-----------------------------------------------------------------*/ void Pnl_PowerDown(void) { int Platform; unsigned long dcfg, hw_video; Platform = Pnl_GetPlatform(); #if PLATFORM_CENTAURUS if (Platform == CENTAURUS_PLATFORM) { Centaurus_Power_Down(); return; } #endif #if PLATFORM_DORADO if (Platform == DORADO_PLATFORM) { Dorado_Power_Down(); return; } #endif #if PLATFORM_GX2BASED if (Platform == REDCLOUD_PLATFORM) { } #endif hw_video = gfx_detect_video(); if (hw_video == GFX_VID_CS5530) { /* READ DISPLAY CONFIG FROM CX5530 */ dcfg = READ_VID32(CS5530_DISPLAY_CONFIG); /* CLEAR RELEVANT FIELDS */ dcfg &= ~(CS5530_DCFG_FP_PWR_EN | CS5530_DCFG_FP_DATA_EN); /* Disable the flatpanel power and data */ WRITE_VID32(CS5530_DISPLAY_CONFIG, dcfg); } else if (hw_video == GFX_VID_SC1200) { /* READ DISPLAY CONFIG FROM SC1200 */ dcfg = READ_VID32(SC1200_DISPLAY_CONFIG); /* CLEAR RELEVANT FIELDS */ dcfg &= ~(SC1200_DCFG_FP_PWR_EN | SC1200_DCFG_FP_DATA_EN); /* Disable the flatpanel power and data */ WRITE_VID32(SC1200_DISPLAY_CONFIG, dcfg); } else if (hw_video == GFX_VID_REDCLOUD) { /* READ DISPLAY CONFIG FROM REDCLOUD */ dcfg = READ_VID32(RCDF_DISPLAY_CONFIG); /* CLEAR RELEVANT FIELDS */ dcfg &= ~(RCDF_DCFG_FP_PWR_EN | RCDF_DCFG_FP_DATA_EN); /* Disable the flatpanel power and data */ WRITE_VID32(RCDF_DISPLAY_CONFIG, dcfg); } } /*----------------------------------------------------------------- * Pnl_SavePanelState * * Description: This function saves the panel state based on the * hardware platforms dorado or centaraus. * * parameters: none. * * return: none. *-----------------------------------------------------------------*/ void Pnl_SavePanelState(void) { int Platform; Platform = Pnl_GetPlatform(); #if PLATFORM_CENTAURUS if (Platform == CENTAURUS_PLATFORM) { Centaurus_Save_Panel_State(); return; } #endif #if PLATFORM_DORADO if (Platform == DORADO_PLATFORM) { Dorado_Save_Panel_State(); return; } #endif #if PLATFORM_GX2BASED if (Platform == REDCLOUD_PLATFORM) { } #endif } /*----------------------------------------------------------------- * Pnl_RestorePanelState * * Description: This function restore the panel state based on the * hardware platforms dorado or centaraus. * * parameters: none. * * return: none. *-----------------------------------------------------------------*/ void Pnl_RestorePanelState(void) { int Platform; Platform = Pnl_GetPlatform(); #if PLATFORM_CENTAURUS if (Platform == CENTAURUS_PLATFORM) { Centaurus_Restore_Panel_State(); return; } #endif #if PLATFORM_DORADO if (Platform == DORADO_PLATFORM) { Dorado_Restore_Panel_State(); return; } #endif #if PLATFORM_GX2BASED if (Platform == REDCLOUD_PLATFORM) { } #endif } /*----------------------------------------------------------------- * Pnl_GetPanelParam * * Description: This function gets the panel parameters from the * hardware platforms dorado or centaraus. * * parameters: * pParam: It specifies the elements of the panel parameter * structure. * * return: none. *-----------------------------------------------------------------*/ void Pnl_GetPanelParam(Pnl_PanelParams * pParam) { if (pParam->Flags & PNL_PANELPRESENT) { pParam->PanelPresent = Pnl_IsPanelPresent(); } if (pParam->Flags & PNL_PLATFORM) { pParam->Platform = Pnl_GetPlatform(); } if ((pParam->Flags & PNL_PANELCHIP) || (pParam->Flags & PNL_PANELSTAT)) { #if PLATFORM_CENTAURUS if (pParam->Platform == CENTAURUS_PLATFORM) { Centaurus_Get_9211_Details(pParam->Flags, pParam); return; } #endif #if PLATFORM_DORADO if (pParam->Platform == DORADO_PLATFORM) { Dorado_Get_9211_Details(pParam->Flags, pParam); return; } #endif #if PLATFORM_GX2BASED if (pParam->Platform == REDCLOUD_PLATFORM) { } #endif /* if unknown platform put unknown */ if (pParam->Flags & PNL_PANELCHIP) pParam->PanelChip = PNL_UNKNOWN_CHIP; if (pParam->Flags & PNL_PANELSTAT) { pParam->PanelStat.XRes = 0; pParam->PanelStat.YRes = 0; pParam->PanelStat.Depth = 0; pParam->PanelStat.MonoColor = PNL_UNKNOWN_COLOR; pParam->PanelStat.Type = PNL_UNKNOWN_PANEL; } } } /*----------------------------------------------------------------- * Pnl_SetPanelChip * * Description: This function sets the panelchip parameter of panel * structure. * * parameters: * panelChip: It specifies the panelChip value. * * return: none. *-----------------------------------------------------------------*/ void Pnl_SetPanelChip(int panelChip) { /* To Be Implemented */ sPanelParam.PanelChip = panelChip; } /*----------------------------------------------------------------- * Pnl_GetPanelChip * * Description: This function gets the panelchip parameter of panel * structure. * * parameters: none * * return: On success it returns the panelchip. *-----------------------------------------------------------------*/ int Pnl_GetPanelChip(void) { /* To Be Implemented */ return sPanelParam.PanelChip; } /*----------------------------------------------------------------- * Pnl_InitPanel * * Description: This function initializes the panel with * hardware platforms dorado or centaraus. * * parameters: * pParam: It specifies the elements of the panel parameter * structure. * * return: none. *-----------------------------------------------------------------*/ int Pnl_InitPanel(Pnl_PanelParams * pParam) { Pnl_PanelParams *pPtr; if (pParam == 0x0) /* NULL use the static table */ pPtr = &sPanelParam; else pPtr = pParam; if (!pPtr->PanelPresent) { return -1; /* error */ } else { if ((pPtr->PanelChip < 0) || (pPtr->Platform < 0)) return -1; /* error */ #if PLATFORM_DRACO /* check we are init. the right one */ if ((pPtr->Platform == DRACO_PLATFORM) && (pPtr->PanelChip == PNL_9210)) { Draco9210Init(&(pPtr->PanelStat)); } #endif #if PLATFORM_CENTAURUS /* check we are init. the right one */ if (pPtr->Platform == CENTAURUS_PLATFORM) { Centaurus_9211init(&(pPtr->PanelStat)); } #endif #if PLATFORM_DORADO /* check we are init. the right one */ if ((pPtr->Platform == DORADO_PLATFORM) && (pPtr->PanelChip == PNL_9211_C)) { Dorado9211Init(&(pPtr->PanelStat)); } #endif #if PLATFORM_GX2BASED if (pPtr->Platform == REDCLOUD_PLATFORM) { Redcloud_9211init(&(pPtr->PanelStat)); } #endif } /* else end */ return 1; } xf86-video-geode-2.11.18/src/panel/platform.c0000644000175000017500000001634212654445443015464 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contains platform dependent functions * which provide interface to that platform. * * SubModule: Geode FlatPanel library * */ #define LINUX_ROM_SEGMENT 0x000F #define SEGMENT_LENGTH 0xFFFF #define PAGE_LENGTH 0x1000 #define SYS_BOARD_NAME_LEN 24 #define PLT_UNKNOWN 0xFFFF typedef struct { char sys_board_name[SYS_BOARD_NAME_LEN]; SYS_BOARD sys_board; } SYS_BOARD_INFO; static SYS_BOARD_INFO Sys_info; /* * The names in the sys_board_name string must exactly match the names in the * BIOS header. These names are used by FindStringInSeg() to find the names * in the BIOS header space. The BIOS does not use OTHER; it is a dummy value * for program useonly. */ SYS_BOARD_INFO Sys_board_info_array[] = { {"Marmot", MARMOT_PLATFORM}, {"Unicorn", UNICORN_PLATFORM}, {"Centaurus", CENTAURUS_PLATFORM}, {"Aries", ARIES_PLATFORM}, {"Carmel", CARMEL_PLATFORM}, {"Hyrda", HYDRA_PLATFORM}, {"Dorado", DORADO_PLATFORM}, {"Redcloud", REDCLOUD_PLATFORM}, {"Other", OTHER_PLATFORM} }; #define NUM_SYS_BOARD_TYPES \ sizeof(Sys_board_info_array)/sizeof(SYS_BOARD_INFO) static int Num_sys_board_type = NUM_SYS_BOARD_TYPES; SYS_BOARD_INFO *Sys_board_array_base = Sys_board_info_array; int FindStringInSeg(unsigned int, char *); static unsigned char get_sys_board_type(SYS_BOARD_INFO *, SYS_BOARD_INFO *); /* Detect the Platform */ int Detect_Platform(void) { /* See if we can find the board name using Xpressrom */ get_sys_board_type(&Sys_info, Sys_board_array_base); return (Sys_info.sys_board); } static int Strncmp(char *str1, char *str2, int len) { int i; if ((str1 == 0x0) || (str2 == 0x0) || (len == 0)) return (1); for (i = 0; i < len; i++) { if (*(str1 + i) > *(str2 + i)) { return 1; } else if (*(str1 + i) < *(str2 + i)) { return -1; } } return 0; } static char * Strcpy(char *dst, char *src) { int i; if ((dst == 0x0) || (src == 0x0)) return (0); for (i = 0; src[i] != 0x0; i++) { dst[i] = src[i]; } dst[i] = 0x0; /* NULL termination */ return dst; } static int Strlen(char *str) { int i; if (str == 0x0) return 0; for (i = 0; str[i] != 0x0; i++); return i; } /* Platform Detection Code */ /************************************************************************ * int FindStringInSeg( unsigned int segment_address, char *string_ptr ) * * Returns the offset where the NULL terminated string pointed to by * string_ptr is located in the segment passed in segment_address. * Segment_address must be of the form 0xXXXX (i.e 0xf000 for segment f). * Returns NULL if the string is not found. ************************************************************************ */ int FindStringInSeg(unsigned int segment_address, char *string_ptr) { int string_length = Strlen(string_ptr); char *psegment_buf; unsigned long mem_ptr = (unsigned long) segment_address << 16; unsigned int i; /* silence compiler */ (void) mem_ptr; psegment_buf = (char *) XpressROMPtr; /* Now search for the first character of the string_ptr */ for (i = 0; i < SEGMENT_LENGTH + 1; i++) { if (*(psegment_buf + i) == *string_ptr) { /* If we match the first character, do a * string compare. */ if (!Strncmp(string_ptr, (psegment_buf + i), string_length)) { /* They match! */ return (1); } } } /* if we got this far we didn't find anything. Return NULL. */ return (0); } /* end FindStringInSeg() */ /********************************************************************** * TRUE_FALSE get_sys_board_type( SYS_BOARD_INFO *sys_info, * SYS_BOARD_INFO *sys_board_array_base) * * Checks the system BIOS area for Xpressrom information. If found, searches * the BIOS area for one of names in the array pointed to by * sys_board_array_ptr. * If a match is found, sets the SYS_INFO system_board_name string * and the system_board variable to the board name and returns TRUE. * If Xpressrom or a board is not found, sets the variables to * their default values and returns FALSE. * Uses the global string pointer *xpress_rom_string_ptr. *********************************************************************** */ static unsigned char get_sys_board_type(SYS_BOARD_INFO * sys_info, SYS_BOARD_INFO * sys_board_array_base) { int index; char *xpress_rom_string_ptr = "XpressStart"; unsigned int segment = LINUX_ROM_SEGMENT; /* See if XpressStart is present in the BIOS area. * If it is, search for a board string. If not, Xpressrom is * not present, set system_board information to UNKNOWN and * return FALSE. */ if (!FindStringInSeg(segment, xpress_rom_string_ptr)) { sys_info->sys_board = PLT_UNKNOWN; Strcpy(sys_info->sys_board_name, "Unknown"); return (FALSE); } else { /* we have Xpressrom, so look for a board */ for (index = 0; index < Num_sys_board_type; index++) { if (!FindStringInSeg(segment, (sys_board_array_base + index)->sys_board_name)) { continue; } else { /* a match!! */ sys_info->sys_board = (sys_board_array_base + index)->sys_board; Strcpy(sys_info->sys_board_name, (sys_board_array_base + index)->sys_board_name); return (TRUE); } } /* end for() */ } /* end else */ /* if we are here we have failed */ sys_info->sys_board = PLT_UNKNOWN; Strcpy(sys_info->sys_board_name, "Unknown"); return (FALSE); } /* end get_sys_board_type() */ xf86-video-geode-2.11.18/src/panel/dora9211.c0000644000175000017500000004275512654445443015111 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contains the panel functions to interface * the dorado platform. * * SubModule: Geode FlatPanel library * */ #include "dora9211.h" void Dorado_Get_9211_Details(unsigned long flags, Pnl_PanelParams * pParam) { unsigned long DPanelType; int i; for (i = 0; i < 0x7fff; i++) { } Dorado9211GpioInit(); for (i = 0; i < 5; i++) toggle_Centaurus_9211_clock(); if (flags & PNL_PANELCHIP) { DPanelType = Dorado9211ReadReg(0x430); if ((DPanelType & 0xFFFF0000) == 0x92110000) { /* found 9211 */ /* check the values for revision ID */ if (DPanelType >= 0x92110301) pParam->PanelChip = PNL_9211_C; else if ((DPanelType >= 0x92110101) && (DPanelType < 0x92110301)) pParam->PanelChip = PNL_9211_A; else pParam->PanelChip = PNL_UNKNOWN_CHIP; } else { /* no 9211 present */ pParam->PanelChip = PNL_UNKNOWN_CHIP; } } if ((pParam->PanelChip != PNL_UNKNOWN_CHIP) && (flags & PNL_PANELSTAT)) { unsigned long PanelTypeOrg; unsigned char Panel_2Byte; DPanelType = Dorado9211ReadReg(0x438); DPanelType &= 0x00e8e8e8; DPanelType |= 0x00170000; Dorado9211WriteReg(0x438, DPanelType); DPanelType = 0; DPanelType = Dorado9211ReadReg(0x434); DPanelType = (DPanelType >> (DRD_LCDRESGPIO1 + 1)); PanelTypeOrg = DPanelType >> 8; Panel_2Byte = (unsigned char) PanelTypeOrg; Panel_2Byte = (Panel_2Byte >> (DRD_LCDRESGPIO2 - DRD_LCDRESGPIO1 - 1)); DPanelType = (DPanelType | ((unsigned int) Panel_2Byte << 8)); DPanelType = DPanelType >> 1; PanelTypeOrg = DPanelType >> 8; Panel_2Byte = (unsigned char) PanelTypeOrg; Panel_2Byte = (Panel_2Byte >> (DRD_LCDRESGPIO3 - DRD_LCDRESGPIO2 - 1)); DPanelType = (DPanelType | ((unsigned int) Panel_2Byte << 8)); DPanelType = DPanelType >> 1; PanelTypeOrg = DPanelType >> 8; Panel_2Byte = (unsigned char) PanelTypeOrg; Panel_2Byte = (Panel_2Byte >> (DRD_LCDRESGPIO4 - DRD_LCDRESGPIO3 - 1)); DPanelType = (DPanelType | ((unsigned int) Panel_2Byte << 8)); DPanelType = DPanelType >> 5; DPanelType &= 0xf; switch (DPanelType) { case 8: pParam->PanelStat.XRes = 800; pParam->PanelStat.YRes = 600; pParam->PanelStat.Depth = 18; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_TFT; break; case 9: pParam->PanelStat.XRes = 640; pParam->PanelStat.YRes = 480; pParam->PanelStat.Depth = 8; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_SSTN; break; case 10: pParam->PanelStat.XRes = 1024; pParam->PanelStat.YRes = 768; pParam->PanelStat.Depth = 18; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_TFT; break; case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 11: pParam->PanelStat.XRes = 640; pParam->PanelStat.YRes = 480; pParam->PanelStat.Depth = 16; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_DSTN; break; case 12: pParam->PanelStat.XRes = 640; pParam->PanelStat.YRes = 480; pParam->PanelStat.Depth = 18; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_TFT; break; case 13: pParam->PanelStat.XRes = 1024; pParam->PanelStat.YRes = 768; pParam->PanelStat.Depth = 24; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_DSTN; break; case 14: pParam->PanelStat.XRes = 640; pParam->PanelStat.YRes = 480; pParam->PanelStat.Depth = 8; pParam->PanelStat.MonoColor = PNL_MONO_PANEL; pParam->PanelStat.Type = PNL_DSTN; break; case 15: pParam->PanelStat.XRes = 800; pParam->PanelStat.YRes = 600; pParam->PanelStat.Depth = 16; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_DSTN; break; default: break; } } /* if block end */ } void Dorado9211Init(Pnl_PanelStat * pstat) { int mode; unsigned long orig_value, pm_value; gfx_delay_milliseconds(100); Dorado9211GpioInit(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); gfx_delay_milliseconds(100); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, 0x0); gfx_delay_milliseconds(100); gfx_delay_milliseconds(100); /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */ for (mode = 0; mode < NUM_92XX_MODES; mode++) { if ((FPModeParams[mode].xres == pstat->XRes) && (FPModeParams[mode].yres == pstat->YRes) && (FPModeParams[mode].bpp == pstat->Depth) && (FPModeParams[mode].panel_type == pstat->Type) && (FPModeParams[mode].color_type == pstat->MonoColor)) { /* SET THE 92xx FOR THE SELECTED MODE */ CS92xx_MODE *pMode = &FPModeParams[mode]; Dorado9211WriteReg(CS92xx_LCD_PAN_TIMING1, pMode->panel_timing1); Dorado9211WriteReg(CS92xx_LCD_PAN_TIMING2, pMode->panel_timing2); Dorado9211WriteReg(CS92xx_LCD_DITH_FR_CNTRL, pMode->rev_C_dither_frc); Dorado9211WriteReg(CS92xx_BLUE_LSFR_SEED, pMode->blue_lsfr_seed); Dorado9211WriteReg(CS92xx_RED_GREEN_LSFR_SEED, pMode->red_green_lsfr_seed); DoradoProgramFRMload(); Dorado9211WriteReg(CS92xx_LCD_MEM_CNTRL, pMode->memory_control); Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, pMode->power_management); gfx_delay_milliseconds(100); gfx_delay_milliseconds(100); Dorado9211ClearCS(); /* This code is added to take care of Panel initialization. * Irrespective of Xpressrom is enabling the panel or not. */ orig_value = READ_VID32(0X04); WRITE_VID32(0x04, 0x00200141); gfx_delay_milliseconds(21); pm_value = gfx_ind(0x9030); pm_value |= 0x400; gfx_outd(0x9030, pm_value); gfx_delay_milliseconds(4); orig_value &= 0xfff1ffff; WRITE_VID32(0X4, orig_value); return; } /*end if() */ } /*end for() */ } void Dorado9211SetCS(void) { unsigned long value; value = gfx_ind(DRD_CSP9211IN); gfx_outd(DRD_CSP9211OUT, value | DRD_CS9211); } void Dorado9211ClearCS(void) { unsigned long value; value = gfx_ind(DRD_CSP9211IN); gfx_outd(DRD_CSP9211OUT, value & (~DRD_CS9211)); } void Dorado9211SetDataOut(void) { unsigned long value; value = gfx_ind(DRD_DATAOUTP9211IN); gfx_outd(DRD_DATAOUTP9211OUT, value | DRD_DATAIN9211); } void Dorado9211ClearDataOut(void) { unsigned long value; value = gfx_ind(DRD_DATAOUTP9211IN); gfx_outd(DRD_DATAOUTP9211OUT, value & (~DRD_DATAIN9211)); } unsigned char Dorado9211ReadDataIn(void) { unsigned char readdata = 0; unsigned long value; /* why to read 4 times ??? */ value = gfx_ind(DRD_DATAINP9211IN); value = gfx_ind(DRD_DATAINP9211IN); value = gfx_ind(DRD_DATAINP9211IN); value = gfx_ind(DRD_DATAINP9211IN); if (value & DRD_DATAOUT9211) readdata = 1; return (readdata); } void Dorado9211ToggleClock(void) { Dorado9211SetClock(); Dorado9211ClearClock(); } void Dorado9211SetClock(void) { unsigned long value; value = gfx_ind(DRD_CLOCKP9211IN); gfx_outd(DRD_CLOCKP9211OUT, value | DRD_CLOCK9211); } void Dorado9211ClearClock(void) { unsigned long value; value = gfx_ind(DRD_CLOCKP9211IN); gfx_outd(DRD_CLOCKP9211OUT, value & (~DRD_CLOCK9211)); } void Dorado9211GpioInit(void) { unsigned long value; /* set output enable on gpio 7, 9, 11 */ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_SEL), DRD_CLOCK9211CFG); gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_CFG), 3); /* set output enable on gpio 7, 9, 11 */ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_SEL), DRD_CS9211CFG); gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_CFG), 3); /* set output enable on gpio 7, 9, 18 */ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_SEL), DRD_DATAIN9211CFG); gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_CFG), 3); /* disable on gpio 11 - This is the output from the 9211 */ gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_SEL), DRD_DATAOUT9211CFG); gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPPIN_CFG), 0); /* Set all PINS low */ value = gfx_ind(DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDI0); value &= ~(DRD_CS9211 | DRD_CLOCK9211 | DRD_DATAIN9211); gfx_outd((DRD_GEODE_GPIO_BASE + DRD_GEODE_GPDO0), value); } unsigned long Dorado9211ReadReg(unsigned short index) { unsigned char i, readbit; unsigned long data; Dorado9211ClearDataOut(); Dorado9211SetCS(); Dorado9211ToggleClock(); Dorado9211SetDataOut(); Dorado9211ToggleClock(); for (i = 0; i < 12; i++) { if (index & 0x1) { Dorado9211SetDataOut(); } else { Dorado9211ClearDataOut(); } Dorado9211ToggleClock(); index >>= 1; } Dorado9211ClearDataOut(); Dorado9211ToggleClock(); /* Idle clock, 7 clocks, no data set */ Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); data = 0; for (i = 0; i < 32; i++) { Dorado9211ToggleClock(); readbit = Dorado9211ReadDataIn(); data |= (((unsigned long) readbit) << i); } Dorado9211ClearCS(); Dorado9211ToggleClock(); return (data); } void Dorado9211WriteReg(unsigned short index, unsigned long data) { unsigned char i; Dorado9211ClearDataOut(); Dorado9211SetDataOut(); Dorado9211SetCS(); Dorado9211ToggleClock(); Dorado9211SetDataOut(); Dorado9211ToggleClock(); for (i = 0; i < 12; i++) { if (index & 0x1) { Dorado9211SetDataOut(); } else { Dorado9211ClearDataOut(); } Dorado9211ToggleClock(); index >>= 1; } Dorado9211SetDataOut(); Dorado9211ToggleClock(); for (i = 0; i < 32; i++) { if (data & 0x1) { Dorado9211SetDataOut(); } else { Dorado9211ClearDataOut(); } Dorado9211ToggleClock(); data >>= 1; } Dorado9211ClearCS(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); Dorado9211ToggleClock(); } void DoradoProgramFRMload(void) { unsigned long DoradoFRMtable[] = { 0x00000000, 0x00000000, 0x01000100, 0x01000100, 0x01010101, 0x01010101, 0x02081041, 0x02081041, 0x10111111, 0x11111101, 0x49249241, 0x12412492, 0x92244891, 0x92244891, 0x22252525, 0x22252525, 0x528294a5, 0x2528494a, 0x294a5295, 0x294a5295, 0x54a54a95, 0x2952a52a, 0x2a552a55, 0x2a552a55, 0x554aa955, 0x2a9552aa, 0x2aaa5555, 0x2aaa5555, 0x55555555, 0x2aaaaaaa, 0x55555555, 0x55555555, 0xaaaaaaab, 0x55555555, 0x5555aaab, 0x5555aaab, 0xaab556ab, 0x556aad55, 0x55ab55ab, 0x55ab55ab, 0xab5ab56b, 0x56ad5ad5, 0x56b5ad6b, 0x56b5ad6b, 0xad6d6b5b, 0x5ad6b6b6, 0x5b5b5b5b, 0x5b5b5b5b, 0x5F6db6db, 0x5F6db6db, 0xF776F776, 0xF776F776, 0xFBDEFBDE, 0xFBDEFBDE, 0x7eFFBFF7, 0x7eFFBFF7, 0xFF7FF7F7, 0xFF7FF7F7, 0xFF7FFF7F, 0xFF7FFF7F, 0xFFF7FFFF, 0xFFF7FFFF, 0xFFFFFFFF, 0xFFFFFFFF, }; unsigned char i; unsigned short index; unsigned long data; Dorado9211WriteReg(CS92xx_FRM_MEMORY_INDEX, 0); index = CS92xx_FRM_MEMORY_DATA; for (i = 0; i < 64; i += 2) { data = DoradoFRMtable[i]; Dorado9211WriteReg(index, data); data = DoradoFRMtable[i + 1]; Dorado9211WriteReg(index, data); } /* * The first FRM location (64 bits) does not program correctly. * This location always reads back with the last value programmed. * ie. If 32 64-bit values are programmed, location 0 reads back as the 32nd * If 30 locations are programmed, location 0 reads back as the 30th, etc. * Fix this by re-writing location 0 after programming all 64 in the writeFRM * loop in RevCFrmload() in CS9211. */ Dorado9211WriteReg(CS92xx_FRM_MEMORY_INDEX, 0); Dorado9211WriteReg(CS92xx_FRM_MEMORY_DATA, 0); Dorado9211WriteReg(CS92xx_FRM_MEMORY_DATA, 0); } /***************************************************************************** * void Dorado_Enable_Power((void); * Enables the power of the CX9211 on Dorado board. ***************************************************************************** */ void Dorado_Power_Up(void) { Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, 0x01000000); return; } /* disable_Centaurus_Power */ /***************************************************************************** * void Dorado_Disable_Power((void); * Disables the power of the CX9211 on Dorado board. ***************************************************************************** */ void Dorado_Power_Down(void) { Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, 0x0); return; } /* disable_Centaurus_Power */ void Dorado_Save_Panel_State(void) { /* set 9211 registers using the desired panel settings */ cs9211_regs.panel_timing1 = Dorado9211ReadReg(CS92xx_LCD_PAN_TIMING1); cs9211_regs.panel_timing2 = Dorado9211ReadReg(CS92xx_LCD_PAN_TIMING2); cs9211_regs.dither_frc_ctrl = Dorado9211ReadReg(CS92xx_LCD_DITH_FR_CNTRL); cs9211_regs.blue_lsfr_seed = Dorado9211ReadReg(CS92xx_BLUE_LSFR_SEED); cs9211_regs.red_green_lsfr_seed = Dorado9211ReadReg(CS92xx_RED_GREEN_LSFR_SEED); /* CentaurusProgramFRMload(); */ cs9211_regs.memory_control = Dorado9211ReadReg(CS92xx_LCD_MEM_CNTRL); /* Set the power register last. This will turn the panel on at the 9211 */ cs9211_regs.power_management = Dorado9211ReadReg(CS92xx_LCD_PWR_MAN); cs9211_regs.panel_state = cs9211_regs.power_management; } void Dorado_Restore_Panel_State(void) { unsigned long off_data = 0; /* Before restoring the 9211 registers, power off the 9211. */ Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, off_data); /* set 9211 registers using the desired panel settings */ Dorado9211WriteReg(CS92xx_LCD_PAN_TIMING1, cs9211_regs.panel_timing1); Dorado9211WriteReg(CS92xx_LCD_PAN_TIMING2, cs9211_regs.panel_timing2); /* load the LSFR seeds */ Dorado9211WriteReg(CS92xx_LCD_DITH_FR_CNTRL, cs9211_regs.dither_frc_ctrl); Dorado9211WriteReg(CS92xx_BLUE_LSFR_SEED, cs9211_regs.blue_lsfr_seed); Dorado9211WriteReg(CS92xx_RED_GREEN_LSFR_SEED, cs9211_regs.red_green_lsfr_seed); Dorado9211WriteReg(CS92xx_LCD_MEM_CNTRL, cs9211_regs.memory_control); /* Set the power register last. This will turn the panel on at the 9211 */ Dorado9211WriteReg(CS92xx_LCD_PWR_MAN, cs9211_regs.power_management); } xf86-video-geode-2.11.18/src/panel/readme.txt0000644000175000017500000004247012654445443015473 00000000000000Panel Library Release 1.3.6 OS - Can be used in all OS's. May 19, 2003 Developer - Sarma Kolluru ----------------------------------------------------------------------------- PRODUCT INFORMATION ----------------------------------------------------------------------------- Panel library is set of functions enabling the driver to give panel support. The panel library is supported on Centaurus and Dorado. The panel library can detect the panel support by the jumper settings selected on the board. The platform can be detected too. \readme.txt This file ----------------------------------------------------------------------------- BUILD INSTRUCTIONS ----------------------------------------------------------------------------- Panel library is a set of files which has support for flatpanel. The panel subdirectory needs to be copied in the driver directory. ----------------------------------------------------------------------------- INSTALLATION INSTRUCTIONS ----------------------------------------------------------------------------- These is no instalation and to be treaded as a driver source code extension. ----------------------------------------------------------------------------- UNIT TEST Panel library when compiled is a part of the driver and cannot be unit tested. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- REVISION HISTORY ----------------------------------------------------------------------------- Version changes v1.3.6 05/19/03 ----------------------------------------------------------------------------- Dependencies: - None ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- - None. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- Removed the code which is not being used in linux env. The allocation of segment buffer in stack was the cause of instability. ----------------------------------------------------------------------------- FILE CHANGES platform.c ----------------------------------------------------------------------------- Version changes v1.3.5 02/28/03 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1o ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Added National Copyright header which replaced the GPL and BSD.. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None. ----------------------------------------------------------------------------- FILE CHANGES 92xx.h cen9211.c cen9211.h dora9211.c dora9211.h drac9210.c drac9210.h gx2_9211.c gx2_9211.h panel.h panel.c platform.c pnl_bios.c pnl_defs.h pnl_init.c ----------------------------------------------------------------------------- Version changes v1.3.4 12/30/02 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1o ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- - Added special GX2_READ and GX2_WRITE instead of READ/WRITE supplied by system. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None. ----------------------------------------------------------------------------- FILE CHANGES gx2_9211.c gx2_9211.h panel.c panel.h platform.c pnl_bios.c ----------------------------------------------------------------------------- Version changes v1.3.3 12/17/02 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1o ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- - None ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - 125.10 Panel code no longer compiles under WinCE with latest change. ----------------------------------------------------------------------------- FILE CHANGES drac9210.c ----------------------------------------------------------------------------- Version changes v1.3.2 12/10/02 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1o ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- - Did code indentation for XFree release. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None. ----------------------------------------------------------------------------- FILE CHANGES 92xx.h cen9211.c cen9211.h dora9211.c dora9211.h drac9210.c drac9210.h gx2_9211.c gx2_9211.h panel.h panel.c platform.c pnl_bios.c pnl_defs.h pnl_init.c ----------------------------------------------------------------------------- Version changes v1.3.1 12/06/02 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1o ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- - Added function protoype. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None. ----------------------------------------------------------------------------- FILE CHANGES cen9211.h dora9211.h gx2_9211.h ----------------------------------------------------------------------------- Version changes v1.3.0 11/29/02 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1o ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- - None. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - cursor variable not defined for XFree when not as a module. ----------------------------------------------------------------------------- FILE CHANGES platform.c ----------------------------------------------------------------------------- Version changes v1.2.9 7/31/02 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1o ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Added FP setup from user input. Added Redcloud Panel initialization. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES pnl_init.c panel.c platform.c gx2_9211.c gx2_9211.h ----------------------------------------------------------------------------- Version changes v1.2.8 5/16/02 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1o ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Added FP detection with BIOS for GX2. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES pnl_bios.c ----------------------------------------------------------------------------- Version changes v1.2.7 1/20/02 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1o ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Added the protoype for gfx_detect_video. Durango dependency removed. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES panel.c ----------------------------------------------------------------------------- Version changes v1.2.6 12/1/01 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1o - Durango 2.35.01 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Toggle 5530/scx200/RC FlatPanel Power and Data accordingly during power up/down. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES pnl_init.c ----------------------------------------------------------------------------- Version changes v1.2.5 11/1/01 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1o - Durango 2.35.01 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Re-Enabled the Draco platform support. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES panel_defs.h pnl_init.c ----------------------------------------------------------------------------- Version changes v1.2.4 08/12/01 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1 - Durango 2.33.01 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Added 2 functions to get the FP setting details from BIOS. int Pnl_IsPanelEnabledInBIOS(void); void Pnl_GetPanelInfoFromBIOS(int *xres, int *yres, int *bpp, int *hz); ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES panel.h pnl_bios.c ----------------------------------------------------------------------------- Version changes v1.2.3 06/05/01 ----------------------------------------------------------------------------- Dependencies: - crlf v1.0.1 - Durango 2.31.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Code cleanup and documentation. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES panel.h cen9211.c cen9211.h dora9211.c dora9211.h panel.h pnl_init.c ----------------------------------------------------------------------------- Version changes v1.2.2 04/11/01 ----------------------------------------------------------------------------- Dependencies: - Durango 2.27.00 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Added Pnl_PowerUp and Pnl_PowerDown Functions. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES panel.h cen9211.c cen9211.h dora9211.c dora9211.h panel.h pnl_init.c ----------------------------------------------------------------------------- Version changes v1.2.1 03/29/01 ----------------------------------------------------------------------------- Dependencies: - Durango 2.25 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Added Pnl_SavePanelState and Pnl_RestorePanelState Functions. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES panel.h 92xx.h cen9211.c cen9211.h dora9211.c dora9211.h platform.c pnl_init.c ----------------------------------------------------------------------------- Version changes v1.2.0 03/04/01 ----------------------------------------------------------------------------- Dependencies: - Durango 2.23 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Use inb/out routines from durango directly. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES panel.h -inb/outb deleted. ============================================================================= Version changes v1.0.1 02/02/01 ----------------------------------------------------------------------------- Dependencies: - Durango 2.19 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Added 9211 Rev. C on Centaurus platform. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES 92xx.h -9211 Rev.C. cen9211.c - centaurus 9211_C support file. cen9211.h - centaurus 9211_C support file. platform.c - Support for detection of platform in which driver runs. ============================================================================= Version changes v1.0.0 01/21/01 ----------------------------------------------------------------------------- Dependencies: - Durango 2.16 ----------------------------------------------------------------------------- FUNCTIONAL CHANGES ----------------------------------------------------------------------------- Detection of platform Detection of 92x chip with version and the panel sected by jumper settings. initialization of the h/w. ----------------------------------------------------------------------------- DEFECTS CORRECTED ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- FILE CHANGES 92xx.h -common file with all 9211/9210 definitions. cen9211.c - centaurus 9211_A support file. cen9211.h - centaurus 9211_A support file. dora9211.c - dorado 9211_A support file. dora9211.h - dorado 9211_C support file. drac9210.c - draco 9210 support file. drac9210.h - draco 9210 support file. panel.c - This is the confiuration file to enable support for platforms. panel.h - centaurus 9211_A support file. platform.c - Support for detection of platform in which driver runs. pnl_defs.h - common definitions for panel. pnl_init.c - configurationto call appropriate platform calls. readme.txt - this file. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- KNOWN ERRATA ----------------------------------------------------------------------------- - None listed ----------------------------------------------------------------------------- xf86-video-geode-2.11.18/src/panel/drac9210.h0000644000175000017500000000330512654445443015065 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contains the panel header file and definition * for the platform with 9210 support. * * SubModule: Geode FlatPanel library * */ #include "panel.h" #ifndef _DRAC9210_h #define _DRAC9210_h #define CX55x0_ID 0x80009000 static unsigned char c92DataReg = 0; #endif /* !_DRAC9210_h */ /* END OF FILE */ xf86-video-geode-2.11.18/src/panel/cen9211.c0000644000175000017500000006606412654445443014730 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file contains panel functions to interface with * the centaraus platform. * * SubModule: Geode FlatPanel library * */ #include "cen9211.h" static unsigned char sioc2_orig_val; static unsigned char must_restore_97317 = FALSE; /******************************************************************** * * PASS_FAIL init_GPIO(void); * Initializes the GPIO pins in the Cx5530 or the National PC97317 * for use with a 9211 on a Marmot or Centaurus board. Uses * the global variables RdPCIVal and sioc2_orig_val. * *********************************************************************/ unsigned char init_Centaurus_GPIO(void) { unsigned char reg_val; static unsigned char first_time = TRUE; /* The Centaurus board uses ports 1 and 2 of the 97317 for GPIO. * These ports require bank 0 to be active. The first thing we will * do is verify that bank 0 is active and set it if it is not. */ /* set the index for access to the configuration register */ gfx_outb(CENT_CONFIG_INDEX, CENT_SIOC2); reg_val = gfx_inb(CENT_CONFIG_DATA); /* set to bank 0 */ if (reg_val & CENT_GPIO_BANK_SELECT) { gfx_outb(CENT_CONFIG_DATA, (unsigned char) (reg_val & ~CENT_GPIO_BANK_SELECT)); } /* If this is the first time we have modified sioc2, we must * save the current value (set by the BIOS) for restoration by * the calling program, set the global flag must_restore_97317, and set * first_time to FALSE. */ if (first_time == TRUE) { sioc2_orig_val = reg_val; must_restore_97317 = TRUE; first_time = FALSE; } /* set port 1 direction */ reg_val = gfx_inb(CENT_PORT1_DIRECTION); /* make GPIO 14 and 17 outputs */ reg_val |= CENT_97317_CLOCK_MASK | CENT_97317_DATA_OUT_MASK; gfx_outb(CENT_PORT1_DIRECTION, reg_val); /* set port 2 direction */ reg_val = gfx_inb(CENT_PORT2_DIRECTION); /* make GPIO 20 an output */ reg_val |= CENT_97317_CHIP_SEL_MASK; /* make GPIO 21 an input */ reg_val &= ~CENT_97317_DATA_IN_MASK; gfx_outb(CENT_PORT2_DIRECTION, reg_val); /* make GPIO 14 and 17 push-pull */ reg_val = gfx_inb(CENT_PORT1_OUTPUT_TYPE); reg_val |= CENT_97317_CLOCK_MASK | CENT_97317_DATA_OUT_MASK; gfx_outb(CENT_PORT1_OUTPUT_TYPE, reg_val); /* make GPIO 20 and 21 push-pull */ reg_val = gfx_inb(CENT_PORT2_OUTPUT_TYPE); reg_val |= CENT_97317_CHIP_SEL_MASK | CENT_97317_DATA_IN_MASK; gfx_outb(CENT_PORT2_OUTPUT_TYPE, reg_val); return CENT_PASS; } /* end init_GPIO() */ /********************************************************************* * * PASS_FAIL init_9211(void); * Initializes (sets to 0) the clock, chip select, and data pins * of the Cx9211 on a Marmot or Centaurus board. * **********************************************************************/ unsigned char init_Centaurus_9211(void) { unsigned char ReadData; /* Uses the 97317 for GPIO. * we will use the clock port define for port 1 */ ReadData = gfx_inb(CENT_97317_CLOCK_PORT); ReadData &= ~CENT_97317_CLOCK_MASK & ~CENT_97317_DATA_OUT_MASK; gfx_outb(CENT_97317_CLOCK_PORT, ReadData); /* we will use the chip select port define for port 2 */ ReadData = gfx_inb(CENT_97317_CHIP_SELECT); ReadData &= ~CENT_97317_CHIP_SEL_MASK & ~CENT_97317_DATA_IN_MASK; gfx_outb(CENT_97317_CHIP_SELECT, ReadData); return (CENT_PASS); } /*end init_9211() */ /****************************************************************** * * PASS_FAIL restore_97317_SIOC2(void); * Restores the original value to the 97317 SIOC2 register using * the global variable sioc2_orig_val. Returns PASS if the value * was written, FAIL if not. * *******************************************************************/ unsigned char restore_Centaurus_97317_SIOC2(void) { /* set the global flag */ if (must_restore_97317 == TRUE) { unsigned char cfg; /* set the index for access to the configuration register */ gfx_outb(CENT_CONFIG_INDEX, CENT_SIOC2); /* restore the value */ gfx_outb(CENT_CONFIG_DATA, sioc2_orig_val); /* now read and verify */ cfg = gfx_inb(CENT_CONFIG_DATA); if (cfg == sioc2_orig_val) return (CENT_PASS); else return (CENT_FAIL); } /* end if() */ return (CENT_FAIL); } /* end restore_97317_SIOC2bank() */ /* ----------------------------------------------------------------------- * * SET_FLAT_PANEL_MODE * * This routine sets the specified flat panel moden parameters in * the 9211. * Returns PASS if successful, FAIL if the mode parameters could * not be set. * *------------------------------------------------------------------------*/ unsigned char set_Centaurus_92xx_mode(Pnl_PanelStat * pstat) { int mode; /* LOOP THROUGH THE AVAILABLE MODES TO FIND A MATCH */ for (mode = 0; mode < NUM_92XX_MODES; mode++) { if ((FPModeParams[mode].xres == pstat->XRes) && (FPModeParams[mode].yres == pstat->YRes) && (FPModeParams[mode].bpp == pstat->Depth) && (FPModeParams[mode].panel_type == pstat->Type) && (FPModeParams[mode].color_type == pstat->MonoColor)) { /* SET THE 92xx FOR THE SELECTED MODE */ set_Centaurus_92xx_mode_params(mode); return (CENT_PASS); } /* end if() */ } /* end for() */ return (CENT_FAIL); } /* end set_Centaurus_92xx_mode() */ /*------------------------------------------------------------------- * * SET_92XX_MODE_PARAMS * This routine sets the 9211 mode parameters. * *-------------------------------------------------------------------*/ void set_Centaurus_92xx_mode_params(int mode) { CS92xx_MODE *pMode = &FPModeParams[mode]; unsigned long off_data = 0; /* Turn the 92xx power off before setting any new parameters. * Since we are going to reset all the power bit positions, we will * force the power register to 0. */ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN, off_data); /* set 9211 registers using the desired panel settings */ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PAN_TIMING1, pMode->panel_timing1); Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PAN_TIMING2, pMode->panel_timing2); if (Pnl_Rev_ID == PNL_9211_C) { /* load the LSFR seeds */ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_DITH_FR_CNTRL, pMode->rev_C_dither_frc); Centaurus_write_gpio(FOUR_BYTES, CS92xx_BLUE_LSFR_SEED, pMode->blue_lsfr_seed); Centaurus_write_gpio(FOUR_BYTES, CS92xx_RED_GREEN_LSFR_SEED, pMode->red_green_lsfr_seed); } else { Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_DITH_FR_CNTRL, pMode->pre_C_dither_frc); Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_BLOCK_SEL1, pMode->block_select1); Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_BLOCK_SEL2, pMode->block_select2); Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_DISPER1, pMode->dispersion1); Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_DISPER2, pMode->dispersion2); CentaurusProgramFRMload(); } Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_MEM_CNTRL, pMode->memory_control); /* Set the power register last. This will turn the panel on at the 9211. */ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN, pMode->power_management); } /* end set_Centaurus_92xx_mode_params() */ void Centaurus_write_gpio(int width, ULONG address, unsigned long data) { int num_clock_toggles; int count; unsigned long Addr = address; enable_Centaurus_9211_chip_select(); /* Write 1 Clock period of no valid transfer */ write_Centaurus_CX9211_GPIO(CENT_NO_DATA); /* Write 1 control bit (the data book calls this the control bar write) */ write_Centaurus_CX9211_GPIO(0x1); /* Write the 12-bit address */ for (count = 0; count < 12; count++) { write_Centaurus_CX9211_GPIO((unsigned char) (Addr & 0x01)); /*the 9211 expects data LSB->MSB */ Addr = Addr >> 1; } /* write */ write_Centaurus_CX9211_DWdata(data); /* a write will require four toggles after disabling CS */ num_clock_toggles = CENT_NUM_WRITE_CLOCK_TOGGLES; disable_Centaurus_9211_chip_select(); /* now toggle the clock */ for (count = 0; count < num_clock_toggles; count++) { toggle_Centaurus_9211_clock(); } return; } /* end Centaurus_write_gpio() */ unsigned long Centaurus_read_gpio(int width, unsigned long address) { int num_clock_toggles; int count; unsigned long Addr = address; unsigned long data; enable_Centaurus_9211_chip_select(); /* Write 1 Clock period of no valid transfer */ write_Centaurus_CX9211_GPIO(CENT_NO_DATA); /* Write 1 control bit (the data book calls this the control bar write) */ write_Centaurus_CX9211_GPIO(0x1); /* Write the 12-bit address */ for (count = 0; count < 12; count++) { write_Centaurus_CX9211_GPIO((unsigned char) (Addr & 0x01)); /*the 9211 expects data LSB->MSB */ Addr = Addr >> 1; } data = read_Centaurus_CX9211_DWdata(); /* a read will require one toggle after disabling CS */ num_clock_toggles = CENT_NUM_READ_CLOCK_TOGGLES; disable_Centaurus_9211_chip_select(); /* now toggle the clock */ for (count = 0; count < num_clock_toggles; count++) { toggle_Centaurus_9211_clock(); } return data; } /* end Centaurus_read_gpio() */ /******************************************************************* * * void enable_Centaurus_9211_chip_select(void); * Enables the chip select of the CX9211 using the National 97317 * on a Centaurus board. * *******************************************************************/ void enable_Centaurus_9211_chip_select(void) { unsigned char cs_port_val; /* Set the chip select (GPIO20) high */ cs_port_val = gfx_inb(CENT_97317_CHIP_SELECT); gfx_outb(CENT_97317_CHIP_SELECT, (unsigned char) (cs_port_val | CENT_97317_CHIP_SEL_MASK)); return; } /* end enable_Centaurus_9211_chip_select() */ /******************************************************************** * * void disable_Centaurus_9211_chip_select(void); * Disables the chip select of the CX9211 using the National 97317 * on a Centaurus board. * *******************************************************************/ void disable_Centaurus_9211_chip_select(void) { unsigned char cs_port_val; /* Set the chip select (GPIO20) low */ cs_port_val = gfx_inb(CENT_97317_CHIP_SELECT); gfx_outb(CENT_97317_CHIP_SELECT, (unsigned char) (cs_port_val & ~CENT_97317_CHIP_SEL_MASK)); return; } /* end disable_Centaurus_9211_chip_select() */ /********************************************************************** * * void toggle_Centaurus_9211_clock(void); * Toggles the clock bit of the CX9211 using the National 97317 on a * Centaurus board. Assumes the 9211 clock bit has previously been * initialized to 0 (this way we do not have to waste GPIO cycles * windowing the clock pulse). * **********************************************************************/ void toggle_Centaurus_9211_clock(void) { unsigned char port_val; /* get the 97317 GPIO port contents for the 9211 clock */ port_val = gfx_inb(CENT_97317_CLOCK_PORT); /* set the clock bit high */ gfx_outb(CENT_97317_CLOCK_PORT, (unsigned char) (port_val | CENT_97317_CLOCK_MASK)); /* set the clock bit low */ gfx_outb(CENT_97317_CLOCK_PORT, (unsigned char) (port_val & ~CENT_97317_CLOCK_MASK)); } /* end toggle_Centaurus_9211_clock() */ /******************************************************************** * * void write_Centaurus_CX9211_GPIO(unsigned char databit); * Writes the value in bit 0 of the value passed in databit to * the 9211 through the GPIO interface of the National 97317 on a * Centaurus board. * NOTE: This function does not set or reset the chip select line! * *******************************************************************/ void write_Centaurus_CX9211_GPIO(unsigned char databit) { unsigned char data_port_val; /* Set the data bit for (GPIO17) */ databit <<= 7; /* read the value of the other bits in the 97317 data port */ data_port_val = gfx_inb(CENT_97317_DATA_OUTPORT); /* set the bit accordingly */ data_port_val &= ~CENT_97317_DATA_OUT_MASK; data_port_val |= databit; gfx_outb(CENT_97317_DATA_OUTPORT, data_port_val); /* clock the data */ toggle_Centaurus_9211_clock(); return; } /* end write_Centaurus_CX9211_GPIO() */ /***************************************************************** * * void write_Centaurus_CX9211_DWdata(unsigned long data); * Writes the doubleword value passed in data to the CX9211 * using GPIO Pins of the National 97317 on a Centaurus board. * This function assumes the Direction register of the 97317 * and the address register of the CX9211 have been previously set. * Uses the global variable count. * NOTE: This function does not set or reset the chip select line! * ******************************************************************/ void write_Centaurus_CX9211_DWdata(unsigned long data) { int count; /* Send the read/write command to the 9211 first. */ write_Centaurus_CX9211_GPIO(CENT_WRITE); /* Now write the 32-bit Data */ for (count = 0; count < 32; count++) { write_Centaurus_CX9211_GPIO((unsigned char) (data & 0x01)); /* the 9211 expects the data LSB->MSB */ data >>= 1; } return; } /* end write_Centaurus_CX9211_DWdata() */ /********************************************************************* * * unsigned char read_Centaurus_CX9211_GPIO(void); * Returns the current value of the databit of the 9211 in bit 0 * using the GPIO interface of the National 97317 on a Centaurus board. * NOTE: This function does not set or reset the chip select line! * *********************************************************************/ unsigned char read_Centaurus_CX9211_GPIO(void) { unsigned char data_port_val; toggle_Centaurus_9211_clock(); /* read the data */ data_port_val = gfx_inb(CENT_97317_DATA_INPORT); /* Save the data from (GPIO21) as bit 0 */ data_port_val >>= 1; return (data_port_val & 0x1); } /* end read_Centaurus_CX9211_GPIO() */ /********************************************************************** * * void read_Centaurus_CX9211_DWdata(unsigned long *data); * Reads a doubleword value from the CX9211 using GPIO Pins of * the National 97317 on a Centaurus board. * This function assumes the Direction register of the 97317 and * the address register of the CX9211 have been previously set. * NOTE: This function does not set or reset the chip select line! * ***********************************************************************/ unsigned long read_Centaurus_CX9211_DWdata(void) { unsigned char ReadData; int count; unsigned long Data; /* Send read/write command word to the 9211 first. */ write_Centaurus_CX9211_GPIO(CENT_READ); /* The data book (revision 0.1) states 8 clock periods of no valid data. * However, the data becomes valid on the eighth clock, making the eighth * clock valid. Since read_Centaurus_GPIO() toggles the clock before * reading, we will only toggle the clock 7 times here. */ for (count = 0; count < 7; count++) /* works */ toggle_Centaurus_9211_clock(); /* Now read the 32-bit Data, bit by bit in a single loop. */ Data = 0; for (count = 0; count < 32; count++) { ReadData = read_Centaurus_CX9211_GPIO(); /* 9211 sends data LSB->MSB */ Data = Data | (((unsigned long) ReadData) << count); } /* end for() */ return Data; } /* end read_Centaurus_CX9211_DWdata() */ void Centaurus_Get_9211_Details(unsigned long flags, Pnl_PanelParams * pParam) { unsigned long PanelType; int i; for (i = 0; i < 0x7fff; i++) { } init_Centaurus_GPIO(); for (i = 0; i < 5; i++) toggle_Centaurus_9211_clock(); if (flags & PNL_PANELCHIP) { PanelType = Centaurus_read_gpio(FOUR_BYTES, 0x430); PanelType = Centaurus_read_gpio(FOUR_BYTES, 0x430); if ((PanelType & 0xFFFF0000) == 0x92110000) { /* found 9211 */ /* check the values for revision ID */ if (PanelType >= 0x92110301) pParam->PanelChip = PNL_9211_C; else if ((PanelType >= 0x92110101) && (PanelType < 0x92110301)) pParam->PanelChip = PNL_9211_A; else pParam->PanelChip = PNL_UNKNOWN_CHIP; } else { /* no 9211 present */ pParam->PanelChip = PNL_UNKNOWN_CHIP; } Pnl_Rev_ID = pParam->PanelChip; } /* if end */ if ((pParam->PanelChip != PNL_UNKNOWN_CHIP) && (flags & PNL_PANELSTAT)) { PanelType = Centaurus_read_gpio(FOUR_BYTES, 0x438); PanelType &= 0x00f8f8f8; PanelType |= 0x00070000; Centaurus_write_gpio(FOUR_BYTES, 0x438, PanelType); PanelType = 0; PanelType = Centaurus_read_gpio(FOUR_BYTES, 0x434); PanelType = (PanelType >> 8); PanelType &= 0x7; switch (PanelType) { case 0: pParam->PanelStat.XRes = 800; pParam->PanelStat.YRes = 600; pParam->PanelStat.Depth = 18; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_TFT; break; case 1: pParam->PanelStat.XRes = 640; pParam->PanelStat.YRes = 480; pParam->PanelStat.Depth = 8; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_SSTN; break; case 2: pParam->PanelStat.XRes = 1024; pParam->PanelStat.YRes = 768; pParam->PanelStat.Depth = 18; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_TFT; break; case 3: pParam->PanelStat.XRes = 640; pParam->PanelStat.YRes = 480; pParam->PanelStat.Depth = 16; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_DSTN; break; case 4: pParam->PanelStat.XRes = 640; pParam->PanelStat.YRes = 480; pParam->PanelStat.Depth = 18; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_TFT; break; case 5: pParam->PanelStat.XRes = 1024; pParam->PanelStat.YRes = 768; pParam->PanelStat.Depth = 24; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_DSTN; break; case 6: pParam->PanelStat.XRes = 640; pParam->PanelStat.YRes = 480; pParam->PanelStat.Depth = 8; pParam->PanelStat.MonoColor = PNL_MONO_PANEL; pParam->PanelStat.Type = PNL_DSTN; break; case 7: pParam->PanelStat.XRes = 800; pParam->PanelStat.YRes = 600; pParam->PanelStat.Depth = 16; pParam->PanelStat.MonoColor = PNL_COLOR_PANEL; pParam->PanelStat.Type = PNL_DSTN; break; default: break; } } } void CentaurusProgramFRMload(void) { unsigned long CentaurusFRMtable[] = { 0x00000000, 0x00000000, 0x01000100, 0x01000100, 0x01010101, 0x01010101, 0x02081041, 0x02081041, 0x10111111, 0x11111101, 0x49249241, 0x12412492, 0x92244891, 0x92244891, 0x22252525, 0x22252525, 0x528294a5, 0x2528494a, 0x294a5295, 0x294a5295, 0x54a54a95, 0x2952a52a, 0x2a552a55, 0x2a552a55, 0x554aa955, 0x2a9552aa, 0x2aaa5555, 0x2aaa5555, 0x55555555, 0x2aaaaaaa, 0x55555555, 0x55555555, 0xaaaaaaab, 0x55555555, 0x5555aaab, 0x5555aaab, 0xaab556ab, 0x556aad55, 0x55ab55ab, 0x55ab55ab, 0xab5ab56b, 0x56ad5ad5, 0x56b5ad6b, 0x56b5ad6b, 0xad6d6b5b, 0x5ad6b6b6, 0x5b5b5b5b, 0x5b5b5b5b, 0x5F6db6db, 0x5F6db6db, 0xF776F776, 0xF776F776, 0xFBDEFBDE, 0xFBDEFBDE, 0x7eFFBFF7, 0x7eFFBFF7, 0xFF7FF7F7, 0xFF7FF7F7, 0xFF7FFF7F, 0xFF7FFF7F, 0xFFF7FFFF, 0xFFF7FFFF, 0xFFFFFFFF, 0xFFFFFFFF, }; unsigned char i; unsigned short index; unsigned long data; Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_INDEX, 0); index = CS92xx_FRM_MEMORY_DATA; for (i = 0; i < 64; i += 2) { data = CentaurusFRMtable[i]; Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_DATA, data); data = CentaurusFRMtable[i + 1]; Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_DATA, data); } /* * The first FRM location (64 bits) does not program correctly. * This location always reads back with the last value programmed. * ie. If 32 64-bit values are programmed, location 0 reads * back as the 32nd If 30 locations are programmed, location 0 * reads back as the 30th, etc. * Fix this by re-writing location 0 after programming all 64 in * the writeFRM loop in RevCFrmload() in CS9211. */ Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_INDEX, 0); Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_DATA, 0); Centaurus_write_gpio(FOUR_BYTES, CS92xx_FRM_MEMORY_DATA, 0); } /******************************************************************** * * void Centaurus_Enable_Power((void); * Enables the power of the CX9211 using the National 97317 on * a Centaurus board. * ********************************************************************/ void Centaurus_Power_Up(void) { unsigned long off_data = 0x01000000; Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN, off_data); return; } /* Centaurus_Disable_Power */ /*********************************************************************** * * void Centaurus_Disable_Power((void); * Disables the power of the CX9211 using the National 97317 * on a Centaurus board. * **********************************************************************/ void Centaurus_Power_Down(void) { unsigned long off_data = 0; Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN, off_data); return; } /* Centaurus_Disable_Power */ void Centaurus_9211init(Pnl_PanelStat * pstat) { init_Centaurus_GPIO(); init_Centaurus_9211(); set_Centaurus_92xx_mode(pstat); restore_Centaurus_97317_SIOC2(); } void Centaurus_Save_Panel_State(void) { /* set 9211 registers using the desired panel settings */ cs9211_regs.panel_timing1 = Centaurus_read_gpio(FOUR_BYTES, CS92xx_LCD_PAN_TIMING1); cs9211_regs.panel_timing2 = Centaurus_read_gpio(FOUR_BYTES, CS92xx_LCD_PAN_TIMING2); cs9211_regs.dither_frc_ctrl = Centaurus_read_gpio(FOUR_BYTES, CS92xx_LCD_DITH_FR_CNTRL); cs9211_regs.blue_lsfr_seed = Centaurus_read_gpio(FOUR_BYTES, CS92xx_BLUE_LSFR_SEED); cs9211_regs.red_green_lsfr_seed = Centaurus_read_gpio(FOUR_BYTES, CS92xx_RED_GREEN_LSFR_SEED); /* CentaurusProgramFRMload(); */ cs9211_regs.memory_control = Centaurus_read_gpio(FOUR_BYTES, CS92xx_LCD_MEM_CNTRL); /* Set the power register last. * This will turn the panel on at the 9211. */ cs9211_regs.power_management = Centaurus_read_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN); } void Centaurus_Restore_Panel_State(void) { unsigned long off_data = 0; /* Before restoring the 9211 registers, power off the 9211. */ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN, off_data); /* set 9211 registers using the desired panel settings */ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PAN_TIMING1, cs9211_regs.panel_timing1); Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PAN_TIMING2, cs9211_regs.panel_timing2); /* load the LSFR seeds */ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_DITH_FR_CNTRL, cs9211_regs.dither_frc_ctrl); Centaurus_write_gpio(FOUR_BYTES, CS92xx_BLUE_LSFR_SEED, cs9211_regs.blue_lsfr_seed); Centaurus_write_gpio(FOUR_BYTES, CS92xx_RED_GREEN_LSFR_SEED, cs9211_regs.red_green_lsfr_seed); Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_MEM_CNTRL, cs9211_regs.memory_control); /* Set the power register last. This will turn the panel on at the 9211 */ Centaurus_write_gpio(FOUR_BYTES, CS92xx_LCD_PWR_MAN, cs9211_regs.power_management); } xf86-video-geode-2.11.18/src/panel/92xx.h0000644000175000017500000004263112654445443014457 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This header file defines the Durango routines and * variables used to access the memory mapped regions. * * SubModule: Geode FlatPanel library * */ #ifndef _92XX_h #define _92XX_h typedef unsigned long ULONG; typedef unsigned char UCHAR; #define FALSE 0 #define TRUE 1 #define NUM_92XX_MODES 13 #define ONE_BYTE 1 #define TWO_BYTES 2 #define FOUR_BYTES 4 /* LCD Registers * The LCD memory area is shared by both TV and LCD. * This offset is for LCD access. */ #define CS92xx_LCD_OFFSET 0x00000400 /* LCD CONTROL REGISTERS */ #define CS92xx_LCD_PAN_TIMING1 CS92xx_LCD_OFFSET + 0x00 /* flat panel(FP) timings */ #define CS92xx_LCD_PAN_TIMING2 CS92xx_LCD_OFFSET + 0x04 /* FP panel timings */ #define CS92xx_LCD_PWR_MAN CS92xx_LCD_OFFSET + 0x08 /* FP power management */ #define CS92xx_LCD_DITH_FR_CNTRL CS92xx_LCD_OFFSET + 0x0C /* FP dither and frame rate * these defines are in revisions prior to C */ #define CS92xx_LCD_BLOCK_SEL1 CS92xx_LCD_OFFSET + 0x10 /* FRM register */ #define CS92xx_LCD_BLOCK_SEL2 CS92xx_LCD_OFFSET + 0x14 /* FRM register */ #define CS92xx_LCD_DISPER1 CS92xx_LCD_OFFSET + 0x18 /* FRM register */ #define CS92xx_LCD_DISPER2 CS92xx_LCD_OFFSET + 0x1C /* FRM register * these defines are revision C */ #define CS92xx_BLUE_LSFR_SEED CS92xx_LCD_OFFSET + 0x10 /* FRM register */ #define CS92xx_RED_GREEN_LSFR_SEED CS92xx_LCD_OFFSET + 0x14 /* FRM register */ #define CS92xx_FRM_MEMORY_INDEX CS92xx_LCD_OFFSET + 0x18 /* FRM register */ #define CS92xx_FRM_MEMORY_DATA CS92xx_LCD_OFFSET + 0x1C /* FRM register */ #define CS92xx_LCD_MEM_CNTRL CS92xx_LCD_OFFSET + 0x20 /* memory PLL register */ #define CS92xx_LCD_RAM_CNTRL CS92xx_LCD_OFFSET + 0x24 /* ram control */ #define CS92xx_LCD_RAM_DATA CS92xx_LCD_OFFSET + 0x28 /* ram data */ #define CS92xx_LCD_PAN_CRC_SIG CS92xx_LCD_OFFSET + 0x2C /* FP CRC signature */ #define CS92xx_DEV_REV_ID CS92xx_LCD_OFFSET + 0x30 /* Device and revision id */ #define CS92xx_LCD_GPIO_DATA CS92xx_LCD_OFFSET + 0x34 /* GPIO Data */ #define CS92xx_LCD_GPIO_CNTRL CS92xx_LCD_OFFSET + 0x38 /* GPIO Control */ int Pnl_Rev_ID; typedef struct { /* DISPLAY MODE PARAMETERS */ int xres; int yres; int bpp; int panel_type; int color_type; /* VALUES USED TO SET THE FLAT PANEL DISPLAY CONTROLLER */ unsigned long panel_timing1; unsigned long panel_timing2; unsigned long power_management; /* the following 5 registers are prior to revision C */ unsigned long pre_C_dither_frc; unsigned long block_select1; unsigned long block_select2; unsigned long dispersion1; unsigned long dispersion2; /* the following 4 registers are revision C only */ unsigned long rev_C_dither_frc; unsigned long blue_lsfr_seed; unsigned long red_green_lsfr_seed; unsigned long frm_memory_index; unsigned long frm_memory_data; unsigned long memory_control; } CS92xx_MODE; /* VALUES USED TO SAVE AND RESTORE 9211 REGISTERS. */ typedef struct { unsigned long panel_state; /* VALUES USED TO SET THE FLAT PANEL DISPLAY CONTROLLER */ unsigned long panel_timing1; unsigned long panel_timing2; unsigned long power_management; unsigned long dither_frc_ctrl; unsigned long blue_lsfr_seed; unsigned long red_green_lsfr_seed; unsigned long frm_memory_index; unsigned long frm_memory_data; unsigned long memory_control; } CS92xx_REGS; CS92xx_REGS cs9211_regs; /* *------------------------------------------------------------------------ * PANEL MODE TABLES: * GLOBAL ARRAY OF FLAT PANEL MODE STRUCTURES *------------------------------------------------------------------------ */ CS92xx_MODE FPModeParams[] = { {640, 480, 8, PNL_SSTN, PNL_COLOR_PANEL, /* display parameters */ 0x01e00000, 0x00034000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /* The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x25cf3096, 0xad47b81e, /* block select 1, block select 2 */ 0x21446450, 0x21446450, /* dispersion 1, dispersion 2 */ /* The next 5 values are for revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000000, /* memory control */ }, {640, 480, 12, PNL_TFT, PNL_COLOR_PANEL, /* display parameters */ 0x01e00000, 0x0f100000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /* The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* block select 1, block select 2 */ 0x00000000, 0x00000000, /* dispersion 1, dispersion 2 */ /* The next 5 values are for revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000000, /* memory control */ }, {640, 480, 18, PNL_TFT, PNL_COLOR_PANEL, /* display parameters */ 0x01e00000, 0x0f100000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /* The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* block select 1, block select 2 */ 0x00000000, 0x00000000, /* dispersion 1, dispersion 2 */ /* The next 5 values are for revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000000, /* memory control */ }, {640, 480, 16, PNL_DSTN, PNL_COLOR_PANEL, /* display parameters */ 0x01e00000, 0x00014000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /* The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x048c26ae, 0x048c26ae, /* block select 1, block select 2 */ 0x02468ace, 0x13579bdf, /* dispersion 1, dispersion 2 */ /* The next 5 values are for revision C */ 0x0000004b, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000007, /* memory control */ }, {640, 480, 8, PNL_DSTN, PNL_MONO_PANEL, /* display parameters */ 0x01e00000, 0x00084000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /* The next 5 values are prior to revision C */ 0x0000004b, /* dither and frame rate control */ 0x25cf3096, 0xad47b81e, /* block select 1, block select 2 */ 0x21446450, 0x21446450, /* dispersion 1, dispersion 2 */ /* The next 5 values are for revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000007, /* memory control */ }, {640, 480, 16, PNL_DSTN, PNL_MONO_PANEL, /* display parameters */ 0x01e00000, 0x00094000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /* The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x25cf3096, 0xad47b81e, /* block select 1, block select 2 */ 0x81a5d470, 0x29cfb63e, /* dispersion 1, dispersion 2 */ /* The next 5 values are for revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000007, /* memory control */ }, {800, 600, 12, PNL_TFT, PNL_COLOR_PANEL, /* display parameters */ 0x02580000, 0x0f100000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /* The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* block select 1, block select 2 */ 0x00000000, 0x00000000, /* dispersion 1, dispersion 2 */ /* The next 5 values are for revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000000, /* memory control */ }, {800, 600, 18, PNL_TFT, PNL_COLOR_PANEL, /* display parameters */ 0x02580000, 0x0f100000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /* The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* block select 1, block select 2 */ 0x00000000, 0x00000000, /* dispersion 1, dispersion 2 */ /* The next 5 values are for revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000000, /* memory control */ }, {800, 600, 16, PNL_DSTN, PNL_COLOR_PANEL, /* display parameters */ 0x02580000, 0x00014000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /* The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x048c26ae, 0x048c26ae, /* block select 1, block select 2 */ 0x02468ace, 0x13579bdf, /* dispersion 1, dispersion 2 */ /* The next 5 values are for revision C */ 0x0000004b, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000007, /* memory control */ }, {800, 600, 8, PNL_DSTN, PNL_MONO_PANEL, /* display parameters */ 0x02580000, 0x00084000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /* The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x25cf3096, 0xad47b81e, /* block select 1, block select 2 */ 0x21446450, 0x21446450, /* dispersion 1, dispersion 2 */ /* The next 5 values are for revision C */ 0x0000004b, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000007, /* memory control */ }, {800, 600, 16, PNL_DSTN, PNL_MONO_PANEL, /* display parameters */ 0x02580000, 0x00094000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /* The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x25cf3096, 0xad47b81e, /* block select 1, block select 2 */ 0x81a5d470, 0x29cfb63e, /* dispersion 1, dispersion 2 */ /* The next 5 values are for revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000007, /* memory control */ }, {1024, 768, 18, PNL_TFT, PNL_COLOR_PANEL, /* display parameters */ 0x03000000, 0x0f100000, /* panel timing reg 1, panel timing */ /* reg 2 */ 0x01000000, /* power management */ /*The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* block select 1, block select 2 */ 0x00000000, 0x00000000, /* dispersion 1, dispersion 2 */ /*The next 5 values are for revision C */ 0x00000050, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000000, /* memory control */ }, {1024, 768, 24, PNL_DSTN, PNL_COLOR_PANEL, /* display parameters */ 0x03000000, 0x80024000, /* panel timing reg 1, panel timing reg 2 */ 0x01000000, /* power management */ /*The next 5 values are prior to revision C */ 0x00000050, /* dither and frame rate control */ 0x048c26ae, 0x048c26ae, /* block select 1, block select 2 */ 0x02468ace, 0x13579bdf, /* dispersion 1, dispersion 2 */ /*The next 5 values are for revision C */ 0x0000004b, /* dither and frame rate control */ 0x00000000, 0x00000000, /* blue LSFR, red and green LSFR */ 0x00000000, 0x00000000, /* FRM memory index, FRM memory data */ 0x00000005, /* memory control */ } }; #endif /* !_92XX_h */ /* END OF FILE */ xf86-video-geode-2.11.18/src/panel/pnl_bios.c0000644000175000017500000002317612654445443015450 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This file panel functions which query for the BIOS for * current FP Paramters. * * SubModule: Geode FlatPanel library * */ #include "panel.h" #if defined(_WIN32) /* windows */ extern unsigned long gfx_cpu_version; extern void gfx_outw(unsigned short port, unsigned short data); extern unsigned short gfx_inw(unsigned short port); #endif #define SOFTVGA_DISPLAY_ENABLE 0x50 #define SOFTVGA_FPRESOLUTION 0x52 #define SOFTVGA_FPCLOCKFREQUENCY 0x54 /* SOFTVG VIRTUAL REGISTER DEFINITIONS */ #define VR_INDEX 0xAC1C #define VR_DATA 0xAC1E #define VR_UNLOCK 0xFC53 #define VRC_VG 0x0002 /* SoftVG Virtual Register Class */ #define VG_MEM_SIZE 0x0000 /* MemSize Virtual Register */ #define FP_DETECT_MASK 0x8000 #define VG_FP_TYPE 0x0002 /* Flat Panel Info Virtual Register */ #define FP_DEV_MASK 0x0003 /* Flat Panel type */ #define FP_TYPE_SSTN 0x0000 /* SSTN panel type value */ #define FP_TYPE_DSTN 0x0001 /* DSTN panel type value */ #define FP_TYPE_TFT 0x0002 /* TFT panel type value */ #define FP_TYPE_LVDS 0x0003 /* LVDS panel type value */ #define FP_RESOLUTION_MASK 0x0038 #define FP_RES_6X4 0x0000 /* 640x480 resolution value */ #define FP_RES_8X6 0x0008 /* 800x600 resolution value */ #define FP_RES_10X7 0x0010 /* 1024x768 resolution value */ #define FP_RES_11X8 0x0018 /* 1152x864 resolution value */ #define FP_RES_12X10 0x0020 /* 1280x1024 resolution value */ #define FP_RES_16X12 0x0028 /* 1600x1200 resolution value */ #define FP_WIDTH_MASK 0x01C0 #define FP_WIDTH_8 0x0000 /* 8 bit data bus width */ #define FP_WIDTH_9 0x0040 /* 9 bit data bus width */ #define FP_WIDTH_12 0x0080 /* 12 bit data bus width */ #define FP_WIDTH_18 0x00C0 /* 18 bit data bus width */ #define FP_WIDTH_24 0x0100 /* 24 bit data bus width */ #define FP_WIDTH_16 0x0140 /* 16 bit data bus width - 16 bit * Mono DSTN only */ #define FP_COLOR_MASK 0x0200 #define FP_COLOR_COLOR 0x0000 /* Color panel */ #define FP_COLOR_MONO 0x0200 /* Mono Panel */ #define FP_PPC_MASK 0x0400 #define FP_PPC_1PPC 0x0000 /* One pixel per clock */ #define FP_PPC_2PPC 0x0400 /* Two pixels per clock */ #define FP_HPOL_MASK 0x0800 #define FP_H_POL_LGH 0x0000 /* HSync at panel, normally low, * active high */ #define FP_H_POL_HGL 0x0800 /* HSync at panel, normally high, * active low */ #define FP_VPOL_MASK 0x1000 #define FP_V_POL_LGH 0x0000 /* VSync at panel, normally low, * active high */ #define FP_V_POL_HGL 0x1000 /* VSync at panel, normally high, * active low */ #define FP_REF_MASK 0xE000 #define FP_REF_60 0x0000 /* 60Hz refresh rate */ #define FP_REF_70 0x2000 /* 70Hz refresh rate */ #define FP_REF_72 0x4000 /* 72Hz refresh rate */ #define FP_REF_75 0x6000 /* 75Hz refresh rate */ #define FP_REF_85 0x8000 /* 85Hz refresh rate */ #define FP_REF_90 0xA000 /* 90Hz refresh rate */ #define FP_REF_100 0xC000 /* 100Hz refresh rate */ /*----------------------------------------------------------------- * Pnl_IsPanelEnabledInBIOS * * Description: This function specifies whether the panel is enabled * by the BIOS or not. * parameters: none. * return: 1 - Enabled, 0 - Disabled *-----------------------------------------------------------------*/ int Pnl_IsPanelEnabledInBIOS(void) { unsigned char ret = 0; if ((gfx_cpu_version & 0xFF) == GFX_CPU_REDCLOUD) { unsigned short data; gfx_outw(VR_INDEX, VR_UNLOCK); gfx_outw(VR_INDEX, (VRC_VG << 8) | VG_MEM_SIZE); data = gfx_inw(VR_DATA); if (data & FP_DETECT_MASK) ret = 1; } else { unsigned short crtcindex, crtcdata; crtcindex = (gfx_inb(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; /* CHECK DisplayEnable Reg in SoftVGA */ gfx_outb(crtcindex, (unsigned char) SOFTVGA_DISPLAY_ENABLE); ret = gfx_inb(crtcdata); } return (ret & 0x1); } /*----------------------------------------------------------------- * Pnl_GetPanelInfoFromBIOS * * Description: This function queries the panel information from * the BIOS. * parameters: * xres: width of the panel configured * yres: height of the panel configured * bpp: depth of the panel configured * hz: vertical frequency of the panel configured * return: none *-----------------------------------------------------------------*/ void Pnl_GetPanelInfoFromBIOS(int *xres, int *yres, int *bpp, int *hz) { unsigned short crtcindex, crtcdata; unsigned short ret; if ((gfx_cpu_version & 0xFF) == GFX_CPU_REDCLOUD) { gfx_outw(VR_INDEX, VR_UNLOCK); gfx_outw(VR_INDEX, (VRC_VG << 8) | VG_FP_TYPE); ret = gfx_inw(VR_DATA); switch (ret & FP_RESOLUTION_MASK) { case FP_RES_6X4: *xres = 640; *yres = 480; break; case FP_RES_8X6: *xres = 800; *yres = 600; break; case FP_RES_10X7: *xres = 1024; *yres = 768; break; case FP_RES_11X8: *xres = 1152; *yres = 864; break; case FP_RES_12X10: *xres = 1280; *yres = 1024; break; case FP_RES_16X12: *xres = 1600; *yres = 1200; break; } switch (ret & FP_WIDTH_MASK) { case FP_WIDTH_8: *bpp = 8; break; case FP_WIDTH_9: *bpp = 9; break; case FP_WIDTH_12: *bpp = 12; break; case FP_WIDTH_18: *bpp = 18; break; case FP_WIDTH_24: *bpp = 24; break; case FP_WIDTH_16: *bpp = 16; break; } switch (ret & FP_REF_MASK) { case FP_REF_60: *hz = 60; break; case FP_REF_70: *hz = 70; break; case FP_REF_72: *hz = 72; break; case FP_REF_75: *hz = 75; break; case FP_REF_85: *hz = 85; break; case FP_REF_90: *hz = 90; break; case FP_REF_100: *hz = 100; break; } } else { crtcindex = (gfx_inb(0x3CC) & 0x01) ? 0x3D4 : 0x3B4; crtcdata = crtcindex + 1; /* CHECK FPResolution Reg in SoftVGA */ gfx_outb(crtcindex, (unsigned char) SOFTVGA_FPRESOLUTION); ret = gfx_inb(crtcdata); switch (ret & 0x3) { case 0: *xres = 640; *yres = 480; break; case 1: *xres = 800; *yres = 600; break; case 2: *xres = 1024; *yres = 768; break; } switch ((ret >> 4) & 0x3) { case 0: *bpp = 12; break; case 1: *bpp = 18; break; case 2: *bpp = 16; break; case 3: *bpp = 8; break; } /* CHECK FPClockFrequency Reg in SoftVGA */ gfx_outb(crtcindex, (unsigned char) SOFTVGA_FPCLOCKFREQUENCY); *hz = gfx_inb(crtcdata); } } xf86-video-geode-2.11.18/src/panel/cen9211.h0000644000175000017500000000713112654445443014723 00000000000000/* Copyright (c) 2005 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * */ /* * File Contents: This header file defines the Durango routines and * variables used to access the memory mapped regions. * * SubModule: Geode FlatPanel library * */ #include "92xx.h" #include "panel.h" #ifndef _CEN9211_h #define _CEN9211_h /* Centaurus/97317 GPIO PORT defines */ #define CENT_97317_CLOCK_PORT 0xE0 #define CENT_97317_DATA_OUTPORT 0xE0 #define CENT_97317_CHIP_SELECT 0xE4 #define CENT_97317_DATA_INPORT 0xE4 #define CENT_PORT1_DIRECTION 0xE1 #define CENT_PORT2_DIRECTION 0xE5 #define CENT_PORT1_OUTPUT_TYPE 0xE2 #define CENT_PORT2_OUTPUT_TYPE 0xE6 /* * Centaurus/97317 GPIO bit masks. * In and out are with respect to the 97317. */ #define CENT_97317_CLOCK_MASK 0x10 #define CENT_97317_CHIP_SEL_MASK 0x01 #define CENT_97317_DATA_IN_MASK 0x02 #define CENT_97317_DATA_OUT_MASK 0x80 #define CENT_PASS 1 #define CENT_FAIL 0 #define CENT_READ 0x0000 #define CENT_WRITE 0x0001 #define CENT_NO_DATA 0 #define CENT_CONFIG_INDEX 0x2E #define CENT_SIOC2 0x22 #define CENT_CONFIG_DATA 0x2F #define CENT_GPIO_BANK_SELECT 0x80 #define CENT_NUM_READ_CLOCK_TOGGLES 1 #define CENT_NUM_WRITE_CLOCK_TOGGLES 4 /* local functions */ void set_Centaurus_92xx_mode_params(int mode); void enable_Centaurus_9211_chip_select(void); void disable_Centaurus_9211_chip_select(void); void toggle_Centaurus_9211_clock(void); void write_Centaurus_CX9211_GPIO(unsigned char databit); void write_Centaurus_CX9211_DWdata(unsigned long data); void Centaurus_write_gpio(int width, unsigned long address, unsigned long data); void Centaurus_Power_Up(void); void Centaurus_Power_Down(void); unsigned long Centaurus_read_gpio(int width, unsigned long address); unsigned char read_Centaurus_CX9211_GPIO(void); unsigned long read_Centaurus_CX9211_DWdata(void); unsigned char restore_Centaurus_97317_SIOC2(void); unsigned char init_Centaurus_GPIO(void); unsigned char init_Centaurus_9211(void); unsigned char set_Centaurus_92xx_mode(Pnl_PanelStat * pstat); void CentaurusProgramFRMload(void); void Centaurus_Get_9211_Details(unsigned long flags, Pnl_PanelParams * pParam); void Centaurus_Save_Panel_State(void); void Centaurus_Restore_Panel_State(void); void Centaurus_9211init(Pnl_PanelStat * pstat); #endif /* !_CEN9211_h */ /* END OF FILE */ xf86-video-geode-2.11.18/src/cimarron.c0000644000175000017500000002646512654445443014362 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* * Base include file for the Cimarron library. This file should be modified * and included in any Cimarron-based project. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /*----------------------------------------------------------------------*/ /* MODULE SETTINGS */ /* The following #defines affect which modules are included in the */ /* project. */ /*----------------------------------------------------------------------*/ #define CIMARRON_INCLUDE_GP 1 #define CIMARRON_INCLUDE_VG 1 #define CIMARRON_INCLUDE_VIP 1 #define CIMARRON_INCLUDE_VOP 1 #define CIMARRON_INCLUDE_VIDEO 1 #define CIMARRON_INCLUDE_INIT 1 #define CIMARRON_INCLUDE_VG_READ_ROUTINES 1 #define CIMARRON_INCLUDE_DF_READ_ROUTINES 1 #define CIMARRON_INCLUDE_VIP_READ_ROUTINES 1 #define CIMARRON_INCLUDE_VOP_READ_ROUTINES 1 /*----------------------------------------------------------------------*/ /* HARDWARE ACCESS SETTINGS */ /* The following #defines affect how the Cimarron macros access the */ /* hardware. The hardware access macros are broken up into groups. */ /* Each group includes an enabling #define as well as several #define */ /* options that modify the macro configuration that is included. */ /* If the enabling define is deleted or all options are set to 0, the */ /* corresponding macros must be implemented by the user. The */ /* combinations are explained as follows: */ /* must be manually defined by the user. This allows a user to use the */ /* cim_defs.h file for only those macros that suit the needs of his/her */ /* project. For example, a user may need custom implementations of the */ /* I/O and MSR macros, but may still want to use the default macros to */ /* read and write hardware registers. The combinations are explained as */ /* follows: */ /* */ /* Register Group: */ /* Disabling define: */ /* CIMARRON_EXCLUDE_REGISTER_ACCESS_MACROS */ /* Define this setting to exclude the register access macros. */ /* This setting is the inverse of the other group settings in */ /* that these macros are included by default. This allows the */ /* cim_defs.h file to be included outside of cimarron.c for */ /* basic operations. */ /* */ /* Memory Group: */ /* Enabling define: */ /* CIMARRON_INCLUDE_STRING_MACROS */ /* Options: */ /* CIMARRON_OPTIMIZE_ASSEMBLY */ /* Set to 1 to allow the use of inline assembly when writing */ /* large chunks of data to memory. Essentially, this allows */ /* a rep movsd in place of a slower C for-loop. */ /* CIMARRON_OPTIMIZE_FORLOOP */ /* Define for C only data writes. */ /* */ /* MSR Group: */ /* Enabling define: */ /* CIMARRON_INCLUDE_MSR_MACROS */ /* Options: */ /* CIMARRON_MSR_DIRECT_ASM */ /* Set to 1 to allow the use of the rdmsr and wrmsr opcodes in */ /* inline assembly. */ /* CIMARRON_MSR_VSA_IO */ /* Set to 1 to access MSRs using a VSAII virtual register. */ /* CIMARRON_MSR_KERNEL_ROUTINE */ /* Set to 1 to access MSRs using a wrapper routine in the */ /* Linux kernel. */ /* */ /* IO Group: */ /* Enabling define: */ /* CIMARRON_INCLUDE_IO_MACROS */ /* Options: */ /* CIMARRON_IO_DIRECT_ACCESS */ /* Set to 1 to perform IO accesses using inline assembly. */ /* CIMARRON_IO_ABSTRACTED_ASM */ /* Set to 1 to perform IO using abstracted IO in Linux. */ /* */ /* Custom Group: */ /* Disabling define: */ /* CIMARRON_EXCLUDE_CUSTOM_MACROS */ /* By default, the custom macros (the macros used by */ /* gp_custom_convert_blt) are mapped to the normal command */ /* string macros. Setting this to 1 allows the user to */ /* create a custom implementation. */ /*----------------------------------------------------------------------*/ /* UNCOMMENT THE FOLLOWING LINE TO EXCLUDE BASIC REGISTER ACCESS MACROS */ /* #define CIMARRON_EXCLUDE_REGISTER_ACCESS_MACROS */ #define CIMARRON_INCLUDE_STRING_MACROS #define CIMARRON_OPTIMIZE_ASSEMBLY 0 #define CIMARRON_OPTIMIZE_FORLOOP 0 #define CIMARRON_OPTIMIZE_ABSTRACTED_ASM 1 #define CIMARRON_INCLUDE_MSR_MACROS #define CIMARRON_MSR_DIRECT_ASM 0 #define CIMARRON_MSR_VSA_IO 0 #define CIMARRON_MSR_ABSTRACTED_ASM 0 #define CIMARRON_MSR_KERNEL_ROUTINE 0 #define CIMARRON_MSR_HOOKS 1 #define CIMARRON_INCLUDE_IO_MACROS #define CIMARRON_IO_DIRECT_ACCESS 0 #define CIMARRON_IO_ABSTRACTED_ASM 1 /* * UNCOMMENT THE FOLLOWING LINE TO IMPLEMENT CUSTOM MACROS FOR * GP_CUSTOM_CONVERT_BLT */ /* #define CIMARRON_EXCLUDE_CUSTOM_MACROS */ /*----------------------------------------------------------------------*/ /* MODULE VARIABLES */ /* The following #defines affect how global variables in each Cimarron */ /* module are defined. These variables can be made static (to prevent */ /* naming conflicts) or they can be defined without the static keyword */ /* (to allow extern references). */ /*----------------------------------------------------------------------*/ #if 1 #define CIMARRON_STATIC static #else #define CIMARRON_STATIC #endif /*----------------------------------------------------------------------*/ /* CIMARRON GLOBAL VARIABLES */ /* These globals are used by the hardware access macros. They must be */ /* initialized by the application to point to the memory-mapped */ /* registers of their respective blocks. */ /*----------------------------------------------------------------------*/ unsigned char *cim_gp_ptr = (unsigned char *) 0; unsigned char *cim_fb_ptr = (unsigned char *) 0; unsigned char *cim_cmd_base_ptr = (unsigned char *) 0; unsigned char *cim_cmd_ptr = (unsigned char *) 0; unsigned char *cim_vid_ptr = (unsigned char *) 0; unsigned char *cim_vip_ptr = (unsigned char *) 0; unsigned char *cim_vg_ptr = (unsigned char *) 0; /* Define hooks for reading and writing MSRs - this is a major hack * to share the MSR code with the GX code */ #ifdef CIMARRON_MSR_HOOKS void (*cim_rdmsr) (unsigned long, unsigned long *, unsigned long *); void (*cim_wrmsr) (unsigned long, unsigned long, unsigned long); #endif /*----------------------------------------------------------------------*/ /* INCLUDE RELEVANT CIMARRON HEADERS */ /*----------------------------------------------------------------------*/ /* HARDWARE REGISTER DEFINITIONS */ #include "cim_regs.h" /* ROUTINE DEFINITIONS */ /* All routines have a prototype, even those that are not included */ /* via #ifdefs. This prevents the user from having to include the */ /* correct #defines anywhere he/she wants to call a Cimarron routine. */ #include "cim_rtns.h" /* HARDWARE ACCESS MACROS */ #include "cim_defs.h" /*----------------------------------------------------------------------*/ /* CIMARRON MODULES */ /* Modules and sub-modules are included based on user settings. Note */ /* that excluding one or more modules may result in functionality */ /* holes. */ /*----------------------------------------------------------------------*/ /* GRAPHICS PROCESSOR */ #if CIMARRON_INCLUDE_GP #include "cim_gp.c" #endif /* VIDEO GENERATOR */ #if CIMARRON_INCLUDE_VG #include "cim_modes.c" #include "cim_vg.c" #endif /* DISPLAY FILTER */ #if CIMARRON_INCLUDE_VIDEO #include "cim_filter.c" #include "cim_df.c" #endif /* INITIALIZATION AND DETECTION */ #if CIMARRON_INCLUDE_INIT #include "cim_init.c" #endif /* VIP SUPPORT */ #if CIMARRON_INCLUDE_VIP #include "cim_vip.c" #endif /* VOP SUPPORT */ #if CIMARRON_INCLUDE_VOP #include "cim_vop.c" #endif /* MSR ACCESS */ /* This module is used to access machine-specific registers. */ /* It cannot be excluded from a project. */ #include "cim_msr.c" xf86-video-geode-2.11.18/src/z4l.c0000644000175000017500000013330712654445443013253 00000000000000/* * Copyright (c) 2006 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* prototype Xv interface for lxv4l2 driver */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include "xf86.h" #include #include "xf86_OSproc.h" #include "compiler.h" #include "xf86xv.h" #include "fourcc.h" #include "compat-api.h" #define __s64 __s_64 typedef long long __s64; #define __u64 __u_64 typedef unsigned long long __u64; #define __user #include "linux/videodev2.h" typedef signed long long s64; typedef unsigned long long u64; int debuglvl = 0; #define NONBLK_IO #undef HAVE_SELECT #define DEBUG 1 #ifdef DEBUG #define DBLOG(n,s...) do { \ if ( debuglvl >= (n) ) \ xf86Msg(X_INFO, "z4l: " s); \ } while(0) #else #define DBLOG(n,s...) do {} while(0) #endif #define DEFAULT_COLORKEY 0x010203 #define DEFAULT_KEYMODE 0 #define MAX_BUFFERS 4 #define MAX_OVLY_WIDTH 2048 #define MAX_OVLY_HEIGHT 2048 static char *z4l_dev_paths[] = { "/dev/videox", NULL }; #define ATTR_ENCODING "encoding" #define ATTR_ENCODING_ID -1 #define ATTR_KEYMODE "keymode" #define ATTR_KEYMODE_ID -2 #define ATTR_COLORKEY "colorkey" #define ATTR_COLORKEY_ID -3 #define ATTR_MAX_ID 3 #ifdef XvExtension static XF86VideoFormatRec Formats[] = { {8, PseudoColor}, {15, TrueColor}, {16, TrueColor}, {24, TrueColor} }; #define NUM_FORMATS (sizeof(Formats)/sizeof(Formats[0])) #define FOURCC_Y800 0x30303859 #define XVIMAGE_Y800 \ { \ FOURCC_Y800, \ XvYUV, \ LSBFirst, \ {'Y','8','0','0', \ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ 8, \ XvPacked, \ 1, \ 0, 0, 0, 0, \ 8, 0, 0, \ 1, 0, 0, \ 1, 0, 0, \ {'Y','8','0','0', \ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \ XvTopToBottom \ } static XF86ImageRec pixfmts[] = { XVIMAGE_UYVY, XVIMAGE_YUY2, XVIMAGE_I420, XVIMAGE_YV12, XVIMAGE_Y800, }; #define NUM_PIXFMTS (sizeof(pixfmts)/sizeof(pixfmts[0])) typedef struct s_std_data { int inp; v4l2_std_id std; unsigned int fmt; } t_std_data; typedef struct s_ovly_bfrs { void *start; unsigned long offset; size_t length; } t_ovly_bfrs; typedef struct { int fd; int run; int dir; int nbfrs; int bufno; int bufsz; int last; int width, height; int keymode, colorkey; int src_is_set, src_x, src_y, src_w, src_h; int drw_is_set, drw_x, drw_y, drw_w, drw_h; unsigned int pixfmt; char dev_path[32]; t_ovly_bfrs bfrs[MAX_BUFFERS]; XF86VideoAdaptorPtr adpt; XF86VideoEncodingPtr enc; RegionRec clips; int attrIds[1]; } Z4lPortPrivRec; static int z4l_x_offset = 0; static int z4l_y_offset = 0; static int Z4l_nAdaptors = 0; static XF86VideoAdaptorPtr *Z4l_pAdaptors = NULL; static int IoCtl(int fd, unsigned int fn, void *arg, int flag) { int ret; errno = 0; ret = ioctl(fd, fn, arg); if (ret != 0 && flag != 0) DBLOG(0, "ioctl(%08x)=%d\n", fn, ret); return ret; } static void z4l_ovly_unmap(Z4lPortPrivRec * pPriv) { int i, nbfrs; nbfrs = pPriv->nbfrs; for (i = 0; i < nbfrs; ++i) { if (pPriv->bfrs[i].start != NULL) { munmap(pPriv->bfrs[i].start, pPriv->bfrs[i].length); pPriv->bfrs[i].start = NULL; } } pPriv->nbfrs = -1; pPriv->bufsz = -1; pPriv->last = -1; } static void z4l_ovly_map(Z4lPortPrivRec * pPriv, int dir) { long offset, bsz; int i, fd; struct v4l2_buffer bfr; struct v4l2_requestbuffers req; int type = dir >= 0 ? V4L2_BUF_TYPE_VIDEO_CAPTURE : V4L2_BUF_TYPE_VIDEO_OVERLAY; if (pPriv->run > 0) { DBLOG(1, "busy\n"); return; } fd = pPriv->fd; memset(&req, 0, sizeof(req)); req.type = type; req.memory = V4L2_MEMORY_MMAP; req.count = MAX_BUFFERS; if (ioctl(fd, VIDIOC_REQBUFS, &req) < 0) goto xit; pPriv->nbfrs = req.count; if (pPriv->nbfrs <= 0) { DBLOG(1, "no vidmem\n"); return; } memset(&pPriv->bfrs, 0, sizeof(pPriv->bfrs)); for (i = 0; i < pPriv->nbfrs; ++i) { memset(&bfr, 0, sizeof(bfr)); bfr.type = type; bfr.index = i; if (ioctl(fd, VIDIOC_QUERYBUF, &bfr) < 0) goto xit; offset = bfr.m.offset; pPriv->bfrs[i].offset = offset; pPriv->bfrs[i].length = bfr.length; bsz = offset + bfr.length; if (pPriv->bufsz < bsz) pPriv->bufsz = bsz; } for (i = 0; i < pPriv->nbfrs; ++i) { pPriv->bfrs[i].start = mmap(NULL, bfr.length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, pPriv->bfrs[i].offset); if (pPriv->bfrs[i].start == MAP_FAILED) goto xit; } for (i = 0; i < pPriv->nbfrs; ++i) { DBLOG(3, "bfr %d ofs %#lx adr %p sz %lu\n", i, pPriv->bfrs[i].offset, pPriv->bfrs[i].start, (unsigned long) pPriv->bfrs[i].length); memset(pPriv->bfrs[i].start, 0x80, pPriv->bfrs[i].length); } pPriv->last = 0; while (pPriv->last < pPriv->nbfrs - 1) { bfr.index = pPriv->last++; bfr.type = type; if (ioctl(fd, VIDIOC_QBUF, &bfr) < 0) goto xit; } return; xit: z4l_ovly_unmap(pPriv); } static int z4l_ovly_dqbuf(Z4lPortPrivRec * pPriv) { int stat; struct v4l2_buffer bfr; int fd = pPriv->fd; #ifdef HAVE_SELECT struct timeval tmo; fd_set dqset; FD_ZERO(&dqset); FD_SET(pPriv->fd, &dqset); tmo.tv_sec = 0; tmo.tv_usec = 0; if (select(fd + 1, &dqset, NULL, NULL, &tmo) <= 0) return -1; #endif memset(&bfr, 0, sizeof(bfr)); bfr.type = V4L2_BUF_TYPE_VIDEO_OVERLAY; stat = ioctl(fd, VIDIOC_DQBUF, &bfr); DBLOG(3, "dqbuf %d,%d,%d,%d\n", stat, bfr.index, pPriv->last, errno); return stat == 0 ? bfr.index : -1; } static int z4l_open_device(Z4lPortPrivRec * pPriv) { int enable; if (pPriv->fd < 0) { pPriv->fd = open(&pPriv->dev_path[0], O_RDWR, 0); DBLOG(1, "open(%s)=%d\n", &pPriv->dev_path[0], pPriv->fd); enable = 1; #ifdef NONBLK_IO if (IoCtl(pPriv->fd, FIONBIO, &enable, 1) != 0) { DBLOG(1, "open cant enable nonblocking\n"); close(pPriv->fd); pPriv->fd = -1; } #endif } return pPriv->fd; } static int z4l_close_device(Z4lPortPrivRec * pPriv) { int ret = 0; if (pPriv->fd >= 0) { ret = close(pPriv->fd); pPriv->fd = -1; DBLOG(1, "close()=%d\n", ret); } if (pPriv->run > 0) { z4l_ovly_unmap(pPriv); pPriv->run = -1; } return ret; } static int z4l_ovly_reset(Z4lPortPrivRec * pPriv) { int ret = 0; if (pPriv->run > 0) { z4l_close_device(pPriv); ret = z4l_open_device(pPriv); } return ret; } static unsigned int z4l_fourcc_pixfmt(int fourcc) { unsigned int pixfmt = -1; switch (fourcc) { case FOURCC_UYVY: pixfmt = V4L2_PIX_FMT_UYVY; break; case FOURCC_YV12: pixfmt = V4L2_PIX_FMT_YVU420; break; case FOURCC_Y800: case FOURCC_I420: pixfmt = V4L2_PIX_FMT_YUV420; break; case FOURCC_YUY2: pixfmt = V4L2_PIX_FMT_YUYV; break; } return pixfmt; } static void z4l_ovly_pixfmt(Z4lPortPrivRec * pPriv, unsigned int pixfmt) { struct v4l2_framebuffer fbuf; DBLOG(1, "pixfmt %4.4s %4.4s\n", (char *) &pPriv->pixfmt, (char *) &pixfmt); memset(&fbuf, 0, sizeof(fbuf)); IoCtl(pPriv->fd, VIDIOC_G_FBUF, &fbuf, 1); fbuf.fmt.pixelformat = pixfmt; fbuf.base = NULL; IoCtl(pPriv->fd, VIDIOC_S_FBUF, &fbuf, 1); pPriv->pixfmt = pixfmt; } static void z4l_ovly_bfr(Z4lPortPrivRec * pPriv, int width, int height) { struct v4l2_format fmt; DBLOG(1, "sfmt ovly %dx%d\n", width, height); memset(&fmt, 0, sizeof(fmt)); fmt.type = 0x102; IoCtl(pPriv->fd, VIDIOC_G_FMT, &fmt, 1); fmt.fmt.win.field = V4L2_FIELD_NONE; fmt.fmt.win.w.width = pPriv->width = width; fmt.fmt.win.w.height = pPriv->height = height; IoCtl(pPriv->fd, VIDIOC_S_FMT, &fmt, 1); } static void z4l_ovly_rect(Z4lPortPrivRec * pPriv, int src_x, int src_y, int src_w, int src_h, int drw_x, int drw_y, int drw_w, int drw_h) { int x, dx, w, y, dy, h; struct v4l2_format fmt; pPriv->src_x = src_x; pPriv->src_y = src_y; pPriv->src_w = src_w; pPriv->src_h = src_h; pPriv->drw_x = drw_x; pPriv->drw_y = drw_y; pPriv->drw_w = drw_w; pPriv->drw_h = drw_h; if ((drw_x -= z4l_x_offset) < 0) { if ((w = pPriv->drw_w) <= 0) w = 1; x = -drw_x; dx = x * pPriv->src_w / w; src_x = pPriv->src_x + dx; src_w = pPriv->src_w - dx; drw_w = pPriv->drw_w - x; drw_x = 0; } if ((drw_y -= z4l_y_offset) < 0) { if ((h = pPriv->drw_h) <= 0) h = 1; y = -drw_y; dy = y * pPriv->src_h / h; src_y = pPriv->src_y + dy; src_h = pPriv->src_h - dy; drw_h = pPriv->drw_h - y; drw_y = 0; } memset(&fmt, 0, sizeof(fmt)); fmt.type = 0x100; IoCtl(pPriv->fd, VIDIOC_G_FMT, &fmt, 1); if (pPriv->src_is_set != 0) { if (src_x != fmt.fmt.win.w.left || src_y != fmt.fmt.win.w.top || src_w != fmt.fmt.win.w.width || src_h != fmt.fmt.win.w.height) pPriv->src_is_set = 0; } if (pPriv->src_is_set == 0) { pPriv->src_is_set = 1; fmt.fmt.win.w.left = src_x; fmt.fmt.win.w.top = src_y; fmt.fmt.win.w.width = src_w; fmt.fmt.win.w.height = src_h; IoCtl(pPriv->fd, VIDIOC_S_FMT, &fmt, 1); DBLOG(3, " set src %d,%d %dx%d\n", src_x, src_y, src_w, src_h); } memset(&fmt, 0, sizeof(fmt)); fmt.type = 0x101; IoCtl(pPriv->fd, VIDIOC_G_FMT, &fmt, 1); if (pPriv->drw_is_set != 0) { if (drw_x != fmt.fmt.win.w.left || drw_y != fmt.fmt.win.w.top || drw_w != fmt.fmt.win.w.width || drw_h != fmt.fmt.win.w.height) pPriv->drw_is_set = 0; } if (pPriv->drw_is_set == 0) { pPriv->drw_is_set = 1; fmt.fmt.win.w.left = drw_x; fmt.fmt.win.w.top = drw_y; fmt.fmt.win.w.width = drw_w; fmt.fmt.win.w.height = drw_h; IoCtl(pPriv->fd, VIDIOC_S_FMT, &fmt, 1); DBLOG(3, " set drw %d,%d %dx%d\n", drw_x, drw_y, drw_w, drw_h); } } static void z4l_ovly_pitch(unsigned int pixfmt, int w, int h, int *py_pitch, int *puv_pitch, int *poffset1, int *poffset2, int *psize) { int y_pitch, uv_pitch; int offset1, offset2; int size, is_420; switch (pixfmt) { case V4L2_PIX_FMT_YVU420: case V4L2_PIX_FMT_YUV420: is_420 = 1; y_pitch = ((w + 1) / 2) * 2; uv_pitch = (w + 1) / 2; break; default: is_420 = 0; y_pitch = ((w + 1) / 2) * 4; uv_pitch = 0; break; } offset1 = y_pitch * h; offset2 = uv_pitch * h; if (is_420 != 0) offset2 /= 2; size = offset1 + 2 * offset2; *py_pitch = y_pitch; *puv_pitch = uv_pitch; *poffset1 = offset1; *poffset2 = offset2; *psize = size; } static int z4l_ovly_set_colorkey(Z4lPortPrivRec * pPriv, int key) { struct v4l2_format fmt; memset(&fmt, 0, sizeof(fmt)); fmt.type = V4L2_BUF_TYPE_VIDEO_OVERLAY; if (IoCtl(pPriv->fd, VIDIOC_G_FMT, &fmt, 1) < 0) return 0; fmt.fmt.win.chromakey = key; if (IoCtl(pPriv->fd, VIDIOC_S_FMT, &fmt, 1) < 0) return 0; pPriv->colorkey = key; return 1; } static int z4l_ovly_get_colorkey(Z4lPortPrivRec * pPriv, int *key) { struct v4l2_format fmt; memset(&fmt, 0, sizeof(fmt)); fmt.type = V4L2_BUF_TYPE_VIDEO_OVERLAY; if (IoCtl(pPriv->fd, VIDIOC_G_FMT, &fmt, 1) < 0) return 0; *key = fmt.fmt.win.chromakey; return 1; } static int z4l_ovly_set_keymode(Z4lPortPrivRec * pPriv, int enable) { struct v4l2_framebuffer fbuf; memset(&fbuf, 0, sizeof(fbuf)); if (IoCtl(pPriv->fd, VIDIOC_G_FBUF, &fbuf, 1) < 0) return 0; if (enable != 0) fbuf.flags |= V4L2_FBUF_FLAG_CHROMAKEY; else fbuf.flags &= ~V4L2_FBUF_FLAG_CHROMAKEY; fbuf.base = NULL; if (IoCtl(pPriv->fd, VIDIOC_S_FBUF, &fbuf, 1) < 0) return 0; pPriv->keymode = enable; return 1; } static int z4l_ovly_get_keymode(Z4lPortPrivRec * pPriv, int *enable) { struct v4l2_framebuffer fbuf; memset(&fbuf, 0, sizeof(fbuf)); if (IoCtl(pPriv->fd, VIDIOC_G_FBUF, &fbuf, 1) < 0) return 0; *enable = (fbuf.flags & V4L2_FBUF_FLAG_CHROMAKEY) != 0 ? 1 : 0; return 1; } static int z4l_ovly_set_encoding(Z4lPortPrivRec * pPriv, int id) { int l, n, inp; char *cp; t_std_data *sp; XF86VideoEncodingPtr enc; XF86VideoAdaptorPtr adpt; v4l2_std_id std; struct v4l2_format fmt; struct v4l2_framebuffer fbuf; adpt = pPriv->adpt; DBLOG(1, "z4l_ovly_set_encoding(%d)\n", id); if (id < 0 || id >= adpt->nEncodings) return 0; enc = &adpt->pEncodings[id]; cp = &enc->name[0]; n = sizeof(int) - 1; l = strlen(cp) + 1; l = (l + n) & ~n; sp = (t_std_data *) (cp + l); inp = sp->inp; DBLOG(1, " nm %s fmt %4.4s inp %d std %llx\n", cp, (char *) &sp->fmt, sp->inp, sp->std); if (IoCtl(pPriv->fd, VIDIOC_S_INPUT, &inp, 1) < 0) return 0; std = sp->std; if (IoCtl(pPriv->fd, VIDIOC_S_STD, &std, 1) < 0) return 0; memset(&fmt, 0, sizeof(fmt)); fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (IoCtl(pPriv->fd, VIDIOC_G_FMT, &fmt, 1) < 0) return 0; fmt.fmt.pix.pixelformat = sp->fmt; if (IoCtl(pPriv->fd, VIDIOC_S_FMT, &fmt, 1) < 0) return 0; memset(&fbuf, 0, sizeof(fbuf)); if (IoCtl(pPriv->fd, VIDIOC_G_FBUF, &fbuf, 1) < 0) return 0; fbuf.fmt.pixelformat = sp->fmt; fbuf.base = NULL; if (IoCtl(pPriv->fd, VIDIOC_S_FBUF, &fbuf, 1) < 0) return 0; pPriv->pixfmt = sp->fmt; pPriv->enc = enc; pPriv->src_is_set = pPriv->drw_is_set = 0; return 1; } static int z4l_ovly_get_encoding(Z4lPortPrivRec * pPriv, int *id) { XF86VideoEncodingPtr enc = pPriv->enc; *id = enc->id; return 1; } static void z4l_ovly_stop(Z4lPortPrivRec * pPriv) { int type, enable, fd; if (pPriv->run < 0) return; fd = pPriv->fd; if (pPriv->dir > 0) { type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ioctl(fd, VIDIOC_STREAMOFF, &type); } if (pPriv->dir <= 0) { enable = 0; ioctl(fd, VIDIOC_OVERLAY, &enable); } if (pPriv->dir != 0) z4l_ovly_unmap(pPriv); pPriv->run = -1; z4l_close_device(pPriv); } static void z4l_ovly_start(Z4lPortPrivRec * pPriv, int dir) { int enable; if (pPriv->run >= 0) return; if ((pPriv->dir = dir) != 0) z4l_ovly_map(pPriv, dir); enable = 1; if (IoCtl(pPriv->fd, VIDIOC_OVERLAY, &enable, 1) != 0) { z4l_ovly_stop(pPriv); return; } pPriv->run = 1; } static int z4l_region_equal(RegionPtr ap, RegionPtr bp) { int nboxes; BoxPtr abox, bbox; if (ap == NULL && bp == NULL) return 1; if (ap == NULL || bp == NULL) return 0; if ((nboxes = REGION_NUM_RECTS(ap)) != REGION_NUM_RECTS(bp) || ap->extents.x1 != bp->extents.x1 || ap->extents.x2 != bp->extents.x2 || ap->extents.y1 != bp->extents.y1 || ap->extents.y2 != bp->extents.y2) return 0; abox = REGION_RECTS(ap); bbox = REGION_RECTS(bp); while (--nboxes >= 0) { if (abox->x1 != bbox->x1 || abox->y1 != bbox->y1 || abox->x2 != bbox->x2 || abox->y2 != bbox->y2) return 0; ++abox; ++bbox; } return 1; } static void z4l_setup_colorkey(Z4lPortPrivRec * pPriv, ScreenPtr pScrn, RegionPtr clipBoxes) { if (pPriv->run > 0 && pPriv->dir <= 0 && pPriv->keymode != 0 && z4l_region_equal(&pPriv->clips, clipBoxes) == 0) { xf86XVFillKeyHelper(pScrn, pPriv->colorkey, clipBoxes); REGION_COPY(pScrn, &pPriv->clips, clipBoxes); } } static void Z4lStopVideo(ScrnInfoPtr pScrni, pointer data, Bool exit) { Z4lPortPrivRec *pPriv = (Z4lPortPrivRec *) data; DBLOG(1, "Z4lStopVideo()\n"); if (exit != 0) z4l_ovly_stop(pPriv); else pPriv->src_is_set = pPriv->drw_is_set = 0; REGION_EMPTY(pScrni->pScreen, &pPriv->clips); } static void Z4lQueryBestSize(ScrnInfoPtr pScrni, Bool motion, short vid_w, short vid_h, short drw_w, short drw_h, unsigned int *p_w, unsigned int *p_h, pointer data) { if (drw_w > MAX_OVLY_WIDTH) drw_w = MAX_OVLY_WIDTH; if (drw_h > MAX_OVLY_HEIGHT) drw_h = MAX_OVLY_HEIGHT; *p_w = drw_w; *p_h = drw_h; DBLOG(1, "Z4lQueryBestSize(%d, src %dx%d dst %dx%d)\n", motion, vid_w, vid_h, drw_w, drw_h); } static int Z4lPutImage(ScrnInfoPtr pScrni, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, int id, unsigned char *buf, short width, short height, Bool sync, RegionPtr clipBoxes, pointer data, DrawablePtr pDraw) { int fd, size; int y_pitch, uv_pitch, offset1, offset2; unsigned char *src, *dst; unsigned int pixfmt; struct v4l2_buffer bfr; Z4lPortPrivRec *pPriv = (Z4lPortPrivRec *) data; if (pPriv->run > 0 && pPriv->dir >= 0) return BadMatch; if (pPriv->fd < 0) { z4l_open_device(pPriv); if (pPriv->fd < 0) return BadValue; } fd = pPriv->fd; if (pPriv->run < 0) { DBLOG(2, "PutImg id %#x src %d,%d %dx%d drw %d,%d %dx%d bfr %p " "%dx%d data %p\n", id, src_x, src_y, src_w, src_h, drw_x, drw_y, drw_w, drw_h, buf, width, height, data); pPriv->pixfmt = pPriv->height = -1; pPriv->src_is_set = pPriv->drw_is_set = 0; } pixfmt = z4l_fourcc_pixfmt(id); if (pixfmt != pPriv->pixfmt) { z4l_ovly_reset(pPriv); z4l_ovly_pixfmt(pPriv, pixfmt); } if (pPriv->width != width || pPriv->height != height) { z4l_ovly_reset(pPriv); z4l_ovly_bfr(pPriv, width, height); } if (pPriv->src_is_set == 0 || pPriv->drw_is_set == 0 || pPriv->src_x != src_x || pPriv->src_y != src_y || pPriv->src_w != src_w || pPriv->src_h != src_h || pPriv->drw_x != drw_x || pPriv->drw_y != drw_y || pPriv->drw_w != drw_w || pPriv->drw_h != drw_h) z4l_ovly_rect(pPriv, src_x, src_y, src_w, src_h, drw_x, drw_y, drw_w, drw_h); if (pPriv->run < 0) { z4l_ovly_start(pPriv, -1); if (pPriv->run < 0) return BadValue; } if (pPriv->last < 0 && (pPriv->last = z4l_ovly_dqbuf(pPriv)) < 0) return BadAlloc; z4l_ovly_pitch(pixfmt, width, height, &y_pitch, &uv_pitch, &offset1, &offset2, &size); src = buf; dst = (unsigned char *) pPriv->bfrs[pPriv->last].start; DBLOG(3, "cpy %4.4s src %p dst %p yp %d uvp %d o1 %d o2 %d sz %d\n", (char *) &id, src, dst, y_pitch, uv_pitch, offset1, offset2, size); if (id == FOURCC_Y800) { memcpy(dst, src, offset1); src += offset1; dst += offset1; memset(dst, 0x80, 2 * offset2); } else memcpy(dst, src, size); memset(&bfr, 0, sizeof(bfr)); bfr.type = V4L2_BUF_TYPE_VIDEO_OVERLAY; bfr.index = pPriv->last; bfr.timestamp.tv_sec = 0; bfr.timestamp.tv_usec = 0; bfr.flags |= V4L2_BUF_FLAG_TIMECODE; if (IoCtl(fd, VIDIOC_QBUF, &bfr, 1) != 0) return BadAccess; pPriv->last = z4l_ovly_dqbuf(pPriv); z4l_setup_colorkey(pPriv, pScrni->pScreen, clipBoxes); return Success; } static int Z4lQueryImageAttributes(ScrnInfoPtr pScrni, int id, unsigned short *width, unsigned short *height, int *pitches, int *offsets) { int w, h, size; int y_pitch, uv_pitch, offset1, offset2; unsigned int pixfmt = z4l_fourcc_pixfmt(id); w = *width; h = *height; if (w > MAX_OVLY_WIDTH) w = MAX_OVLY_WIDTH; if (h > MAX_OVLY_HEIGHT) h = MAX_OVLY_HEIGHT; z4l_ovly_pitch(pixfmt, w, h, &y_pitch, &uv_pitch, &offset1, &offset2, &size); if (offsets != NULL) offsets[0] = 0; if (pitches != NULL) pitches[0] = y_pitch; switch (pixfmt) { case V4L2_PIX_FMT_YVU420: case V4L2_PIX_FMT_YUV420: if (offsets != NULL) { offsets[1] = offset1; offsets[2] = offset1 + offset2; } if (pitches != NULL) pitches[1] = pitches[2] = uv_pitch; h = (h + 1) & ~1; break; } w = (w + 1) & ~1; *width = w; *height = h; DBLOG(1, "Z4lQueryImageAttributes(%4.4s) = %d, %dx%d %d/%d %d/%d\n", (char *) &id, size, w, h, y_pitch, uv_pitch, offset1, offset2); return size; } static int Z4lPutVideo(ScrnInfoPtr pScrni, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, RegionPtr clipBoxes, pointer data, DrawablePtr pDraw) { int id; Z4lPortPrivRec *pPriv = (Z4lPortPrivRec *) data; DBLOG(2, "PutVid src %d,%d %dx%d drw %d,%d %dx%d data %p\n", src_x, src_y, src_w, src_h, drw_x, drw_y, drw_w, drw_h, data); if (z4l_open_device(pPriv) >= 0) { if (pPriv->run < 0) { DBLOG(2, "PutVid start\n"); z4l_ovly_get_encoding(pPriv, &id); z4l_ovly_set_encoding(pPriv, id); } DBLOG(2, "PutVid priv %d,%d %dx%d drw %d,%d %dx%d\n", pPriv->src_x, pPriv->src_y, pPriv->src_w, pPriv->src_h, pPriv->drw_x, pPriv->drw_y, pPriv->drw_w, pPriv->drw_h); if (pPriv->src_is_set == 0 || pPriv->drw_is_set == 0 || pPriv->src_w != src_w || pPriv->src_h != src_h || pPriv->drw_x != drw_x || pPriv->drw_y != drw_y || pPriv->drw_w != drw_w || pPriv->drw_h != drw_h) z4l_ovly_rect(pPriv, src_x, src_y, src_w, src_h, drw_x, drw_y, drw_w, drw_h); if (pPriv->run < 0) z4l_ovly_start(pPriv, 0); z4l_setup_colorkey(pPriv, pScrni->pScreen, clipBoxes); } return Success; } static XF86VideoEncodingPtr Z4lNewEncoding(XF86VideoEncodingPtr * encs, int *nencs) { XF86VideoEncodingPtr enc; XF86VideoEncodingPtr tencs = (XF86VideoEncodingPtr) realloc(*encs, sizeof(*tencs) * (*nencs + 1)); if (tencs == NULL) return NULL; *encs = tencs; enc = &tencs[*nencs]; ++*nencs; memset(enc, 0, sizeof(*enc)); return enc; } static void Z4lEncodingName(char *ename, int l, char *inp_name, char *std_name, char *fmt) { int i, ch; while ((ch = *inp_name++) != 0) { if (isalnum(ch) == 0) continue; if (--l <= 0) goto xit; *ename++ = ch; } if (--l <= 0) goto xit; *ename++ = '-'; while ((ch = *std_name++) != 0) { if (isalnum(ch) == 0) continue; if (--l <= 0) goto xit; *ename++ = ch; } if (--l <= 0) goto xit; *ename++ = '-'; i = 4; while (--i >= 0 && (ch = *fmt++) != 0) { if (isalnum(ch) == 0) continue; if (--l <= 0) goto xit; *ename++ = ch; } xit: *ename = 0; } static int Z4lAddEncoding(XF86VideoEncodingPtr enc, char *name, int id, int width, int height, int numer, int denom, int inp, v4l2_std_id std, unsigned int fmt) { int l, n; t_std_data *sp; char *cp; n = sizeof(int) - 1; l = strlen(&name[0]) + 1; l = (l + n) & ~n; n = l + sizeof(*sp); cp = (char *) malloc(n); if (cp == NULL) return 0; sp = (t_std_data *) (cp + l); enc->id = id; strcpy(cp, &name[0]); enc->name = cp; enc->width = width; enc->height = height; enc->rate.numerator = numer; enc->rate.denominator = denom; sp->inp = inp; sp->std = std; sp->fmt = fmt; DBLOG(1, "enc %s\n", &name[0]); return 1; } static XF86ImagePtr Z4lNewImage(XF86ImagePtr * imgs, int *nimgs) { XF86ImagePtr img; XF86ImagePtr timgs = (XF86ImagePtr) realloc(*imgs, sizeof(*timgs) * (*nimgs + 1)); if (timgs == NULL) return NULL; *imgs = timgs; img = &timgs[*nimgs]; ++*nimgs; memset(img, 0, sizeof(*img)); return img; } static int Z4lAddImage(XF86ImagePtr img, XF86ImagePtr ip) { *img = *ip; DBLOG(1, "img %4.4s\n", (char *) &img->id); return 1; } static XF86AttributePtr Z4lNewAttribute(XF86AttributePtr * attrs, int *nattrs) { XF86AttributePtr attr; XF86AttributePtr tattrs = (XF86AttributePtr) realloc(*attrs, sizeof(*tattrs) * (*nattrs + 1)); if (tattrs == NULL) return NULL; *attrs = tattrs; attr = &tattrs[*nattrs]; ++*nattrs; memset(attr, 0, sizeof(*attr)); return attr; } static void Z4lAttributeName(char *bp, int l, char *cp) { int ch; char *atomNm = bp; if (l > 0) { *bp++ = 'X'; --l; } if (l > 0) { *bp++ = 'V'; --l; } if (l > 0) { *bp++ = '_'; --l; } while (l > 0 && (ch = *cp++) != 0) { if (isalnum(ch) == 0) continue; *bp++ = toupper(ch); } *bp = 0; MakeAtom(&atomNm[0], strlen(&atomNm[0]), TRUE); } static int Z4lAddAttribute(XF86AttributePtr attr, char *name, int min, int max, int flags) { char *cp = (char *) malloc(strlen((char *) &name[0]) + 1); if (cp == NULL) return 0; attr->name = cp; strcpy(&attr->name[0], name); attr->min_value = min; attr->max_value = max; attr->flags = flags; DBLOG(1, "attr %s\n", attr->name); return 1; } static XF86VideoAdaptorPtr Z4lNewAdaptor(XF86VideoAdaptorPtr ** adpts, int *nadpts, int nattrs) { int n; Z4lPortPrivRec *pPriv; XF86VideoAdaptorPtr adpt, *tadpts; tadpts = (XF86VideoAdaptorPtr *) realloc(*adpts, sizeof(*tadpts) * (*nadpts + 1)); if (tadpts == NULL) return NULL; *adpts = tadpts; n = sizeof(*adpt) + sizeof(*pPriv) + 1 * sizeof(*adpt->pPortPrivates); n += (nattrs - 1) * sizeof(pPriv->attrIds[0]); adpt = (XF86VideoAdaptorPtr) malloc(n); if (adpt == NULL) return NULL; memset(adpt, 0, n); tadpts[*nadpts] = adpt; ++*nadpts; adpt->pPortPrivates = (DevUnion *) &adpt[1]; pPriv = (Z4lPortPrivRec *) & adpt->pPortPrivates[1]; adpt->pPortPrivates[0].ptr = (pointer) pPriv; pPriv->adpt = adpt; adpt->nPorts = 1; return adpt; } static int Z4lSetPortAttribute(ScrnInfoPtr pScrni, Atom attribute, INT32 value, pointer data) { Z4lPortPrivRec *pPriv = (Z4lPortPrivRec *) data; XF86VideoAdaptorPtr adpt; XF86AttributePtr attr; struct v4l2_control ctrl; int i, nattrs, attrId, val; const char *name = NameForAtom(attribute); int old_fd = pPriv->fd; DBLOG(1, "Z4lSetPortAttribute(%#lx,%d) '%s'\n", (unsigned long) attribute, (int) value, name != NULL ? name : "_null_"); if (name == NULL) return BadImplementation; if (old_fd < 0 && z4l_open_device(pPriv) < 0) return BadAccess; adpt = pPriv->adpt; attr = adpt->pAttributes; nattrs = adpt->nAttributes; for (i = 0; i < nattrs; ++i, ++attr) if (strcmp(attr->name, name) == 0) break; if (i >= nattrs) return BadMatch; attrId = pPriv->attrIds[i]; val = value; switch (attrId) { case ATTR_ENCODING_ID: z4l_ovly_set_encoding(pPriv, val); break; case ATTR_KEYMODE_ID: z4l_ovly_set_keymode(pPriv, val); REGION_EMPTY(pScrni->pScreen, &pPriv->clips); z4l_setup_colorkey(pPriv, pScrni->pScreen, &pPriv->clips); break; case ATTR_COLORKEY_ID: z4l_ovly_set_colorkey(pPriv, val); break; default: memset(&ctrl, 0, sizeof(ctrl)); ctrl.id = attrId + V4L2_CID_BASE; ctrl.value = val; if (IoCtl(pPriv->fd, VIDIOC_S_CTRL, &ctrl, 1) != 0) return BadMatch; break; } if (old_fd < 0) z4l_close_device(pPriv); return Success; } static int Z4lGetPortAttribute(ScrnInfoPtr pScrni, Atom attribute, INT32 *value, pointer data) { Z4lPortPrivRec *pPriv = (Z4lPortPrivRec *) data; XF86VideoAdaptorPtr adpt; XF86AttributePtr attr; struct v4l2_control ctrl; int i, nattrs, attrId, val; const char *name = NameForAtom(attribute); int old_fd = pPriv->fd; DBLOG(1, "Z4lGetPortAttribute(%#lx) '%s'\n", (unsigned long) attribute, name != NULL ? name : "_null_"); if (name == NULL) return BadImplementation; if (old_fd < 0 && z4l_open_device(pPriv) < 0) return BadAccess; adpt = pPriv->adpt; attr = adpt->pAttributes; nattrs = adpt->nAttributes; for (i = 0; i < nattrs; ++i, ++attr) if (strcmp(attr->name, name) == 0) break; if (i >= nattrs) return BadMatch; attrId = pPriv->attrIds[i]; val = 0; switch (attrId) { case ATTR_ENCODING_ID: z4l_ovly_get_encoding(pPriv, &val); *value = val; break; case ATTR_KEYMODE_ID: z4l_ovly_get_keymode(pPriv, &val); *value = val; break; case ATTR_COLORKEY_ID: z4l_ovly_get_colorkey(pPriv, &val); break; default: memset(&ctrl, 0, sizeof(ctrl)); ctrl.id = attrId + V4L2_CID_BASE; if (IoCtl(pPriv->fd, VIDIOC_G_CTRL, &ctrl, 1) != 0) return BadMatch; val = ctrl.value; break; } if (old_fd < 0) z4l_close_device(pPriv); *value = val; return Success; } static void (*oldAdjustFrame) (ADJUST_FRAME_ARGS_DECL) = NULL; static void Z4lAdjustFrame(ADJUST_FRAME_ARGS_DECL) { SCRN_INFO_PTR(arg); int i; XF86VideoAdaptorPtr adpt; Z4lPortPrivRec *pPriv; DBLOG(3, "Z4lAdjustFrame(%d,%d)\n", x, y); z4l_x_offset = x; z4l_y_offset = y; oldAdjustFrame(ADJUST_FRAME_ARGS(x, y)); /* xv adjust does not handle putvideo case */ for (i = 0; i < Z4l_nAdaptors; ++i) { adpt = Z4l_pAdaptors[i]; pPriv = (Z4lPortPrivRec *) adpt->pPortPrivates[0].ptr; if (pPriv->run > 0) { pPriv->drw_is_set = 0; z4l_ovly_rect(pPriv, pPriv->src_x, pPriv->src_y, pPriv->src_w, pPriv->src_h, pPriv->drw_x, pPriv->drw_y, pPriv->drw_w, pPriv->drw_h); } } } static int Z4lInit(ScrnInfoPtr pScrni, XF86VideoAdaptorPtr ** adaptors) { int i, id, fd, dev, enable, has_video, has_colorkey; int ctl, cinp, inp, std, fmt, has_image; int nadpts, nattrs, nencs, cenc, nimgs; int numer, denom, width, height; unsigned int pixfmt, cpixfmt, opixfmt; XF86VideoAdaptorPtr *adpts, adpt; XF86AttributePtr attrs, attr; XF86VideoEncodingPtr encs, enc; XF86ImagePtr ip, img, imgs; Z4lPortPrivRec *pPriv; char *dp, *msg; char enc_name[256], attr_name[256]; int attrIds[V4L2_CID_LASTP1 - V4L2_CID_BASE + ATTR_MAX_ID]; struct v4l2_capability capability; v4l2_std_id cstd_id, std_id; struct v4l2_standard standard; struct v4l2_format format, cfmt; struct v4l2_input input; struct v4l2_fmtdesc fmtdesc; struct v4l2_queryctrl queryctrl; struct v4l2_framebuffer fbuf; DBLOG(1, "Init\n"); if (oldAdjustFrame == NULL) { oldAdjustFrame = pScrni->AdjustFrame; pScrni->AdjustFrame = Z4lAdjustFrame; } fd = -1; enc = NULL; encs = NULL; nencs = 0; img = NULL; imgs = NULL; nimgs = 0; attr = NULL; attrs = NULL; nattrs = 0; adpt = NULL; adpts = NULL; nadpts = 0; has_video = has_image = has_colorkey = 0; for (dev = 0; z4l_dev_paths[dev] != NULL; ++dev) { fd = open(z4l_dev_paths[dev], O_RDWR, 0); if (fd < 0) continue; DBLOG(1, "%s open ok\n", z4l_dev_paths[dev]); msg = NULL; enable = 1; if (IoCtl(fd, VIDIOC_QUERYCAP, &capability, 1) < 0) msg = "bad querycap"; else if ((capability.capabilities & V4L2_CAP_VIDEO_OVERLAY) == 0) msg = "no overlay"; else if ((capability.capabilities & V4L2_CAP_STREAMING) == 0) msg = "no streaming"; #ifdef NONBLK_IO else if (IoCtl(fd, FIONBIO, &enable, 1) != 0) msg = "cant enable non-blocking io"; #endif if (msg == NULL) { memset(&format, 0, sizeof(format)); format.type = 0x100; if (IoCtl(fd, VIDIOC_G_FMT, &format, 1) != 0) msg = "no src/dst ovly fmt"; } if (msg != NULL) { DBLOG(0, "%s %s\n", z4l_dev_paths[dev], msg); close(fd); continue; } memset(&cfmt, 0, sizeof(cfmt)); cfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (IoCtl(fd, VIDIOC_G_FMT, &cfmt, 1) < 0) goto fail; if (IoCtl(fd, VIDIOC_G_STD, &cstd_id, 1) < 0) goto fail; if (IoCtl(fd, VIDIOC_G_INPUT, &cinp, 1) < 0) goto fail; cpixfmt = cfmt.fmt.pix.pixelformat; cenc = 0; for (inp = 0;; ++inp) { memset(&input, 0, sizeof(input)); input.index = inp; if (IoCtl(fd, VIDIOC_ENUMINPUT, &input, 0) < 0) break; id = inp; if (IoCtl(fd, VIDIOC_S_INPUT, &id, 1) < 0) goto fail; for (std = 0;; ++std) { memset(&standard, 0, sizeof(standard)); standard.index = std; if (IoCtl(fd, VIDIOC_ENUMSTD, &standard, 0) < 0) break; std_id = standard.id; denom = standard.frameperiod.denominator; numer = standard.frameperiod.numerator; if (IoCtl(fd, VIDIOC_S_STD, &std_id, 1) < 0) continue; memset(&format, 0, sizeof(format)); format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (IoCtl(fd, VIDIOC_G_FMT, &format, 1) < 0) continue; width = format.fmt.pix.width; height = format.fmt.pix.height; for (fmt = 0;; ++fmt) { memset(&fmtdesc, 0, sizeof(fmtdesc)); fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fmtdesc.index = fmt; if (IoCtl(fd, VIDIOC_ENUM_FMT, &fmtdesc, 0) < 0) break; pixfmt = fmtdesc.pixelformat; ip = &pixfmts[0]; for (i = sizeof(pixfmts) / sizeof(pixfmts[0]); --i >= 0; ++ip) if (z4l_fourcc_pixfmt(ip->id) == pixfmt) break; if (i >= 0) { id = nencs; has_video = 1; if ((enc = Z4lNewEncoding(&encs, &nencs)) == NULL) goto fail; Z4lEncodingName(&enc_name[0], sizeof(enc_name), (char *) &input.name[0], (char *) &standard.name[0], (char *) &pixfmt); if (Z4lAddEncoding (enc, &enc_name[0], id, width, height, denom, numer, inp, std_id, pixfmt) == 0) goto fail; if (std_id == cstd_id && inp == cinp && pixfmt == cpixfmt) cenc = id; } } } } if (IoCtl(fd, VIDIOC_S_INPUT, &cinp, 1) < 0) goto fail; if (IoCtl(fd, VIDIOC_S_STD, &cstd_id, 1) < 0) goto fail; if (IoCtl(fd, VIDIOC_S_FMT, &cfmt, 1) < 0) goto fail; if (encs == NULL) { DBLOG(0, "no encodings\n"); goto fail; } for (fmt = 0;; ++fmt) { memset(&fmtdesc, 0, sizeof(fmtdesc)); fmtdesc.type = V4L2_BUF_TYPE_VIDEO_OVERLAY; fmtdesc.index = fmt; if (IoCtl(fd, VIDIOC_ENUM_FMT, &fmtdesc, 0) < 0) break; pixfmt = fmtdesc.pixelformat; ip = &pixfmts[0]; for (i = sizeof(pixfmts) / sizeof(pixfmts[0]); --i >= 0; ++ip) if (z4l_fourcc_pixfmt(ip->id) == pixfmt) break; if (i >= 0) { has_image = 1; if ((img = Z4lNewImage(&imgs, &nimgs)) == NULL) goto fail; if (Z4lAddImage(img, ip) == 0) goto fail; } } if (nimgs > 0) { id = nencs; if ((enc = Z4lNewEncoding(&encs, &nencs)) == NULL) goto fail; if (Z4lAddEncoding(enc, "XV_IMAGE", id, MAX_OVLY_WIDTH, MAX_OVLY_HEIGHT, 0, 0, 0, 0, pixfmt) == 0) goto fail; } ctl = 0; for (ctl = 0; ctl < (V4L2_CID_LASTP1 - V4L2_CID_BASE); ++ctl) { memset(&queryctrl, 0, sizeof(queryctrl)); queryctrl.id = V4L2_CID_BASE + ctl; if (IoCtl(fd, VIDIOC_QUERYCTRL, &queryctrl, 0) < 0) continue; if (queryctrl.type != V4L2_CTRL_TYPE_INTEGER && queryctrl.type != V4L2_CTRL_TYPE_BOOLEAN) continue; attrIds[nattrs] = ctl; if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL) goto fail; Z4lAttributeName(&attr_name[0], sizeof(attr_name), (char *) &queryctrl.name[0]); if (Z4lAddAttribute(attr, &attr_name[0], queryctrl.minimum, queryctrl.maximum, XvSettable | XvGettable) == 0) goto fail; } attrIds[nattrs] = ATTR_ENCODING_ID; if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL) goto fail; Z4lAttributeName(&attr_name[0], sizeof(attr_name), ATTR_ENCODING); if (Z4lAddAttribute(attr, &attr_name[0], 0, nencs - 1, XvSettable | XvGettable) == 0) goto fail; memset(&fbuf, 0, sizeof(fbuf)); if (IoCtl(fd, VIDIOC_G_FBUF, &fbuf, 1) < 0) goto fail; opixfmt = fbuf.fmt.pixelformat; if ((fbuf.capability & V4L2_FBUF_CAP_CHROMAKEY) != 0) { attrIds[nattrs] = ATTR_KEYMODE_ID; if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL) goto fail; Z4lAttributeName(&attr_name[0], sizeof(attr_name), ATTR_KEYMODE); if (Z4lAddAttribute(attr, &attr_name[0], 0, 1, XvSettable | XvGettable) == 0) goto fail; attrIds[nattrs] = ATTR_COLORKEY_ID; if ((attr = Z4lNewAttribute(&attrs, &nattrs)) == NULL) goto fail; Z4lAttributeName(&attr_name[0], sizeof(attr_name), ATTR_COLORKEY); if (Z4lAddAttribute(attr, &attr_name[0], 0, 0xffffff, XvSettable | XvGettable) == 0) goto fail; has_colorkey = 1; } dp = malloc(strlen((char *) &capability.card[0]) + 1); if (dp == NULL) goto fail; strcpy(dp, (char *) &capability.card[0]); if ((adpt = Z4lNewAdaptor(&adpts, &nadpts, nattrs)) == NULL) goto fail; adpt->type = XvWindowMask | XvInputMask; if (has_video != 0) adpt->type |= XvVideoMask; if (has_image != 0) adpt->type |= XvImageMask; adpt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; adpt->name = dp; adpt->type = XvInputMask | XvWindowMask | XvVideoMask | XvImageMask; adpt->pEncodings = encs; adpt->nEncodings = nencs; adpt->pFormats = &Formats[0]; adpt->nFormats = sizeof(Formats) / sizeof(Formats[0]); adpt->pAttributes = attrs; adpt->nAttributes = nattrs; attrs = NULL; nattrs = 0; adpt->pImages = imgs; adpt->nImages = nimgs; imgs = NULL; nimgs = 0; adpt->PutVideo = Z4lPutVideo; adpt->StopVideo = Z4lStopVideo; adpt->SetPortAttribute = Z4lSetPortAttribute; adpt->GetPortAttribute = Z4lGetPortAttribute; adpt->QueryBestSize = Z4lQueryBestSize; adpt->PutImage = Z4lPutImage; adpt->QueryImageAttributes = Z4lQueryImageAttributes; pPriv = (Z4lPortPrivRec *) adpt->pPortPrivates[0].ptr; pPriv->fd = fd; pPriv->run = -1; pPriv->dir = 0; pPriv->nbfrs = -1; pPriv->bufsz = -1; pPriv->last = -1; pPriv->pixfmt = opixfmt; #if defined(REGION_NULL) REGION_NULL(pScrni->pScreen, &pPriv->clips); #else REGION_INIT(pScrni->pScreen, &pPriv->clips, NullBox, 0); #endif strncpy(&pPriv->dev_path[0], z4l_dev_paths[dev], sizeof(pPriv->dev_path)); pPriv->enc = &encs[cenc]; for (i = 0; i < adpt->nAttributes; ++i) pPriv->attrIds[i] = attrIds[i]; DBLOG(1, "adpt %s\n", dp); if (has_colorkey != 0) { z4l_ovly_set_colorkey(pPriv, DEFAULT_COLORKEY); z4l_ovly_set_keymode(pPriv, DEFAULT_KEYMODE); } close(fd); pPriv->fd = -1; adpt = NULL; cenc = 0; encs = NULL; nencs = 0; } DBLOG(0, "init done, %d device(s) found\n", nadpts); Z4l_nAdaptors = nadpts; Z4l_pAdaptors = adpts; *adaptors = adpts; return nadpts; fail: if (attrs != NULL) { for (i = 0; i < nattrs; ++i) if (attrs[i].name != NULL) free(attrs[i].name); free(attrs); } if (encs != NULL) { for (i = 0; i < nencs; ++i) { if (encs[i].name != NULL) free(encs[i].name); } free(encs); } if (imgs != NULL) free(imgs); if (adpts != NULL) { for (i = 0; i < nadpts; ++i) { if ((adpt = adpts[i]) != NULL) { if (adpt->name != NULL) free(adpt->name); if ((attrs = adpt->pAttributes) != NULL) { for (i = 0; i < adpt->nAttributes; ++i) if (attrs[i].name != NULL) free(attrs[i].name); free(attrs); } if ((encs = adpt->pEncodings) != NULL) { for (i = 0; i < adpt->nEncodings; ++i, ++enc) if (encs[i].name != NULL) free(encs[i].name); free(encs); } if ((imgs = adpt->pImages) != NULL) free(imgs); free(adpt); } } free(adpts); } if (fd >= 0) close(fd); return 0; } static Bool Z4lProbe(DriverPtr drv, int flags) { DBLOG(1, "Probe\n"); if (flags & PROBE_DETECT) return TRUE; xf86XVRegisterGenericAdaptorDriver(Z4lInit); drv->refCount++; return TRUE; } static const OptionInfoRec * Z4lAvailableOptions(int chipid, int busid) { return NULL; } static void Z4lIdentify(int flags) { xf86Msg(X_INFO, "z4l driver for Video4Linux\n"); } _X_EXPORT DriverRec Z4l = { 40001, "z4l", Z4lIdentify, Z4lProbe, Z4lAvailableOptions, NULL, 0 }; #ifdef XFree86LOADER static MODULESETUPPROTO(z4lSetup); static XF86ModuleVersionInfo z4lVersionRec = { "ztv", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, 0, 0, 1, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, MOD_CLASS_NONE, {0, 0, 0, 0} }; _X_EXPORT XF86ModuleData ztvModuleData = { &z4lVersionRec, z4lSetup, NULL }; static pointer z4lSetup(pointer module, pointer opts, int *errmaj, int *errmin) { const char *osname; static Bool setupDone = FALSE; if (setupDone != FALSE) { if (errmaj != NULL) *errmaj = LDR_ONCEONLY; return NULL; } setupDone = TRUE; LoaderGetOS(&osname, NULL, NULL, NULL); if (osname == NULL || strcmp(osname, "linux") != 0) { if (errmaj) *errmaj = LDR_BADOS; if (errmin) *errmin = 0; return NULL; } xf86AddDriver(&Z4l, module, 0); return (pointer) 1; } #endif #endif /* !XvExtension */ xf86-video-geode-2.11.18/src/lx_video.c0000644000175000017500000006650512654445443014360 00000000000000/* Copyright (c) 2007-2008 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to * deal in the Software without restriction, including without limitation the * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* TODO: Add rotation Add back in double buffering? */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "xf86.h" #include "xf86_OSproc.h" #include "compiler.h" #include "xf86PciInfo.h" #include "xf86Pci.h" #include "xf86fbman.h" #include "regionstr.h" #include "dixstruct.h" #include "geode.h" #include "xf86xv.h" #include #include "fourcc.h" #include "geode_fourcc.h" #include "cim/cim_defs.h" #include "cim/cim_regs.h" #define OFF_DELAY 200 #define FREE_DELAY 60000 #define OFF_TIMER 0x01 #define FREE_TIMER 0x02 #define CLIENT_VIDEO_ON 0x04 #define TIMER_MASK (OFF_TIMER | FREE_TIMER) #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof((a)) / (sizeof(*(a)))) #endif /* Local function prototypes */ static void LXStopVideo(ScrnInfoPtr pScrni, pointer data, Bool exit); static void LXDisplayVideo(ScrnInfoPtr pScrni, int id, short width, short height, BoxPtr dstBox, short srcW, short srcH, short drawW, short drawH); static void LXResetVideo(ScrnInfoPtr pScrni); static XF86VideoEncodingRec DummyEncoding[1] = { {0, "XV_IMAGE", 1024, 1024, {1, 1}} }; static XF86VideoFormatRec Formats[] = { {8, PseudoColor}, {15, TrueColor}, {16, TrueColor}, {24, TrueColor} }; static XF86AttributeRec Attributes[] = { {XvSettable | XvGettable, 0, (1 << 24) - 1, "XV_COLORKEY"}, {XvSettable | XvGettable, 0, 1, "XV_FILTER"}, {XvSettable | XvGettable, 0, 1, "XV_COLORKEYMODE"} }; static XF86ImageRec Images[] = { XVIMAGE_UYVY, XVIMAGE_YUY2, XVIMAGE_Y2YU, XVIMAGE_YVYU, XVIMAGE_Y800, XVIMAGE_I420, XVIMAGE_YV12, XVIMAGE_RGB565 }; typedef struct { ExaOffscreenArea *vidmem; RegionRec clip; CARD32 filter; CARD32 colorKey; CARD32 colorKeyMode; CARD32 videoStatus; Time offTime; Time freeTime; short pwidth, pheight; } GeodePortPrivRec, *GeodePortPrivPtr; #define GET_PORT_PRIVATE(pScrni) \ (GeodePortPrivRec *)((GEODEPTR(pScrni))->adaptor->pPortPrivates[0].ptr) static void LXCopyFromSys(GeodeRec * pGeode, unsigned char *src, unsigned int dst, int dstPitch, int srcPitch, int h, int w) { gp_declare_blt(0); gp_set_bpp((srcPitch / w) << 3); gp_set_raster_operation(0xCC); gp_set_strides(dstPitch, srcPitch); gp_set_solid_pattern(0); gp_color_bitmap_to_screen_blt(dst, 0, w, h, src, srcPitch); } static void LXSetColorkey(ScrnInfoPtr pScrni, GeodePortPrivRec * pPriv) { int red, green, blue; unsigned long key; switch (pScrni->depth) { case 8: vg_get_display_palette_entry(pPriv->colorKey & 0xFF, &key); red = ((key >> 16) & 0xFF); green = ((key >> 8) & 0xFF); blue = (key & 0xFF); break; case 16: red = (pPriv->colorKey & pScrni->mask.red) >> pScrni->offset.red << (8 - pScrni->weight.red); green = (pPriv->colorKey & pScrni->mask.green) >> pScrni->offset.green << (8 - pScrni->weight.green); blue = (pPriv->colorKey & pScrni->mask.blue) >> pScrni->offset.blue << (8 - pScrni->weight.blue); break; default: /* for > 16 bpp we send in the mask in xf86SetWeight. This * function is providing the offset by 1 more. So we take * this as a special case and subtract 1 for > 16 */ red = (pPriv->colorKey & pScrni->mask.red) >> (pScrni->offset.red - 1) << (8 - pScrni->weight.red); green = (pPriv->colorKey & pScrni->mask.green) >> (pScrni->offset.green - 1) << (8 - pScrni->weight.green); blue = (pPriv->colorKey & pScrni->mask.blue) >> (pScrni->offset.blue - 1) << (8 - pScrni->weight.blue); break; } df_set_video_color_key((blue | (green << 8) | (red << 16)), 0xFFFFFF, (pPriv->colorKeyMode == 0)); REGION_EMPTY(pScrni->pScreen, &pPriv->clip); } /* A structure full of the scratch information that originates in the copy routines, but is needed for the video display - maybe we should figure out a way to attach this to structures? I hate to put it in pGeode since it will increase the size of the structure, and possibly cause us cache issues. */ struct { unsigned int dstOffset; unsigned int dstPitch; unsigned int UVPitch; unsigned int UDstOffset; unsigned int VDstOffset; } videoScratch; /* Copy planar YUV data */ static Bool LXAllocateVidMem(ScrnInfoPtr pScrni, GeodePortPrivRec * pPriv, int size) { if (!pPriv->vidmem || pPriv->vidmem->size < size) { if (pPriv->vidmem) { exaOffscreenFree(pScrni->pScreen, pPriv->vidmem); pPriv->vidmem = NULL; } pPriv->vidmem = exaOffscreenAlloc(pScrni->pScreen, size, 4, TRUE, NULL, NULL); if (pPriv->vidmem == NULL) { ErrorF("Could not allocate memory for the video\n"); return FALSE; } } return TRUE; } static Bool LXCopyPlanar(ScrnInfoPtr pScrni, int id, unsigned char *buf, short x1, short y1, short x2, short y2, int width, int height, pointer data) { GeodeRec *pGeode = GEODEPTR(pScrni); GeodePortPrivRec *pPriv = (GeodePortPrivRec *) data; unsigned int YSrcPitch, YDstPitch; unsigned int UVSrcPitch, UVDstPitch; unsigned int YSrcOffset, YDstOffset; unsigned int USrcOffset, UDstOffset; unsigned int VSrcOffset, VDstOffset; unsigned int size, lines, top, left, pixels; YSrcPitch = (width + 3) & ~3; YDstPitch = (width + 31) & ~31; UVSrcPitch = ((width >> 1) + 3) & ~3; UVDstPitch = ((width >> 1) + 15) & ~15; USrcOffset = YSrcPitch * height; VSrcOffset = USrcOffset + (UVSrcPitch * (height >> 1)); UDstOffset = YDstPitch * height; VDstOffset = UDstOffset + (UVDstPitch * (height >> 1)); size = YDstPitch * height; size += UVDstPitch * height; if (LXAllocateVidMem(pScrni, pPriv, size) == FALSE) { ErrorF("Error allocating an offscreen Planar region.\n"); return FALSE; } /* The top of the source region we want to copy */ top = y1 & ~1; /* The left hand side of the source region, aligned on a word */ left = x1 & ~1; /* Number of bytes to copy, also word aligned */ pixels = ((x2 + 1) & ~1) - left; /* Calculate the source offset */ YSrcOffset = (top * YSrcPitch) + left; USrcOffset += ((top >> 1) * UVSrcPitch) + (left >> 1); VSrcOffset += ((top >> 1) * UVSrcPitch) + (left >> 1); /* Calculate the destination offset */ YDstOffset = (top * YDstPitch) + left; UDstOffset += ((top >> 1) * UVDstPitch) + (left >> 1); VDstOffset += ((top >> 1) * UVDstPitch) + (left >> 1); lines = ((y2 + 1) & ~1) - top; /* Copy Y */ LXCopyFromSys(pGeode, buf + YSrcOffset, pPriv->vidmem->offset + YDstOffset, YDstPitch, YSrcPitch, lines, pixels); /* Copy U + V at the same time */ LXCopyFromSys(pGeode, buf + USrcOffset, pPriv->vidmem->offset + UDstOffset, UVDstPitch, UVSrcPitch, lines, pixels >> 1); videoScratch.dstOffset = pPriv->vidmem->offset + YDstOffset; videoScratch.dstPitch = YDstPitch; videoScratch.UVPitch = UVDstPitch; videoScratch.UDstOffset = pPriv->vidmem->offset + UDstOffset; videoScratch.VDstOffset = pPriv->vidmem->offset + VDstOffset; return TRUE; } static Bool LXCopyPacked(ScrnInfoPtr pScrni, int id, unsigned char *buf, short x1, short y1, short x2, short y2, int width, int height, pointer data) { GeodePortPrivRec *pPriv = (GeodePortPrivRec *) data; GeodeRec *pGeode = GEODEPTR(pScrni); unsigned int dstPitch, srcPitch; unsigned int srcOffset, dstOffset; unsigned int lines, top, left, pixels; dstPitch = ((width << 1) + 3) & ~3; srcPitch = (width << 1); lines = ((dstPitch * height) + pGeode->Pitch - 1) / pGeode->Pitch; if (LXAllocateVidMem(pScrni, pPriv, dstPitch * height) == FALSE) { ErrorF("Error allocating an offscreen Packed region.\n"); return FALSE; } /* The top of the source region we want to copy */ top = y1; /* The left hand side of the source region, aligned on a word */ left = x1 & ~1; /* Number of bytes to copy, also word aligned */ pixels = ((x2 + 1) & ~1) - left; /* Adjust the incoming buffer */ srcOffset = (top * srcPitch) + left; /* Calculate the destination offset */ dstOffset = pPriv->vidmem->offset + (top * dstPitch) + left; /* Make the copy happen */ if (id == FOURCC_Y800) { /* Use the shared (unaccelerated) greyscale copy - you could probably * accelerate it using a 2 pass blit and patterns, but it doesn't really * seem worth it */ GeodeCopyGreyscale(buf + srcOffset, pGeode->FBBase + dstOffset, srcPitch, dstPitch, height, pixels >> 1); } else /* FIXME: should lines be used here instead of height? */ LXCopyFromSys(pGeode, buf + srcOffset, dstOffset, dstPitch, srcPitch, height, pixels); videoScratch.dstOffset = dstOffset; videoScratch.dstPitch = dstPitch; return TRUE; } static void LXDisplayVideo(ScrnInfoPtr pScrni, int id, short width, short height, BoxPtr dstBox, short srcW, short srcH, short drawW, short drawH) { long ystart, xend, yend; unsigned long lines = 0; unsigned long yExtra, uvExtra = 0; DF_VIDEO_POSITION vidPos; DF_VIDEO_SOURCE_PARAMS vSrcParams; int err; memset(&vSrcParams, 0, sizeof(vSrcParams)); gp_wait_until_idle(); switch (id) { case FOURCC_UYVY: vSrcParams.video_format = DF_VIDFMT_UYVY; break; case FOURCC_Y800: case FOURCC_YV12: case FOURCC_I420: vSrcParams.video_format = DF_VIDFMT_Y0Y1Y2Y3; break; case FOURCC_YUY2: vSrcParams.video_format = DF_VIDFMT_YUYV; break; case FOURCC_Y2YU: vSrcParams.video_format = DF_VIDFMT_Y2YU; break; case FOURCC_YVYU: vSrcParams.video_format = DF_VIDFMT_YVYU; break; case FOURCC_RGB565: vSrcParams.video_format = DF_VIDFMT_RGB; break; } vSrcParams.width = width; vSrcParams.height = height; vSrcParams.y_pitch = videoScratch.dstPitch; vSrcParams.uv_pitch = videoScratch.UVPitch; /* Set up scaling */ df_set_video_filter_coefficients(NULL, 1); err = df_set_video_scale(width, height, drawW, drawH, DF_SCALEFLAG_CHANGEX | DF_SCALEFLAG_CHANGEY); if (err != CIM_STATUS_OK) { /* Note the problem, but do nothing for now. */ ErrorF("Video scale factor too large: %dx%d -> %dx%d\n", width, height, drawW, drawH); } /* Figure out clipping */ xend = dstBox->x2; yend = dstBox->y2; if (dstBox->y1 < 0) { if (srcH < drawH) lines = ((-dstBox->y1) * srcH) / drawH; else lines = (-dstBox->y1); ystart = 0; drawH += dstBox->y1; } else { ystart = dstBox->y1; lines = 0; } yExtra = lines * videoScratch.dstPitch; uvExtra = (lines >> 1) * videoScratch.UVPitch; memset(&vidPos, 0, sizeof(vidPos)); vidPos.x = dstBox->x1; vidPos.y = ystart; vidPos.width = xend - dstBox->x1; vidPos.height = yend - ystart; df_set_video_position(&vidPos); vSrcParams.y_offset = videoScratch.dstOffset + yExtra; switch (id) { case FOURCC_Y800: case FOURCC_I420: vSrcParams.u_offset = videoScratch.UDstOffset + uvExtra; vSrcParams.v_offset = videoScratch.VDstOffset + uvExtra; break; case FOURCC_YV12: vSrcParams.v_offset = videoScratch.UDstOffset + uvExtra; vSrcParams.u_offset = videoScratch.VDstOffset + uvExtra; break; default: vSrcParams.u_offset = vSrcParams.v_offset = 0; break; } vSrcParams.flags = DF_SOURCEFLAG_IMPLICITSCALING; df_configure_video_source(&vSrcParams, &vSrcParams); /* Turn on the video palette */ df_set_video_palette(NULL); df_set_video_enable(1, 0); } static int LXPutImage(ScrnInfoPtr pScrni, short srcX, short srcY, short drawX, short drawY, short srcW, short srcH, short drawW, short drawH, int id, unsigned char *buf, short width, short height, Bool sync, RegionPtr clipBoxes, pointer data, DrawablePtr pDraw) { GeodeRec *pGeode = GEODEPTR(pScrni); GeodePortPrivRec *pPriv = (GeodePortPrivRec *) data; INT32 x1, x2, y1, y2; BoxRec dstBox; Bool ret; if (pGeode->rotation != RR_Rotate_0) return Success; if (srcW <= 0 || srcH <= 0) { return Success; } if (drawW <= 0 || drawH <= 0) { return Success; } if (drawW > 16384) drawW = 16384; memset(&videoScratch, 0, sizeof(videoScratch)); x1 = srcX; x2 = srcX + srcW; y1 = srcY; y2 = srcY + srcH; dstBox.x1 = drawX; dstBox.x2 = drawX + drawW; dstBox.y1 = drawY; dstBox.y2 = drawY + drawH; dstBox.x1 -= pScrni->frameX0; dstBox.x2 -= pScrni->frameX0; dstBox.y1 -= pScrni->frameY0; dstBox.y2 -= pScrni->frameY0; if (id == FOURCC_YV12 || id == FOURCC_I420) ret = LXCopyPlanar(pScrni, id, buf, x1, y1, x2, y2, width, height, data); else ret = LXCopyPacked(pScrni, id, buf, x1, y1, x2, y2, width, height, data); if (ret == FALSE) return BadAlloc; if (!RegionsEqual(&pPriv->clip, clipBoxes) || (drawW != pPriv->pwidth || drawH != pPriv->pheight)) { REGION_COPY(pScrni->pScreen, &pPriv->clip, clipBoxes); if (pPriv->colorKeyMode == 0) { xf86XVFillKeyHelper(pScrni->pScreen, pPriv->colorKey, clipBoxes); } LXDisplayVideo(pScrni, id, width, height, &dstBox, srcW, srcH, drawW, drawH); pPriv->pwidth = drawW; pPriv->pheight = drawH; } pPriv->videoStatus = CLIENT_VIDEO_ON; return Success; } static void LXQueryBestSize(ScrnInfoPtr pScrni, Bool motion, short vidW, short vidH, short drawW, short drawH, unsigned int *retW, unsigned int *retH, pointer data) { *retW = drawW > 16384 ? 16384 : drawW; *retH = drawH; } static Atom xvColorKey, xvColorKeyMode, xvFilter; static int LXGetPortAttribute(ScrnInfoPtr pScrni, Atom attribute, INT32 *value, pointer data) { GeodePortPrivRec *pPriv = (GeodePortPrivRec *) data; if (attribute == xvColorKey) *value = pPriv->colorKey; else if (attribute == xvColorKeyMode) *value = pPriv->colorKeyMode; else if (attribute == xvFilter) *value = pPriv->filter; else return BadMatch; return Success; } static int LXSetPortAttribute(ScrnInfoPtr pScrni, Atom attribute, INT32 value, pointer data) { GeodePortPrivRec *pPriv = (GeodePortPrivRec *) data; gp_wait_until_idle(); if (attribute == xvColorKey) { pPriv->colorKey = value; LXSetColorkey(pScrni, pPriv); } else if (attribute == xvColorKeyMode) { pPriv->colorKeyMode = value; LXSetColorkey(pScrni, pPriv); } else if (attribute == xvFilter) { if ((value < 0) || (value > 1)) return BadValue; pPriv->filter = value; } else return BadMatch; return Success; } static void LXStopVideo(ScrnInfoPtr pScrni, pointer data, Bool exit) { GeodePortPrivRec *pPriv = (GeodePortPrivRec *) data; if (pPriv->videoStatus == 0) return; REGION_EMPTY(pScrni->pScreen, &pPriv->clip); gp_wait_until_idle(); if (exit) { if (pPriv->videoStatus & CLIENT_VIDEO_ON) { unsigned int val; df_set_video_enable(0, 0); /* Put the LUT back in bypass */ val = READ_VID32(DF_VID_MISC); WRITE_VID32(DF_VID_MISC, val | DF_GAMMA_BYPASS_BOTH); } if (pPriv->vidmem) { exaOffscreenFree(pScrni->pScreen, pPriv->vidmem); pPriv->vidmem = NULL; } pPriv->videoStatus = 0; /* Eh? */ } else if (pPriv->videoStatus & CLIENT_VIDEO_ON) { pPriv->videoStatus |= OFF_TIMER; pPriv->offTime = currentTime.milliseconds + OFF_DELAY; } } static void LXResetVideo(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); if (!pGeode->NoAccel) { GeodePortPrivRec *pPriv = pGeode->adaptor->pPortPrivates[0].ptr; gp_wait_until_idle(); df_set_video_palette(NULL); LXSetColorkey(pScrni, pPriv); } } static void LXVidBlockHandler(BLOCKHANDLER_ARGS_DECL) { SCREEN_PTR(arg); ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); GeodePortPrivRec *pPriv = GET_PORT_PRIVATE(pScrni); pScrn->BlockHandler = pGeode->BlockHandler; (*pScrn->BlockHandler) (BLOCKHANDLER_ARGS); pScrn->BlockHandler = LXVidBlockHandler; if (pPriv->videoStatus & TIMER_MASK) { Time now = currentTime.milliseconds; if (pPriv->videoStatus & OFF_TIMER) { gp_wait_until_idle(); if (pPriv->offTime < now) { unsigned int val; df_set_video_enable(0, 0); pPriv->videoStatus = FREE_TIMER; pPriv->freeTime = now + FREE_DELAY; /* Turn off the video palette */ val = READ_VID32(DF_VID_MISC); WRITE_VID32(DF_VID_MISC, val | DF_GAMMA_BYPASS_BOTH); } } else { if (pPriv->freeTime < now) { if (pPriv->vidmem) { exaOffscreenFree(pScrni->pScreen, pPriv->vidmem); pPriv->vidmem = NULL; } pPriv->videoStatus = 0; } } } } static XF86VideoAdaptorPtr LXSetupImageVideo(ScreenPtr pScrn) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); XF86VideoAdaptorPtr adapt; GeodePortPrivRec *pPriv; adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + sizeof(GeodePortPrivRec) + sizeof(DevUnion)); if (adapt == NULL) { ErrorF("Couldn't create the rec\n"); return NULL; } adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; adapt->name = "AMD Geode LX"; adapt->nEncodings = 1; adapt->pEncodings = DummyEncoding; adapt->nFormats = ARRAY_SIZE(Formats); adapt->pFormats = Formats; adapt->nPorts = 1; adapt->pPortPrivates = (DevUnion *) (&adapt[1]); pPriv = (GeodePortPrivRec *) (&adapt->pPortPrivates[1]); adapt->pPortPrivates[0].ptr = (pointer) (pPriv); adapt->pAttributes = Attributes; adapt->nImages = ARRAY_SIZE(Images); adapt->nAttributes = ARRAY_SIZE(Attributes); adapt->pImages = Images; adapt->PutVideo = NULL; adapt->PutStill = NULL; adapt->GetVideo = NULL; adapt->GetStill = NULL; adapt->StopVideo = LXStopVideo; adapt->SetPortAttribute = LXSetPortAttribute; adapt->GetPortAttribute = LXGetPortAttribute; adapt->QueryBestSize = LXQueryBestSize; adapt->PutImage = LXPutImage; /* Use the common function */ adapt->QueryImageAttributes = GeodeQueryImageAttributes; pPriv->vidmem = NULL; pPriv->filter = 0; pPriv->colorKey = 0; pPriv->colorKeyMode = 0; pPriv->videoStatus = 0; pPriv->pwidth = 0; pPriv->pheight = 0; REGION_NULL(pScrn, &pPriv->clip); pGeode->adaptor = adapt; pGeode->BlockHandler = pScrn->BlockHandler; pScrn->BlockHandler = LXVidBlockHandler; xvColorKey = MAKE_ATOM("XV_COLORKEY"); xvColorKeyMode = MAKE_ATOM("XV_COLORKEYMODE"); xvFilter = MAKE_ATOM("XV_FILTER"); LXResetVideo(pScrni); return adapt; } /* Offscreen surface allocation */ struct OffscreenPrivRec { ExaOffscreenArea *vidmem; Bool isOn; }; static int LXDisplaySurface(XF86SurfacePtr surface, short srcX, short srcY, short drawX, short drawY, short srcW, short srcH, short drawW, short drawH, RegionPtr clipBoxes) { struct OffscreenPrivRec *pPriv = (struct OffscreenPrivRec *) surface->devPrivate.ptr; ScrnInfoPtr pScrni = surface->pScrn; GeodePortPrivRec *portPriv = GET_PORT_PRIVATE(pScrni); BoxRec dstBox; dstBox.x1 = drawX; dstBox.x2 = drawX + drawW; dstBox.y1 = drawY; dstBox.y2 = drawY + drawH; if ((drawW <= 0) | (drawH <= 0)) return Success; /* Is this still valid? */ dstBox.x1 -= pScrni->frameX0; dstBox.x2 -= pScrni->frameX0; dstBox.y1 -= pScrni->frameY0; dstBox.y2 -= pScrni->frameY0; xf86XVFillKeyHelper(pScrni->pScreen, portPriv->colorKey, clipBoxes); videoScratch.dstOffset = surface->offsets[0]; videoScratch.dstPitch = surface->pitches[0]; LXDisplayVideo(pScrni, surface->id, surface->width, surface->height, &dstBox, srcW, srcH, drawW, drawH); pPriv->isOn = TRUE; if (portPriv->videoStatus & CLIENT_VIDEO_ON) { REGION_EMPTY(pScrni->pScreen, &portPriv->clip); UpdateCurrentTime(); portPriv->videoStatus = FREE_TIMER; portPriv->freeTime = currentTime.milliseconds + FREE_DELAY; } return Success; } static int LXAllocateSurface(ScrnInfoPtr pScrni, int id, unsigned short w, unsigned short h, XF86SurfacePtr surface) { GeodeRec *pGeode = GEODEPTR(pScrni); int pitch, lines; ExaOffscreenArea *vidmem; struct OffscreenPrivRec *pPriv; if (w > 1024 || h > 1024) return BadAlloc; /* The width needs to be word aligned */ w = (w + 1) & ~1; pitch = ((w << 1) + 15) & ~15; lines = ((pitch * h) + (pGeode->Pitch - 1)) / pGeode->Pitch; /* FIXME: is lines the right parameter to use here, * or should it be height * pitch? */ vidmem = exaOffscreenAlloc(pScrni->pScreen, lines, 4, TRUE, NULL, NULL); if (vidmem == NULL) { ErrorF("Error while allocating an offscreen region.\n"); return BadAlloc; } surface->width = w; surface->height = h; surface->pitches = malloc(sizeof(int)); surface->offsets = malloc(sizeof(int)); pPriv = malloc(sizeof(struct OffscreenPrivRec)); if (pPriv && surface->pitches && surface->offsets) { pPriv->vidmem = vidmem; pPriv->isOn = FALSE; surface->pScrn = pScrni; surface->id = id; surface->pitches[0] = pitch; surface->offsets[0] = vidmem->offset; surface->devPrivate.ptr = (pointer) pPriv; return Success; } if (surface->offsets) free(surface->offsets); if (surface->pitches) free(surface->pitches); if (vidmem) { exaOffscreenFree(pScrni->pScreen, vidmem); vidmem = NULL; } return BadAlloc; } static int LXStopSurface(XF86SurfacePtr surface) { struct OffscreenPrivRec *pPriv = (struct OffscreenPrivRec *) surface->devPrivate.ptr; pPriv->isOn = FALSE; return Success; } static int LXFreeSurface(XF86SurfacePtr surface) { struct OffscreenPrivRec *pPriv = (struct OffscreenPrivRec *) surface->devPrivate.ptr; ScrnInfoPtr pScrni = surface->pScrn; if (pPriv->isOn) LXStopSurface(surface); if (pPriv->vidmem) { exaOffscreenFree(pScrni->pScreen, pPriv->vidmem); pPriv->vidmem = NULL; } free(surface->pitches); free(surface->offsets); free(surface->devPrivate.ptr); return Success; } static int LXGetSurfaceAttribute(ScrnInfoPtr pScrni, Atom attribute, INT32 *value) { return LXGetPortAttribute(pScrni, attribute, value, (pointer) (GET_PORT_PRIVATE(pScrni))); } static int LXSetSurfaceAttribute(ScrnInfoPtr pScrni, Atom attribute, INT32 value) { return LXSetPortAttribute(pScrni, attribute, value, (pointer) (GET_PORT_PRIVATE(pScrni))); } static void LXInitOffscreenImages(ScreenPtr pScrn) { XF86OffscreenImagePtr offscreenImages; /* need to free this someplace */ if (!(offscreenImages = malloc(sizeof(XF86OffscreenImageRec)))) return; offscreenImages[0].image = &Images[0]; offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; offscreenImages[0].alloc_surface = LXAllocateSurface; offscreenImages[0].free_surface = LXFreeSurface; offscreenImages[0].display = LXDisplaySurface; offscreenImages[0].stop = LXStopSurface; offscreenImages[0].setAttribute = LXSetSurfaceAttribute; offscreenImages[0].getAttribute = LXGetSurfaceAttribute; offscreenImages[0].max_width = 1024; offscreenImages[0].max_height = 1024; offscreenImages[0].num_attributes = ARRAY_SIZE(Attributes); offscreenImages[0].attributes = Attributes; xf86XVRegisterOffscreenImages(pScrn, offscreenImages, 1); } void LXInitVideo(ScreenPtr pScrn) { GeodeRec *pGeode; ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; XF86VideoAdaptorPtr newAdaptor = NULL; int num_adaptors; pGeode = GEODEPTR(pScrni); if (pGeode->NoAccel) { ErrorF("Cannot run Xv without accelerations!\n"); return; } if (!(newAdaptor = LXSetupImageVideo(pScrn))) { ErrorF("Error while setting up the adaptor.\n"); return; } LXInitOffscreenImages(pScrn); num_adaptors = xf86XVListGenericAdaptors(pScrni, &adaptors); if (!num_adaptors) { num_adaptors = 1; adaptors = &newAdaptor; } else { newAdaptors = malloc((num_adaptors + 1) * sizeof(XF86VideoAdaptorPtr *)); if (newAdaptors) { memcpy(newAdaptors, adaptors, num_adaptors * sizeof(XF86VideoAdaptorPtr)); newAdaptors[num_adaptors] = newAdaptor; adaptors = newAdaptors; num_adaptors++; } else ErrorF("Memory error while setting up the adaptor\n"); } if (num_adaptors) xf86XVScreenInit(pScrn, adaptors, num_adaptors); if (newAdaptors) free(newAdaptors); } xf86-video-geode-2.11.18/src/lx_exa.c0000644000175000017500000015314712654445443014026 00000000000000/* * Copyright (c) 2007-2008 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Neither the name of the Advanced Micro Devices, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. */ /* TODO: Support a8 as a source or destination? convert !a8 or !a4 masks? support multiple pass operations? */ /* To support PictOptAdd with a mask */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "xf86.h" #include "exa.h" #include "geode.h" #include "cim_defs.h" #include "cim_regs.h" #include "geode_blend.h" #define F(x) IntToxFixed(x) #define I(x) xFixedToInt(x) #define GEODE_TRACE_FALL 0 #if GEODE_TRACE_FALL #define GEODE_FALLBACK(x) \ do { \ ErrorF("%s: ", __FUNCTION__); \ ErrorF x; \ return FALSE; \ } while (0) #else #define GEODE_FALLBACK(x) return FALSE #endif static const struct exa_format_t { int exa; int bpp; int fmt; int alphabits; } lx_exa_formats[] = { { PICT_a8r8g8b8, 32, CIMGP_SOURCE_FMT_8_8_8_8, 8}, { PICT_x8r8g8b8, 32, CIMGP_SOURCE_FMT_8_8_8_8, 0}, { PICT_x8b8g8r8, 32, CIMGP_SOURCE_FMT_32BPP_BGR, 0}, { PICT_a4r4g4b4, 16, CIMGP_SOURCE_FMT_4_4_4_4, 4}, { PICT_a1r5g5b5, 16, CIMGP_SOURCE_FMT_1_5_5_5, 1}, { PICT_r5g6b5, 16, CIMGP_SOURCE_FMT_0_5_6_5, 0}, { PICT_b5g6r5, 16, CIMGP_SOURCE_FMT_16BPP_BGR, 0}, { PICT_x1r5g5b5, 16, CIMGP_SOURCE_FMT_1_5_5_5, 0}, { PICT_x1b5g5r5, 16, CIMGP_SOURCE_FMT_15BPP_BGR, 0}, { PICT_r3g3b2, 8, CIMGP_SOURCE_FMT_3_3_2, 0}, { PICT_a8, 32, CIMGP_SOURCE_FMT_8_8_8_8, 8} }; /* This is a chunk of memory we use for scratch space */ #define COMP_TYPE_MASK 0 #define COMP_TYPE_ONEPASS 1 #define COMP_TYPE_TWOPASS 3 #define COMP_TYPE_ROTATE 5 static struct { int type; unsigned int srcOffset; unsigned int srcPitch; unsigned int srcBpp; unsigned int srcWidth, srcHeight; unsigned int srcColor; int op; int repeat; int maskrepeat; unsigned int fourBpp; unsigned int bufferOffset; struct exa_format_t *srcFormat; struct exa_format_t *dstFormat; int rotate; PictTransform *transform; } exaScratch; static const int SDfn[16] = { 0x00, 0x88, 0x44, 0xCC, 0x22, 0xAA, 0x66, 0xEE, 0x11, 0x99, 0x55, 0xDD, 0x33, 0xBB, 0x77, 0xFF }; static const int SDfn_PM[16] = { 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA }; /* These functions check to see if we can safely prefetch the memory * for the blt, or if we have to wait the previous blt to complete. * One function is for the fill, and the other is for the copy because * they have different requirements based on ROP */ static int lx0 = -1, ly0 = -1, lx1 = -1, ly1 = -1; static int lx_fill_flags(int x0, int y0, int w, int h, int rop) { int x1 = x0 + w, y1 = y0 + h; int n = ((rop ^ (rop >> 1)) & 0x55) == 0 || /* no dst */ x0 >= lx1 || y0 >= ly1 || /* rght/below */ x1 <= lx0 || y1 <= ly0 ? /* left/above */ 0 : CIMGP_BLTFLAGS_HAZARD; lx0 = x0; ly0 = y0; lx1 = x1; ly1 = y1; return n; } static int lx_copy_flags(int x0, int y0, int x1, int y1, int w, int h, int rop) { int x2 = x1 + w, y2 = y1 + h; /* dst not hazzard and src not hazzard */ int n = (((rop ^ (rop >> 1)) & 0x55) == 0 || x1 >= lx1 || y1 >= ly1 || x2 <= lx0 || y2 <= ly0) && (((rop ^ (rop >> 2)) & 0x33) == 0 || x0 >= lx1 || y0 >= ly1 || x0 + w <= lx0 || y0 + h <= ly0) ? 0 : CIMGP_BLTFLAGS_HAZARD; lx0 = x1; ly0 = y1; lx1 = x2; ly1 = y2; return n; } /* These are borrowed from the exa engine - they should be made global and available to drivers, but until then.... */ /* exaGetPixelFromRGBA (exa_render.c) */ static Bool _GetPixelFromRGBA(CARD32 *pixel, CARD16 red, CARD16 green, CARD16 blue, CARD16 alpha, CARD32 format) { int rbits, bbits, gbits, abits; int rshift, bshift, gshift, ashift; *pixel = 0; if (!PICT_FORMAT_COLOR(format)) return FALSE; rbits = PICT_FORMAT_R(format); gbits = PICT_FORMAT_G(format); bbits = PICT_FORMAT_B(format); abits = PICT_FORMAT_A(format); if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) { bshift = 0; gshift = bbits; rshift = gshift + gbits; ashift = rshift + rbits; } else { /* PICT_TYPE_ABGR */ rshift = 0; gshift = rbits; bshift = gshift + gbits; ashift = bshift + bbits; } *pixel |= (blue >> (16 - bbits)) << bshift; *pixel |= (red >> (16 - rbits)) << rshift; *pixel |= (green >> (16 - gbits)) << gshift; *pixel |= (alpha >> (16 - abits)) << ashift; return TRUE; } /* exaGetRGBAFromPixel (exa_render.c) */ static Bool _GetRGBAFromPixel(CARD32 pixel, CARD16 *red, CARD16 *green, CARD16 *blue, CARD16 *alpha, CARD32 format) { int rbits, bbits, gbits, abits; int rshift, bshift, gshift, ashift; if (!PICT_FORMAT_COLOR(format)) return FALSE; rbits = PICT_FORMAT_R(format); gbits = PICT_FORMAT_G(format); bbits = PICT_FORMAT_B(format); abits = PICT_FORMAT_A(format); if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) { bshift = 0; gshift = bbits; rshift = gshift + gbits; ashift = rshift + rbits; } else { /* PICT_TYPE_ABGR */ rshift = 0; gshift = rbits; bshift = gshift + gbits; ashift = bshift + bbits; } *red = ((pixel >> rshift) & ((1 << rbits) - 1)) << (16 - rbits); while (rbits < 16) { *red |= *red >> rbits; rbits <<= 1; } *green = ((pixel >> gshift) & ((1 << gbits) - 1)) << (16 - gbits); while (gbits < 16) { *green |= *green >> gbits; gbits <<= 1; } *blue = ((pixel >> bshift) & ((1 << bbits) - 1)) << (16 - bbits); while (bbits < 16) { *blue |= *blue >> bbits; bbits <<= 1; } if (abits) { *alpha = ((pixel >> ashift) & ((1 << abits) - 1)) << (16 - abits); while (abits < 16) { *alpha |= *alpha >> abits; abits <<= 1; } } else *alpha = 0xffff; return TRUE; } static unsigned int lx_get_source_color(PixmapPtr pSrc, int srcFormat, int dstFormat) { CARD32 in, out; CARD16 red = 0, green = 0, blue = 0, alpha = 0; /* Stall to avoid a race with the upload function */ /* for 1.4 and newer, the problem will be resolved within * exaGetPixmapFirstPixel, so this should be adjusted so * the stall isn't run needlessly */ /* FIXME: xserver-1.4 with a supposed fix for this is really old, so kill the stall? */ gp_wait_until_idle(); in = exaGetPixmapFirstPixel(pSrc); _GetRGBAFromPixel(in, &red, &blue, &green, &alpha, srcFormat); _GetPixelFromRGBA(&out, red, blue, green, alpha, dstFormat); return out; } static Bool lx_prepare_solid(PixmapPtr pxMap, int alu, Pixel planemask, Pixel fg) { int pitch = exaGetPixmapPitch(pxMap); int op = (planemask == ~0U) ? SDfn[alu] : SDfn_PM[alu]; gp_declare_blt(0); gp_set_bpp(pxMap->drawable.bitsPerPixel); gp_set_raster_operation(op); if (planemask != ~0U) gp_set_solid_pattern(planemask); exaScratch.op = op; gp_set_solid_source(fg); gp_set_strides(pitch, pitch); gp_write_parameters(); return TRUE; } static void lx_do_solid(PixmapPtr pxMap, int x1, int y1, int x2, int y2) { int bpp = (pxMap->drawable.bitsPerPixel + 7) / 8; int pitch = exaGetPixmapPitch(pxMap); unsigned int offset = exaGetPixmapOffset(pxMap) + (pitch * y1) + (bpp * x1); gp_declare_blt(lx_fill_flags(x1, y1, x2 - x1, y2 - y1, exaScratch.op)); gp_pattern_fill(offset, x2 - x1, y2 - y1); } static Bool lx_prepare_copy(PixmapPtr pxSrc, PixmapPtr pxDst, int dx, int dy, int alu, Pixel planemask) { int dpitch = exaGetPixmapPitch(pxDst); int op = (planemask == ~0U) ? SDfn[alu] : SDfn_PM[alu]; gp_declare_blt(0); gp_set_bpp(pxDst->drawable.bitsPerPixel); gp_set_raster_operation(op); if (planemask != ~0U) gp_set_solid_pattern(planemask); exaScratch.srcOffset = exaGetPixmapOffset(pxSrc); exaScratch.srcPitch = exaGetPixmapPitch(pxSrc); exaScratch.srcBpp = (pxSrc->drawable.bitsPerPixel + 7) / 8; exaScratch.op = op; gp_set_strides(dpitch, exaScratch.srcPitch); gp_write_parameters(); return TRUE; } static void lx_do_copy(PixmapPtr pxDst, int srcX, int srcY, int dstX, int dstY, int w, int h) { int dstBpp = (pxDst->drawable.bitsPerPixel + 7) / 8; int dstPitch = exaGetPixmapPitch(pxDst); unsigned int srcOffset, dstOffset; int flags = 0; gp_declare_blt(lx_copy_flags(srcX, srcY, dstX, dstY, w, h, exaScratch.op)); srcOffset = exaScratch.srcOffset + (exaScratch.srcPitch * srcY) + (exaScratch.srcBpp) * srcX; dstOffset = exaGetPixmapOffset(pxDst) + (dstPitch * dstY) + (dstBpp * dstX); if (dstX > srcX) flags |= CIMGP_NEGXDIR; if (dstY > srcY) flags |= CIMGP_NEGYDIR; gp_screen_to_screen_blt(dstOffset, srcOffset, w, h, flags); } /* Composite operations These are the simplest - one pass operations - if there is no format or mask, the we can make these happen pretty fast Operation Type Channel Alpha PictOpClear 0 2 0 3 PictOpSrc 0 3 0 3 PictOpDst 0 3 1 3 PictOpOver 2 0 0 3 PictOpOverReverse 2 0 1 3 PictOpIn 0 1 0 3 PictOpInReverse 0 1 1 3 PictOpOut 1 0 0 3 PictOpOutReverse 1 0 1 3 PictOpAdd 2 2 0 3 The following require multiple passes PictOpAtop PictOpXor */ struct blend_ops_t { int operation; int type; int channel; } lx_alpha_ops[] = { /* PictOpClear */ { CIMGP_ALPHA_TIMES_A, CIMGP_CONSTANT_ALPHA, CIMGP_CHANNEL_A_SOURCE}, { }, /* PictOpSrc */ { CIMGP_ALPHA_TIMES_A, CIMGP_ALPHA_EQUALS_ONE, CIMGP_CHANNEL_A_SOURCE}, { }, /* PictOpDst */ { CIMGP_ALPHA_TIMES_A, CIMGP_ALPHA_EQUALS_ONE, CIMGP_CHANNEL_A_DEST}, { }, /* PictOpOver */ { CIMGP_A_PLUS_BETA_B, CIMGP_CHANNEL_A_ALPHA, CIMGP_CHANNEL_A_SOURCE}, { CIMGP_ALPHA_TIMES_A, CIMGP_CONVERTED_ALPHA, CIMGP_CHANNEL_A_SOURCE}, /* PictOpOverReverse */ { CIMGP_A_PLUS_BETA_B, CIMGP_CHANNEL_A_ALPHA, CIMGP_CHANNEL_A_DEST}, { CIMGP_ALPHA_TIMES_A, CIMGP_CONVERTED_ALPHA, CIMGP_CHANNEL_A_SOURCE}, /* PictOpIn */ { CIMGP_ALPHA_TIMES_A, CIMGP_CHANNEL_B_ALPHA, CIMGP_CHANNEL_A_SOURCE}, { CIMGP_ALPHA_TIMES_A, CIMGP_CONVERTED_ALPHA, CIMGP_CHANNEL_A_SOURCE}, /* PictOpInReverse */ { CIMGP_ALPHA_TIMES_A, CIMGP_CHANNEL_B_ALPHA, CIMGP_CHANNEL_A_DEST}, { CIMGP_ALPHA_TIMES_A, CIMGP_CONVERTED_ALPHA, CIMGP_CHANNEL_A_SOURCE}, /* PictOpOut */ { CIMGP_BETA_TIMES_B, CIMGP_CHANNEL_A_ALPHA, CIMGP_CHANNEL_A_DEST}, { CIMGP_ALPHA_TIMES_A, CIMGP_CONVERTED_ALPHA, CIMGP_CHANNEL_A_SOURCE}, /* PictOpOutReverse */ { CIMGP_BETA_TIMES_B, CIMGP_CHANNEL_A_ALPHA, CIMGP_CHANNEL_A_SOURCE}, { CIMGP_ALPHA_TIMES_A, CIMGP_CONVERTED_ALPHA, CIMGP_CHANNEL_A_SOURCE}, /* SrcAtop */ { CIMGP_ALPHA_TIMES_A, CIMGP_CHANNEL_B_ALPHA, CIMGP_CHANNEL_A_DEST}, { CIMGP_BETA_TIMES_B, CIMGP_CHANNEL_A_ALPHA, CIMGP_CHANNEL_A_SOURCE}, /* SrcAtopReverse */ { CIMGP_ALPHA_TIMES_A, CIMGP_CHANNEL_B_ALPHA, CIMGP_CHANNEL_A_SOURCE}, { CIMGP_BETA_TIMES_B, CIMGP_CHANNEL_A_ALPHA, CIMGP_CHANNEL_A_DEST}, /* Xor */ { CIMGP_BETA_TIMES_B, CIMGP_CHANNEL_A_ALPHA, CIMGP_CHANNEL_A_SOURCE}, { CIMGP_BETA_TIMES_B, CIMGP_CHANNEL_A_ALPHA, CIMGP_CHANNEL_A_SOURCE}, /* PictOpAdd */ { CIMGP_A_PLUS_BETA_B, CIMGP_CONSTANT_ALPHA, CIMGP_CHANNEL_A_SOURCE}, { } }; #ifndef ARRAY_SIZE #define ARRAY_SIZE(a) (sizeof((a)) / (sizeof(*(a)))) #endif static const struct exa_format_t * lx_get_format(PicturePtr p) { int i; unsigned int format = p->format; for (i = 0; i < ARRAY_SIZE(lx_exa_formats); i++) if (lx_exa_formats[i].exa == format) return (&lx_exa_formats[i]); return NULL; } static Bool lx_process_transform(PicturePtr pSrc) { PictTransformPtr t = pSrc->transform; xFixed c0 = t->matrix[0][0]; xFixed s0 = t->matrix[0][1]; xFixed s1 = t->matrix[1][0]; xFixed c1 = t->matrix[1][1]; /* If the transform doesn't have any rotation * or scaling components, then just grab the * translate coordinates */ if (t->matrix[0][0] == 0 && t->matrix[0][1] == 0 && t->matrix[1][0] == 0 && t->matrix[1][1] == 0) { exaScratch.transform = pSrc->transform; return TRUE; } /* Otherwise, see if this is a simple * rotate transform - if it isn't, then * we have to punt back to software */ if (t->matrix[2][2] != F(1)) return FALSE; /* The rotate matrix looks like this: * [ cos X -sin x * sin X cos X ] * * Where X is the angle. We do a simple * check first - if [0,0] != [1,1], then * scaling was specified too, and we can * bail, and if [0,1] != -[1,1] then this * isn't scaling that we can handle. */ if ((c0 != c1) || (s0 != -s1)) return FALSE; /* Now, figure out what angle we want - we * can only accelerate right angle rotations, * so this turns into an easy set of if statements */ if (c0 == F(1) && s1 == F(0)) exaScratch.rotate = RR_Rotate_0; else if (c0 == F(0) && s1 == F(1)) exaScratch.rotate = RR_Rotate_90; else if (c0 == F(-1) && s1 == F(0)) exaScratch.rotate = RR_Rotate_180; else if (c0 == F(0) && s1 == F(-1)) exaScratch.rotate = RR_Rotate_270; else return FALSE; exaScratch.transform = pSrc->transform; return TRUE; } static Bool lx_check_composite(int op, PicturePtr pSrc, PicturePtr pMsk, PicturePtr pDst) { GeodeRec *pGeode = GEODEPTR_FROM_PICTURE(pDst); const struct exa_format_t *srcFmt, *dstFmt; if (op > PictOpAdd) GEODE_FALLBACK(("Operation %d is not supported\n", op)); /* XXX - don't know if we can do any hwaccel on solid fills or gradient types in generic cases */ if (pMsk && pMsk->pSourcePict) GEODE_FALLBACK(("%s are not supported as a mask\n", pMsk->pSourcePict->type == SourcePictTypeSolidFill ? "Solid pictures" : "Gradients")); if (pSrc->pSourcePict && pSrc->pSourcePict->type != SourcePictTypeSolidFill) GEODE_FALLBACK(("Gradients are not supported as the source\n")); if (pMsk && op == PictOpAdd) GEODE_FALLBACK(("PictOpAdd with mask is not supported\n")); /* FIXME: Meet this conditions from the debug for PictOpAdd. * Any Other possibilities? Add a judge for the future supplement */ if (op == PictOpAdd && pSrc->format == PICT_a8r8g8b8 && pDst->format == PICT_a8) return TRUE; if (op == PictOpAdd && pSrc->format == PICT_x8r8g8b8 && pDst->format == PICT_a8) return TRUE; if (op == PictOpAdd && pSrc->format == PICT_r5g6b5 && pDst->format == PICT_a8) return TRUE; if (usesPasses(op)) { /* FIXME: Slightly misleading fallback msg when !pMsk */ if (pGeode->exaBfrOffset == 0 || !pMsk) GEODE_FALLBACK(("Multipass operation requires off-screen buffer\n")); } /* Check that the filter matches what we support */ switch (pSrc->filter) { case PictFilterNearest: case PictFilterFast: case PictFilterGood: case PictFilterBest: break; default: GEODE_FALLBACK(("Bilinear or convolution filters are not supported\n")); } if (pMsk && pMsk->transform) GEODE_FALLBACK(("Mask transforms are not supported\n")); /* Keep an eye out for source rotation transforms - those we can * do something about */ exaScratch.rotate = RR_Rotate_0; exaScratch.transform = NULL; if (pSrc->transform && !lx_process_transform(pSrc)) GEODE_FALLBACK(("Transform operation is non-trivial\n")); /* XXX - I don't understand PICT_a8 enough - so I'm punting */ if ((op != PictOpAdd) && (pSrc->format == PICT_a8 || pDst->format == PICT_a8)) GEODE_FALLBACK(("PICT_a8 as src or dst format is unsupported\n")); if (pMsk && op != PictOpClear) { struct blend_ops_t *opPtr = &lx_alpha_ops[op * 2]; int direction = (opPtr->channel == CIMGP_CHANNEL_A_SOURCE) ? 0 : 1; /* Direction 0 indicates src->dst, 1 indicates dst->src */ if (((direction == 0) && (pSrc->pDrawable && pSrc->pDrawable->bitsPerPixel < 16)) || ((direction == 1) && (pDst->pDrawable->bitsPerPixel < 16))) { ErrorF("Mask blending unsupported with <16bpp\n"); return FALSE; } if (pMsk->format != PICT_a8 && pMsk->format != PICT_a4) GEODE_FALLBACK(("Masks can be only done with a 8bpp or 4bpp depth\n")); /* The pSrc should be 1x1 pixel if the pMsk is not zero */ if (pSrc->pDrawable && (pSrc->pDrawable->width != 1 || pSrc->pDrawable->height != 1)) GEODE_FALLBACK(("pSrc should be 1x1 pixel if pMsk is not zero\n")); /* FIXME: In lx_prepare_composite, there are no variables to record the * one pixel source's width and height when the mask is not zero. * That will lead to bigger region to render instead of one pixel in lx * _do_composite, so we should fallback currently to avoid this */ /* Not an issue for solid pictures, because we'll treat it as 1x1R too */ if (!pSrc->repeat && !(pSrc->pSourcePict && pSrc->pSourcePict->type == SourcePictTypeSolidFill)) { GEODE_FALLBACK(("FIXME: unzero mask might lead to bigger rendering region than 1x1 pixels\n")); } } else { if (pSrc->pSourcePict) GEODE_FALLBACK(("Solid source pictures without a mask are not supported\n")); } /* Get the formats for the source and destination */ if ((srcFmt = lx_get_format(pSrc)) == NULL) GEODE_FALLBACK(("Unsupported source format %x\n", pSrc->format)); if ((dstFmt = lx_get_format(pDst)) == NULL) GEODE_FALLBACK(("Unsupported destination format %x\n", pDst->format)); /* Make sure operations that need alpha bits have them */ /* If a mask is enabled, the alpha will come from there */ if (!pMsk && (!srcFmt->alphabits && usesSrcAlpha(op))) GEODE_FALLBACK(("Operation requires src alpha, but alphabits is unset\n")); if (!pMsk && (!dstFmt->alphabits && usesDstAlpha(op))) GEODE_FALLBACK(("Operation requires dst alpha, but alphabits is unset\n")); /* FIXME: See a way around this! */ if (srcFmt->alphabits == 0 && dstFmt->alphabits != 0) GEODE_FALLBACK(("src_alphabits=0, dst_alphabits!=0\n")); /* If this is a rotate operation, then make sure the src and dst * formats are the same */ if (exaScratch.rotate != RR_Rotate_0 && srcFmt != dstFmt) { ErrorF("EXA: Unable to rotate and convert formats at the same time\n"); return FALSE; } return TRUE; } static Bool lx_prepare_composite(int op, PicturePtr pSrc, PicturePtr pMsk, PicturePtr pDst, PixmapPtr pxSrc, PixmapPtr pxMsk, PixmapPtr pxDst) { GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst); const struct exa_format_t *srcFmt, *dstFmt; /* Get the formats for the source and destination */ srcFmt = lx_get_format(pSrc); dstFmt = lx_get_format(pDst); /* Set up the scratch buffer with the information we need */ exaScratch.srcFormat = (struct exa_format_t *) srcFmt; exaScratch.dstFormat = (struct exa_format_t *) dstFmt; exaScratch.op = op; exaScratch.repeat = pSrc->repeat; exaScratch.bufferOffset = pGeode->exaBfrOffset; if (pMsk && op != PictOpClear) { /* Get the source color */ if (pSrc->pSourcePict) { exaScratch.srcColor = pSrc->pSourcePict->solidFill.color; } else { /* If the op is PictOpOver(or PictOpOutReverse, PictOpInReverse, * PictOpIn, PictOpOut, PictOpOverReverse), we should get the * ARGB32 source format */ if ((op == PictOpOver || op == PictOpOutReverse || op == PictOpInReverse || op == PictOpIn || op == PictOpOut || op == PictOpOverReverse) && (srcFmt->alphabits != 0)) exaScratch.srcColor = exaGetPixmapFirstPixel(pxSrc); else if ((op == PictOpOver || op == PictOpOutReverse || op == PictOpInReverse || op == PictOpIn || op == PictOpOut || op == PictOpOverReverse) && (srcFmt->alphabits == 0)) exaScratch.srcColor = lx_get_source_color(pxSrc, pSrc->format, PICT_a8r8g8b8); else exaScratch.srcColor = lx_get_source_color(pxSrc, pSrc->format, pDst->format); } /* Save off the info we need (reuse the source values to save space) */ exaScratch.type = COMP_TYPE_MASK; exaScratch.maskrepeat = pMsk->repeat; exaScratch.srcOffset = exaGetPixmapOffset(pxMsk); exaScratch.srcPitch = exaGetPixmapPitch(pxMsk); exaScratch.srcBpp = (pxMsk->drawable.bitsPerPixel + 7) / 8; exaScratch.srcWidth = pMsk->pDrawable->width; exaScratch.srcHeight = pMsk->pDrawable->height; /* Flag to indicate if this a 8BPP or a 4BPP mask */ exaScratch.fourBpp = (pxMsk->drawable.bitsPerPixel == 4) ? 1 : 0; } else { if (usesPasses(op)) exaScratch.type = COMP_TYPE_TWOPASS; else if (exaScratch.rotate != RR_Rotate_0) exaScratch.type = COMP_TYPE_ROTATE; else exaScratch.type = COMP_TYPE_ONEPASS; exaScratch.srcOffset = exaGetPixmapOffset(pxSrc); exaScratch.srcPitch = exaGetPixmapPitch(pxSrc); exaScratch.srcBpp = (pxSrc->drawable.bitsPerPixel + 7) / 8; exaScratch.srcWidth = pSrc->pDrawable->width; exaScratch.srcHeight = pSrc->pDrawable->height; } return TRUE; } static int lx_get_bpp_from_format(int format) { switch (format) { case CIMGP_SOURCE_FMT_8_8_8_8: case CIMGP_SOURCE_FMT_32BPP_BGR: return 32; case CIMGP_SOURCE_FMT_4_4_4_4: return 12; case CIMGP_SOURCE_FMT_0_5_6_5: case CIMGP_SOURCE_FMT_16BPP_BGR: return 16; case CIMGP_SOURCE_FMT_1_5_5_5: case CIMGP_SOURCE_FMT_15BPP_BGR: return 15; case CIMGP_SOURCE_FMT_3_3_2: return 8; } return 0; } /* BGR needs to be set in the source for it to take - so adjust the source * to enable BGR if the two formats are different, and disable it if they * are the same */ static void lx_set_source_format(int srcFormat, int dstFormat) { if (!(srcFormat & 0x10) && (dstFormat & 0x10)) gp_set_source_format(srcFormat | 0x10); else if ((srcFormat & 0x10) && (dstFormat & 0x10)) gp_set_source_format(srcFormat & ~0x10); else gp_set_source_format(srcFormat); } /* If we are converting colors and we need the channel A alpha, * then use a special alpha type that preserves the alpha before * converting the format */ static inline int get_op_type(struct exa_format_t *src, struct exa_format_t *dst, int type) { return (type == CIMGP_CHANNEL_A_ALPHA && src->alphabits != dst->alphabits) ? CIMGP_CONVERTED_ALPHA : type; } /* Note - this is the preferred onepass method. The other will remain * ifdefed out until such time that we are sure its not needed */ #define GetPixmapOffset(px, x, y) ( exaGetPixmapOffset((px)) + \ (exaGetPixmapPitch((px)) * (y)) + \ ((((px)->drawable.bitsPerPixel + 7) / 8) * (x)) ) #define GetSrcOffset(_x, _y) (exaScratch.srcOffset + ((_y) * exaScratch.srcPitch) + \ ((_x) * exaScratch.srcBpp)) static void lx_composite_onepass_add_a8(PixmapPtr pxDst, unsigned long dstOffset, unsigned long srcOffset, int width, int height, int opX, int opY, int srcX, int srcY) { struct blend_ops_t *opPtr; int apply, type; int optempX, optempY; int i, j; unsigned long pixmapOffset, pixmapPitch, calBitsPixel; pixmapOffset = exaGetPixmapOffset(pxDst); pixmapPitch = exaGetPixmapPitch(pxDst); calBitsPixel = (pxDst->drawable.bitsPerPixel + 7) / 8; /* Keep this GP idle judge here. Otherwise the SW method has chance to * conflict with the HW rendering method */ gp_wait_until_idle(); if (opX % 4 == 0 && srcX % 4 == 0) { /* HW acceleration */ opPtr = &lx_alpha_ops[exaScratch.op * 2]; apply = CIMGP_APPLY_BLEND_TO_ALL; gp_declare_blt(0); gp_set_bpp(32); gp_set_strides(exaGetPixmapPitch(pxDst), exaScratch.srcPitch); gp_set_source_format(8); type = opPtr->type; gp_set_alpha_operation(opPtr->operation, type, opPtr->channel, apply, 0); gp_screen_to_screen_convert(dstOffset, srcOffset, width / 4, height, 0); /* Calculate the pixels in the tail of each line */ for (j = srcY; j < srcY + height; j++) for (i = srcX + (width / 4) * 4; i < srcX + width; i++) { srcOffset = GetSrcOffset(i, j); optempX = opX + i - srcX; optempY = opY + j - srcY; dstOffset = pixmapOffset + pixmapPitch * optempY + calBitsPixel * optempX; *(cim_fb_ptr + dstOffset) = (*(cim_fb_ptr + srcOffset) + *(cim_fb_ptr + dstOffset) <= 0xff) ? *(cim_fb_ptr + srcOffset) + *(cim_fb_ptr + dstOffset) : 0xff; } } else { for (j = srcY; j < srcY + height; j++) for (i = srcX; i < srcX + width; i++) { srcOffset = GetSrcOffset(i, j); optempX = opX + i - srcX; optempY = opY + j - srcY; dstOffset = pixmapOffset + pixmapPitch * optempY + calBitsPixel * optempX; *(cim_fb_ptr + dstOffset) = (*(cim_fb_ptr + srcOffset) + *(cim_fb_ptr + dstOffset) <= 0xff) ? *(cim_fb_ptr + srcOffset) + *(cim_fb_ptr + dstOffset) : 0xff; } } } static void lx_composite_onepass(PixmapPtr pxDst, unsigned long dstOffset, unsigned long srcOffset, int width, int height) { struct blend_ops_t *opPtr; int apply, type; opPtr = &lx_alpha_ops[exaScratch.op * 2]; apply = (exaScratch.dstFormat->alphabits != 0 && exaScratch.srcFormat->alphabits != 0) ? CIMGP_APPLY_BLEND_TO_ALL : CIMGP_APPLY_BLEND_TO_RGB; gp_declare_blt(0); gp_set_bpp(lx_get_bpp_from_format(exaScratch.dstFormat->fmt)); gp_set_strides(exaGetPixmapPitch(pxDst), exaScratch.srcPitch); lx_set_source_format(exaScratch.srcFormat->fmt, exaScratch.dstFormat->fmt); type = get_op_type(exaScratch.srcFormat, exaScratch.dstFormat, opPtr->type); gp_set_alpha_operation(opPtr->operation, type, opPtr->channel, apply, 0); gp_screen_to_screen_convert(dstOffset, srcOffset, width, height, 0); } static void lx_composite_all_black(unsigned long srcOffset, int width, int height) { struct blend_ops_t *opPtr; int apply, type; opPtr = &lx_alpha_ops[0]; apply = (exaScratch.srcFormat->alphabits != 0) ? CIMGP_APPLY_BLEND_TO_ALL : CIMGP_APPLY_BLEND_TO_RGB; gp_declare_blt(0); gp_set_bpp(lx_get_bpp_from_format(exaScratch.srcFormat->fmt)); gp_set_strides(exaScratch.srcPitch, exaScratch.srcPitch); lx_set_source_format(exaScratch.srcFormat->fmt, exaScratch.srcFormat->fmt); type = get_op_type(exaScratch.srcFormat, exaScratch.srcFormat, opPtr->type); gp_set_alpha_operation(opPtr->operation, type, opPtr->channel, apply, 0); gp_screen_to_screen_convert(srcOffset, srcOffset, width, height, 0); } static void lx_composite_onepass_special(PixmapPtr pxDst, int width, int height, int opX, int opY, int srcX, int srcY) { struct blend_ops_t *opPtr; int apply, type; int opWidth, opHeight; int optempX, optempY; unsigned int dstOffset, srcOffset = 0; optempX = opX; optempY = opY; /* Make sure srcX and srcY are in source region */ srcX = ((srcX % (int) exaScratch.srcWidth) + (int) exaScratch.srcWidth) % (int) exaScratch.srcWidth; srcY = ((srcY % (int) exaScratch.srcHeight) + (int) exaScratch.srcHeight) % (int) exaScratch.srcHeight; opWidth = exaScratch.srcWidth - srcX; opHeight = exaScratch.srcHeight - srcY; srcOffset = GetSrcOffset(srcX, srcY); if (width < opWidth) opWidth = width; if (height < opHeight) opHeight = height; while (1) { gp_wait_until_idle(); dstOffset = GetPixmapOffset(pxDst, optempX, optempY); opPtr = &lx_alpha_ops[exaScratch.op * 2]; apply = (exaScratch.dstFormat->alphabits != 0 && exaScratch.srcFormat->alphabits != 0) ? CIMGP_APPLY_BLEND_TO_ALL : CIMGP_APPLY_BLEND_TO_RGB; gp_declare_blt(0); gp_set_bpp(lx_get_bpp_from_format(exaScratch.dstFormat->fmt)); gp_set_strides(exaGetPixmapPitch(pxDst), exaScratch.srcPitch); lx_set_source_format(exaScratch.srcFormat->fmt, exaScratch.dstFormat->fmt); type = get_op_type(exaScratch.srcFormat, exaScratch.dstFormat, opPtr->type); gp_set_alpha_operation(opPtr->operation, type, opPtr->channel, apply, 0); gp_screen_to_screen_convert(dstOffset, srcOffset, opWidth, opHeight, 0); optempX += opWidth; if (optempX >= opX + width) { optempX = opX; optempY += opHeight; if (optempY >= opY + height) break; } if (optempX == opX) { srcOffset = GetSrcOffset(srcX, 0); opWidth = ((opX + width) - optempX) > (exaScratch.srcWidth - srcX) ? (exaScratch.srcWidth - srcX) : ((opX + width) - optempX); opHeight = ((opY + height) - optempY) > exaScratch.srcHeight ? exaScratch.srcHeight : ((opY + height) - optempY); } else if (optempY == opY) { srcOffset = GetSrcOffset(0, srcY); opWidth = ((opX + width) - optempX) > exaScratch.srcWidth ? exaScratch.srcWidth : ((opX + width) - optempX); opHeight = ((opY + height) - optempY) > (exaScratch.srcHeight - srcY) ? (exaScratch.srcHeight - srcY) : ((opY + height) - optempY); } else { srcOffset = GetSrcOffset(0, 0); opWidth = ((opX + width) - optempX) > exaScratch.srcWidth ? exaScratch.srcWidth : ((opX + width) - optempX); opHeight = ((opY + height) - optempY) > exaScratch.srcHeight ? exaScratch.srcHeight : ((opY + height) - optempY); } } } /* This function handles the multipass blend functions */ static void lx_composite_multipass(PixmapPtr pxDst, unsigned long dstOffset, unsigned long srcOffset, int width, int height) { struct blend_ops_t *opPtr; int sbpp = lx_get_bpp_from_format(exaScratch.srcFormat->fmt); int apply, type; /* Wait until the GP is idle - this will ensure that the scratch buffer * isn't occupied */ gp_wait_until_idle(); /* Copy the destination to the scratch buffer, and convert it to the * source format */ gp_declare_blt(0); gp_set_bpp(sbpp); gp_set_source_format(exaScratch.dstFormat->fmt); gp_set_raster_operation(0xCC); gp_set_strides(exaScratch.srcPitch, exaGetPixmapPitch(pxDst)); gp_screen_to_screen_convert(exaScratch.bufferOffset, dstOffset, width, height, 0); /* Do the first blend from the source to the scratch buffer */ gp_declare_blt(CIMGP_BLTFLAGS_HAZARD); gp_set_bpp(sbpp); gp_set_source_format(exaScratch.srcFormat->fmt); gp_set_strides(exaScratch.srcPitch, exaScratch.srcPitch); opPtr = &lx_alpha_ops[exaScratch.op * 2]; apply = (exaScratch.srcFormat->alphabits == 0) ? CIMGP_APPLY_BLEND_TO_RGB : CIMGP_APPLY_BLEND_TO_ALL; /* If we're destroying the source alpha bits, then make sure we * use the alpha before the color conversion */ gp_screen_to_screen_blt(exaScratch.bufferOffset, srcOffset, width, height, 0); /* Finally, do the second blend back to the destination */ opPtr = &lx_alpha_ops[(exaScratch.op * 2) + 1]; apply = (exaScratch.dstFormat->alphabits == 0) ? CIMGP_APPLY_BLEND_TO_RGB : CIMGP_APPLY_BLEND_TO_ALL; gp_declare_blt(CIMGP_BLTFLAGS_HAZARD); gp_set_bpp(lx_get_bpp_from_format(exaScratch.dstFormat->fmt)); lx_set_source_format(exaScratch.srcFormat->fmt, exaScratch.dstFormat->fmt); type = get_op_type(exaScratch.srcFormat, exaScratch.dstFormat, opPtr->type); gp_set_alpha_operation(opPtr->operation, type, opPtr->channel, apply, 0); gp_screen_to_screen_convert(dstOffset, exaScratch.bufferOffset, width, height, 0); } static void lx_composite_rotate(PixmapPtr pxDst, unsigned long dstOffset, unsigned int srcOffset, int width, int height) { int degrees = 0; gp_declare_blt(0); gp_set_bpp(lx_get_bpp_from_format(exaScratch.dstFormat->fmt)); gp_set_strides(exaGetPixmapPitch(pxDst), exaScratch.srcPitch); lx_set_source_format(exaScratch.srcFormat->fmt, exaScratch.dstFormat->fmt); gp_set_raster_operation(0xCC); /* RandR rotation is counter-clockwise, our rotation * is clockwise, so adjust the numbers accordingly */ switch (exaScratch.rotate) { case RR_Rotate_90: degrees = 270; break; case RR_Rotate_180: degrees = 180; break; case RR_Rotate_270: degrees = 90; break; } gp_rotate_blt(dstOffset, srcOffset, width, height, degrees); } static void lx_do_composite_mask(PixmapPtr pxDst, unsigned long dstOffset, unsigned int maskOffset, int width, int height) { struct blend_ops_t *opPtr = &lx_alpha_ops[exaScratch.op * 2]; gp_declare_blt(0); gp_set_source_format(exaScratch.srcFormat->fmt); gp_set_strides(exaGetPixmapPitch(pxDst), exaScratch.srcPitch); gp_set_bpp(lx_get_bpp_from_format(exaScratch.dstFormat->fmt)); gp_set_solid_source(exaScratch.srcColor); gp_blend_mask_blt(dstOffset, 0, width, height, maskOffset, exaScratch.srcPitch, opPtr->operation, exaScratch.fourBpp); } static void lx_do_composite_mask_two_pass(PixmapPtr pxDst, unsigned long dstOffset, unsigned int maskOffset, int width, int height, int opX, int opY, xPointFixed srcPoint) { int apply, type; struct blend_ops_t *opPtr; int opWidth, opHeight; int opoverX, opoverY; opoverX = opX; opoverY = opY; /* The rendering region should not be bigger than off-screen memory size * which equals to DEFAULT_EXA_SCRATCH_BFRSZ. If that happens, we split * the PictOpOver rendering region into several 256KB chunks. And because * of the Pitch(stride) parameter, so we use maximun width of mask picture. * that is to say it is a scanline rendering process */ if (width * height * 4 > DEFAULT_EXA_SCRATCH_BFRSZ) { opWidth = width; opHeight = DEFAULT_EXA_SCRATCH_BFRSZ / (width * 4); } else { opWidth = width; opHeight = height; } while (1) { /* Wait until the GP is idle - this will ensure that the scratch buffer * isn't occupied */ gp_wait_until_idle(); /* Copy the source to the scratch buffer, and do a src * mask raster * operation */ gp_declare_blt(0); opPtr = &lx_alpha_ops[(exaScratch.op * 2) + 1]; gp_set_source_format(CIMGP_SOURCE_FMT_8_8_8_8); gp_set_strides(opWidth * 4, exaScratch.srcPitch); gp_set_bpp(lx_get_bpp_from_format(CIMGP_SOURCE_FMT_8_8_8_8)); gp_set_solid_source(exaScratch.srcColor); gp_blend_mask_blt(exaScratch.bufferOffset, 0, opWidth, opHeight, maskOffset, exaScratch.srcPitch, opPtr->operation, exaScratch.fourBpp); /* Do a relative operation(refer rendercheck ops.c), and copy the * operation result to destination */ gp_declare_blt(CIMGP_BLTFLAGS_HAZARD); opPtr = &lx_alpha_ops[exaScratch.op * 2]; apply = (exaScratch.dstFormat->alphabits == 0) ? CIMGP_APPLY_BLEND_TO_RGB : CIMGP_APPLY_BLEND_TO_ALL; gp_set_source_format(CIMGP_SOURCE_FMT_8_8_8_8); gp_set_strides(exaGetPixmapPitch(pxDst), opWidth * 4); gp_set_bpp(lx_get_bpp_from_format(exaScratch.dstFormat->fmt)); type = CIMGP_CONVERTED_ALPHA; gp_set_alpha_operation(opPtr->operation, type, opPtr->channel, apply, 0); gp_screen_to_screen_convert(dstOffset, exaScratch.bufferOffset, opWidth, opHeight, 0); if (width * height * 4 > DEFAULT_EXA_SCRATCH_BFRSZ) { /* Finish the rendering */ if (opoverY + opHeight == opY + height) break; /* Recalculate the Dest and Mask rendering start point */ srcPoint.y = srcPoint.y + F(opHeight); opoverY = opoverY + opHeight; if (opoverY + opHeight > opY + height) opHeight = opY + height - opoverY; dstOffset = GetPixmapOffset(pxDst, opoverX, opoverY); maskOffset = GetSrcOffset(I(srcPoint.x), I(srcPoint.y)); } else break; } } static void transformPoint(PictTransform * t, xPointFixed * point) { PictVector v; v.vector[0] = point->x; v.vector[1] = point->y; v.vector[2] = xFixed1; if (t != NULL) PictureTransformPoint(t, &v); point->x = v.vector[0]; point->y = v.vector[1]; } static void lx_do_composite(PixmapPtr pxDst, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int width, int height) { unsigned int dstOffset, srcOffset = 0; xPointFixed srcPoint; int opX = dstX; int opY = dstY; int opWidth = width; int opHeight = height; /* Transform the source coordinates */ if (exaScratch.type == COMP_TYPE_MASK) { srcPoint.x = F(maskX); srcPoint.y = F(maskY); } else { srcPoint.x = F(srcX); srcPoint.y = F(srcY); } /* srcX, srcY point to the upper right side of the bounding box * in the unrotated coordinate space. Depending on the orientation, * we have to translate the coordinates to point to the origin of * the rectangle in the source pixmap */ switch (exaScratch.rotate) { case RR_Rotate_270: srcPoint.x += F(width); opWidth = height; opHeight = width; break; case RR_Rotate_180: srcPoint.x += F(width); srcPoint.y += F(height); srcX += width; srcY += height; break; case RR_Rotate_90: srcPoint.y += F(height); opWidth = height; opHeight = width; break; } transformPoint(exaScratch.transform, &srcPoint); /* Adjust the point to fit into the pixmap */ if (I(srcPoint.x) < 0) { opWidth += I(srcPoint.x); srcPoint.x = F(0); } if (I(srcPoint.y) < 0) { opHeight += I(srcPoint.y); srcPoint.y = F(0); } /* Get the source point offset position */ srcOffset = GetSrcOffset(I(srcPoint.x), I(srcPoint.y)); /* When mask exists, exaScratch.srcWidth and exaScratch.srcHeight are * the source width and source height; Otherwise, they are mask width * and mask height */ /* exaScratch.repeat is the source repeat attribute * exaScratch.maskrepeat is the mask repeat attribute */ /* If type is COMP_TYPE_MASK, maskX and maskY are not zero, we should * subtract them to do the operation in the correct region */ /* FIXME: Please add the code to handle the condition when the maskX * and maskY coordinate are negative or greater than * exaScratch.srcWidth and exaScratch.srcHeight */ if (exaScratch.type == COMP_TYPE_MASK) { if ((exaScratch.srcWidth - maskX) < opWidth) opWidth = exaScratch.srcWidth - maskX; if ((exaScratch.srcHeight - maskY) < opHeight) opHeight = exaScratch.srcHeight - maskY; } else { if (exaScratch.type == COMP_TYPE_ONEPASS) { /* This is the condition srcX or/and srcY is/are out of source * region */ if (((srcY >= 0 && srcY >= exaScratch.srcHeight) || (srcX >= 0 && srcX >= exaScratch.srcWidth)) && (exaScratch.op == PictOpOver || exaScratch.op == PictOpSrc)) { if (exaScratch.repeat == 1) { opWidth = width; opHeight = height; } else { if (exaScratch.op == PictOpOver) return; else { exaScratch.op = PictOpClear; opWidth = width; opHeight = height; } } /* This is the condition srcX or/and srcY is/are in the source * region */ } else if (srcX >= 0 && srcY >= 0 && (exaScratch.op == PictOpOver || exaScratch.op == PictOpSrc)) { if (exaScratch.repeat == 1) { opWidth = width; opHeight = height; } else { if ((exaScratch.srcWidth - srcX) < opWidth) opWidth = exaScratch.srcWidth - srcX; if ((exaScratch.srcHeight - srcY) < opHeight) opHeight = exaScratch.srcHeight - srcY; } /* This is the condition srcX or/and srcY is/are negative */ } else if ((srcX < 0 || srcY < 0) && (exaScratch.op == PictOpOver || exaScratch.op == PictOpSrc)) { if (exaScratch.repeat == 1) { opWidth = width; opHeight = height; } else { /* FIXME: We can't support negative srcX/Y for all corner cases in * a sane way without a bit bigger refactoring. So as to avoid * gross misrenderings (e.g missing tray icons) in current real-world * applications, just shift destination appropriately for now and * ignore out of bounds source pixmap zero-vector handling. This is * actually correct for PictOpOver, but PictOpSrc out of bounds regions * should be blacked out, but aren't - without this workaround however * it'd be simply all black instead, which is probably worse till a full * clean solution solves it for all cases. */ if (srcX < 0) { opX -= srcX; srcX = 0; } if (srcY < 0) { opY -= srcY; srcY = 0; } /* EXA has taken care of adjusting srcWidth if it gets cut on the right */ width = opWidth = exaScratch.srcWidth; /* EXA has taken care of adjusting srcHeight if it gets cut on the bottom */ height = opHeight = exaScratch.srcHeight; } } else { if (exaScratch.srcWidth < opWidth) opWidth = exaScratch.srcWidth; if (exaScratch.srcHeight < opHeight) opHeight = exaScratch.srcHeight; } } else { if (exaScratch.rotate == RR_Rotate_180) { } else { if ((exaScratch.srcWidth - srcY) < opWidth) opWidth = exaScratch.srcWidth - srcY; if ((exaScratch.srcHeight - srcX) < opHeight) opHeight = exaScratch.srcHeight - srcX; } } } while (1) { dstOffset = GetPixmapOffset(pxDst, opX, opY); switch (exaScratch.type) { case COMP_TYPE_MASK:{ if (exaScratch.op == PictOpOver || exaScratch.op == PictOpOutReverse || exaScratch.op == PictOpInReverse || exaScratch.op == PictOpIn || exaScratch.op == PictOpOut || exaScratch.op == PictOpOverReverse) lx_do_composite_mask_two_pass(pxDst, dstOffset, srcOffset, opWidth, opHeight, opX, opY, srcPoint); else lx_do_composite_mask(pxDst, dstOffset, srcOffset, opWidth, opHeight); } break; case COMP_TYPE_ONEPASS: if ((exaScratch.op == PictOpOver || exaScratch.op == PictOpSrc) && (exaScratch.repeat == 1)) { lx_composite_onepass_special(pxDst, opWidth, opHeight, opX, opY, srcX, srcY); return; } else if ((exaScratch.op == PictOpAdd) && (exaScratch.srcFormat->exa == PICT_a8) && (exaScratch.dstFormat->exa == PICT_a8)) lx_composite_onepass_add_a8(pxDst, dstOffset, srcOffset, opWidth, opHeight, opX, opY, srcX, srcY); else lx_composite_onepass(pxDst, dstOffset, srcOffset, opWidth, opHeight); break; case COMP_TYPE_TWOPASS: lx_composite_multipass(pxDst, dstOffset, srcOffset, opWidth, opHeight); case COMP_TYPE_ROTATE: lx_composite_rotate(pxDst, dstOffset, srcOffset, opWidth, opHeight); break; } opX += opWidth; if (opX >= dstX + width) { opX = dstX; opY += opHeight; if (opY >= dstY + height) break; } /* FIXME: Please add the code to handle the condition when the maskX * and maskY coordinate are negative or greater than * exaScratch.srcWidth and exaScratch.srcHeight */ if (exaScratch.type == COMP_TYPE_MASK) { opWidth = ((dstX + width) - opX) > (exaScratch.srcWidth - maskX) ? (exaScratch.srcWidth - maskX) : (dstX + width) - opX; opHeight = ((dstY + height) - opY) > (exaScratch.srcHeight - maskY) ? (exaScratch.srcHeight - maskY) : (dstY + height) - opY; /* All black out of the mask */ if (!exaScratch.maskrepeat) exaScratch.srcColor = 0x0; } else { if (exaScratch.type == COMP_TYPE_ONEPASS) { if (srcX >= 0 && srcY >= 0 && (exaScratch.op == PictOpOver || exaScratch.op == PictOpSrc || exaScratch.op == PictOpClear)) { opWidth = ((dstX + width) - opX) > (exaScratch.srcWidth - srcX) ? (exaScratch.srcWidth - srcX) : (dstX + width) - opX; opHeight = ((dstY + height) - opY) > (exaScratch.srcHeight - srcY) ? (exaScratch.srcHeight - srcY) : (dstY + height) - opY; } else { opWidth = ((dstX + width) - opX) > exaScratch.srcWidth ? exaScratch.srcWidth : (dstX + width) - opX; opHeight = ((dstY + height) - opY) > exaScratch.srcHeight ? exaScratch.srcHeight : (dstY + height) - opY; } } else { opWidth = ((dstX + width) - opX) > (exaScratch.srcWidth - srcY) ? (exaScratch.srcWidth - srcY) : (dstX + width) - opX; opHeight = ((dstY + height) - opY) > (exaScratch.srcHeight - srcX) ? (exaScratch.srcHeight - srcX) : (dstY + height) - opY; } /* All black out of the source */ if (!exaScratch.repeat && (exaScratch.type == COMP_TYPE_ONEPASS)) { /* FIXME: We black out the source here, so that any further regions * in the loop get handled as a source that's a zero-vector (as * defined for out-of-bounds from source pixmap for RepeatModeNone), * but this will likely interfere with cases where srcX and/or srcY * is negative - as opposed to e.g width being larger than srcWidth, * which is exercised in rendercheck (always rectangle in top-left * corner). * Additionally it forces the drawing into tiles of srcWidth/srcHeight * for non-repeat modes too, where we don't really need to tile it like * this and could draw the out of bound regions all at once (or at most * in 4 operations without the big loop). */ lx_composite_all_black(srcOffset, exaScratch.srcWidth, exaScratch.srcHeight); } if (!exaScratch.repeat && (exaScratch.type == COMP_TYPE_ROTATE)) break; } } } static void lx_wait_marker(ScreenPtr PScreen, int marker) { gp_wait_until_idle(); } static void lx_done(PixmapPtr ptr) { } #if 0 static void lx_upload_to_screen(PixmapPtr pxDst, int x, int y, int w, int h, char *src, int src_pitch) { GeodeRec *pGeode = GEODEPTR_FROM_PIXMAP(pxDst); int dst_pitch = exaGetPixmapPitch(pxDst); int cpp = (pxDst->drawable.bitsPerPixel + 7) / 8; char *dst; int offset = exaGetPixmapOffset(pxDst); dst = (char *) (pGeode->FBBase + offset + (y * dst_pitch) + (x * cpp)); int i; for (i = 0; i < h; i++) { memcpy(dst, src, w * cpp); dst += dst_pitch; src += src_pitch; } } #endif #if EXA_VERSION_MAJOR > 2 || (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 2) static Bool lx_exa_pixmap_is_offscreen(PixmapPtr pPixmap) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pPixmap->drawable.pScreen); GeodeRec *pGeode = GEODEPTR(pScrni); void *start = (void *) (pGeode->FBBase); void *end = (void *) (pGeode->FBBase + pGeode->offscreenStart + pGeode->offscreenSize); if ((void *) pPixmap->devPrivate.ptr >= start && (void *) pPixmap->devPrivate.ptr < end) return TRUE; return FALSE; } #endif Bool LXExaInit(ScreenPtr pScreen) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScreen); GeodeRec *pGeode = GEODEPTR(pScrni); ExaDriverPtr pExa = pGeode->pExa; pExa->exa_major = EXA_VERSION_MAJOR; pExa->exa_minor = EXA_VERSION_MINOR; pExa->WaitMarker = lx_wait_marker; pExa->PrepareSolid = lx_prepare_solid; pExa->Solid = lx_do_solid; pExa->DoneSolid = lx_done; pExa->PrepareCopy = lx_prepare_copy; pExa->Copy = lx_do_copy; pExa->DoneCopy = lx_done; /* Composite */ pExa->CheckComposite = lx_check_composite; pExa->PrepareComposite = lx_prepare_composite; pExa->Composite = lx_do_composite; pExa->DoneComposite = lx_done; //pExa->UploadToScreen = lx_upload_to_screen; #if EXA_VERSION_MAJOR > 2 || (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 2) pExa->PixmapIsOffscreen = lx_exa_pixmap_is_offscreen; #endif //pExa->flags = EXA_OFFSCREEN_PIXMAPS; return exaDriverInit(pScreen, pGeode->pExa); } xf86-video-geode-2.11.18/Makefile.in0000644000175000017500000006675412654445520013663 00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright 2005 Adam Jackson. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # on the rights to use, copy, modify, merge, publish, distribute, sub # license, and/or sell copies of the Software, and to permit persons to whom # the Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice (including the next # paragraph) shall be included in all copies or substantial portions of the # Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/ltmain.sh \ $(top_srcdir)/build-aux/missing COPYING ChangeLog INSTALL NEWS \ README TODO build-aux/compile build-aux/config.guess \ build-aux/config.sub build-aux/install-sh build-aux/ltmain.sh \ build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best DIST_TARGETS = dist-bzip2 dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BASE_CFLAGS = @BASE_CFLAGS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHANGELOG_CMD = @CHANGELOG_CMD@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_CMD = @INSTALL_CMD@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ M32_CFLAGS = @M32_CFLAGS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PANEL_CPPFLAGS = @PANEL_CPPFLAGS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ PCIACCESS_LIBS = @PCIACCESS_LIBS@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ VERSION = @VERSION@ XEXT_CFLAGS = @XEXT_CFLAGS@ XEXT_LIBS = @XEXT_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 SUBDIRS = src MAINTAINERCLEANFILES = ChangeLog INSTALL EXTRA_DIST = autogen.sh all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile .PHONY: ChangeLog INSTALL INSTALL: $(INSTALL_CMD) ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: xf86-video-geode-2.11.18/configure0000755000175000017500000225012212654445512013510 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for xf86-video-geode 2.11.18. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver%2Fgeode $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xf86-video-geode' PACKAGE_TARNAME='xf86-video-geode' PACKAGE_VERSION='2.11.18' PACKAGE_STRING='xf86-video-geode 2.11.18' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver%2Fgeode' PACKAGE_URL='http://www.x.org/wiki/GeodeDriver' ac_unique_file="Makefile.am" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS PCIACCESS_LIBS PCIACCESS_CFLAGS XEXT_LIBS XEXT_CFLAGS XORG_LIBS XORG_CFLAGS M32_CFLAGS BUILD_ZTV_FALSE BUILD_ZTV_TRUE PANEL_CPPFLAGS moduledir MAN_SUBSTS XORG_MAN_PAGE ADMIN_MAN_DIR DRIVER_MAN_DIR MISC_MAN_DIR FILE_MAN_DIR LIB_MAN_DIR APP_MAN_DIR ADMIN_MAN_SUFFIX DRIVER_MAN_SUFFIX MISC_MAN_SUFFIX FILE_MAN_SUFFIX LIB_MAN_SUFFIX APP_MAN_SUFFIX INSTALL_CMD PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG CHANGELOG_CMD STRICT_CFLAGS CWARNFLAGS BASE_CFLAGS CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_static enable_shared with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_selective_werror enable_strict_compilation with_xorg_module_dir enable_geodegx_panel enable_ztv enable_xaa ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR XORG_CFLAGS XORG_LIBS XEXT_CFLAGS XEXT_LIBS PCIACCESS_CFLAGS PCIACCESS_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures xf86-video-geode 2.11.18 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/xf86-video-geode] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of xf86-video-geode 2.11.18:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --disable-selective-werror Turn off selective compiler errors. (default: enabled) --enable-strict-compilation Enable all warnings from compiler and make them errors (default: disabled) --disable-geodegx-panel Disable support for flatpanels with the Geode GX --enable-ztv Enable Video For Linux based ZTV driver (default: auto-detected) --enable-xaa Enable legacy X Acceleration Architecture (XAA) [default=auto] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-xorg-module-dir=DIR Default xorg module directory [[default=$libdir/xorg/modules]] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path XORG_CFLAGS C compiler flags for XORG, overriding pkg-config XORG_LIBS linker flags for XORG, overriding pkg-config XEXT_CFLAGS C compiler flags for XEXT, overriding pkg-config XEXT_LIBS linker flags for XEXT, overriding pkg-config PCIACCESS_CFLAGS C compiler flags for PCIACCESS, overriding pkg-config PCIACCESS_LIBS linker flags for PCIACCESS, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . xf86-video-geode home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF xf86-video-geode configure 2.11.18 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ----------------------------------------------------------------------------------------------- ## ## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver%2Fgeode ## ## ----------------------------------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by xf86-video-geode $as_me 2.11.18, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Initialize Automake am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='xf86-video-geode' VERSION='2.11.18' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # Initialize libtool # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: # Require xorg-macros: XORG_DEFAULT_OPTIONS { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : fi ac_fn_c_check_decl "$LINENO" "__clang__" "ac_cv_have_decl___clang__" "$ac_includes_default" if test "x$ac_cv_have_decl___clang__" = xyes; then : CLANGCC="yes" else CLANGCC="no" fi ac_fn_c_check_decl "$LINENO" "__INTEL_COMPILER" "ac_cv_have_decl___INTEL_COMPILER" "$ac_includes_default" if test "x$ac_cv_have_decl___INTEL_COMPILER" = xyes; then : INTELCC="yes" else INTELCC="no" fi ac_fn_c_check_decl "$LINENO" "__SUNPRO_C" "ac_cv_have_decl___SUNPRO_C" "$ac_includes_default" if test "x$ac_cv_have_decl___SUNPRO_C" = xyes; then : SUNCC="yes" else SUNCC="no" fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi # Check whether --enable-selective-werror was given. if test "${enable_selective_werror+set}" = set; then : enableval=$enable_selective_werror; SELECTIVE_WERROR=$enableval else SELECTIVE_WERROR=yes fi # -v is too short to test reliably with XORG_TESTSET_CFLAG if test "x$SUNCC" = "xyes"; then BASE_CFLAGS="-v" else BASE_CFLAGS="" fi # This chunk of warnings were those that existed in the legacy CWARNFLAGS xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wall" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wall" >&5 $as_echo_n "checking if $CC supports -Wall... " >&6; } cacheid=xorg_cv_cc_flag__Wall if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wall" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wpointer-arith" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wpointer-arith" >&5 $as_echo_n "checking if $CC supports -Wpointer-arith... " >&6; } cacheid=xorg_cv_cc_flag__Wpointer_arith if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wpointer-arith" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-declarations" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-declarations" >&5 $as_echo_n "checking if $CC supports -Wmissing-declarations... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_declarations if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-declarations" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wformat=2" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wformat=2" >&5 $as_echo_n "checking if $CC supports -Wformat=2... " >&6; } cacheid=xorg_cv_cc_flag__Wformat_2 if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wformat=2" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wformat" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wformat" >&5 $as_echo_n "checking if $CC supports -Wformat... " >&6; } cacheid=xorg_cv_cc_flag__Wformat if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wformat" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wstrict-prototypes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wstrict-prototypes" >&5 $as_echo_n "checking if $CC supports -Wstrict-prototypes... " >&6; } cacheid=xorg_cv_cc_flag__Wstrict_prototypes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wstrict-prototypes" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-prototypes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-prototypes" >&5 $as_echo_n "checking if $CC supports -Wmissing-prototypes... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_prototypes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-prototypes" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wnested-externs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wnested-externs" >&5 $as_echo_n "checking if $CC supports -Wnested-externs... " >&6; } cacheid=xorg_cv_cc_flag__Wnested_externs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wnested-externs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wbad-function-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wbad-function-cast" >&5 $as_echo_n "checking if $CC supports -Wbad-function-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wbad_function_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wbad-function-cast" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wold-style-definition" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wold-style-definition" >&5 $as_echo_n "checking if $CC supports -Wold-style-definition... " >&6; } cacheid=xorg_cv_cc_flag__Wold_style_definition if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wold-style-definition" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -fd" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -fd" >&5 $as_echo_n "checking if $CC supports -fd... " >&6; } cacheid=xorg_cv_cc_flag__fd if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -fd" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wdeclaration-after-statement" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wdeclaration-after-statement" >&5 $as_echo_n "checking if $CC supports -Wdeclaration-after-statement... " >&6; } cacheid=xorg_cv_cc_flag__Wdeclaration_after_statement if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wdeclaration-after-statement" found="yes" fi fi # This chunk adds additional warnings that could catch undesired effects. xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wunused" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wunused" >&5 $as_echo_n "checking if $CC supports -Wunused... " >&6; } cacheid=xorg_cv_cc_flag__Wunused if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wunused" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wuninitialized" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wuninitialized" >&5 $as_echo_n "checking if $CC supports -Wuninitialized... " >&6; } cacheid=xorg_cv_cc_flag__Wuninitialized if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wuninitialized" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wshadow" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wshadow" >&5 $as_echo_n "checking if $CC supports -Wshadow... " >&6; } cacheid=xorg_cv_cc_flag__Wshadow if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wshadow" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-noreturn" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-noreturn" >&5 $as_echo_n "checking if $CC supports -Wmissing-noreturn... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_noreturn if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-noreturn" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-format-attribute" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-format-attribute" >&5 $as_echo_n "checking if $CC supports -Wmissing-format-attribute... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_format_attribute if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-format-attribute" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wredundant-decls" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wredundant-decls" >&5 $as_echo_n "checking if $CC supports -Wredundant-decls... " >&6; } cacheid=xorg_cv_cc_flag__Wredundant_decls if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wredundant-decls" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wlogical-op" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wlogical-op" >&5 $as_echo_n "checking if $CC supports -Wlogical-op... " >&6; } cacheid=xorg_cv_cc_flag__Wlogical_op if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wlogical-op" found="yes" fi fi # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=implicit" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=implicit" >&5 $as_echo_n "checking if $CC supports -Werror=implicit... " >&6; } cacheid=xorg_cv_cc_flag__Werror_implicit if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=implicit" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" >&5 $as_echo_n "checking if $CC supports -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_NO_EXPLICIT_TYPE_GIVEN__errwarn_E_NO_IMPLICIT_DECL_ALLOWED if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=nonnull" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=nonnull" >&5 $as_echo_n "checking if $CC supports -Werror=nonnull... " >&6; } cacheid=xorg_cv_cc_flag__Werror_nonnull if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=nonnull" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=init-self" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=init-self" >&5 $as_echo_n "checking if $CC supports -Werror=init-self... " >&6; } cacheid=xorg_cv_cc_flag__Werror_init_self if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=init-self" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=main" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=main" >&5 $as_echo_n "checking if $CC supports -Werror=main... " >&6; } cacheid=xorg_cv_cc_flag__Werror_main if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=main" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=missing-braces" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=missing-braces" >&5 $as_echo_n "checking if $CC supports -Werror=missing-braces... " >&6; } cacheid=xorg_cv_cc_flag__Werror_missing_braces if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=missing-braces" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=sequence-point" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=sequence-point" >&5 $as_echo_n "checking if $CC supports -Werror=sequence-point... " >&6; } cacheid=xorg_cv_cc_flag__Werror_sequence_point if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=sequence-point" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=return-type" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=return-type" >&5 $as_echo_n "checking if $CC supports -Werror=return-type... " >&6; } cacheid=xorg_cv_cc_flag__Werror_return_type if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=return-type" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_FUNC_HAS_NO_RETURN_STMT" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_FUNC_HAS_NO_RETURN_STMT" >&5 $as_echo_n "checking if $CC supports -errwarn=E_FUNC_HAS_NO_RETURN_STMT... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_FUNC_HAS_NO_RETURN_STMT if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_FUNC_HAS_NO_RETURN_STMT" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=trigraphs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=trigraphs" >&5 $as_echo_n "checking if $CC supports -Werror=trigraphs... " >&6; } cacheid=xorg_cv_cc_flag__Werror_trigraphs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=trigraphs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=array-bounds" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=array-bounds" >&5 $as_echo_n "checking if $CC supports -Werror=array-bounds... " >&6; } cacheid=xorg_cv_cc_flag__Werror_array_bounds if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=array-bounds" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=write-strings" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=write-strings" >&5 $as_echo_n "checking if $CC supports -Werror=write-strings... " >&6; } cacheid=xorg_cv_cc_flag__Werror_write_strings if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=write-strings" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=address" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=address" >&5 $as_echo_n "checking if $CC supports -Werror=address... " >&6; } cacheid=xorg_cv_cc_flag__Werror_address if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=address" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=int-to-pointer-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=int-to-pointer-cast" >&5 $as_echo_n "checking if $CC supports -Werror=int-to-pointer-cast... " >&6; } cacheid=xorg_cv_cc_flag__Werror_int_to_pointer_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=int-to-pointer-cast" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_BAD_PTR_INT_COMBINATION" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_BAD_PTR_INT_COMBINATION" >&5 $as_echo_n "checking if $CC supports -errwarn=E_BAD_PTR_INT_COMBINATION... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_BAD_PTR_INT_COMBINATION if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -errwarn=E_BAD_PTR_INT_COMBINATION" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=pointer-to-int-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=pointer-to-int-cast" >&5 $as_echo_n "checking if $CC supports -Werror=pointer-to-int-cast... " >&6; } cacheid=xorg_cv_cc_flag__Werror_pointer_to_int_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Werror=pointer-to-int-cast" found="yes" fi fi # Also -errwarn=E_BAD_PTR_INT_COMBINATION else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT" >&5 $as_echo "$as_me: WARNING: You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT" >&2;} xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wimplicit" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wimplicit" >&5 $as_echo_n "checking if $CC supports -Wimplicit... " >&6; } cacheid=xorg_cv_cc_flag__Wimplicit if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wimplicit" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wnonnull" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wnonnull" >&5 $as_echo_n "checking if $CC supports -Wnonnull... " >&6; } cacheid=xorg_cv_cc_flag__Wnonnull if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wnonnull" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Winit-self" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Winit-self" >&5 $as_echo_n "checking if $CC supports -Winit-self... " >&6; } cacheid=xorg_cv_cc_flag__Winit_self if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Winit-self" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmain" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmain" >&5 $as_echo_n "checking if $CC supports -Wmain... " >&6; } cacheid=xorg_cv_cc_flag__Wmain if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmain" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-braces" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-braces" >&5 $as_echo_n "checking if $CC supports -Wmissing-braces... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_braces if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wmissing-braces" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wsequence-point" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wsequence-point" >&5 $as_echo_n "checking if $CC supports -Wsequence-point... " >&6; } cacheid=xorg_cv_cc_flag__Wsequence_point if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wsequence-point" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wreturn-type" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wreturn-type" >&5 $as_echo_n "checking if $CC supports -Wreturn-type... " >&6; } cacheid=xorg_cv_cc_flag__Wreturn_type if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wreturn-type" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wtrigraphs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wtrigraphs" >&5 $as_echo_n "checking if $CC supports -Wtrigraphs... " >&6; } cacheid=xorg_cv_cc_flag__Wtrigraphs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wtrigraphs" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Warray-bounds" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Warray-bounds" >&5 $as_echo_n "checking if $CC supports -Warray-bounds... " >&6; } cacheid=xorg_cv_cc_flag__Warray_bounds if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Warray-bounds" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wwrite-strings" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wwrite-strings" >&5 $as_echo_n "checking if $CC supports -Wwrite-strings... " >&6; } cacheid=xorg_cv_cc_flag__Wwrite_strings if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wwrite-strings" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Waddress" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Waddress" >&5 $as_echo_n "checking if $CC supports -Waddress... " >&6; } cacheid=xorg_cv_cc_flag__Waddress if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Waddress" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wint-to-pointer-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wint-to-pointer-cast" >&5 $as_echo_n "checking if $CC supports -Wint-to-pointer-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wint_to_pointer_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wint-to-pointer-cast" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wpointer-to-int-cast" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wpointer-to-int-cast" >&5 $as_echo_n "checking if $CC supports -Wpointer-to-int-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wpointer_to_int_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then BASE_CFLAGS="$BASE_CFLAGS -Wpointer-to-int-cast" found="yes" fi fi fi CWARNFLAGS="$BASE_CFLAGS" if test "x$GCC" = xyes ; then CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" fi # Check whether --enable-strict-compilation was given. if test "${enable_strict_compilation+set}" = set; then : enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval else STRICT_COMPILE=no fi STRICT_CFLAGS="" xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -pedantic" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -pedantic" >&5 $as_echo_n "checking if $CC supports -pedantic... " >&6; } cacheid=xorg_cv_cc_flag__pedantic if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -pedantic" found="yes" fi fi xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror" >&5 $as_echo_n "checking if $CC supports -Werror... " >&6; } cacheid=xorg_cv_cc_flag__Werror if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -Werror" found="yes" fi fi if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn" >&5 $as_echo_n "checking if $CC supports -errwarn... " >&6; } cacheid=xorg_cv_cc_flag__errwarn if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -errwarn" found="yes" fi fi # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not # activate it with -Werror, so we add it here explicitly. xorg_testset_save_CFLAGS="$CFLAGS" if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 $as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unknown_warning_option=yes else xorg_cv_cc_flag_unknown_warning_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 $as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option CFLAGS="$xorg_testset_save_CFLAGS" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi CFLAGS="$CFLAGS -Werror=unused-command-line-argument" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 $as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : xorg_cv_cc_flag_unused_command_line_argument=yes else xorg_cv_cc_flag_unused_command_line_argument=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 $as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument CFLAGS="$xorg_testset_save_CFLAGS" fi found="no" if test $found = "no" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=attributes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=attributes" >&5 $as_echo_n "checking if $CC supports -Werror=attributes... " >&6; } cacheid=xorg_cv_cc_flag__Werror_attributes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int i; int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval $cacheid=yes else eval $cacheid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CFLAGS="$xorg_testset_save_CFLAGS" eval supported=\$$cacheid { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes" found="yes" fi fi if test "x$STRICT_COMPILE" = "xyes"; then BASE_CFLAGS="$BASE_CFLAGS $STRICT_CFLAGS" CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1` _ACEOF PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MINOR $PVM _ACEOF PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_PATCHLEVEL $PVP _ACEOF CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ echo 'git directory not found: installing possibly empty changelog.' >&2)" macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi if test x$APP_MAN_DIR = x ; then APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' fi if test x$LIB_MAN_SUFFIX = x ; then LIB_MAN_SUFFIX=3 fi if test x$LIB_MAN_DIR = x ; then LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' fi if test x$FILE_MAN_SUFFIX = x ; then case $host_os in solaris*) FILE_MAN_SUFFIX=4 ;; *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' fi if test x$MISC_MAN_SUFFIX = x ; then case $host_os in solaris*) MISC_MAN_SUFFIX=5 ;; *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' fi if test x$DRIVER_MAN_SUFFIX = x ; then case $host_os in solaris*) DRIVER_MAN_SUFFIX=7 ;; *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' fi if test x$ADMIN_MAN_SUFFIX = x ; then case $host_os in solaris*) ADMIN_MAN_SUFFIX=1m ;; *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' fi XORG_MAN_PAGE="X Version 11" MAN_SUBSTS="\ -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xservername__|Xorg|g' \ -e 's|__xconfigfile__|xorg.conf|g' \ -e 's|__projectroot__|\$(prefix)|g' \ -e 's|__apploaddir__|\$(appdefaultdir)|g' \ -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' # Checks for programs. # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- # Define a configure option for an alternate input module directory # Check whether --with-xorg-module-dir was given. if test "${with_xorg_module_dir+set}" = set; then : withval=$with_xorg_module_dir; moduledir="$withval" else moduledir="$libdir/xorg/modules" fi # Define a configure option to enable/disable lcd panel support # Check whether --enable-geodegx-panel was given. if test "${enable_geodegx_panel+set}" = set; then : enableval=$enable_geodegx_panel; else PANEL_CPPFLAGS=-DPNL_SUP fi # Define a configure option to enable/disable ztv # Check whether --enable-ztv was given. if test "${enable_ztv+set}" = set; then : enableval=$enable_ztv; ztv=$enableval else ztv=auto fi # Check for Video4Linux Version 2 (V4L2) availability for ac_header in linux/videodev2.h do : ac_fn_c_check_header_mongrel "$LINENO" "linux/videodev2.h" "ac_cv_header_linux_videodev2_h" "$ac_includes_default" if test "x$ac_cv_header_linux_videodev2_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LINUX_VIDEODEV2_H 1 _ACEOF v4l2=yes else v4l2=no fi done if test "x$ztv" != "xno" ; then if test "x$v4l2" = "xno" ; then if test "x$ztv" = "xyes" ; then # User really wants ztv but V4L2 is not found as_fn_error $? "ZTV driver requested, but videodev2.h not found." "$LINENO" 5 fi else BUILD_ZTV=yes fi fi if test "x$BUILD_ZTV" = xyes; then BUILD_ZTV_TRUE= BUILD_ZTV_FALSE='#' else BUILD_ZTV_TRUE='#' BUILD_ZTV_FALSE= fi # Check if GCC supports compiling in 32 bit mode for 64 bit computers case $host_cpu in x86_64*|amd64*) if test "x$GCC" = xyes ; then SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -m32" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports the -m32 Intel/AMD option" >&5 $as_echo_n "checking if $CC supports the -m32 Intel/AMD option... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : m32_support=yes; M32_CFLAGS=-m32 else m32_support=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $m32_support" >&5 $as_echo "$m32_support" >&6; } CFLAGS="$SAVE_CFLAGS" fi ;; esac # Store the list of server defined optional extensions in REQUIRED_MODULES SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "xorg-server.h" #if !defined RANDR #error RANDR not defined #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : _EXT_CHECK=yes else _EXT_CHECK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RANDR is defined" >&5 $as_echo_n "checking if RANDR is defined... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 $as_echo "$_EXT_CHECK" >&6; } if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES randrproto" fi SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "xorg-server.h" #if !defined RENDER #error RENDER not defined #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : _EXT_CHECK=yes else _EXT_CHECK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RENDER is defined" >&5 $as_echo_n "checking if RENDER is defined... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 $as_echo "$_EXT_CHECK" >&6; } if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES renderproto" fi SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "xorg-server.h" #if !defined XV #error XV not defined #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : _EXT_CHECK=yes else _EXT_CHECK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if XV is defined" >&5 $as_echo_n "checking if XV is defined... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 $as_echo "$_EXT_CHECK" >&6; } if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES videoproto" fi SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "xorg-server.h" #if !defined DPMSExtension #error DPMSExtension not defined #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : _EXT_CHECK=yes else _EXT_CHECK=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if DPMSExtension is defined" >&5 $as_echo_n "checking if DPMSExtension is defined... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 $as_echo "$_EXT_CHECK" >&6; } if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES xextproto" fi # Obtain compiler/linker options for the Geode driver dependencies pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XORG" >&5 $as_echo_n "checking for XORG... " >&6; } if test -n "$XORG_CFLAGS"; then pkg_cv_XORG_CFLAGS="$XORG_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xorg-server xproto fontsproto \$REQUIRED_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "xorg-server xproto fontsproto $REQUIRED_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XORG_CFLAGS=`$PKG_CONFIG --cflags "xorg-server xproto fontsproto $REQUIRED_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XORG_LIBS"; then pkg_cv_XORG_LIBS="$XORG_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xorg-server xproto fontsproto \$REQUIRED_MODULES\""; } >&5 ($PKG_CONFIG --exists --print-errors "xorg-server xproto fontsproto $REQUIRED_MODULES") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XORG_LIBS=`$PKG_CONFIG --libs "xorg-server xproto fontsproto $REQUIRED_MODULES" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XORG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xorg-server xproto fontsproto $REQUIRED_MODULES" 2>&1` else XORG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xorg-server xproto fontsproto $REQUIRED_MODULES" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XORG_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (xorg-server xproto fontsproto $REQUIRED_MODULES) were not met: $XORG_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables XORG_CFLAGS and XORG_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables XORG_CFLAGS and XORG_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else XORG_CFLAGS=$pkg_cv_XORG_CFLAGS XORG_LIBS=$pkg_cv_XORG_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XEXT" >&5 $as_echo_n "checking for XEXT... " >&6; } if test -n "$XEXT_CFLAGS"; then pkg_cv_XEXT_CFLAGS="$XEXT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xextproto >= 7.0.99.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "xextproto >= 7.0.99.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XEXT_CFLAGS=`$PKG_CONFIG --cflags "xextproto >= 7.0.99.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$XEXT_LIBS"; then pkg_cv_XEXT_LIBS="$XEXT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xextproto >= 7.0.99.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "xextproto >= 7.0.99.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_XEXT_LIBS=`$PKG_CONFIG --libs "xextproto >= 7.0.99.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xextproto >= 7.0.99.1" 2>&1` else XEXT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xextproto >= 7.0.99.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XEXT_PKG_ERRORS" >&5 HAVE_XEXTPROTO_71="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } HAVE_XEXTPROTO_71="no" else XEXT_CFLAGS=$pkg_cv_XEXT_CFLAGS XEXT_LIBS=$pkg_cv_XEXT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } HAVE_XEXTPROTO_71="yes"; $as_echo "#define HAVE_XEXTPROTO_71 1" >>confdefs.h fi # Define a configure option to enable/disable XAA support; # handles unavailability of XAA since xserver-1.13 # Check whether --enable-xaa was given. if test "${enable_xaa+set}" = set; then : enableval=$enable_xaa; fi if test "x$enable_xaa" != "xno"; then : save_CFLAGS=$CFLAGS save_CPPFLAGS=$CPPFLAGS CFLAGS=$XORG_CFLAGS CPPFLAGS="$XORG_CFLAGS" for ac_header in xaa.h do : ac_fn_c_check_header_mongrel "$LINENO" "xaa.h" "ac_cv_header_xaa_h" "$ac_includes_default" if test "x$ac_cv_header_xaa_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_XAA_H 1 _ACEOF have_XAA=yes else have_XAA=no fi done CFLAGS=$save_CFLAGS CPPFLAGS=$save_CPPFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include XAA support" >&5 $as_echo_n "checking whether to include XAA support... " >&6; } if test "x$have_XAA" = "xyes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else if test "x$enable_xaa" = "xyes"; then : as_fn_error $? "XAA requested but not found (perhaps building against xserver-1.13 or newer?)" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # Checks for libpciaccess support. SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" ac_fn_c_check_decl "$LINENO" "XSERVER_LIBPCIACCESS" "ac_cv_have_decl_XSERVER_LIBPCIACCESS" "#include \"xorg-server.h\" " if test "x$ac_cv_have_decl_XSERVER_LIBPCIACCESS" = xyes; then : XSERVER_LIBPCIACCESS=yes else XSERVER_LIBPCIACCESS=no fi CPPFLAGS="$SAVE_CPPFLAGS" if test "x$XSERVER_LIBPCIACCESS" = xyes; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PCIACCESS" >&5 $as_echo_n "checking for PCIACCESS... " >&6; } if test -n "$PCIACCESS_CFLAGS"; then pkg_cv_PCIACCESS_CFLAGS="$PCIACCESS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.8.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PCIACCESS_CFLAGS=`$PKG_CONFIG --cflags "pciaccess >= 0.8.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PCIACCESS_LIBS"; then pkg_cv_PCIACCESS_LIBS="$PCIACCESS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pciaccess >= 0.8.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "pciaccess >= 0.8.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_PCIACCESS_LIBS=`$PKG_CONFIG --libs "pciaccess >= 0.8.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pciaccess >= 0.8.0" 2>&1` else PCIACCESS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pciaccess >= 0.8.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PCIACCESS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (pciaccess >= 0.8.0) were not met: $PCIACCESS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PCIACCESS_CFLAGS and PCIACCESS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PCIACCESS_CFLAGS and PCIACCESS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else PCIACCESS_CFLAGS=$pkg_cv_PCIACCESS_CFLAGS PCIACCESS_LIBS=$pkg_cv_PCIACCESS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" fi ac_config_files="$ac_config_files Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_ZTV_TRUE}" && test -z "${BUILD_ZTV_FALSE}"; then as_fn_error $? "conditional \"BUILD_ZTV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by xf86-video-geode $as_me 2.11.18, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . xf86-video-geode home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ xf86-video-geode config.status 2.11.18 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Whether or not to build static libraries. build_old_libs=$enable_static # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi xf86-video-geode-2.11.18/build-aux/0000755000175000017500000000000012654451205013543 500000000000000xf86-video-geode-2.11.18/build-aux/config.sub0000755000175000017500000010646012654445520015460 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-08-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xf86-video-geode-2.11.18/build-aux/install-sh0000755000175000017500000003546312654445520015505 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # $RANDOM is not portable (e.g. dash); use it when possible to # lower collision chance tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # As "mkdir -p" follows symlinks and we work in /tmp possibly; so # create the $tmpdir first (and fail if unsuccessful) to make sure # that nobody tries to guess the $tmpdir name. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xf86-video-geode-2.11.18/build-aux/missing0000755000175000017500000001533012654445520015067 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xf86-video-geode-2.11.18/build-aux/config.guess0000755000175000017500000012475312654445520016022 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-08-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || \ echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; *:Sortix:*:*) echo ${UNAME_MACHINE}-unknown-sortix exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: xf86-video-geode-2.11.18/build-aux/compile0000755000175000017500000001624512654445520015054 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xf86-video-geode-2.11.18/build-aux/depcomp0000755000175000017500000005601612654445520015053 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: xf86-video-geode-2.11.18/build-aux/ltmain.sh0000644000175000017500000105203012654445466015320 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.11" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 xf86-video-geode-2.11.18/COPYING0000644000175000017500000000304112654445443012631 00000000000000Copyright (C) 2003-2008 Advanced Micro Devices, Inc. Copyright (C) 2007 George Sapountzis Copyright (C) 2002 David Dawes Copyright (C) 2001 VA Linux Systems Inc., Fremont, California. Copyright (C) 2002 Keith Packard, member of The XFree86 Project, Inc. LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ADDITIONAL AMD CLAUSE: Neither the name of the Advanced Micro Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. xf86-video-geode-2.11.18/configure.ac0000644000175000017500000001342612654445443014074 00000000000000# Copyright 2005 Adam Jackson. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # on the rights to use, copy, modify, merge, publish, distribute, sub # license, and/or sell copies of the Software, and to permit persons to whom # the Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice (including the next # paragraph) shall be included in all copies or substantial portions of the # Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Process this file with autoconf to produce a configure script # Initialize Autoconf AC_PREREQ(2.60) AC_INIT([xf86-video-geode], [2.11.18], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver%2Fgeode], [xf86-video-geode], [http://www.x.org/wiki/GeodeDriver]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) # Initialize Automake AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE # Initialize libtool AC_DISABLE_STATIC AC_PROG_LIBTOOL # Require xorg-macros: XORG_DEFAULT_OPTIONS m4_ifndef([XORG_MACROS_VERSION], [m4_fatal([must install xorg-macros 1.4 or later before running autoconf/autogen])]) XORG_MACROS_VERSION(1.4) XORG_DEFAULT_OPTIONS # Checks for programs. AC_DISABLE_STATIC AC_PROG_LIBTOOL AH_TOP([#include "xorg-server.h"]) # ----------------------------------------------------------------------------- # Configuration options # ----------------------------------------------------------------------------- # Define a configure option for an alternate input module directory AC_ARG_WITH(xorg-module-dir, AS_HELP_STRING([--with-xorg-module-dir=DIR], [Default xorg module directory [[default=$libdir/xorg/modules]]]), [moduledir="$withval"], [moduledir="$libdir/xorg/modules"]) AC_SUBST([moduledir]) # Define a configure option to enable/disable lcd panel support AC_ARG_ENABLE(geodegx-panel, AS_HELP_STRING([--disable-geodegx-panel], [Disable support for flatpanels with the Geode GX]), [ ], [ PANEL_CPPFLAGS=-DPNL_SUP ]) AC_SUBST(PANEL_CPPFLAGS) # Define a configure option to enable/disable ztv AC_ARG_ENABLE(ztv, AS_HELP_STRING([--enable-ztv], [Enable Video For Linux based ZTV driver (default: auto-detected)]), [ztv=$enableval], [ztv=auto]) # Check for Video4Linux Version 2 (V4L2) availability AC_CHECK_HEADERS([linux/videodev2.h],[v4l2=yes],[v4l2=no]) if test "x$ztv" != "xno" ; then if test "x$v4l2" = "xno" ; then if test "x$ztv" = "xyes" ; then # User really wants ztv but V4L2 is not found AC_MSG_ERROR([ZTV driver requested, but videodev2.h not found.]) fi else BUILD_ZTV=yes fi fi AM_CONDITIONAL(BUILD_ZTV, [test "x$BUILD_ZTV" = xyes]) # Check if GCC supports compiling in 32 bit mode for 64 bit computers case $host_cpu in x86_64*|amd64*) if test "x$GCC" = xyes ; then SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -m32" AC_MSG_CHECKING([if $CC supports the -m32 Intel/AMD option]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #include int main () { ; return 0; }]])], [m32_support=yes; M32_CFLAGS=-m32], [m32_support=no]) AC_MSG_RESULT([$m32_support]) CFLAGS="$SAVE_CFLAGS" fi ;; esac AC_SUBST([M32_CFLAGS]) # Store the list of server defined optional extensions in REQUIRED_MODULES XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(RENDER, renderproto) XORG_DRIVER_CHECK_EXT(XV, videoproto) XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) # Obtain compiler/linker options for the Geode driver dependencies PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES]) PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1], HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]), HAVE_XEXTPROTO_71="no") # Define a configure option to enable/disable XAA support; # handles unavailability of XAA since xserver-1.13 AC_ARG_ENABLE(xaa, AS_HELP_STRING([--enable-xaa], [Enable legacy X Acceleration Architecture (XAA) [default=auto]])) AS_IF([test "x$enable_xaa" != "xno"], [ save_CFLAGS=$CFLAGS save_CPPFLAGS=$CPPFLAGS CFLAGS=$XORG_CFLAGS CPPFLAGS="$XORG_CFLAGS" AC_CHECK_HEADERS([xaa.h], have_XAA=yes, have_XAA=no) CFLAGS=$save_CFLAGS CPPFLAGS=$save_CPPFLAGS ]) AC_MSG_CHECKING([whether to include XAA support]) AS_IF([test "x$have_XAA" = "xyes"], [AC_MSG_RESULT([yes])], [AS_IF([test "x$enable_xaa" = "xyes"], [AC_MSG_ERROR([XAA requested but not found (perhaps building against xserver-1.13 or newer?)])], [AC_MSG_RESULT([no]) ]) ]) # Checks for libpciaccess support. SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" AC_CHECK_DECL(XSERVER_LIBPCIACCESS, [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no], [#include "xorg-server.h"]) CPPFLAGS="$SAVE_CPPFLAGS" if test "x$XSERVER_LIBPCIACCESS" = xyes; then PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" fi AC_CONFIG_FILES([ Makefile src/Makefile ]) AC_OUTPUT xf86-video-geode-2.11.18/Makefile.am0000644000175000017500000000251512654445443013637 00000000000000# Copyright 2005 Adam Jackson. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # on the rights to use, copy, modify, merge, publish, distribute, sub # license, and/or sell copies of the Software, and to permit persons to whom # the Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice (including the next # paragraph) shall be included in all copies or substantial portions of the # Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 SUBDIRS = src MAINTAINERCLEANFILES = ChangeLog INSTALL EXTRA_DIST = autogen.sh .PHONY: ChangeLog INSTALL INSTALL: $(INSTALL_CMD) ChangeLog: $(CHANGELOG_CMD) dist-hook: ChangeLog INSTALL xf86-video-geode-2.11.18/INSTALL0000644000175000017500000003660012654451205012627 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. xf86-video-geode-2.11.18/m4/0000755000175000017500000000000012654451205012171 500000000000000xf86-video-geode-2.11.18/m4/ltoptions.m40000644000175000017500000003007312654445467014426 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) xf86-video-geode-2.11.18/m4/ltversion.m40000644000175000017500000000126212654445467014416 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) xf86-video-geode-2.11.18/m4/lt~obsolete.m40000644000175000017500000001375612654445467014756 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) xf86-video-geode-2.11.18/m4/ltsugar.m40000644000175000017500000001042412654445467014052 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) xf86-video-geode-2.11.18/m4/libtool.m40000644000175000017500000106011112654445467014034 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS xf86-video-geode-2.11.18/NEWS0000644000175000017500000001322612654445443012303 00000000000000Geode 2.11.16 (2014-07-17) ========================== No user-visible change: * This release restores compatibility with xserver-1.15 and newer by adding a missing xf86Modes.h include to src/geode_dcon.c Geode 2.11.15 (2013-10-09) ========================== No user-visible change: * This release restores compatibility with xserver-1.14 by removing mibstore.h includes and miInitializeBackingStore() functions. Since Nov.2010 (commit c4c4676) the only purpose of mibstore.h was to define an empty function for backward compatibility. * Build helpers migrate to contemporary [build-aux] and [m4]. Geode 2.11.14 (2012-11-25) ========================== Better compatibility with xserver-1.13, cairo-1.12 and gtk3: * Fix building on Xservers without XAA (Maarten Lankhorst) xserver-1.13 dropped XAA acceleration method, as it does not accel anything important used on modern desktops. The geode driver now supports configuring whether to include XAA support - by default it is automatically disabled with newest xservers that do not support it, but can be explicitly disabled for older xservers as well if desired (particularly for LX deployments). XAA support remains in place for the time being for older xservers, as the EXA support for GX2 GPUs is of unknown quality and speed. * Fix building with new xserver-1.13 API (Maarten Lankhorst) xserver-1.13 changed API, including moving various global symbols behind function calls, to better support multiple switchable graphics cards and hotplugged (USB) graphics cards. Work done to support both pre-1.13 and 1.13+ APIs in other drivers is reused to bring the same support to the Geode driver. * Implement solid source pictures acceleration (Mart Raudsepp) cairo-1.12 uses these extensively for text rendering, instead of 1x1 repeating images that cairo-1.10 used and we already accelerate. Without acceleration, in addition to being slow, we'd hit a fallback handling bug in EXA with xserver older than 1.13.1, which results in very visible text corruption in many instances. * Handle negative srcX and srcY parameters better in EXA Composite operations, used via the RENDER extension (Mart Raudsepp) Handling of source picture coordinates outside actual source pixmap area is still subpar and ignoring spec in some corner cases, but a more specific case is improved to provide correct results in more situations. In particular this fixes GtkTrayIcon drawing via cairo as used by gtk3, specifically as seen in GNOME3 fallback desktop. Previously no icon was drawn at all if the icon needed centering to the drawing area, which in the end is achieved via a negative srcX/srcY. https://bugs.freedesktop.org/show_bug.cgi?id=51360 * Fix builds for exotic and/or non-target platforms (Dave Airlie) * Clarify the copyright of older AMD commits (Martin-Éric Racine) VALIDATION PLATFORMS * Debian (X server 1.7.7) on Artec DBE61 and Hercules EC-800. * Debian (X server 1.12.14) on FIC ION603A. * Fedora (X server 1.13) on OLPC XO-1. Geode 2.11.13 (2011-12-26) ========================== This release mainly features a complete overhaul of the building scripts plus a cleanup of deprecated macros. The key benefit is that this Geode driver can finally build on FreeBSD and on other platforms not offering V4L2 support and that it can also build on a 64-bit host using its 32-bit personality. Support for the Video Input Port (VIP) feature of the Geode LX found in 'ztv' is now documented and the source code saw the removal of deprecated Linux 2.4 backward compatibility code. Compiling is skipped on platforms without V4L2. Configuration for laptops featuring WXGA resolutions is finally documented. Setting the GEODE_TRACE_FALL macro now enables composite operation tracing on this driver. This can be used to profile the performance during development. Fixes to keep this driver compilable on recent X servers are also included. VALIDATION PLATFORMS * Debian (X server 1.7.7) on Artec DBE61 and Hercules EC-800. * Ubuntu (X server 1.10.4) on FIC ION603A. Geode 2.11.12 (2011-02-13) ========================== This release drops the "linux/videodev.h" include in z4l.c because V4L1 support was dropped as of Linux kernel 2.6.38, and it fixes packed overlay offscreen allocations. Geode 2.11.11 (2010-12-27) ========================== This release restores code compatibility down to X server 1.4, it fixes compilation under 1.9.99 and newer, and it improves handling of gamma correction in video vs graphics Geode 2.11.10 (2010-11-09) ========================== This release migrates deprecated xalloc/xrealloc/xfree/xcalloc calls to malloc/realloc/free/calloc, fixes several DCON-specific issues, improves mode validation and adds support for one WXGA resolution. Geode 2.11.9 (2010-08-23) ========================= We are pleased to announce this maintenance release of xf86-video-geode. It features a plethora of bug fixes, a few documentation updates and one performance enhancement. This release also marks the return of AMD to the development team. Noticeable changes compared to 2.11.8 ------------------------------------- * Fixes all known rendering bugs, most notably those pertaining to the GNOME and KDE desktop environments, to video player applications and to the Chrome and Firefox browsers. * Dramatically improves the performance: Before After -aa10text 4660/sec 53300/sec -aa24text 2740/sec 16200/sec * Validates resolutions rather than resorts to virtual screen sizes. Adds a new screen resolution at 106.50MHz to those we know about. * Clarifies the copyrights of each file and updates COPYING to match. xf86-video-geode-2.11.18/ChangeLog0000644000175000017500000036224512654451205013357 00000000000000commit 9b04a4df4239e7e9414402f8522cb31728481a27 Author: Martin-Éric Racine Date: Wed Feb 3 20:38:37 2016 +0200 Geode 2.11.18 This release restores compatibility with xserver-1.18 and newer. Conditional support for the Geode MSR device on FreeBSD is merged. GX acceleration and compositing is upgraded to current standards. LX switching to VT and back is restored. Farewell blanks screens! VALIDATION PLATFORM * Debian (X server 1.18.0) on FIC ION603A (Geode LX800). Signed-off-by: Martin-Éric Racine commit cecdf5085739649dc3b52e343c246f6c3c1dda4d Author: Connor Behan Date: Tue Dec 1 18:45:59 2015 -0500 LX: Restore old VT switch code Calls for enabling and disabling outputs were removed from the VT switch routine when RandR support was added. Presumably, this is because the server already sets DPMS properly on a VT switch. However, DDX code can undo what the server does so it seems best to keep the explicit calls. Closes: X.Org Bugzilla #80825 Signed-off-by: Connor Behan commit 44c508916af7a6e59d898829faaec599dbd51f4a Author: Arrigo Marchiori Date: Mon Sep 28 13:52:34 2015 +0300 Geode MSR support for FreeBSD The file src/geode_msr.c does not compile under FreeBSD. The attached patch allows to compile the driver. Closes: Free Desktop Bug #92158 Signed-off-by: Arrigo Marchiori commit aecb0803d318e8100d6024f34a96df225ff738aa Author: Connor Behan Date: Thu Aug 27 01:09:53 2015 -0400 Fix GX UploadToScreen and DownloadFromScreen Even though most embedded drivers don't do it, there could be a slight advantage on a single arch from reimplementing unaccelerated UTS and DFS since the xserver avoids assembly. This does not remove them, it merely updates them to work with the latest EXA. Signed-off-by: Connor Behan commit d0d07108b7db4536ec12a45d5b7633b1abb22f60 Author: Connor Behan Date: Tue Aug 25 23:32:29 2015 -0400 Fix GX composite hooks These need to fallback for solid and gradient pictures. Signed-off-by: Connor Behan commit fc5d97e06c922de929017f676a58adf741770bc7 Author: Matthew Green Date: Mon Jul 20 10:37:16 2015 +0200 Properly hide config.h inclusion inside HAVE_CONFIG_H. v2: make config.h inclusion the first one. Signed-off-by: Thomas Klausner Reviewed-by: Emil Velikov commit 97e53b5896752a7e504d0159a7009418e2510521 Author: Martin-Éric Racine Date: Wed May 20 11:24:30 2015 +0300 Geode 2.11.17 This release restores compatibility with xserver-1.17. Support for the Geode MSR device on OpenBSD is merged. VALIDATION PLATFORM * Debian (X server 1.17.1) on FIC ION603A (Geode LX800). Signed-off-by: Martin-Éric Racine commit f98301ad73b84915358ce6f6d2522b36c4b603d9 Author: Maarten Lankhorst Date: Thu Mar 12 10:50:57 2015 +0100 Fix building Geode against xserver 1.17 The xf86MapVidMem API is gone. Use pciaccess calls where applicable and mmap for XpressROMPtr. Signed-off-by: Maarten Lankhorst commit 621d946e56efac2c779b83b1a5c6b645169c4ebd Author: Brian A. Lloyd Date: Wed Oct 1 12:35:18 2014 +0300 Add config.h include to src/lx_memory.c The src/lx_memory.c file uses the xf86.h header file. This file must have HAVE_STRNDUP defined before calling it when the building platform has a strndup function. When using config.h, this file doesn't have that define and so fails to compile. The attached patch adds the conditional config.h to this file so it may compile on the affected platforms. The patch is trivial and may be included and used under whatever licensing desired. Closes: Free Desktop Bug #84541 Signed-off-by: Brian A. Lloyd commit efb42fc933a4198645691a94fe350f361cbf55a8 Author: Marc Balmer Date: Thu Sep 25 16:11:56 2014 +0300 Geode MSR support for OpenBSD This patch adds conditional support for the Geode MSR device on OpenBSD. Signed-off-by: Marc Balmer Signed-off-by: Matthieu Herrb commit 6ec1e2df7aeb78332fee0dd90900906e58aa790b Author: Martin-Éric Racine Date: Thu Jul 17 03:28:26 2014 +0300 Geode 2.11.16 This release restores compatibility with xserver-1.15 and newer by adding a missing xf86Modes.h include to src/geode_dcon.c VALIDATION PLATFORM * Debian (X server 1.15.99.904) on FIC ION603A (Geode LX800). Signed-off-by: Martin-Éric Racine commit 70b131d09b7d21df1d1ffcf6a4e50d3086924228 Author: Martin-Éric Racine Date: Sat Feb 8 14:58:26 2014 +0200 No need to conditionalize the xf86Modes.h include. commit 9707a7a5eac25536a5150fc12d9ace52420b4d36 Author: Martin-Éric Racine Date: Sat Feb 8 13:27:11 2014 +0200 Added conditional include to fix FTBFS on xserver 1.15 and up. Thanks to Maarten Lankhorst for the fix. commit c2d956a1e9bba7fa7877544f8e036ae78faa441f Author: Martin-Éric Racine Date: Wed Oct 9 14:48:45 2013 +0300 Geode 2.11.15 This release restores compatibility with xserver-1.14 by removing mibstore.h includes and miInitializeBackingStore() functions. Since Nov.2010 (commit c4c4676) the only purpose of mibstore.h was to define an empty function for backward compatibility. Build helpers migrate to contemporary [build-aux] and [m4]. VALIDATION PLATFORM * Debian (X server 1.14.3) on FIC ION603A (Geode LX800). Signed-off-by: Martin-Éric Racine commit 69a8eedfe62d0df9037d86b47f2a6e34ba3c40a8 Author: Martin-Éric Racine Date: Thu Oct 3 01:29:35 2013 +0300 Migrate AC_CONFIG_AUX_DIR to [build-aux] Signed-off-by: Martin-Éric Racine commit b57f56b311d7f9702459f2bfd5330141f6b2bcff Author: Martin-Éric Racine Date: Wed Oct 2 22:39:49 2013 +0300 Fix whitespace in AC_INIT Signed-off-by: Martin-Éric Racine commit 7d9f923e15eca509cd61f4f01ebbb0b2bf49d73c Author: Martin-Éric Racine Date: Wed Oct 2 22:35:12 2013 +0300 Bump AC_PREREQ to 2.60 as suggested by Gaetan Nadon Signed-off-by: Martin-Éric Racine commit cb36826843017583aecbc77c4dbeb8ec5198c016 Author: Martin-Éric Racine Date: Wed Oct 2 22:18:42 2013 +0300 libtool upgrade to include m4 directory Signed-off-by: Martin-Éric Racine commit ed0b153f320a95a11bd561726d2405823573500e Author: Adam Jackson Date: Wed Jan 9 22:16:26 2013 -0500 Remove mibstore.h Signed-off-by: Adam Jackson commit a96a4e28a079499b18b441f0b6c05c50dd86ead6 Author: Martin-Éric Racine Date: Sun Nov 25 11:12:58 2012 +0200 Geode 2.11.14 This release restores compatibility with xserver-1.13, cairo-1.12 and gtk-3: * Fix building with new xserver-1.13 (Maarten Lankhorst) + Implement xserver-1.13 API changes. + Make XAA support optional (dropped as of xserver-1.13). * Implement solid source pictures acceleration for cairo-1.12 (Mart Raudsepp) * Fix EXA Composite implementation in the LX component (Mart Raudsepp) Restores icon and text rendering for GNOME 3 fallback mode. This release also improves compatibility with non-Linux/non-32-bit hardware: * Fix compiling on 64-bit hosts (Dave Airlie) * Fix compiling on non-Linux platforms (Martin-Éric Racine) VALIDATION PLATFORMS * Debian (X server 1.7.7) on Artec DBE61. * Debian (X server 1.12.14) on FIC ION603A. * Fedora (X server 1.13) on OLPC XO-1. commit cec433840fde8be3ee6b8ce916b416f44d15a794 Author: Martin-Éric Racine Date: Sat Nov 24 12:02:32 2012 +0200 pre-release whitespace cleanup using ../modular/x-indent-all.sh commit 4e6f1e68344d52cd80f85843a2a9830add042a34 Author: Mart Raudsepp Date: Tue Nov 20 09:14:31 2012 +0200 NEWS: Release notes for 2.11.14 commit a02c099af60c96b440edcc2b0afbd0be0b349ee8 Author: Mart Raudsepp Date: Tue Nov 20 08:30:13 2012 +0200 NEWS: Fix placement order of 2.11.10 NEWS compared to others commit 45ca66ee73bfe04a7ac17e2086f2e5d20bfa93e9 Author: Mart Raudsepp Date: Sat Nov 17 23:51:39 2012 +0200 lx_exa: Improvements to negative srcX/Y PictOpSrc/Over operations Adds handling of negative srcX or srcY coordinates, which is used by gtk3 GtkTrayIcon implementation via cairo for centering icons on top of the destination area. For now just handle the drawing within source pixmap bounds in these cases, as full handling of the out of bound zero-vector for PictOpSrc seems to require bigger refactoring, which is not suitable for the impending stable release. The approach implemented here should result in correct rendering for PictOpOver (as out of bounds with non-repeat mode ends up meaning transparency). For PictOpSrc no black borders are rendered where appropriate, but before this approach, no source pixmap would even be rendered at all, so it should be a net improvement for the upcoming release, while fixing the gtk3 icons in GNOME3 fallback. The completely out of bounds special case check didn't work correctly for negative srcX or srcY because exaScratch.srcWidth/Height are unsigned types, so the negative srcX or srcY got casted to unsigned, which resulted in a big number, so srcX >= 0 was always true (but GCC managed to not warn of the implicit signedness cast). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=51360 commit a46486b05f4674fc17f36947c97bc281c1d00d26 Author: Mart Raudsepp Date: Tue Oct 23 11:40:11 2012 +0300 lx_exa: Implement solid pictures support as source with a mask cairo-1.12 uses solid pictures instead of 1x1R pixmaps in glyph rendering paths, so accelerate it. In addition to acceleration, it avoids a bug in xserver-1.13.0 and earlier which causes visible misrendering for fallback path, making cairo-1.12 a viable and desired choice on GeodeLX systems. Quick benchmarking suggests a 4-12% win in cairo-traces. commit 85f25321661b24324d9e8fb6415abc0fda12436d Author: Mart Raudsepp Date: Tue Oct 23 11:35:18 2012 +0300 lx_exa: Remove unused srcPixmap member from exaScratch Became redundant with commit 32a927b8e6 commit 5cfd7591b2f6ccb57d698738faa3fa800088f972 Author: Martin-Éric Racine Date: Tue Oct 2 18:05:55 2012 +0300 Clarified the copyright and license of src/geode_msr.c src/geode_blend.h Debian's 'licensecheck' tool showed these two files to have unspecified copyright and license. Git log clarifies that these had been created by Jordan Crouse when he was still at AMD, so their stock copyright notice was copied as-is from other files in src/ commit 65d9954ef61b7e22252d38cc81db710a8ec0b22b Author: Mart Raudsepp Date: Tue Sep 18 08:43:51 2012 +0300 lx_exa: Downgrade src/dst format warnings to fallbacks to not spam the log We don't support 10bit wide color channels, BGRA and other types, which mainly cause these fallbacks. The ErrorF's were unwarranted, these are just fallbacks as any other, so don't output these warnings without GEODE_TRACE_FALL. commit 5f7797cadeaf8a28612b9d0c394f8507eb687c34 Author: Mart Raudsepp Date: Tue Sep 18 08:41:53 2012 +0300 lx_exa: Fix crash with solid fills on PictOpAdd operations lx_check_composite has many special checks for PictOpAdd to return successfully early, but these were done even earlier than the check for solid fills. This resulted in lx_prepare_composite assuming the source pixmap exists, which is not the case with solid fills. Move the solid fill fallback checks before the others, so we are guaranteed to always have a source pixmap in PrepareComposite and Composite and don't crash trying to access a NULL pointer. Also move up the mask check to do less checks in the PictOpAdd logic. commit 4a20e8ac285cfe8a033f771ac8df25f873db9908 Author: Martin-Éric Racine Date: Wed Aug 29 12:53:00 2012 +0300 NEWS: add information about releases since 2.11.9 ...and flip the location of the recent src/Makefile.am addition. commit 0e64b1252c51e380f72f6ff0bdb6836a6e27071d Author: Martin-Éric Racine Date: Thu Aug 9 18:59:03 2012 +0300 src/Makefile.am: added missing compat-api.h to geode_drv_la_SOURCES commit 86a879a1ec9771c45b0bffb18f7fd13854b1e84a Author: Mart Raudsepp Date: Thu Jul 26 10:28:22 2012 +0300 configure: Make the new XAA checks work, and other improvements commit 68646c31 added XAA checks were too early, when XORG_CFLAGS isn't declared yet, so it got never enabled. Move the block after xorg-server pkg-config checks, which declare XORG_CFLAGS. Change configure to fail if --enable-xaa is explicitly requested, but XAA headers are not found. Other tweaks for more autoconf-ism. Signed-off-by: Mart Raudsepp commit a83fcb6f84995dc50b8adffc27e264a663fbd606 Author: Maarten Lankhorst Date: Sat Jul 21 12:36:51 2012 +0200 Initial stab at converting geode to new X1.13 API Preparing to compile geode on X 1.13 All compiler errors are gone as far as I can tell, but I lack the hardware to verify it works as well. commit 68646c3119a69a8391a49f2d565672d73829e2c9 Author: Maarten Lankhorst Date: Sat Jul 21 12:36:17 2012 +0200 Allow building on Xservers without XAA commit cb0e67bbc019b170194b3b51e2a47fca8d3aeac1 Author: Mart Raudsepp Date: Wed Jul 25 07:23:35 2012 +0300 lx_exa: Fix EXA minor version checks The old version of just checking for EXA_MINOR_VERSION >= 2 would stop working if ever EXA gets a new major version, as minor would be reset to 0, and start unexpectedly working again when minor gets bumped gradually up to 2 again. Other drivers also assume that a new major would still have the vfunc we use. commit dc0dbd41745f99dcd9ca3fda05acf5a5f11a6960 Author: Mart Raudsepp Date: Wed Jul 25 04:44:18 2012 +0300 Fix an unused variable warning in geode_driver.c geode_driver.c:372:9: warning: variable 'cpu_detected' set but not used [-Wunused-but-set-variable] Was used only in a DEBUGMSG, which has since been made not do anything ever, so just kill it completely, as the debug message wasn't useful anyway. commit 1ed67d70ac9d3afd9b372c311aaf7b77e38b3e21 Author: Martin-Éric Racine Date: Wed Jul 11 15:50:28 2012 +0300 Whitespace cleanup using ../modular/x-indent.sh commit b9afafec0a26eaec49e7f0ff08297c2bb795a9c2 Author: Dave Airlie Date: Tue Apr 3 11:08:09 2012 +0100 geode: fix compile on x86-64 in tinderbox. geode_ddc.c: In function 'GeodeI2CInit': geode_ddc.c:158: error: cast to pointer from integer of different size Signed-off-by: Dave Airlie commit 048c67d6f351083741ef68e94a278a445c16436d Author: Martin-Éric Racine Date: Mon Jan 2 17:49:10 2012 +0200 z4l.c: drop unnecessary #include linux/types.h On hybrid platforms, such as Debian GNU/KFreeBSD, that support V4L2 and yet without providing the full complement of Linux headers, ZTV fails to compile because of this missing header. Given how removing this header does not adversely affect compiling, plus it might improve portability, we went ahead and removed it. Nonetheless, as observed by Gaetan Nadon, z4l.c includes code that explicitly disables the module on any OS other than Linux: LoaderGetOS(&osname, NULL, NULL, NULL); if (osname == NULL || strcmp(osname, "linux") != 0) { if (errmaj) *errmaj = LDR_BADOS; if (errmin) *errmin = 0; return NULL; } Still, in the interest of OS neutrality, we decided to leave recent autoconf magic in place and to let OS vendors figure out how to get the module loaded on non-Linux OS themselves. Patches are welcome. Signed-off-by: Martin-Éric Racine commit e420d7956afceeb41f20179cedc28d46aebdb29f Author: Martin-Éric Racine Date: Mon Dec 26 22:13:22 2011 +0200 Geode 2.11.13 This release mainly features a complete overhaul of the building scripts plus a cleanup of deprecated macros. The key benefit is that this Geode driver can finally build on FreeBSD and on other platforms not offering V4L2 support and that it can also build on a 64-bit host using its 32-bit personality. Support for the Video Input Port (VIP) feature of the Geode LX found in 'ztv' is now documented and the source code saw the removal of deprecated Linux 2.4 backward compatibility code. Compiling is skipped on platforms without V4L2. Configuration for laptops featuring WXGA resolutions is finally documented. Setting the GEODE_TRACE_FALL macro now enables composite operation tracing on this driver. This can be used to profile the performance during development. Fixes to keep this driver compilable on recent X servers are also included. VALIDATION PLATFORMS * Debian/stable (X server 1.7.7) on Artec DBE61 and Hercules EC-800. * Ubuntu/Precise (X server 1.10.4) on FIC ION603A. Signed-off-by: Martin-Éric Racine commit 7e7fe26882dada5878d5450e64c043ba7b0737fd Author: Martin-Éric Racine Date: Sun Dec 25 21:43:40 2011 +0200 Fix lx_display.c:360:9: warning: ISO C90 forbids mixed declarations and code commit 515d232162c8ea2c5ecabf12b88b0bf4eb5102e7 Author: Adam Jackson Date: Mon Dec 19 17:47:38 2011 -0500 Fix for new vgaHW ABI Signed-off-by: Adam Jackson commit 78052e0d3e28c7e6e08666d9ed2bcc64f5e93540 Author: Gaetan Nadon Date: Tue Nov 29 12:02:32 2011 -0500 DCONDPMSSet: handle error return code on "write" to avoid a warning The author of the write() system call has deemed important for the caller to check the return code. If not, the compiler issues a warning. The patch handles a bad return code from write() just in the same way as the code does for the open() calls. Signed-off-by: Gaetan Nadon commit db7155395e794eb276f853c7642f62727e29a0b9 Author: Martin-Éric Racine Date: Tue Nov 29 23:49:06 2011 +0200 README: added example of ZTV loading to EC800 xorg.conf sample. commit d072870e20c360fb0ec1baefc6abcb11a6d4687c Author: Gaetan Nadon Date: Tue Nov 29 14:20:17 2011 -0500 README: do not suggest compiling with xserver older than 1.3 This was done at one point in time by some drivers (3 that I remember) but the workarounds all have been removed since. The tarballs created by those drivers picked-up whatever code happened to be on the developer disk and was not in git. The code was not maintained and in fact did not work thereafter. http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/configure.ac ?id=84f69081abaeef8b05cafb64d3102eb2abdf9a8e Signed-off-by: Gaetan Nadon commit 2890f6c431a6de0726c6c53a800074f95d71294e Author: Martin-Éric Racine Date: Thu Nov 24 21:47:35 2011 +0200 README: added info about how to calculate arbitrary laptop modelines. commit e520739e9ce18a48df7d873de16022aec21d7d3c Author: Martin-Éric Racine Date: Mon Nov 21 22:47:23 2011 +0200 README: whitespace cleanup. commit edb6a6380e0db6be06fe89e7d73dedbca945550f Author: Martin-Éric Racine Date: Mon Nov 21 22:42:41 2011 +0200 README: harmonize x.org versus freedesktop.org as much as possible. commit 308430e8898e29ae111bf4f552f4d7554b96fda2 Author: Martin-Éric Racine Date: Mon Nov 21 22:34:26 2011 +0200 README: add info about the Geode mailing list and Bugzilla component. commit 1108f9cfac5b78fc9660174aa4df592ecd87d287 Author: Gaetan Nadon Date: Mon Nov 14 14:52:21 2011 -0500 Remove unrequired large file descriptor partial support The LFS "transitional extension" API is deprecated and is not available on FreeBSD. Large file support (64 bit) is not required on the geode 32 bit only architecture. There are some hints that the LFS transional extension API were not used correclty. The variable holding the value is held in an unsigned long rather than in off_t. The msr open call did not use the O_LARGEFILE flag and did not check for EOVERFLOW. Signed-off-by: Gaetan Nadon commit 0daee9eb57c826da120edf35c50e8947a43f19b2 Author: Martin-Éric Racine Date: Mon Nov 21 10:54:10 2011 +0200 README: a little bit of proofreading wouldn't hurt now, would it? commit d1c40f2d5baa2d964499412c7f1c443c9ee63626 Author: Martin-Éric Racine Date: Mon Nov 21 10:24:29 2011 +0200 README: added a sample xorg.conf for 1024x600 and 800x480 laptops. commit 8fc372b4e239005dda60f45737468f1e82571457 Author: Gaetan Nadon Date: Sun Nov 20 15:58:03 2011 -0500 config: fix Autoconf warnings and improve comments These changes have been done in all other video drivers. Signed-off-by: Gaetan Nadon commit 725d6ddc0b0888af9b033ccb6ce88c9800a791f9 Author: Gaetan Nadon Date: Sun Nov 20 15:35:29 2011 -0500 config: The compiler version to use is now set in XORG_DEFAULT_OPTIONS In this case "now" means a couple of years ago. All of Xorg is compiled with AC_PROG_CC_C99. It shows up in config.log as CC='gcc -std=gnu99'. The removed statement was resetting the compiler to C89 as it comes after XORG_DEFAULT_OPTIONS. Signed-off-by: Gaetan Nadon commit 40aae069bb15cda123f5e08b757ca93166e62db8 Author: Gaetan Nadon Date: Sun Nov 20 15:24:00 2011 -0500 config: remove a few dead/obsolete lines of code HAVE_XEXTPROTO_71 not used in Makefile. AC_HEADER_STD is very obsolete. AC_SUBST([XORG_CFLAGS]) is redundant. DRIVER_NAME is correctly no longer used. AC_SUBST([moduledir]) has just been moved up. Any erroneously removed statements above would result in a configuration failure. Signed-off-by: Gaetan Nadon commit fa0e88bfe00baa648ab3b1184b56f7dc5536aa21 Author: Gaetan Nadon Date: Sat Nov 19 15:33:33 2011 -0500 Move back ztv with geode driver Now we have a clean separation between CPP flags and C Flags Only the C Flags apply to both geode and ztv driver, however it is not worth doing a per target compilation. Should some flags become mutually exclusive and if we want to have both target in the same makefile, add the incompatible flag on the appropriate target, example: geode_drv_la_CFLAGS = $(AM_CFLAGS) -newCFlag and/or geode_drv_la_CPPFLAGS = $(AM_CPPFLAGS) -newCPPFlag Note that both AM_CFLAGS and AM_CPPFLAGS are picked-up by both geode and ztv driver target. Signed-off-by: Gaetan Nadon commit 03529b7b35fa8d7b5bac277d6abe1caf0557301a Author: Gaetan Nadon Date: Sat Nov 19 13:22:32 2011 -0500 Separate compiler from pre-processor options Clean-up what goes in AM_CFLAGS and AM_CPPFLAGS Use more descriptive names such that comments are not needed. Signed-off-by: Gaetan Nadon commit ac99bf2c5cdf86f039a290397614ca042a56c8db Author: Gaetan Nadon Date: Fri Nov 18 16:36:12 2011 -0500 Detect 32bit support on 64bit OS and compile with -m32 if found For gcc compiler only at the moment. The configuration reports if support is found or not, e.g.: checking if gcc supports the -m32 Intel/AMD option... yes The configuration C test relies on #include unistd.h which includes features.h which includes gnu/stubs.h which includes gnu/stubs-32.h which is missing on 64 bit system without the 32 bit library support. Tested on x86_64 AMD64 CPU with/without libc6-dev-i386 which provides 32 bit support. Remains to be tested on Geode and FreeBSD 32/64 bit. The configuration does not attempt to decide if building should proceed or be aborted. If no 32 bit support then the build will die in the assembly code as it always did before. The variable M32_CFLAGS provides the flag for the makefiles. The variable names and organization is subject to change. Signed-off-by: Gaetan Nadon commit 3021c6df08004ec9ed846fec4000d798148eeb0e Author: Gaetan Nadon Date: Thu Nov 17 19:47:10 2011 -0500 geode source: streamline whitespace and sort alphabetically No functional changes. Signed-off-by: Gaetan Nadon commit c1993fa8e5bf07bbd43b09ae2ec27c287725d81e Author: Gaetan Nadon Date: Thu Nov 17 19:21:01 2011 -0500 Remove -I linux_v26 as the directory does not exist Signed-off-by: Gaetan Nadon commit 4eaba919fccc7618aee0b2f58294e460640bedb9 Author: Gaetan Nadon Date: Thu Nov 17 12:32:55 2011 -0500 Remove unused and misleading I386ARCH configuration code The AM_CONDITIONAL I386ARCH is not used. The AC_CHECK_DECLS is misleading as it suggests there could be some i*86 system with a 64 bit architecture which is incorrect. It also provides false results on 64 bit computer. The generated HAVE_DECL_XXX are not used anyway. Signed-off-by: Gaetan Nadon commit 65275e62415ded849f9986a36ad55ca3c96dc331 Author: Gaetan Nadon Date: Thu Nov 17 12:20:13 2011 -0500 Remove -DPNL_SUP for the ztv driver Only the gx driver provide such a panel. Signed-off-by: Gaetan Nadon commit 60c3f5f7e9482d29f043504860319aeead7b9a69 Author: Gaetan Nadon Date: Thu Nov 17 09:32:24 2011 -0500 Remove duplicate warning variable and werror option Use already existing: --enable-strict-compilation Enable all warnings from compiler and make them errors (default: disabled) which, byt the way was broken as it was not implemented in geode. Use already existing CWARNINGFLAGS variable, so there is no need to define GCC_WARNINGS. Both come from util-macros version 1.4 or later. http://cgit.freedesktop.org/xorg/util/macros/tree/xorg-macros.m4.in ?id=03b04a6b5d61aafbd2705f7d29e58e0c92553a4a If you configure with a later version of util-macros you may see new warnings appear as additional flags have been added over the years. You get better support for platforms/compiler differences. Signed-off-by: Gaetan Nadon commit 5f228208cc65348e35aa24b6cddae1df19b67fa5 Author: Gaetan Nadon Date: Wed Nov 16 20:14:08 2011 -0500 Remove unrequired .s assembly files automake support Only the suffixes .s, .S, and .sx are recognized by automake as being files containing assembly code. http://www.gnu.org/software/automake/manual/automake.html#Assembly-Support Signed-off-by: Gaetan Nadon commit fc9957114875edb94cba89a4f4f0e023f2c98bfb Author: Gaetan Nadon Date: Wed Nov 16 19:47:08 2011 -0500 Remove ztv LINUX_2_6 switch and dead code The makefile defines LINUX_2_6 so the "else" code is dead. The port from kernel 2.4 is complete. Signed-off-by: Gaetan Nadon commit 100576b3a0a38da7a957969745b2cf087929c478 Author: Gaetan Nadon Date: Wed Nov 16 19:15:17 2011 -0500 Remove broken duplicate visibility configure option This was added by commit f762b456 in 2007 and has been since implemented in the server which returns it in XORG_CFLAGS pkg-config --cflags xorg-server The server also takes care of platforms and compilers being used. Currently the visibility is set twice and even if you disable it, it is still passed through XORG_CFLAGS. Signed-off-by: Gaetan Nadon commit 970d142abe2fa09b294dd2bfa860fe3bbcaa8c68 Author: Gaetan Nadon Date: Wed Nov 16 17:01:48 2011 -0500 Remove unused LINUX_2_6 macro from geode driver makefile It is used in ztv but not geode driver. In the wake of more platforms other than linux, might as well remove any source of confusion. Signed-off-by: Gaetan Nadon commit 65625eac28af7cf3164e5560478cd18aaa0ac33e Author: Gaetan Nadon Date: Wed Nov 16 15:20:07 2011 -0500 Remove HAVE__GX HAVE_LX and OPT_ACCEL from ztv build These macros are not used in z4l.c. Signed-off-by: Gaetan Nadon commit dd8eadc53732ed2929e38c565240147165767625 Author: Gaetan Nadon Date: Wed Nov 16 15:11:18 2011 -0500 Remove no longer used AMD_V4L2_VIDEO from makefiles This macro has been removed every where from source code. Signed-off-by: Gaetan Nadon commit fc19e7d2bd256663b4a731661a35abcf435eaf18 Author: Gaetan Nadon Date: Wed Nov 16 14:07:10 2011 -0500 Add a configure option to enable/disable building the ztv driver Even when V4L2 is available there are always reasons why distros may not want to build the driver. This patch uses a common idiom in xorg. When no configure option is specified ztv is built iff v4l2 is detected (auto). When user issues --disable-ztv, the ztv driver is not built (no) When user issues --enable-ztv, the ztv driver is built (yes) if v4l2 is detected but the configuration fails if v4l2 is missing. Distros do not want silent failures when a feature is explicitly requested but cannot be built. Signed-off-by: Gaetan Nadon commit 23b85b3fcd1439561f0693755a31f7fded50741b Author: Gaetan Nadon Date: Tue Nov 15 19:36:17 2011 -0500 Add conditional build for ztv Detect the presence of Video4Linux V2 and do not build if missing. The geode driver is no longer Linux only. Signed-off-by: Gaetan Nadon commit e4b771572d7b0797a794340ab8fb8b1db91a5eb1 Author: Gaetan Nadon Date: Tue Nov 15 18:02:34 2011 -0500 Move ztv driver to it's own directory The convention is to have the video driver (geode) in the src subdir and any other targets (utils, apps, other drivers) in their own directory. It makes it much simpler to right a correct makefile and to set conditional compile. This highlighted a few things to fix. For now, the directory includes have not been copied as they are required. The AM_CCASFLAGS is not required either as there is no assembler. Other than that, the gcc command issued has no differences. Other unrequired defines could be removed later. Signed-off-by: Gaetan Nadon commit 2b3767b9e424ce371c342c9c9a2f2ae1f61df1fd Author: Martin-Éric Racine Date: Sat Nov 19 02:29:20 2011 +0200 README: emphasize that "ztv" is the name of that VIP driver. commit aa7cd847d821ed639f7d18a5114a13c324f6f227 Author: Martin-Éric Racine Date: Sat Nov 19 02:17:22 2011 +0200 README: properly call the LX's video input port feature "VIP" commit 9bbc7bc49f1d04d41d7e1750b81cfce45e4ddf42 Author: Martin-Éric Racine Date: Thu Nov 17 02:15:27 2011 +0200 Added info about 'ztv' a.k.a. the V4L2 driver for LX in README. commit 9e8a766cfb458cdc791f4c4a932fe51638a8bc73 Author: Gaetan Nadon Date: Tue Nov 15 16:55:15 2011 -0500 Add gx_randr.c Copyright statement to COPYING Signed-off-by: Gaetan Nadon commit b724ff4045994fff721db4ab67f8aa418cc4f707 Author: Martin-Éric Racine Date: Mon Nov 14 08:44:32 2011 +0200 Revert "Only enable z4l.c on Linux" until we have a consensus. commit 587d4e40e58e70649968261f73b7fb2078349f4f Author: Martin-Éric Racine Date: Sun Nov 13 15:48:29 2011 +0200 Revised BSD check in geode_msr.c commit ee52d73fd2c68740b1ff3cdb5b1bf2a6d941090d Author: Martin-Éric Racine Date: Sun Nov 13 03:40:01 2011 +0200 Move the z4l.c test to src/Makefile.am where it should be. commit d193a42b3596ceb9dfaa66af71edd1f15ecc75bd Author: Martin-Éric Racine Date: Sun Nov 13 03:23:21 2011 +0200 Added two #ifdef to enable building on FreeBSD. commit ee6296ecb8bf5c9b5e7fa3eade5fa45245b66d62 Author: Martin-Éric Racine Date: Sun Nov 13 03:14:51 2011 +0200 Whitespace cleanup. commit f6745f544feeb7443405f4b87043be9b721236b5 Author: Martin-Éric Racine Date: Sun Nov 13 03:10:01 2011 +0200 Only enable z4l.c on Linux. commit f15f4da59a80533f3864aa6c54b4471e272d5c80 Author: Martin-Éric Racine Date: Wed Apr 6 22:13:09 2011 +0300 Added info about the Geode developers' IRC channel in README. commit 3c1375afdb9e1be524adae98c3713397d50e3a3e Author: Martin-Éric Racine Date: Sun Mar 13 16:17:06 2011 +0200 Proofread and restructured the README for clarity. commit 9d0986232cb417f41aee934b655cc0bbbae5f99b Author: Martin-Éric Racine Date: Sun Mar 13 15:21:31 2011 +0200 Added README section about supported resolutions. Inverted two FAQ sections so as to bring the answer about WXGA right below this new supported resolutions section. commit 8eab313cdf0cdc53ea936c7a9dd716d1000e1c56 Author: Martin-Éric Racine Date: Sun Mar 13 15:10:28 2011 +0200 Removed README note about minimal version. b9a5a86a402832fe699e43b3030932b50ae821a0 restored code compatibility with X server 1.4. commit c465e19ff53db4be42dabcfafde510f79508c531 Author: Priit Laes Date: Sun Mar 13 03:40:53 2011 +0200 Add optional composite operation fallback tracing Changing GEODE_TRACE_FALL to 1 allows to easily find the unaccelerated code paths in a given use case while working on driver performance. Signed-off-by: Priit Laes Signed-off-by: Mart Raudsepp commit 4fd7500bb16b80ea9aee8dc61c5b11e9deb8281f Author: Mart Raudsepp Date: Sat Mar 12 22:17:19 2011 +0200 Fix parameter ordering for calloc/xnfcalloc calls First argument is the number of elements and second the size of one element, not vice-versa. Signed-off-by: Mart Raudsepp commit 1a23956758d17a8b4c1d8acebf8acc94358c37b9 Author: Martin-Éric Racine Date: Sun Feb 13 21:52:55 2011 +0200 Geode 2.11.12 commit 30d46e6c28479e07ac8328b6f4dfc2692eb1ac6d Author: Martin-Éric Racine Date: Mon Feb 7 00:04:06 2011 +0000 Stop including "linux/videodev.h" in z4l.c V4L1 support was dropped as of Linux kernel 2.6.38 commit 509f6085ce7747d76f638a7a30170c437b296a40 Author: Daniel Drake Date: Sun Feb 6 20:22:01 2011 +0000 Fix packed overlay offscreen allocations Commit 5e72a00ad2 caused packed video data to corrupt glyphs and other parts of the screen, but it turns out that the commit actually at fault was d681a844e, incorrectly changing the size of the allocated destination memory from the number of bytes needed to the number of lines needed. While fixing this, I noticed that LXAllocateSurface is probably making the same mistake, and that the height is probably not calculated correctly for some corner cases when calling LXCopyFromSys in the packed video path (but I'm not sure about either). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=33004 commit 66c375d2a1d1eadb38d2cbfe2d08cfec20213cb4 Author: Martin-Éric Racine Date: Mon Dec 27 15:20:38 2010 +0200 Geode 2.11.11 commit b9a5a86a402832fe699e43b3030932b50ae821a0 Author: Priit Laes Date: Wed Dec 15 03:54:13 2010 +0200 Restoring compatibility down to X server 1.4 Signed-off-by: Priit Laes commit bae443bb46c81702a57d4914b7e56f17e5aa1f3a Author: Daniel Drake Date: Tue Nov 30 20:31:49 2010 +0000 Improve handling of gamma correction in video vs graphics The LX is a bit odd in that the palette can be used for gamma correction of graphics data, or video data, but not both at the same time. Right now, during X startup, X sets gamma correction (but without any actual correction) causing the Geode driver to start using the palette for graphics gamma correction. (this is just momentary) Later on during startup, vg_set_custom_mode() switches to using the palette for video gamma correction, and this is the end result. If you later use xrandr to change the gamma, the palette starts being used for graphics again. If you VT switch, vg_set_custom_mode (momentarily) starts using the palette for video, but then X jumps in with a gamma callback causing it to be used for graphics again. End result: no user visible bug, but this is inconsistent. As there is no exposed mechanism for changing video gamma I suggest we just drop that bit from vg_set_custom_mode(). Then the inconsistency goes away. Downside: this now becomes dependent on X setting gamma during startup. I don't know when this was introduced but I think it is recent. Aditionally, I think I found a (harmless) bug in df_set_video_palette_entry, it doesn't do what the comments say. commit 5873bfa48f1c090d224adbc7ca7df3ebea0b198f Author: Priit Laes Date: Sun Dec 12 16:17:24 2010 +0200 Fix compilation under xorg >1.9.99 Signed-off-by: Priit Laes commit 1d8d02d64e9f5d5dd3788b3b9b1b25866c2ed6b5 Author: Martin-Éric Racine Date: Fri Nov 19 17:24:35 2010 +0200 LX Panel: lower the 1024x600 refresh rate down to 60Hz. NOTE: the eCafe EC-800's panel doesn't support a higher refresh rate. commit 256356912bbc1d1e65db5c3c03c6ae25883a81fb Author: Frank Huang Date: Fri Nov 19 10:28:31 2010 +0800 Print the panel mode BIOS uses Signed-off-by: Frank Huang commit 50f9152e2087fd50dfc09e35505c2fbcdd3183b0 Author: Martin-Éric Racine Date: Tue Nov 9 11:12:44 2010 +0200 Geode 2.11.10 commit ff091333b506855c17ec8ea5f933026221600be9 Author: Martin-Éric Racine Date: Thu Oct 28 13:13:09 2010 +0300 Revert "Simplify the mode_valid function" This reverts commit fab58e111b6655602b4f739260a01247ff478f35. commit fab58e111b6655602b4f739260a01247ff478f35 Author: Huang, FrankR Date: Thu Oct 28 15:17:19 2010 +0800 Simplify the mode_valid function Signed-off-by: Frank Huang commit fb72a210d7de61c49fc66aafa057d8c6a028b907 Author: Huang, FrankR Date: Thu Oct 28 15:16:58 2010 +0800 Revise the entry for 1024x600 *Change the entry of 1024x600 from 3 to 7(That will not affect the entries from 3 to 6). And BIOS should set the VG_FP_TYPE bit[5:3] to 7. *Use 1024x600@80 instead of 1024x600@60 parameters to support more 4:3 resolutions Signed-off-by: Frank Huang commit 9caaf7f8294ef9700e9e20e394fee10cc2b1c9c0 Author: Daniel Drake Date: Mon Sep 6 18:35:17 2010 -0600 Don't power down DCON when it is frozen Putting a frozen DCON to sleep (as happens during regular boot of the XO) will cause the frozen image to be corrupted. Change the behaviour to only sleep when the DCON is not frozen. http://dev.laptop.org/ticket/10196 commit 87512b72d64370e062d209724994a72368c21df6 Author: Daniel Drake Date: Mon Sep 6 18:33:48 2010 -0600 Add get_crtc output function I don't know why X can't do this itself, but when no get_crtc method is provided, X decides that it doesn't know the CRTC of the output and decides to reset the mode completely (causing display powerdown, resulting in an uncomfortable visual interruption to OLPC's boot process). commit 5e72a00ad26f2052bb48fef041d6fbd14ba18153 Author: Hunk Cui Date: Wed Oct 13 18:26:52 2010 +0800 Allocate video memory with exaOffscreenAlloc *Del for deduct the probable size of a video overlay. *Use exaOffscreenAlloc allocate the video overlay. *Use exaOffscreenAlloc allocate the offscreen surface. *XV-video data has to be allocate in offscreen memory range. Signed-off-by: Hunk Cui commit 334534cde47f1ffe126e4e665988480fc57a7307 Author: Frank Huang Date: Wed Sep 29 16:45:56 2010 +0800 Add resolution 1024x600 support for PANEL *Users can not get 1024x600 by default when using panel without xorg.conf. Add this screen resolution to the panel_modes table to support it by default. *Users who are using VGA will get this resolution by the monitor EDID. No code is needed *Use gtf tool to get the parameters *Ubuntu bugzilla #433142 Signed-off-by: Frank Huang commit becaa0ae375e996c2f83192bb84a5c89f94933dd Author: Frank Huang Date: Wed Sep 29 16:45:42 2010 +0800 Fix a typo on resolution parameter *change from 1028 to 1280 Signed-off-by: Frank Huang commit 89c60efe899f0cda4a52e0574f030c021c4b1ece Author: Frank Huang Date: Wed Sep 29 16:35:46 2010 +0300 Mode Validation support on modeline in xorg.conf *mode validation(lx_output_mode_valid) in this driver should return MODE_OK for all modes filtered out by previous process in this function. Otherwise, new modelines(conf_modes) will be pruned by Xserver function Xf86PruneInvalidModes. The result is that the user can not set arbitrary resolutions. We comply with the code of ATI&&Intel mode_valid function to do this. *For modes that cannot be supported by the geode driver, it is better to give the specific MODE_XXX(such as MODE_CLOCK_RANGE) instead of MODE_BAD. Signed-off-by: Frank Huang commit 74e28b83d5b725a134aad264771a7c9a4d0e38df Author: Hunk Date: Sun Sep 26 18:14:52 2010 +0800 Modify rotation pitch & reallocate pixmap for bo *Modify rotation pitch value with crtc_mode_set. *Use own wrapper to allocate a pixmap for wrapping a bo. *Ubuntu Bugzilla #377929 *Debian Bugzilla #512020 Signed-off-by: Hunk Cui commit 7d7cc26011fde18dcce5c6b95cd73a12a71a7f99 Author: Otavio Salvador Date: Thu Sep 23 16:17:40 2010 -0300 lx_display: fix typo commit 90dda28842ac76a05ae75a4fdd457dd8b8988950 Author: Andres Salomon Date: Mon Sep 20 11:31:29 2010 -0700 fix the DCON verification loop for LX output This is pretty clearly a bug. This should fix it (after all, that check is merely to see if the panel is a DCON; we don't care at all about the panel bit). This also adds an extra parenthesis in the following if() statement for clarity. I'm resisting the temptation to change GeodeRec's Output member to an unsigned long (for now). Bitfields should really be unsigned. Signed-off-by: Andres Salomon commit 5dfe7dbf6ed122fbbb758be7a5b7d78a199583c7 Author: Frank Huang Date: Wed Sep 1 10:30:35 2010 +0800 Replace xalloc/xrealloc/xfree/xcalloc with malloc/realloc/free/calloc * Replace the deprecated functions with new ones Refer to "/xserver/include/os.h" Signed-off-by: Frank Huang commit fc342655a3d928759467eac8c917effe8f283031 Author: Martin-Éric Racine Date: Mon Aug 23 07:46:22 2010 +0300 Geode 2.11.9 We are pleased to announce this maintenance release of xf86-video-geode. It features a plethora of bug fixes, a few documentation updates and one performance enhancement. This release also marks the return of AMD to the development team. Please read the content of NEWS for more details. commit c77eb79ef24c47ed7431713918a731252ea8153b Author: Frank Huang Date: Wed Aug 18 15:37:18 2010 +0800 Fix the PictOpIn and PictOpOut *Correct the entry for PictOpIn, PictOpOut, PictOpOverReverse *Some code format adjustment *Delete the maskflag(temp variable) *Change the code to make the black region(More reasonable than change op from PictOpSrc to PictOpClear) Signed-off-by: Frank Huang commit 32a927b8e627b3f9759ccfbff231f5fd22445f02 Author: Frank Huang Date: Wed Aug 18 15:36:49 2010 +0800 Fix the PictOpInReverse op *Correct the entry for PictOpOverReverse and PictOpInReverse *Correct the channel reverse use, delete direction use *Add a function lx_composite_all_black to generate a all zero vectors including alpha *Modify some comments Signed-off-by: Frank Huang commit f0e24491ca676244b2fd6f2d4476e996847824cd Author: Mart Raudsepp Date: Mon Aug 16 07:09:43 2010 +0300 Fix segfault with Option NoAccel Fixes bug #27725 Breakage from commit 38e86827 commit b0a13d871d9b72da83380d4564ae947ace733b5d Author: Martin-Éric Racine Date: Sun Aug 15 18:19:00 2010 +0300 Fix a few typos in NEWS. commit 66a74e1e7ee5abde9a9eebfece126ba2fdafce9d Author: Martin-Éric Racine Date: Sun Aug 15 18:13:57 2010 +0300 Further rephrase the content of NEWS. commit fc711bc0c3b21fd11ffd1ab590122226799ee904 Author: Martin-Éric Racine Date: Sun Aug 15 18:11:43 2010 +0300 Fixes the styling of NEWS for consistency. commit 2c26c5a4399fcf04d402a973ce3da484215d3202 Author: Martin-Éric Racine Date: Sun Aug 15 18:00:41 2010 +0300 Created a NEWS file to document recent changes. commit 673d71b970a6d02449c9994e67f337d117d7f075 Author: Frank Huang Date: Thu Aug 12 15:49:53 2010 +0800 Fix the PictOpOutReverse op *Correct the entry for PictOutReverse *Outside the source picture, the pixels should be all zero when doing the PictOpOutReverse rendering with Dst *Rename the function name of pict_a8 to add_a8 *Rename the function name of opover to two_pass *Fix the bug in KDE dolphin file browser Signed-off-by: Frank Huang commit 2d1a07327ef352b5f36cbd93a280485cafeeb4d4 Author: Frank Huang Date: Thu Aug 12 15:49:36 2010 +0800 Improve the glyph rendering performance *Add a PICT_a8 entry in the format we support *Use Mart's workaround patch to give geode PictOpAdd correct pSrc and pDst format *Add a function lx_composite_onepass_pict_a8 to handle the PictOpAdd for glyph rendering *Performance for "x11perf" command under Fedora 12 Past Now -aa10text 4660/sec 53300/sec -aa24text 2740/sec 16200/sec Signed-off-by: Frank Huang commit fe6ad5942bf3d638bee2e6979f60d9d7128ba1e8 Author: Hunk Cui Date: Mon Aug 9 18:03:23 2010 +0800 Rectify lx_display.c outstanding compiler warnings *Correct the type of LXAllocShadow from Bool to static Bool. Signed-off-by: Hunk Cui commit 1f96e74919fe9442062804de785c6e1008d75bf2 Author: Martin-Éric Racine Date: Mon Aug 9 10:48:16 2010 +0300 Revert "Improve the glyph rendering performance" This reverts commit ebe43da32226eb7bc3ef758c43eff85ac8b8baef as Frank pointed out that I mistakenly committed an outdated version of this. commit 7a523acf985771b2bd45f5d2823c217cd9075b1e Author: Frank Huang Date: Mon Aug 9 10:43:27 2010 +0800 Correct two outstanding compiler warnings *Correct the type from "Q_WORD" to "QQ_WORD" in panel.c *Correct the tyep from "char" to "const char" in z4l.c Signed-off-by: Frank Huang commit ebe43da32226eb7bc3ef758c43eff85ac8b8baef Author: Frank Huang Date: Sat Aug 7 16:54:35 2010 +0800 Improve the glyph rendering performance *Add a PICT_a8 entry in the format we support *Use Mart's workaround patch to give geode PictOpAdd correct pSrc and pDst format *Add a function lx_composite_onepass_pict_a8 to handle the PictOpAdd for glyph rendering *Performance for "x11perf -aa10text" has been improved from 4200/s to 47400/s on Fedora12 Signed-off-by: Frank Huang commit 8a61ef8f9f6b9dac6804754572250e59d80bdf06 Author: Hunk Cui Date: Mon Jul 12 13:17:18 2010 +0800 Fix rotation with newer Xserver versions (exaOffscreenAlloc) *Del for deduct the probable size of a shadow buffer. *Use exaOffscreenAlloc allocate the shadow buffer. *Rotateeddata has to be allocate in offscreen memory range. *Ubuntu Bugzilla #377929 Signed-off-by: Hunk Cui commit 2bcbc0b64091218d348ad9f699370e4bfde3948b Author: Hunk Cui Date: Mon Jul 12 12:57:39 2010 +0800 Gamma Correction for fading operation *Modify integrated palette RAM for gamma-correction of the data stream *Let Graphic data passes through the Gamma Correction RAM *Special for Screensaver Operation *FreeDesktop Bugzilla #27853 Signed-off-by: Hunk Cui commit ecb741f27de4ca66555d312a4699efc22f873d0e Author: Huang, FrankR Date: Fri Aug 6 11:16:02 2010 +0800 Fix the Nautilus file browser misrendering issue This is patch 4 final this week. This one has fixed several bugs below: 1)google chrome hang 2)Some website using repeat for source picture with PictOpSrc. To sum up, right now this patch has gracefully solved the Nautilus bug and some special rendering under PictOpSrc and PictOpOver I will describe all special conditions I met Websites for test before and after this patch: 1)http://daduke.org (greater srcX and srcY) 2)http://bjdns2.cncmax.cn (negative srcX and srcY) From: Frank Huang *When the srcX or srcY is greater than source width or source height (or negative),the driver should do the correct region to render. Add a function lx_composite_onepass_special to handle this. The source start point should be calculated by a modulus operation. *If the opeartion is with a shifted position src, then adjust the operation region based on the operations src width and height parameters. The rotation condition should be excluded. This part still need investigation Signed-off-by: Frank Huang commit 5b93fdd42d7d8af4535fd62ce0749f2c4434f9fe Author: Huang, FrankR Date: Fri Jul 23 17:17:49 2010 +0800 Fix the PictOpOver operation Fix the PictOpOver operation *Fix the PictOpOver blend_ops struct. The PictOpOver operation is Src + (1-a) * Dest. So change from CIMGP_ALPHA_A_PLUS_BETA_B to CIMGP_A_PLUS_BETA_B. And add one pass operation to do the Src * (alpha of Mask) if there is a mask *Convert the source format in lx_prepare_composite if it is not ARGB32 when doing the first pass *Add a function lx_do_composite_mask_opover to handle the PictOpOver operation, the first pass is to do the Src * (alpha of Mask), the second pass is to do the Src + (1-a) * Dest. *Due to our off-screen buffer is only 256KB, so split big Mask region into several small region(256KB) to do the rendering. *Progressbar, scrollbar and button display well with this patch *See Free Desktop Bugzilla #28352 Signed-off-by: Frank Huang commit 969844d51967aa79ce2c151fc5f1bd296d74437a Author: Huang, FrankR Date: Fri Jul 23 17:17:34 2010 +0800 Fix the PictOpSrc rendering Fix the PictOpSrc rendering *Add the maskrepeat variabel to record mask picture's repeat attribute *Add the maskflag to record the exaScratch.type when it is COMP_TYPE_MASK *Use the PictOpClear to make other non-blending region(out of src or mask) to be black if the op is PictOpSrc or PictOpClear Signed-off-by: Frank Huang commit 2771fb365107976e76e175e7f8953dd41ecb91c1 Author: Huang, FrankR Date: Fri Jul 23 17:17:15 2010 +0800 Put the one pixel rendering work back to the server to handle if the pMsk is not zero Put the one pixel rendering work back to the server to handle if the pMsk is not zero *exaScratch.srcWidth and exaScratch.srcHeight are used to reocrd mask's width and mask's height if mask is not zero. So the one pixel source's width and height are missing in lx_do_composite. So we must fallback. Otherwise, bigger region will be wrongly rendered. Signed-off-by: Frank Huang commit e9effca821c1d604aeffeb3d3e7a49539485117d Author: Daniel Drake Date: Thu Aug 5 08:08:06 2010 +0300 http://lists.x.org/archives/xorg-driver-geode/2010-August/000938.html https://bugs.freedesktop.org/show_bug.cgi?id=29391 LXCopyFromSys currently is hardcoded to operate on 16bpp data. And indeed, when working with packed data (e.g. YUY2), this is the case. However, it is also used from LXCopyPlanar to copy the planes of I420 images. In this case, it is on an 8bpp input plane. Running at 16bpp causes twice as much data to be copied, and ultimately causes a buffer overflow leading to crashes such as http://dev.laptop.org/ticket/10260 Fix this by deriving the BPP from the input image parameters. commit f0df6821c454d2b174a071fd846b399e8c2f98f5 Author: Martin-Éric Racine Date: Sun Jul 11 21:28:49 2010 +0300 Rephrased the FAQ about video rotation to NOT specify a minimum RAM size. commit f21fb29dbe54e7a237047920a00632752a970da1 Author: Frank Huang Date: Mon Jul 5 16:49:05 2010 +0800 Correctly calculate the rendering region with the mask picture If the opeartion is with a shifted position mask, then adjust the operation region based on the operations mask width and height parameters(instead of clipping based on source width/height) Signed-off-by: Frank Huang Acked-by: Mart Raudsepp commit d8baf45eb79e473fba68b8335b6aaca27df681cf Author: Martin-Éric Racine Date: Wed Jun 23 00:41:53 2010 +0300 Added square braces to all AC_INIT elements. commit 2d377782abc64281b5fa44825d541a1541b19a10 Author: Jamey Sharp Date: Tue Jun 22 08:36:40 2010 -0700 Use new server API to find the root window. Signed-off-by: Jamey Sharp commit 14b1561dac796c6ad05648e6857028a87acde9ef Author: Jamey Sharp Date: Tue Jun 22 08:30:52 2010 -0700 Adapt to DevPrivate API changes. This allows the driver to be built against either the old or new DevPrivate API. Signed-off-by: Jamey Sharp commit b47d77360cb428d8892beb93789c83dfa681b26f Author: Martin-Éric Racine Date: Mon Jun 21 07:44:31 2010 +0300 Added FAQ about minimal memory requirements to rotate screen in README. commit 42481a36f92cf79c76fea229b5143c4fbdea444a Author: Mart Raudsepp Date: Mon Jun 14 02:34:20 2010 +0300 lx_exa: fallback in case of server-side gradients and solid fill RENDER extension version 0.10 added support for doing server-side gradients and solid fills, which we were not handling at all. cairo-1.9 started making use of server-side gradients, and we are crashing on those, as the source pixmap (pxSrc in lx_prepare_composite) doesn't have a drawable in this case, and we were not expecting such a possibility. So, as the first measure, fallback (three years late) all server-side gradients and solid fills instead of crashing, until we have no code that tries to accelerate cases of these or aren't sure if we even can accelerate any cases. pSourcePict member was added to xserver in 2005, so no compatibility wrapping needed. Signed-off-by: Mart Raudsepp Acked-by: Otavio Salvador commit b46d4ff787bce43409d59837d736af0be2b0dda5 Author: Frank Huang Date: Sun Jun 13 18:47:12 2010 +0800 Prevent the pixmap migration if the geode GP can not do the acceleration. Bring all the "return FALSE" condition forward from lx_prepare_composite to lx_check_composite. The Xserver will handle this condition. See more on Freedesktop Bugzilla #27243 Signed-off-by: Frank Huang Acked-by: Mart Raudsepp commit 8e53a62f196dfc4eb1e8769183b00bf4a3122ddc Author: Martin-Éric Racine Date: Sun Jun 13 03:24:20 2010 +0300 Clean up and indent the content of COPYING for better clarity. commit 4302f6961571609a2b8a27a2d21281f758f48f0d Author: Martin-Éric Racine Date: Sun Jun 13 03:19:18 2010 +0300 Move the AMD-specific part of the license away from the boilerplate text. commit 83b8249d91c7bf351f44062b5e42d12b0b8c9a28 Author: Martin-Éric Racine Date: Sun Jun 13 03:15:09 2010 +0300 Removed superflous duplicate license from COPYING. commit 854323a434b8fc7b980387f52dc8c80258ca9b64 Author: Gaetan Nadon Date: Sat Jun 12 15:48:05 2010 -0400 COPYING: update Copyright notices from the source code Signed-off-by: Gaetan Nadon commit e9447f5335681a78cf87ebf8c9659a6fecfc9746 Author: Otavio Salvador Date: Wed Sep 9 22:13:40 2009 -0300 LX: validate display modes To avoid using virtual desktop by default we now validate the display modes. Signed-off-by: Otavio Salvador commit 3a0e9730634f6894ef57793ae6e072656cd125f0 Author: Otavio Salvador Date: Sat Oct 10 11:54:53 2009 -0300 cim: add a new 106.50MHz entry commit 527e3763343b736e0d9f7a1c7d55a51366bfdc36 Author: Otavio Salvador Date: Sat Oct 10 11:53:46 2009 -0300 cim: properly indent 341.349MHz entry commit 2f26fd4cc583aa07e31aa3c8edb975ace9bf31eb Author: Adam Jackson Date: Tue May 18 13:07:18 2010 -0400 Remove mibank.h reference Signed-off-by: Adam Jackson commit cf69c8bde21ee383b471ca82d70c179dfaf78722 Author: Nicolas Boullis Date: Mon May 10 07:39:20 2010 +0300 Correctly set the name for the user-specified panel mode. commit db01a594ac30c730c580bcf9323220b83eb8ce03 Author: Martin-Éric Racine Date: Thu Apr 15 16:36:43 2010 +0300 Geode 2.11.8 commit a4b8389e50ea92fe361d96da6fe1c2d7caf39a02 Author: Mart Raudsepp Date: Mon Apr 12 08:53:11 2010 +0300 lx_exa: bail earlier (in CheckComposite) for non-alpha-only masks. We should have all the information at CheckComposite already, so don't waste time migrating pixmaps for this case, only to fail in PrepareComposite. Currently more importantly this workarounds EXA fallback failure in xserver-1.7+ for this situation, which resulted in many desktop icons not getting rendered; bug #27243 commit 46679d0220c8d34bdd46433bffc490c971783ab9 Author: Gaetan Nadon Date: Fri Mar 26 08:56:56 2010 -0400 make: use AM_CPPFLAGS rather than DEFAULT_INCLUDES DEFAULT_INCLUDES is computed by Automake and should not be overwritten. -I. is the same as -I$(srcdir) The generated DEFAULT_INCLUDES = -I. -I$(top_builddir) Signed-off-by: Gaetan Nadon commit 621de3bf4966b48532ae2bff5f3859a1a6d63241 Author: Martin-Éric Racine Date: Thu Feb 11 19:56:10 2010 +0000 Bump the minimal autoconf version to 2.59. commit f67c4f57c06ce4800f2929f65f88b65e22499a65 Author: Martin-Éric Racine Date: Thu Feb 11 21:38:59 2010 +0200 Bump the minimal xutils macro version to 1.4, as agreed with Gaetan Nadon. commit 10364d0f667c808641d62339c99564b401683612 Author: Martin-Éric Racine Date: Mon Feb 8 18:43:27 2010 +0200 Get rid of unused XFreeXDGA extension. commit ba9e3975535ffdf05611e96feb578eb01c49544d Author: Martin-Éric Racine Date: Wed Feb 3 21:09:53 2010 +0000 Geode 2.11.7 commit 755b08bd59a5ff968040d657401c0779ba7828d0 Author: Otavio Salvador Date: Sat Oct 3 14:46:52 2009 -0300 GX: refactory mode validation code to be easier to ready Signed-off-by: Otavio Salvador commit 7f044dc2569ddf4328649d857023b7c418f9b1df Author: Otavio Salvador Date: Sat Oct 3 16:01:31 2009 -0300 LX: fix typo in panel supported modes Signed-off-by: Otavio Salvador commit 52f14e87edf564faa475063f44e8ee5adb4e1368 Author: Otavio Salvador Date: Fri Oct 2 00:21:01 2009 -0300 gfx: document panel related methods available Signed-off-by: Otavio Salvador commit 5798991e7a4d2354e9735f91f8d60f436c6549ab Author: Otavio Salvador Date: Sat Oct 3 16:41:14 2009 -0300 geode: fix typo in AmdPciProbe commit 93f0303f79ce29e896e4817e945709c6a1d3df69 Author: Christian Bühler Date: Sat Dec 19 18:59:00 2009 +0200 Geode LX does not support PanelGeometry Hello, I believe I found an error in the README, which caused quite a lot of confusion for me. According to the source, PanelGeometry is only supported by the GX, not by the LX, but in the README file, this option is listed on both. Regards, Christian commit ab9e8fec5e2f2e0ab35890d8102663991d40b4e4 Author: Gaetan Nadon Date: Tue Dec 15 22:01:02 2009 -0500 configure.ac: remove unused sdkdir=$(pkg-config...) statement The sdkdir variable isn't use, so remove the statement. Acked-by: Dan Nicholson Signed-off-by: Gaetan Nadon commit a63b523ea694f2badf79827632fb7f0ee8cc1609 Author: Gaetan Nadon Date: Mon Nov 23 09:24:32 2009 -0500 Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES Now that the INSTALL file is generated. Allows running make maintainer-clean. commit 58ecaae19472206fd3c642886c787297e6c423d7 Author: Gaetan Nadon Date: Thu Nov 19 13:45:23 2009 -0500 Revert "Makefile.am: do not include autogen.sh in distribution #24183" This reverts commit c77803368611751f828c1cc7b00e77157b7774b3. commit d39754d3cd76fbc4eca5eb199bbe67db5e25eee8 Author: Gaetan Nadon Date: Wed Oct 28 14:41:41 2009 -0400 INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206 Automake 'foreign' option is specified in configure.ac. Remove from Makefile.am commit 29f57f0b92a783f0e1a520b6cf0a6cd211fd9c5f Author: Gaetan Nadon Date: Wed Oct 28 14:09:09 2009 -0400 INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206 Add missing INSTALL file. Use standard GNU file on building tarball README may have been updated Remove AUTHORS file as it is empty and no content available yet. Remove NEWS file as it is empty and no content available yet. commit 8159be49ec768130c47426b669d7491ebdeb288b Author: Gaetan Nadon Date: Mon Oct 26 12:54:21 2009 -0400 Several driver modules do not have a ChangeLog target in Makefile.am #23814 The git generated ChangeLog replaces the hand written one. Update configure.ac to xorg-macros level 1.3. Use XORG_DEFAULT_OPTIONS which replaces four XORG_* macros Update Makefile.am to add ChangeLog target if missing Remove ChangeLog from EXTRA_DIST or *CLEAN variables This is a pre-req for the INSTALL_CMD commit 530f29b38408319e4bd9689e4a1309055644c4a2 Author: Gaetan Nadon Date: Thu Oct 22 12:34:16 2009 -0400 .gitignore: use common defaults with custom section # 24239 Using common defaults will reduce errors and maintenance. Only the very small or inexistent custom section need periodic maintenance when the structure of the component changes. Do not edit defaults. commit c77803368611751f828c1cc7b00e77157b7774b3 Author: Gaetan Nadon Date: Sun Sep 27 16:33:51 2009 -0400 Makefile.am: do not include autogen.sh in distribution #24183 This is a private build script that should not be distributed commit 1cdb69f2ed0efff76edf90d62ffed72fe65108f5 Author: Martin-Éric Racine Date: Sun Sep 27 14:57:18 2009 +0300 Geode 2.11.6 commit a504725d2250e663f0a275fd0c02cc849dafe792 Author: Martin-Éric Racine Date: Sun Sep 27 14:55:25 2009 +0300 Revert "LX: validate display modes" This reverts commit 3af472f4453f8e92a9f303e64e2796836374d980. This commit had broken detection of arbitrary non-VESA resolutions, which affected the OLPC XO-1 and a number of Geode-based notebooks. commit 1b1092b11a686febfd3ee20bd18677fcc366faa5 Author: Martin-Éric Racine Date: Tue Sep 22 16:41:59 2009 +0300 Geode 2.11.5 commit 3af472f4453f8e92a9f303e64e2796836374d980 Author: Otavio Salvador Date: Wed Sep 9 22:13:40 2009 -0300 LX: validate display modes To avoid using virtual desktop by default we now validate the display modes. Signed-off-by: Otavio Salvador commit 6ff8735b25da03f432b755391000bbfe2253b60c Author: Otavio Salvador Date: Tue Sep 8 21:53:49 2009 -0300 GX: refactor code that allow backward compatibility with old video interfaces Most of dependent code is now located in a single place. The macro has been changed to use a cleaner name to be easier to spot why it is needed. Signed-off-by: Otavio Salvador commit 292df8af92d5295c4be1ab0b3ad630a09589eb55 Author: Martin-Éric Racine Date: Fri Sep 18 10:04:38 2009 +0300 geode: further precised brand names of Geode variants by NSC in README. commit 869a93c00ce2e9fe739239b4481b5c98e4df9092 Author: Martin-Éric Racine Date: Fri Sep 18 09:26:25 2009 +0300 Geode: corrected the product names in README. commit 9184997ac2bf08841f1a40ebf416e49b44d71ff4 Author: Martin-Éric Racine Date: Fri Sep 18 09:15:25 2009 +0300 geode: Added the PCI vendor and device ID of NSC SC1400 to README. commit 651310328e3cfc5c4936cf5df1dcaf7d319d20f6 Author: Martin-Éric Racine Date: Wed Sep 9 19:47:14 2009 +0300 Switch project URL in README to read-only www host. commit f6039ef1bc9962caf18a3abb15c7f627ffc6158a Author: Otavio Salvador Date: Wed Sep 9 06:00:00 2009 +0300 geode: use lowercase vendor id commit 50b44451c6462bf999e8899715377dd735bc8940 Author: Martin-Éric Racine Date: Wed Sep 9 00:06:44 2009 +0300 Added extended info about which Geode driver covers what Geode variant in README. commit 7af63b86ab9e06b9ccdf1291250afa303b69a885 Author: Martin-Éric Racine Date: Sat Sep 5 01:47:11 2009 +0300 Fixed a typo in src/lx_output.c debug message. commit 999d1ef343c65ac2324ac1e9c2e72f014cb5610d Author: Martin-Éric Racine Date: Thu Sep 3 10:56:09 2009 +0300 Added README about X server dependency bump due to GX Randr dixSetPrivate fix. commit feea2a0afa67c8be1d1afd743ab45745878c1c91 Author: Martin-Éric Racine Date: Mon Aug 31 23:28:31 2009 +0300 Release 2.11.4.1. commit f1268f3ba8404129d358db3bb1e66f3841f7018a Author: Martin-Éric Racine Date: Mon Aug 31 23:24:30 2009 +0300 Fixed typo in GX2 dixSetPrivate patch. Kudos to Eamon Walsh! commit 34405a9c5cb0c30d45c12ef6850fc636a964e441 Author: Martin-Éric Racine Date: Fri Aug 28 11:21:57 2009 +0300 Release 2.11.4. commit 255c0b985731350fdfd38987a95310e72f4e5381 Author: Otavio Salvador Date: Tue Aug 18 07:30:33 2009 -0300 GX: use XAA by default. EXA support is broken for GX so we disable it for now. commit ef3fbd7bd03fa4a9ff966a373ba8ddec94ea8ff5 Author: Martin-Éric Racine Date: Tue Aug 18 14:11:07 2009 +0300 Revert "GX: use XAA by default." This reverts commit 09ddb88781bc9ec12531414beabd95e50237fdd5. Otavio just sent me a nicer version of this patch. commit 09ddb88781bc9ec12531414beabd95e50237fdd5 Author: Otavio Salvador Date: Tue Aug 18 07:30:33 2009 -0300 GX: use XAA by default. commit b28abde0276ddd7f687242f3886f98b0e49a7fc2 Author: Otavio Salvador Date: Fri May 22 20:40:16 2009 -0300 Fix GX RandR to properly use dixSetPrivate. Signed-off-by: Otavio Salvador commit 917a5bf5fdadac1a8799336aa8da2e51f8790eea Author: Martin-Éric Racine Date: Tue Aug 4 21:33:12 2009 +0300 Migrated the project URL to the new http://wiki.x.org/wiki/GeodeDriver commit c2141752ed4520af6d7f5197fcb0c512058db839 Author: Martin-Éric Racine Date: Tue Aug 4 21:00:24 2009 +0300 Somewhat harmonized the README between xf86-video-cyrix, xf86-video-nsc and xf86-video-geode. TODO: * Rename http://wiki.x.org/wiki/AMDGeodeDriver to http://wiki.x.org/wiki/GeodeDriver and install a redirect from the old page. commit b5419c47138e9a8efc5f946fd08c4488dedcb5ee Author: Martin-Éric Racine Date: Wed Jul 29 13:57:15 2009 +0300 Added missing development dependencies (X.org macros) to FAQ. commit c088a8dc4e5a37d8e07766c0c26ebc11037407c0 Author: Martin-Éric Racine Date: Wed Jul 29 12:23:46 2009 +0300 Added FAQ about building drivers from GIT for testing purposes. commit a3788ff318f57f64d7317eeaee4d64a466f3745a Author: Martin-Éric Racine Date: Wed Jul 29 02:35:04 2009 +0300 Added FAQ about submitting patches and producing useful backtraces. commit cab8435d8aef852c4cb1ab71285fa020dcbd7a68 Author: Dave Airlie Date: Tue Jul 28 15:22:40 2009 +1000 geode: change to using ABI version check commit a22b16c0dc757c940461f26bc6e1802b53e860c5 Author: Dave Airlie Date: Tue Jul 28 13:32:29 2009 +1000 geode: update for resources/RAC API removal commit 810dd8f15c40271b75bb8a124709eadb5e4c36a8 Author: Dave Airlie Date: Tue Jul 28 10:06:20 2009 +1000 geode: switch to using correct pci config interface commit 9fd00d01cacae9724649699bf8e0af1e16dbe356 Author: Gaetan Nadon Date: Wed Jul 15 16:01:37 2009 -0400 Use XORG_CHANGELOG macro to create ChangeLog. #22611 Adding the macro in configure.ac and use it in Makefile.am Refer to: https://bugs.freedesktop.org/show_bug.cgi?id=22611 Global maintenance on all modules Signed-off-by: Peter Hutterer commit df4745e5565b98cea278f33001f38a64e027e4ce Author: Peter Hutterer Date: Thu Jul 16 11:37:34 2009 +1000 Update to xextproto 7.1 support. DPMS header was split into dpms.h (client) and dpmsconst.h (server). Drivers need to include dpmsconst.h if xextproto 7.1 is available. Signed-off-by: Peter Hutterer commit 3d9dd15cf30832bdb467e8fe02327f474e1e2130 Author: Chris Ball Date: Fri Jun 19 09:51:28 2009 -0400 Release 2.11.3. Signed-off-by: Chris Ball commit 26bd1287ef4f9e63f4e3722f21c168db3d55099e Author: Dave Airlie Date: Wed Jun 10 14:18:12 2009 +1000 geode: add inputstr.h include explicitly. commit 1bfde92b1e2c1a386b679b67f1901a57623db633 Author: Adam Jackson Date: Thu May 28 14:56:22 2009 -0400 Remove useless loader symbol lists. commit 106c341c4076f7714cd67e0fcf5942a22554c8f3 Author: Martin-Éric Racine Date: Mon May 25 23:28:17 2009 +0300 Cleaned up the FAQ about WXGA modes. commit 60f37744b09fa1cdf4a3bcfa1a039ac8c984b942 Author: Martin-Éric Racine Date: Mon May 25 17:51:34 2009 +0300 Added a FAQ about disabling Panel in BIOS to enable WXGA modes. commit 639e9c88e588cae55698cfb4063f625c38224afb Author: Otavio Salvador Date: Sat May 23 05:52:13 2009 +0800 Fix GPIO BAR detection with libpciaccess This patch fixes an issue with the GPIO BAR detection. Basically, with libpciaccess we're finding the ISA device and checking its BARs, but we're not bothering to fill in the BAR information via pci_device_probe. This results in a 0'd out bar and: (EE) GEODE(0): Could not find the GPIO I/O base Signed-off-by: Otavio Salvador Signed-off-by: Andres Salomon Signed-off-by: Chris Ball commit 54303b269f1efe04a80177dbb62d7b94882ff45d Author: Chris Ball Date: Tue May 12 00:05:07 2009 -0400 Release 2.11.2. Signed-off-by: Chris Ball commit b172617909976c4a7d8f05191e23e4647c1a1c96 Author: Kyle McMartin Date: Mon May 11 23:58:57 2009 -0400 Crasher fix: Use ExaDriverAlloc() to calloc the EXA struct. Patch from Kyle McMartin. A recent exa/exa.c commit from Dave Airlie (02ae85c4..) added a new member to the EXA struct, and corresponding code to call it if it's non-NULL. We were using calloc with sizeof() that struct at driver-compile-time; as a result, after the ABI change the new member contained garbage, passed the EXA test for NULL, was called, and segfaulted at startup. RH bug https://bugzilla.redhat.com/show_bug.cgi?id=500086 Signed-off-by: Chris Ball commit 23e62499a5ecfd9c70db00c181a4801d4898fe83 Author: Chris Ball Date: Fri Feb 27 10:53:11 2009 -0500 Revert EXA 3 build fix. The EXA developers have backed out the ABI bump to version 3. Signed-off-by: Chris Ball commit 7ce365dafcbeb549fa083b8115475d5b7b01a704 Author: Chris Ball Date: Tue Feb 24 22:26:39 2009 -0500 Build fix: Include config.h earlier geode.h includes exa.h, without anything having included config.h (which sets the EXA major version) beforehand; add config.h to geode.h. Signed-off-by: Chris Ball commit 2c293240f8003b3a52121161d0b0464100fd990d Author: Chris Ball Date: Tue Feb 24 12:51:45 2009 -0500 configure: use AC_DEFINE instead of shell substitution (This is just cosmetic.) Signed-off-by: Chris Ball commit c5c7f60b577cc86a670bedea2bd70bd05d5cd128 Author: Chris Ball Date: Tue Feb 24 11:46:20 2009 -0500 Build fix: set EXA_DRIVER_KNOWN_MAJOR=3. We don't use {Prepare,Finish}Access, and: /home/cjb/xorg-build/include/xorg/exa.h:45:2: error: #error Make sure this EXA driver either does not have Prepare/FinishAccess hooks or that they can handle EXA_PREPARE_AUX*, and #define EXA_DRIVER_KNOWN_MAJOR 3 before including exa.h Signed-off-by: Chris Ball commit da07a540db2078e00e48897b52a5a1f6d283cfeb Author: Chris Ball Date: Mon Feb 16 13:37:03 2009 -0500 Release 2.11.1. Signed-off-by: Chris Ball commit 4176e9ed24e7b79cefe3e7f4f5d73c7353781f1b Author: Chris Ball Date: Mon Feb 16 13:41:48 2009 -0500 Makefile.am: use "git log" instead of "git-log" "git-log" doesn't work on my Fedora machine, but "git log" should work everywhere. Some distributions choose not to ship all the git aliases. Signed-off-by: Chris Ball commit 990ff710c6220cc3d1ba6b9e8fb972bd168b4472 Author: Chris Ball Date: Sun Feb 15 15:30:09 2009 -0500 Change OLPC detection heuristic to one that works on upstream kernels We've been checking whether we have a DCON/are on an OLPC by looking for files from the "olpc_dcon" kernel module. This module isn't upstream yet, so this only works for the OLPC custom kernel. We might as well check for an OLPC kernel module that *is* upstream, so that we can run on unmodified distributions. This patch moves us to checking for "olpc-ac" instead. Signed-off-by: Chris Ball commit e33dc807bf4504ba242cb19ce8024cdb32e10f4d Author: Chris Ball Date: Sun Feb 15 00:17:45 2009 -0500 Fix pMsk=NULL segfault at startup on OLPC Commit 7c278551c79d7a5898c627341f58fad59b7ae20d uses pMsk without testing for non-NULL, and this causes an immediate segfault when running Sugar. Signed-off-by: Chris Ball commit 7c278551c79d7a5898c627341f58fad59b7ae20d Author: Mart Raudsepp Date: Fri Jan 9 19:32:50 2009 +0200 Fallback in case of mask transforms as well. Fixes attachment #21519 test case on bug #15700, but not the initial report. Detective work by Michel Dänzer. Signed-off-by: Mart Raudsepp commit 0e65d77a636848b6bc24518d8e45aed506122b49 Author: Jordan Crouse Date: Tue Dec 9 20:54:20 2008 -0700 2.11.0 release commit 2a36083f3cb93bd4ab456024d6b6776725085904 Author: Andres Salomon Date: Thu Dec 4 22:41:59 2008 -0500 xf86-video-geode: after reloading cursors, hide the cursor Whenever we reload cursors, the geode driver needs to call hide_cursor() to ensure that the cursor is hidden until we finally unhide the cursor. Without this, we see ghost cursors during rotation or VT switches. Signed-off-by: Andres Salomon commit fb2c1af124a56f34c4212bba16e1926889104cb4 Author: Andres Salomon Date: Thu Dec 4 21:33:22 2008 -0500 xf86-video-geode: fix up cursor size (again) The geode hardware (and cimarron) expects cursor memory size to be 48x64, and cimarron will zero out the excess when a smaller cursor is used. It would be nice to be able to use the full cursor size, but xorg's interleaving stuff requires a cursor width that's a multiple of 32. Thus, we're stuck back at 32x32 for cursor size, but we allocate enough memory for a 48x64 cursor. This fixes misc interleaving corruption that we see with 2bpp cursors (when converting to ARGB). Signed-off-by: Andres Salomon commit 356dec75b96e7b235632bb8c5f7cc70002a590b1 Author: Paulo Cesar Pereira de Andrade Date: Thu Dec 4 02:24:42 2008 -0200 Ensure symbol GXRandRSetConfig is of public visibility. Symbol is referenced via LoaderSymbol(), and this patch doesn't should provide the same behavior as when compiling with public symbols by default. commit fe7ede0c073bd8dc22f61388b8a5d83f17696113 Author: Andres Salomon Date: Wed Nov 26 17:56:14 2008 -0500 xf86-video-geode: change cursor size to match cimarron When we use ARGB cursors and rotate the screen, we get double cursors and stale cursor data left over. This is because cimarron expects a cursor that is smaller than or equal to 48x64, but hardcodes a memory shift of 192 bytes (4*48). This means that if we have a 32x64 cursor, cimarron screws it up. Change the cursor size to 48x64. Signed-off-by: Andres Salomon commit 8080f7a01cf62a13c5a32013668b2796c23d97a4 Author: Andres Salomon Date: Wed Nov 26 01:39:28 2008 -0500 xf86-video-geode: DCON: set the default (physical) screen size if we detect a DCON We can be assured that a DCON device has an OLPC panel that's 152x114 mm. This adds fields to GeodeRec to allow other panels to potentially override physical width/height fields, and also allows xorg.conf to override the values. Signed-off-by: Andres Salomon commit f57f2bd7161d4a7c2ededfc43a7709fb06213b99 Author: Jordan Crouse Date: Tue Nov 25 11:36:03 2008 -0700 LX: Set default scaling coefficients Systems without a traditional BIOS may not have the default scaling coefficients set up - make sure that we force them on when the mode gets set. commit d7f73aca763eb2fa918c3e5a27e264aa14f653d1 Author: Alan Coopersmith Date: Wed Nov 19 12:06:06 2008 -0800 include instead of Solaris defines errno itself in commit fa38cc225ef39aeb6a2ab1c90a233b285d4c77f8 Author: Jordan Crouse Date: Tue Nov 18 20:07:53 2008 -0700 LX: Put back variable needed when PCIACCCESS is defined commit c4142d3a05e4b889f7933dcfa8bc9cd744ccfdd6 Author: Jordan Crouse Date: Tue Nov 18 15:41:58 2008 -0700 LX: Make the version in configure.ac reflect the upcoming release commit cf0655edbcbd3910c12c33d8c786cc72c0242786 Author: Jordan Crouse Date: Tue Nov 18 15:41:58 2008 -0700 LX: Change the way EXA memory is allocated Change how EXA memory is allocated to better allow for EXA + video + rotation to co-exist on the system. Change the video to only allocate memory when it needs it. Also, automatically disable compression when there is less then 16Mb of memory. commit ee23fd75f5eb4447ca238694cc03fcdc219ee245 Author: Jordan Crouse Date: Tue Nov 18 15:41:58 2008 -0700 LX: Fix the memory allocated by the video so it fails when there isn't enough memory. commit aac2e161818494b88677f11115bca890a552c709 Author: Jordan Crouse Date: Tue Nov 18 15:41:58 2008 -0700 LX: Fix a bug in the memory allocator commit fc772694ec04f729b5a1cdced7f33dc406c1d67f Author: Andres Salomon Date: Tue Nov 18 14:14:17 2008 -0500 DCON: Mark 1200x900 mode as preferred. commit 1e3fcaaa67dde12a658206f3b0fd07b627a3b61b Author: Jordan Crouse Date: Tue Oct 7 13:12:19 2008 -0600 geode: Move the hardware cursor support to full ARGB mode commit f66c9d1928ec9bcde57009c7263f6c8575ad0d0c Merge: 85d2103 62d2b0e Author: Jordan Crouse Date: Wed Sep 10 17:33:30 2008 -0600 Merge branch 'randr12-branch' Conflicts: src/geode_ddc.c src/gx_randr.c src/lx_randr.c src/lx_rotate.c commit 85d2103a90e6ab422246b66d252dbee19c96a0d7 Author: Jordan Crouse Date: Mon Sep 8 15:20:51 2008 -0600 XINPUT_ABI bumped on us and broke the previous evil workaround for the miPointerPosition issue. commit 62d2b0ede08042147ca528be9ab1e392886a10ff Author: Jordan Crouse Date: Thu Sep 4 17:43:32 2008 -0600 LX: RandR 1.2 updates for Lenny Fix some build issues for Lenny and make the branch work on an XO running Lenny. commit 526da8a3b279dbfc35505ebb1ddc4b8db8dc46d3 Author: Jordan Crouse Date: Thu Aug 28 16:59:41 2008 -0600 LX: Fix a possible segfault in EXA Avoid passing a null pointer to PictureTransformPoint commit c6339a360b611514155e5101dc2c5bc6472d8865 Author: Jordan Crouse Date: Mon Aug 25 11:34:36 2008 -0600 [LX] - RandR 1.2 updates Remove a flag that was making EXA pixmaps break horribly. Also, Make the new code compile for Hardy and warning cleanups. commit 38e868271bd24be7a884c8c56772b25cd6fa6f1d Author: Jordan Crouse Date: Mon Aug 18 14:19:34 2008 -0600 lx: Add rotation for Randr 1.2 + cleanups Enable rotation through RandR 1.2 and add the accelerated rotation blit the EXA composite function. Also, fix a handful of critical bugs and remove some more dead code. commit f8a09702f0905d45a03cc71ae67767b7effc1500 Author: Adam Jackson Date: Fri Aug 15 14:25:00 2008 -0400 s/XF86_VERSION_CURRENT/XORG_VERSION_CURRENT/ commit b06f75895b6363816bf88402a233800631718f4d Author: Martin-Éric Racine Date: Fri Aug 15 14:13:12 2008 +0300 Bump to version 2.10.1 and release. commit 6908dda7ac66cbe13737db6c9c3e5ebe16156099 Author: Martin-Éric Racine Date: Wed Aug 13 09:51:23 2008 +0300 Added info about the current roadmap. commit 89c6a947f31af15a8f65706de328300ea2e75f1a Author: Martin-Éric Racine Date: Wed Aug 13 09:32:21 2008 +0300 All your typos are belong to us!!! commit 4e95ee76d47982450ec112988adb2079658bb682 Author: Martin-Éric Racine Date: Wed Aug 13 09:25:49 2008 +0300 Updated the README with the URL of the Geode X.Org wiki and with info on the current Build Dependencies. commit 316e89aa58f4d7f3cb4513a6decb035e99abc7d6 Author: Jordan Crouse Date: Thu Aug 7 14:29:50 2008 -0600 Geode: Add DDC support for the CS5535 commit f89f6d8004a0ae0ae7826f72a1058d26e9e0217a Author: Jordan Crouse Date: Thu Jul 24 10:47:57 2008 -0600 lx: Fix rotate issue EXA pixmaps are now protected against outside intrusion, so use a different way to find the base of the shadow buffer for rotation. commit d681a844e448712a9a419d2a4dca81930d39a80a Author: Jordan Crouse Date: Thu Aug 7 11:21:48 2008 -0600 [LX] - Add RandR 1.2 support A wholesale update to Randr 1.2 for LX accompanied by massive cleanup. commit e98927f2c60acd9262cfb6fca2491fe0decc7aa5 Author: Jordan Crouse Date: Fri Jun 13 15:59:44 2008 -0600 Bump to version 2.10.0 commit 2fc546c0d129fe7d3edee6b0cbfd530de33e2209 Author: Jordan Crouse Date: Tue Jun 10 12:08:53 2008 -0600 geode: Bring over the DCON detection code from the OLPC tree commit 489546dfd2dd295db63f31e123b0073a6fa330a9 Author: Jordan Crouse Date: Tue Jun 10 12:08:52 2008 -0600 geode: Unmap the PCI memory when we close the screen commit 739eb15da7bb0d2ca681eeb9a308b1297ee4eca7 Author: Peter Hutterer Date: Wed May 28 11:13:54 2008 +0930 Fix build for git-master (missing device pointers). We don't have an updated Video ABI yet, so use the XINPUT ABI as check for when to use which call. Note that the check is not optimal. We only check for the position of the VCP, not of any other device to adjust the viewpoint. This needs to be fixed. commit 5186a2b736e30b7d68a75f861f51047491182e57 Author: Peter Hutterer Date: Wed May 28 10:54:09 2008 +0930 Revert "Fix build (missing device pointers)." Silly me, this breaks the build for non-git-master servers. This reverts commit 3005e9c7eb10e212c956e87b3631548e268c794e. commit 3005e9c7eb10e212c956e87b3631548e268c794e Author: Peter Hutterer Date: Wed May 28 09:25:06 2008 +0930 Fix build (missing device pointers). miPointerGetScreen, miPointerGetPosition and pScreen->SetCursorPosition all require a device argument now. For lack of other choices, just pass in the VCP. commit 94b9029e335ddbe7c22a8fe4bf69858b75179219 Author: Martin-Éric Racine Date: Wed May 7 22:35:23 2008 +0300 Making libDDC support the 2.9.0 release. commit 61663593475f61567466c105ca19d5009a4e9c41 Author: Jordan Crouse Date: Tue Apr 15 14:54:57 2008 -0600 geode: Add "native" DDC parsing to the Geode driver Teach libDDC to access the DDC pins on the Geode natively, instead of using the BIOS which has proven to be broken time and time again. commit 401a7ed390beca4d37121575e64b72969d55fa7c Author: Jordan Crouse Date: Tue Apr 1 13:41:48 2008 -0600 geode: Bump to new version and replace two instances of the old amd name commit e93660928499f963d477720b628a05e8d14ea197 Author: Jordan Crouse Date: Fri Mar 14 16:38:21 2008 -0600 amd: Missed a merge artifact - kick me in the head for breaking tinderbox commit c42454a5d1fba9dc0ef4d671cb839108ef827ec9 Author: Jordan Crouse Date: Fri Mar 14 13:57:14 2008 -0600 amd: fix compile and warning issues from the merge commit 5e1f6e925bd92c389169c971502b1fd17c625056 Author: Jordan Crouse Date: Fri Mar 14 13:55:23 2008 -0600 amd: fix up the versioning and naming of the new driver commit 1fd63467e3fa71f289f80dba013046d0065ff3f3 Author: Jordan Crouse Date: Tue Mar 11 16:21:58 2008 -0600 Massive coding style fixup - move to X coding style, remove trailing whitespace, zap unused files and remove blocks of ifdefed out code. commit ec8edd1393f482ca42b401463f0f09580aa263a0 Author: Jordan Crouse Date: Tue Mar 11 15:43:00 2008 -0600 First stage of the rename process - get rid of all amd_ prefixes - change either to geode_ or just to lx_ or gx_ depending on the processor. Change the name in the Makefiles and other collateral commit a7bc1a7f6b439419fc27b669d9d7f99f882d83fe Author: Jordan Crouse Date: Thu Mar 13 17:30:03 2008 -0600 amd: release version 2.7.7.7 xf86-video-amd is now dead - long live xf86-video-geode! commit 248a1f24c9f232cb9d5218faee5d4f7f014ef9c5 Author: Jordan Crouse Date: Thu Mar 13 16:01:21 2008 -0600 amd: fix panel and DDC interation with GX commit d8f8277c89752286da329c50b769986a19b521de Author: Jordan Crouse Date: Thu Mar 13 15:00:36 2008 -0600 amd: Fix a compile error in < 1.5 builds commit 95159125cb19acdfb23ee5042acf9d8b9d776c7a Author: Jordan Crouse Date: Wed Mar 12 14:14:45 2008 -0600 amd: Add the 'geode' name in preparation for the renaming commit b884e17eb74f6b7f11f4bba71ce0421cd0d28855 Author: Stefano Fedrigo Date: Wed Mar 12 14:13:55 2008 -0600 amd: Add libpciaccess probe function commit 01a23f48f4777c705eb4345b3d5e27b6a4f73254 Author: Dave Airlie Date: Mon Mar 10 19:21:07 2008 +1000 amd: fix distcheck commit 0464e1e6b7587aaf87b818fabd93e484f9bc8288 Author: Dave Airlie Date: Mon Mar 10 18:56:22 2008 +1000 amd: fixup pciaccess compile commit eec3a36983867611c9ee401079a8c3a81181d941 Author: Dave Airlie Date: Mon Mar 10 18:56:08 2008 +1000 fix devprivates properly commit 68e3f6c80c1db7c84e176ef298c700ce5bedd501 Author: Dave Airlie Date: Mon Mar 10 18:38:49 2008 +1000 old privates v2 commit 497a081b8fc5d22890b3555589dfc4d2f9c9b6f6 Author: Dave Airlie Date: Mon Mar 10 17:09:18 2008 +1000 amd: move to new devprivates commit da6ca8ff17373428844f904bbc3a1d0e55c8e5c2 Author: Dave Airlie Date: Mon Mar 10 16:54:25 2008 +1000 pciaccess: fix name of struct commit 0899664b9f9dc7a9a7fafab008e145f5e3340ac9 Author: Dave Airlie Date: Mon Mar 10 16:47:53 2008 +1000 pciaccess: forgot some commas commit 0e655a383d3fa8d6757b6b785451468ed1550443 Author: Dave Airlie Date: Mon Mar 10 16:25:09 2008 +1000 oops I did it again.. forgot the damn include commit 2b7d32a60ffa6c87fa7a89eb206ed8916a682d93 Author: Dave Airlie Date: Mon Mar 10 16:22:57 2008 +1000 amd: initial pciaccess conversion commit 1e763626aaefa1ae0cf4d4896c0b7192955e5993 Author: Bart Trojanowski Date: Sun Mar 2 11:52:01 2008 +0200 Implement support for wide and non-standard screen resolutions. Works fine on the VGA output, but requires further testing to ensure that it doesn't disturb operation on the TFT output. commit 2a7240e845ba27a9d2f485fda0bb5f8175234454 Author: Martin-Éric Racine Date: Sun Feb 10 01:55:06 2008 +0200 Erm... That would be pScrni, of course. commit ae448a3beafe001c2bbc60f9fa09ebcfb00e828f Author: Martin-Éric Racine Date: Sun Feb 10 01:50:26 2008 +0200 Added trivial fix for Gamma initialization. commit 4670abb6036379245995f000dcb7d3e33f39570f Author: Martin-Éric Racine Date: Sat Jan 26 01:51:39 2008 +0200 [GX/LX] Bump the default pixel depth up to 16-bit. This is a reasonable compromise between memory consumption and picture readability. This also gives the driver usable defaults for X server >= 1.3 when used with -configure. commit 2ac6c6e3764f4e6ae014af23db6b5211bb034424 Author: Bernardo Innocenti Date: Sat Jan 26 01:46:24 2008 +0200 Constify a few huge tables to reduce data section size. This driver is still unusually big compared to the other X.org drivers. The biggest offender is cimarron.o as demonstrated by: nm -S -t d cimarron.o | sort -k 2 -n commit db25e615f81ea94e1c3e82a408c09d915389d3b7 Author: Bernardo Innocenti Date: Mon Jan 14 01:43:16 2008 +0100 amd_drv: Remove a few (harmless) warnings Signed-off-by: Bernardo Innocenti commit ba2880433912cd63c68cd81682d8e48c3cf77a09 Author: Martin-Éric Racine Date: Mon Jan 14 12:32:13 2008 +0200 Expanded the bug reporting URL in configure.ac to specify the Driver/AMD component. commit cf5e5d2b37de2504b76d96e1f26a5450550b8320 Author: Martin-Éric Racine Date: Mon Jan 14 03:05:48 2008 +0200 Basic OLPC support from Bernardo Innocenti and Jordan Crouse. commit 471f96cf85c6db9952ff4443f84a3c8d701927e7 Author: Martin-Éric Racine Date: Tue Jan 8 13:57:25 2008 -0700 Trivial patch to fix the ZTV module commit 407f403583f901bbb38d267b9194835d5255d41c Author: Martin-Éric Racine Date: Sat Jan 5 06:29:59 2008 +0200 [GX][LX] Push PreInit fixes to avoid segfauls on X -configure. This is known to work on products with GeodeROM and Insyde BIOSes. On products with a General Software BIOS, a freeze occurs while X is probing VBE. The same issue occurs with LinuxBIOS and VGAROM, but not with LinuxBIOS omitting VGAROM. Both issues appear to be caused by X server core upgrading from vm86 to x86emu since X server release 1.3, which requires fixing x86emu, or the concerned BIOSes, or both. commit cc570675d97af7b0f4f6a70af0e7e01c89690aa1 Author: Jordan Crouse Date: Mon Dec 24 13:00:48 2007 -0700 [GX] Fix the autoconfigure segfault for GX too commit f1482feb5b210095c564e2cad5bfd6d6e4e2cd78 Author: Jordan Crouse Date: Mon Dec 24 11:56:19 2007 -0700 [LX] Re-arrange PreInit to avoid segfaults in Xorg -configure Re-arrange the early part of PreInit so that Xorg -configure can run cleanly. commit d4cd5d91a015088d548736831edd31760bcda88d Author: Martin-Éric Racine Date: Mon Oct 15 16:32:56 2007 +0300 Bumped package version to 2.7.7.3. commit 5833df9f71af8253f02a360c1b0e5e36ba2e4910 Author: Jordan Crouse Date: Fri Sep 28 09:05:56 2007 -0600 [XORG] Fix video downscaling When downscaling the window, apparently the clip region doesn't change (not sure why), so we didn't get the message to re-init the video. This will make the re-init process happen on both the clip region changing and the width/height changing. commit dfe2ab1ea3c1a66952b6d38e436a064d677e5fba Author: Jordan Crouse Date: Tue Sep 18 13:45:10 2007 -0600 [XORG] Remove the upload function for LX Remove the upload function for LX. The default function is going to be faster for all 0xCC BLTs; which just so happens to be what all the uploads will be. commit b795643e860548eff6f1a458391e56098c490f64 Author: Martin-Éric Racine Date: Mon Sep 17 14:57:22 2007 +0300 Update the package version in configure.ac commit 65a629fb9861f51f7591bfc1d80068194e7f840e Author: Martin-Éric Racine Date: Mon Sep 17 14:55:49 2007 +0300 ChangeLog DOES need to be cleaned, but in MAINTIANERCLEANFILES. commit 5179095e4e9ba4e699f6965b752df932d2808155 Author: Martin-Éric Racine Date: Wed Sep 12 10:53:34 2007 +0300 Creating a release of course requires updating the package version... commit 39be7f612783fcc6e51ee0a502e4630661fab702 Author: Martin-Éric Racine Date: Wed Sep 12 09:04:08 2007 +0300 We no longer delete the ChangeLog in the clean target. We will simply overwrite it instead. commit 48b20f8c1424e953485149b707318386339e2953 Author: Martin-Éric Racine Date: Sun Sep 2 13:28:57 2007 +0300 Erm... actually, the ChangeLog needs ot be removed, since it's generated at release time. commit 4ade6759760b52ed3b84a846f9c4f5f421a70ef8 Author: Martin-Éric Racine Date: Sun Sep 2 13:18:28 2007 +0300 Commit the clean 2.7.7.0 ChangeLog to GIT. commit 1d1b3005a741b04331fecb1453a0c5c6381518a7 Author: Martin-Éric Racine Date: Sun Sep 2 12:54:30 2007 +0300 Added the standard X.org ChangeLog generation target to Makefile.am commit f159ec89c2e1fd33a52d8f0375233c5fb06bc6f0 Author: Martin-Éric Racine Date: Sun Sep 2 12:46:40 2007 +0300 Reverted autogen.sh changes too, since the 'dist' target does what we need. commit bae63fbe0871229ecd9fca75043065c15a8ea9dc Author: Martin-Éric Racine Date: Sun Sep 2 12:39:06 2007 +0300 Reverted the autotool file generation from the GIT tree. commit 1afba2099aaefead9e87827c60dea146d6e264f3 Author: Martin-Éric Racine Date: Sun Sep 2 10:18:49 2007 +0300 Regenerated configure based on new package version. commit e525ca0d68faed9ede9f55df6d0d4a3099d3ad49 Author: Martin-Éric Racine Date: Sun Sep 2 10:05:49 2007 +0300 Bumped the package version to 2.7.7.0 and calling it a release. commit 47c1bc40e2a06ac84953f4a8b62031fb978ab316 Author: Martin-Eric Racine Date: Wed Aug 29 22:02:23 2007 +0300 Updated the ChangeLog. commit b29cce202abb0c6afb30ec1f06c98d7f84e8d2e4 Author: Martin-Eric Racine Date: Wed Aug 29 22:01:28 2007 +0300 Regenerated ChangeLog and autotool files. commit a6192811e21c9f8d17b409018f945adc2eea3594 Author: Jordan Crouse Date: Thu Aug 2 10:45:14 2007 -0600 Fix the upload / composite mask race We fix a race with the upload function when using a composite mask by using the exa core function exaGetPixmapFirstPixel, which does the right thing in X 1.4 and newer. For older versions, the fix is to stall the pipeine to ensure the upload is complete, so thats what we do. commit 8ce4c5cc9650ddc81d9243bc416522800bce3afc Author: Martin-Éric Racine Date: Wed Jul 25 09:55:25 2007 -0600 Add the all-important if/then loop to avoid squashing the ChangeLog if autogen.sh is executed outside of a git tree. commit bb0f0afc6c5cf849081a007af0c2d3485e87e9c4 Author: Martin-Éric Racine Date: Fri Jul 13 12:34:45 2007 -0600 This autogen.sh implements ChangeLog generation from the git commit log. It also calls the correct Makefile macro to clean up after maintainer configuration, instead of cleaning up by hand. commit 08c26f1bda66b8ffd91e345cdd2cb29171b615b3 Author: Jordan Crouse Date: Tue Jul 10 15:16:12 2007 -0600 Fix "old-school" MSR accesses This fixes the "old" way of reading MSRs (through virtual registers) - we had swapped arguments in one of the macros, which does very bad things to the poor systems it was running on. commit 9f8ea76662733cec5ee6289727c143bf057aee57 Author: Jordan Crouse Date: Tue Jul 10 10:06:01 2007 -0600 Change _X_INLINE to just inline - the define probably isn't needed for us unless we go to a system that doesn't support it. We'll cross that bridge when we get to it. commit 47b5a249e7ae877d7816504fec4f987442d07931 Author: Martin-Éric Racine Date: Fri Jul 6 16:59:51 2007 -0600 An improved autogen.sh script commit f42add8948e2cee3d9f2edf580f260c42718fc0c Author: Jordan Crouse Date: Fri Jul 6 16:13:14 2007 -0600 Remove the DCON sleep code The DCON sleep code was introduced by a previous commit - for now that will only live in the OLPC tree. commit bff92101bd22fcb6a5c0e9da9be58105f7655be4 Author: Jordan Crouse Date: Fri Jul 6 13:22:02 2007 -0600 Use the right bit depth when doing EXA copies on the GX. This fixes the image corruption problem on OLPC. commit 247faeeb1d1c429800f187e08cfaa31407c660ff Author: Jordan Crouse Date: Tue Jul 3 15:53:56 2007 -0600 Make sure we turn on the video palette when video starts, and turn it off when video ends. commit 610f9a6b443afa8e40637a62b2b377a992f5eb05 Author: Dan Williams Date: Mon Jun 25 15:30:02 2007 -0400 Fix LX video downscaling The GX video downscaling logic apparently isn't appropriate for the LX commit fd870f7acd4654ea1b440925e78df2afc5bf7259 Author: Adam Jackson Date: Mon Jun 25 11:06:39 2007 -0400 uint32_t -> CARD32 commit 54ac7918b53a999a25185ff140cda001255596b3 Author: Jordan Crouse Date: Fri Jun 22 17:09:28 2007 -0600 Multiple fixes for the LX driver * Fix VGA detection * Restrict EXA implementations older then 2.0 * Fix crash when VT is switched while rotated * Turn the shadow framebuffer into a true exa offscreen component * Shut off video when we are rotated Conflicts: src/amd_lx_driver.c src/amd_lx_rotate.c commit ea11d99bc29086a8fa92c01dd22f195d626b33d2 Author: Jordan Crouse Date: Fri Jun 15 18:08:56 2007 -0600 Two fixes for compositing for Cairo 1.4.4 and X server 1.3+ commit 7bf0627cd001325affbe16118a2f27225179eabd Author: Zephaniah E. Hull Date: Wed Jun 13 12:28:36 2007 -0400 From Bernardo Innocenti. - enable a few GCC warnings - make a few globals const and static - move MGP_RASTER_MODE writes before writes to color registers - compute BPP dynamically in the SolidFill EXA hook Conflicts: configure.ac commit dc23a3168df78424108e8609b250e88c3dd16775 Author: Jordan Crouse Date: Fri Jun 1 18:32:28 2007 -0600 Fix A8 masks We were using the wrong operation for A8 masks, resulting in badness. Also, clean up the mask blt to be much simpler. commit 167d9dcfe6c13f37590b26bd544ae225cb7934ac Author: Jordan Crouse Date: Fri Jun 1 09:31:52 2007 -0600 Use the correct pitch for composite mask operations We need to specify the correct pitch for composite mask operations - this fixes the stride problem. Also, correctly set up the source color and some other minor issues, this helps us pass caps-join in the cairo test suite. commit 802282679447f2be6d815a6aa196d764a33bb07d Author: Jordan Crouse Date: Thu May 17 17:07:17 2007 -0600 Swizzle the sync when the panel is enabled to account for Cimarron being silly. commit 0a138f4a36ff2b474705bb542b446fe340be324d Author: Adam Jackson Date: Thu May 31 15:10:59 2007 -0400 Add DCON detection to LX. commit 6350e6e2bdc42aa7220d3101111a3bcc0a9b864a Author: Adam Jackson Date: Thu May 31 15:07:29 2007 -0400 DCON detection cleanup and generification. commit 506a23c3618905cbcc1c767b9e388ca86706bc73 Author: Adam Jackson Date: Thu May 31 14:34:07 2007 -0400 Un-libcwrap. commit c37fc13ea909a7a1315d3723ccac0e4146b3a0b2 Author: Adam Jackson Date: Thu May 31 14:30:10 2007 -0400 Add extra GCC warning fu. -Wall cleanup. commit 0953a855c7d20186a8efb6db4842eb777f6e0e56 Author: Adam Jackson Date: Thu May 31 13:58:59 2007 -0400 Rename: amd_gx_dcon.c -> amd_dcon.c commit 0da247099df93a9774e8a638170f2142615ed5df Author: Adam Jackson Date: Wed May 16 13:05:46 2007 -0400 Remove 'man' directory references from configure.ac. commit 217eeed3c1659cc9e0f13ba6932d1342c0255df4 Merge: 6d1942f 022a106 Author: Jordan Crouse Date: Thu May 10 10:39:08 2007 -0600 Merge Geode GX and LX development from OLPC Conflicts: man/amd.man commit 022a106b38693d2d705e8c15ad84c18832fa2e8c Author: Jordan Crouse Date: Wed May 9 17:17:25 2007 -0600 Documentation cleanups Rework the readme, and delete the now woefully out of date man pages. Also update the TODO file with more interesting information. commit 37719011a020eafc9a6848025f3e07219c2f5444 Author: Jordan Crouse Date: Wed May 9 17:17:16 2007 -0600 Fix warnings discovered by Dan Williams and -Wall commit da653c761c9a275cf2b5ff4e087cb0239421c72d Author: Dan Williams Date: Wed May 9 13:32:42 2007 -0600 More -Wall warnings fixed commit 8fa5d1e3653f91c0c1409147f7292463554dd9f9 Author: Dan Williams Date: Wed May 9 13:31:15 2007 -0600 Eliminate the first round of warnings discovered with -Wall commit 0af46deb156c1d4bdc7c3378c70bb9ef696a4886 Author: Jordan Crouse Date: Fri May 4 11:43:09 2007 -0600 Completely eliminate the rotation pitch Chris Ball is still getting segfalts - completely eliminate the call. commit c35f7fe15a5a872606f18c84c097f3b5b1cada74 Author: Jordan Crouse Date: Fri May 4 11:30:55 2007 -0600 Fix a segfault in RandR commit 1ddbc60536d6e2b7a4654dd9019a3872c1a54de2 Author: Jordan Crouse Date: Fri May 4 09:03:26 2007 -0600 Use the same stride for all rotations This avoids problems copying pixmaps from EXA space. commit 69501cb09955741a3bb93a0992085cf4f64c70d7 Author: Jordan Crouse Date: Fri May 4 09:03:22 2007 -0600 Cimarron wants to use CF8/CFC Avoid using the PCI access routines in Cimarron commit 460c5b55d30086b013e35c76fd406e8826e6a814 Author: Jordan Crouse Date: Fri May 4 08:53:40 2007 -0600 Handle out of memory situations more gracefully commit 501f1b6d11ce35d5e53de798a364b7712c754e7b Author: Dan Williams Date: Thu May 3 10:05:17 2007 -0400 commit 5f7979e990c5eafb44aa0fa9779a7ed3904d25ce include string.h for memset commit 89bb73e915a8aca7a04d2ab0818f9b21c88d59c3 Author: Dan Williams Date: Thu May 3 09:56:42 2007 -0400 commit 7125fcab372b24f7045bbdaa6d4f6e435b1f7a83 Fix missed GXQueryImageAttributes->GeodeQueryImageAttributes commit 4dfae85222779694e162c8bb942b7587c2600592 Author: Jordan Crouse Date: Wed May 2 14:38:24 2007 -0600 Solve several vexing issues with RandR: * Incorrect rendering while rotated * Mouse was incorrectly drawn for 90 and 270 * subsequent RandR commands were killing the rotated stride commit dc5db7c4d68268377cd99f7c8e4bc54556923ed1 Author: Jordan Crouse Date: Tue May 1 17:08:42 2007 -0600 Fix video and VGA bugs Fix two small bugs: The VGA dection code wasn't working, and the video engine was not using color keying. commit 59eac173349afa24c126ec670bedb68643dd5a84 Author: Jordan Crouse Date: Thu Apr 26 15:34:11 2007 -0600 Use a secret bit to ensure we use channel A alpha *before* color conversion commit 46b29acf1f239dd89adabf1cb2c138cf8a2b1700 Author: Jordan Crouse Date: Fri Apr 20 11:17:16 2007 -0600 Several fixes to support OLPC LX turnon These are fixes discovered during the OLPC LX turn on. The compression was incorrectly being configured, resulting in bad drawing, that has bee repaired. Assume by default that we're going to use a panel and the CRT, no longer read the straps MSR because it is unreliable. Finally, fix the MSR hooks by moving the hook definitions where they will do some good and disabling the VSA method. commit 8bfed84a1f972325cdf61876d7f7dfd0e8f0d4d5 Author: Jordan Crouse Date: Wed Apr 11 13:37:02 2007 -0600 Add Linux MSR suport for LX Extend the GX MSR support to LX - this is to support the VSAless OFW, and share code. commit 2d7689990c19fd74d5fad11bcf6317a7874a6057 Author: Jordan Crouse Date: Thu Mar 8 18:06:11 2007 -0700 Fix a couple of scary bugs - including one that seemed to be causing corruption. commit b959509bb37e6ef269088ecbe92f49c7dc971fb6 Author: Jordan Crouse Date: Wed Mar 7 18:27:52 2007 -0700 Add a TODO file filled with many bugs and enhancements commit b59bfdde9341ca9014e00795e344ac64b5b91b8c Author: Jordan Crouse Date: Wed Mar 7 18:14:34 2007 -0700 [MAJOR UPDATE] Geode LX driver This is a major re-vamping of the Geode LX driver to support EXA, RandR, and advanced xserver features. The GX and LX drivers now share the similar streamlined infrastructure, and acceleration. The LX driver also adds features the GX does not have, such as accelerated rotations and far better composite support. This provides the basis for the rotation and acceleration enhancements. commit 6d1942fb5e9a1e37baae3ec8559f9567ddeb2f67 Author: Alan Coopersmith Date: Thu Mar 1 10:38:08 2007 -0800 Replace references to XFree86/XF86Config in man page commit d2f53b7c576c91f07f55b62b0020be1d0ab358dc Author: Jordan Crouse Date: Wed Jan 31 13:50:19 2007 -0700 Fix an unfortunate segfault when NoAccel is selected commit 610e65d49c3060b9512be785ab78de0824583155 Author: Jordan Crouse Date: Mon Jan 15 22:03:00 2007 -0700 Fixed broken EXA - things actually move faster now. commit 7f3e76af1675dc071769cdd68fa0ae4f1290b7b4 Author: Dan Williams Date: Mon Jan 15 16:49:09 2007 -0500 Fix distcheck commit edbd744b31eb7996b521eca4a42e0e20700ffa78 Author: Jordan Crouse Date: Fri Jan 12 10:30:19 2007 -0700 Correctly program the sync polarity taking into account the GX wierdness commit 461c5fb1ed00101e9832b4a0236bbb51d092ddb6 Author: Jordan Crouse Date: Thu Jan 11 17:30:45 2007 -0700 Broken logic on the previous Xv fix - should work now commit a212981da0147a5f277b43b801de6d2454005c17 Author: Jordan Crouse Date: Wed Jan 10 17:51:23 2007 -0700 Add Xv hardware support for a RGB565 source. commit acc4421ac55d021ef917967ecd09b650e8dd9699 Author: Jordan Crouse Date: Wed Jan 10 14:23:02 2007 -0700 Fix a segfault when no valid modes are found Also - be smart about allocating memory in the RandR part. commit 888dab329bb66c8e4317d0b6a9736fa70c9686a6 Author: Jordan Crouse Date: Wed Jan 10 14:21:43 2007 -0700 I missed a few updates of the new driver structure in the video code commit cb69ce0f54569c68c79173e144c3c90e46e64f8b Author: Adam Jackson Date: Mon Jan 8 15:23:59 2007 -0500 Minor DCON fixes. Wire up the DCON init to GXPreInit, and set the panel geometry appropriately if found. commit c4f21aaaaf6d101e7c8828e246e06be3ff0591c3 Author: Adam Jackson Date: Mon Jan 8 15:22:28 2007 -0500 Fix RANDR support to be dlloader-friendly. commit d4d16bf29802549b501a00e32195162ed5e8ab93 Author: Adam Jackson Date: Mon Jan 8 15:21:33 2007 -0500 Build fix. commit f762b456b98063860e38e9541f4be2fb1302e3c2 Author: Adam Jackson Date: Mon Jan 8 15:20:44 2007 -0500 Add --enable-visibility. Allow the driver to be built with the default symbol visbility set to hidden, for smaller better code. commit cf77a1fe9ec232cbb0d99685f34d0acb91ee5d88 Author: Jordan Crouse Date: Fri Dec 29 10:58:35 2006 -0700 Remove direct PCI accesses from Durango Accessing PCI through X is one thing, accessing it directly is quite another. commit fb92319afde24b91c64314e4f2d8725fa2cd61fe Author: Jordan Crouse Date: Wed Dec 20 17:30:44 2006 -0700 Replace the VSA MSR interface with something more sane commit e34f70fc46b36a0ea26636045ce9f9bf24ec89cd Author: Jordan Crouse Date: Mon Dec 18 11:01:34 2006 -0700 Correctly rotate the HW cursor data so that it matches the rest of the screen commit 2e558b7cf6c508a1f745d922d911d612eba7d2c4 Author: Jordan Crouse Date: Fri Dec 15 16:37:35 2006 -0700 A few fixes for the panel - the mode should be set correctly now, and segfaults have gone away. commit 243edb93e131734f23d9c5f39f1cd614ecc6a1f8 Author: Jordan Crouse Date: Fri Dec 15 13:23:49 2006 -0700 Remove debugging messages and other cleanups commit 8cd3fa16e377119452d8575198a7f1f1a77e44fc Author: Jordan Crouse Date: Fri Dec 15 13:23:48 2006 -0700 Default the GX driver to use EXA for acceleration commit 04e5aa4e6e9ec4ddc8ebeaf9f7004cb832c194c8 Author: Jordan Crouse Date: Fri Dec 15 13:23:48 2006 -0700 Allow the user to specify an initial rotation commit dc2244b398d68bb340e97c723615e3b52ecd47ae Author: Jordan Crouse Date: Fri Dec 15 13:23:45 2006 -0700 Clean up the VGA init commit 5b66b41b1d91345700e8f18569fa984c6ce53aca Author: Jordan Crouse Date: Fri Dec 15 08:46:42 2006 -0700 Remove unneeded GX options commit d901348441642fadbd71ed2e37e74b3b2a7af97c Author: Jordan Crouse Date: Thu Dec 14 17:28:48 2006 -0700 Fix the memory mapping so its more sane, and disable XAA pixmap caches during rotation. commit 73dc69c6597d5f0f6023c067f7b1c2d7709b604b Author: Jordan Crouse Date: Thu Dec 14 17:26:59 2006 -0700 PATCH: Automatically probe to see if VGA exists commit a38f40687c00f35d2e6529c3cfb894ee29cdea66 Author: Jordan Crouse Date: Wed Dec 13 16:03:36 2006 -0700 Clean up whitespace and other code style issues commit edd326cc9ba5b9f46ca7a4516806a5b7fd3605f0 Author: Jordan Crouse Date: Tue Dec 12 17:31:48 2006 -0700 First attempt at adding dynamic rotation (just RandR 1.1 for now) commit 98aad0c298e59b6336e9219cc37294644d2d9e95 Author: Jordan Crouse Date: Thu Nov 9 15:31:07 2006 -0700 PATCH: Add special support for the OLPC DCON commit e18f0a7efe7bbc7655a9fdcd3b74ec8c799a86a2 Author: Jordan Crouse Date: Wed Nov 8 16:41:44 2006 -0700 PATCH: More gamma fixes Be smarter about how gamma is saved and restored by checking the bits. commit 881c2aac50af3265d98daa4be5ccf49cabe2f5d6 Author: Jordan Crouse Date: Wed Nov 8 11:24:26 2006 -0700 PATCH: Avoid incorrectly killing the gamma RAM when the driver starts up The Xv driver requires color adjustment by programming the gamma LUT. The driver was incorectly programming the LUT at startup, which is damaging for any previous applications that may have graphics gamma information in the LUT. Change only applies the video adjustment when video is enabled. commit 57921b0fffbd1a4bf36dbef69badb9b71918a3b8 Author: Jordan Crouse Date: Mon Oct 16 16:54:15 2006 -0600 Fixed stupid buglet that I introduced commit 1c2fdaa4bc0df076f2d15184cfba74b2df82c6e4 Author: Jordan Crouse Date: Mon Oct 16 16:27:01 2006 -0600 Missed a place where I needed to clear the EXA memory commit 8d9986ffa3d678469901d595c80770696bd866d8 Author: Jordan Crouse Date: Wed Oct 11 17:42:30 2006 -0600 Xv needs to understand how to allocate offscreen code from EXA too When EXA is enabled, it takes enough of the offscreen memory for itself, so that Xv cannot query memory with xf86AllocateOffscreen. commit 2979196dae5615f2a78ace891d4ad6dd98c8fe6e Author: Jordan Crouse Date: Thu Sep 28 09:09:27 2006 -0600 Update for 7.2 - fix config.h and other include problems. This closes bug 8290 by applying the patch from Andres Salomon. commit 45eeb43888e92e2736d9b678ce6d67fb99449800 Author: Jordan Crouse Date: Mon Aug 21 11:24:42 2006 -0600 PATCH: Clean ups some of the log messages Remove the useless DDC probe message and only warn when MSR reads don't work. commit 1665bf4ae01b88bd2d981ebacc306568715ee927 Author: Jordan Crouse Date: Mon Aug 21 11:24:41 2006 -0600 PATCH: Move the check for EXA version The check for the EXA version occurs before the EXA_VERSION is defined. This results in EXA being permanently turned off. This makes sure exa.h is defined before checking the version. commit 38f3d21beba13daba4844a129f3c268b5f291fb1 Author: Jordan Crouse Date: Tue Aug 15 13:14:01 2006 -0600 PATCH: When compression is off, adjust the pitch to be linear, saving memory commit 9d8d08c6a7449faf9c52d728eeb5793180eaf98e Author: Jordan Crouse Date: Mon Aug 7 17:46:56 2006 -0600 PATCH: Fixup Xv Xv was still stuck in the 6.8.1 days. commit 4a29b63925ea8ffa4e220925dd8aca280fd887a7 Author: Jordan Crouse Date: Fri Aug 4 14:23:52 2006 -0600 PATCH: Add specific support for the OLPC dcon panel The OLPC dcon panel operates differently then the other panels in the GX universe. commit 7a49bf6205d77a22b07c785f2cb589abd8671667 Author: Jordan Crouse Date: Fri Aug 4 14:23:40 2006 -0600 PATCH: Remove the build files that shouldn't be in the repository commit d67ec33ef47086469446f0bd692ec15581124424 Author: Zephaniah E. Hull Date: Thu Aug 3 10:41:41 2006 -0400 Make EXA support on EXA_VERSION_MAJOR >= 2. Catch the two places where we tried to use EXA stuff when it wasn't available. commit 3718e9e2639d0f6313c3ec9ab32d277d2224f8cf Author: Jordan Crouse Date: Fri Jul 7 17:18:06 2006 -0600 PATCH: Fix some VGA issues Fix some issues from the recent NoVGA refactoring commit 726d46c8da96b2a0168b39d36be32467d54a9de3 Author: Jordan Crouse Date: Fri Jul 7 13:05:19 2006 -0600 Update with cleanup and other fixes Final commit of cleanup fixes prior to pushing commit c3ab9f1a60afe1f5e86db1cf2635acda14fae2f5 Author: Jordan Crouse Date: Thu Jul 6 14:56:42 2006 -0600 Initial commit of the xf86-video-amd tree xf86-video-geode-2.11.18/autogen.sh0000755000175000017500000000035212654445443013601 00000000000000#! /bin/sh srcdir=`dirname $0` test -z "$srcdir" && srcdir=. ORIGDIR=`pwd` cd $srcdir autoreconf -v --install || exit 1 cd $ORIGDIR || exit $? if test -z "$NOCONFIGURE"; then $srcdir/configure --enable-maintainer-mode "$@" fi xf86-video-geode-2.11.18/README0000644000175000017500000001467012654445443012470 00000000000000xf86-video-geode -- AMD Geode GX and LX graphics driver for X.org ================================================================= README last updated: 2011-11-24 1.INTRODUCTION This is the X graphics driver for the AMD Geode GX and LX processors. The GX component supports both XAA and EXA for graphics acceleration. The LX component supports EXA, including compositing. Both support Xv overlay and dynamic rotation with XRandR. Additionally, a V4L2 driver for the LX's video input port (VIP) feature is provided as "ztv". 2.DEPENDENCIES Since version 2.9.0, this driver depends on X server 1.3 or greater, because it utilizes the new common DDC probing libraries from X.Org. 3.ROADMAP Support for old GX1 Geodes by Cyrix and NSC will be reintroduced soon, at which point xf86-video-cyrix and xf86-video-nsc will be retired. Until then, the current situation for Geode coverage is as follow: xf86-video-geode * Geode LX (a.k.a. GX3) PCI ID 0x1022:0x2081 * Geode GX (a.k.a. GX2) PCI ID 0x100B:0x0030 (re-branded GX2) xf86-video-nsc * Geode GX2 (a.k.a. GX2) PCI ID 0x100B:0x0030 (a.k.a. "Red Cloud") * Geode SCx200 (a.k.a. GX1) PCI ID 0x100B:0x0504 * Geode SC1400 (a.k.a. GX1) PCI ID 0x100B:0x0104 xf86-video-cyrix * Geode MediaGX (a.k.a. GX1) PCI ID 0x1078:0x0104 Please note that both NSC and GEODE support GX2. This is indeed correct. However, only GEODE has up-to-date code, while NSC is deprecated. 4.MAXIMUM RESOLUTIONS The driver supports all maximum resolutions advertised by AMD, namely: LX: 1920x1440 (CRT) and 1600x1200 (TFT) GX: 1600x1200 (CRT) and 1280x1024 (TFT) SC: 1280x1024 (CRT/TFT) *** Currently unsupported by this driver *** 5.CONFIGURATION OPTIONS You can specify driver options in /etc/X11/xorg.conf in the usual fashion: Section "Device" Identifier "AMD Geode" Driver "geode" Option "OptionName" "value" ... EndSection The following options may be added to such a Device section: 5.1.COMMON OPTIONS FBSize: Specify the size of the video space (in bytes) NoAccel: Disable hardware assisted acceleration NoCompression: Disable video bandwidth compression NoPanel: Disable panel support Rotate: Select an initial orientation - LEFT, INVERT, CCW SWCursor: Enable software cursors (essentially disabling HW cursor support) 5.2.GX-SPECIFIC OPTIONS AccelMethod: "XAA" (default) or "EXA" PanelGeometry: Specify the geometry of the attached panel ("x") OSMImageBuffers: Set the number of image buffers (XAA only) OSMColorExpBuffers: Set the number of color expansion buffers (XAA only) 5.3.LX-SPECIFIC OPTIONS ExaScratch: Specify the amount of extra EXA scratch buffer (in bytes) 6.FREQUENTLY ASKED QUESTIONS (FAQ) Q: Why doesn't the GEODE driver work at WXGA (wide screen) resolutions? A: Make sure that TFT Panel support is disabled in the BIOS settings, otherwise resolutions will be restricted to traditional VGA modes. The GEODE offers a choice between CRT-only, CRT+TFT, TFT-only for output device and selecting CRT-only removes the VGA restriction. Q: How can these hardcoded modes be expanded to support a WXGA laptop? A: By adding the desired modes to /etc/X11/xorg.conf as follow: 1) Use either the "cvt" or "gtf" command to determine the modeline: cvt 1024 600 60 Where 1024x600 is the resolution and 60 the refresh rate. The resulting modeline using "gtf" is: Modeline "1024x600" 48.96 1024 1064 1168 1312 600 601 604 622 -hsync +vsync 2) Add it to the bottom of the "Monitor" section in /etc/X11/xorg.conf. In this example, we created entries for two modes and configured the larger resolution to be our preferred choice. ############################################################# # /etc/X11/xorg.conf for 1024x600 and 800x480 laptop panels # ############################################################# #### By J.KASPER and B.HIBRY #### for Hercules eCafe 800 #### ############################################################# Section "Module" Load "ztv" EndSection Section "Device" Identifier "card0" Driver "geode" BusID "PCI:0:1:1" Option "PanelMode" "33450 800 840 968 1056 480 490 492 525" EndSection Section "Monitor" Identifier "monitor0" Modeline "1024x768" 64.56 1024 1056 1296 1328 768 783 791 807 -hsync +vsync Modeline "1024x600" 48.96 1024 1064 1168 1312 600 601 604 622 -hsync +vsync Modeline "800x480" 33.45 800 840 968 1056 480 490 492 525 -hsync +vsync Option "dpms" EndSection Section "Screen" Identifier "Default Screen" Monitor "monitor0" Device "card0" DefaultDepth 24 Subsection "Display" Depth 24 Modes "1024x600" "1024x768" "800x480" EndSubsection EndSection ### EOF ### Q: Why doesn't screen rotation work? A: Make sure that a sufficient amount of video RAM is reserved in the BIOS, otherwise rotation will fail and this error message appear in Xorg.log: Couldn't allocate the shadow memory for rotation You need XX bytes, but only YY bytes are available Q: How do I produce useful information whenever submitting a bug report? A: See http://www.x.org/wiki/Development/Documentation/ServerDebugging and follow the instructions found there. Q: How do I test development snapshots from the upstream GIT repository? A: Run the following commands from a command line interpreter shell: 1. git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-video-geode 2. Debian/Ubuntu: apt-get install autoconf automake libtool xutils-dev apt-get install build-dep xserver-xorg-video-geode Fedora/Red Hat: yum install autoconf automake libtool xorg-x11-util-macros yum-builddep xorg-x11-drv-geode 3. cd xf86-video-geode 4. ./autogen.sh 5. make distcheck ...then install the driver manually. Q: What is the preferred method for submitting patches to this driver? A: See http://www.x.org/wiki/Development/Documentation/SubmittingPatches and submit the patches to the Geode X.org mailing list or to Bugzilla against product "xorg" component "Driver/geode". 7.PROJECT CONTACTS Project homepage: http://www.x.org/wiki/GeodeDriver Mailing list: http://lists.freedesktop.org/mailman/listinfo/xorg-driver-geode Bug reports: https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver%2Fgeode Code browser: http://cgit.freedesktop.org/xorg/driver/xf86-video-geode Code repository: git://anongit.freedesktop.org/git/xorg/driver/xf86-video-geode IRC channel: #geode on the Freenode network. .EOF. xf86-video-geode-2.11.18/aclocal.m40000644000175000017500000036772112654445505013457 00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- dnl serial 11 (pkg-config-0.29) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), dnl to deal in the Software without restriction, including without limitation dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, dnl and/or sell copies of the Software, and to permit persons to whom the dnl Software is furnished to do so, subject to the following conditions: dnl dnl The above copyright notice and this permission notice (including the next dnl paragraph) shall be included in all copies or substantial portions of the dnl Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER dnl DEALINGS IN THE SOFTWARE. # XORG_MACROS_VERSION(required-version) # ------------------------------------- # Minimum version: 1.1.0 # # If you're using a macro added in Version 1.1 or newer, include this in # your configure.ac with the minimum required version, such as: # XORG_MACROS_VERSION(1.1) # # To ensure that this macro is defined, also add: # m4_ifndef([XORG_MACROS_VERSION], # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) # # # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ m4_define([vers_have], [1.19.0]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) m4_if(m4_version_compare(vers_have, [$1]), -1, [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) m4_undefine([vers_have]) m4_undefine([maj_have]) m4_undefine([maj_needed]) ]) # XORG_MACROS_VERSION # XORG_PROG_RAWCPP() # ------------------ # Minimum version: 1.0.0 # # Find cpp program and necessary flags for use in pre-processing text files # such as man pages and config files AC_DEFUN([XORG_PROG_RAWCPP],[ AC_REQUIRE([AC_PROG_CPP]) AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) # Check for flag to avoid builtin definitions - assumes unix is predefined, # which is not the best choice for supporting other OS'es, but covers most # of the ones we need for now. AC_MSG_CHECKING([if $RAWCPP requires -undef]) AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])]) if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then AC_MSG_RESULT([no]) else if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then RAWCPPFLAGS=-undef AC_MSG_RESULT([yes]) # under Cygwin unix is still defined even with -undef elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then RAWCPPFLAGS="-undef -ansi" AC_MSG_RESULT([yes, with -ansi]) else AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) fi fi rm -f conftest.$ac_ext AC_MSG_CHECKING([if $RAWCPP requires -traditional]) AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])]) if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then AC_MSG_RESULT([no]) else if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then TRADITIONALCPPFLAGS="-traditional" RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" AC_MSG_RESULT([yes]) else AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) fi fi rm -f conftest.$ac_ext AC_SUBST(RAWCPPFLAGS) AC_SUBST(TRADITIONALCPPFLAGS) ]) # XORG_PROG_RAWCPP # XORG_MANPAGE_SECTIONS() # ----------------------- # Minimum version: 1.0.0 # # Determine which sections man pages go in for the different man page types # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. # Not sure if there's any better way than just hardcoding by OS name. # Override default settings by setting environment variables # Added MAN_SUBSTS in version 1.8 # Added AC_PROG_SED in version 1.8 AC_DEFUN([XORG_MANPAGE_SECTIONS],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_SED]) if test x$APP_MAN_SUFFIX = x ; then APP_MAN_SUFFIX=1 fi if test x$APP_MAN_DIR = x ; then APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' fi if test x$LIB_MAN_SUFFIX = x ; then LIB_MAN_SUFFIX=3 fi if test x$LIB_MAN_DIR = x ; then LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' fi if test x$FILE_MAN_SUFFIX = x ; then case $host_os in solaris*) FILE_MAN_SUFFIX=4 ;; *) FILE_MAN_SUFFIX=5 ;; esac fi if test x$FILE_MAN_DIR = x ; then FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' fi if test x$MISC_MAN_SUFFIX = x ; then case $host_os in solaris*) MISC_MAN_SUFFIX=5 ;; *) MISC_MAN_SUFFIX=7 ;; esac fi if test x$MISC_MAN_DIR = x ; then MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' fi if test x$DRIVER_MAN_SUFFIX = x ; then case $host_os in solaris*) DRIVER_MAN_SUFFIX=7 ;; *) DRIVER_MAN_SUFFIX=4 ;; esac fi if test x$DRIVER_MAN_DIR = x ; then DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' fi if test x$ADMIN_MAN_SUFFIX = x ; then case $host_os in solaris*) ADMIN_MAN_SUFFIX=1m ;; *) ADMIN_MAN_SUFFIX=8 ;; esac fi if test x$ADMIN_MAN_DIR = x ; then ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' fi AC_SUBST([APP_MAN_SUFFIX]) AC_SUBST([LIB_MAN_SUFFIX]) AC_SUBST([FILE_MAN_SUFFIX]) AC_SUBST([MISC_MAN_SUFFIX]) AC_SUBST([DRIVER_MAN_SUFFIX]) AC_SUBST([ADMIN_MAN_SUFFIX]) AC_SUBST([APP_MAN_DIR]) AC_SUBST([LIB_MAN_DIR]) AC_SUBST([FILE_MAN_DIR]) AC_SUBST([MISC_MAN_DIR]) AC_SUBST([DRIVER_MAN_DIR]) AC_SUBST([ADMIN_MAN_DIR]) XORG_MAN_PAGE="X Version 11" AC_SUBST([XORG_MAN_PAGE]) MAN_SUBSTS="\ -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ -e 's|__xservername__|Xorg|g' \ -e 's|__xconfigfile__|xorg.conf|g' \ -e 's|__projectroot__|\$(prefix)|g' \ -e 's|__apploaddir__|\$(appdefaultdir)|g' \ -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" AC_SUBST([MAN_SUBSTS]) ]) # XORG_MANPAGE_SECTIONS # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) # ------------------------ # Minimum version: 1.7.0 # # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent # provided by xorg-sgml-doctools, if installed. AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) XORG_SGML_PATH= PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], [m4_ifval([$1],[:], [if test x"$cross_compiling" != x"yes" ; then AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], [XORG_SGML_PATH=$prefix/share/sgml]) fi]) ]) # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing # the path and the name of the doc stylesheet if test "x$XORG_SGML_PATH" != "x" ; then AC_MSG_RESULT([$XORG_SGML_PATH]) STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl else AC_MSG_RESULT([no]) fi AC_SUBST(XORG_SGML_PATH) AC_SUBST(STYLESHEET_SRCDIR) AC_SUBST(XSL_STYLESHEET) AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) ]) # XORG_CHECK_SGML_DOCTOOLS # XORG_CHECK_LINUXDOC # ------------------- # Minimum version: 1.0.0 # # Defines the variable MAKE_TEXT if the necessary tools and # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. # Whether or not the necessary tools and files are found can be checked # with the AM_CONDITIONAL "BUILD_LINUXDOC" AC_DEFUN([XORG_CHECK_LINUXDOC],[ AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) AC_REQUIRE([XORG_WITH_PS2PDF]) AC_PATH_PROG(LINUXDOC, linuxdoc) AC_MSG_CHECKING([whether to build documentation]) if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then BUILDDOC=yes else BUILDDOC=no fi AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) AC_MSG_RESULT([$BUILDDOC]) AC_MSG_CHECKING([whether to build pdf documentation]) if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then BUILDPDFDOC=yes else BUILDPDFDOC=no fi AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) AC_MSG_RESULT([$BUILDPDFDOC]) MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" MAKE_PDF="$PS2PDF" MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" AC_SUBST(MAKE_TEXT) AC_SUBST(MAKE_PS) AC_SUBST(MAKE_PDF) AC_SUBST(MAKE_HTML) ]) # XORG_CHECK_LINUXDOC # XORG_CHECK_DOCBOOK # ------------------- # Minimum version: 1.0.0 # # Checks for the ability to build output formats from SGML DocBook source. # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" # indicates whether the necessary tools and files are found and, if set, # $(MAKE_XXX) blah.sgml will produce blah.xxx. AC_DEFUN([XORG_CHECK_DOCBOOK],[ AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) BUILDTXTDOC=no BUILDPDFDOC=no BUILDPSDOC=no BUILDHTMLDOC=no AC_PATH_PROG(DOCBOOKPS, docbook2ps) AC_PATH_PROG(DOCBOOKPDF, docbook2pdf) AC_PATH_PROG(DOCBOOKHTML, docbook2html) AC_PATH_PROG(DOCBOOKTXT, docbook2txt) AC_MSG_CHECKING([whether to build text documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && test x$BUILD_TXTDOC != xno; then BUILDTXTDOC=yes fi AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) AC_MSG_RESULT([$BUILDTXTDOC]) AC_MSG_CHECKING([whether to build PDF documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && test x$BUILD_PDFDOC != xno; then BUILDPDFDOC=yes fi AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) AC_MSG_RESULT([$BUILDPDFDOC]) AC_MSG_CHECKING([whether to build PostScript documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && test x$BUILD_PSDOC != xno; then BUILDPSDOC=yes fi AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) AC_MSG_RESULT([$BUILDPSDOC]) AC_MSG_CHECKING([whether to build HTML documentation]) if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && test x$BUILD_HTMLDOC != xno; then BUILDHTMLDOC=yes fi AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) AC_MSG_RESULT([$BUILDHTMLDOC]) MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" AC_SUBST(MAKE_TEXT) AC_SUBST(MAKE_PS) AC_SUBST(MAKE_PDF) AC_SUBST(MAKE_HTML) ]) # XORG_CHECK_DOCBOOK # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) # ---------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-xmlto option, it allows maximum flexibilty in making decisions # as whether or not to use the xmlto package. When DEFAULT is not specified, # --with-xmlto assumes 'auto'. # # Interface to module: # HAVE_XMLTO: used in makefiles to conditionally generate documentation # XMLTO: returns the path of the xmlto program found # returns the path set by the user in the environment # --with-xmlto: 'yes' user instructs the module to use xmlto # 'no' user instructs the module not to use xmlto # # Added in version 1.10.0 # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation # xmlto for text output requires either lynx, links, or w3m browsers # # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_XMLTO],[ AC_ARG_VAR([XMLTO], [Path to xmlto command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(xmlto, AS_HELP_STRING([--with-xmlto], [Use xmlto to regenerate documentation (default: ]_defopt[)]), [use_xmlto=$withval], [use_xmlto=]_defopt) m4_undefine([_defopt]) if test "x$use_xmlto" = x"auto"; then AC_PATH_PROG([XMLTO], [xmlto]) if test "x$XMLTO" = "x"; then AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) have_xmlto=no else have_xmlto=yes fi elif test "x$use_xmlto" = x"yes" ; then AC_PATH_PROG([XMLTO], [xmlto]) if test "x$XMLTO" = "x"; then AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) fi have_xmlto=yes elif test "x$use_xmlto" = x"no" ; then if test "x$XMLTO" != "x"; then AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) fi have_xmlto=no else AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) fi # Test for a minimum version of xmlto, if provided. m4_ifval([$1], [if test "$have_xmlto" = yes; then # scrape the xmlto version AC_MSG_CHECKING([the xmlto version]) xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` AC_MSG_RESULT([$xmlto_version]) AS_VERSION_COMPARE([$xmlto_version], [$1], [if test "x$use_xmlto" = xauto; then AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) have_xmlto=no else AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) fi]) fi]) # Test for the ability of xmlto to generate a text target # # NOTE: xmlto 0.0.27 or higher return a non-zero return code in the # following test for empty XML docbook files. # For compatibility reasons use the following empty XML docbook file and if # it fails try it again with a non-empty XML file. have_xmlto_text=no cat > conftest.xml << "EOF" EOF AS_IF([test "$have_xmlto" = yes], [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], [have_xmlto_text=yes], [# Try it again with a non-empty XML file. cat > conftest.xml << "EOF" EOF AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], [have_xmlto_text=yes], [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])]) rm -f conftest.xml AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) ]) # XORG_WITH_XMLTO # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT]) # -------------------------------------------- # Minimum version: 1.12.0 # Minimum version for optional DEFAULT argument: 1.12.0 # # XSLT (Extensible Stylesheet Language Transformations) is a declarative, # XML-based language used for the transformation of XML documents. # The xsltproc command line tool is for applying XSLT stylesheets to XML documents. # It is used under the cover by xmlto to generate html files from DocBook/XML. # The XSLT processor is often used as a standalone tool for transformations. # It should not be assumed that this tool is used only to work with documnetation. # When DEFAULT is not specified, --with-xsltproc assumes 'auto'. # # Interface to module: # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation # XSLTPROC: returns the path of the xsltproc program found # returns the path set by the user in the environment # --with-xsltproc: 'yes' user instructs the module to use xsltproc # 'no' user instructs the module not to use xsltproc # have_xsltproc: returns yes if xsltproc found in PATH or no # # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_XSLTPROC],[ AC_ARG_VAR([XSLTPROC], [Path to xsltproc command]) # Preserves the interface, should it be implemented later m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(xsltproc, AS_HELP_STRING([--with-xsltproc], [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]), [use_xsltproc=$withval], [use_xsltproc=]_defopt) m4_undefine([_defopt]) if test "x$use_xsltproc" = x"auto"; then AC_PATH_PROG([XSLTPROC], [xsltproc]) if test "x$XSLTPROC" = "x"; then AC_MSG_WARN([xsltproc not found - cannot transform XML documents]) have_xsltproc=no else have_xsltproc=yes fi elif test "x$use_xsltproc" = x"yes" ; then AC_PATH_PROG([XSLTPROC], [xsltproc]) if test "x$XSLTPROC" = "x"; then AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH]) fi have_xsltproc=yes elif test "x$use_xsltproc" = x"no" ; then if test "x$XSLTPROC" != "x"; then AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified]) fi have_xsltproc=no else AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes]) ]) # XORG_WITH_XSLTPROC # XORG_WITH_PERL([MIN-VERSION], [DEFAULT]) # ---------------------------------------- # Minimum version: 1.15.0 # # PERL (Practical Extraction and Report Language) is a language optimized for # scanning arbitrary text files, extracting information from those text files, # and printing reports based on that information. # # When DEFAULT is not specified, --with-perl assumes 'auto'. # # Interface to module: # HAVE_PERL: used in makefiles to conditionally scan text files # PERL: returns the path of the perl program found # returns the path set by the user in the environment # --with-perl: 'yes' user instructs the module to use perl # 'no' user instructs the module not to use perl # have_perl: returns yes if perl found in PATH or no # # If the user sets the value of PERL, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_PERL],[ AC_ARG_VAR([PERL], [Path to perl command]) # Preserves the interface, should it be implemented later m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(perl, AS_HELP_STRING([--with-perl], [Use perl for extracting information from files (default: ]_defopt[)]), [use_perl=$withval], [use_perl=]_defopt) m4_undefine([_defopt]) if test "x$use_perl" = x"auto"; then AC_PATH_PROG([PERL], [perl]) if test "x$PERL" = "x"; then AC_MSG_WARN([perl not found - cannot extract information and report]) have_perl=no else have_perl=yes fi elif test "x$use_perl" = x"yes" ; then AC_PATH_PROG([PERL], [perl]) if test "x$PERL" = "x"; then AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH]) fi have_perl=yes elif test "x$use_perl" = x"no" ; then if test "x$PERL" != "x"; then AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified]) fi have_perl=no else AC_MSG_ERROR([--with-perl expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes]) ]) # XORG_WITH_PERL # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) # ---------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-asciidoc option, it allows maximum flexibilty in making decisions # as whether or not to use the asciidoc package. When DEFAULT is not specified, # --with-asciidoc assumes 'auto'. # # Interface to module: # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation # ASCIIDOC: returns the path of the asciidoc program found # returns the path set by the user in the environment # --with-asciidoc: 'yes' user instructs the module to use asciidoc # 'no' user instructs the module not to use asciidoc # # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_ASCIIDOC],[ AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(asciidoc, AS_HELP_STRING([--with-asciidoc], [Use asciidoc to regenerate documentation (default: ]_defopt[)]), [use_asciidoc=$withval], [use_asciidoc=]_defopt) m4_undefine([_defopt]) if test "x$use_asciidoc" = x"auto"; then AC_PATH_PROG([ASCIIDOC], [asciidoc]) if test "x$ASCIIDOC" = "x"; then AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) have_asciidoc=no else have_asciidoc=yes fi elif test "x$use_asciidoc" = x"yes" ; then AC_PATH_PROG([ASCIIDOC], [asciidoc]) if test "x$ASCIIDOC" = "x"; then AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) fi have_asciidoc=yes elif test "x$use_asciidoc" = x"no" ; then if test "x$ASCIIDOC" != "x"; then AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) fi have_asciidoc=no else AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) fi m4_ifval([$1], [if test "$have_asciidoc" = yes; then # scrape the asciidoc version AC_MSG_CHECKING([the asciidoc version]) asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` AC_MSG_RESULT([$asciidoc_version]) AS_VERSION_COMPARE([$asciidoc_version], [$1], [if test "x$use_asciidoc" = xauto; then AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) have_asciidoc=no else AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) fi]) fi]) AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) ]) # XORG_WITH_ASCIIDOC # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) # ------------------------------------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 # Minimum version for optional DOT checking: 1.18.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-doxygen option, it allows maximum flexibilty in making decisions # as whether or not to use the doxygen package. When DEFAULT is not specified, # --with-doxygen assumes 'auto'. # # Interface to module: # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation # DOXYGEN: returns the path of the doxygen program found # returns the path set by the user in the environment # --with-doxygen: 'yes' user instructs the module to use doxygen # 'no' user instructs the module not to use doxygen # # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_DOXYGEN],[ AC_ARG_VAR([DOXYGEN], [Path to doxygen command]) AC_ARG_VAR([DOT], [Path to the dot graphics utility]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(doxygen, AS_HELP_STRING([--with-doxygen], [Use doxygen to regenerate documentation (default: ]_defopt[)]), [use_doxygen=$withval], [use_doxygen=]_defopt) m4_undefine([_defopt]) if test "x$use_doxygen" = x"auto"; then AC_PATH_PROG([DOXYGEN], [doxygen]) if test "x$DOXYGEN" = "x"; then AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) have_doxygen=no else have_doxygen=yes fi elif test "x$use_doxygen" = x"yes" ; then AC_PATH_PROG([DOXYGEN], [doxygen]) if test "x$DOXYGEN" = "x"; then AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) fi have_doxygen=yes elif test "x$use_doxygen" = x"no" ; then if test "x$DOXYGEN" != "x"; then AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) fi have_doxygen=no else AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) fi m4_ifval([$1], [if test "$have_doxygen" = yes; then # scrape the doxygen version AC_MSG_CHECKING([the doxygen version]) doxygen_version=`$DOXYGEN --version 2>/dev/null` AC_MSG_RESULT([$doxygen_version]) AS_VERSION_COMPARE([$doxygen_version], [$1], [if test "x$use_doxygen" = xauto; then AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) have_doxygen=no else AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) fi]) fi]) dnl Check for DOT if we have doxygen. The caller decides if it is mandatory dnl HAVE_DOT is a variable that can be used in your doxygen.in config file: dnl HAVE_DOT = @HAVE_DOT@ HAVE_DOT=no if test "x$have_doxygen" = "xyes"; then AC_PATH_PROG([DOT], [dot]) if test "x$DOT" != "x"; then HAVE_DOT=yes fi fi AC_SUBST([HAVE_DOT]) AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"]) AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) ]) # XORG_WITH_DOXYGEN # XORG_WITH_GROFF([DEFAULT]) # ---------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-groff option, it allows maximum flexibilty in making decisions # as whether or not to use the groff package. When DEFAULT is not specified, # --with-groff assumes 'auto'. # # Interface to module: # HAVE_GROFF: used in makefiles to conditionally generate documentation # HAVE_GROFF_MM: the memorandum macros (-mm) package # HAVE_GROFF_MS: the -ms macros package # GROFF: returns the path of the groff program found # returns the path set by the user in the environment # --with-groff: 'yes' user instructs the module to use groff # 'no' user instructs the module not to use groff # # Added in version 1.9.0: # HAVE_GROFF_HTML: groff has dependencies to output HTML format: # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. # psselect from the psutils package. # the ghostcript package. Refer to the grohtml man pages # # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. # # OS and distros often splits groff in a basic and full package, the former # having the groff program and the later having devices, fonts and macros # Checking for the groff executable is not enough. # # If macros are missing, we cannot assume that groff is useless, so we don't # unset HAVE_GROFF or GROFF env variables. # HAVE_GROFF_?? can never be true while HAVE_GROFF is false. # AC_DEFUN([XORG_WITH_GROFF],[ AC_ARG_VAR([GROFF], [Path to groff command]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_WITH(groff, AS_HELP_STRING([--with-groff], [Use groff to regenerate documentation (default: ]_defopt[)]), [use_groff=$withval], [use_groff=]_defopt) m4_undefine([_defopt]) if test "x$use_groff" = x"auto"; then AC_PATH_PROG([GROFF], [groff]) if test "x$GROFF" = "x"; then AC_MSG_WARN([groff not found - documentation targets will be skipped]) have_groff=no else have_groff=yes fi elif test "x$use_groff" = x"yes" ; then AC_PATH_PROG([GROFF], [groff]) if test "x$GROFF" = "x"; then AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) fi have_groff=yes elif test "x$use_groff" = x"no" ; then if test "x$GROFF" != "x"; then AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) fi have_groff=no else AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) fi # We have groff, test for the presence of the macro packages if test "x$have_groff" = x"yes"; then AC_MSG_CHECKING([for ${GROFF} -ms macros]) if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then groff_ms_works=yes else groff_ms_works=no fi AC_MSG_RESULT([$groff_ms_works]) AC_MSG_CHECKING([for ${GROFF} -mm macros]) if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then groff_mm_works=yes else groff_mm_works=no fi AC_MSG_RESULT([$groff_mm_works]) fi # We have groff, test for HTML dependencies, one command per package if test "x$have_groff" = x"yes"; then AC_PATH_PROGS(GS_PATH, [gs gswin32c]) AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) AC_PATH_PROG(PSSELECT_PATH, [psselect]) if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then have_groff_html=yes else have_groff_html=no AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) fi fi # Set Automake conditionals for Makefiles AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) ]) # XORG_WITH_GROFF # XORG_WITH_FOP([MIN-VERSION], [DEFAULT]) # --------------------------------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # Minimum version for optional MIN-VERSION argument: 1.15.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-fop option, it allows maximum flexibilty in making decisions # as whether or not to use the fop package. When DEFAULT is not specified, # --with-fop assumes 'auto'. # # Interface to module: # HAVE_FOP: used in makefiles to conditionally generate documentation # FOP: returns the path of the fop program found # returns the path set by the user in the environment # --with-fop: 'yes' user instructs the module to use fop # 'no' user instructs the module not to use fop # # If the user sets the value of FOP, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_FOP],[ AC_ARG_VAR([FOP], [Path to fop command]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(fop, AS_HELP_STRING([--with-fop], [Use fop to regenerate documentation (default: ]_defopt[)]), [use_fop=$withval], [use_fop=]_defopt) m4_undefine([_defopt]) if test "x$use_fop" = x"auto"; then AC_PATH_PROG([FOP], [fop]) if test "x$FOP" = "x"; then AC_MSG_WARN([fop not found - documentation targets will be skipped]) have_fop=no else have_fop=yes fi elif test "x$use_fop" = x"yes" ; then AC_PATH_PROG([FOP], [fop]) if test "x$FOP" = "x"; then AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) fi have_fop=yes elif test "x$use_fop" = x"no" ; then if test "x$FOP" != "x"; then AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) fi have_fop=no else AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) fi # Test for a minimum version of fop, if provided. m4_ifval([$1], [if test "$have_fop" = yes; then # scrape the fop version AC_MSG_CHECKING([for fop minimum version]) fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3` AC_MSG_RESULT([$fop_version]) AS_VERSION_COMPARE([$fop_version], [$1], [if test "x$use_fop" = xauto; then AC_MSG_WARN([fop version $fop_version found, but $1 needed]) have_fop=no else AC_MSG_ERROR([fop version $fop_version found, but $1 needed]) fi]) fi]) AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) ]) # XORG_WITH_FOP # XORG_WITH_M4([MIN-VERSION]) # --------------------------- # Minimum version: 1.19.0 # # This macro attempts to locate an m4 macro processor which supports # -I option and is only useful for modules relying on M4 in order to # expand macros in source code files. # # Interface to module: # M4: returns the path of the m4 program found # returns the path set by the user in the environment # AC_DEFUN([XORG_WITH_M4], [ AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4], [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4], [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \ ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]], [AC_MSG_ERROR([could not find m4 that supports -I option])], [$PATH:/usr/gnu/bin])]) AC_SUBST([M4], [$ac_cv_path_M4]) ]) # XORG_WITH_M4 # XORG_WITH_PS2PDF([DEFAULT]) # ---------------- # Minimum version: 1.6.0 # Minimum version for optional DEFAULT argument: 1.11.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the # presence of the tool and obtain it's path in separate variables. Coupled with # the --with-ps2pdf option, it allows maximum flexibilty in making decisions # as whether or not to use the ps2pdf package. When DEFAULT is not specified, # --with-ps2pdf assumes 'auto'. # # Interface to module: # HAVE_PS2PDF: used in makefiles to conditionally generate documentation # PS2PDF: returns the path of the ps2pdf program found # returns the path set by the user in the environment # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf # 'no' user instructs the module not to use ps2pdf # # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. # AC_DEFUN([XORG_WITH_PS2PDF],[ AC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_WITH(ps2pdf, AS_HELP_STRING([--with-ps2pdf], [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) m4_undefine([_defopt]) if test "x$use_ps2pdf" = x"auto"; then AC_PATH_PROG([PS2PDF], [ps2pdf]) if test "x$PS2PDF" = "x"; then AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) have_ps2pdf=no else have_ps2pdf=yes fi elif test "x$use_ps2pdf" = x"yes" ; then AC_PATH_PROG([PS2PDF], [ps2pdf]) if test "x$PS2PDF" = "x"; then AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) fi have_ps2pdf=yes elif test "x$use_ps2pdf" = x"no" ; then if test "x$PS2PDF" != "x"; then AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) fi have_ps2pdf=no else AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) fi AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) ]) # XORG_WITH_PS2PDF # XORG_ENABLE_DOCS (enable_docs=yes) # ---------------- # Minimum version: 1.6.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a builder to skip all # documentation targets except traditional man pages. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_DOCS: used in makefiles to conditionally generate documentation # --enable-docs: 'yes' user instructs the module to generate docs # 'no' user instructs the module not to generate docs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_DOCS],[ m4_define([docs_default], m4_default([$1], [yes])) AC_ARG_ENABLE(docs, AS_HELP_STRING([--enable-docs], [Enable building the documentation (default: ]docs_default[)]), [build_docs=$enableval], [build_docs=]docs_default) m4_undefine([docs_default]) AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) AC_MSG_CHECKING([whether to build documentation]) AC_MSG_RESULT([$build_docs]) ]) # XORG_ENABLE_DOCS # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) # ---------------- # Minimum version: 1.6.0 # # This macro enables a builder to skip all developer documentation. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs # --enable-devel-docs: 'yes' user instructs the module to generate developer docs # 'no' user instructs the module not to generate developer docs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ m4_define([devel_default], m4_default([$1], [yes])) AC_ARG_ENABLE(devel-docs, AS_HELP_STRING([--enable-devel-docs], [Enable building the developer documentation (default: ]devel_default[)]), [build_devel_docs=$enableval], [build_devel_docs=]devel_default) m4_undefine([devel_default]) AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) AC_MSG_CHECKING([whether to build developer documentation]) AC_MSG_RESULT([$build_devel_docs]) ]) # XORG_ENABLE_DEVEL_DOCS # XORG_ENABLE_SPECS (enable_specs=yes) # ---------------- # Minimum version: 1.6.0 # # This macro enables a builder to skip all functional specification targets. # Combined with the specific tool checking macros XORG_WITH_*, it provides # maximum flexibilty in controlling documentation building. # Refer to: # XORG_WITH_XMLTO --with-xmlto # XORG_WITH_ASCIIDOC --with-asciidoc # XORG_WITH_DOXYGEN --with-doxygen # XORG_WITH_FOP --with-fop # XORG_WITH_GROFF --with-groff # XORG_WITH_PS2PDF --with-ps2pdf # # Interface to module: # ENABLE_SPECS: used in makefiles to conditionally generate specs # --enable-specs: 'yes' user instructs the module to generate specs # 'no' user instructs the module not to generate specs # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_SPECS],[ m4_define([spec_default], m4_default([$1], [yes])) AC_ARG_ENABLE(specs, AS_HELP_STRING([--enable-specs], [Enable building the specs (default: ]spec_default[)]), [build_specs=$enableval], [build_specs=]spec_default) m4_undefine([spec_default]) AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) AC_MSG_CHECKING([whether to build functional specifications]) AC_MSG_RESULT([$build_specs]) ]) # XORG_ENABLE_SPECS # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) # ---------------------------------------------- # Minimum version: 1.13.0 # # This macro enables a builder to enable/disable unit testing # It makes no assumption about the test cases implementation # Test cases may or may not use Automake "Support for test suites" # They may or may not use the software utility library GLib # # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. # The variable enable_unit_tests is used by other macros in this file. # # Interface to module: # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests # enable_unit_tests: used in configure.ac for additional configuration # --enable-unit-tests: 'yes' user instructs the module to build tests # 'no' user instructs the module not to build tests # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[ AC_BEFORE([$0], [XORG_WITH_GLIB]) AC_BEFORE([$0], [XORG_LD_WRAP]) AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], [Enable building unit test cases (default: ]_defopt[)]), [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt) m4_undefine([_defopt]) AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno]) AC_MSG_CHECKING([whether to build unit test cases]) AC_MSG_RESULT([$enable_unit_tests]) ]) # XORG_ENABLE_UNIT_TESTS # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto) # ------------------------------------------------------ # Minimum version: 1.17.0 # # This macro enables a builder to enable/disable integration testing # It makes no assumption about the test cases' implementation # Test cases may or may not use Automake "Support for test suites" # # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support # usually requires less dependencies and may be built and run under less # stringent environments than integration tests. # # Interface to module: # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests # enable_integration_tests: used in configure.ac for additional configuration # --enable-integration-tests: 'yes' user instructs the module to build tests # 'no' user instructs the module not to build tests # parm1: specify the default value, yes or no. # AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[ AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) m4_define([_defopt], m4_default([$1], [auto])) AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests], [Enable building integration test cases (default: ]_defopt[)]), [enable_integration_tests=$enableval], [enable_integration_tests=]_defopt) m4_undefine([_defopt]) AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], [test "x$enable_integration_tests" != xno]) AC_MSG_CHECKING([whether to build unit test cases]) AC_MSG_RESULT([$enable_integration_tests]) ]) # XORG_ENABLE_INTEGRATION_TESTS # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT]) # ---------------------------------------- # Minimum version: 1.13.0 # # GLib is a library which provides advanced data structures and functions. # This macro enables a module to test for the presence of Glib. # # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. # Otherwise the value of $enable_unit_tests is blank. # # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit # test support usually requires less dependencies and may be built and run under # less stringent environments than integration tests. # # Interface to module: # HAVE_GLIB: used in makefiles to conditionally build targets # with_glib: used in configure.ac to know if GLib has been found # --with-glib: 'yes' user instructs the module to use glib # 'no' user instructs the module not to use glib # AC_DEFUN([XORG_WITH_GLIB],[ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], [Use GLib library for unit testing (default: ]_defopt[)]), [with_glib=$withval], [with_glib=]_defopt) m4_undefine([_defopt]) have_glib=no # Do not probe GLib if user explicitly disabled unit testing if test "x$enable_unit_tests" != x"no"; then # Do not probe GLib if user explicitly disabled it if test "x$with_glib" != x"no"; then m4_ifval( [$1], [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])], [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])] ) fi fi # Not having GLib when unit testing has been explicitly requested is an error if test "x$enable_unit_tests" = x"yes"; then if test "x$have_glib" = x"no"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) fi fi # Having unit testing disabled when GLib has been explicitly requested is an error if test "x$enable_unit_tests" = x"no"; then if test "x$with_glib" = x"yes"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) fi fi # Not having GLib when it has been explicitly requested is an error if test "x$with_glib" = x"yes"; then if test "x$have_glib" = x"no"; then AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found]) fi fi AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) ]) # XORG_WITH_GLIB # XORG_LD_WRAP([required|optional]) # --------------------------------- # Minimum version: 1.13.0 # # Check if linker supports -wrap, passed via compiler flags # # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. # Otherwise the value of $enable_unit_tests is blank. # # Argument added in 1.16.0 - default is "required", to match existing behavior # of returning an error if enable_unit_tests is yes, and ld -wrap is not # available, an argument of "optional" allows use when some unit tests require # ld -wrap and others do not. # AC_DEFUN([XORG_LD_WRAP],[ XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no], [AC_LANG_PROGRAM([#include void __wrap_exit(int status) { return; }], [exit(0);])]) # Not having ld wrap when unit testing has been explicitly requested is an error if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then if test "x$have_ld_wrap" = x"no"; then AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available]) fi fi AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) # ]) # XORG_LD_WRAP # XORG_CHECK_LINKER_FLAGS # ----------------------- # SYNOPSIS # # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE]) # # DESCRIPTION # # Check whether the given linker FLAGS work with the current language's # linker, or whether they give an error. # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # PROGRAM-SOURCE is the program source to link with, if needed # # NOTE: Based on AX_CHECK_COMPILER_FLAGS. # # LICENSE # # Copyright (c) 2009 Mike Frysinger # Copyright (c) 2009 Steven G. Johnson # Copyright (c) 2009 Matteo Frigo # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well.# AC_DEFUN([XORG_CHECK_LINKER_FLAGS], [AC_MSG_CHECKING([whether the linker accepts $1]) dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: AS_LITERAL_IF([$1], [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ ax_save_FLAGS=$LDFLAGS LDFLAGS="$1" AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])], AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, AS_TR_SH(xorg_cv_linker_flags_[$1])=no) LDFLAGS=$ax_save_FLAGS])], [ax_save_FLAGS=$LDFLAGS LDFLAGS="$1" AC_LINK_IFELSE([AC_LANG_PROGRAM()], eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no) LDFLAGS=$ax_save_FLAGS]) eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1]) AC_MSG_RESULT($xorg_check_linker_flags) if test "x$xorg_check_linker_flags" = xyes; then m4_default([$2], :) else m4_default([$3], :) fi ]) # XORG_CHECK_LINKER_FLAGS # XORG_MEMORY_CHECK_FLAGS # ----------------------- # Minimum version: 1.16.0 # # This macro attempts to find appropriate memory checking functionality # for various platforms which unit testing code may use to catch various # forms of memory allocation and access errors in testing. # # Interface to module: # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging # Usually added to TESTS_ENVIRONMENT in Makefile.am # # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim. # AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV], [Environment variables to enable memory checking in tests]) # Check for different types of support on different platforms case $host_os in solaris*) AC_CHECK_LIB([umem], [umem_alloc], [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default']) ;; *-gnu*) # GNU libc - Value is used as a single byte bit pattern, # both directly and inverted, so should not be 0 or 255. malloc_debug_env='MALLOC_PERTURB_=15' ;; darwin*) malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' ;; *bsd*) malloc_debug_env='MallocPreScribble=1 MallocScribble=1' ;; esac # User supplied flags override default flags if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" fi AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env]) ]) # XORG_WITH_LINT # XORG_CHECK_MALLOC_ZERO # ---------------------- # Minimum version: 1.0.0 # # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if # malloc(0) returns NULL. Packages should add one of these cflags to # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ AC_ARG_ENABLE(malloc0returnsnull, AS_HELP_STRING([--enable-malloc0returnsnull], [malloc(0) returns NULL (default: auto)]), [MALLOC_ZERO_RETURNS_NULL=$enableval], [MALLOC_ZERO_RETURNS_NULL=auto]) AC_MSG_CHECKING([whether malloc(0) returns NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then AC_CACHE_VAL([xorg_cv_malloc0_returns_null], [AC_RUN_IFELSE([AC_LANG_PROGRAM([ #include ],[ char *m0, *r0, *c0, *p; m0 = malloc(0); p = malloc(10); r0 = realloc(p,0); c0 = calloc(0,10); exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); ])], [xorg_cv_malloc0_returns_null=yes], [xorg_cv_malloc0_returns_null=no])]) MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null fi AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" else MALLOC_ZERO_CFLAGS="" XMALLOC_ZERO_CFLAGS="" XTMALLOC_ZERO_CFLAGS="" fi AC_SUBST([MALLOC_ZERO_CFLAGS]) AC_SUBST([XMALLOC_ZERO_CFLAGS]) AC_SUBST([XTMALLOC_ZERO_CFLAGS]) ]) # XORG_CHECK_MALLOC_ZERO # XORG_WITH_LINT() # ---------------- # Minimum version: 1.1.0 # # This macro enables the use of a tool that flags some suspicious and # non-portable constructs (likely to be bugs) in C language source code. # It will attempt to locate the tool and use appropriate options. # There are various lint type tools on different platforms. # # Interface to module: # LINT: returns the path to the tool found on the platform # or the value set to LINT on the configure cmd line # also an Automake conditional # LINT_FLAGS: an Automake variable with appropriate flags # # --with-lint: 'yes' user instructs the module to use lint # 'no' user instructs the module not to use lint (default) # # If the user sets the value of LINT, AC_PATH_PROG skips testing the path. # If the user sets the value of LINT_FLAGS, they are used verbatim. # AC_DEFUN([XORG_WITH_LINT],[ AC_ARG_VAR([LINT], [Path to a lint-style command]) AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], [Use a lint-style source code checker (default: disabled)])], [use_lint=$withval], [use_lint=no]) # Obtain platform specific info like program name and options # The lint program on FreeBSD and NetBSD is different from the one on Solaris case $host_os in *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) lint_name=splint lint_options="-badflag" ;; *freebsd* | *netbsd*) lint_name=lint lint_options="-u -b" ;; *solaris*) lint_name=lint lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" ;; esac # Test for the presence of the program (either guessed by the code or spelled out by the user) if test "x$use_lint" = x"yes" ; then AC_PATH_PROG([LINT], [$lint_name]) if test "x$LINT" = "x"; then AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) fi elif test "x$use_lint" = x"no" ; then if test "x$LINT" != "x"; then AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) fi else AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) fi # User supplied flags override default flags if test "x$LINT_FLAGS" != "x"; then lint_options=$LINT_FLAGS fi AC_SUBST([LINT_FLAGS],[$lint_options]) AM_CONDITIONAL(LINT, [test "x$LINT" != x]) ]) # XORG_WITH_LINT # XORG_LINT_LIBRARY(LIBNAME) # -------------------------- # Minimum version: 1.1.0 # # Sets up flags for building lint libraries for checking programs that call # functions in the library. # # Interface to module: # LINTLIB - Automake variable with the name of lint library file to make # MAKE_LINT_LIB - Automake conditional # # --enable-lint-library: - 'yes' user instructs the module to created a lint library # - 'no' user instructs the module not to create a lint library (default) AC_DEFUN([XORG_LINT_LIBRARY],[ AC_REQUIRE([XORG_WITH_LINT]) AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], [Create lint library (default: disabled)])], [make_lint_lib=$enableval], [make_lint_lib=no]) if test "x$make_lint_lib" = x"yes" ; then LINTLIB=llib-l$1.ln if test "x$LINT" = "x"; then AC_MSG_ERROR([Cannot make lint library without --with-lint]) fi elif test "x$make_lint_lib" != x"no" ; then AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) fi AC_SUBST(LINTLIB) AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) ]) # XORG_LINT_LIBRARY # XORG_COMPILER_BRAND # ------------------- # Minimum version: 1.14.0 # # Checks for various brands of compilers and sets flags as appropriate: # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes" # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes" # clang compiler - sets CLANGCC to "yes" # Intel compiler - sets INTELCC to "yes" # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes" # AC_DEFUN([XORG_COMPILER_BRAND], [ AC_LANG_CASE( [C], [ AC_REQUIRE([AC_PROG_CC_C99]) ], [C++], [ AC_REQUIRE([AC_PROG_CXX]) ] ) AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"]) AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) ]) # XORG_COMPILER_BRAND # XORG_TESTSET_CFLAG(, , [, ...]) # --------------- # Minimum version: 1.16.0 # # Test if the compiler works when passed the given flag as a command line argument. # If it succeeds, the flag is appeneded to the given variable. If not, it tries the # next flag in the list until there are no more options. # # Note that this does not guarantee that the compiler supports the flag as some # compilers will simply ignore arguments that they do not understand, but we do # attempt to weed out false positives by using -Werror=unknown-warning-option and # -Werror=unused-command-line-argument # AC_DEFUN([XORG_TESTSET_CFLAG], [ m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) AC_LANG_COMPILER_REQUIRE AC_LANG_CASE( [C], [ AC_REQUIRE([AC_PROG_CC_C99]) define([PREFIX], [C]) define([CACHE_PREFIX], [cc]) define([COMPILER], [$CC]) ], [C++], [ define([PREFIX], [CXX]) define([CACHE_PREFIX], [cxx]) define([COMPILER], [$CXX]) ] ) [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]" if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option], AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes], [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no])) [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option] PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" fi if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" fi PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument], AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes], [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no])) [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument] PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" fi found="no" m4_foreach([flag], m4_cdr($@), [ if test $found = "no" ; then if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" fi if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" fi PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag[" dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[]) cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[]) AC_CACHE_VAL($cacheid, [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], [eval $cacheid=yes], [eval $cacheid=no])]) PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" eval supported=\$$cacheid AC_MSG_RESULT([$supported]) if test "$supported" = "yes" ; then $1="$$1 ]flag[" found="yes" fi fi ]) ]) # XORG_TESTSET_CFLAG # XORG_COMPILER_FLAGS # --------------- # Minimum version: 1.16.0 # # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line # arguments supported by the selected compiler which do NOT alter the generated # code. These arguments will cause the compiler to print various warnings # during compilation AND turn a conservative set of warnings into errors. # # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in # future versions of util-macros as options are added to new compilers. # AC_DEFUN([XORG_COMPILER_FLAGS], [ AC_REQUIRE([XORG_COMPILER_BRAND]) AC_ARG_ENABLE(selective-werror, AS_HELP_STRING([--disable-selective-werror], [Turn off selective compiler errors. (default: enabled)]), [SELECTIVE_WERROR=$enableval], [SELECTIVE_WERROR=yes]) AC_LANG_CASE( [C], [ define([PREFIX], [C]) ], [C++], [ define([PREFIX], [CXX]) ] ) # -v is too short to test reliably with XORG_TESTSET_CFLAG if test "x$SUNCC" = "xyes"; then [BASE_]PREFIX[FLAGS]="-v" else [BASE_]PREFIX[FLAGS]="" fi # This chunk of warnings were those that existed in the legacy CWARNFLAGS XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat]) AC_LANG_CASE( [C], [ XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement]) ] ) # This chunk adds additional warnings that could catch undesired effects. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. if test "x$SELECTIVE_WERROR" = "xyes" ; then XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION else AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast]) fi AC_SUBST([BASE_]PREFIX[FLAGS]) ]) # XORG_COMPILER_FLAGS # XORG_CWARNFLAGS # --------------- # Minimum version: 1.2.0 # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) # # Defines CWARNFLAGS to enable C compiler warnings. # # This function is deprecated because it defines -fno-strict-aliasing # which alters the code generated by the compiler. If -fno-strict-aliasing # is needed, then it should be added explicitly in the module when # it is updated to use BASE_CFLAGS. # AC_DEFUN([XORG_CWARNFLAGS], [ AC_REQUIRE([XORG_COMPILER_FLAGS]) AC_REQUIRE([XORG_COMPILER_BRAND]) AC_LANG_CASE( [C], [ CWARNFLAGS="$BASE_CFLAGS" if test "x$GCC" = xyes ; then CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" fi AC_SUBST(CWARNFLAGS) ] ) ]) # XORG_CWARNFLAGS # XORG_STRICT_OPTION # ----------------------- # Minimum version: 1.3.0 # # Add configure option to enable strict compilation flags, such as treating # warnings as fatal errors. # If --enable-strict-compilation is passed to configure, adds strict flags to # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS. # # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or # when strict compilation is unconditionally desired. AC_DEFUN([XORG_STRICT_OPTION], [ AC_REQUIRE([XORG_CWARNFLAGS]) AC_REQUIRE([XORG_COMPILER_FLAGS]) AC_ARG_ENABLE(strict-compilation, AS_HELP_STRING([--enable-strict-compilation], [Enable all warnings from compiler and make them errors (default: disabled)]), [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) AC_LANG_CASE( [C], [ define([PREFIX], [C]) ], [C++], [ define([PREFIX], [CXX]) ] ) [STRICT_]PREFIX[FLAGS]="" XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic]) XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn]) # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not # activate it with -Werror, so we add it here explicitly. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes]) if test "x$STRICT_COMPILE" = "xyes"; then [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]" AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"]) fi AC_SUBST([STRICT_]PREFIX[FLAGS]) AC_SUBST([BASE_]PREFIX[FLAGS]) AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS])) ]) # XORG_STRICT_OPTION # XORG_DEFAULT_OPTIONS # -------------------- # Minimum version: 1.3.0 # # Defines default options for X.Org modules. # AC_DEFUN([XORG_DEFAULT_OPTIONS], [ AC_REQUIRE([AC_PROG_INSTALL]) XORG_COMPILER_FLAGS XORG_CWARNFLAGS XORG_STRICT_OPTION XORG_RELEASE_VERSION XORG_CHANGELOG XORG_INSTALL XORG_MANPAGE_SECTIONS m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) ]) # XORG_DEFAULT_OPTIONS # XORG_INSTALL() # ---------------- # Minimum version: 1.4.0 # # Defines the variable INSTALL_CMD as the command to copy # INSTALL from $prefix/share/util-macros. # AC_DEFUN([XORG_INSTALL], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" AC_SUBST([INSTALL_CMD]) ]) # XORG_INSTALL dnl Copyright 2005 Red Hat, Inc dnl dnl Permission to use, copy, modify, distribute, and sell this software and its dnl documentation for any purpose is hereby granted without fee, provided that dnl the above copyright notice appear in all copies and that both that dnl copyright notice and this permission notice appear in supporting dnl documentation. dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or substantial portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR dnl OTHER DEALINGS IN THE SOFTWARE. dnl dnl Except as contained in this notice, the name of the copyright holders shall dnl not be used in advertising or otherwise to promote the sale, use or dnl other dealings in this Software without prior written authorization dnl from the copyright holders. dnl # XORG_RELEASE_VERSION # -------------------- # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. AC_DEFUN([XORG_RELEASE_VERSION],[ AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], [`echo $PACKAGE_VERSION | cut -d . -f 1`], [Major version of this package]) PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` if test "x$PVM" = "x"; then PVM="0" fi AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], [$PVM], [Minor version of this package]) PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` if test "x$PVP" = "x"; then PVP="0" fi AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], [$PVP], [Patch version of this package]) ]) # XORG_CHANGELOG() # ---------------- # Minimum version: 1.2.0 # # Defines the variable CHANGELOG_CMD as the command to generate # ChangeLog from git. # # AC_DEFUN([XORG_CHANGELOG], [ CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ echo 'git directory not found: installing possibly empty changelog.' >&2)" AC_SUBST([CHANGELOG_CMD]) ]) # XORG_CHANGELOG dnl Copyright 2005 Red Hat, Inc dnl dnl Permission to use, copy, modify, distribute, and sell this software and its dnl documentation for any purpose is hereby granted without fee, provided that dnl the above copyright notice appear in all copies and that both that dnl copyright notice and this permission notice appear in supporting dnl documentation. dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or substantial portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR dnl OTHER DEALINGS IN THE SOFTWARE. dnl dnl Except as contained in this notice, the name of the copyright holders shall dnl not be used in advertising or otherwise to promote the sale, use or dnl other dealings in this Software without prior written authorization dnl from the copyright holders. dnl # XORG_DRIVER_CHECK_EXT(MACRO, PROTO) # -------------------------- # Checks for the MACRO define in xorg-server.h (from the sdk). If it # is defined, then add the given PROTO to $REQUIRED_MODULES. AC_DEFUN([XORG_DRIVER_CHECK_EXT],[ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "xorg-server.h" #if !defined $1 #error $1 not defined #endif ]])], [_EXT_CHECK=yes], [_EXT_CHECK=no]) CFLAGS="$SAVE_CFLAGS" AC_MSG_CHECKING([if $1 is defined]) AC_MSG_RESULT([$_EXT_CHECK]) if test "$_EXT_CHECK" != no; then REQUIRED_MODULES="$REQUIRED_MODULES $2" fi ]) # Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) xf86-video-geode-2.11.18/config.h.in0000644000175000017500000000403212654445513013620 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ #include "xorg-server.h" /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_VIDEODEV2_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_XAA_H /* xextproto 7.1 available */ #undef HAVE_XEXTPROTO_71 /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Major version of this package */ #undef PACKAGE_VERSION_MAJOR /* Minor version of this package */ #undef PACKAGE_VERSION_MINOR /* Patch version of this package */ #undef PACKAGE_VERSION_PATCHLEVEL /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION xf86-video-geode-2.11.18/TODO0000644000175000017500000000055212654445443012272 00000000000000General: * Add automagic probing of the fb driver (for memory size) * Write the man page GX: * Fix the options so they are sane (i.e eliminate one of SWCursor or HWCursor) * TV support * Fix the rotate text strings (CCW?) * Don't crash when rotating when playing video LX: * Fix the options so they are sane * TV support (VOP) * Rotated video * ARGB cursor