Skip to contentSkip to conversation

drivers/video/sis/ cleanups

PATCH New Adrian Bunk 1 participant 1 message Nov 21, 2004 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/video/sis/ cleanups

The patch below does the following cleanups under drivers/video/sis/ :
- make needlessly global code static
- remove the following unused functions:
- init.c: SiS_GetModeID
- init301.c: SiS_{Get,Set}TrumpReg

diffstat output:

 drivers/video/sis/init.c     |  150 -----------------------------------
 drivers/video/sis/init.h     |   91 +++++++++------------
 drivers/video/sis/init301.c  |   87 ++++++--------------
 drivers/video/sis/init301.h  |   66 +++++++--------
 drivers/video/sis/oem300.h   |   26 +++---
 drivers/video/sis/sis_main.c |    6 -
 drivers/video/sis/sis_main.h |   13 +--
 7 files changed, 128 insertions(+), 311 deletions(-)
drivers/video/sis/init.h renamed from drivers/video/sis/init.h.old +42 -49
@@ -85,43 +85,43 @@
 #endif
 
 /* Mode numbers */
-const USHORT  ModeIndex_320x200[]      = {0x59, 0x41, 0x00, 0x4f};
-const USHORT  ModeIndex_320x240[]      = {0x50, 0x56, 0x00, 0x53};
-const USHORT  ModeIndex_320x240_FSTN[] = {0x5a, 0x5b, 0x00, 0x00};  /* FSTN */
-const USHORT  ModeIndex_400x300[]      = {0x51, 0x57, 0x00, 0x54};
-const USHORT  ModeIndex_512x384[]      = {0x52, 0x58, 0x00, 0x5c};
-const USHORT  ModeIndex_640x400[]      = {0x2f, 0x5d, 0x00, 0x5e};
-const USHORT  ModeIndex_640x480[]      = {0x2e, 0x44, 0x00, 0x62};
-const USHORT  ModeIndex_720x480[]      = {0x31, 0x33, 0x00, 0x35};
-const USHORT  ModeIndex_720x576[]      = {0x32, 0x34, 0x00, 0x36};
-const USHORT  ModeIndex_768x576[]      = {0x5f, 0x60, 0x00, 0x61};
-const USHORT  ModeIndex_800x480[]      = {0x70, 0x7a, 0x00, 0x76};
-const USHORT  ModeIndex_800x600[]      = {0x30, 0x47, 0x00, 0x63};
-const USHORT  ModeIndex_848x480[]      = {0x39, 0x3b, 0x00, 0x3e};
-const USHORT  ModeIndex_856x480[]      = {0x3f, 0x42, 0x00, 0x45};
-const USHORT  ModeIndex_960x540[]      = {0x1d, 0x1e, 0x00, 0x1f};  /* 315 series only */
-const USHORT  ModeIndex_1024x768[]     = {0x38, 0x4a, 0x00, 0x64};
-const USHORT  ModeIndex_1024x576[]     = {0x71, 0x74, 0x00, 0x77};
-const USHORT  ModeIndex_1024x600[]     = {0x20, 0x21, 0x00, 0x22};  /* 300 series only */
-const USHORT  ModeIndex_1280x1024[]    = {0x3a, 0x4d, 0x00, 0x65};
-const USHORT  ModeIndex_1280x960[]     = {0x7c, 0x7d, 0x00, 0x7e};
-const USHORT  ModeIndex_1152x768[]     = {0x23, 0x24, 0x00, 0x25};  /* 300 series only */
-const USHORT  ModeIndex_1152x864[]     = {0x29, 0x2a, 0x00, 0x2b};
-const USHORT  ModeIndex_300_1280x768[] = {0x55, 0x5a, 0x00, 0x5b};
-const USHORT  ModeIndex_310_1280x768[] = {0x23, 0x24, 0x00, 0x25};
-const USHORT  ModeIndex_1280x720[]     = {0x79, 0x75, 0x00, 0x78};
-const USHORT  ModeIndex_1280x800[]     = {0x14, 0x15, 0x00, 0x16};
-const USHORT  ModeIndex_1360x768[]     = {0x48, 0x4b, 0x00, 0x4e};
-const USHORT  ModeIndex_300_1360x1024[]= {0x67, 0x6f, 0x00, 0x72};  /* 300 series, BARCO only */
-const USHORT  ModeIndex_1400x1050[]    = {0x26, 0x27, 0x00, 0x28};  /* 315 series only */
-const USHORT  ModeIndex_1680x1050[]    = {0x17, 0x18, 0x00, 0x19};  /* 315 series only */
-const USHORT  ModeIndex_1600x1200[]    = {0x3c, 0x3d, 0x00, 0x66};
-const USHORT  ModeIndex_1920x1080[]    = {0x2c, 0x2d, 0x00, 0x73};  /* 315 series only */
-const USHORT  ModeIndex_1920x1440[]    = {0x68, 0x69, 0x00, 0x6b};
-const USHORT  ModeIndex_300_2048x1536[]= {0x6c, 0x6d, 0x00, 0x00};
-const USHORT  ModeIndex_310_2048x1536[]= {0x6c, 0x6d, 0x00, 0x6e};
+static const USHORT  ModeIndex_320x200[]      = {0x59, 0x41, 0x00, 0x4f};
+static const USHORT  ModeIndex_320x240[]      = {0x50, 0x56, 0x00, 0x53};
+static const USHORT  ModeIndex_320x240_FSTN[] = {0x5a, 0x5b, 0x00, 0x00};  /* FSTN */
+static const USHORT  ModeIndex_400x300[]      = {0x51, 0x57, 0x00, 0x54};
+static const USHORT  ModeIndex_512x384[]      = {0x52, 0x58, 0x00, 0x5c};
+static const USHORT  ModeIndex_640x400[]      = {0x2f, 0x5d, 0x00, 0x5e};
+static const USHORT  ModeIndex_640x480[]      = {0x2e, 0x44, 0x00, 0x62};
+static const USHORT  ModeIndex_720x480[]      = {0x31, 0x33, 0x00, 0x35};
+static const USHORT  ModeIndex_720x576[]      = {0x32, 0x34, 0x00, 0x36};
+static const USHORT  ModeIndex_768x576[]      = {0x5f, 0x60, 0x00, 0x61};
+static const USHORT  ModeIndex_800x480[]      = {0x70, 0x7a, 0x00, 0x76};
+static const USHORT  ModeIndex_800x600[]      = {0x30, 0x47, 0x00, 0x63};
+static const USHORT  ModeIndex_848x480[]      = {0x39, 0x3b, 0x00, 0x3e};
+static const USHORT  ModeIndex_856x480[]      = {0x3f, 0x42, 0x00, 0x45};
+static const USHORT  ModeIndex_960x540[]      = {0x1d, 0x1e, 0x00, 0x1f};  /* 315 series only */
+static const USHORT  ModeIndex_1024x768[]     = {0x38, 0x4a, 0x00, 0x64};
+static const USHORT  ModeIndex_1024x576[]     = {0x71, 0x74, 0x00, 0x77};
+static const USHORT  ModeIndex_1024x600[]     = {0x20, 0x21, 0x00, 0x22};  /* 300 series only */
+static const USHORT  ModeIndex_1280x1024[]    = {0x3a, 0x4d, 0x00, 0x65};
+static const USHORT  ModeIndex_1280x960[]     = {0x7c, 0x7d, 0x00, 0x7e};
+static const USHORT  ModeIndex_1152x768[]     = {0x23, 0x24, 0x00, 0x25};  /* 300 series only */
+static const USHORT  ModeIndex_1152x864[]     = {0x29, 0x2a, 0x00, 0x2b};
+static const USHORT  ModeIndex_300_1280x768[] = {0x55, 0x5a, 0x00, 0x5b};
+static const USHORT  ModeIndex_310_1280x768[] = {0x23, 0x24, 0x00, 0x25};
+static const USHORT  ModeIndex_1280x720[]     = {0x79, 0x75, 0x00, 0x78};
+static const USHORT  ModeIndex_1280x800[]     = {0x14, 0x15, 0x00, 0x16};
+static const USHORT  ModeIndex_1360x768[]     = {0x48, 0x4b, 0x00, 0x4e};
+static const USHORT  ModeIndex_300_1360x1024[]= {0x67, 0x6f, 0x00, 0x72};  /* 300 series, BARCO only */
+static const USHORT  ModeIndex_1400x1050[]    = {0x26, 0x27, 0x00, 0x28};  /* 315 series only */
+static const USHORT  ModeIndex_1680x1050[]    = {0x17, 0x18, 0x00, 0x19};  /* 315 series only */
+static const USHORT  ModeIndex_1600x1200[]    = {0x3c, 0x3d, 0x00, 0x66};
+static const USHORT  ModeIndex_1920x1080[]    = {0x2c, 0x2d, 0x00, 0x73};  /* 315 series only */
+static const USHORT  ModeIndex_1920x1440[]    = {0x68, 0x69, 0x00, 0x6b};
+static const USHORT  ModeIndex_300_2048x1536[]= {0x6c, 0x6d, 0x00, 0x00};
+static const USHORT  ModeIndex_310_2048x1536[]= {0x6c, 0x6d, 0x00, 0x6e};
 
-const USHORT SiS_DRAMType[17][5]={
+static const USHORT SiS_DRAMType[17][5]={
 	{0x0C,0x0A,0x02,0x40,0x39},
 	{0x0D,0x0A,0x01,0x40,0x48},
 	{0x0C,0x09,0x02,0x20,0x35},
@@ -141,7 +141,7 @@
 	{0x09,0x08,0x01,0x01,0x00}
 };
 
-const USHORT SiS_SDRDRAM_TYPE[13][5] =
+static const USHORT SiS_SDRDRAM_TYPE[13][5] =
 {
 	{ 2,12, 9,64,0x35},
 	{ 1,13, 9,64,0x44},
@@ -158,7 +158,7 @@
 	{ 1, 9, 8, 2,0x00}
 };
 
-const USHORT SiS_DDRDRAM_TYPE[4][5] =
+static const USHORT SiS_DDRDRAM_TYPE[4][5] =
 {
 	{ 2,12, 9,64,0x35},
 	{ 2,12, 8,32,0x31},
@@ -166,7 +166,7 @@
 	{ 2, 9, 8, 4,0x01}
 };
 
-const USHORT SiS_MDA_DAC[] =
+static const USHORT SiS_MDA_DAC[] =
 {
 	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
         0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
@@ -178,7 +178,7 @@
         0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F
 };
 
-const USHORT SiS_CGA_DAC[] =
+static const USHORT SiS_CGA_DAC[] =
 {
         0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
         0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
@@ -190,7 +190,7 @@
         0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F
 };
 
-const USHORT SiS_EGA_DAC[] =
+static const USHORT SiS_EGA_DAC[] =
 {
         0x00,0x10,0x04,0x14,0x01,0x11,0x05,0x15,
         0x20,0x30,0x24,0x34,0x21,0x31,0x25,0x35,
@@ -202,7 +202,7 @@
         0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F
 };
 
-const USHORT SiS_VGA_DAC[] =
+static const USHORT SiS_VGA_DAC[] =
 {
 	0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
 	0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F,
@@ -2361,10 +2361,6 @@
    { 0x0000 }
 };
 
-USHORT  SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay,
-			  int Depth, BOOLEAN FSTN, int LCDwith, int LCDheight);
-USHORT  SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN,
-                          USHORT CustomT, int LCDwith, int LCDheight);
 USHORT  SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
 USHORT  SiS_GetModeID_VGA2(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
 
@@ -2382,12 +2378,9 @@
 void	SiS_DisplayOn(SiS_Private *SiS_Pr);
 void	SiS_DisplayOff(SiS_Private *SiS_Pr);
 void	SiSRegInit(SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr);
-void	SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
 BOOLEAN SiSDetermineROMLayout661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
 void	SiS_SetEnableDstn(SiS_Private *SiS_Pr, int enable);
 void	SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable);
-void	SiS_GetVBType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
-USHORT	SiS_GetMCLK(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
 BOOLEAN	SiS_SearchModeID(SiS_Private *SiS_Pr, USHORT *ModeNo, USHORT *ModeIdIndex);
 UCHAR	SiS_GetModePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex);
 USHORT	SiS_GetColorDepth(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex);
drivers/video/sis/init.c renamed from drivers/video/sis/init.c.old +3 -147

174 lines not on this page · raw message

drivers/video/sis/init301.h renamed from drivers/video/sis/init301.h.old +32 -34

126 lines not on this page · raw message

drivers/video/sis/init301.c renamed from drivers/video/sis/init301.c.old +29 -58

273 lines not on this page · raw message

drivers/video/sis/oem300.h renamed from drivers/video/sis/oem300.h.old +13 -13
@@ -50,7 +50,7 @@
  *
  */
 
-const UCHAR SiS300_OEMTVDelay301[8][4] =
+static const UCHAR SiS300_OEMTVDelay301[8][4] =
 {
 	{0x08,0x08,0x08,0x08},
 	{0x08,0x08,0x08,0x08},
@@ -62,7 +62,7 @@
 	{0x20,0x20,0x20,0x20}
 };
 
-const UCHAR SiS300_OEMTVDelayLVDS[8][4] =
+static const UCHAR SiS300_OEMTVDelayLVDS[8][4] =
 {
 	{0x20,0x20,0x20,0x20},
 	{0x20,0x20,0x20,0x20},
@@ -74,7 +74,7 @@
 	{0x20,0x20,0x20,0x20}
 };
 
-const UCHAR SiS300_OEMTVFlicker[8][4] =
+static const UCHAR SiS300_OEMTVFlicker[8][4] =
 {
 	{0x00,0x00,0x00,0x00},
 	{0x00,0x00,0x00,0x00},
@@ -87,7 +87,7 @@
 };
 
 #if 0   /* TW: Not used */
-const UCHAR SiS300_OEMLCDDelay1[12][4]={
+static const UCHAR SiS300_OEMLCDDelay1[12][4]={
 	{0x2c,0x2c,0x2c,0x2c},
 	{0x20,0x20,0x20,0x20},
 	{0x20,0x20,0x20,0x20},
@@ -104,7 +104,7 @@
 #endif
 
 /* TW: From 630/301B BIOS */
-const UCHAR SiS300_OEMLCDDelay2[64][4] =		 /* for 301/301b/302b/301LV/302LV */
+static const UCHAR SiS300_OEMLCDDelay2[64][4] =		 /* for 301/301b/302b/301LV/302LV */
 {
 	{0x20,0x20,0x20,0x20},
 	{0x20,0x20,0x20,0x20},
@@ -173,7 +173,7 @@
 };
 
 /* TW: From 300/301LV BIOS */
-const UCHAR SiS300_OEMLCDDelay4[12][4] =
+static const UCHAR SiS300_OEMLCDDelay4[12][4] =
 {
 	{0x2c,0x2c,0x2c,0x2c},
 	{0x20,0x20,0x20,0x20},
@@ -190,7 +190,7 @@
 };
 
 /* TW: From 300/301LV BIOS */
-const UCHAR SiS300_OEMLCDDelay5[32][4] =
+static const UCHAR SiS300_OEMLCDDelay5[32][4] =
 {
 	{0x20,0x20,0x20,0x20},
 	{0x20,0x20,0x20,0x20},
@@ -227,7 +227,7 @@
 };
 
 /* TW: Added for LVDS */
-const UCHAR SiS300_OEMLCDDelay3[64][4] = {	/* For LVDS */
+static const UCHAR SiS300_OEMLCDDelay3[64][4] = {	/* For LVDS */
 	{0x20,0x20,0x20,0x20},
 	{0x20,0x20,0x20,0x20},
 	{0x20,0x20,0x20,0x20},
@@ -294,7 +294,7 @@
 	{0x20,0x20,0x20,0x20}
 };
 
-const UCHAR SiS300_Phase1[8][5][4] =
+static const UCHAR SiS300_Phase1[8][5][4] =
 {
     {
 	{0x21,0xed,0x00,0x08},
@@ -355,7 +355,7 @@
 };
 
 
-const UCHAR SiS300_Phase2[8][5][4] =
+static const UCHAR SiS300_Phase2[8][5][4] =
 {
     {
         {0x21,0xed,0x00,0x08},
@@ -415,7 +415,7 @@
     }
 };
 
-const UCHAR SiS300_Filter1[10][16][4] =
+static const UCHAR SiS300_Filter1[10][16][4] =
 {
     {
 	{0x00,0xf4,0x10,0x38},
@@ -599,7 +599,7 @@
     },
 };
 
-const UCHAR SiS300_Filter2[10][9][7] =
+static const UCHAR SiS300_Filter2[10][9][7] =
 {
     {
 	{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
@@ -714,7 +714,7 @@
 };
 
 /* Custom data for Barco iQ Pro R300 */
-const UCHAR barco_p1[2][9][7][3] = {
+static const UCHAR barco_p1[2][9][7][3] = {
     {
 	{  { 0x16, 0xcf, 0x00 },
 	   { 0x18, 0x00, 0x00 },
drivers/video/sis/sis_main.h renamed from drivers/video/sis/sis_main.h.old +6 -7
@@ -153,7 +153,7 @@
    now (hoping that nobody is crazy enough to run two
    SiS cards at the same time).
  */
-SIS_HEAP       	sisfb_heap;
+static	SIS_HEAP       	sisfb_heap;
 
 #define MD_SIS300 1
 #define MD_SIS315 2
@@ -336,19 +336,19 @@
 };
 
 /* CR36 evaluation */
-const USHORT sis300paneltype[] =
+static const USHORT sis300paneltype[] =
     { LCD_UNKNOWN,   LCD_800x600,   LCD_1024x768,  LCD_1280x1024,
       LCD_1280x960,  LCD_640x480,   LCD_1024x600,  LCD_1152x768,
       LCD_UNKNOWN,   LCD_UNKNOWN,   LCD_UNKNOWN,   LCD_UNKNOWN,
       LCD_UNKNOWN,   LCD_UNKNOWN,   LCD_UNKNOWN,   LCD_UNKNOWN };
 
-const USHORT sis310paneltype[] =
+static const USHORT sis310paneltype[] =
     { LCD_UNKNOWN,   LCD_800x600,   LCD_1024x768,  LCD_1280x1024,
       LCD_640x480,   LCD_1024x600,  LCD_1152x864,  LCD_1280x960,
       LCD_1152x768,  LCD_1400x1050, LCD_1280x768,  LCD_1600x1200,
       LCD_640x480_2, LCD_640x480_3, LCD_UNKNOWN,   LCD_UNKNOWN };
 
-const USHORT sis661paneltype[] =
+static const USHORT sis661paneltype[] =
     { LCD_UNKNOWN,   LCD_800x600,   LCD_1024x768,  LCD_1280x1024,
       LCD_640x480,   LCD_1024x600,  LCD_1152x864,  LCD_1280x960,
       LCD_1152x768,  LCD_1400x1050, LCD_1280x768,  LCD_1600x1200,
@@ -800,11 +800,11 @@
 
 /* Interface used by the world */
 #ifndef MODULE
-int             sisfb_setup(char *options);
+static int      sisfb_setup(char *options);
 #endif
 
 /* Interface to the low level console driver */
-int             sisfb_init(void);
+static int      sisfb_init(void);
 
 
 /* fbdev routines */
@@ -908,7 +908,6 @@
 static void     SiS_SenseCh(struct sis_video_info *ivideo);
 
 /* Routines from init.c/init301.c */
-extern USHORT   SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN);
 extern USHORT   SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth,
                                   BOOLEAN FSTN, USHORT CustomT, int LCDwith, int LCDheight);
 extern USHORT   SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth);
drivers/video/sis/sis_main.c renamed from drivers/video/sis/sis_main.c.old +3 -3
@@ -3840,7 +3840,7 @@
 }
 
 #ifndef MODULE
-int __init sisfb_setup(char *options)
+static int __init sisfb_setup(char *options)
 {
 	char *this_opt;
 	
@@ -4736,7 +4736,7 @@
 #endif
 
 
-int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+static int __devinit sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct sisfb_chip_info 	*chipinfo = &sisfb_chip_info[ent->driver_data];
 	struct sis_video_info 	*ivideo = NULL;
@@ -5720,7 +5720,7 @@
 	.remove 	= __devexit_p(sisfb_remove)
 };
 
-int __init sisfb_init(void)
+static int __init sisfb_init(void)
 {
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,8)
 #ifndef MODULE