1. 17 Nov, 2020 2 commits
    • Daniel Vetter's avatar
      fbcon: Disable accelerated scrolling · 39aead83
      Daniel Vetter authored
      So ever since syzbot discovered fbcon, we have solid proof that it's
      full of bugs. And often the solution is to just delete code and remove
      features, e.g.  50145474 ("fbcon: remove soft scrollback code").
      
      Now the problem is that most modern-ish drivers really only treat
      fbcon as an dumb kernel console until userspace takes over, and Oops
      printer for some emergencies. Looking at drm drivers and the basic
      vesa/efi fbdev drivers shows that only 3 drivers support any kind of
      acceleration:
      
      - nouveau, seems to be enabled by default
      - omapdrm, when a DMM remapper exists using remapper rewriting for
        y/xpanning
      - gma500, but that is getting deleted now for the GTT remapper trick,
        and the accelerated copyarea never set the FBINFO_HWACCEL_COPYAREA
        flag, so unused (and could be deleted already I think).
      
      No other driver supportes accelerated fbcon. And fbcon is the only
      user of this accel code (it's not exposed as uapi through ioctls),
      which means we could garbage collect fairly enormous amounts of code
      if we kill this.
      
      Plus because syzbot only runs on virtual hardware, and none of the
      drivers for that have acceleration, we'd remove a huge gap in testing.
      And there's no other even remotely comprehensive testing aside from
      syzbot.
      
      This patch here just disables the acceleration code by always
      redrawing when scrolling. The plan is that once this has been merged
      for well over a year in released kernels, we can start to go around
      and delete a lot of code.
      
      v2:
      - Drop a few more unused local variables, somehow I missed the
      compiler warnings (Sam)
      - Fix typo in comment (Jiri)
      - add a todo entry for the cleanup (Thomas)
      
      v3: Remove more unused variables (0day)
      Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
      Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Cc: Jiri Slaby <jirislaby@kernel.org>
      Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: nouveau@lists.freedesktop.org
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Jiri Slaby <jirislaby@kernel.org>
      Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: Peilin Ye <yepeilin.cs@gmail.com>
      Cc: George Kennedy <george.kennedy@oracle.com>
      Cc: Nathan Chancellor <natechancellor@gmail.com>
      Cc: Peter Rosin <peda@axentia.se>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201029132229.4068359-1-daniel.vetter@ffwll.ch
      39aead83
    • Yang Yingliang's avatar
      video: fbdev: atmel_lcdfb: fix return error code in atmel_lcdfb_of_init() · ba236455
      Yang Yingliang authored
      If devm_kzalloc() failed after the first time, atmel_lcdfb_of_init()
      can't return -ENOMEM, fix this by putting the error code in loop.
      
      Fixes: b985172b ("video: atmel_lcdfb: add device tree suport")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201117061350.3453742-1-yangyingliang@huawei.com
      ba236455
  2. 16 Nov, 2020 14 commits
  3. 15 Nov, 2020 7 commits
  4. 14 Nov, 2020 5 commits
  5. 13 Nov, 2020 2 commits
  6. 12 Nov, 2020 7 commits
  7. 11 Nov, 2020 3 commits
    • Colin Ian King's avatar
      drm/kmb: fix spelling mistakes in drm_info and drm_dbg messages · 05481f07
      Colin Ian King authored
      There are two spelling mistakes of the word sync in drm_info
      and drm_dbg messages. Fix these.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201109111225.1485190-1-colin.king@canonical.com
      05481f07
    • Anitha Chrisanthus's avatar
      drm/kmb: Fix build warnings · 7cb397e7
      Anitha Chrisanthus authored
      Fixed the following W=1 kernel build warnings
       drivers/gpu/drm/kmb/kmb_plane.h:74:18: warning: ‘kmb_formats_v’
       defined but not used [-Wunused-const-variable=]
       drivers/gpu/drm/kmb/kmb_plane.h:61:18: warning: ‘kmb_formats_g’
       defined but not used [-Wunused-const-variable=]
      Signed-off-by: default avatarAnitha Chrisanthus <anitha.chrisanthus@intel.com>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/1605045169-2696-1-git-send-email-anitha.chrisanthus@intel.com
      7cb397e7
    • Thomas Zimmermann's avatar
      drm/nouveau: Fix out-of-bounds access when deferencing MMU type · f644e303
      Thomas Zimmermann authored
      The value of struct drm_device.ttm.type_vram can become -1 for unknown
      types of memory (see nouveau_ttm_init()). This leads to an out-of-bounds
      error when accessing struct nvif_mmu.type[]:
      
        [   18.304116] ==================================================================
        [   18.311649] BUG: KASAN: slab-out-of-bounds in nouveau_ttm_io_mem_reserve+0x17a/0x7e0 [nouveau]
        [   18.320415] Read of size 1 at addr ffff88810ffac1fe by task systemd-udevd/342
        [   18.327681]
        [   18.329208] CPU: 1 PID: 342 Comm: systemd-udevd Tainted: G            E     5.10.0-rc2-1-default+ #581
        [   18.338681] Hardware name: Dell Inc. OptiPlex 9020/0N4YC8, BIOS A24 10/24/2018
        [   18.346032] Call Trace:
        [   18.348536]  dump_stack+0xae/0xe5
        [   18.351919]  print_address_description.constprop.0+0x17/0xf0
        [   18.357787]  ? nouveau_ttm_io_mem_reserve+0x17a/0x7e0 [nouveau]
        [   18.363818]  __kasan_report.cold+0x20/0x38
        [   18.368099]  ? nouveau_ttm_io_mem_reserve+0x17a/0x7e0 [nouveau]
        [   18.374133]  kasan_report+0x3a/0x50
        [   18.377789]  nouveau_ttm_io_mem_reserve+0x17a/0x7e0 [nouveau]
        <...>
        [   18.767690] Allocated by task 342:
        [   18.773087]  kasan_save_stack+0x1b/0x40
        [   18.778890]  __kasan_kmalloc.constprop.0+0xbf/0xd0
        [   18.785646]  __kmalloc_track_caller+0x1be/0x390
        [   18.792165]  kstrdup_const+0x46/0x70
        [   18.797686]  kobject_set_name_vargs+0x2f/0xb0
        [   18.803992]  kobject_init_and_add+0x9d/0xf0
        [   18.810117]  ttm_mem_global_init+0x12c/0x210 [ttm]
        [   18.816853]  ttm_bo_global_init+0x4a/0x160 [ttm]
        [   18.823420]  ttm_bo_device_init+0x39/0x220 [ttm]
        [   18.830046]  nouveau_ttm_init+0x2c3/0x830 [nouveau]
        [   18.836929]  nouveau_drm_device_init+0x1b4/0x3f0 [nouveau]
        <...>
        [   19.105336] ==================================================================
      
      Fix this error, by not using type_vram as an index if it's negative.
      Assume default values instead.
      
      The error was seen on Nvidia G72 hardware.
      Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Reviewed-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Fixes: 1cf65c45 ("drm/ttm: add caching state to ttm_bus_placement")
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Michael J. Ruhl <michael.j.ruhl@intel.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
      Cc: Roland Scheidegger <sroland@vmware.com>
      Cc: Huang Rui <ray.huang@amd.com>
      Cc: Felix Kuehling <Felix.Kuehling@amd.com>
      Cc: Hawking Zhang <Hawking.Zhang@amd.com>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Likun Gao <Likun.Gao@amd.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: nouveau@lists.freedesktop.org
      Cc: virtualization@lists.linux-foundation.org
      Cc: spice-devel@lists.freedesktop.org
      Cc: amd-gfx@lists.freedesktop.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20201110133655.13174-1-tzimmermann@suse.de
      f644e303