linux/drivers/staging/xgifb/vb_struct.h

202 lines
4.7 KiB
C
Raw Normal View History

#ifndef _VB_STRUCT_
#define _VB_STRUCT_
#include "../../video/sis/vstruct.h"
struct XGI_LVDSCRT1HDataStruct {
unsigned char Reg[8];
};
struct XGI_LVDSCRT1VDataStruct {
unsigned char Reg[7];
};
struct XGI_ExtStruct {
unsigned char Ext_ModeID;
unsigned short Ext_ModeFlag;
unsigned short Ext_ModeInfo;
unsigned char Ext_RESINFO;
unsigned char VB_ExtTVYFilterIndex;
unsigned char REFindex;
};
struct XGI_Ext2Struct {
unsigned short Ext_InfoFlag;
unsigned char Ext_CRT1CRTC;
unsigned char Ext_CRTVCLK;
unsigned char Ext_CRT2CRTC;
unsigned char Ext_CRT2CRTC2;
unsigned char ModeID;
unsigned short XRes;
unsigned short YRes;
};
struct XGI_ECLKDataStruct {
unsigned char SR2E, SR2F, SR30;
unsigned short CLOCK;
};
/*add for new UNIVGABIOS*/
struct XGI_LCDDesStruct {
unsigned short LCDHDES;
unsigned short LCDHRS;
unsigned short LCDVDES;
unsigned short LCDVRS;
};
struct XGI330_LCDDataDesStruct2 {
unsigned short LCDHDES;
unsigned short LCDHRS;
unsigned short LCDVDES;
unsigned short LCDVRS;
unsigned short LCDHSync;
unsigned short LCDVSync;
};
struct XGI330_LCDDataTablStruct {
unsigned char PANELID;
unsigned short MASK;
unsigned short CAP;
unsigned short DATAPTR;
};
struct XGI330_TVDataTablStruct {
unsigned short MASK;
unsigned short CAP;
struct SiS_TVData const *DATAPTR;
};
struct XGI_TimingHStruct {
unsigned char data[8];
};
struct XGI_TimingVStruct {
unsigned char data[7];
};
struct XGI_XG21CRT1Struct {
unsigned char ModeID, CR02, CR03, CR15, CR16;
};
struct XGI330_LCDCapStruct {
unsigned char LCD_ID;
unsigned short LCD_Capability;
unsigned char LCD_SetFlag;
unsigned char LCD_HSyncWidth;
unsigned char LCD_VSyncWidth;
unsigned char LCD_VCLK;
unsigned char LCDA_VCLKData1;
unsigned char LCDA_VCLKData2;
unsigned char LCUCHAR_VCLKData1;
unsigned char LCUCHAR_VCLKData2;
unsigned char PSC_S1;
unsigned char PSC_S2;
unsigned char PSC_S3;
unsigned char PSC_S4;
unsigned char PSC_S5;
unsigned char PWD_2B;
unsigned char PWD_2C;
unsigned char PWD_2D;
unsigned char PWD_2E;
unsigned char PWD_2F;
unsigned char Spectrum_31;
unsigned char Spectrum_32;
unsigned char Spectrum_33;
unsigned char Spectrum_34;
};
struct XGI21_LVDSCapStruct {
unsigned short LVDS_Capability;
unsigned short LVDSHT;
unsigned short LVDSVT;
unsigned short LVDSHDE;
unsigned short LVDSVDE;
unsigned short LVDSHFP;
unsigned short LVDSVFP;
unsigned short LVDSHSYNC;
unsigned short LVDSVSYNC;
unsigned char VCLKData1;
unsigned char VCLKData2;
unsigned char PSC_S1; /* Duration between CPL on and signal on */
unsigned char PSC_S2; /* Duration signal on and Vdd on */
unsigned char PSC_S3; /* Duration between CPL off and signal off */
unsigned char PSC_S4; /* Duration signal off and Vdd off */
unsigned char PSC_S5;
};
struct XGI_CRT1TableStruct {
unsigned char CR[16];
};
struct XGI301C_Tap4TimingStruct {
unsigned short DE;
unsigned char Reg[64]; /* C0-FF */
};
struct vb_device_info {
unsigned long P3c4, P3d4, P3c0, P3ce, P3c2, P3cc;
unsigned long P3ca, P3c6, P3c7, P3c8, P3c9, P3da;
unsigned long Part0Port, Part1Port, Part2Port;
unsigned long Part3Port, Part4Port, Part5Port;
unsigned short RVBHCFACT, RVBHCMAX, RVBHRS;
unsigned short VGAVT, VGAHT, VGAVDE, VGAHDE;
unsigned short VT, HT, VDE, HDE;
unsigned short LCDHRS, LCDVRS, LCDHDES, LCDVDES;
unsigned short ModeType;
unsigned short IF_DEF_LVDS, IF_DEF_TRUMPION, IF_DEF_DSTN;
unsigned short IF_DEF_CRT2Monitor;
unsigned short IF_DEF_YPbPr;
unsigned short IF_DEF_HiVision;
unsigned short LCDResInfo, LCDTypeInfo, VBType;/*301b*/
unsigned short VBInfo, TVInfo, LCDInfo;
unsigned short SetFlag;
unsigned short NewFlickerMode;
unsigned short SelectCRT2Rate;
staging: xgifb: vb_init: use readl()/writel() to access iomapped memory Use readl() and writel() in FB memory test instead of direct pointer access, and also add iomem annotations for the FB memory. The patch eliminates the following sparse warnings: drivers/staging/xgifb/XGI_main_26.c:2113:69: warning: incorrect type in assignment (different address spaces) drivers/staging/xgifb/XGI_main_26.c:2113:69: expected unsigned char *static [addressable] [toplevel] [assigned] pjVideoMemoryAddress drivers/staging/xgifb/XGI_main_26.c:2113:69: got void [noderef] <asn:2>* drivers/staging/xgifb/XGI_main_26.c:2399:30: warning: incorrect type in assignment (different address spaces) drivers/staging/xgifb/XGI_main_26.c:2399:30: expected char [noderef] <asn:2>*screen_base drivers/staging/xgifb/XGI_main_26.c:2399:30: got char *[addressable] [toplevel] [assigned] video_vbase drivers/staging/xgifb/XGI_main_26.c:2430:31: warning: incorrect type in argument 1 (different address spaces) drivers/staging/xgifb/XGI_main_26.c:2430:31: expected void volatile [noderef] <asn:2>*addr drivers/staging/xgifb/XGI_main_26.c:2430:31: got char *[addressable] [toplevel] [assigned] video_vbase drivers/staging/xgifb/XGI_main_26.c:2454:31: warning: incorrect type in argument 1 (different address spaces) drivers/staging/xgifb/XGI_main_26.c:2454:31: expected void volatile [noderef] <asn:2>*addr drivers/staging/xgifb/XGI_main_26.c:2454:31: got char *[addressable] [toplev Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-13 21:49:33 +02:00
void __iomem *FBAddr;
unsigned long BaseAddr;
unsigned char (*CR6B)[4];
unsigned char (*CR6E)[4];
unsigned char (*CR6F)[32];
unsigned char (*CR89)[2];
unsigned char (*SR15)[8];
unsigned char (*CR40)[8];
unsigned char *AGPReg;
unsigned char *SR16;
staging/xgifb: Cleanup vb_device_info struct This patch cleans up the vb_device_info struct and the related functions. The cleanup decreases the size of the compiled module by about 10kB. == Remove fields in vb_device_info that are never read: == pOutputSelect pRGBSenseData pRGBSenseData2 pVideoSenseData pVideoSenseData2 pYCSenseData pYCSenseData2 CR49 pXGINew_I2CDefinition pCR2E pCR2F pCR46 pCR47 pCRD0 pCRDE pSR40 pSR41 pCR47 === Remove the corresponding 'constants' === XGI330_RGBSenseData XGI330_RGBSenseData2 XGI330_VideoSenseData XGI330_VideoSenseData2 XGI330_YCSenseData XGI330_YCSenseData2 XGI330_CR49 XG40_I2CDefinition XG21_CR2E XG21_CR2F XG21_CR46 XG21_CR47 XG27_CRD0 XG27_CRDE XGI330_OutputSelect == Remove 'constant fields' and replace constant value with #define == pSR07 = XGI330_SR07 -> 0x18 pSR1F = XGI330_SR1F -> 0 pSR23 = XGI330_SR23 -> 0xf6 pSR24 = XGI330_SR24 -> 0x0d pSR33 = XGI330_SR33 ->0 pCRT2Data_1_2 = XGI330_CRT2Data_1_2 -> 0 pCRT2Data_4_D = XGI330_CRT2Data_4_D -> 0 pCRT2Data_4_E = XGI330_CRT2Data_4_E -> 0 pCRT2Data_4_10 = XGI330_CRT2Data_4_10 -> 0x80 pSR36 = XG27_SR36 -> 0x30 pCR8F = &XG27_CR8F -> 0x0C pSR40 = XG27_SR40 -> 0x04 pSR41 = XG27_SR41 ->0x00 pSR31 = XGI330_SR31 -> 0xc0 pSR32 = XGI330_SR32 -> 0xc0 SR25 = XGI330_sr25 -> 0 (we only use XGI330_sr25[0]) == Constant fields with 'dead' code: == pSoftSetting is set to XGI330_SoftSetting = 0x30 -> if (*pVBInfo->pSoftSetting & SoftDRAMType) is never true since SoftDRAMType = 0x80 -> if (*pVBInfo->pSoftSetting & ModeSoftSetting) is never true since ModeSoftSetting = 0x04 --> remove the code, remove pSoftSetting, remove XGI330_SoftSetting pDVOSetting is set to XG21_DVOSetting = 0 -> if (((*pVBInfo->pDVOSetting) & 0xC0) == 0xC0) is never true --> remove the code, remove pDVOSetting, remove XG21_DVOSetting pXGINew_DRAMTypeDefinition is set to &XG40_DRAMTypeDefinition 0xFF -> if (*pVBInfo->pXGINew_DRAMTypeDefinition != 0x0C) is always true --> remove the if and remove pXGINew_DRAMTypeDefinition remove XG40_DRAMTypeDefinition == Replace pointer to unsigned char with unsigned char variable and assign value of referenced pointer: == pSR21 -> SR21, remove XGI330_SR21 pSR22 -> SR22, remove XGI330_SR22 pXGINew_CR97 -> XGINew_CR97, remove XG20_CR97, XG27_CR97 and Z11m_CR97 Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-14 00:21:52 +02:00
unsigned char SR21;
unsigned char SR22;
unsigned char SR25;
struct SiS_MCLKData *MCLKData;
struct XGI_ECLKDataStruct *ECLKData;
unsigned char *ScreenOffset;
unsigned char *pXGINew_DRAMTypeDefinition;
staging/xgifb: Cleanup vb_device_info struct This patch cleans up the vb_device_info struct and the related functions. The cleanup decreases the size of the compiled module by about 10kB. == Remove fields in vb_device_info that are never read: == pOutputSelect pRGBSenseData pRGBSenseData2 pVideoSenseData pVideoSenseData2 pYCSenseData pYCSenseData2 CR49 pXGINew_I2CDefinition pCR2E pCR2F pCR46 pCR47 pCRD0 pCRDE pSR40 pSR41 pCR47 === Remove the corresponding 'constants' === XGI330_RGBSenseData XGI330_RGBSenseData2 XGI330_VideoSenseData XGI330_VideoSenseData2 XGI330_YCSenseData XGI330_YCSenseData2 XGI330_CR49 XG40_I2CDefinition XG21_CR2E XG21_CR2F XG21_CR46 XG21_CR47 XG27_CRD0 XG27_CRDE XGI330_OutputSelect == Remove 'constant fields' and replace constant value with #define == pSR07 = XGI330_SR07 -> 0x18 pSR1F = XGI330_SR1F -> 0 pSR23 = XGI330_SR23 -> 0xf6 pSR24 = XGI330_SR24 -> 0x0d pSR33 = XGI330_SR33 ->0 pCRT2Data_1_2 = XGI330_CRT2Data_1_2 -> 0 pCRT2Data_4_D = XGI330_CRT2Data_4_D -> 0 pCRT2Data_4_E = XGI330_CRT2Data_4_E -> 0 pCRT2Data_4_10 = XGI330_CRT2Data_4_10 -> 0x80 pSR36 = XG27_SR36 -> 0x30 pCR8F = &XG27_CR8F -> 0x0C pSR40 = XG27_SR40 -> 0x04 pSR41 = XG27_SR41 ->0x00 pSR31 = XGI330_SR31 -> 0xc0 pSR32 = XGI330_SR32 -> 0xc0 SR25 = XGI330_sr25 -> 0 (we only use XGI330_sr25[0]) == Constant fields with 'dead' code: == pSoftSetting is set to XGI330_SoftSetting = 0x30 -> if (*pVBInfo->pSoftSetting & SoftDRAMType) is never true since SoftDRAMType = 0x80 -> if (*pVBInfo->pSoftSetting & ModeSoftSetting) is never true since ModeSoftSetting = 0x04 --> remove the code, remove pSoftSetting, remove XGI330_SoftSetting pDVOSetting is set to XG21_DVOSetting = 0 -> if (((*pVBInfo->pDVOSetting) & 0xC0) == 0xC0) is never true --> remove the code, remove pDVOSetting, remove XG21_DVOSetting pXGINew_DRAMTypeDefinition is set to &XG40_DRAMTypeDefinition 0xFF -> if (*pVBInfo->pXGINew_DRAMTypeDefinition != 0x0C) is always true --> remove the if and remove pXGINew_DRAMTypeDefinition remove XG40_DRAMTypeDefinition == Replace pointer to unsigned char with unsigned char variable and assign value of referenced pointer: == pSR21 -> SR21, remove XGI330_SR21 pSR22 -> SR22, remove XGI330_SR22 pXGINew_CR97 -> XGINew_CR97, remove XG20_CR97, XG27_CR97 and Z11m_CR97 Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-14 00:21:52 +02:00
unsigned char XGINew_CR97;
struct XGI330_LCDCapStruct *LCDCapList;
struct XGI_TimingHStruct *TimingH;
struct XGI_TimingVStruct *TimingV;
struct SiS_StandTable_S *StandTable;
struct XGI_ExtStruct *EModeIDTable;
struct XGI_Ext2Struct *RefIndex;
struct XGI_CRT1TableStruct *XGINEWUB_CRT1Table;
struct SiS_VCLKData *VCLKData;
struct SiS_VBVCLKData *VBVCLKData;
struct SiS_StResInfo_S *StResInfo;
struct SiS_ModeResInfo_S *ModeResInfo;
struct XGI_XG21CRT1Struct *UpdateCRT1;
int ram_type;
int ram_channel;
int ram_bus;
}; /* _struct vb_device_info */
#endif /* _VB_STRUCT_ */