Commit graph

76 commits

Author SHA1 Message Date
Rehas Sachdeva c7437f342d staging: xgifb: Avoid multiple blank lines
This patch removes the checkpatch.pl warnings regarding multiple blank
lines as single blank line is the preferred coding style.

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Tomi Valkeinen f7018c2135 video: move fbdev to drivers/video/fbdev
The drivers/video directory is a mess. It contains generic video related
files, directories for backlight, console, linux logo, lots of fbdev
device drivers, fbdev framework files.

Make some order into the chaos by creating drivers/video/fbdev
directory, and move all fbdev related files there.

No functionality is changed, although I guess it is possible that some
subtle Makefile build order related issue could be created by this
patch.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Rob Clark <robdclark@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-17 08:10:19 +03:00
Aaro Koskinen 597d96b63b staging: xgifb: rename SR15/SR13 arrays to SR18
Since we are programming SR register 18, better name structs/arrays
accordingly to avoid confusion.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 16:10:16 -07:00
Aaro Koskinen d8e7567e53 staging: xgifb: make SR15/SR13 arrays single dimensional
Since we only access the third row, we can delete the others.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 16:10:16 -07:00
Aaro Koskinen 99c66181b8 staging: xgifb: delete pXGINew_DRAMTypeDefinition
Delete unused struct field.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 16:10:15 -07:00
Aaro Koskinen abe0a2e05d staging: xgifb: delete XGI330_LCDCapStruct.PWD_2x
Delete unused XGI330_LCDCapStruct fields.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 16:10:15 -07:00
Aaro Koskinen d5a1b52b72 staging: xgifb: delete XGI330_LCDCapStruct.PSC_Sx
Delete unused XGI330_LCDCapStruct fields.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 16:10:15 -07:00
Aaro Koskinen 625030e5bf staging: xgifb: delete LCD_SetFlag
Delete redundant XGI330_LCDCapStruct field.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 16:10:15 -07:00
Aaro Koskinen 84a0b9b959 staging: xgifb: delete IF_DEF_TRUMPION and IF_DEF_DSTN
Delete some unused flags.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-28 16:10:15 -07:00
Peter Huewe 86c6c948da staging/xgifb: Remove unused values in XG27_SR13 and XGI340_SR13
In the lookup tables XG27_SR13 and XGI340_SR13 only the first three
 values are used of each 'line', thus the remaining fields can be
 removed.

Rationale:
- vb_init.c uses pVBInfo->ram_type for the 'column' index for
pVBInfo->SR15.

- pVBInfo->ram_type is assigned the return value of
XGINew_GetXG20DRAMType which can only be 0, 1 or 2

- pVBInfo->SR15 is assigned to either XG27_SR13 or XGI340_SR13 in
vb_setmode.c

-> only the first three values are used.
This becomes also evident as values 3-7 are all 0.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 13:45:09 -08:00
Peter Huewe 87be0afafa staging/xgifb: Remove unused values in XGI340_cr41 and XGI27_cr41
In the lookup tables XGI340_cr41 and XGI27_cr41 only the first three
values are used of each 'line', thus the remaining fields can be
removed.

Rationale:
- vb_init.c uses pVBInfo->ram_type for the 'column' index for
pVBInfo->CR40.

- pVBInfo->ram_type is assigned the return value of
  XGINew_GetXG20DRAMType which can only be 0, 1 or 2

- pVBInfo->CR40 is assigned to either XGI340_cr41 or XGI27_cr41 in
vb_setmode.c

-> only the first three values are used.
This becomes also evident as values 3-7 are all 0.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-05 13:45:09 -08:00
Aaro Koskinen cdbbc618f8 staging: xgifb: delete pVBInfo->BaseAddr
Delete redundant field.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-21 14:00:10 -08:00
Aaro Koskinen a68292fce1 staging: xgifb: make remaining data tables const
Remaining vb_table.h data can be trivially made const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:30 -08:00
Aaro Koskinen ea12b4e077 staging: xgifb: eliminate pVBInfo->AGPReg
Access XGI340_AGPReg directly and make it const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:30 -08:00
Aaro Koskinen 0904f7f315 staging: xgifb: eliminate pVBInfo->SR16
Inline constant values that are used only once.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:30 -08:00
Aaro Koskinen 5ce24760f6 staging: xgifb: eliminate pVBInfo->CR6B
Access XGI340_CR6B directly and make it const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:30 -08:00
Aaro Koskinen 38c09652a0 staging: xgifb: eliminate pVBInfo->SR21/22/25
In-line constants that are used only once.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:29 -08:00
Aaro Koskinen c705ea8165 staging: xgifb: eliminate pVBInfo->StResInfo
Delete unused data.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:29 -08:00
Aaro Koskinen e8e6c754e5 staging: xgifb: eliminate pVBInfo->ModeResInfo
Access XGI330_ModeResInfo directly and make it const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:24 -08:00
Aaro Koskinen 224114c788 staging: xgifb: eliminate pVBInfo->ScreenOffset
Access XGI330_ScreenOffset directly and make it const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:21 -08:00
Aaro Koskinen acfe093e82 staging: xgifb: eliminate pVBInfo->VCLKData/VBVCLKData
Access XGI_VCLKData and XGI_VBVCLKData directly and make them const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:20 -08:00
Aaro Koskinen 9b04745816 staging: xgifb: eliminate pVBInfo->ECLKData
Access XGI340_ECLKData directly and make it const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:20 -08:00
Aaro Koskinen 7e29d632f3 staging: xgifb: eliminate pVBInfo->CR6E/6F/89
Eliminate dummy zero read-only global data.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:20 -08:00
Aaro Koskinen 7c5c07a611 staging: xgifb: eliminate pVBInfo->UpdateCRT1
Access XGI_UpdateCRT1Table directly and make it const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:20 -08:00
Aaro Koskinen 7853bced96 staging: xgifb: eliminate pVBInfo->XGINEWUB_CRT1Table
Access XGI_CRT1Table directly and make it const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:20 -08:00
Aaro Koskinen a39325d24f staging: xgifb: eliminate pVBInfo->RefIndex
Access XGI330_RefIndex directly and make it const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:20 -08:00
Aaro Koskinen b397992e88 staging: xgifb: eliminate pVBInfo->EModeIDTable
Access XGI330_EModeIDTable directly and make it const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:19 -08:00
Aaro Koskinen 3625c9a782 staging: xgifb: eliminate pVBInfo->StandTable
Access XGI330_StandTable directly and make it const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:19 -08:00
Aaro Koskinen 6154e7f48a staging: xgifb: eliminate global TimingV/TimingH data
Use private data instead of global variables for timing data. Also,
get rid of the single element arrays.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:19 -08:00
Aaro Koskinen bdc9eb142c staging: xgifb: constify LCD data
Make read-only LCD data tables const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:19 -08:00
Aaro Koskinen 4736783cca staging: xgifb: XGI_GetLcdPtr: use real pointers for data tables
Use real pointers for LCD data tables to simplify the code.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 12:54:18 -08:00
Aaro Koskinen 8951dadc97 staging: xgifb: delete ISXPDOS
Delete unneeded flag.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 15:48:17 -07:00
Aaro Koskinen 073b61e8c1 staging: xgifb: access static data tables directly
Access some data tables directly instead of using pointers.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 15:48:17 -07:00
Aaro Koskinen 14f7c11187 staging: xgifb: delete XGI_LCDDataTablStruct
Delete an unused structure.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 15:48:17 -07:00
Aaro Koskinen 18ba866bb4 staging: xgifb: use a real pointer for TV DATAPTR
Replace DATAPTR numbers with a real pointer to make code simpler.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 15:48:16 -07:00
Aaro Koskinen 2457254560 staging: xgifb: use proper typing for TV data
There's a dangerous cast from XGI330_TVDataStruct to SiS_TVData. Use
SiS_TVData everywhere, also the data can be made const.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 15:48:16 -07:00
Aaro Koskinen 31fb40fd13 staging: xgifb: delete IF_DEF_LCDA
IF_DEF_LCDA is always true.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 15:48:16 -07:00
Aaro Koskinen 6e90d0570d staging: xgifb: delete IF_DEF_ExpLink
Delete a flag which is never set.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 15:48:15 -07:00
Aaro Koskinen 2fd002bc7b staging: xgifb: document some LVDS data delay values
Document some delay values based on the comments in
XGI_XG21SetPanelDelay().

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10 15:48:15 -07:00
Miguel Gómez 949eb0aeb9 Staging: xgifb: Comment cleaning.
Remove commented code and useless comments. Leave only those with relevant
hints to the code.

Signed-off-by: Miguel Gómez <magomez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11 16:59:27 -07:00
Peter Huewe 6d12dae47e 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-13 17:15:43 -07:00
Peter Huewe 51f984bc06 staging/xgifb: Use SiS structs
This patch replaces some of the XGI internal structs by their
counterparts in the SiS driver.
XGI330_LVDSDataStruct -> SiS_LVDSData
XGI330_LCDDataStruct -> SiS_LCDData
XGI330_CHTVDataStruct -> SiS_LVDSData

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13 17:15:43 -07:00
Peter Huewe 03f76fc617 staging/xgifb: Replace delay lookup tables with constant values
For TV Devices:
The values taken from XGI_TVDelayList are always overwritten with the
values from XGI_TVDelayList2 since the if condition for using the values
from XGI_TVDelayList2 is identical with the check to enter this scope and
thus always true.
The delay values in XGI_TVDelayList2 is always 0x22 so we
can simply replace it with this constant value.

For LCD Devices:
The LCD_DelayCompensation field is always set to 0x12 so we can simply
replace this field with a constant value.

This saves about 500 bytes in compiled size.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-13 17:15:43 -07:00
Aaro Koskinen d00d12f87a staging: xgifb: eliminate redundant struct definition
Replace XGI330_LCDDataDesStruct with identical XGI_LCDDesStruct.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 10:20:09 -07:00
Aaro Koskinen 354f49fa12 staging: xgifb: delete VB_ExtTVEdgeIndex
Delete VB_ExtTVEdgeIndex. It's 0 for all video modes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 10:20:09 -07:00
Aaro Koskinen 36ae035b45 staging: xgifb: delete VB_ExtTVFlickerIndex
Delete VB_ExtTVFlickerIndex. It's 0 for all video modes.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 10:20:08 -07:00
Aaro Koskinen 66f38592a0 staging: xgifb: XGI_ExtStruct: delete unused fields
Delete unused struct fields.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 10:20:08 -07:00
Aaro Koskinen ace1055e5e staging: xgifb: delete SModeIDTable
Delete unused data.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 10:20:08 -07:00
Dmitry Eremin-Solenikov 30b7681615 staging/xgifb: drop RelIO from vb_device_info
The RelIO field is unused in the driver, drop it.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 09:52:58 -07:00
Peter Huewe 7ad6651d78 staging/xgifb: Remove remaining duplicate structs and defines
This patch removes the now unused structs and defines which were mere
duplicates of the ones in the sgi headers

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:21:57 -08:00