Skip to content
Snippets Groups Projects
  1. Aug 04, 2023
  2. Jul 24, 2023
    • Thomas Zimmermann's avatar
      fbdev: Remove FBINFO_DEFAULT from framebuffer_alloc()'ed structs · b3e148d7
      Thomas Zimmermann authored
      
      The flag FBINFO_DEFAULT is 0 and has no effect, as struct fbinfo.flags
      has been allocated to zero by framebuffer_alloc(). So do not set it.
      
      Flags should signal differences from the default values. After cleaning
      up all occurrences of FBINFO_DEFAULT, the token will be removed.
      
      v4:
      	* clarify commit message (Geert, Dan)
      v2:
      	* fix commit message (Miguel)
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Ferenc Bakonyi <fero@drama.obuda.kando.hu>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Dexuan Cui <decui@microsoft.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Maik Broemme <mbroemme@libmpq.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nicholas Piggin <npiggin@gmail.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>
      Cc: Hans de Goede <hdegoede@redhat.com>
      Cc: Steve Glendinning <steve.glendinning@shawell.net>
      Cc: Bernie Thompson <bernie@plugable.com>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20230715185343.7193-6-tzimmermann@suse.de
      b3e148d7
  3. May 18, 2023
  4. Nov 16, 2022
    • Thomas Zimmermann's avatar
      fbdev: Add support for the nomodeset kernel parameter · 0ba2fa8c
      Thomas Zimmermann authored
      
      Support the kernel's nomodeset parameter for all PCI-based fbdev
      drivers that use aperture helpers to remove other, hardware-agnostic
      graphics drivers.
      
      The parameter is a simple way of using the firmware-provided scanout
      buffer if the hardware's native driver is broken. The same effect
      could be achieved with per-driver options, but the importance of the
      graphics output for many users makes a single, unified approach
      worthwhile.
      
      With nomodeset specified, the fbdev driver module will not load. This
      unifies behavior with similar DRM drivers. In DRM helpers, modules
      first check the nomodeset parameter before registering the PCI
      driver. As fbdev has no such module helpers, we have to modify each
      driver individually.
      
      The name 'nomodeset' is slightly misleading, but has been chosen for
      historical reasons. Several drivers implemented it before it became a
      general option for DRM. So keeping the existing name was preferred over
      introducing a new one.
      
      v2:
      	* print a warning if a driver does not init (Helge)
      	* wrap video_firmware_drivers_only() in helper
      
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221111133024.9897-3-tzimmermann@suse.de
      0ba2fa8c
  5. Jul 19, 2022
  6. Apr 11, 2022
    • Zheyu Ma's avatar
      video: fbdev: kyro: Error out if 'lineclock' equals zero · 213e2df4
      Zheyu Ma authored
      
      The userspace program could pass any values to the driver through
      ioctl() interface. If the driver doesn't check the value of 'lineclock',
      it may cause divide error.
      
      Fix this by checking whether 'lineclock' is zero.
      
      The following log reveals it:
       divide error: 0000 [#1] PREEMPT SMP KASAN PTI
       RIP: 0010:kyrofb_set_par+0x30d/0xd80
       Call Trace:
        <TASK>
        fb_set_var+0x604/0xeb0
        do_fb_ioctl+0x234/0x670
        fb_ioctl+0xdd/0x130
        do_syscall_64+0x3b/0x90
      
      Signed-off-by: default avatarZheyu Ma <zheyuma97@gmail.com>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      213e2df4
  7. Jul 26, 2021
    • Zheyu Ma's avatar
      video: fbdev: kyro: Error out if 'pixclock' equals zero · 1520b4b7
      Zheyu Ma authored
      
      The userspace program could pass any values to the driver through
      ioctl() interface. if the driver doesn't check the value of 'pixclock',
      it may cause divide error because the value of 'lineclock' and
      'frameclock' will be zero.
      
      Fix this by checking whether 'pixclock' is zero in kyrofb_check_var().
      
      The following log reveals it:
      
      [  103.073930] divide error: 0000 [#1] PREEMPT SMP KASAN PTI
      [  103.073942] CPU: 4 PID: 12483 Comm: syz-executor Not tainted 5.14.0-rc2-00478-g2734d6c1b1a0-dirty #118
      [  103.073959] RIP: 0010:kyrofb_set_par+0x316/0xc80
      [  103.074045] Call Trace:
      [  103.074048]  ? ___might_sleep+0x1ee/0x2d0
      [  103.074060]  ? kyrofb_ioctl+0x330/0x330
      [  103.074069]  fb_set_var+0x5bf/0xeb0
      [  103.074078]  ? fb_blank+0x1a0/0x1a0
      [  103.074085]  ? lock_acquire+0x3bd/0x530
      [  103.074094]  ? lock_release+0x810/0x810
      [  103.074103]  ? ___might_sleep+0x1ee/0x2d0
      [  103.074114]  ? __mutex_lock+0x620/0x1190
      [  103.074126]  ? trace_hardirqs_on+0x6a/0x1c0
      [  103.074137]  do_fb_ioctl+0x31e/0x700
      [  103.074144]  ? fb_getput_cmap+0x280/0x280
      [  103.074152]  ? rcu_read_lock_sched_held+0x11/0x80
      [  103.074162]  ? rcu_read_lock_sched_held+0x11/0x80
      [  103.074171]  ? __sanitizer_cov_trace_switch+0x67/0xf0
      [  103.074181]  ? __sanitizer_cov_trace_const_cmp2+0x20/0x80
      [  103.074191]  ? do_vfs_ioctl+0x14b/0x16c0
      [  103.074199]  ? vfs_fileattr_set+0xb60/0xb60
      [  103.074207]  ? rcu_read_lock_sched_held+0x11/0x80
      [  103.074216]  ? lock_release+0x483/0x810
      [  103.074224]  ? __fget_files+0x217/0x3d0
      [  103.074234]  ? __fget_files+0x239/0x3d0
      [  103.074243]  ? do_fb_ioctl+0x700/0x700
      [  103.074250]  fb_ioctl+0xe6/0x130
      
      Signed-off-by: default avatarZheyu Ma <zheyuma97@gmail.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/1627293835-17441-3-git-send-email-zheyuma97@gmail.com
      1520b4b7
  8. Jul 19, 2021
    • Zheyu Ma's avatar
      video: fbdev: kyro: fix a DoS bug by restricting user input · 98a65439
      Zheyu Ma authored
      
      The user can pass in any value to the driver through the 'ioctl'
      interface. The driver dost not check, which may cause DoS bugs.
      
      The following log reveals it:
      
      divide error: 0000 [#1] PREEMPT SMP KASAN PTI
      RIP: 0010:SetOverlayViewPort+0x133/0x5f0 drivers/video/fbdev/kyro/STG4000OverlayDevice.c:476
      Call Trace:
       kyro_dev_overlay_viewport_set drivers/video/fbdev/kyro/fbdev.c:378 [inline]
       kyrofb_ioctl+0x2eb/0x330 drivers/video/fbdev/kyro/fbdev.c:603
       do_fb_ioctl+0x1f3/0x700 drivers/video/fbdev/core/fbmem.c:1171
       fb_ioctl+0xeb/0x130 drivers/video/fbdev/core/fbmem.c:1185
       vfs_ioctl fs/ioctl.c:48 [inline]
       __do_sys_ioctl fs/ioctl.c:753 [inline]
       __se_sys_ioctl fs/ioctl.c:739 [inline]
       __x64_sys_ioctl+0x19b/0x220 fs/ioctl.c:739
       do_syscall_64+0x32/0x80 arch/x86/entry/common.c:46
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Signed-off-by: default avatarZheyu Ma <zheyuma97@gmail.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/1626235762-2590-1-git-send-email-zheyuma97@gmail.com
      98a65439
  9. Jan 06, 2020
  10. Dec 05, 2019
  11. Aug 01, 2017
    • Arvind Yadav's avatar
      video: fbdev: kyro: constify pci_device_id. · 344ff8da
      Arvind Yadav authored
      
      pci_device_id are not supposed to change at runtime. All functions
      working with pci_device_id provided by <linux/pci.h> work with
      const pci_device_id. So mark the non-const structs as const.
      
      File size before:
         text	   data	    bss	    dec	    hex	filename
         3190	   2704	     24	   5918	   171e	video/fbdev/kyro/fbdev.o
      
      File size after adding 'const':
         text	   data	    bss	    dec	    hex	filename
         3290	   2640	     24	   5918	   171e	video/fbdev/kyro/fbdev.o
      
      Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Maik Broemme <mbroemme@libmpq.org>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      344ff8da
  12. Sep 27, 2016
  13. Aug 25, 2015
    • Luis R. Rodriguez's avatar
      drivers/video/fbdev/kyrofb: Use arch_phys_wc_add() and pci_ioremap_wc_bar() · 9e517ac8
      Luis R. Rodriguez authored
      
      Convert the driver from using the x86-specific MTRR code to the
      architecture-agnostic arch_phys_wc_add(). It will avoid MTRR if
      write-combining is available, in order to take advantage of that
      also ensure the ioremapped area is requested as write-combining.
      
      There are a few motivations for this:
      
      a) Take advantage of PAT when available
      
      b) Help bury MTRR code away, MTRR is architecture-specific and on
         x86 it is being replaced by PAT.
      
      c) Help with the goal of eventually using _PAGE_CACHE_UC over
         _PAGE_CACHE_UC_MINUS on x86 on ioremap_nocache() (see commit
         de33c442 titled "x86 PAT: fix performance drop for glx,
         use UC minus for ioremap(), ioremap_nocache() and
         pci_mmap_page_range()")
      
      The conversion done is expressed by the following Coccinelle
      SmPL patch, it additionally required manual intervention to
      address all the ifdeffery and removal of redundant things which
      arch_phys_wc_add() already addresses such as verbose message
      about when MTRR fails and doing nothing when we didn't get an
      MTRR.
      
      @ mtrr_found @
      expression index, base, size;
      @@
      
      -index = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
      +index = arch_phys_wc_add(base, size);
      
      @ mtrr_rm depends on mtrr_found @
      expression mtrr_found.index, mtrr_found.base, mtrr_found.size;
      @@
      
      -mtrr_del(index, base, size);
      +arch_phys_wc_del(index);
      
      @ mtrr_rm_zero_arg depends on mtrr_found @
      expression mtrr_found.index;
      @@
      
      -mtrr_del(index, 0, 0);
      +arch_phys_wc_del(index);
      
      @ mtrr_rm_fb_info depends on mtrr_found @
      struct fb_info *info;
      expression mtrr_found.index;
      @@
      
      -mtrr_del(index, info->fix.smem_start, info->fix.smem_len);
      +arch_phys_wc_del(index);
      
      @ ioremap_replace_nocache depends on mtrr_found @
      struct fb_info *info;
      expression base, size;
      @@
      
      -info->screen_base = ioremap_nocache(base, size);
      +info->screen_base = ioremap_wc(base, size);
      
      @ ioremap_replace_default depends on mtrr_found @
      struct fb_info *info;
      expression base, size;
      @@
      
      -info->screen_base = ioremap(base, size);
      +info->screen_base = ioremap_wc(base, size);
      
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Acked-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Jingoo Han <jg1.han@samsung.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: airlied@linux.ie
      Cc: benh@kernel.crashing.org
      Cc: bhelgaas@google.com
      Cc: dan.j.williams@intel.com
      Cc: konrad.wilk@oracle.com
      Cc: linux-fbdev@vger.kernel.org
      Cc: linux-pci@vger.kernel.org
      Cc: mst@redhat.com
      Cc: toshi.kani@hp.com
      Cc: vinod.koul@intel.com
      Cc: xen-devel@lists.xensource.com
      Link: http://lkml.kernel.org/r/1440443613-13696-4-git-send-email-mcgrof@do-not-panic.com
      
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      9e517ac8
  14. Apr 17, 2014
  15. Nov 26, 2013
  16. Oct 29, 2013
  17. Sep 26, 2013
  18. Sep 19, 2013
  19. Jan 03, 2013
    • Greg Kroah-Hartman's avatar
      Drivers: video: remove __dev* attributes. · 48c68c4f
      Greg Kroah-Hartman authored
      
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitdata,
      __devinitconst, and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      48c68c4f
  20. Oct 16, 2007
  21. Feb 14, 2007
    • Tim Schmielau's avatar
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau authored
      
      After Al Viro (finally) succeeded in removing the sched.h #include in module.h
      recently, it makes sense again to remove other superfluous sched.h includes.
      There are quite a lot of files which include it but don't actually need
      anything defined in there.  Presumably these includes were once needed for
      macros that used to live in sched.h, but moved to other header files in the
      course of cleaning it up.
      
      To ease the pain, this time I did not fiddle with any header files and only
      removed #includes from .c-files, which tend to cause less trouble.
      
      Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
      arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
      allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
      configs in arch/arm/configs on arm.  I also checked that no new warnings were
      introduced by the patch (actually, some warnings are removed that were emitted
      by unnecessarily included header files).
      
      Signed-off-by: default avatarTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  22. Jul 10, 2006
  23. Jun 30, 2006
  24. Jan 15, 2006
  25. Jan 10, 2006
  26. Nov 07, 2005
    • Antonino A. Daplas's avatar
      [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon · c465e05a
      Antonino A. Daplas authored
      
      According to Jon Smirl, filling in the field fb_cursor with soft_cursor for
      drivers that do not support hardware cursors is redundant.  The soft_cursor
      function is usable by all drivers because it is just a wrapper around
      fb_imageblit.  And because soft_cursor is an fbcon-specific hook, the file is
      moved to the console directory.
      
      Thus, drivers that do not support hardware cursors can leave the fb_cursor
      field blank.  For drivers that do, they can fill up this field with their own
      version.
      
      The end result is a smaller code size.  And if the framebuffer console is not
      loaded, module/kernel size is also reduced because the soft_cursor module will
      also not be loaded.
      
      Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
      Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      c465e05a
  27. Apr 16, 2005
    • Linus Torvalds's avatar
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds authored
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4
Loading