aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
AgeCommit message (Collapse)Author
2014-06-18tgafb: fix data copyingMikulas Patocka
commit 6b0df6827bb6fcacb158dff29ad0a62d6418b534 upstream. The functions for data copying copyarea_foreward_8bpp and copyarea_backward_8bpp are buggy, they produce screen corruption. This patch fixes the functions and moves the logic to one function "copyarea_8bpp". For simplicity, the function only handles copying that is aligned on 8 pixes. If we copy an unaligned area, generic function cfb_copyarea is used. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18tgafb: fix mode setting with fbsetMikulas Patocka
commit 624966589041deb32a2626ee2e176e8274581101 upstream. Mode setting in the TGA driver is broken for these reasons: - info->fix.line_length is set just once in tgafb_init_fix function. If we change videomode, info->fix.line_length is not recalculated - so the video mode is changed but the screen is corrupted because of wrong info->fix.line_length. - info->fix.smem_len is set in tgafb_init_fix to the size of the default video mode (640x480). If we set a higher resolution, info->fix.smem_len is smaller than the current screen size, preventing the userspace program from mapping the framebuffer. This patch fixes it: - info->fix.line_length initialization is moved to tgafb_set_par so that it is recalculated with each mode change. - info->fix.smem_len is set to a fixed value representing the real amount of video ram (the values are taken from xfree86 driver). - add a check to tgafb_check_var to prevent us from setting a videomode that doesn't fit into videoram. - in tgafb_register, tgafb_init_fix is moved upwards, to be called before fb_find_mode (because fb_find_mode already needs the videoram size set in tgafb_init_fix). Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mach64: fix cursor when character width is not a multiple of 8 pixelsMikulas Patocka
commit 43751a1b8ee2e70ce392bf31ef3133da324e68b3 upstream. This patch fixes the hardware cursor on mach64 when font width is not a multiple of 8 pixels. If you load such a font, the cursor is expanded to the next 8-byte boundary and a part of the next character after the cursor is not visible. For example, when you load a font with 12-pixel width, the cursor width is 16 pixels and when the cursor is displayed, 4 pixels of the next character are not visible. The reason is this: atyfb_cursor is called with proper parameters to load an image that is 12-pixel wide. However, the number is aligned on the next 8-pixel boundary on the line "unsigned int width = (cursor->image.width + 7) >> 3;" and the whole function acts as it is was loading a 16-pixel image. This patch fixes it so that the value written to the framebuffer is padded with 0xaaaa (the transparent pattern) when the image size it not a multiple of 8 pixels. The transparent pattern causes that the cursor will not interfere with the next character. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18mach64: use unaligned accessMikulas Patocka
commit c29dd8696dc5dbd50b3ac441b8a26751277ba520 upstream. This patch fixes mach64 to use unaligned access to the font bitmap. This fixes unaligned access warning on sparc64 when 14x8 font is loaded. On x86(64), unaligned access is handled in hardware, so both functions le32_to_cpup and get_unaligned_le32 perform the same operation. On RISC machines, unaligned access is not handled in hardware, so we better use get_unaligned_le32 to avoid the unaligned trap and warning. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18matroxfb: restore the registers M_ACCESS and M_PITCHMikulas Patocka
commit a772d4736641ec1b421ad965e13457c17379fc86 upstream. When X11 is running and the user switches back to console, the card modifies the content of registers M_MACCESS and M_PITCH in periodic intervals. This patch fixes it by restoring the content of these registers before issuing any accelerator command. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18framebuffer: fix cfb_copyareaMikulas Patocka
commit 00a9d699bc85052d2d3ed56251cd928024ce06a3 upstream. The function cfb_copyarea is buggy when the copy operation is not aligned on long boundary (4 bytes on 32-bit machines, 8 bytes on 64-bit machines). How to reproduce: - use x86-64 machine - use a framebuffer driver without acceleration (for example uvesafb) - set the framebuffer to 8-bit depth (for example fbset -a 1024x768-60 -depth 8) - load a font with character width that is not a multiple of 8 pixels note: the console-tools package cannot load a font that has width different from 8 pixels. You need to install the packages "kbd" and "console-terminus" and use the program "setfont" to set font width (for example: setfont Uni2-Terminus20x10) - move some text left and right on the bash command line and you get a screen corruption To expose more bugs, put this line to the end of uvesafb_init_info: info->flags |= FBINFO_HWACCEL_COPYAREA | FBINFO_READS_FAST; - Now framebuffer console will use cfb_copyarea for console scrolling. You get a screen corruption when console is scrolled. This patch is a rewrite of cfb_copyarea. It fixes the bugs, with this patch, console scrolling in 8-bit depth with a font width that is not a multiple of 8 pixels works fine. The cfb_copyarea code was very buggy and it looks like it was written and never tried with non-8-pixel font. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-18video: atmel_lcdfb: ensure the hardware is initialized with the correct modeAntoine Ténart
commit 7d3477d801808a5037a511cf5a5aae5718e7ecce upstream. If no driver takeover the atmel_lcdfb, the lcd won't be in a working state since atmel_lcdfb_set_par() will never be called. Enabling a driver which does, like fbcon, will call the function and put atmel_lcdfb in a working state. Fixes: b985172b328a (video: atmel_lcdfb: add device tree suport) Signed-off-by: Antoine Ténart <antoine.tenart@free-electrons.com> Reported-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16OMAPDSS: raw read and write endian fixVictor Kamensky
All OMAP IP blocks expect LE data, but CPU may operate in BE mode. Need to use endian neutral functions to read/write h/w registers. I.e instead of __raw_read[lw] and __raw_write[lw] functions code need to use read[lw]_relaxed and write[lw]_relaxed functions. If the first simply reads/writes register, the second will byteswap it if host operates in BE mode. Changes are trivial sed like replacement of __raw_xxx functions with xxx_relaxed variant. Signed-off-by: Victor Kamensky <victor.kamensky@linaro.org> Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
2014-04-15Merge branch 'tracking-armlt-clcd' into integration-linaro-vexpressJon Medhurst
2014-04-15Merge branch 'tracking-armlt-hdlcd' into integration-linaro-vexpressJon Medhurst
2014-04-15Merge branch 'tracking-armlt-ve-updates' into integration-linaro-vexpressJon Medhurst
2014-03-31amba-clcd: Hack RGB ordering in 32-bit video modesJon Medhurst
There is confusion somewhere about RGB ordering in 32-bit video modes. This hack get's these modes working in Linaro's ALIP and Android builds. Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-31amba-clcd: add 888 caps supportBrian Bennett
Add 888 caps support to the CLCD driver and increase the smem_len to allow 32bpp to be used. Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
2014-03-31amba-clcd: set video mode via module parameter on kernel commandlineRyan Harkin
Specifying the module parameter "amba-clcd.mode=<mode>" will over-ride the default mode used when the driver is initialised. Where <mode> can either be VGA or XVGA (the default). Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
2014-03-31amba-clcd: separate ioremap framebuffer from DMA implementationWill Deacon
The amba-clcd device can be configured to use either DMA or, when this feature is not available, an ioremapped frambuffer in static ram. In the case of the latter, we must take care not to pass ioremapped addresses to dma_common_mmap, since this expects only addresses from dma_mmap_coherent, which reside in the kernel linear mapping. This patch reworks the fb initialisation code so that either DMA or IO implementations of the mmap/remove functions are chosen as appropriate. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2014-03-31amba-clcd: Only use dma_alloc_writecombine() if the arch supports itCatalin Marinas
This patch hides the dma_(alloc|free)_writecombine() calls behind macros to allow the amba-clcd.c to be used on architectures that do not provide this DMA API. With this patch, the *_writecombine() API is only used on ARM (AArch32). Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2014-03-31amba-clcd: Remove check for 'reg' value in clcdfb_probeJon Medhurst
This check was attempting to ensure only one clcd device in the device-tree was probed, however the check fails in the valid case where the device is a child of another device and the 'reg' value is a offset from the start of that other device, not an absolute address. This occurs on vexpress with the motherboard clcd being a child of iofga. For now, we will just have to rely on there only being one display device specified in device-tree. Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-31amba-clcd: Add Device Tree support to amba-clcd driverJon Medhurst
Add support to parse the display configuration from device tree. If the board does not provide platform specific functions in the struct clcd_board contained with the amba device info, then defaults are provided by the driver. The device tree configuration can either ask for a DMA setup or provide a framebuffer address to be remapped into the driver. Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
2014-03-31ARM HDLCD: Fix clock initialisation sequenceJon Medhurst
This reworks HDLCD initialisation to mirror how CLCD does this, in particular to prepare the clock immediately after it has been got which ensures that we don't try and enable clocks before they were prepared, e.g. in the former clk_enable after register_framebuffer(). The reason this issue wasn't noticed before is that we have been setting CONFIG_FRAMEBUFFER_CONSOLE and this caused register_framebuffer() to trigger the creation of a console which calls hdlcd_set_par(), which in turn was preparing and enabling the clock. Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-31ARM HDLCD: Fix compilation on Linux 3.9Jon Medhurst
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-31ARM HDLCD: Changes to get HDLCD working with 've-updates'Jon Medhurst
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-31ARM HDLCD: Add developer option to remove double-height framebuffersChris Redpath
This option can be used with Android to push the graphics subsystem into a different composition strategy which is more effective when used on hardware where the framebuffer memory is not cacheable. Signed-off-by: Chris Redpath <chris.redpath@arm.com>
2014-03-31ARM HDLCD: Review comments from Liviu - extraneous memcpyChris Redpath
Signed-off-by: Chris Redpath <chris.redpath@arm.com> Reviewed-By: Liviu Dudau <liviu.dudau@arm.com>
2014-03-31ARM HDLCD: Add useful functions to HDLCD driver for system integrationChris Redpath
During TC2 integration a bad config option resulted in HDLCD memory reads not being serviced often enough. This lead to unsightly screen blanking. These options allow the developer to count the number of underruns and to control the color used by HDLCD when an underrun prevents accessing pixel data. The combination of these two options allow easy diagnosis of HDLCD underrun conditions. Signed-off-by: Chris Redpath <chris.redpath@arm.com>
2014-03-31ARM HDLCD: Change default byte ordering to match Android assumptionChris Redpath
Change color byte location in 32-bit word from argb to abgr to match the assumption made in Android when 32-bit color displays are used. Signed-off-by: Chris Redpath <chris.redpath@arm.com>
2014-03-31ARM HDLCD: Get it working under Android.Dietmar Eggemann
Add a shortcut when set_par is called to only change the yoffset. Android is doing that instead of calling pan_display to flip the framebuffer. Signed-off-by: Chris Redpath <chris.redpath@arm.com>
2014-03-31ARM HDLCD: Fixup driver to resemble ARM's latest codebase.Jon Medhurst
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-31ARM HDLCD: Add missing clk_{un}prepare callsJon Medhurst
Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-31ARM HDLCD: Add support for ARM High Definition LCD.Liviu Dudau
The ARM HDLCD device is now found in various new Versatile Express coretiles. Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
2014-03-31video: Make vexpress DVI driver depend on CONFIG_FBJon Medhurst
The driver uses symbols from fbmem.c so if CONFIG_FB is not selected we get build errors like: drivers/built-in.o: In function `vexpress_dvi_fb_select': :(.text+0x1b6c): undefined reference to `lock_fb_info' :(.text+0x1ba0): undefined reference to `registered_fb' Note, this is only a partial solution because we still have a problem if CONFIG_FB is selected as a module. Signed-off-by: Jon Medhurst <tixy@linaro.org>
2014-03-31video: Versatile Express DVI output driverPawel Moll
Versatile Express' DVI video output can be connected to one the three sources - motherboard's CLCD controller or a video signal generated by one of the daughterboards. This driver configures the muxer FPGA so the output displays content of one of the framebuffers in the system (0 by default, can be changed by user writing to the "fb" sysfs attribute of the muxfpga device). It will also set up the display formatter mode and keep it up to date with mode changes requested by the user (eg. with fbset tool). Signed-off-by: Pawel Moll <pawel.moll@arm.com>
2014-03-19video: adf: export the adf_attachment_allow symbol to modules.Alistair Strachan
There are no in-tree users of adf_attachment_allow, but out-of-tree modules want to use it. It looks like this function should be EXPORT_SYMBOL. Change-Id: Iad522dc5d32ac09fec6483bbc317db8ecae12e97 Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
2014-03-19video: adf: use %zu when printing size_tGreg Hackmann
Change-Id: I9cf7ebc368bad0a83db9e5aa370feadf117b21c0 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: fix compat ioctls calling ioctl with wrong cmdGreg Hackmann
Change-Id: Icdbac3edd123b3114103dc138a60e6955006cda4 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: use ADF_IOCTL_TYPE in compat ioctl definitionsGreg Hackmann
Change-Id: I7451a282d9d972c9957568b366c164b67b4b47e8 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: fix fbdev blank -> dpms state mappingGreg Hackmann
Change-Id: I96132a1b7275d389a6d0ba8899c6be838b63c422 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: validate dpms state passed to blankGreg Hackmann
Change-Id: I3a4228d50fc4a2553b3e92e5675a94cbc6e71b8a Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: make device node names less hierarchicalGreg Hackmann
adf/foobar/device -> adf0 adf/foobar/interface1 -> adf-interface0.1 adf/foobar/overlay-engine1 -> adf-overlay-engine0.1 Change-Id: I7af7f84ce3f101ecb02f448070c200ff3e03f2ec Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: expose adf_modeinfo_set_{name,vrefresh} to driversGreg Hackmann
Change-Id: Id9f8b2184927a77b244ce0b33d619d6e44a0f17a Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: set default interface dpms_state to OFFGreg Hackmann
Interfaces default to unplugged, so they should also default to off Change-Id: I36500a54b11f354a0d7dd2c9924a79e0d9c6f855 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: make dpms_state sysfs attribute writableGreg Hackmann
Change-Id: I04e7785cbddac160003e6c9edaf62d20b367fdc9 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: add helpers for validating custom formatsGreg Hackmann
Many custom formats look a lot like the standard ones, but with different subsampling, bpp, etc. Expose and document adf_buffer_validate()'s main body, so drivers can reuse its logic when validating these formats. Change-Id: I1d06981c9e5aab26f3ab2956c08c679f2c823bcc Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: add informational flags to interfacesGreg Hackmann
Informational flags don't affect ADF directly but may be useful to clients. Currently used to indicate primary and external displays. Change-Id: I343c7f0148da0869244c8e818350e9855525df85 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: add fbdev compatibility helperGreg Hackmann
Change-Id: I2b82bb625f805e8edb27799743b290dda5befb97 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: add supported formats to adf_overlay_engine_dataGreg Hackmann
Change-Id: If2aa783b9ece60160f465bf697508fc58682e1bc Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: support "simple" buffersGreg Hackmann
Simple buffers are linear RGB buffers analogous to KMS's dumb buffers. Simple buffers can be allocated and posted to a display interface without any driver-private data. Internally, ADF drivers provide the driver-private data needed (if any) to post a simple buffer to the display. Change-Id: Ib0b737622eaf343111310f6623f99d69cf3807d2 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: adf: add memblock helperGreg Hackmann
Provides a dma-buf exporter for memblocks, mainly useful for ADF devices to wrap their bootloader logos Change-Id: I936a9b5df099ab6084d433fcaf50f3bc29f93289 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-03-19video: add atomic display frameworkGreg Hackmann
Change-Id: I693257e269a99012cd0dbb57576ac222869cf4c7 Signed-off-by: Greg Hackmann <ghackmann@google.com>
2014-02-14video: Kconfig: Allow more broad selection of the imxfb framebuffer driver.Denis Carikli
Without that patch, a user can't select the imxfb driver when the i.MX25 and/or the i.MX27 device tree board are selected and that no boards that selects IMX_HAVE_PLATFORM_IMX_FB are compiled in. Cc: Eric Bénard <eric@eukrea.com> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Sascha Hauer <kernel@pengutronix.de> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-fbdev@vger.kernel.org Signed-off-by: Denis Carikli <denis@eukrea.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Acked-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-02-14video: exynos: Fix S6E8AX0 LCD driver build errorSachin Kamat
Enable S6E8AX0 LCD driver only if LCD_CLASS_DEVICE is a built-in driver. Else we get the following errors due to missing symbols: drivers/built-in.o: In function `s6e8ax0_probe': :(.text+0x51aec): undefined reference to `lcd_device_register' :(.text+0x51c44): undefined reference to `lcd_device_unregister' Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>