summaryrefslogtreecommitdiff
path: root/drivers/video/via
AgeCommit message (Collapse)AuthorFilesLines
2012-09-23viafb: don't touch clock state on OLPC XO-1.5Daniel Drake1-0/+19
As detailed in the thread titled "viafb PLL/clock tweaking causes XO-1.5 instability," enabling or disabling the IGA1/IGA2 clocks causes occasional stability problems during suspend/resume cycles on this platform. This is rather odd, as the documentation suggests that clocks have two states (on/off) and the default (stable) configuration is configured to enable the clock only when it is needed. However, explicitly enabling *or* disabling the clock triggers this system instability, suggesting that there is a 3rd state at play here. Leaving the clock enable/disable registers alone solves this problem. This fixes spurious reboots during suspend/resume behaviour introduced by commit b692a63a. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: stable@vger.kernel.org
2012-05-08video/via: Convert to kstrtou8_from_userPeter Huewe1-22/+12
This patch replaces the code for getting an number from a userspace buffer by a simple call to kstrou8_from_user. This makes it easier to read and less error prone. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Acked-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-03-14Merge branch 'viafb-next' of git://github.com/schandinat/linux-2.6 into ↵Florian Tobias Schandinat25-1139/+936
fbdev-next
2012-03-08viafb: avoid refresh and mode lookup in set_parFlorian Tobias Schandinat1-18/+14
As check_var already ensures that the mode is valid there is no need to do those expensive lookups here again. The only thing that might change is that the deprecated interface could report slightly different refresh rates due to rounding errors. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-03-08viafb: modetable conversionFlorian Tobias Schandinat7-1035/+120
This patch converts the modetables used in viafb to - remove the strange thing that sync_end and blanking_end contained the length and not the absolute value - remove hundreds of useless defines - use fb_videomode and not our own definition so modes defined in the subsystem and received via EDID are compatible with ours As the modes are now stored in a flat structure and no longer in a tree like thing the lookup time was increased but as it is a rare event anyway it shouldn't matter. Otherwise the behaviour should be the same as before. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-03-04viafb: LCD bpp cleanupFlorian Tobias Schandinat5-30/+12
This patch removes redundant bits per pixel information by using the one storged in var directly. Simplifies code without any functional changes. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-24viafb: fix IGA1 modesetting on VX900Florian Tobias Schandinat1-0/+3
Even if the documentation calls this bit "Reserved" it has to be set to 0 for correct modesetting on IGA1. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: stable@vger.kernel.org
2012-02-24viafb: select HW scaling on VX900 for IGA2Florian Tobias Schandinat1-0/+1
VX900 can do hardware scaling for both IGAs in contrast to previous hardware which could do it only for IGA2. This patch ensures that we set the parameter for IGA2 and not for IGA1. This fixes hardware scaling on VX900 until we have the infrastructure to support it for both IGAs. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: stable@vger.kernel.org
2012-02-21viafb: Fix bug in centering codeFlorian Tobias Schandinat1-1/+1
Obviously this is a typo and although there were no effects observed it's probably better to fix it. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-21viafb: another workaround for OLPCs weird wiringFlorian Tobias Schandinat1-2/+4
On OLPC we must not touch this I2C bus or it will hang. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-17viafb: NULL dereference on allocation failure in query_edid()Dan Carpenter1-2/+5
We should handle the allocation here, if only to keep the static checkers happy. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-15Merge branch 'viafb-aux' into viafb-nextFlorian Tobias Schandinat15-10/+736
2012-02-13viafb: add initial EDID supportFlorian Tobias Schandinat4-8/+103
This patch adds support for using EDID data on CRT and DVP1 for initial configuration if viafb_mode or viafb_mode1 are not present. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-13viafb: fix I2C emulation on GPIO portsFlorian Tobias Schandinat1-2/+8
This patch fixes the I2C emulation on GPIO ports by enabling it (software controlled) and disabling the output on a GPIO line before reading it. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-13viafb: make SAMM to also work on LCDFlorian Tobias Schandinat4-28/+22
This patch enables LCD to handle SAMM without dual fb. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-10viafb: make single framebuffer multiple adapter mode workFlorian Tobias Schandinat4-22/+30
This patch implementes this mode (viafb_SAMM_ON set and viafb_dual_fb not set) in a useful way for CRT and DVI devices. The same content is shown on both devices in different video modes. The first (primary) resolution must not be bigger than the secondary one and determines the visible region. The same content is shown centered on the secondary output. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-10viafb: fill xres and yresFlorian Tobias Schandinat1-1/+2
This patch fills xres and yres in var which is required when a temporary var is genereated when viafb_SAMM_ON is set and viafb_dual_fb is not set. It also removes an obsolete comment. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-10viafb: set correct polarity for second adapterFlorian Tobias Schandinat1-7/+7
This patch sets the correct polarity for the second adapter when viafb_SAMM_ON is set and viafb_dual_fb is not set. Just one step to make this mode useful. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2012-02-10viafb: add auxiliary device management infrastructureFlorian Tobias Schandinat14-1/+626
This patch adds the basic infrastructure and a few stub drivers for devices that are connected via I2C busses. The infrastructure will be used to replace and extend the support that is scattered throughout viafb. The stub drivers are not very useful yet but they show how the infrastructure works, provide information about the chips integrated into a system and maybe gather some testers as it would be very difficult for a single person to get a sane test environment. The only thing this actually does is probing the I2C busses which will hopefully not cause any regressions. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-11-22viafb: correct sync polarity for OLPC DCONDaniel Drake1-2/+2
While the OLPC display appears to be able to handle either positive or negative sync, the Display Controller only recognises positive sync. This brings viafb (for XO-1.5) in line with lxfb (for XO-1) and fixes a recent regression where the XO-1.5 DCON could no longer be frozen. Thanks to Florian Tobias Schandinat for helping identify the fix. Test case: from a vt, echo 1 > /sys/devices/platform/dcon/freeze should cause the current screen contents to freeze, rather than garbage being displayed. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: stable@kernel.org
2011-11-01video: Add export.h for THIS_MODULE/EXPORT_SYMBOL to drivers/videoPaul Gortmaker1-0/+1
With module.h being implicitly everywhere via device.h, the absence of explicitly including something for EXPORT_SYMBOL went unnoticed. Since we are heading to fix things up and clean module.h from the device.h file, we need to explicitly include these files now. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-08-18viafb: replace strict_strtoul to kstrto* and check return valueWang Shaoyan1-58/+68
This commit replace the function strict_strtoul(becasue commit 33ee3b2e), and check the return value to avoid such warning: drivers/video/via/viafbdev.c:1992: warning: ignoring return value of 'kstrtoul', declared with attribute warn_unused_result Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-17Merge commit 'v3.1-rc2' into HEADFlorian Tobias Schandinat5-32/+30
2011-08-07viafb: get rid of the remaining modetable structure assumptionsFlorian Tobias Schandinat7-33/+17
This patch removes the remaining places where assumptions about the structure of the modetable were made. Aside from some places where assumptions are made that certain modes are in the modetable the only code dealing with the modetable and not just a single mode is in viamode. This will allow chaniging the modetable and use other sources for videomodes like the subsystem or EDID. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-07viafb: eliminate modetable dependancy of LCD modesettingFlorian Tobias Schandinat3-22/+15
This patch removes the need for knowing the modetable structure within the LCD modesetting function. The magic 60Hz refresh rate was already there as always the first entry for a resolution was choosen based on the ascending refresh rate ordering in the modetable. For all but one this is at least 60Hz, if only higher frequencies available we choose those like the code before did. The exception is OLPC but that resolution has only one frequency so we get the same behaviour there as well. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-07viafb: seperate hardware initializationFlorian Tobias Schandinat1-20/+28
This patch splits the hardware initialization out of the modesetting function which will make it easier to make it conditional and not require starting from scratch for every mode change, which is especially annoying in dual framebuffer mode. This required some minor reordering but it should not influence its functionality. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-07viafb: use information in var for modesettingFlorian Tobias Schandinat4-83/+61
This patch starts to use the information in var for modesetting for CRT and DVI devices. This is the right thing as it allows us to use more generic modes than the ones predefined by VIA. We do not yet allow more generic modes as check_var still limits them to the predefined ones but with this patch applied it would be really easy to do so. A problem was VIAs SAMM mode as it has 2 different modes but just one frame buffer device. This is solved by creating a pseudo var which contains enough information to use it for modesetting. Hopefully one day we can use information in var for all modes that do not involve hardware scaling. Well I'd like to say that the chance of regressions is low but it is quite likely that the behaviour in some cases changed especially when SAMM is involved. I hope we made it better than before in particular the DVI frequency check was probably broken before and hopefully works better now. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-07viafb: eliminate viafb_get_pixclockFlorian Tobias Schandinat3-19/+2
As there is only one user we can just insert the formula where needed. Avoids one lookup in the modetable and viafb_fill_var_timing_info does no longer depend on the modetable. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-07viafb: add new funcions to select a single modeFlorian Tobias Schandinat5-61/+70
This patch introduces 2 new functions for selecting a single mode based on hres, vres and refresh rate and changes some uses to use those. The advantage is that it is less error prone than doing the selection based on refresh rate everywhere and allows replacing the modetable structure. This includes a little change that users may notice: If a refresh rate was given as module parameters but does not exist in the modetable prior to this patch a refresh rate of 60 was assumed and after this patch the closest supported refresh rate to the one provided by the user is used. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-07viafb: fix pointer type missmatchWang Shaoyan1-1/+1
drivers/video/via/via-core.c: In function 'via_pci_probe': drivers/video/via/via-core.c:691: warning: assignment discards qualifiers from pointer target type Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-05viafb: remove 640x480-60 CRT special caseFlorian Tobias Schandinat2-15/+1
The timing for 640x480-60 was handled different than all others. This patch changes this by changing the blanking start and end. The reason for this is that I can't find any reason for the old behaviour and it was not consistent anyway as the special case for LCD did not always trigger as the LCD code does not use this function and it did trigger regardless of whether the display set is CRT or LCD but only based whether any DVI/LCD device exists. There are no negative effects observed for CRT or DVI devices. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-05viafb: simplify viafb_fill_crtc_timingFlorian Tobias Schandinat3-12/+10
As the first argument is just part of the structure passed as the second argument there is no need for it at all. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-05viafb: remove superfluous mode lookupFlorian Tobias Schandinat1-2/+0
As the result is not used anywhere there is no need to perform the lookup at all. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-05viafb: remove superfluous register unlocking/lockingFlorian Tobias Schandinat2-7/+4
The locking is done within the viafb_set_*_timing functions so there is no need to do it here. Move a missing hardware reset into the modesetting function. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-05viafb: kill viafb_load_crtc_timingFlorian Tobias Schandinat3-46/+27
This patch replaces calls to viafb_load_crtc_timing with the code. This should make it easier to fix the oddity that in the modetable the blank and sync end entries contain the length and we need to add the start values to get those to be written to the hardware. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-08-05viafb: use more compact modesetting functionsFlorian Tobias Schandinat5-578/+128
This patch replaces the old timing setup code with a redesigned one. The new code might be slightly faster as it has no conditinals and does not write the same register multiple times. Also it makes the comparison to the documentation easier. Regressions are unlikely but could happen as a lot of hardware is undocumented. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-07-17viafb: improve pitch handlingFlorian Tobias Schandinat2-3/+13
This patch adds checks for minimum and maximum pitch size to prevent invalid settings which could otherwise crash the machine. Also the alignment is done in a slightly more readable way. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: stable@kernel.org
2011-06-27viafbdev: fix compilation warning for unused variableNikanth Karthikesan1-2/+2
viafbdev: Fix compilation warning for unused variable for #ifdef MODULE Fix compilation warning when #ifdef MODULE drivers/video/via/viafbdev.c: In function ‘viafb_init’: drivers/video/via/viafbdev.c:2019: warning: unused variable ‘r’ Signed-off-by: Nikanth Karthikesan <nikanth@google.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-27viafb: use display information in info not in var for panningFlorian Tobias Schandinat1-2/+3
As Laurent pointed out we must not use any information in the passed var besides xoffset, yoffset and vmode as otherwise applications might abuse it. Also use the aligned fix.line_length and not the (possible) unaligned xres_virtual. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: stable@kernel.org
2011-05-26Merge branch 'gpio/next' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds1-24/+25
* 'gpio/next' of git://git.secretlab.ca/git/linux-2.6: gpio/via: rename VIA local config struct basic_mmio_gpio: split into a gpio library and platform device gpio: remove some legacy comments in build files gpio: add trace events for setting direction and value gpio/pca953x: Use handle_simple_irq instead of handle_edge_irq gpiolib: export gpiochip_find gpio: remove redundant Kconfig depends on GPIOLIB basic_mmio_gpio: convert to non-__raw* accessors basic_mmio_gpio: support direction registers basic_mmio_gpio: support different input/output registers basic_mmio_gpio: detect output method at probe time basic_mmio_gpio: request register regions basic_mmio_gpio: allow overriding number of gpio basic_mmio_gpio: convert to platform_{get,set}_drvdata() basic_mmio_gpio: remove runtime width/endianness evaluation
2011-05-22Merge branch 'viafb-next' of git://github.com/schandinat/linux-2.6Linus Torvalds18-706/+712
* 'viafb-next' of git://github.com/schandinat/linux-2.6: (24 commits) viafb: Automatic OLPC XO-1.5 configuration viafb: remove unused CEA mode viafb: try to map less memory in case of failure viafb: use write combining for video ram viafb: add X server compatibility mode viafb: reduce OLPC refresh a bit viafb: fix OLPC XO 1.5 device connection viafb: fix OLPC DCON refresh rate viafb: delete clock and PLL initialization viafb: replace custom return values viafb: some small cleanup for global variables viafb: gather common good, old VGA initialization in one place viafb: add engine clock support viafb: add VIA slapping capability viafb: split clock and PLL code to an extra file viafb: add primary/secondary clock on/off switches viafb: add clock source selection and PLL power management support viafb: prepare for PLL separation viafb: call viafb_get_clk_value only in viafb_set_vclock viafb: remove unused max_hres/vres ...
2011-05-20gpio/via: rename VIA local config structLinus Walleij1-24/+25
The local VIA GPIO config struct "gpio_config" collides with my extension to the gpio_chip struct, so rename it to viafb_gpio_config so we don't get this clash. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2011-05-11viafb: Automatic OLPC XO-1.5 configurationDaniel Drake1-9/+30
Currently, a long set of viafb options are needed to get the XO-1.5 laptop to output video (there is only 1 configuration that works, that can't really be autodetected). This patch automatically detects and configures viafb for the XO-1.5 laptop, meaning all that is required for working display is that viafb is loaded. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-04-26viafb: remove unused CEA modeFlorian Tobias Schandinat3-34/+0
This trivial patch removes unused mode tables. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-04-26viafb: try to map less memory in case of failureFlorian Tobias Schandinat1-1/+8
The current code might result in trying to remap 512MB video ram on a 32 bit system which is quite likely to fail. This patch tries to map less of it down to 8MB as this should still be enough to get a reasonably well working framebuffer. This should make viafb work for many people without requiring them to manually allocate more space. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-04-24viafb: use write combining for video ramFlorian Tobias Schandinat1-1/+1
This can give a speed up of factor 6-9, which is quite notable. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-04-24Merge branch 'viafb-pll' into viafb-nextFlorian Tobias Schandinat7-408/+577
Conflicts: drivers/video/via/viamode.c Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-04-24Merge branch 'viafb-cleanup' into viafb-nextFlorian Tobias Schandinat13-251/+84
2011-04-24viafb: add X server compatibility modeFlorian Tobias Schandinat1-0/+7
This patch adds a config option to be compatible with X servers like OpenChrome. This is required as for example the X server does not handle things like disabled IGAs/PLLs resulting in a potential freeze on X startup. With this option disabled we can provide some nice features like power management and not reinitializing the hardware on every mode switch (taking long time, causing flickering). Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-04-24viafb: reduce OLPC refresh a bitFlorian Tobias Schandinat3-2/+3
When allowing some PLL calculation we get a frequency that seems to be a bit higher than what the OLPC DCON likes resulting in a still readable but not so good image. We don't really know whether this is a problem with the calculation formula or the OLPC but as other displays seem to be happy with the other modes adjusting the OLPC refresh looks like the better thing. This patch prevents a regression when dynamic PLL calculation is allowed. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>