summaryrefslogtreecommitdiff
path: root/drivers/staging/xgifb
AgeCommit message (Collapse)Author
2012-09-14staging: xgifb: delete bogus video RAM configurationAaro Koskinen
The driver reconfigures DRAM size register to 8M (regardless what the actual size was) once the init has been completed, overwriting the correct value written during the early init. As a result if the driver is unloaded and reloaded, the user will be limited to 8M video memory and may lose some of the available video modes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-14staging: xgifb: setup initial video RAM size for systems without BIOSAaro Koskinen
On embedded systems without a BIOS, the DRAM sizing register is 0 after the boot, and the driver thinks we have only 1 MB video memory. On such cases, use the PCI window size for the initial size. This information is needed only to create the I/O mapping - the driver will later detect and configure the memory size correctly. Limit the size to 16 MB as it should be sufficient for all supported video modes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12staging: xgifb: prevent video RAM size exceeding PCI window sizeAaro Koskinen
Add a sanity check for the video RAM size. It should fit into the PCI window. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-12staging: xgifb: validate the mode against video memory sizeAaro Koskinen
It's possible to select video mode that exceeds the available video memory. This is potentially dangerous, fix by adding a check. The patch fixes system hangs seen occasionally when playing random videos with mplayer. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: delete redundant castsAaro Koskinen
Delete some redundant casts. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: use correct type for VBVCLKDataAaro Koskinen
Use correct type to eliminate casting. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: delete ISXPDOSAaro Koskinen
Delete unneeded flag. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: mark constant data with constAaro Koskinen
Mark some data tables as const. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: access static data tables directlyAaro Koskinen
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-10staging: xgifb: use "else if"Aaro Koskinen
Use "else if" when possible to reduce nesting. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: delete XGI_LCDDataTablStructAaro Koskinen
Delete an unused structure. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: delete LCDLenListAaro Koskinen
LCDLenList is redundant. It's only used for modifying a write-only stack variable. Delete also related #defines. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: XGI_GetLcdPtr: delete dead codeAaro Koskinen
Only table values 0..5 are ever used. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: delete Chrontel 7017 LCD dataAaro Koskinen
Delete unused Chrontel 7017 LCD data. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: use a real pointer for TV DATAPTRAaro Koskinen
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-10staging: xgifb: use proper typing for TV dataAaro Koskinen
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-10staging: xgifb: delete Chrontel TV dataAaro Koskinen
Delete unused Chrontel TV data. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: XGI_GetTVPtr: drop the table parameterAaro Koskinen
Only one TV data table is used by the driver, delete unneeded complexity. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: avoid copy-pasting LCD dataAaro Koskinen
Share the common data tables instead of having the same data in multiple tables. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: delete redundant chip type checkAaro Koskinen
All chip type values are covered by (chip >= XG20 || chip >= XG40). Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: delete some unused #definesAaro Koskinen
Delete some unused #defines. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: delete IF_DEF_LCDAAaro Koskinen
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-10staging: xgifb: delete IF_DEF_ExpLinkAaro Koskinen
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-10staging: xgifb: replace XGI_XG21SetPanelDelay() with mdelay()Aaro Koskinen
Eliminate a trivial wrapper function. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: xgifb: document some LVDS data delay valuesAaro Koskinen
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-08-14Staging: xgifb: fix bitwise vs logical bugDan Carpenter
This is a static checker fix and not something I can test. The intent of the code here is to set some bit flags. For a logical OR the ">> 1" shift wouldn't make a difference. So it should be using a bitwise OR. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-14staging: xgifb: print small buffers via %*phAndy Shevchenko
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Remove useless condition.Miguel Gómez
Remove last if branch in XGIfb_do_set_var(), as it has no action assigned. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Fix coding style.Miguel Gómez
Fix small coding style warnings in several files. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Rework some conditions in XGI_SetCRT2ModeRegs().Miguel Gómez
Rework some conditions to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Rework conditions in XGI_EnableBridge().Miguel Gómez
Rework some conditions to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Rework conditions in XGI_SetLockRegs().Miguel Gómez
Rework some conditions to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Refactor XGI_GetCRT2ResInfo().Miguel Gómez
Use a goto to remove one level of indentation, fixing style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Rework conditions in XGI_GetVBInfo().Miguel Gómez
Rework some conditions to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Refactor XGI_GetVBType().Miguel Gómez
Refactor XGI_GetVBType() to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Refactor XGI_AjustCRT2Rate().Miguel Gómez
Refactor some conditions to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Rework conditions in XGI_SetATTRegs().Miguel Gómez
Rework some conditions to reduce indentation and fix style warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Remove useless always true condition.Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Remove unneeded var and condition in XGIfb_search_vesamode().Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Simplify XGIfb_GetXG21DefaultLVDSModeIdx().Miguel Gómez
Simplify the code and make it more readable. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Remove useless switch in XGIfb_detect_VB().Miguel Gómez
The switch performs no action so it can be removed. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Improve debug strings.Miguel Gómez
Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Remove unused struct _chswtable.Miguel Gómez
Struct _chswtable and the variable mychswtable are not used anywhere, so remove them. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Remove LCDA detection in xgifb_probe().Miguel Gómez
The piece of code that checks for LCDA in xgifb_probe() just checks for some register values but doesn't really do anything in response to them (the actions that should be executed are commented). As nothing is really being done, the code can be safely removed. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Remove unneeded XGI_LCD_TYPE enumeration.Miguel Gómez
LCD_TYPEs are taken from drivers/video/sis/sis.h, so this enumeration is not needed. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11Staging: xgifb: Comment cleaning.Miguel Gómez
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-06-19Staging: xgifb: Replace pr_* with dev_* when possible.Miguel Gómez
Replace pr_* calls with dev_* ones when the device structure is available. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-19Staging: xgifb: Fix sparse warnings.Miguel Gómez
Add include files with function definitions to avoid sparse warnings. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-19Staging: xgifb: Remove printk usage.Miguel Gómez
Replace meaninful printks with pr_debug and remove useless ones. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-19Staging: xgifb: Remove XGIFAIL() macro and its calls.Miguel Gómez
XGIFAIL() prints a message and returns a value, but it's used only in one place. Better remove it and replace the call with the macro content. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>