summaryrefslogtreecommitdiff
path: root/drivers/video
AgeCommit message (Collapse)Author
2019-03-28Merge tag 'v4.9.166' into 4.9-2.3.x-imxMarcel Ziswiler
This is the 4.9.166 stable release
2019-03-27pwm-backlight: Enable/disable the PWM before/after LCD enable toggle.Enric Balletbo i Serra
commit 5fb5caee92ba35a4a3baa61d45a78eb057e2c031 upstream. Before this patch the enable signal was set before the PWM signal and vice-versa on power off. This sequence is wrong, at least, it is on the different panels datasheets that I checked, so I inverted the sequence to follow the specs. For reference the following panels have the mentioned sequence: - N133HSE-EA1 (Innolux) - N116BGE (Innolux) - N156BGE-L21 (Innolux) - B101EAN0 (Auo) - B101AW03 (Auo) - LTN101NT05 (Samsung) - CLAA101WA01A (Chunghwa) Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Acked-by: Daniel Thompson <daniel.thompson@linaro.org> Acked-by: Jingoo Han <jingoohan1@gmail.com> Acked-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-12fbdev: fbcon: Fix unregister crash when more than one framebufferNoralf Trønnes
[ Upstream commit 2122b40580dd9d0620398739c773d07a7b7939d0 ] When unregistering fbdev using unregister_framebuffer(), any bound console will unbind automatically. This is working fine if this is the only framebuffer, resulting in a switch to the dummy console. However if there is a fb0 and I unregister fb1 having a bound console, I eventually get a crash. The fastest way for me to trigger the crash is to do a reboot, resulting in this splat: [ 76.478825] WARNING: CPU: 0 PID: 527 at linux/kernel/workqueue.c:1442 __queue_work+0x2d4/0x41c [ 76.478849] Modules linked in: raspberrypi_hwmon gpio_backlight backlight bcm2835_rng rng_core [last unloaded: tinydrm] [ 76.478916] CPU: 0 PID: 527 Comm: systemd-udevd Not tainted 4.20.0-rc4+ #4 [ 76.478933] Hardware name: BCM2835 [ 76.478949] Backtrace: [ 76.478995] [<c010d388>] (dump_backtrace) from [<c010d670>] (show_stack+0x20/0x24) [ 76.479022] r6:00000000 r5:c0bc73be r4:00000000 r3:6fb5bf81 [ 76.479060] [<c010d650>] (show_stack) from [<c08e82f4>] (dump_stack+0x20/0x28) [ 76.479102] [<c08e82d4>] (dump_stack) from [<c0120070>] (__warn+0xec/0x12c) [ 76.479134] [<c011ff84>] (__warn) from [<c01201e4>] (warn_slowpath_null+0x4c/0x58) [ 76.479165] r9:c0eb6944 r8:00000001 r7:c0e927f8 r6:c0bc73be r5:000005a2 r4:c0139e84 [ 76.479197] [<c0120198>] (warn_slowpath_null) from [<c0139e84>] (__queue_work+0x2d4/0x41c) [ 76.479222] r6:d7666a00 r5:c0e918ee r4:dbc4e700 [ 76.479251] [<c0139bb0>] (__queue_work) from [<c013a02c>] (queue_work_on+0x60/0x88) [ 76.479281] r10:c0496bf8 r9:00000100 r8:c0e92ae0 r7:00000001 r6:d9403700 r5:d7666a00 [ 76.479298] r4:20000113 [ 76.479348] [<c0139fcc>] (queue_work_on) from [<c0496c28>] (cursor_timer_handler+0x30/0x54) [ 76.479374] r7:d8a8fabc r6:c0e08088 r5:d8afdc5c r4:d8a8fabc [ 76.479413] [<c0496bf8>] (cursor_timer_handler) from [<c0178744>] (call_timer_fn+0x100/0x230) [ 76.479435] r4:c0e9192f r3:d758a340 [ 76.479465] [<c0178644>] (call_timer_fn) from [<c0178980>] (expire_timers+0x10c/0x12c) [ 76.479495] r10:40000000 r9:c0e9192f r8:c0e92ae0 r7:d8afdccc r6:c0e19280 r5:c0496bf8 [ 76.479513] r4:d8a8fabc [ 76.479541] [<c0178874>] (expire_timers) from [<c0179630>] (run_timer_softirq+0xa8/0x184) [ 76.479570] r9:00000001 r8:c0e19280 r7:00000000 r6:c0e08088 r5:c0e1a3e0 r4:c0e19280 [ 76.479603] [<c0179588>] (run_timer_softirq) from [<c0102404>] (__do_softirq+0x1ac/0x3fc) [ 76.479632] r10:c0e91680 r9:d8afc020 r8:0000000a r7:00000100 r6:00000001 r5:00000002 [ 76.479650] r4:c0eb65ec [ 76.479686] [<c0102258>] (__do_softirq) from [<c0124d10>] (irq_exit+0xe8/0x168) [ 76.479716] r10:d8d1a9b0 r9:d8afc000 r8:00000001 r7:d949c000 r6:00000000 r5:c0e8b3f0 [ 76.479734] r4:00000000 [ 76.479764] [<c0124c28>] (irq_exit) from [<c016b72c>] (__handle_domain_irq+0x94/0xb0) [ 76.479793] [<c016b698>] (__handle_domain_irq) from [<c01021dc>] (bcm2835_handle_irq+0x3c/0x48) [ 76.479823] r8:d8afdebc r7:d8afddfc r6:ffffffff r5:c0e089f8 r4:d8afddc8 r3:d8afddc8 [ 76.479851] [<c01021a0>] (bcm2835_handle_irq) from [<c01019f0>] (__irq_svc+0x70/0x98) The problem is in the console rebinding in fbcon_fb_unbind(). It uses the virtual console index as the new framebuffer index to bind the console(s) to. The correct way is to use the con2fb_map lookup table to find the framebuffer index. Fixes: cfafca8067c6 ("fbdev: fbcon: console unregistration from unregister_framebuffer") Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Mikulas Patocka <mpatocka@redhat.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-02-12fbdev: fbmem: behave better with small rotated displays and many CPUsPeter Rosin
[ Upstream commit f75df8d4b4fabfad7e3cba2debfad12741c6fde7 ] Blitting an image with "negative" offsets is not working since there is no clipping. It hopefully just crashes. For the bootup logo, there is protection so that blitting does not happen as the image is drawn further and further to the right (ROTATE_UR) or further and further down (ROTATE_CW). There is however no protection when drawing in the opposite directions (ROTATE_UD and ROTATE_CCW). Add back this protection. The regression is 20-odd years old but the mindless warning-killing mentality displayed in commit 34bdb666f4b2 ("fbdev: fbmem: remove positive test on unsigned values") is also to blame, methinks. Fixes: 448d479747b8 ("fbdev: fb_do_show_logo() updates") Signed-off-by: Peter Rosin <peda@axentia.se> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Fabian Frederick <ffrederick@users.sourceforge.net> Cc: Geert Uytterhoeven <geert+renesas@glider.be> cc: Geoff Levand <geoff@infradead.org> Cc: James Simmons <jsimmons@users.sf.net> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-02-12video: clps711x-fb: release disp device node in probe()Alexey Khoroshilov
[ Upstream commit fdac751355cd76e049f628afe6acb8ff4b1399f7 ] clps711x_fb_probe() increments refcnt of disp device node by of_parse_phandle() and leaves it undecremented on both successful and error paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Cc: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-01-23omap2fb: Fix stack memory disclosureVlad Tsyrklevich
commit a01421e4484327fe44f8e126793ed5a48a221e24 upstream. Using [1] for static analysis I found that the OMAPFB_QUERY_PLANE, OMAPFB_GET_COLOR_KEY, OMAPFB_GET_DISPLAY_INFO, and OMAPFB_GET_VRAM_INFO cases could all leak uninitialized stack memory--either due to uninitialized padding or 'reserved' fields. Fix them by clearing the shared union used to store copied out data. [1] https://github.com/vlad902/kernel-uninitialized-memory-checker Signed-off-by: Vlad Tsyrklevich <vlad@tsyrklevich.net> Reviewed-by: Kees Cook <keescook@chromium.org> Fixes: b39a982ddecf ("OMAP: DSS2: omapfb driver") Cc: security@kernel.org [b.zolnierkie: prefix patch subject with "omap2fb: "] Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12Merge tag 'v4.9.144' into 4.9-2.3.x-imxMarcel Ziswiler
This is the 4.9.144 stable release
2018-11-21mach64: fix image corruption due to reading accelerator registersMikulas Patocka
commit c09bcc91bb94ed91f1391bffcbe294963d605732 upstream. Reading the registers without waiting for engine idle returns unpredictable values. These unpredictable values result in display corruption - if atyfb_imageblit reads the content of DP_PIX_WIDTH with the bit DP_HOST_TRIPLE_EN set (from previous invocation), the driver would never ever clear the bit, resulting in display corruption. We don't want to wait for idle because it would degrade performance, so this patch modifies the driver so that it never reads accelerator registers. HOST_CNTL doesn't have to be read, we can just write it with HOST_BYTE_ALIGN because no other part of the driver cares if HOST_BYTE_ALIGN is set. DP_PIX_WIDTH is written in the functions atyfb_copyarea and atyfb_fillrect with the default value and in atyfb_imageblit with the value set according to the source image data. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Reviewed-by: Ville Syrjälä <syrjala@sci.fi> Cc: stable@vger.kernel.org Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-21mach64: fix display corruption on big endian machinesMikulas Patocka
commit 3c6c6a7878d00a3ac997a779c5b9861ff25dfcc8 upstream. The code for manual bit triple is not endian-clean. It builds the variable "hostdword" using byte accesses, therefore we must read the variable with "le32_to_cpu". The patch also enables (hardware or software) bit triple only if the image is monochrome (image->depth). If we want to blit full-color image, we shouldn't use the triple code. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Reviewed-by: Ville Syrjälä <syrjala@sci.fi> Cc: stable@vger.kernel.org Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-10efi/fb: Correct PCI_STD_RESOURCE_END usageBjorn Helgaas
[ Upstream commit 92a16c86299c64f58f320e491977408ba31b8c3c ] PCI_STD_RESOURCE_END is (confusingly) the index of the last valid BAR, not the *number* of BARs. To iterate through all possible BARs, we need to include PCI_STD_RESOURCE_END. Fixes: 55d728a40d36 ("efi/fb: Avoid reconfiguration of BAR that covers the framebuffer") Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-11-10pxa168fb: prepare the clockLubomir Rintel
[ Upstream commit d85536cde91fcfed6fb8d983783bd2b92c843939 ] Add missing prepare/unprepare operations for fbi->clk, this fixes following kernel warning: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:874 clk_core_enable+0x2c/0x1b0 Enabling unprepared disp0_clk Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-rc8-00032-g02b43ddd4f21-dirty #25 Hardware name: Marvell MMP2 (Device Tree Support) [<c010f7cc>] (unwind_backtrace) from [<c010cc6c>] (show_stack+0x10/0x14) [<c010cc6c>] (show_stack) from [<c011dab4>] (__warn+0xd8/0xf0) [<c011dab4>] (__warn) from [<c011db10>] (warn_slowpath_fmt+0x44/0x6c) [<c011db10>] (warn_slowpath_fmt) from [<c043898c>] (clk_core_enable+0x2c/0x1b0) [<c043898c>] (clk_core_enable) from [<c0439ec8>] (clk_core_enable_lock+0x18/0x2c) [<c0439ec8>] (clk_core_enable_lock) from [<c0436698>] (pxa168fb_probe+0x464/0x6ac) [<c0436698>] (pxa168fb_probe) from [<c04779a0>] (platform_drv_probe+0x48/0x94) [<c04779a0>] (platform_drv_probe) from [<c0475bec>] (driver_probe_device+0x328/0x470) [<c0475bec>] (driver_probe_device) from [<c0475de4>] (__driver_attach+0xb0/0x124) [<c0475de4>] (__driver_attach) from [<c0473c38>] (bus_for_each_dev+0x64/0xa0) [<c0473c38>] (bus_for_each_dev) from [<c0474ee0>] (bus_add_driver+0x1b8/0x230) [<c0474ee0>] (bus_add_driver) from [<c0476a20>] (driver_register+0xac/0xf0) [<c0476a20>] (driver_register) from [<c0102dd4>] (do_one_initcall+0xb8/0x1f0) [<c0102dd4>] (do_one_initcall) from [<c0b010a0>] (kernel_init_freeable+0x294/0x2e0) [<c0b010a0>] (kernel_init_freeable) from [<c07e9eb8>] (kernel_init+0x8/0x10c) [<c07e9eb8>] (kernel_init) from [<c01010e8>] (ret_from_fork+0x14/0x2c) Exception stack(0xd008bfb0 to 0xd008bff8) bfa0: 00000000 00000000 00000000 00000000 bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace c0af40f9e2ed7cb4 ]--- Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> [b.zolnierkie: enhance patch description a bit] Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-10-18mach64: detect the dot clock divider correctly on sparcMikulas Patocka
commit 76ebebd2464c5c8a4453c98b6dbf9c95a599e810 upstream. On Sun Ultra 5, it happens that the dot clock is not set up properly for some videomodes. For example, if we set the videomode "r1024x768x60" in the firmware, Linux would incorrectly set a videomode with refresh rate 180Hz when booting (suprisingly, my LCD monitor can display it, although display quality is very low). The reason is this: Older mach64 cards set the divider in the register VCLK_POST_DIV. The register has four 2-bit fields (the field that is actually used is specified in the lowest two bits of the register CLOCK_CNTL). The 2 bits select divider "1, 2, 4, 8". On newer mach64 cards, there's another bit added - the top four bits of PLL_EXT_CNTL extend the divider selection, so we have possible dividers "1, 2, 4, 8, 3, 5, 6, 12". The Linux driver clears the top four bits of PLL_EXT_CNTL and never sets them, so it can work regardless if the card supports them. However, the sparc64 firmware may set these extended dividers during boot - and the mach64 driver detects incorrect dot clock in this case. This patch makes the driver read the additional divider bit from PLL_EXT_CNTL and calculate the initial refresh rate properly. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org Acked-by: David S. Miller <davem@davemloft.net> Reviewed-by: Ville Syrjälä <syrjala@sci.fi> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-13fbdev/omapfb: fix omapfb_memory_read infoleakTomi Valkeinen
commit 1bafcbf59fed92af58955024452f45430d3898c5 upstream. OMAPFB_MEMORY_READ ioctl reads pixels from the LCD's memory and copies them to a userspace buffer. The code has two issues: - The user provided width and height could be large enough to overflow the calculations - The copy_to_user() can copy uninitialized memory to the userspace, which might contain sensitive kernel information. Fix these by limiting the width & height parameters, and only copying the amount of data that we actually received from the LCD. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reported-by: Jann Horn <jannh@google.com> Cc: stable@vger.kernel.org Cc: security@kernel.org Cc: Will Deacon <will.deacon@arm.com> Cc: Jann Horn <jannh@google.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-02Merge tag 'v4.9.130' into 4.9-2.3.x-imxGary Bisson
This is the 4.9.130 stable release
2018-09-26fbdev: Distinguish between interlaced and progressive modesFredrik Noring
[ Upstream commit 1ba0a59cea41ea05fda92daaf2a2958a2246b9cf ] I discovered the problem when developing a frame buffer driver for the PlayStation 2 (not yet merged), using the following video modes for the PlayStation 3 in drivers/video/fbdev/ps3fb.c: }, { /* 1080if */ "1080if", 50, 1920, 1080, 13468, 148, 484, 36, 4, 88, 5, FB_SYNC_BROADCAST, FB_VMODE_INTERLACED }, { /* 1080pf */ "1080pf", 50, 1920, 1080, 6734, 148, 484, 36, 4, 88, 5, FB_SYNC_BROADCAST, FB_VMODE_NONINTERLACED }, In ps3fb_probe, the mode_option module parameter is used with fb_find_mode but it can only select the interlaced variant of 1920x1080 since the loop matching the modes does not take the difference between interlaced and progressive modes into account. In short, without the patch, progressive 1920x1080 cannot be chosen as a mode_option parameter since fb_find_mode (falsely) thinks interlace is a perfect match. Signed-off-by: Fredrik Noring <noring@nocrew.org> Cc: "Maciej W. Rozycki" <macro@linux-mips.org> [b.zolnierkie: updated patch description] Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26video: fbdev: pxafb: clear allocated memory for video modesDaniel Mack
[ Upstream commit b951d80aaf224b1f774e10def672f5e37488e4ee ] When parsing the video modes from DT properties, make sure to zero out memory before using it. This is important because not all fields in the mode struct are explicitly initialized, even though they are used later on. Fixes: 420a488278e86 ("video: fbdev: pxafb: initial devicetree conversion") Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26fbdev/via: fix defined but not used warningRandy Dunlap
[ Upstream commit b6566b47a67e07fdca44cf51abb14e2fbe17d3eb ] Fix a build warning in viafbdev.c when CONFIG_PROC_FS is not enabled by marking the unused function as __maybe_unused. ../drivers/video/fbdev/via/viafbdev.c:1471:12: warning: 'viafb_sup_odev_proc_show' defined but not used [-Wunused-function] Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26video: goldfishfb: fix memory leak on driver removeAnton Vasilyev
[ Upstream commit 5958fde72d04e7b8c6de3669d1f794a90997e3eb ] goldfish_fb_probe() allocates memory for fb, but goldfish_fb_remove() does not have deallocation of fb, which leads to memory leak on probe/remove. The patch adds deallocation into goldfish_fb_remove(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru> Cc: Aleksandar Markovic <aleksandar.markovic@mips.com> Cc: Miodrag Dinic <miodrag.dinic@mips.com> Cc: Goran Ferenc <goran.ferenc@mips.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-26fbdev: omapfb: off by one in omapfb_register_client()Dan Carpenter
[ Upstream commit 5ec1ec35b2979b59d0b33381e7c9aac17e159d16 ] The omapfb_register_client[] array has OMAPFB_PLANE_NUM elements so the > should be >= or we are one element beyond the end of the array. Fixes: 8b08cf2b64f5 ("OMAP: add TI OMAP framebuffer driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Imre Deak <imre.deak@solidboot.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-18Merge tag 'v4.9.127' into imx_4.9.x_2.3.0_gaGary Bisson
This is the 4.9.127 stable release Conflicts: drivers/gpu/drm/imx/imx-ldb.c drivers/staging/android/ion/ion_priv.h
2018-09-09fb: fix lost console when the user unplugs a USB adapterMikulas Patocka
commit 8c5b044299951acd91e830a688dd920477ea1eda upstream. I have a USB display adapter using the udlfb driver and I use it on an ARM board that doesn't have any graphics card. When I plug the adapter in, the console is properly displayed, however when I unplug and re-plug the adapter, the console is not displayed and I can't access it until I reboot the board. The reason is this: When the adapter is unplugged, dlfb_usb_disconnect calls unlink_framebuffer, then it waits until the reference count drops to zero and then it deallocates the framebuffer. However, the console that is attached to the framebuffer device keeps the reference count non-zero, so the framebuffer device is never destroyed. When the USB adapter is plugged again, it creates a new device /dev/fb1 and the console is not attached to it. This patch fixes the bug by unbinding the console from unlink_framebuffer. The code to unbind the console is moved from do_unregister_framebuffer to a function unbind_console. When the console is unbound, the reference count drops to zero and the udlfb driver frees the framebuffer. When the adapter is plugged back, a new framebuffer is created and the console is attached to it. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Bernie Thompson <bernie@plugable.com> Cc: Ladislav Michl <ladis@linux-mips.org> Cc: stable@vger.kernel.org [b.zolnierkie: preserve old behavior for do_unregister_framebuffer()] Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-24MLK-18031 video: mxsfb: enable global alpha when grayscale is 0 for 32bpp formatFancy Fang
For overlay framebuffer, when its grayscale is '0' and the format bpp is 32, enable the global alpha blending by default which can make the overlay fb can display the framebuffer content as long as it is unblanked. Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2018-08-24MLK-17692-1: fbdev: Remove imx8 hdmi fb driverSandor Yu
imx8 hdmi fb driver is not maintain. imx8 hdmi function have implemented with DRM framework in driver/gpu/drm/imx folder. So remove hdmi fb driver. Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-08-24video: mxfsb: Fix endless -EPROBE_DEFER with empty disp_devLeonard Crestez
Since f7b48681ec68 ("MLK-16137 video: fbdev: add defer probe for mxs framebuffer") the mxsfb_dispdrv_init function will return -EPROBE_DEFER on all mxc_dispdrv_gethandle failures. That makes sense because all mxc_dispdrv_entry are registered in their respective probe functions and an absent entry should result in probing mxsfb later. However in some cases an the disp_dev is empty and those configurations now result in enless EPROBE_DEFER loops. Fix this by accepting empty disp_dev at the start of mxsfb_dispdrv_init. Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
2018-08-24video: mxsfb: Fix leaking videomem if dispdrv not readyLeonard Crestez
This is a large leak and repeated probing can even exhaust CMA Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
2018-08-24drm: Enable HDR infoframe supportUma Shankar
Enable Dynamic Range and Mastering Infoframe for HDR content, which is defined in CEA 861.3 spec. The metadata will be computed based on blending policy in userspace compositors and passed as a connector property blob to driver. The same will be sent as infoframe to panel which support HDR. Signed-off-by: Uma Shankar <uma.shankar@intel.com>
2018-08-24MLK-17289-3: hdmi fb: change mem variable typeSandor Yu
Change mem variable type. Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-08-24MLK-17370 video: fbdev: mxc_edid: change '640x480' mode clockFancy Fang
For the '640x480' cea mode, change the 'pixclock' from 39722 ps to 39683 ps to satisfy the imx7ulp hdmi display requirement. Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2018-08-24MLK-17215-3 video: fbdev: mipi_dsi_northwest: refine 'phy-ref-clkfreq' get ↵Fancy Fang
to support all socs Move the code slice of getting 'phy-ref-clkfreq' property to probe function to support arm32 socs besides arm64. Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2018-08-24MLK-17215-1 video: fbdev: mipi_dsi_northwest: fix an integer overflow issueFancy Fang
On ARM32 socs, the 'UL' and 'ULL' postfix are different. And if using a 64bit constant integer, 'ULL' is the right postfix. Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2018-08-24video: Add new aspect ratios for HDMI 2.0Shashank Sharma
HDMI 2.0/CEA-861-F introduces two new aspect ratios: - 64:27 - 256:135 This patch adds enumeration for the new aspect ratios in the existing aspect ratio list. V2: rebase V3: rebase V4: Added r-b from Jose, Ack by Tomi Signed-off-by: Shashank Sharma <shashank.sharma@intel.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Jose Abreu <Jose.Abreu@synopsys.com> Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1476705880-15600-4-git-send-email-shashank.sharma@intel.com (cherry picked from commit a6e78b3e1406575323b30b65890ee3c29930fb27) Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-08-24MLK-16755 video: fbdev: mipi_dsi_northwest: fix a linker error when do 64bit divFancy Fang
Compiling the 64-bit integer direct division statement by 32-bit GCC compiler may trigger below linker error: " drivers/built-in.o: In function `mipi_dsi_enable': core.c:(.text+0x2ad48): undefined reference to `__aeabi_uldivmod' core.c:(.text+0x2ad60): undefined reference to `__aeabi_uldivmod' core.c:(.text+0x2ada4): undefined reference to `__aeabi_uldivmod' core.c:(.text+0x2ade8): undefined reference to `__aeabi_uldivmod' core.c:(.text+0x2aed4): undefined reference to `__aeabi_uldivmod' drivers/built-in.o:core.c:(.text+0x2af00): more undefined references to `__aeabi_uldivmod' follow make: *** [vmlinux] Error 1 " In this case, use 'do_div()' can solve this linker error. This patch changes all the 'DIV_ROUND_CLOSEST()' to its 64-bit version 'DIV_ROUND_CLOSEST_ULL()' and also uses 'do_div()' to replace all the direct division operations if required. Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2018-08-24MLK-16706-4 video: fbdev: mipi_dsi_northwest: improve phy pll configFancy Fang
The MXL PLL uses the following function to generate the output clock 'CLKOUT' based on the input 'CLKREF' (which is the reference clock): " CLKOUT = CLKREF * CM / (CN * CO); CM range is in [16, 255]; CN range is in [1, 16]; CO range is in {1, 2, 4, 8}; " So the DSI driver needs to derive proper 'CM', 'CN' and 'CO' to get the required 'CLKOUT' based on the 'CLKREF'. This commit provides a general method to derive the best 'CM', 'CN' and 'CO' values for any required 'CLKOUT' and input 'CLKREF' combinations. 'best' means the actual generated output clock freq is closest to the required 'CLKOUT' by using the derived 'CM', 'CN' and 'CO'. Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2018-08-24MLK-16706-3 video: fbdev: mipi_dsi_northwest: add map tables for 'CM', 'CN' ↵Fancy Fang
and 'CO' The 'CM', 'CN' and 'CO' possible values have no apparent relationships with their registers config values. So add three tables to describe mappings for them. Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2018-08-24MLK-16706-2 video: fbdev: mipi_dsi_northwest: add 'phy_ref_clkfreq' fieldFancy Fang
Add 'phy_ref_clkfreq' field to 'struct mipi_dsi_info' to save the reference clock frequency configed in dtb file for mipi phy pll. Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2018-08-24MLK-16706-1 video: fbdev: mipi_dsi_northwest: replace 'PICOS2KHZ' by ↵Fancy Fang
'PICOS2KHZ2' The 'PICOS2KHZ' macro is used to get pixel clock frequency from 'pixclock' value to derive the required mipi phy bit clock frequency. But the result precision get from this macro is not good enough in some cases. The patch defines an new improved macro 'PICOS2KHZ2' to replace 'PICOS2KHZ'. Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2018-08-24MLK-16570-2: hdmi audio: Add hdmi audio config functionSandor Yu
Add hdmi audio config function to hdmi driver. Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-08-24MLK-16565: hdmi: Remove CEC clock setting in HDMI driverSandor Yu
HDMI CEC clock have management in HDMI CEC driver, so bypass CEC clock in HDMI driver. Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-08-24MLK-16538-2: hdmi api: Relocate hdmi api soure codeSandor Yu
-Relocate hdmi api source code from drivers/video/fbdev/mxc/cdn_hdp to drivers/mxc/hdp. -Add displayport and hdcp api function. -Move t28hpc_hdmitx function from api source code folder to hdmi fb driver folder. -Update imx8 hdmi fb driver according api source code change. -Sync api source code with CDN_API_1_0_33 release. Acked-by: Robby Cai <robby.cai@nxp.com> Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-08-24MLK-16536-16 video: fbdev: dcss: change 'refcount' to 'struct kref' typeFancy Fang
Use 'struct kref' type for 'refcount' field instead of 'atomic_t' to take advantage of 'kref_*()' interface series. The benefit to do so can improve the defered cfifo flush performance, since this defered flush does not need to wait to be done until next vsync happens. Signed-off-by: Fancy Fang <chen.fang@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-08-24MLK-16536-15 video: fbdev: dcss: improve cfifo wrapping handlingFancy Fang
After changing the strategy to 'flush cfifo once per frame', the cfifo wrapping handling should also be changed accordingly. Now, when it is found that the cfifo has no enough room from 'in' to the buffer end to hold the current commit, the 'commit_cfifo' will cancel this commit and flush the cfifo workqueue before restart the commit again. Signed-off-by: Fancy Fang <chen.fang@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-08-24MLK-16536-14 video: fbdev: dcss: correct ret value for 'dcss_wait_for_vsync()'Fancy Fang
The correct return value for 'dcss_wait_for_vsync()' when it executes successfully should be '0'. But this current value now gets from 'wait_event_interruptible_timeout()' which returns non-zero value when the wait is not timeout. Signed-off-by: Fancy Fang <chen.fang@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-08-24MLK-16536-13 video: fbdev: dcss: improve 'kfifo_to_end_len()' macroFancy Fang
The macro 'kfifo_to_end_len()' is used to get the length between the current kfifo 'in' and the kfifo end. Previous implementation has a short-coming under the new strategy that multiple commits are combined into one cfifo flush. For a simple example, commits 'A' and 'B' are going to be combined into one flush, and the last byte of 'A' exactly occupy the last byte of fifo coincidently. Then when handling the 'B' commit, the old 'kfifo_to_end_len()' logic returns the fifo size instead of 0, So the condition 'commit_size > kfifo_to_end_len(&cfifo->fifo)' will be false and let 'B' to be stored from fifo beginning which finally triggers below kernel BUG log: [ 568.558341] ------------[ cut here ]------------ [ 568.558343] kernel BUG at drivers/video/fbdev/mxc/imx_dcss.c:2261! [ 568.558348] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 568.558354] Modules linked in: [ 568.558362] CPU: 0 PID: 34 Comm: kworker/u8:1 Not tainted [ 568.558364] Hardware name: Freescale i.MX8MQ EVK (DT) [ 568.558385] Workqueue: ctxld-wq dcss_ctxld_config [ 568.558387] task: ffff8000ba2d8c80 task.stack: ffff8000ba2f8000 [ 568.558392] PC is at dcss_ctxld_config+0x1dc/0x1e8 [ 568.558396] LR is at dcss_ctxld_config+0x1dc/0x1e8 [ 568.558398] pc : [<ffff0000084786c4>] lr : [<ffff0000084786c4>] pstate: 80000145 [ 568.558399] sp : ffff8000ba2fbd30 [ 568.558404] x29: ffff8000ba2fbd30 x28: ffff8000ba1f0000 [ 568.558407] x27: ffff8000ba0096a8 x26: ffff8000ba9d8930 [ 568.558411] x25: ffff8000ba3a2410 x24: 0000000000000003 [ 568.558414] x23: 0000000000000008 x22: ffff8000ba9d8918 [ 568.558417] x21: ffff8000ba9d88f0 x20: ffff8000ba9d8818 [ 568.558421] x19: ffff8000bbdd0080 x18: ffffffffffffffff [ 568.558424] x17: 0000ffff934c8b60 x16: ffff0000081df178 [ 568.558427] x15: ffff0000092db010 x14: 202c387830203d20 [ 568.558431] x13: ffff0000092dafe0 x12: ffff0000091be498 [ 568.558434] x11: ffff0000091be498 x10: ffff0000092d8650 [ 568.558437] x9 : 0000000000000000 x8 : ffff8000bff7352f [ 568.558441] x7 : 0000000000000000 x6 : 0000000000000016 [ 568.558444] x5 : 0000000000804738 x4 : 0000000000000000 [ 568.558447] x3 : 0000000000000140 x2 : 000000000000f9bd [ 568.558450] x1 : ffff8000ba2f8000 x0 : 0000000000000030 [ 568.558451] [ 568.558453] Process kworker/u8:1 (pid: 34, stack limit = 0xffff8000ba2f8020) ... [ 568.558541] Call trace: [ 568.558545] Exception stack(0xffff8000ba2fbb60 to 0xffff8000ba2fbc90) ... [ 568.558586] [<ffff0000084786c4>] dcss_ctxld_config+0x1dc/0x1e8 [ 568.558595] [<ffff0000080d3bb4>] process_one_work+0x11c/0x370 [ 568.558600] [<ffff0000080d3e58>] worker_thread+0x50/0x4a0 [ 568.558606] [<ffff0000080d9a70>] kthread+0xd0/0xe8 [ 568.558611] [<ffff000008082e80>] ret_from_fork+0x10/0x50 [ 568.558616] Code: d00055e1 aa1903e0 91074021 94056a66 (d4210000) [ 568.558623] ---[ end trace faae62afa988e865 ]--- [ 568.558707] Unable to handle kernel paging request at virtual address ffffffffffffffd8 [ 568.558709] pgd = ffff8000bbda1000 [ 568.558712] [ffffffffffffffd8] *pgd=00000000fb7ad003 [ 568.558714] , *pud=00000000fb6a0003 [ 568.558715] , *pmd=0000000000000000 ... Signed-off-by: Fancy Fang <chen.fang@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-08-24MLK-16536-12 video: fbdev: dcss: flush cfifo once per frameFancy Fang
Change the cfifo flush to be once per frame to combine possible multiple flush requests in one frame into one flush to improve performance. And during one frame, only flush requests from different channels can be combined, and the different requests from the same channel cannot be combined into one flush. Signed-off-by: Fancy Fang <chen.fang@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-08-24MLK-16536-11 video: fbdev: dcss: add '__maybe_unused' to 'dtg_irq_mask()'Fancy Fang
The function 'dtg_irq_mask()' is not used at this moment which caused gcc compiler generate the build warning: "‘dtg_irq_mask’ defined but not used [-Wunused-function]" So add attribute '__maybe_unused' to 'dtg_irq_mask()' functon definition to avoid this build warning. Signed-off-by: Fancy Fang <chen.fang@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-08-24MLK-16536-10 video: fbdev: dcss: unmask 'IRQ_TC_LINE1' by defaultFancy Fang
Unmask the 'IRQ_TC_LINE1' when initialize it by default, since the vsync count can be used as a reference count or timestamp. Signed-off-by: Fancy Fang <chen.fang@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-08-24MLK-16536-9 video: fbdev: dcss: remove undesired variables in 'dcss_set_par()'Fancy Fang
The variables 'cinfo' and 'chan_info' both refer to the same 'struct dcss_channel_info' data. So remove 'chan_info' and its related variables to make code more clean. Signed-off-by: Fancy Fang <chen.fang@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-08-24MLK-16536-8 video: fbdev: dcss: move 'ctxld_list' field to 'struct ctxld_fifo'Fancy Fang
The 'ctxld_list' is more closely related to 'struct ctxld_info' structure. So moving its definition to this structure is more reasonable. Signed-off-by: Fancy Fang <chen.fang@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-08-24MLK-16536-7 video: fbdev: dcss: abstract cfifo wq flush operationFancy Fang
Abstract the cfifo workqueue flush operation to a separate interface 'finish_cfifo()'. Signed-off-by: Fancy Fang <chen.fang@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-08-24MLK-16536-6 video: fbdev: dcss: split 'commit_to_fifo' into three partsFancy Fang
This commit split the function 'commit_to_fifo' into three parts: 'alloc_cc()', 'commit_cfifo()' and 'flush_cfifo()'. So that each of the three parts can be used as required, but not used all together. Signed-off-by: Fancy Fang <chen.fang@nxp.com> Reviewed-by: Robby Cai <robby.cai@nxp.com>