1. 21 2月, 2018 3 次提交
  2. 20 2月, 2018 7 次提交
    • N
      drm/meson: fix vsync buffer update · e88230a3
      Neil Armstrong 提交于
      The plane buffer address/stride/height was incorrectly updated in the
      plane_atomic_update operation instead of the vsync irq.
      This patch delays this operation in the vsync irq along with the
      other plane delayed setup.
      
      This issue was masked using legacy framebuffer and X11 modesetting, but
      is clearly visible using gbm rendering when buffer is submitted late after
      vblank, like using software decoding and OpenGL rendering in Kodi.
      With this patch, tearing and other artifacts disappears completely.
      
      Cc: Michal Lazo <michal.lazo@gmail.com>
      Fixes: bbbe775e ("drm: Add support for Amlogic Meson Graphic Controller")
      Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/1518689976-23292-1-git-send-email-narmstrong@baylibre.com
      e88230a3
    • C
      drm: Handle unexpected holes in color-eviction · b8ff1802
      Chris Wilson 提交于
      During eviction, the driver may free more than one hole in the drm_mm
      due to the side-effects in evicting the scanned nodes. However,
      drm_mm_scan_color_evict() expects that the scan result is the first
      available hole (in the mru freed hole_stack list):
      
        kernel BUG at drivers/gpu/drm/drm_mm.c:844!
        invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
        Dumping ftrace buffer:
           (ftrace buffer empty)
        Modules linked in: i915 snd_hda_codec_analog snd_hda_codec_generic coretemp snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core lpc_ich snd_pcm e1000e mei_me prime_numbers mei
        CPU: 1 PID: 1490 Comm: gem_userptr_bli Tainted: G     U           4.16.0-rc1-g740f57c54ecf-kasan_6+ #1
        Hardware name: Dell Inc. OptiPlex 755                 /0PU052, BIOS A08 02/19/2008
        RIP: 0010:drm_mm_scan_color_evict+0x2b8/0x3d0
        RSP: 0018:ffff880057a573f8 EFLAGS: 00010287
        RAX: ffff8800611f5980 RBX: ffff880057a575d0 RCX: dffffc0000000000
        RDX: 00000000029d5000 RSI: 1ffff1000af4aec1 RDI: ffff8800611f5a10
        RBP: ffff88005ab884d0 R08: ffff880057a57600 R09: 000000000afff000
        R10: 1ffff1000b5710b5 R11: 0000000000001000 R12: 1ffff1000af4ae82
        R13: ffff8800611f59b0 R14: ffff8800611f5980 R15: ffff880057a57608
        FS:  00007f2de0c2e8c0(0000) GS:ffff88006ac40000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
        CR2: 00007f2ddde1e000 CR3: 00000000609b2000 CR4: 00000000000006e0
        Call Trace:
         ? drm_mm_scan_remove_block+0x330/0x330
         ? drm_mm_scan_remove_block+0x151/0x330
         i915_gem_evict_something+0x711/0xbd0 [i915]
         ? igt_evict_contexts+0x50/0x50 [i915]
         ? nop_clear_range+0x10/0x10 [i915]
         ? igt_evict_something+0x90/0x90 [i915]
         ? i915_gem_gtt_reserve+0x1a1/0x320 [i915]
         i915_gem_gtt_insert+0x237/0x400 [i915]
         __i915_vma_do_pin+0xc25/0x1a20 [i915]
         eb_lookup_vmas+0x1c63/0x3790 [i915]
         ? i915_gem_check_execbuffer+0x250/0x250 [i915]
         ? trace_hardirqs_on_caller+0x33f/0x590
         ? _raw_spin_unlock_irqrestore+0x39/0x60
         ? __pm_runtime_resume+0x7d/0xf0
         i915_gem_do_execbuffer+0x86a/0x2ff0 [i915]
         ? __kmalloc+0x132/0x340
         ? i915_gem_execbuffer2_ioctl+0x10f/0x760 [i915]
         ? drm_ioctl_kernel+0x12e/0x1c0
         ? drm_ioctl+0x662/0x980
         ? eb_relocate_slow+0xa90/0xa90 [i915]
         ? i915_gem_execbuffer2_ioctl+0x10f/0x760 [i915]
         ? __might_fault+0xea/0x1a0
         i915_gem_execbuffer2_ioctl+0x3cc/0x760 [i915]
         ? i915_gem_execbuffer_ioctl+0xba0/0xba0 [i915]
         ? lock_acquire+0x3c0/0x3c0
         ? i915_gem_execbuffer_ioctl+0xba0/0xba0 [i915]
         drm_ioctl_kernel+0x12e/0x1c0
         drm_ioctl+0x662/0x980
         ? i915_gem_execbuffer_ioctl+0xba0/0xba0 [i915]
         ? drm_getstats+0x20/0x20
         ? debug_check_no_obj_freed+0x2a6/0x8c0
         do_vfs_ioctl+0x170/0xe70
         ? ioctl_preallocate+0x170/0x170
         ? task_work_run+0xbe/0x160
         ? lock_acquire+0x3c0/0x3c0
         ? trace_hardirqs_on_caller+0x33f/0x590
         ? _raw_spin_unlock_irq+0x2f/0x50
         SyS_ioctl+0x36/0x70
         ? do_vfs_ioctl+0xe70/0xe70
         do_syscall_64+0x18c/0x5d0
         entry_SYSCALL_64_after_hwframe+0x26/0x9b
        RIP: 0033:0x7f2ddf13b587
        RSP: 002b:00007fff15c4f9d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
        RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f2ddf13b587
        RDX: 00007fff15c4fa20 RSI: 0000000040406469 RDI: 0000000000000003
        RBP: 00007fff15c4fa20 R08: 0000000000000000 R09: 00007f2ddf3fe120
        R10: 0000000000000073 R11: 0000000000000246 R12: 0000000040406469
        R13: 0000000000000003 R14: 00007fff15c4fa20 R15: 00000000000000c7
        Code: 00 00 00 4a c7 44 22 08 00 00 00 00 42 c7 44 22 10 00 00 00 00 48 81 c4 b8 00 00 00 5b 5d 41 5c 41 5d 41 5e 41 5f c3 0f 0b 0f 0b <0f> 0b 31 c0 eb c0 4c 89 ef e8 9a 09 41 ff e9 1e fe ff ff 4c 89
        RIP: drm_mm_scan_color_evict+0x2b8/0x3d0 RSP: ffff880057a573f8
      
      We can trivially relax this assumption by searching the hole_stack for
      the scan result and warn instead if the driver called us without any
      result.
      
      Fixes: 3fa489da ("drm: Apply tight eviction scanning to color_adjust")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: <stable@vger.kernel.org> # v4.11+
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180219113543.8010-1-chris@chris-wilson.co.uk
      b8ff1802
    • S
      drm: exynos: Use proper macro definition for HDMI_I2S_PIN_SEL_1 · c84b66f8
      Sylwester Nawrocki 提交于
      Bit field [2:0] of HDMI_I2S_PIN_SEL_1 corresponds to SDATA_0,
      not SDATA_2. This patch removes redefinition of HDMI_I2S_SEL_DATA2
      constant and adds missing HDMI_I2S_SEL_DATA0.
      The value of bit field selecting SDATA_1 (pin_sel_3) is also changed,
      so it is 3 as suggested in the Exynos TRMs.
      Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: NInki Dae <inki.dae@samsung.com>
      c84b66f8
    • C
      drm/exynos: remove exynos_drm_rotator.h · b701a143
      Corentin Labbe 提交于
      Since its inclusion in 2012 via commit bea8a429 ("drm/exynos: add rotator ipp driver")
      this header is not used by any source files and is empty.
      Lets just remove it.
      Signed-off-by: NCorentin Labbe <clabbe@baylibre.com>
      Signed-off-by: NInki Dae <inki.dae@samsung.com>
      b701a143
    • M
      drm/exynos: g2d: Delete an error message for a failed memory allocation in two functions · 6f0a6029
      Markus Elfring 提交于
      Omit an extra message for a memory allocation failure in these functions.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: NInki Dae <inki.dae@samsung.com>
      6f0a6029
    • W
      drm/exynos: fix comparison to bitshift when dealing with a mask · 1293b619
      Wolfram Sang 提交于
      Due to a typo, the mask was destroyed by a comparison instead of a bit
      shift.
      Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com>
      Signed-off-by: NInki Dae <inki.dae@samsung.com>
      1293b619
    • A
      drm/exynos: g2d: use monotonic timestamps · a588a8bb
      Arnd Bergmann 提交于
      The exynos DRM driver uses real-time 'struct timeval' values
      for exporting its timestamps to user space. This has multiple
      problems:
      
      1. signed seconds overflow in y2038
      2. the 'struct timeval' definition is deprecated in the kernel
      3. time may jump or go backwards after a 'settimeofday()' syscall
      4. other DRM timestamps are in CLOCK_MONOTONIC domain, so they
         can't be compared
      5. exporting microseconds requires a division by 1000, which may
         be slow on some architectures.
      
      The code existed in two places before, but the IPP portion was
      removed in 8ded5941 ("drm/exynos: ipp: Remove Exynos DRM
      IPP subsystem"), so we no longer need to worry about it.
      
      Ideally timestamps should just use 64-bit nanoseconds instead, but
      of course we can't change that now. Instead, this tries to address
      the first four points above by using monotonic 'timespec' values.
      
      According to Tobias Jakobi, user space doesn't care about the
      timestamp at the moment, so we can change the format. Even if
      there is something looking at them, it will work just fine with
      monotonic times as long as the application only looks at the
      relative values between two events.
      
      Link: https://patchwork.kernel.org/patch/10038593/
      Cc: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NTobias Jakobi <tjakobi@math.uni-bielefeld.de>
      Signed-off-by: NInki Dae <inki.dae@samsung.com>
      a588a8bb
  3. 19 2月, 2018 1 次提交
  4. 17 2月, 2018 4 次提交
    • L
      drm/amdgpu: Fix deadlock on runtime suspend · aa0aad57
      Lukas Wunner 提交于
      amdgpu's ->runtime_suspend hook calls drm_kms_helper_poll_disable(),
      which waits for the output poll worker to finish if it's running.
      
      The output poll worker meanwhile calls pm_runtime_get_sync() in
      amdgpu's ->detect hooks, which waits for the ongoing suspend to finish,
      causing a deadlock.
      
      Fix by not acquiring a runtime PM ref if the ->detect hooks are called
      in the output poll worker's context.  This is safe because the poll
      worker is only enabled while runtime active and we know that
      ->runtime_suspend waits for it to finish.
      
      Fixes: d38ceaf9 ("drm/amdgpu: add core driver (v4)")
      Cc: stable@vger.kernel.org # v4.2+: 27d4ee03: workqueue: Allow retrieval of current task's work struct
      Cc: stable@vger.kernel.org # v4.2+: 25c058cc: drm: Allow determining if current task is output poll worker
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Tested-by: NMike Lothian <mike@fireburn.co.uk>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/4c9bf72aacae1eef062bd134cd112e0770a7f121.1518338789.git.lukas@wunner.de
      aa0aad57
    • L
      drm/radeon: Fix deadlock on runtime suspend · 15734fef
      Lukas Wunner 提交于
      radeon's ->runtime_suspend hook calls drm_kms_helper_poll_disable(),
      which waits for the output poll worker to finish if it's running.
      
      The output poll worker meanwhile calls pm_runtime_get_sync() in
      radeon's ->detect hooks, which waits for the ongoing suspend to finish,
      causing a deadlock.
      
      Fix by not acquiring a runtime PM ref if the ->detect hooks are called
      in the output poll worker's context.  This is safe because the poll
      worker is only enabled while runtime active and we know that
      ->runtime_suspend waits for it to finish.
      
      Stack trace for posterity:
      
        INFO: task kworker/0:3:31847 blocked for more than 120 seconds
        Workqueue: events output_poll_execute [drm_kms_helper]
        Call Trace:
         schedule+0x3c/0x90
         rpm_resume+0x1e2/0x690
         __pm_runtime_resume+0x3f/0x60
         radeon_lvds_detect+0x39/0xf0 [radeon]
         output_poll_execute+0xda/0x1e0 [drm_kms_helper]
         process_one_work+0x14b/0x440
         worker_thread+0x48/0x4a0
      
        INFO: task kworker/2:0:10493 blocked for more than 120 seconds.
        Workqueue: pm pm_runtime_work
        Call Trace:
         schedule+0x3c/0x90
         schedule_timeout+0x1b3/0x240
         wait_for_common+0xc2/0x180
         wait_for_completion+0x1d/0x20
         flush_work+0xfc/0x1a0
         __cancel_work_timer+0xa5/0x1d0
         cancel_delayed_work_sync+0x13/0x20
         drm_kms_helper_poll_disable+0x1f/0x30 [drm_kms_helper]
         radeon_pmops_runtime_suspend+0x3d/0xa0 [radeon]
         pci_pm_runtime_suspend+0x61/0x1a0
         vga_switcheroo_runtime_suspend+0x21/0x70
         __rpm_callback+0x32/0x70
         rpm_callback+0x24/0x80
         rpm_suspend+0x12b/0x640
         pm_runtime_work+0x6f/0xb0
         process_one_work+0x14b/0x440
         worker_thread+0x48/0x4a0
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94147
      Fixes: 10ebc0bc ("drm/radeon: add runtime PM support (v2)")
      Cc: stable@vger.kernel.org # v3.13+: 27d4ee03: workqueue: Allow retrieval of current task's work struct
      Cc: stable@vger.kernel.org # v3.13+: 25c058cc: drm: Allow determining if current task is output poll worker
      Cc: Ismo Toijala <ismo.toijala@gmail.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/64ea02c44f91dda19bc563902b97bbc699040392.1518338789.git.lukas@wunner.de
      15734fef
    • L
      drm/nouveau: Fix deadlock on runtime suspend · d61a5c10
      Lukas Wunner 提交于
      nouveau's ->runtime_suspend hook calls drm_kms_helper_poll_disable(),
      which waits for the output poll worker to finish if it's running.
      
      The output poll worker meanwhile calls pm_runtime_get_sync() in
      nouveau_connector_detect() which waits for the ongoing suspend to finish,
      causing a deadlock.
      
      Fix by not acquiring a runtime PM ref if nouveau_connector_detect() is
      called in the output poll worker's context.  This is safe because
      the poll worker is only enabled while runtime active and we know that
      ->runtime_suspend waits for it to finish.
      
      Other contexts calling nouveau_connector_detect() do require a runtime
      PM ref, these comprise:
      
        status_store() drm sysfs interface
        ->fill_modes drm callback
        drm_fb_helper_probe_connector_modes()
        drm_mode_getconnector()
        nouveau_connector_hotplug()
        nouveau_display_hpd_work()
        nv17_tv_set_property()
      
      Stack trace for posterity:
      
        INFO: task kworker/0:1:58 blocked for more than 120 seconds.
        Workqueue: events output_poll_execute [drm_kms_helper]
        Call Trace:
         schedule+0x28/0x80
         rpm_resume+0x107/0x6e0
         __pm_runtime_resume+0x47/0x70
         nouveau_connector_detect+0x7e/0x4a0 [nouveau]
         nouveau_connector_detect_lvds+0x132/0x180 [nouveau]
         drm_helper_probe_detect_ctx+0x85/0xd0 [drm_kms_helper]
         output_poll_execute+0x11e/0x1c0 [drm_kms_helper]
         process_one_work+0x184/0x380
         worker_thread+0x2e/0x390
      
        INFO: task kworker/0:2:252 blocked for more than 120 seconds.
        Workqueue: pm pm_runtime_work
        Call Trace:
         schedule+0x28/0x80
         schedule_timeout+0x1e3/0x370
         wait_for_completion+0x123/0x190
         flush_work+0x142/0x1c0
         nouveau_pmops_runtime_suspend+0x7e/0xd0 [nouveau]
         pci_pm_runtime_suspend+0x5c/0x180
         vga_switcheroo_runtime_suspend+0x1e/0xa0
         __rpm_callback+0xc1/0x200
         rpm_callback+0x1f/0x70
         rpm_suspend+0x13c/0x640
         pm_runtime_work+0x6e/0x90
         process_one_work+0x184/0x380
         worker_thread+0x2e/0x390
      
      Bugzilla: https://bugs.archlinux.org/task/53497
      Bugzilla: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870523
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70388#c33
      Fixes: 5addcf0a ("nouveau: add runtime PM support (v0.9)")
      Cc: stable@vger.kernel.org # v3.12+: 27d4ee03: workqueue: Allow retrieval of current task's work struct
      Cc: stable@vger.kernel.org # v3.12+: 25c058cc: drm: Allow determining if current task is output poll worker
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/b7d2cbb609a80f59ccabfdf479b9d5907c603ea1.1518338789.git.lukas@wunner.de
      d61a5c10
    • L
      drm: Allow determining if current task is output poll worker · 25c058cc
      Lukas Wunner 提交于
      Introduce a helper to determine if the current task is an output poll
      worker.
      
      This allows us to fix a long-standing deadlock in several DRM drivers
      wherein the ->runtime_suspend callback waits for the output poll worker
      to finish and the worker in turn calls a ->detect callback which waits
      for runtime suspend to finish.  The ->detect callback is invoked from
      multiple call sites and waiting for runtime suspend to finish is the
      correct thing to do except if it's executing in the context of the
      worker.
      
      v2: Expand kerneldoc to specifically mention deadlock between
          output poll worker and autosuspend worker as use case. (Lyude)
      
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/3549ce32e7f1467102e70d3e9cbf70c46bfe108e.1518593424.git.lukas@wunner.de
      25c058cc
  5. 16 2月, 2018 1 次提交
  6. 15 2月, 2018 4 次提交
  7. 14 2月, 2018 8 次提交
  8. 13 2月, 2018 4 次提交
  9. 12 2月, 2018 1 次提交
    • L
      vfs: do bulk POLL* -> EPOLL* replacement · a9a08845
      Linus Torvalds 提交于
      This is the mindless scripted replacement of kernel use of POLL*
      variables as described by Al, done by this script:
      
          for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
              L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
              for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
          done
      
      with de-mangling cleanups yet to come.
      
      NOTE! On almost all architectures, the EPOLL* constants have the same
      values as the POLL* constants do.  But they keyword here is "almost".
      For various bad reasons they aren't the same, and epoll() doesn't
      actually work quite correctly in some cases due to this on Sparc et al.
      
      The next patch from Al will sort out the final differences, and we
      should be all done.
      Scripted-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9a08845
  10. 09 2月, 2018 1 次提交
  11. 08 2月, 2018 1 次提交
  12. 07 2月, 2018 5 次提交