1. 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
  2. 21 7月, 2016 1 次提交
  3. 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
  4. 13 7月, 2016 1 次提交
  5. 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
  6. 10 6月, 2016 1 次提交
  7. 03 6月, 2016 1 次提交
  8. 02 6月, 2016 3 次提交
  9. 01 6月, 2016 1 次提交
  10. 18 5月, 2016 1 次提交
  11. 05 5月, 2016 2 次提交
  12. 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
  13. 02 5月, 2016 1 次提交
  14. 28 4月, 2016 1 次提交
  15. 20 3月, 2016 1 次提交
  16. 08 3月, 2016 1 次提交
  17. 19 2月, 2016 1 次提交
    • M
      drm/atomic: Allow for holes in connector state, v2. · 5fff80bb
      Maarten Lankhorst 提交于
      Because we record connector_mask using 1 << drm_connector_index now
      the connector_mask should stay the same even when other connectors
      are removed. This was not the case with MST, in that case when removing
      a connector all other connectors may change their index.
      
      This is fixed by waiting until the first get_connector_state to allocate
      connector_state, and force reallocation when state is too small.
      
      As a side effect connector arrays no longer have to be preallocated,
      and can be allocated on first use which means a less allocations in
      the page flip only path.
      
      Changes since v1:
      - Whitespace. (Ville)
      - Call ida_remove when destroying the connector. (Ville)
      - u32 alloc -> int. (Ville)
      
      Fixes: 14de6c44 ("drm/atomic: Remove drm_atomic_connectors_for_crtc.")
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NLyude <cpaul@redhat.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      5fff80bb
  18. 25 1月, 2016 1 次提交
  19. 06 1月, 2016 1 次提交
  20. 05 1月, 2016 2 次提交
  21. 11 12月, 2015 2 次提交
  22. 08 12月, 2015 1 次提交
  23. 03 12月, 2015 1 次提交
    • T
      drm: Implement drm_modeset_lock_all_ctx() · 06eaae46
      Thierry Reding 提交于
      This function is like drm_modeset_lock_all(), but it takes the lock
      acquisition context as a parameter rather than storing it in the DRM
      device's mode_config structure.
      
      Implement drm_modeset_{,un}lock_all() in terms of the new function for
      better code reuse, and add a note to the kerneldoc that new code should
      use the new functions.
      
      v2: improve kerneldoc
      v4: rename drm_modeset_lock_all_crtcs() to drm_modeset_lock_all_ctx()
          and take mode_config's .connection_mutex instead of .mutex lock to
          avoid lock inversion (Daniel Vetter), use drm_modeset_drop_locks()
          which is now the equivalent of drm_modeset_unlock_all_ctx()
      v5: do not take the dev->mode_config.connection_mutex in
          drm_atomic_legacy_backoff() since drm_modeset_lock_all_ctx()
          already keeps it, enhance kerneldoc for drm_modeset_lock_all_ctx()
          (Daniel Vetter)
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449075005-13937-1-git-send-email-thierry.reding@gmail.comSigned-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      06eaae46
  24. 24 11月, 2015 2 次提交
  25. 17 11月, 2015 2 次提交
  26. 25 9月, 2015 1 次提交
  27. 08 9月, 2015 1 次提交
    • D
      drm/atomic: refuse changing CRTC for planes directly · f8aeb41c
      Daniel Vetter 提交于
      Very strictly speaking this is possible if you have special hw and
      genlocked CRTCs. In general switching a plane between two active CRTC
      just won't work so well and is probably not tested at all. Just forbid
      it.
      
      I've put this into the core since right now no helper or driver copes
      with it, no userspace has code for it and no one asks for it. Yes
      there's piles of corner-cases where this would be possible to do this
      like:
      - switch from inactive crtc to active crtc
      - switch from active crtc to inactive crtc
      - genlocked display
      - invisible plane (to do whatever)
      - idle plane hw due to dsi cmd mode/psr
      - whatever
      but looking at details it's not that easy to implement this correctly.
      Hence just put it into the core and add a comment, since the only
      userspace we have right now for atomic (weston) doesn't want to use
      direct plane switching either.
      
      v2: don't bother with complexity and just outright disallow plane
      switching without the intermediate OFF state. Simplifies drivers, we
      don't have any hw that could do it anyway and current atomic userspace
      (weston) works like this already anyway.
      
      v3: Bikeshed function name (Ville) and add comment (Rob).
      
      v4: Also bikeshed commit message (Rob).
      
      v5: Fix compile warnings reported by 0-day.
      
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Daniel Stone <daniels@collabora.com>
      Acked-by: NDaniel Stone <daniels@collabora.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Acked-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      f8aeb41c
  28. 01 9月, 2015 1 次提交
  29. 25 8月, 2015 1 次提交
  30. 11 8月, 2015 2 次提交
  31. 22 7月, 2015 1 次提交
    • D
      drm: Roll out drm_for_each_connector more · 9a9f5ce8
      Daniel Vetter 提交于
      Now that we also grab the connection_mutex and so fixed the race with
      atomic modeset we can use the iterator there too.
      
      The other special case is drm_connector_unplug_all which would have a
      locking inversion with the sysfs store/show functions if we'd grab the
      mode_config.mutex around the unplug. We could just grab
      connection_mutex instead, but that's a bit too much a dirty trick for
      my taste. Also it's only used by udl, which doesn't do any other kind
      of connector hotplugging, so should be race-free. Hence just stick
      with a comment for now.
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      9a9f5ce8
  32. 07 7月, 2015 1 次提交