1. 14 7月, 2017 2 次提交
  2. 30 6月, 2017 1 次提交
  3. 28 6月, 2017 1 次提交
  4. 16 6月, 2017 1 次提交
  5. 31 5月, 2017 1 次提交
  6. 22 5月, 2017 1 次提交
  7. 08 5月, 2017 2 次提交
  8. 04 5月, 2017 1 次提交
  9. 02 5月, 2017 1 次提交
  10. 13 4月, 2017 1 次提交
  11. 06 4月, 2017 1 次提交
  12. 05 4月, 2017 2 次提交
  13. 06 3月, 2017 1 次提交
  14. 28 2月, 2017 6 次提交
  15. 27 2月, 2017 1 次提交
    • M
      drm: Add a new connector atomic property for link status · 40ee6fbe
      Manasi Navare 提交于
      At the time userspace does setcrtc, we've already promised the mode
      would work. The promise is based on the theoretical capabilities of
      the link, but it's possible we can't reach this in practice. The DP
      spec describes how the link should be reduced, but we can't reduce
      the link below the requirements of the mode. Black screen follows.
      
      One idea would be to have setcrtc return a failure. However, it
      already should not fail as the atomic checks have passed. It would
      also conflict with the idea of making setcrtc asynchronous in the
      future, returning before the actual mode setting and link training.
      
      Another idea is to train the link "upfront" at hotplug time, before
      pruning the mode list, so that we can do the pruning based on
      practical not theoretical capabilities. However, the changes for link
      training are pretty drastic, all for the sake of error handling and
      DP compliance, when the most common happy day scenario is the current
      approach of link training at mode setting time, using the optimal
      parameters for the mode. It is also not certain all hardware could do
      this without the pipe on; not even all our hardware can do this. Some
      of this can be solved, but not trivially.
      
      Both of the above ideas also fail to address link degradation *during*
      operation.
      
      The solution is to add a new "link-status" connector property in order
      to address link training failure in a way that:
      a) changes the current happy day scenario as little as possible, to
      avoid regressions, b) can be implemented the same way by all drm
      drivers, c) is still opt-in for the drivers and userspace, and opting
      out doesn't regress the user experience, d) doesn't prevent drivers
      from implementing better or alternate approaches, possibly without
      userspace involvement. And, of course, handles all the issues presented.
      In the usual happy day scenario, this is always "good". If something
      fails during or after a mode set, the kernel driver can set the link
      status to "bad" and issue a hotplug uevent for userspace to have it
      re-check the valid modes through GET_CONNECTOR IOCTL, and try modeset
      again. If the theoretical capabilities of the link can't be reached,
      the mode list is trimmed based on that.
      
      v7 by Jani:
      * Rebase, simplify set property while at it, checkpatch fix
      v6:
      * Fix a typo in kernel doc (Sean Paul)
      v5:
      * Clarify doc for silent rejection of atomic properties by driver (Daniel Vetter)
      v4:
      * Add comments in kernel-doc format (Daniel Vetter)
      * Update the kernel-doc for link-status (Sean Paul)
      v3:
      * Fixed a build error (Jani Saarinen)
      v2:
      * Removed connector->link_status (Daniel Vetter)
      * Set connector->state->link_status in drm_mode_connector_set_link_status_property
      (Daniel Vetter)
      * Set the connector_changed flag to true if connector->state->link_status changed.
      * Reset link_status to GOOD in update_output_state (Daniel Vetter)
      * Never allow userspace to set link status from Good To Bad (Daniel Vetter)
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Acked-by: NTony Cheng <tony.cheng@amd.com>
      Acked-by: NHarry Wentland <harry.wentland@amd.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Sean Paul <seanpaul@chromium.org>
      Signed-off-by: NManasi Navare <manasi.d.navare@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Acked-by: Eric Anholt <eric@anholt.net> (for the -modesetting patch)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/0182487051aa9f1594820e35a4853de2f8747b4e.1481883920.git.jani.nikula@intel.com
      40ee6fbe
  16. 17 2月, 2017 1 次提交
  17. 15 2月, 2017 5 次提交
  18. 31 1月, 2017 2 次提交
    • M
      drm/atomic: Fix double free in drm_atomic_state_default_clear · 92c715fc
      Maarten Lankhorst 提交于
      drm_atomic_helper_page_flip and drm_atomic_ioctl set their own events
      in crtc_state->event. But when it's set the event is freed in 2 places.
      
      Solve this by only freeing the event in the atomic ioctl when it
      allocated its own event.
      
      This has been broken twice. The first time when the code was introduced,
      but only in the corner case when an event is allocated, but more crtc's
      were included by atomic check and then failing. This can mostly
      happen when you do an atomic modeset in i915 and the display clock is
      changed, which forces all crtc's to be included to the state.
      
      This has been broken worse by adding in-fences support, which caused
      the double free to be done unconditionally.
      
      [IGT] kms_rotation_crc: starting subtest primary-rotation-180
      =============================================================================
      BUG kmalloc-128 (Tainted: G     U         ): Object already free
      -----------------------------------------------------------------------------
      
      Disabling lock debugging due to kernel taint
      INFO: Allocated in drm_atomic_helper_setup_commit+0x285/0x2f0 [drm_kms_helper] age=0 cpu=3 pid=1529
       ___slab_alloc+0x308/0x3b0
       __slab_alloc+0xd/0x20
       kmem_cache_alloc_trace+0x92/0x1c0
       drm_atomic_helper_setup_commit+0x285/0x2f0 [drm_kms_helper]
       intel_atomic_commit+0x35/0x4f0 [i915]
       drm_atomic_commit+0x46/0x50 [drm]
       drm_mode_atomic_ioctl+0x7d4/0xab0 [drm]
       drm_ioctl+0x2b3/0x490 [drm]
       do_vfs_ioctl+0x69c/0x700
       SyS_ioctl+0x4e/0x80
       entry_SYSCALL_64_fastpath+0x13/0x94
      INFO: Freed in drm_event_cancel_free+0xa3/0xb0 [drm] age=0 cpu=3 pid=1529
       __slab_free+0x48/0x2e0
       kfree+0x159/0x1a0
       drm_event_cancel_free+0xa3/0xb0 [drm]
       drm_mode_atomic_ioctl+0x86d/0xab0 [drm]
       drm_ioctl+0x2b3/0x490 [drm]
       do_vfs_ioctl+0x69c/0x700
       SyS_ioctl+0x4e/0x80
       entry_SYSCALL_64_fastpath+0x13/0x94
      INFO: Slab 0xffffde1f0997b080 objects=17 used=2 fp=0xffff92fb65ec2578 flags=0x200000000008101
      INFO: Object 0xffff92fb65ec2578 @offset=1400 fp=0xffff92fb65ec2ae8
      
      Redzone ffff92fb65ec2570: bb bb bb bb bb bb bb bb                          ........
      Object ffff92fb65ec2578: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
      Object ffff92fb65ec2588: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
      Object ffff92fb65ec2598: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
      Object ffff92fb65ec25a8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
      Object ffff92fb65ec25b8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
      Object ffff92fb65ec25c8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
      Object ffff92fb65ec25d8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
      Object ffff92fb65ec25e8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5  kkkkkkkkkkkkkkk.
      Redzone ffff92fb65ec25f8: bb bb bb bb bb bb bb bb                          ........
      Padding ffff92fb65ec2738: 5a 5a 5a 5a 5a 5a 5a 5a                          ZZZZZZZZ
      CPU: 3 PID: 180 Comm: kworker/3:2 Tainted: G    BU          4.10.0-rc6-patser+ #5039
      Hardware name:                  /NUC5PPYB, BIOS PYBSWCEL.86A.0031.2015.0601.1712 06/01/2015
      Workqueue: events intel_atomic_helper_free_state [i915]
      Call Trace:
       dump_stack+0x4d/0x6d
       print_trailer+0x20c/0x220
       free_debug_processing+0x1c6/0x330
       ? drm_atomic_state_default_clear+0xf7/0x1c0 [drm]
       __slab_free+0x48/0x2e0
       ? drm_atomic_state_default_clear+0xf7/0x1c0 [drm]
       kfree+0x159/0x1a0
       drm_atomic_state_default_clear+0xf7/0x1c0 [drm]
       ? drm_atomic_state_clear+0x30/0x30 [drm]
       intel_atomic_state_clear+0xd/0x20 [i915]
       drm_atomic_state_clear+0x1a/0x30 [drm]
       __drm_atomic_state_free+0x13/0x60 [drm]
       intel_atomic_helper_free_state+0x5d/0x70 [i915]
       process_one_work+0x260/0x4a0
       worker_thread+0x2d1/0x4f0
       kthread+0x127/0x130
       ? process_one_work+0x4a0/0x4a0
       ? kthread_stop+0x120/0x120
       ret_from_fork+0x29/0x40
      FIX kmalloc-128: Object at 0xffff92fb65ec2578 not freed
      
      Fixes: 3b24f7d6 ("drm/atomic: Add struct drm_crtc_commit to track async updates")
      Fixes: 96260142 ("drm/fence: add in-fences support")
      Cc: <stable@vger.kernel.org> # v4.8+
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NGustavo Padovan <gustavo.padovan@collabora.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1485854725-27640-1-git-send-email-maarten.lankhorst@linux.intel.com
      92c715fc
    • D
      drm/docs: Fix documentation for drm_atomic_set_mode_for_crtc · cbef9099
      Dhinakaran Pandiyan 提交于
      drm_atomic_set_mode_for_crtc() modifies the .enable member of CRTC state
      but documentation claims otherwise, fix that.
      Signed-off-by: NDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1485843518-28438-1-git-send-email-dhinakaran.pandiyan@intel.com
      cbef9099
  19. 27 1月, 2017 1 次提交
  20. 25 1月, 2017 1 次提交
  21. 17 1月, 2017 1 次提交
  22. 05 1月, 2017 1 次提交
  23. 04 1月, 2017 1 次提交
  24. 30 12月, 2016 1 次提交
  25. 18 12月, 2016 1 次提交
    • D
      drm: locking&new iterators for connector_list · 613051da
      Daniel Vetter 提交于
      The requirements for connector_list locking are a bit tricky:
      - We need to be able to jump over zombie conectors (i.e. with refcount
        == 0, but not yet removed from the list). If instead we require that
        there's no zombies on the list then the final kref_put must happen
        under the list protection lock, which means that locking context
        leaks all over the place. Not pretty - better to deal with zombies
        and wrap the locking just around the list_del in the destructor.
      
      - When we walk the list we must _not_ hold the connector list lock. We
        walk the connector list at an absolutely massive amounts of places,
        if all those places can't ever call drm_connector_unreference the
        code would get unecessarily complicated.
      
      - connector_list needs it own lock, again too many places that walk it
        that we could reuse e.g. mode_config.mutex without resulting in
        inversions.
      
      - Lots of code uses these loops to look-up a connector, i.e. they want
        to be able to call drm_connector_reference. But on the other hand we
        want connectors to stay on that list until they're dead (i.e.
        connector_list can't hold a full reference), which means despite the
        "can't hold lock for the loop body" rule we need to make sure a
        connector doesn't suddenly become a zombie.
      
      At first Dave&I discussed various horror-show approaches using srcu,
      but turns out it's fairly easy:
      
      - For the loop body we always hold an additional reference to the
        current connector. That means it can't zombify, and it also means
        it'll stay on the list, which means we can use it as our iterator to
        find the next connector.
      
      - When we try to find the next connector we only have to jump over
        zombies. To make sure we don't chase bad pointers that entire loop
        is protected with the new connect_list_lock spinlock. And because we
        know that we're starting out with a non-zombie (need to drop our
        reference for the old connector only after we have our new one),
        we're guranteed to still be on the connector_list and either find
        the next non-zombie or complete the iteration.
      
      - Only downside is that we need to make sure that the temporary
        reference for the loop body doesn't leak. iter_get/put() functions +
        lockdep make sure that's the case.
      
      - To avoid a flag day the new iterator macro has an _iter postfix. We
        can rename it back once all the users of the unsafe version are gone
        (there's about 100 list walkers for the connector_list).
      
      For now this patch only converts all the list walking in the core,
      leaving helpers and drivers for later patches. The nice thing is that
      we can now finally remove 2 FIXME comments from the
      register/unregister functions.
      
      v2:
      - use irqsafe spinlocks, so that we can use this in drm_state_dump
        too.
      - nuke drm_modeset_lock_all from drm_connector_init, now entirely
        cargo-culted nonsense.
      
      v3:
      - do {} while (!kref_get_unless_zero), makes for a tidier loop (Dave).
      - pretty kerneldoc
      - add EXPORT_SYMBOL, helpers&drivers are supposed to use this.
      
      v4: Change lockdep annotations to only check whether we release the
      iter fake lock again (i.e. make sure that iter_put is called), but
      not check any locking dependecies itself. That seams to require a
      recursive read lock in trylock mode.
      
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161213230814.19598-6-daniel.vetter@ffwll.ch
      613051da
  26. 15 12月, 2016 2 次提交
    • M
      drm/atomic: Delete wrong comment. · d9a5bb2d
      Maarten Lankhorst 提交于
      drm_atomic_state_put is called unconditionally, so TEST_ONLY is no
      different from commit.
      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/1481812185-19098-2-git-send-email-maarten.lankhorst@linux.intel.com
      d9a5bb2d
    • V
      drm: Nuke fb->pixel_format · 438b74a5
      Ville Syrjälä 提交于
      Replace uses of fb->pixel_format with fb->format->format.
      Less duplicated information is a good thing.
      
      Note that coccinelle failed to eliminate the
      "/* fourcc format */" comment from drm_framebuffer.h, so I had
      to do that part manually.
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       drm_helper_mode_fill_fb_struct(...) {
      	...
      -	FB->pixel_format = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       i9xx_get_initial_plane_config(...) {
      	...
      -	FB->pixel_format = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       ironlake_get_initial_plane_config(...) {
      	...
      -	FB->pixel_format = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       skylake_get_initial_plane_config(...) {
      	...
      -	FB->pixel_format = E;
      	...
       }
      
      @@
      struct drm_framebuffer *a;
      struct drm_framebuffer b;
      @@
      (
      - a->pixel_format
      + a->format->format
      |
      - b.pixel_format
      + b.format->format
      )
      
      @@
      struct drm_plane_state *a;
      struct drm_plane_state b;
      @@
      (
      - a->fb->pixel_format
      + a->fb->format->format
      |
      - b.fb->pixel_format
      + b.fb->format->format
      )
      
      @@
      struct drm_crtc *CRTC;
      @@
      (
      - CRTC->primary->fb->pixel_format
      + CRTC->primary->fb->format->format
      |
      - CRTC->primary->state->fb->pixel_format
      + CRTC->primary->state->fb->format->format
      )
      
      @@
      struct drm_mode_set *set;
      @@
      (
      - set->fb->pixel_format
      + set->fb->format->format
      |
      - set->crtc->primary->fb->pixel_format
      + set->crtc->primary->fb->format->format
      )
      
      @@
      @@
       struct drm_framebuffer {
      	 ...
      -	 uint32_t pixel_format;
      	 ...
       };
      
      v2: Fix commit message (Laurent)
          Rebase due to earlier removal of many fb->pixel_format uses,
          including the 'fb->format = drm_format_info(fb->format->format);'
          snafu
      v3: Adjusted the semantic patch a bit and regenerated due to code
          changes
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1481751175-18463-1-git-send-email-ville.syrjala@linux.intel.com
      438b74a5