1. 08 10月, 2018 15 次提交
    • R
      fbdev: fix broken menu dependencies · aae3394e
      Randy Dunlap 提交于
      The framebuffer options and devices menu is unintentionally split
      or broken because some items in it do not depend on FB (including
      several under omap and mmp).
      Fix this by moving FB_CMDLINE, FB_NOTIFY, and FB_CLPS711X_OLD to
      just before the FB Kconfig symbol definition and by moving the
      omap, omap2, and mmp menus to last, following FB_SM712.
      
      Also, the FB_VIA dependencies are duplicated by both being inside
      an "if FB_VIA/endif" block and "depends on FB_VIA", so drop the
      "depends on FB_VIA" lines since they are redundant.
      
      Fixes: ea6763c1 ("video/fbdev: Always built-in video= cmdline parsing")
      Fixes: 5ec96538 ("fbdev: Make fb-notify a no-op if CONFIG_FB=n")
      Fixes: ef74d46a ("video: clps711x: Add new Cirrus Logic CLPS711X framebuffer driver")
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Alexander Shiyan <shc_work@mail.ru>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      aae3394e
    • N
      video: fbdev: sis: Remove unnecessary parentheses and commented code · 864eb1af
      Nathan Chancellor 提交于
      Clang warns when multiple pairs of parentheses are used for a single
      conditional statement.
      
      drivers/video/fbdev/sis/init301.c:851:42: warning: equality comparison
      with extraneous parentheses [-Wparentheses-equality]
            } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
                       ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
      drivers/video/fbdev/sis/init301.c:851:42: note: remove extraneous
      parentheses around the comparison to silence this warning
            } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
                      ~                        ^   ~
      drivers/video/fbdev/sis/init301.c:851:42: note: use '=' to turn this
      equality comparison into an assignment
            } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
                                               ^~
                                               =
      1 warning generated.
      
      Remove the parentheses and while we're at it, clean up the commented
      code, which has been here since the beginning of git history.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/118Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Cc: Thomas Winischhofer <thomas@winischhofer.net>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      864eb1af
    • J
      video: fbdev: omapfb: lcd_ams_delta: use GPIO lookup table · 02f17ffd
      Janusz Krzysztofik 提交于
      Now as Amstrad Delta board - the only user of this driver - provides
      GPIO lookup tables, switch from GPIO numbers to GPIO descriptors and
      use the table to locate required GPIO pins.
      
      Declare static variables for storing GPIO descriptors and replace
      gpio_ function calls with their gpiod_ equivalents. Move GPIO lookup
      to the driver probe function so device initialization can be deferred
      instead of aborted if a GPIO pin is not yet available.
      
      Pin naming used by the driver should be followed while respective GPIO
      lookup table is initialized by a board init code.
      Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com>
      Reviewed-by: NLinus Walleij <linus.walleij@linaro.org>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Boris Brezillon <boris.brezillon@bootlin.com>
      Cc: Miquel Raynal <miquel.raynal@bootlin.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Brian Norris <computersforpeace@gmail.com>
      Cc: Marek Vasut <marek.vasut@gmail.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      02f17ffd
    • D
      fbdev: sbuslib: integer overflow in sbusfb_ioctl_helper() · e5017716
      Dan Carpenter 提交于
      The "index + count" addition can overflow.  Both come directly from the
      user.  This bug leads to an information leak.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: Peter Malone <peter.malone@gmail.com>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Mathieu Malaterre <malat@debian.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      e5017716
    • D
      fbdev: sbuslib: use checked version of put_user() · d8bad911
      Dan Carpenter 提交于
      I'm not sure why the code assumes that only the first put_user() needs
      an access_ok() check.  I have made all the put_user() and get_user()
      calls checked.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Mathieu Malaterre <malat@debian.org>
      Cc: Peter Malone <peter.malone@gmail.com>,
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      d8bad911
    • R
      fbdev: Convert to using %pOFn instead of device_node.name · 5c63e407
      Rob Herring 提交于
      In preparation to remove the node name pointer from struct device_node,
      convert printf users to use the %pOFn format specifier.
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      5c63e407
    • S
      atmel_lcdfb: support native-mode display-timings · 60e5e48d
      Sam Ravnborg 提交于
      When a device tree set a display-timing using native-mode
      then according to the bindings doc this should:
      
          native-mode:
          The native mode for the display, in case multiple
          modes are provided.
          When omitted, assume the first node is the native.
      
      The atmel_lcdfb used the last timing subnode and did not
      respect the timing mode specified with native-mode.
      
      Introduce use of of_get_videomode() which allowed
      a nice simplification of the code while also
      added support for native-mode.
      
      As a nice side-effect this fixes a memory leak where the
      data used for timings and the display_np was not freed.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
      Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      60e5e48d
    • M
      Video: vgastate: fixed a spacing coding style · 811ab8db
      Mehdi Bounya 提交于
      Removed a space between function name and open parant.
      Signed-off-by: NMehdi Bounya <mehdi.bounya@gmail.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      811ab8db
    • M
      atyfb: fix debugging printks · ee6fbb20
      Mikulas Patocka 提交于
      This patch fixes the debugging printks. Use pr_cont, so that the lines are
      not broken up. Use printk when starting a new line (a long string of
      pr_cont's without any printks causes missing characters in the console
      output on sparc).
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      ee6fbb20
    • M
      mach64: optimize wait_for_fifo · 01c40a17
      Mikulas Patocka 提交于
      This is a simple optimization for fifo waiting that improves scrolling
      performance by 5%. If the queue has more free entries that what we
      consume, we can skip the costly register read next time.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Reviewed-by: NVille Syrjälä <syrjala@sci.fi>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      01c40a17
    • M
      mach64: fix image corruption due to reading accelerator registers · c09bcc91
      Mikulas Patocka 提交于
      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: NMikulas Patocka <mpatocka@redhat.com>
      Reviewed-by: NVille Syrjälä <syrjala@sci.fi>
      Cc: stable@vger.kernel.org
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      c09bcc91
    • M
      mach64: fix display corruption on big endian machines · 3c6c6a78
      Mikulas Patocka 提交于
      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: NMikulas Patocka <mpatocka@redhat.com>
      Reviewed-by: NVille Syrjälä <syrjala@sci.fi>
      Cc: stable@vger.kernel.org
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      3c6c6a78
    • M
      mach64: detect the dot clock divider correctly on sparc · ceadddde
      Mikulas Patocka 提交于
      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: NMikulas Patocka <mpatocka@redhat.com>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Reviewed-by: NVille Syrjälä <syrjala@sci.fi>
      Cc: stable@vger.kernel.org
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      ceadddde
    • M
      udlfb: handle unplug properly · 68a958a9
      Mikulas Patocka 提交于
      The udlfb driver maintained an open count and cleaned up itself when the
      count reached zero. But the console is also counted in the reference count
      - so, if the user unplugged the device, the open count would not drop to
      zero and the driver stayed loaded with console attached. If the user
      re-plugged the adapter, it would create a device /dev/fb1, show green
      screen and the access to the console would be lost.
      
      The framebuffer subsystem has reference counting on its own - in order to
      fix the unplug bug, we rely the framebuffer reference counting. When the
      user unplugs the adapter, we call unregister_framebuffer unconditionally.
      unregister_framebuffer will unbind the console, wait until all users stop
      using the framebuffer and then call the fb_destroy method. The fb_destroy
      cleans up the USB driver.
      
      This patch makes the following changes:
      * Drop dlfb->kref and rely on implicit framebuffer reference counting
        instead.
      * dlfb_usb_disconnect calls unregister_framebuffer, the rest of driver
        cleanup is done in the function dlfb_ops_destroy. dlfb_ops_destroy will
        be called by the framebuffer subsystem when no processes have the
        framebuffer open or mapped.
      * We don't use workqueue during initialization, but initialize directly
        from dlfb_usb_probe. The workqueue could race with dlfb_usb_disconnect
        and this racing would produce various kinds of memory corruption.
      * We use usb_get_dev and usb_put_dev to make sure that the USB subsystem
        doesn't free the device under us.
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      cc: Dave Airlie <airlied@redhat.com>
      Cc: Bernie Thompson <bernie@plugable.com>,
      Cc: Ladislav Michl <ladis@linux-mips.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      68a958a9
    • J
      video: fbdev: add the dependency of broadsheetfb in Kconfig · ad4366ad
      Jia-Ju Bai 提交于
      broadsheetfb is a platform driver and it should not be used on x86.
      It should be used only by single ARM PXA board so add the dependency
      in Kconfig.
      Signed-off-by: NJia-Ju Bai <baijiaju1990@gmail.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      ad4366ad
  2. 27 9月, 2018 4 次提交
    • G
      video/fbdev/stifb: Fix spelling mistake in fall-through annotation · 7c968791
      Gustavo A. R. Silva 提交于
      Replace "fall though" with a proper "fall through" annotation.
      
      This fix is part of the ongoing efforts to enabling
      -Wimplicit-fallthrough
      
      Addresses-Coverity-ID: 402013 ("Missing break in switch")
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      7c968791
    • H
      efifb: BGRT: Add nobgrt option · cf7389b8
      Hans de Goede 提交于
      In some setups restoring the BGRT logo is undesirable, allow passing
      video=efifb:nobgrt on the kernel commandline to disable it.
      Reported-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      cf7389b8
    • T
      fbdev/omapfb: fix omapfb_memory_read infoleak · 1bafcbf5
      Tomi Valkeinen 提交于
      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: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Reported-by: NJann 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: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      1bafcbf5
    • L
      pxa168fb: prepare the clock · d85536cd
      Lubomir Rintel 提交于
      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: NLubomir Rintel <lkundrak@v3.sk>
      [b.zolnierkie: enhance patch description a bit]
      Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      d85536cd
  3. 10 8月, 2018 4 次提交
  4. 03 8月, 2018 3 次提交
  5. 31 7月, 2018 5 次提交
  6. 25 7月, 2018 9 次提交