summaryrefslogtreecommitdiffstats
path: root/drivers/video/via
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'viafb-next' of git://github.com/schandinat/linux-2.6Paul Mundt2010-11-104-23/+138
|\
| * viafb: Add OLPC XO-1.5 port configsDaniel Drake2010-11-091-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | The OLPC XO-1.5 does not use the standard port wiring suggested in the viafb driver. This is required for the upcoming OLPC DCON and via-camera drivers, to be submitted soon. Signed-off-by: Daniel Drake <dsd@laptop.org> [fts: removed useless ifdef's and corrected comment] Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
| * viafb: suspend/resume for GPIOsJonathan Corbet2010-11-091-0/+29
| | | | | | | | | | | | | | | | | | Be sure to re-enable GPIO lines on resume. Users still have to be sure to set them properly. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
| * viafb: General power management infrastructureDaniel Drake2010-11-093-23/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | Multiple devices need S/R hooks (framebuffer, GPIO, camera). Add infrastructure and convert existing framebuffer code to the new model. This patch should create no functional change. Based on earlier work by Jonathan Corbet. Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
* | Merge branch 'v4l_for_linus' of ↵Linus Torvalds2010-10-282-3/+15
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (505 commits) [media] af9015: Fix max I2C message size when used with tda18271 [media] IR: initialize ir_raw_event in few more drivers [media] Guard a divide in v4l1 compat layer [media] imon: fix nomouse modprobe option [media] imon: remove redundant change_protocol call [media] imon: fix my egregious brown paper bag w/rdev/idev split [media] cafe_ccic: Configure ov7670 correctly [media] ov7670: allow configuration of image size, clock speed, and I/O method [media] af9015: support for DigitalNow TinyTwin v3 [1f4d:9016] [media] af9015: map DigitalNow TinyTwin v2 remote [media] DigitalNow TinyTwin remote controller [media] af9015: RC fixes and improvements videodev2.h.xml: Update to reflect the latest changes at videodev2.h [media] v4l: document new Bayer and monochrome pixel formats [media] DocBook/v4l: Add missing formats used on gspca cpia1 and sn9c2028 [media] firedtv: add parameter to fake ca_system_ids in CA_INFO [media] tm6000: fix a macro coding style issue tm6000: Remove some ugly debug code [media] Nova-S-Plus audio line input [media] [RFC,1/1] V4L2: Use new CAP bits in existing RDS capable drivers ...
| * [media] Add the via framebuffer camera controller driverJonathan Corbet2010-10-212-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a driver for the video capture port on VIA integrated chipsets. This version has a remaining OLPCism or two and expects to be talking to an ov7670; those can be improved as the need arises. This work was supported by the One Laptop Per Child project. Thanks to Laurent Pinchart for a number of useful comments. Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* | viafb: add initial VX900 supportFlorian Tobias Schandinat2010-10-247-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds basic support for the new VX900 IGP. Almost everything that was implemented for other IGPs is expected to work also on VX900 after this patch. The only known issue is that on the CRT output mode setting does not always work. It is clear that the possibility for regressions is zero. A big thanks to VIA Technologies for making this possible and supporting this work. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Jonathan Corbet <corbet@lwn.net>
* | viafb: fix hardware acceleration for suspend & resumeFlorian Tobias Schandinat2010-10-243-19/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch splits the acceleration initialization in two parts: The first is only called during probe and is used to allocate resources. The second part is also called on resume to reinitalize the 2D engine. This should fix all acceleration issues after resume most notable an "invisible" cursor and as we do nothing special it is reasonable to assume that it works on all supported IGPs. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: make suspend and resume work (on all machines?)Florian Tobias Schandinat2010-10-242-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the dangerous suspend and resume code that was developed for VX855 only. After this the framebuffer is expected to cause no longer serious (freezing) issues on any machines. However the hardware acceleration is broken now so only doing resume with unaccelerated framebuffers is save. This did not work previously as the 2D engine is not mapped if the framebuffer is not accelerated. The acceleration issue will be addressed later. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: restore display on resumeFlorian Tobias Schandinat2010-10-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes viafb restore the display on resume by calling viafb_set_par. Resumeing has still its issues: - will probably freeze most machines (for me on VX800 reliable on the second resume) - under some configurations the screen appears on the wrong output device (reason unknown) Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw>
* | Minimal support for viafb suspend/resumeDeepak Saxena2010-10-243-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds minimal support for suspend/resume of the VIA framebuffer device. It requires a version of OFW that restores the video mode. This patch is OLPC-specific as the proper upstream solution is to move the VIA video path to using the kernel modesetting infrastructure and doing a proper save/restore in the kernel. [jc: extensive changes for 2.6.34 merge] Signed-off-by: Deepak Saxena <dsaxena@laptop.org> [fts: viafb_driver moved from viafbdev.c to via-core.c] Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: use proper register for colour when doing fill opsFlorian Tobias Schandinat2010-09-241-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The colour was written to a wrong register for fillrect operations. This sometimes caused empty console space (for example after 'clear') to have a different colour than desired. Fix this by writing to the correct register. Many thanks to Daniel Drake and Jon Nettleton for pointing out this issue and pointing me in the right direction for the fix. Fixes http://dev.laptop.org/ticket/9323 Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Daniel Drake <dsd@laptop.org> Cc: Jon Nettleton <jon.nettleton@gmail.com> Cc: stable@kernel.org
* | viafb: rename output devicesFlorian Tobias Schandinat2010-09-243-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now it looks like we finally know enough about the output devices to give them proper names. As VIA_96 is often referred to as DVP0 rename it to VIA_DVP0. As VIA_6C and VIA_93 seem to exist only on CLE266 and "replace" DVP0 and DVP1 there rename them to VIA_LDVP0 and VIA_LDVP1 (L as legacy). The proc names were changed accordingly which should be harmless as they were just introduced and not beyond RFC state. This patch should make things a bit more comfortable and less scary. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Andrew Morton <akpm@linux-foundation.org>
* | viafb: add a mapping of supported output devicesFlorian Tobias Schandinat2010-09-241-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | This patch maps supported output devices to IGP versions. This list may contain errors as most of it is derived of the driver source but it should be correct enough to provide a good help. The devices are exported via a proc entry in the same format as those showing the output devices per IGA. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Andrew Morton <akpm@linux-foundation.org>
* | viafb: set sync polarity for all output devicesFlorian Tobias Schandinat2010-09-241-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | This patch sets the sync polarity for all output devices, not only CRT. This may give some people a working screen but only if lcd scaling and centering are not used as it is currently too dificult to propagate a different resolution (from what the application thinks) to the correct output device. Hopefully this does not introduce regressions as the polarity of non-CRT devices was completly ignored before. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: add function to change sync polarity per deviceFlorian Tobias Schandinat2010-09-242-3/+26
| | | | | | | | | | | | | | | | | | | | | | At the moment only the sync polarity for CRT is handled but there are also bits for controlling the sync polarity for other output devices. Add a function to change those similar to the other output device functions. There is no runtime change yet as the code still handles only CRT. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: reduce I2C timeout and delayFlorian Tobias Schandinat2010-09-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reduces the value for I2C timeout and udelay. The udelay was reduced to 10 (old: 40) which is still very high as for standard-mode I2C even 5 should work. This gives a speedup of factor 4 when talking to I2C devices. The timeout was reduced to 2 (old: 20) which is taken from the radeon driver so it should work as well. This gives a speedup of factor 10 when detecting that there is no I2C device we want to talk to. This causes a huge improvement of device initialization time. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: enable I2C for CRTFlorian Tobias Schandinat2010-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | This patch enables the I2C port to talk with the CRT. This allows adding EDID reading and parsing capability for CRTs. Just a small preparation, no notable changes in user experience yet. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: fix i2c_transfer error handlingFlorian Tobias Schandinat2010-09-241-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i2c_transfer returns negative errno on error and number of messages processed on success. Just returning this value would give a poor interface as it is not obvious that you must compare with 2 after reading 1 or n bytes and with 1 after writing 1 byte to determine if it was successful. To avoid this error prone interface convert the error code of a successful read/write to zero and all other non-negative values to an negative error code. This fixes a regression introduced by via: Rationalize vt1636 detection which resulted in no longer detecting a VT1636 chip and therefore has broken the output in configurations which contain this chip. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: stable@kernel.org
* | viafb: vt1636 cleanupFlorian Tobias Schandinat2010-09-245-131/+42
| | | | | | | | | | | | | | | | This patch merges tbl1636 into vt1636 and cleans it up as the data was only used there anyway. No runtime changes are expected. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: introduce per output device power managementFlorian Tobias Schandinat2010-09-246-111/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves common parts of dvi.c, lcd.c and vt1636.c to hw.c to start a per output device power management. There should be no runtime changes aside that this patch enables the proc interface to enable/disable devices when needed which greatly increases the chances that changes to the output device configuration will work. However the power management is not yet complete so it might fail on some configurations. As this area is quite complex and touches undocumented things there is a slight chance of regressions. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: limit LCD code impactFlorian Tobias Schandinat2010-09-241-31/+0
| | | | | | | | | | | | | | | | | | | | This patch cleans the LCD code up. It forbids overwritting global decissions like what IGA should be used as the source and whether to enable the second display channel. Additionally it removes a bit code duplication. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: add interface for output device configurationFlorian Tobias Schandinat2010-09-244-24/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch extends the proc entry to contain a possibility to view and change the output devices for each IGA. This is useful for debugging output problems as it provides a reliable way to query which low level devices are active after VIAs output device configuration nightmare happended. It's as well suitable for daily use as one can change the output configuration on the fly for example to connect a projector. At the moment it's still unstable. The reason is that we have to handle a bunch of undocumented output devices (those without a proper name) and that this patch is the first step to collect and verify the needed information. Basically the only configuration change that is expected to work at the moment is switching output devices between IGA1 and IGA2. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Acked-by: Jonathan Corbet <corbet@lwn.net> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Andrew Morton <akpm@linux-foundation.org>
* | viafb: merge the remaining output path with enable functionsFlorian Tobias Schandinat2010-09-244-205/+136
| | | | | | | | | | | | | | | | | | | | | | This patch merges the remaining functionality of the output path function in the associated enabling functions. This is very natural as most of the remaining code does actually enable the device. Just some more or less intelligent code merge. If no stupid mistakes occured there should be no regressions. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: use new device routingFlorian Tobias Schandinat2010-09-241-63/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch uses the iga{1,2}_devices variables to select which IGA should be the source. Doing this is convinient, more powerfull than the older scheme and easy extendable to support further output devices. It is not yet completed as the device on/off selection needs to be converted to the same scheme to take full advantage. No visible changes yet as we want to complete the transition before anouncing any unstabke interface. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: add new output device managementFlorian Tobias Schandinat2010-09-243-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new output device management that stores for each IGA which output devices are routed to it and a compatiblity layer that converts the old per-output device values in the new format. Bounding the output devices to each IGA is a central idea of the cleanup. Doing it this way should be easier and make much more sense than the old format which happily mixed different output devices together and did not even take into account that some devices are no longer available on newer chipsets. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: reduce viafb_set_iga_path usageFlorian Tobias Schandinat2010-09-242-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | The result of viafb_set_iga_path can change after init only in the hotplug ioctl. So we can move it there rather than doing it always when a new mode is set. The setup during init is done via a call from the init chip funtion. This change enables a stable mapping between the old device scheme and a new more powerfull one. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: propagate __init and __devinitFlorian Tobias Schandinat2010-09-247-34/+38
| | | | | | | | | | | | | | | | There are a lot of init functions which are not marked as such. Fix this. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: rework output device routingFlorian Tobias Schandinat2010-09-241-89/+94
| | | | | | | | | | | | | | | | | | This patch rips the device routing out of the 3 main functions to separate functions to make them available for transition to a better controlling scheme. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: enable second display channel at central placeFlorian Tobias Schandinat2010-09-241-30/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the enabling of the second display channel to the generic output routing function and do it exactly if something is using it. This unifies a zoo of variants how to do it and does no longer disable it if LCD is not on the second display which is much saner as there can be other users who need it. Probably this did not cause any problems so far as we only recently started dual fb support and otherwise there won't be other users and LCD is preferred assigned to second display channel. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: unify output path configurationFlorian Tobias Schandinat2010-09-243-7/+17
| | | | | | | | | | | | | | | | Move all output path routing directly in the viafb_setmode. This gives a better overview and allows to factor similar parts out. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: remove stubFlorian Tobias Schandinat2010-09-241-17/+0
| | | | | | | | | | | | | | This is a nop so removing it is safe. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: remove lcdtbl.hFlorian Tobias Schandinat2010-09-242-592/+7
| | | | | | | | | | | | | | | | | | This patch moves the power on/off sequences to lcd.c as they are only used there. This allows removing lcdtbl.h as the other stuff is not used. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* | viafb: reset correct PLLFlorian Tobias Schandinat2010-09-241-2/+2
|/ | | | | | | | Looks like we did reset the PLL of the (whatever) engine instead of the PLL of the secondary display (IGA2, LCDCK). This patch fixes it. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* drivers/video/via/ioctl.c: prevent reading uninitialized stack memoryDan Rosenberg2010-09-151-0/+2
| | | | | | | | | | | The VIAFB_GET_INFO device ioctl allows unprivileged users to read 246 bytes of uninitialized stack memory, because the "reserved" member of the viafb_ioctl_info struct declared on the stack is not altered or zeroed before being copied back to the user. This patch takes care of it. Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
* drivers/video/via/via-gpio.c: fix warningAndrew Morton2010-08-051-1/+1
| | | | | | | | | | | drivers/video/via/via-gpio.c: In function 'viafb_gpio_probe': drivers/video/via/via-gpio.c:216: warning: assignment from incompatible pointer type Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Scott Fang <ScottFang@viatech.com.cn> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
* fbdev: section cleanup in viafb driverHenrik Kretzschmar2010-08-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves two functions from .devexit to .text, which are called on the probe error path. Also a function which is called by probe is moved from .text to .devinit. WARNING: vmlinux.o(.devinit.text+0x2ca5): Section mismatch in reference from the function via_pci_probe() to the function devexit.text:via_teardown_subdevs() The function __devinit via_pci_probe() references a function __devexit via_teardown_subdevs(). This is often seen when error handling in the init function uses functionality in the exit path. The fix is often to remove the __devexit annotation of via_teardown_subdevs() so it may be used outside an exit section. WARNING: vmlinux.o(.devinit.text+0x2cb1): Section mismatch in reference from the function via_pci_probe() to the function devexit.text:via_pci_teardown_mmio() The function __devinit via_pci_probe() references a function __devexit via_pci_teardown_mmio(). This is often seen when error handling in the init function uses functionality in the exit path. The fix is often to remove the __devexit annotation of via_pci_teardown_mmio() so it may be used outside an exit section. Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
* viafb: fix accel_flags check_var bugFlorian Tobias Schandinat2010-07-231-2/+2
| | | | | | | | | | | | | viafb: fix accel_flags check_var bug In check_var we should check and modify the var given and not the one which is currently active. So this code was obviously wrong. Probably this was doing no harm because all acceleration functions also check whether acceleration is possible. (otherwise I would expect this to lead to a null pointer dereference) Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* viafb: probe cleanupsFlorian Tobias Schandinat2010-07-231-24/+3
| | | | | | | | | | viafb: probe cleanups Removal of strange special cases that must not exist as well as a useless check. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* viafb: remove ioctls which break the framebuffer interfaceFlorian Tobias Schandinat2010-07-232-254/+0
| | | | | | | | | | | | | | | viafb: remove ioctls which break the framebuffer interface The ioctls VIAFB_SET_DEVICE, VIAFB_SET_DEVICE_INFO and VIAFB_SET_SECOND_MODE are removed because they prevent a clean framebuffer driver because they modify the hardware and/or the internal structures. There are no known applications using these ioctls so no breakage is expected. Additionaly the main functionality was duplicating the framebuffer interface so there really should not exist any user. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* viafb: update fix before calculating depthFlorian Tobias Schandinat2010-07-231-1/+1
| | | | | | | | | | | | viafb: update fix before calculating depth As the depth calculation depends on information in fix it is saner to do the update first. No runtime change expected as the value visual in fix used never changes to MONO. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* viafb: PLL value cleanupFlorian Tobias Schandinat2010-07-233-489/+412
| | | | | | | | | | | | | | | | | | | | | | | | | viafb: PLL value cleanup This is a big change of how PLL values are handled on the road to dynamic PLL value generation. The table was converted automatically in the relevant parameters for frequency generation. Sadly there were some bits set whose meaning is unknown. Those differences are documented but ignored as the unichrome code implies that they are not important (a big thanks to Luc for his amazing work). The PLL values for 31490000 and 133308000 are deleted as they were more than 5% off and not used anyway. The values for CX700@60466000 and VX855@153920000 are corrected as they were wrong and easily correctable as enough correct values was available because CX700 and VX855 support the same values only with a little difference in hardware format. All remaining values are not more than 2% off. Additionally the surrounding code is changed as needed especially the byte order of the values written to hardware to allow nicer conversion functions. This is mostly a change preparing for dynamic PLL generation and the two corrected values aside no runtime change is expected. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* viafb: simplify lcd size "detection"Florian Tobias Schandinat2010-07-234-41/+1
| | | | | | | | | | | | | viafb: simplify lcd size "detection" Remove all occurences of get_lcd_size_method as only the values GET_LCD_SIZE_BY_VGA_BIOS and GET_LCD_SIZE_BY_USER_SETTING were used which had the identical code so there is no need to make things look more complicated than they actually are. Just a bit of of cleanup, really no regressions expected. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* viafb: fix PCI tableFlorian Tobias Schandinat2010-07-231-7/+9
| | | | | | | | | | | | | | | | | viafb: fix PCI table This patch fixes an oddity in the device table where the P4M890 ID was assigned with the enumeration value of CN700 which itself was missing. This is a regression introduced by "viafb: make viafb a first-class citizen using pci_driver" While at it reorder the table to reflect the order of the enumeration values. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Harald Welte <laforge@gnumonks.org>
* viafb: add lcd scaling support for some IGPsFlorian Tobias Schandinat2010-07-231-0/+6
| | | | | | | | | | | | viafb: add lcd scaling support for some IGPs These IGPs should also support lcd scaling but likely this switch was missed when adding support for them. Fix it, allowing lcd scaling on CN750, VX800 and VX855. At least this improves the situation for VX855. (there seems to be another scaling unrelated bug somewhere) Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* viafb: improve lcd code readabilityFlorian Tobias Schandinat2010-07-231-5/+4
| | | | | | | | | | viafb: improve lcd code readability This changes the code to better reflect that we can (currently) only perform upscaling. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* viafb: remove duplicated scaling codeFlorian Tobias Schandinat2010-07-231-73/+2
| | | | | | | | | | viafb: remove duplicated scaling code The code for P4M900 does the same as for all newer IGPs so there is no reason to duplicate it. Just reducing the code to maintain. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Joseph Chan <JosephChan@via.com.tw>
* drivers/video/via: use memdup_userJulia Lawall2010-05-271-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use memdup_user when user data is immediately copied into the allocated region. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression from,to,size,flag; position p; identifier l1,l2; @@ - to = \(kmalloc@p\|kzalloc@p\)(size,flag); + to = memdup_user(from,size); if ( - to==NULL + IS_ERR(to) || ...) { <+... when != goto l1; - -ENOMEM + PTR_ERR(to) ...+> } - if (copy_from_user(to, from, size) != 0) { - <+... when != goto l2; - -EFAULT - ...+> - } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Scott Fang <ScottFang@viatech.com.cn> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge branch 'viafb-next' of git://git.lwn.net/linux-2.6Linus Torvalds2010-05-2023-584/+1625
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'viafb-next' of git://git.lwn.net/linux-2.6: (35 commits) viafb: move some include files to include/linux viafb: Eliminate some global.h references viafb: get rid of i2c debug cruft viafb: fold via_io.h into via-core.h viafb: Fix initialization error paths viafb: Do not remove gpiochip under spinlock viafb: make procfs entries optional viafb: fix proc entry removal viafb: improve misc register handling viafb: replace inb/outb viafb: move some modesetting functions to a seperate file viafb: unify modesetting functions viafb: Reserve framebuffer memory for the upcoming camera driver viafb: Add a simple VX855 DMA engine driver viafb: Add a simple interrupt management infrastructure via: Rationalize vt1636 detection viafb: Introduce viafb_find_i2c_adapter() via: Do not attempt I/O on inactive I2C adapters viafb: Turn GPIO and i2c into proper platform devices viafb: Convert GPIO and i2c to the new indexed port ops ...
| * viafb: move some include files to include/linuxJonathan Corbet2010-05-1115-295/+21
| | | | | | | | | | | | | | | | | | | | | | These are the files which should be available to subdevices compiled outside of drivers/video/via. Cc: ScottFang@viatech.com.cn Cc: JosephChan@via.com.tw Cc: Harald Welte <laforge@gnumonks.org> Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
OpenPOWER on IntegriCloud