1. 15 12月, 2016 1 次提交
  2. 10 12月, 2016 1 次提交
  3. 07 12月, 2016 1 次提交
  4. 29 11月, 2016 1 次提交
  5. 22 11月, 2016 2 次提交
  6. 17 11月, 2016 1 次提交
  7. 16 11月, 2016 2 次提交
    • G
      drm/fence: add out-fences support · beaf5af4
      Gustavo Padovan 提交于
      Support DRM out-fences by creating a sync_file with a fence for each CRTC
      that sets the OUT_FENCE_PTR property.
      
      We use the out_fence pointer received in the OUT_FENCE_PTR prop to send
      the sync_file fd back to userspace.
      
      The sync_file and fd are allocated/created before commit, but the
      fd_install operation only happens after we know that commit succeed.
      
      v2: Comment by Rob Clark:
      	- Squash commit that adds DRM_MODE_ATOMIC_OUT_FENCE flag here.
      
          Comment by Daniel Vetter:
      	- Add clean up code for out_fences
      
      v3: Comments by Daniel Vetter:
      	- create DRM_MODE_ATOMIC_EVENT_MASK
      	- userspace should fill out_fences_ptr with the crtc_ids for which
      	it wants fences back.
      
      v4: Create OUT_FENCE_PTR properties and remove old approach.
      
      v5: Comments by Brian Starkey:
      	- Remove extra fence_get() in atomic_ioctl()
      	- Check ret before iterating on the crtc_state
      	- check ret before fd_install
      	- set fence_state to NULL at the beginning
      	- check fence_state->out_fence_ptr before put_user()
      	- change order of fput() and put_unused_fd() on failure
      
           - Add access_ok() check to the out_fence_ptr received
           - Rebase after fence -> dma_fence rename
           - Store out_fence_ptr in the drm_atomic_state
           - Split crtc_setup_out_fence()
           - return -1 as out_fence with TEST_ONLY flag
      
      v6: Comments by Daniel Vetter
      	- Add prepare/unprepare_crtc_signaling()
      	- move struct drm_out_fence_state to drm_atomic.c
      	- mark get_crtc_fence() as static
      
          Comments by Brian Starkey
      	- proper set fence_ptr fence_state array
      	- isolate fence_idx increment
      
          - improve error handling
      
      v7: Comments by Daniel Vetter
      	- remove prefix from internal functions
      	- make out_fence_ptr an s64 pointer
      	- degrade DRM_INFO to DRM_DEBUG_ATOMIC when put_user fail
      	- fix doc issues
      	- filter out OUT_FENCE_PTR == NULL and do not fail in this case
      	- add complete_crtc_signalling()
      	- krealloc fence_state on demand
      
          Comment by Brian Starkey
      	- remove unused crtc_state arg from get_out_fence()
      
      v8: Comment by Brian Starkey
      	- cancel events before check for !fence_state
      	- convert a few lefovers u64 types for out_fence_ptr
      	- fix memleak by assign fence_state earlier after realloc
      	- proper accout num_fences in case of error
      
      v9: Comment by Brian Starkey
      	- memset last position of fence_state after krealloc
          Comments by Sean Paul
      	- pass install_fds in complete_crtc_signaling() instead of ret
      
           - put_user(-1, fence_ptr) when decoding props
      
      v10: Comment by Brian Starkey
      	- remove unneeded num_fences increment on error path
      	- kfree fence_state after installing fences fd
      
      v11: rebase against latest drm-misc
      
      v12: rebase again against latest drm-misc
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Reviewed-by: Brian Starkey <brian.starkey@arm.com> (v10)
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Tested-by: Robert Foss <robert.foss@collabora.com> (v10)
      [danvet: Appease checkpatch.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479301221-13056-1-git-send-email-gustavo@padovan.org
      beaf5af4
    • G
      drm/fence: add in-fences support · 96260142
      Gustavo Padovan 提交于
      There is now a new property called IN_FENCE_FD attached to every plane
      state that receives sync_file fds from userspace via the atomic commit
      IOCTL.
      
      The fd is then translated to a fence (that may be a fence_array
      subclass or just a normal fence) and then used by DRM to fence_wait() for
      all fences in the sync_file to signal. So it only commits when all
      framebuffers are ready to scanout.
      
      v2: Comments by Daniel Vetter:
      	- remove set state->fence = NULL in destroy phase
      	- accept fence -1 as valid and just return 0
      	- do not call fence_get() - sync_file_fences_get() already calls it
      	- fence_put() if state->fence is already set, in case userspace
      	set the property more than once.
      
      v3: WARN_ON if fence is set but state has no FB
      
      v4: Comment from Maarten Lankhorst
      	- allow set fence with no related fb
      
      v5: rename FENCE_FD to IN_FENCE_FD
      
      v6: Comments by Daniel Vetter:
      	- rename plane_state->in_fence back to "fence"
      	- re-introduce WARN_ON if fence set but no fb
      
           - rebase after fence -> dma_fence rename
      
      v7: Comments by Brian Starkey
      	- set state->fence to NULL when duplicating the state
      	- fail if IN_FENCE_FD was already set
      
      v8: rebase against latest drm-misc
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Reviewed-by: NBrian Starkey <brian.starkey@arm.com>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Tested-by: NRobert Foss <robert.foss@collabora.com>
      [danvet: Rebase onto extracted drm_mode_config.[hc].]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      96260142
  8. 12 11月, 2016 1 次提交
  9. 09 11月, 2016 2 次提交
  10. 08 11月, 2016 1 次提交
  11. 26 10月, 2016 1 次提交
  12. 25 10月, 2016 1 次提交
    • C
      dma-buf: Rename struct fence to dma_fence · f54d1867
      Chris Wilson 提交于
      I plan to usurp the short name of struct fence for a core kernel struct,
      and so I need to rename the specialised fence/timeline for DMA
      operations to make room.
      
      A consensus was reached in
      https://lists.freedesktop.org/archives/dri-devel/2016-July/113083.html
      that making clear this fence applies to DMA operations was a good thing.
      Since then the patch has grown a bit as usage increases, so hopefully it
      remains a good thing!
      
      (v2...: rebase, rerun spatch)
      v3: Compile on msm, spotted a manual fixup that I broke.
      v4: Try again for msm, sorry Daniel
      
      coccinelle script:
      @@
      
      @@
      - struct fence
      + struct dma_fence
      @@
      
      @@
      - struct fence_ops
      + struct dma_fence_ops
      @@
      
      @@
      - struct fence_cb
      + struct dma_fence_cb
      @@
      
      @@
      - struct fence_array
      + struct dma_fence_array
      @@
      
      @@
      - enum fence_flag_bits
      + enum dma_fence_flag_bits
      @@
      
      @@
      (
      - fence_init
      + dma_fence_init
      |
      - fence_release
      + dma_fence_release
      |
      - fence_free
      + dma_fence_free
      |
      - fence_get
      + dma_fence_get
      |
      - fence_get_rcu
      + dma_fence_get_rcu
      |
      - fence_put
      + dma_fence_put
      |
      - fence_signal
      + dma_fence_signal
      |
      - fence_signal_locked
      + dma_fence_signal_locked
      |
      - fence_default_wait
      + dma_fence_default_wait
      |
      - fence_add_callback
      + dma_fence_add_callback
      |
      - fence_remove_callback
      + dma_fence_remove_callback
      |
      - fence_enable_sw_signaling
      + dma_fence_enable_sw_signaling
      |
      - fence_is_signaled_locked
      + dma_fence_is_signaled_locked
      |
      - fence_is_signaled
      + dma_fence_is_signaled
      |
      - fence_is_later
      + dma_fence_is_later
      |
      - fence_later
      + dma_fence_later
      |
      - fence_wait_timeout
      + dma_fence_wait_timeout
      |
      - fence_wait_any_timeout
      + dma_fence_wait_any_timeout
      |
      - fence_wait
      + dma_fence_wait
      |
      - fence_context_alloc
      + dma_fence_context_alloc
      |
      - fence_array_create
      + dma_fence_array_create
      |
      - to_fence_array
      + to_dma_fence_array
      |
      - fence_is_array
      + dma_fence_is_array
      |
      - trace_fence_emit
      + trace_dma_fence_emit
      |
      - FENCE_TRACE
      + DMA_FENCE_TRACE
      |
      - FENCE_WARN
      + DMA_FENCE_WARN
      |
      - FENCE_ERR
      + DMA_FENCE_ERR
      )
       (
       ...
       )
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Acked-by: NSumit Semwal <sumit.semwal@linaro.org>
      Acked-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161025120045.28839-1-chris@chris-wilson.co.uk
      f54d1867
  13. 22 10月, 2016 3 次提交
  14. 17 10月, 2016 1 次提交
  15. 12 9月, 2016 1 次提交
  16. 07 9月, 2016 1 次提交
  17. 29 8月, 2016 1 次提交
  18. 16 8月, 2016 1 次提交
  19. 15 8月, 2016 1 次提交
  20. 29 7月, 2016 1 次提交
    • M
      drm: add generic zpos property · 44d1240d
      Marek Szyprowski 提交于
      version 8:
      - move drm_blend.o from drm-y to drm_kms_helper-y to avoid
        EXPORT_SYMBOL(drm_atomic_helper_normalize_zpos)
      - remove dead function declarations in drm_crtc.h
      
      version 7:
      - remove useless EXPORT_SYMBOL()
      - better z-order wording in Documentation
      
      version 6:
      - add zpos in gpu documentation file
      - merge Ville patch about zpos initial value and API improvement.
        I have split Ville patch between zpos core and drivers
      
      version 5:
      - remove zpos range check and comeback to 0 to N-1
        normalization algorithm
      
      version 4:
      - make sure that normalized zpos value is stay
        in the defined property range and warn user if not
      
      This patch adds support for generic plane's zpos property property with
      well-defined semantics:
      - added zpos properties to plane and plane state structures
      - added helpers for normalizing zpos properties of given set of planes
      - well defined semantics: planes are sorted by zpos values and then plane
        id value if zpos equals
      
      Normalized zpos values are calculated automatically when generic
      muttable zpos property has been initialized. Drivers can simply use
      plane_state->normalized_zpos in their atomic_check and/or plane_update
      callbacks without any additional calls to DRM core.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      
      Compare to Marek's original patch zpos property is now specific to each
      plane and no more to the core.
      Normalize function take care of the range of per plane defined range
      before set normalized_zpos.
      Signed-off-by: NBenjamin Gaignard <benjamin.gaignard@linaro.org>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Tested-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Joonyoung Shim <jy0922.shim@samsung.com>
      Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
      Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: vincent.abriou@st.com
      Cc: fabien.dessenne@st.com
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      44d1240d
  21. 21 7月, 2016 1 次提交
  22. 14 7月, 2016 1 次提交
    • D
      Revert "drm: Resurrect atomic rmfb code" · 0dcac500
      Daniel Vetter 提交于
      This reverts commit 11c21e73.
      
      For reasons totally unclear this manages to wreak havoc with the audio
      rpm refcount:
      
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 215 at drivers/gpu/drm/i915/intel_runtime_pm.c:1729 intel_display_power_put+0xe8/0x100 [i915]
      Use count on domain AUDIO is already zero
      Modules linked in: i915 ax88179_178a usbnet mii snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec x86_pkg_temp_thermal snd_hwdep intel_powerclamp snd_hda_core co
      f_pclmul crc32_pclmul snd_pcm ghash_clmulni_intel mei_me mei e1000e ptp pps_core i2c_hid [last unloaded: i915]
      CPU: 0 PID: 215 Comm: kworker/0:2 Not tainted 4.7.0-rc6+ #44
      Hardware name: Intel Corporation Skylake Client platform/Skylake Halo DDR4 RVP11, BIOS SKLSE2R1.R00.X106.B00.1601180206 01/18/2016
      Workqueue: events output_poll_execute
       0000000000000000 ffff88045573fa38 ffffffff813a2d6b ffff88045573fa88
       0000000000000000 ffff88045573fa78 ffffffff81075db6 000006c15a590000
       ffff88045a59a238 ffff88045a590054 ffff88045a590000 ffff88045a590000
      Call Trace:
       [<ffffffff813a2d6b>] dump_stack+0x4d/0x72
       [<ffffffff81075db6>] __warn+0xc6/0xe0
       [<ffffffff81075e1a>] warn_slowpath_fmt+0x4a/0x50
       [<ffffffffa046399d>] ? hsw_audio_codec_disable+0xdd/0x110 [i915]
       [<ffffffffa041e638>] intel_display_power_put+0xe8/0x100 [i915]
       [<ffffffffa049d776>] intel_disable_ddi+0x46/0x80 [i915]
       [<ffffffffa0474eef>] haswell_crtc_disable+0x16f/0x290 [i915]
       [<ffffffffa047cb53>] intel_atomic_commit_tail+0x153/0x10e0 [i915]
       [<ffffffff814aa020>] ? drm_atomic_helper_swap_state+0x140/0x2d0
       [<ffffffffa047dedd>] intel_atomic_commit+0x3fd/0x520 [i915]
       [<ffffffff814d0252>] ? drm_atomic_add_affected_connectors+0x22/0xf0
       [<ffffffff814cf8a2>] drm_atomic_commit+0x32/0x50
       [<ffffffff814aed07>] restore_fbdev_mode+0x147/0x260
       [<ffffffff814b026e>] drm_fb_helper_restore_fbdev_mode_unlocked+0x2e/0x70
       [<ffffffff814b02d8>] drm_fb_helper_set_par+0x28/0x50
       [<ffffffff814b0203>] drm_fb_helper_hotplug_event+0x143/0x180
       [<ffffffffa0498ab5>] intel_fbdev_output_poll_changed+0x15/0x20 [i915]
       [<ffffffff814a1f92>] drm_kms_helper_hotplug_event+0x22/0x30
       [<ffffffff814a2172>] output_poll_execute+0x192/0x1e0
       [<ffffffff8108cf7c>] process_one_work+0x14c/0x480
       [<ffffffff8108d4fa>] worker_thread+0x24a/0x4e0
       [<ffffffff8108d2b0>] ? process_one_work+0x480/0x480
       [<ffffffff8108d2b0>] ? process_one_work+0x480/0x480
       [<ffffffff81092904>] kthread+0xc4/0xe0
       [<ffffffff8173013f>] ret_from_fork+0x1f/0x40
       [<ffffffff81092840>] ? kthread_worker_fn+0x180/0x180
      ---[ end trace 2d440da5f0c053e4 ]---
      
      Instead of scratching heads too much while CI is down, let's revert
      before more trouble is caused.
      
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reported-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Acked-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1468502194-17029-1-git-send-email-daniel.vetter@ffwll.ch
      0dcac500
  23. 13 7月, 2016 1 次提交
  24. 24 6月, 2016 1 次提交
    • M
      drm/atomic: Make drm_atomic_legacy_backoff reset crtc->acquire_ctx · 81e257e9
      Maarten Lankhorst 提交于
      Atomic updates may acquire more state than initially locked through
      drm_modeset_lock_crtc, running with heavy stress can cause a
      WARN_ON(crtc->acquire_ctx) in drm_modeset_lock_crtc:
      
      [  601.491296] ------------[ cut here ]------------
      [  601.491366] WARNING: CPU: 0 PID: 2411 at
      drivers/gpu/drm/drm_modeset_lock.c:191 drm_modeset_lock_crtc+0xeb/0xf0 [drm]
      [  601.491369] Modules linked in: drm i915 drm_kms_helper
      [  601.491414] CPU: 0 PID: 2411 Comm: kms_cursor_lega Tainted: G     U 4.7.0-rc4-patser+ #4798
      [  601.491417] Hardware name: Intel Corporation Skylake Client
      [  601.491420]  0000000000000000 ffff88044d153c98 ffffffff812ead28 0000000000000000
      [  601.491425]  0000000000000000 ffff88044d153cd8 ffffffff810868e6 000000bf58058030
      [  601.491431]  ffff880088b415e8 ffff880458058030 ffff88008a271548 ffff88008a271568
      [  601.491436] Call Trace:
      [  601.491443]  [<ffffffff812ead28>] dump_stack+0x4d/0x65
      [  601.491447]  [<ffffffff810868e6>] __warn+0xc6/0xe0
      [  601.491452]  [<ffffffff81086968>] warn_slowpath_null+0x18/0x20
      [  601.491472]  [<ffffffffc00d4ffb>] drm_modeset_lock_crtc+0xeb/0xf0 [drm]
      [  601.491491]  [<ffffffffc00c5526>] drm_mode_cursor_common+0x66/0x180 [drm]
      [  601.491509]  [<ffffffffc00c91cc>] drm_mode_cursor_ioctl+0x3c/0x40 [drm]
      [  601.491524]  [<ffffffffc00bc94d>] drm_ioctl+0x14d/0x530 [drm]
      [  601.491540]  [<ffffffffc00c9190>] ? drm_mode_setcrtc+0x520/0x520 [drm]
      [  601.491545]  [<ffffffff81176aeb>] ? handle_mm_fault+0x106b/0x1430
      [  601.491550]  [<ffffffff81108441>] ? stop_one_cpu+0x61/0x70
      [  601.491556]  [<ffffffff811bb71d>] do_vfs_ioctl+0x8d/0x570
      [  601.491560]  [<ffffffff81290d7e>] ? security_file_ioctl+0x3e/0x60
      [  601.491565]  [<ffffffff811bbc74>] SyS_ioctl+0x74/0x80
      [  601.491571]  [<ffffffff810e321c>] ? posix_get_monotonic_raw+0xc/0x10
      [  601.491576]  [<ffffffff8175b11b>] entry_SYSCALL_64_fastpath+0x13/0x8f
      [  601.491581] ---[ end trace 56f3d3d85f000d00 ]---
      
      For good measure, test mode_config.acquire_ctx too, although this should
      never happen.
      
      Testcase: kms_cursor_legacy
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      81e257e9
  25. 10 6月, 2016 1 次提交
  26. 03 6月, 2016 1 次提交
  27. 02 6月, 2016 3 次提交
  28. 01 6月, 2016 1 次提交
  29. 18 5月, 2016 1 次提交
  30. 05 5月, 2016 2 次提交
  31. 03 5月, 2016 1 次提交
    • M
      drm/atomic: Add WARN_ON when state->acquire_ctx is not set. · 7f4eaa89
      Maarten Lankhorst 提交于
      When I was writing an atomic wrapper for rmfb, I ran into the
      following backtrace from lockdep:
      
      =============================================
      [ INFO: possible recursive locking detected ]
      4.5.0-patser+ #4696 Tainted: G     U
      ---------------------------------------------
      kworker/2:2/2608 is trying to acquire lock:
       (crtc_ww_class_mutex){+.+.+.}, at: [<ffffffffc00c9ddc>] drm_modeset_lock+0x7c/0x120 [drm]
      
      but task is already holding lock:
       (crtc_ww_class_mutex){+.+.+.}, at: [<ffffffffc00c98cd>] modeset_backoff+0x8d/0x220 [drm]
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
      
             CPU0
             ----
        lock(crtc_ww_class_mutex);
        lock(crtc_ww_class_mutex);
      
       *** DEADLOCK ***
      
       May be due to missing lock nesting notation
      
      4 locks held by kworker/2:2/2608:
       #0:  ("events"){.+.+.+}, at: [<ffffffff810a5eea>] process_one_work+0x15a/0x6c0
       #1:  ((&arg.work)){+.+.+.}, at: [<ffffffff810a5eea>] process_one_work+0x15a/0x6c0
       #2:  (crtc_ww_class_acquire){+.+.+.}, at: [<ffffffffc004532a>] drm_atomic_helper_remove_fb+0x4a/0x1d0 [drm_kms_helper]
       #3:  (crtc_ww_class_mutex){+.+.+.}, at: [<ffffffffc00c98cd>] modeset_backoff+0x8d/0x220 [drm]
      
      While lockdep probably catches this bug when it happens, it's better
      to explicitly warn when state->acquire_ctx is not set.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1462266751-29123-1-git-send-email-maarten.lankhorst@linux.intel.com
      7f4eaa89
  32. 02 5月, 2016 1 次提交