Commit Graph

45 Commits

Author SHA1 Message Date
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
Peter Huewe fc39dcb7fa staging/xgifb: Use structs and defines from the sis headers
This patch removes the usage of some xgi structs and defines and
replaces them with the _identical_ structs from the sis headers.
Thus the old structs and defines can be removed.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:21:56 -08:00
Peter Huewe b33704dffa staging/xgifb: Include sis headers
This patch includes the headers of the sis driver and reorders some
includes.

Since the xgi driver used to redefine a lot of stuff from the sis
driver, we can simply include the headers of the sis driver itself, so
we can remove duplicated stuff later on.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:21:56 -08:00
Aaro Koskinen fab04b97be staging: xgifb: move XGI21_LVDSCapStruct into xgifb_video_info
Move the LVDS data into a device-specific data, and eliminate the global
variable usage.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 12:26:07 -08:00
Aaro Koskinen f7054c2a3c staging: xgifb: delete ROMAddr
Delete a redundant struct member.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08 12:26:04 -08:00
Aaro Koskinen 9ffc7e9fee staging: xgifb: vb_setmode: eliminate GetVGAType/Set_VGAType
Eliminate unneeded function and struct field. The same information is
available in HwDeviceExtension->jChipType.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-28 06:20:13 +09:00
Aaro Koskinen 2f0f395ef7 staging: xgifb: move XGINew_DataBusWidth into vb_device_info
Move the memory bus width info to vb_device_info.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-12 09:51:48 -06:00
Aaro Koskinen ee055a48ce staging: xgifb: move XGINew_ChannelAB into vb_device_info
Move the memory channel info into vb_device_info.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-12 09:51:48 -06:00
Aaro Koskinen 2af1a29da7 staging: xgifb: move XGINew_RAMType into vb_device_info
The RAM type is device specific, so move it into vb_device_info.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-12 09:51:48 -06:00
Aaro Koskinen c44fa627c7 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-16 20:16:48 +02:00
Aaro Koskinen aef6bc7458 staging: xgifb: delete IF_DEF_ScaleLCD
Delete one more disabled feature.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 11:42:15 -07:00
Aaro Koskinen 3d6defadda staging: xgifb: delete IF_DEF_PWD
Delete already disabled code paths.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 11:42:15 -07:00
Aaro Koskinen 66cfacecc3 staging: xgifb: delete IF_DEF_OEMUtil
Delete already disabled code paths.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 11:42:14 -07:00
Aaro Koskinen d2de85c5da staging: xgifb: delete IF_DEF_VideoCapture
Delete already disabled code paths.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 11:42:13 -07:00
Aaro Koskinen 160b006ae9 staging: xgifb: delete redundant Chrontel TV data
Delete redundant Chrontel TV data.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 11:42:08 -07:00
Aaro Koskinen 83f76a9d7e staging: xgifb: delete support for Chrontel 7007 TV output
IF_DEF_CH7007 is hard-coded to 0, so this is all just dead code that
can be deleted.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 11:42:07 -07:00
Aaro Koskinen 4c14bfd41d staging: xgifb: delete support for Chrontel 7005 TV output
IF_DEF_CH7005 is hard-coded to 0, so this is all just dead code that
can be deleted.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 11:42:07 -07:00
Aaro Koskinen a35cd0ba7f staging: xgifb: delete support for Chrontel 7017 TV output
IF_DEF_CH7017 is hard-coded to 0, so this is all just dead code that
can be deleted.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 11:42:06 -07:00
Aaro Koskinen f3e5260585 staging: xgifb: delete unused structs
Delete unused struct declarations.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 14:21:46 -07:00
Aaro Koskinen fa4c212f2b staging: xgifb: delete unused definitions
Delete some more unused definitions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 14:21:45 -07:00
Aaro Koskinen 1f8385841b staging: xgifb: delete duplicate #defines
Delete duplicate identical #defines.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 14:21:45 -07:00
Kenji Toyama 918122e687 Staging: xgifb: Fixed almost all style warnings.
I've removed all the warnings except one that I believe is a false
positive. The original author has used a macro to #define EXTERN to be
'extern', so in this case 'extern' is not used to define the storage
class of anything, but just the value of the macro. We can safely ignore
this warning.

Signed-off-by: Daniel Kenji Toyama <kenji.toyama@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:30:42 -07:00
Bill Pemberton 80adad85ea Staging: xgifb: Remove typedefs in vb_struct.h
This removes all the remaining typedefs in vb_struct.h

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-22 14:33:34 -07:00
Bill Pemberton 108afbf8ae Staging: xgifb: Remove SHORT, UCHAR, and LONG typedef
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-22 14:33:19 -07:00
Bill Pemberton 82d6eb5b2e Staging: xgifb: Remove USHORT, ULONG, BOOLEAN, and VOID typedefs
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-22 14:32:32 -07:00
Bill Pemberton 274afb73bd Staging: xgifb: Remove PUCHAR typedef
PUCHAR was unsigned char *, use that instead

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-22 14:30:53 -07:00
apatard@mandriva.com d7636e0b07 staging: Add framebuffer driver for XGI chipsets
This driver handles XG20, XG21, XG40, XG42 chipsets from XGI. They're
also known as Z7,Z9,Z11 chipsets. It's based on the SiS fb driver but
has been heavily modified by XGI to support their newer chipsets.


Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-04 13:38:51 -07:00