diff options
author | Thomas Winischhofer <thomas@winischhofer.net> | 2005-04-22 23:42:43 +0000 |
---|---|---|
committer | Thomas Winischhofer <thomas@winischhofer.net> | 2005-04-22 23:42:43 +0000 |
commit | 26f9da76d3e9970aeb88792e682b5ffdb899ba43 (patch) | |
tree | 66fc42649c4ae6944600669fcdc8e39acde8909e | |
parent | 2a629b64c6ce666d12a4f657d2696c36958fb123 (diff) |
SiSUSB driver:sco_port_update-baseXORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_7XORG-6_8_99_6XORG-6_8_99_5XORG-6_8_99_4XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10
- remove gamma pre-brightness remains
- minor clean-ups
-rw-r--r-- | src/sisusb.h | 5 | ||||
-rw-r--r-- | src/sisusb_accel.c | 2 | ||||
-rw-r--r-- | src/sisusb_accel.h | 20 | ||||
-rw-r--r-- | src/sisusb_driver.c | 15 | ||||
-rw-r--r-- | src/sisusb_init.c | 2 | ||||
-rw-r--r-- | src/sisusb_opt.c | 24 | ||||
-rw-r--r-- | src/sisusb_osdef.h | 1 | ||||
-rw-r--r-- | src/sisusb_regs.h | 2 | ||||
-rw-r--r-- | src/sisusb_utility.c | 12 | ||||
-rw-r--r-- | src/sisusb_vga.c | 47 | ||||
-rw-r--r-- | src/sisusb_video.c | 5 |
11 files changed, 57 insertions, 78 deletions
diff --git a/src/sisusb.h b/src/sisusb.h index fe32596..2b07cbe 100644 --- a/src/sisusb.h +++ b/src/sisusb.h @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Authors: Thomas Winischhofer <thomas@winischhofer.net> + * Author: Thomas Winischhofer <thomas@winischhofer.net> * */ @@ -36,7 +36,7 @@ #define SISUSBDRIVERVERSIONYEAR 5 #define SISUSBDRIVERVERSIONMONTH 4 -#define SISUSBDRIVERVERSIONDAY 21 +#define SISUSBDRIVERVERSIONDAY 23 #define SISUSBDRIVERREVISION 1 #define SISUSBDRIVERIVERSION ((SISUSBDRIVERVERSIONYEAR << 16) | \ @@ -666,7 +666,6 @@ typedef struct { UChar * CurMonoSrc; CARD32 * CurARGBDest; int GammaBriR, GammaBriG, GammaBriB; - int GammaPBriR, GammaPBriG, GammaPBriB; Bool HideHWCursor; /* Custom application */ Bool HWCursorIsVisible; ULong HWCursorBackup[16]; diff --git a/src/sisusb_accel.c b/src/sisusb_accel.c index 4aeaa5d..0bc1fce 100644 --- a/src/sisusb_accel.c +++ b/src/sisusb_accel.c @@ -30,8 +30,6 @@ * * Author: Thomas Winischhofer <thomas@winischhofer.net> * - * 2003/08/18: Rewritten for using VRAM command queue - * */ #include "sisusb.h" diff --git a/src/sisusb_accel.h b/src/sisusb_accel.h index 56afea5..e214532 100644 --- a/src/sisusb_accel.h +++ b/src/sisusb_accel.h @@ -30,8 +30,6 @@ * * Author: Thomas Winischhofer <thomas@winischhofer.net> * - * 2003/08/18: Added VRAM queue support - * */ /* Engine commands */ @@ -226,15 +224,15 @@ #define SiSUSBGetSwWP() (CARD32)(*(pSiSUSB->cmdQ_SharedWritePort)) #define SiSUSBGetHwRP() (CARD32)(SIS_MMIO_IN32(pSiSUSB->IOBase, Q_READ_PTR)) -#define SiSUSBFlushCmdBuf +#define SiSUSBFlushCmdBuf #define SiSUSBSyncWP \ SiSUSBFlushCmdBuf; \ - SIS_MMIO_OUT32(pSiSUSB->IOBase, Q_WRITE_PTR, (CARD32)(*(pSiSUSB->cmdQ_SharedWritePort))); - + SIS_MMIO_OUT32(pSiSUSB->IOBase, Q_WRITE_PTR, (CARD32)(*(pSiSUSB->cmdQ_SharedWritePort))); + #define SiSUSBSetHwWP(p) \ *(pSiSUSB->cmdQ_SharedWritePort) = (p); \ - SIS_MMIO_OUT32(pSiSUSB->IOBase, Q_WRITE_PTR, (p)); + SIS_MMIO_OUT32(pSiSUSB->IOBase, Q_WRITE_PTR, (p)); #define SiSUSBSetSwWP(p) *(pSiSUSB->cmdQ_SharedWritePort) = (p); @@ -707,9 +705,9 @@ } typedef struct _SiSUSB_Packet12_YUV { - CARD32 P12_Header0; - CARD32 P12_Header1; - CARD16 P12_UVPitch; /* 8200 UV if planar, Y if packed */ + CARD32 P12_Header0; + CARD32 P12_Header1; + CARD16 P12_UVPitch; /* 8200 UV if planar, Y if packed */ CARD16 P12_Unused0; /* 8202 */ CARD16 P12_YPitch; /* 8204 Y if planar */ CARD16 P12_AGPBase; /* 8206 */ @@ -735,7 +733,7 @@ typedef struct _SiSUSB_Packet12_YUV { CARD32 P12_Command; /* 823c */ CARD32 P12_Null1; CARD32 P12_Null2; -} SiSUSB_Packet12_YUV; +} SiSUSB_Packet12_YUV; #define SiSUSBWritePacketPart(part1, part2, part3, part4) \ { \ @@ -748,7 +746,7 @@ typedef struct _SiSUSB_Packet12_YUV { SiSUSBUpdateQueue \ SiSUSBSetSwWP(ttt); \ } - + #endif /* VRAM mode */ /* ---- MMIO mode ---- */ diff --git a/src/sisusb_driver.c b/src/sisusb_driver.c index 701941c..cf3eedb 100644 --- a/src/sisusb_driver.c +++ b/src/sisusb_driver.c @@ -578,14 +578,11 @@ SISUSBCalculateGammaRamp(ScreenPtr pScreen, ScrnInfoPtr pScrn) SISUSBPtr pSiSUSB = SISUSBPTR(pScrn); int i, j, nramp; UShort *ramp[3]; - float gamma_max[3], gamma_prescale[3], framp; + float gamma_max[3], framp; gamma_max[0] = (float)pSiSUSB->GammaBriR / 1000; gamma_max[1] = (float)pSiSUSB->GammaBriG / 1000; gamma_max[2] = (float)pSiSUSB->GammaBriB / 1000; - gamma_prescale[0] = (float)pSiSUSB->GammaPBriR / 1000; - gamma_prescale[1] = (float)pSiSUSB->GammaPBriG / 1000; - gamma_prescale[2] = (float)pSiSUSB->GammaPBriB / 1000; if(!(nramp = xf86GetGammaRampSize(pScreen))) return; @@ -601,7 +598,7 @@ SISUSBCalculateGammaRamp(ScreenPtr pScreen, ScrnInfoPtr pScrn) for(i = 0; i < 3; i++) { int fullscale = 65535 * gamma_max[i]; float dramp = 1. / (nramp - 1); - float invgamma=0.0, v; + float invgamma = 0.0, v; switch(i) { case 0: invgamma = 1. / pScrn->gamma.red; break; @@ -610,7 +607,7 @@ SISUSBCalculateGammaRamp(ScreenPtr pScreen, ScrnInfoPtr pScrn) } for(j = 0; j < nramp; j++) { - framp = pow(gamma_prescale[i] * j * dramp, invgamma); + framp = pow(j * dramp, invgamma); v = (fullscale < 0) ? (65535 + fullscale * framp) : fullscale * framp; @@ -1890,9 +1887,9 @@ SISUSBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } #ifdef SISGAMMARAMP - if((pSiSUSB->GammaBriR != 1000) || (pSiSUSB->GammaBriG != 1000) || - (pSiSUSB->GammaBriB != 1000) || (pSiSUSB->GammaPBriR != 1000) || - (pSiSUSB->GammaPBriG != 1000) || (pSiSUSB->GammaPBriB != 1000)) { + if((pSiSUSB->GammaBriR != 1000) || + (pSiSUSB->GammaBriB != 1000) || + (pSiSUSB->GammaBriG != 1000)) { SISUSBCalculateGammaRamp(pScreen, pScrn); } #endif diff --git a/src/sisusb_init.c b/src/sisusb_init.c index fc2ca72..baaece0 100644 --- a/src/sisusb_init.c +++ b/src/sisusb_init.c @@ -2,7 +2,7 @@ /* $XdotOrg$ */ /* * Mode initializing code (CRT1 section) for SiS315/USB - * (Universal module for Linux kernel framebuffer and XFree86 4.x) + * (Universal module for Linux kernel framebuffer and X.org/XFree86 4.x) * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria * diff --git a/src/sisusb_opt.c b/src/sisusb_opt.c index 7574e0e..ef9a4eb 100644 --- a/src/sisusb_opt.c +++ b/src/sisusb_opt.c @@ -27,8 +27,8 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Authors: Thomas Winischhofer <thomas@winischhofer.net> - * ? + * Author: Thomas Winischhofer <thomas@winischhofer.net> + * */ #include "sisusb.h" @@ -60,9 +60,7 @@ typedef enum { OPTION_XVYUVCHROMAKEY, OPTION_ENABLESISCTRL, OPTION_STOREDBRI, - OPTION_STOREDPBRI, OPTION_STOREDBRI2, - OPTION_STOREDPBRI2, OPTION_DISCONNTIMEOUT, OPTION_PSEUDO } SISUSBOpts; @@ -79,9 +77,7 @@ static const OptionInfoRec SISUSBOptions[] = { { OPTION_RESTOREBYSET, "RestoreBySetMode", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_CRT1GAMMA, "CRT1Gamma", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_STOREDBRI, "GammaBrightness", OPTV_STRING, {0}, FALSE }, - { OPTION_STOREDPBRI, "GammaPreBrightness", OPTV_STRING, {0}, FALSE }, { OPTION_STOREDBRI, "StoredGammaBrightness", OPTV_STRING, {0}, FALSE }, - { OPTION_STOREDPBRI, "StoredGammaPreBrightness",OPTV_STRING, {0}, FALSE }, { OPTION_XVGAMMA, "XvGamma", OPTV_STRING, {0}, FALSE }, { OPTION_XVDEFCONTRAST, "XvDefaultContrast", OPTV_INTEGER, {0}, FALSE }, { OPTION_XVDEFBRIGHTNESS, "XvDefaultBrightness", OPTV_INTEGER, {0}, FALSE }, @@ -238,7 +234,6 @@ SiSUSBOptions(ScrnInfoPtr pScrn) pSiSUSB->XvGammaRed = pSiSUSB->XvGammaGreen = pSiSUSB->XvGammaBlue = pSiSUSB->XvGammaRedDef = pSiSUSB->XvGammaGreenDef = pSiSUSB->XvGammaBlueDef = 1000; pSiSUSB->GammaBriR = pSiSUSB->GammaBriG = pSiSUSB->GammaBriB = 1000; - pSiSUSB->GammaPBriR = pSiSUSB->GammaPBriG = pSiSUSB->GammaPBriB = 1000; pSiSUSB->HideHWCursor = FALSE; pSiSUSB->HWCursorIsVisible = FALSE; @@ -465,18 +460,9 @@ SiSUSBOptions(ScrnInfoPtr pScrn) } } - { - Bool GotBri = FALSE, GotPBri = FALSE; - if((strptr = (char *)xf86GetOptValString(pSiSUSB->Options, OPTION_STOREDBRI))) { - SiSUSB_EvalOneOrThreeFloats(pScrn, OPTION_STOREDBRI, briopt, strptr, - &pSiSUSB->GammaBriR, &pSiSUSB->GammaBriG, &pSiSUSB->GammaBriB); - GotBri = TRUE; - } - if((strptr = (char *)xf86GetOptValString(pSiSUSB->Options, OPTION_STOREDPBRI))) { - SiSUSB_EvalOneOrThreeFloats(pScrn, OPTION_STOREDPBRI, briopt, strptr, - &pSiSUSB->GammaPBriR, &pSiSUSB->GammaPBriG, &pSiSUSB->GammaPBriB); - GotPBri = TRUE; - } + if((strptr = (char *)xf86GetOptValString(pSiSUSB->Options, OPTION_STOREDBRI))) { + SiSUSB_EvalOneOrThreeFloats(pScrn, OPTION_STOREDBRI, briopt, strptr, + &pSiSUSB->GammaBriR, &pSiSUSB->GammaBriG, &pSiSUSB->GammaBriB); } } diff --git a/src/sisusb_osdef.h b/src/sisusb_osdef.h index 4864ba5..2da19db 100644 --- a/src/sisusb_osdef.h +++ b/src/sisusb_osdef.h @@ -47,7 +47,6 @@ * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Thomas Winischhofer <thomas@winischhofer.net> - * Silicon Integrated Systems, Inc. (used by permission) * */ diff --git a/src/sisusb_regs.h b/src/sisusb_regs.h index 3d5f1d0..d299924 100644 --- a/src/sisusb_regs.h +++ b/src/sisusb_regs.h @@ -27,6 +27,8 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * Author: Thomas Winischhofer <thomas@winischhofer.net> + * */ #ifndef _SISUSB_REGS_H_ diff --git a/src/sisusb_utility.c b/src/sisusb_utility.c index 352b62a..98931b3 100644 --- a/src/sisusb_utility.c +++ b/src/sisusb_utility.c @@ -1199,11 +1199,11 @@ SISUSBGetPortUtilAttribute(ScrnInfoPtr pScrn, Atom attribute, } else if(attribute == pSiSUSB->xv_BRB) { *value = pSiSUSB->GammaBriB; } else if(attribute == pSiSUSB->xv_PBR) { - *value = pSiSUSB->GammaPBriR; + *value = 1000; } else if(attribute == pSiSUSB->xv_PBG) { - *value = pSiSUSB->GammaPBriG; + *value = 1000; } else if(attribute == pSiSUSB->xv_PBB) { - *value = pSiSUSB->GammaPBriB; + *value = 1000; } else if(attribute == pSiSUSB->xv_BRR2) { *value = pSiSUSB->GammaBriR; } else if(attribute == pSiSUSB->xv_BRG2) { @@ -1211,11 +1211,11 @@ SISUSBGetPortUtilAttribute(ScrnInfoPtr pScrn, Atom attribute, } else if(attribute == pSiSUSB->xv_BRB2) { *value = pSiSUSB->GammaBriB; } else if(attribute == pSiSUSB->xv_PBR2) { - *value = pSiSUSB->GammaPBriR; + *value = 1000; } else if(attribute == pSiSUSB->xv_PBG2) { - *value = pSiSUSB->GammaPBriG; + *value = 1000; } else if(attribute == pSiSUSB->xv_PBB2) { - *value = pSiSUSB->GammaPBriB; + *value = 1000; } else if(attribute == pSiSUSB->xv_GARC2) { *value = 1000; } else if(attribute == pSiSUSB->xv_GAGC2) { diff --git a/src/sisusb_vga.c b/src/sisusb_vga.c index ecdb964..5a461ea 100644 --- a/src/sisusb_vga.c +++ b/src/sisusb_vga.c @@ -5,11 +5,6 @@ * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. * - * The SISUSBInit() function for old series (except TV and FIFO calculation) - * was previously based on code which was Copyright (C) 1998,1999 by Alan - * Hourihane, Wigan, England. However, the code has been rewritten entirely - * and is - it its current representation - not covered by this old copyright. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -115,7 +110,7 @@ SISUSB300Init(ScrnInfoPtr pScrn, DisplayModePtr mode) void SISUSBVGAPreInit(ScrnInfoPtr pScrn) { SISUSBPtr pSiSUSB = SISUSBPTR(pScrn); - + pSiSUSB->ModeInit = SISUSB300Init; pSiSUSB->VBFlags = pSiSUSB->VBFlags2 = 0; /* reset VBFlags */ @@ -164,7 +159,7 @@ SISUSBVGALock(SISUSBPtr pSiSUSB) void SiSUSBVGAUnlock(SISUSBPtr pSiSUSB) { - andSISIDXREG(pSiSUSB, SISCR, 0x11, 0x7f); /* Unprotect CRTC[0-7] */ + andSISIDXREG(pSiSUSB, SISCR, 0x11, 0x7f); /* Unprotect CRTC[0-7] */ } static void @@ -201,12 +196,12 @@ SiSUSBVGASaveColormap(ScrnInfoPtr pScrn, SISUSBRegPtr save) int i; if(pSiSUSB->VGACMapSaved) return; - - outSISREG(pSiSUSB, SISPEL, 0xff); - - outSISREG(pSiSUSB, SISCOLIDXR, 0x00); + + outSISREG(pSiSUSB, SISPEL, 0xff); + + outSISREG(pSiSUSB, SISCOLIDXR, 0x00); for(i = 0; i < 768; i++) { - save->sisDAC[i] = inSISREG(pSiSUSB, SISCOLDATA); + save->sisDAC[i] = inSISREG(pSiSUSB, SISCOLDATA); (void)inSISREG(pSiSUSB, SISINPSTAT); (void)inSISREG(pSiSUSB, SISINPSTAT); } @@ -235,13 +230,13 @@ SiSUSBVGARestoreMode(ScrnInfoPtr pScrn, SISUSBRegPtr restore) for(i = 1; i < 5; i++) { outSISIDXREG(pSiSUSB, SISSR, i, restore->sisRegs3C4[i]); } - + outSISIDXREG(pSiSUSB, SISCR, 17, restore->sisRegs3D4[17] & ~0x80); for(i = 0; i < 25; i++) { outSISIDXREG(pSiSUSB, SISCR, i, restore->sisRegs3D4[i]); } - + for(i = 0; i < 9; i++) { outSISIDXREG(pSiSUSB, SISGR, i, restore->sisRegsGR[i]); } @@ -258,14 +253,14 @@ SiSUSBVGARestoreColormap(ScrnInfoPtr pScrn, SISUSBRegPtr restore) { SISUSBPtr pSiSUSB = SISUSBPTR(pScrn); int i; - + if(!pSiSUSB->VGACMapSaved) return; - + outSISREG(pSiSUSB, SISPEL, 0xff); - + outSISREG(pSiSUSB, SISCOLIDX, 0x00); for(i = 0; i < 768; i++) { - outSISREG(pSiSUSB, SISCOLDATA, restore->sisDAC[i]); + outSISREG(pSiSUSB, SISCOLDATA, restore->sisDAC[i]); (void)inSISREG(pSiSUSB, SISINPSTAT); (void)inSISREG(pSiSUSB, SISINPSTAT); } @@ -277,7 +272,7 @@ void SiSUSBVGARestore(ScrnInfoPtr pScrn, SISUSBRegPtr restore, int flags) { if(restore == NULL) return; - + if(flags & SISVGA_SR_MODE) SiSUSBVGARestoreMode(pScrn, restore); if(flags & SISVGA_SR_CMAP) SiSUSBVGARestoreColormap(pScrn, restore); } @@ -295,18 +290,18 @@ SiSUSB_SeqReset(SISUSBPtr pSiSUSB, Bool start) void SiSUSBVGAProtect(ScrnInfoPtr pScrn, Bool on) { - SISUSBPtr pSiSUSB = SISUSBPTR(pScrn); + SISUSBPtr pSiSUSB = SISUSBPTR(pScrn); UChar tmp; - + if(!pScrn->vtSema) return; - + if(on) { inSISIDXREG(pSiSUSB, SISSR, 0x01, tmp); SiSUSB_SeqReset(pSiSUSB, TRUE); /* start synchronous reset */ - outSISIDXREG(pSiSUSB, SISSR, 0x01, tmp | 0x20); /* disable display */ + outSISIDXREG(pSiSUSB, SISSR, 0x01, tmp | 0x20); /* disable display */ SiSUSB_EnablePalette(pSiSUSB); } else { - andSISIDXREG(pSiSUSB, SISSR, 0x01, ~0x20); /* enable display */ + andSISIDXREG(pSiSUSB, SISSR, 0x01, ~0x20); /* enable display */ SiSUSB_SeqReset(pSiSUSB, FALSE); /* clear synchronous reset */ SiSUSB_DisablePalette(pSiSUSB); } @@ -331,9 +326,9 @@ SiSUSBVGASaveScreen(ScreenPtr pScreen, int mode) { ScrnInfoPtr pScrn = NULL; Bool on = xf86IsUnblank(mode); - + if(pScreen == NULL) return FALSE; - + pScrn = xf86Screens[pScreen->myNum]; if(pScrn->vtSema) { diff --git a/src/sisusb_video.c b/src/sisusb_video.c index 87e858d..2bfa13b 100644 --- a/src/sisusb_video.c +++ b/src/sisusb_video.c @@ -3,6 +3,11 @@ /* * Xv driver for SiS 315 USB * + * Note: The version of the 315 used in my dongle does not seem + * to support Xv at all. The overlay just won't show up. However, + * Xv is left enabled since I don't know if other versions of the + * dongle support the overlay. + * * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria. * * Redistribution and use in source and binary forms, with or without |