summaryrefslogtreecommitdiffstats
path: root/drivers/video
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/misc'Sascha Hauer2021-12-1516-16/+16
|\
| * drivers: migrate "GPL-2.0" license identifiers to SPDX 2.0Roland Hieber2021-11-2216-16/+16
| | | | | | | | | | | | | | | | | | | | "GPL-2.0-only" was introduced in SPDX 2.0, and the old identifier "GPL-2.0" is now considered deprecated; see <https://spdx.org/licenses>. Fixes: 28f4a6a4df76f0f1581d (2021-10-30, "drivers: add missing SPDX-License-Identifier") Signed-off-by: Roland Hieber <rhi@pengutronix.de> Link: https://lore.barebox.org/20211117113851.2022669-2-rhi@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | efi: rename <efi/efi.h> to <efi/efi-payload.h>Ahmad Fatoum2021-11-251-1/+1
|/ | | | | | | | | | | The split between <efi.h> and <efi/efi.h> is confusing: The former contains universal definitions, while the latter contains barebox utilities on top. To make the distinction clear, rename <efi/efi.h> to <efi/efi-payload.h> as it's used for EFI payloads. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-14-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: add missing SPDX-License-IdentifierAhmad Fatoum2021-11-0144-301/+46
| | | | | | | | | | | | | | | | | | | | This adds the suitable SPDX-License-Identifier to all files in drivers/ that previously lacked one. To aid manual inspection, following heuristics can be used: * No changes outside of comments/whitespace: git show -U0 HEAD | rg -v '^(@@|diff|index)|[-+]([-+]|//|#|[\s/]\*)' * -or-later come in pairs: git show --inter-hunk-context=19 HEAD | \ perl -0777 -F'/^@/gm' -ne 'for (@F) { @m = /later/g; print if @m & 1 }' Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030175632.2276077-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2021-10-071-13/+14
|\
| * video: simplefb-client: make probe less verboseAhmad Fatoum2021-10-051-4/+1
| | | | | | | | | | | | | | | | | | | | Printing the framebuffer base is unnecessary because it's already contained in the dev_printf prefix. Make the message shorter and only print it on success. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210824095119.15907-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * video: simplefb-client: populate video mode fieldAhmad Fatoum2021-10-051-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Video drivers should initialize fb_info->mode, so device parameters for mode and enable/disable can function as expected. This wasn't done in the simplefb driver so far, fix this. This also lets us drop some initialization of the fb_info, because it can be calculated from the mode. The very verbose mode info print can be dropped as well, because it's now available in devinfo. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210824095119.15907-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | video: Fix broken bcm2835 fb driverDaniel Brát2021-10-041-2/+19
|/ | | | | | | | | | | | | | | | The bcm2835 framebuffer driver was broken, because the address of video buffer allocated for us by the GPU and returned through mailbox was used without converting it back to ARM address space. That unconverted address was also in the range of peripheral addresses, which caused other issues later on due to it being filled with garbage data. The offset by which to convert the address back can vary by device, so the value is read from devicetree 'dma-ranges' for somewhat portable operation. This fix was tested on Raspberry PI B+ and Raspberry PI 3B+. Signed-off-by: Daniel Brát <danek.brat@gmail.com> Link: https://lore.barebox.org/20210907072915.18451-1-danek.brat@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2021-06-1612-0/+14
|\
| * video: reunite fb devices with their hardware parentAhmad Fatoum2021-06-0212-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | So far, only sdlfb and efi associated the framebuffer device they register with the hardware device providing it. Follow suit for all other frame buffers. This enables devinfo to display parentage. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210527124453.22710-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: introduce struct clk_hwSascha Hauer2021-06-071-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Linux the ops in struct clk_ops take a struct clk_hw * argument instead of a struct clk * argument as in barebox. With this taking new clk drivers from Linux requires a lot of mechanical conversions. Instead of doing this over and over again swallow the pill once and convert the existing barebox code over to clk_hw. The implementation is a little different from Linux. In Linux struct clk is only known to the core clock code. In barebox struct clk is publically known and it is embedded into struct clk_hw. This allows us to still use struct clk members in the clock drivers which we currently still need, because otherwise this patch would be even bigger. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210602095507.24609-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: rename clk_register() to bclk_register()Sascha Hauer2021-06-071-1/+1
|/ | | | | | | | | | | | Linux has a clk_register() function with a different semantics than barebox. Rename this function to bclk_register() so that we later can introduce a clk_register() function with the same semantics as Linux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210602095507.24609-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2021-04-151-7/+7
|\
| * atmel_lcdfb: fix atmel,lcd-wiring-mode; BGR => BRGSam Ravnborg2021-04-131-7/+7
| | | | | | | | | | | | | | | | | | Fix spelling error that prevented us from getting the atmel,lcd-wiring-mode The Bindings mandate the use of BRG. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
* | video: bochs: pci: fix unterminated PCI device tableAhmad Fatoum2021-04-131-0/+1
|/ | | | | | | | | Like other device id tables across tree, the last element is expected to be zeroed to act as sentinel. Fix the omission. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.pengutronix.de/20210410104807.2078535-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: add simplefb driverAhmad Fatoum2021-03-014-2/+158
| | | | | | | | | | | | barebox has support to fix up a framebuffer it has set up as simplefb into the device tree of a kernel it boots. Add the counterpart to this, so barebox itself can reuse an already set up frame buffer. This is done to support the framebuffer device on the tinyemu RISC-V machine. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/sound'Sascha Hauer2021-02-222-14/+24
|\
| * sandbox: migrate to SDL 2.0Ahmad Fatoum2021-02-082-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SDL 2.0 has been released more than 7 years ago and should be available everywhere. Replace barebox's SDL 1.2 with SDL 2.0 instead: - better maintained - At least on Debian, you can't install x86_64 and i386 libsdl-dev at the same time, which makes a quick use of CONFIG_SANDBOX_LINUX_I386 harder as the user needs to reinstall libraries. With SDL 2.0, it works - SDL 2.0 has easier audio API, which will be used in a later commit - Wayland support for sandbox video driver Port to SDL 2.0 and as we touch everything anyway, rename the sdl_ functions to start with sdl_video_ to differentiate from upcoming sdl_sound_. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/asm-io'Sascha Hauer2021-02-221-2/+1
|\ \
| * | printk: port over Linux print_hex_dump_bytes/print_hex_dump_debugAhmad Fatoum2021-02-041-2/+1
| |/ | | | | | | | | | | | | | | | | print_hex_dump in barebox always prints a hex dump. Most users use it for debugging though, so import Linux helpers to do so to cut down on the #ifdef DEBUG. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / treewide: include <linux/math64.h> wrapper instead of <asm-generic/div64.h>Ahmad Fatoum2021-02-199-9/+9
|/ | | | | | | | | | | <asm-generic/div64.h> isn't meant for direct usage as <asm/div64.h> may override this on a per-architecture basis. We don't do that currently, but in the future we might. Include the <linux/math64.h> instead. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: sdl: delete useless debug outputAhmad Fatoum2021-01-051-9/+0
| | | | | | | | | The information on the color mode is only populated at framebuffer enable time. At probe time, it's all zero, so it's useless to print it out. Drop it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: implement bochs dispi / QEMU VGA driver for PCI and ISAAhmad Fatoum2021-01-058-1/+320
| | | | | | | | | | | | | All SVGA devices in Qemu, except for Cirrus, support the bochs display interface, which is very easy to set up. Add a driver for it. This has been tested with: PCI: qemu-system-mips(el) -device VGA + barebox qemu-malta_defconfig ISA: qemu-system-x86_64 -device isa-vga + barebox efi_defconfig Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: edid: make edid_check_header externally visibleAhmad Fatoum2021-01-052-4/+14
| | | | | | | | | For non-i2c EDID use, drivers will want to verify the EDID header. We already have a function for this, but internal linkage. Change this and while at it change the type to a more appropriate type. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: edid: make accessible without i2cAhmad Fatoum2021-01-052-1/+3
| | | | | | | | | | | Users can already populate fb_info::edid_data for cases where the EDID doesn't come via an i2c controller managed by barebox. Only thing missing is to be able to compile without i2c, thus drop the dependency. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fb: sync enable device parameter with internal stateAhmad Fatoum2020-11-231-9/+12
| | | | | | | | | | | | So far fb.enable only reflected whether the fb was enabled/disabled via device parameter. Enabling/disabling the fb via ioctl left the parameter untouched. Remedy this. While at it, have setting of fb.enable if the underlying fb_enable/fb_disable fails as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/percent_pe' into masterSascha Hauer2020-10-142-7/+6
|\
| * treewide: replace strerror(-PTR_ERR(errno)) with %pe format specifierAhmad Fatoum2020-09-291-3/+2
| | | | | | | | | | | | | | | | | | Using %pe instead of PTR_ERR has the benefit of being less verbose and less error-prone (no negation necessary) while potentially reducing code size. Make use of it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * vsprintf: retire strerrorp in favor of %peAhmad Fatoum2020-09-291-4/+4
| | | | | | | | | | | | | | | | | | strerrorp() is only used along with printf. We now have a format specifier for printing error pointers directly, so use that and remove strerrorp. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/driver-macro' into masterSascha Hauer2020-10-142-11/+2
|\ \
| * | treewide: Use driver macroSascha Hauer2020-09-292-11/+2
| |/ | | | | | | | | | | | | We have several macros for a oneline driver registration. Add some missing and use them consistently where possible througout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/dev-drvdata' into masterSascha Hauer2020-10-141-31/+8
|\ \
| * | video: imx-hdmi: fix dev_get_drvdata misuseAhmad Fatoum2020-10-091-31/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver has a couple of issues in how it handles match data: - First use of dev_get_drvdata is superfluous as result is unused - Second use of dev_get_drvdata stores a sizeof(const void *) into an enum typed object - hdmi->dev_type contains a truncated pointer to a struct dw_hdmi_data and compares it with an enum, which will always fail Fix these and while it, refactor the code a bit to get rid of dw_hdmi_data, whose only other member is unused. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / video: ssd1307fb: fix VBAT supply idMarco Felsch2020-09-291-1/+1
|/ | | | | | | | | The regulator id should be given without the "-supply" suffix else the core is searching for "vbat-supply-supply". Fixes: bf8f62d334 ("video/ssd1307fb: add support for VBAT") Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: simple-panel: don't error out on unhandled ioctl commandAhmad Fatoum2020-08-201-1/+1
| | | | | | | | | | | | | | | | | | | Video devices propagate ioctls down the pipeline by calling vpl_ioctl themselves. This also happens when propagating VPL_PREPARE. simple-panel doesn't have anything special to do in VPL_PREPARE, so it returned -ENOSYS so far. This leads vpl_ioctl to fail, which in turn is propagated back through the pipeline. For devices with multiple endpoints, vpl_ioctl passes the ioctl to each one of them. An early exit by a simple-panel can thus cause other endpoints to not prepare themselves leading to display issues. Fix this by having the simple panel ignore ioctls that aren't relevant to it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: ipuv3: parallel-display: support of_graph bindingAhmad Fatoum2020-08-201-10/+21
| | | | | | | | | | | | | | | | | "fsl,imx-parallel-display"-compatible devices are supposed to support two bindings to query the connected LCD's parameters: - A display timings sub node - A of_graph pointing to a panel or a bridge So far only the first was supported. Mimic what LDB is already doing, so we support both. Unlike LDB, if both are specified, the display timings node takes precedence. This is to maintain backwards compatibility. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: ssd1307fb: Honour reset GPIO polaritySascha Hauer2020-08-181-7/+11
| | | | | | | The reset GPIO polarity was hardcoded as active low. Honour the polarity flags given in the device tree instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-05-1410-31/+1
|\
| * video: backlight-pwm: set backlight dev.parent to hardware devAhmad Fatoum2020-05-121-0/+1
| | | | | | | | | | | | | | | | | | backlight_register allocates a new backlight device. Populating the device's parent field with the hardware device gives us more informational devinfo output. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * video: backlight-pwm: remove unused struct memberAhmad Fatoum2020-05-121-1/+0
| | | | | | | | | | | | | | pwm_backlight.max_value is unused anywhere. Drop it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * treewide: remove references to CREDITSUwe Kleine-König2020-04-2710-30/+0
| | | | | | | | | | | | | | | | The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97 ("Remove the CREDITS file"). Remove references to it from several files. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | video: ssd1307fb: fix null pointer dereference on errorAhmad Fatoum2020-05-041-1/+1
|/ | | | | | | | | | On error, a goto may jump over the initialization of vmem and free the uninitialized value during clean up. Fix this. Found by compiling the code with clang. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video/ssd1307fb: make reset GPIO optionalAhmad Fatoum2020-03-091-20/+23
| | | | | | | | Both reset GPIO and regulator are optional as per the binding and the driver can work without if we ignore their absence. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video/ssd1307fb: drop unneeded regulator NULL checksAhmad Fatoum2020-03-091-10/+6
| | | | | | | | regulator_{enable,disable} are already no-ops when the parameter is NULL. Drop the NULL checks thusly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video/ssd1307fb: fix NULL pointer dereference in probeAhmad Fatoum2020-03-091-1/+3
| | | | | | | | info->priv is dereferenced before a valid value has been set leading to a NULL pointer dereference in the probe function. Fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: backlight-pwm: remove duplicate assignment to objectAhmad Fatoum2020-02-101-2/+0
| | | | | | | | pwm_backlight->period is assigned pwm_get_period(pwm), which is the same value just a few lines earlier. Remove the superfluous reassignment. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: imxfb: make pcr and bpp per-display settingsUwe Kleine-König2019-09-121-17/+6
| | | | | | | | | | | | These settings used to be specified per-mode. But the device tree bindings have these two values attached to the display and not to each mode. Also for the supported boards it doesn't matter as they all only have a single mode. This is preparatory work to add devicetree support for the imxfb driver. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video/stm: fix return value handling for of_get_display_timings()Uwe Kleine-König2019-09-061-2/+2
| | | | | | | | of_get_display_timings() returns NULL on failure, not an error pointer. Fixes: 16fd24847d7a ("video: stmfb: Add device tree support") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: replace __raw_{readl, writel} of peripherals with readl, writelAhmad Fatoum2019-05-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the potentially endianness-changing readl, writel and siblings directly. They looks prettier and are the correct thing to do, as even if the CPU is in big-endian mode, the peripherals are little-endian. Unlike Linux, barebox readl,writel are the same Linux' {readl,writel}_relaxed (they don't imply memory barriers) and thus there shouldn't be any functional change. Patch was generated by a mass search and replace. I looked it over, adjust some whitespace and further verified by reviewing the output of git diff HEAD~1 --word-diff | \ perl -pe 's/\[-(.*?)__raw_/{+$1/; s/-\]\{\+/+}{+/;' \ -e 's/(\{\+.*?\+\})\1/__ALL_IS_WELL__/' | grep '+}{+' which filters out the common case of lines where a single __raw_{readT,writeT} had its __raw_ prefix stripped without any further changes. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Tested-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: surround Kconfig file paths with double quotesMasahiro Yamada2019-03-211-1/+1
| | | | | | | | | Based on Linux commit 8636a1f9677db4f883f29a072f401303acfc2edd This will be needed when you sync Kconfig with Linux 5.0 or later. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>