Skip to content
  1. Jun 07, 2016
  2. Jun 04, 2016
  3. Jun 03, 2016
    • Chris Wilson's avatar
      drm: Store the plane's index · 490d3d1b
      Chris Wilson authored
      
      
      Currently the plane's index is determined by walking the list of all
      planes in the mode and finding the position of that plane in the list. A
      linear walk, especially a linear walk within a linear walk as frequently
      conceived by i915.ko [O(N^2)] quickly comes to dominate profiles.
      
      The plane's index is constant for as long as no earlier planes are
      removed from the list. For all drivers, planes are static, determined
      at boot and then untouched until shutdown. In fact, there is no locking
      provided to allow for dynamic removal of planes/encoders/crtcs.
      
      v2: Convert drm_crtc_index() and drm_encoder_index() as well.
      v3: Stop adjusting the indices upon removal; consider the list
      construct-only.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      [danvet: Fixup typo in kerneldoc that Matt spotted.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464375900-2542-1-git-send-email-chris@chris-wilson.co.uk
      490d3d1b
    • Gustavo Padovan's avatar
      drm/fence: add fence to drm_pending_event · 1b47aaf9
      Gustavo Padovan authored
      
      
      Now a drm_pending_event can either send a real drm_event or signal a
      fence, or both. It allow us to signal via fences when the buffer is
      displayed on the screen. Which in turn means that the previous buffer
      is not in use anymore and can be freed or sent back to another driver
      for processing.
      
      v2: Comments from Daniel Vetter
      	- call fence_signal in drm_send_event_locked()
      	- remove unneeded !e->event check
      
      v3: Remove drm_pending_event->destroy to fix a leak when e->file_priv
      is not set.
      
      Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
      Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> (v2)
      [danvet: fix one e->destroy in arcpgu due to rebasing.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-13-git-send-email-daniel.vetter@ffwll.ch
      1b47aaf9
  4. Jun 02, 2016
    • Daniel Vetter's avatar
      drm/atomic-docs: Spelling fixups · 60c9e190
      Daniel Vetter authored
      Eric nicely pointed these out, but I failed at git add and lost them.
      This fixes up
      
      commit 2f196b7c
      
      
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Jun 2 16:21:44 2016 +0200
      
          drm/atomic: Add drm_atomic_crtc_state_for_each_plane_state
      
      to actually do what it says on the tin^Wcommit message.
      
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      60c9e190
    • Daniel Vetter's avatar
      drm: Consolidate crtc arrays in drm_atomic_state · 5d943aa6
      Daniel Vetter authored
      
      
      It's silly to have 2 mallocs when we could tie these two together.
      
      Also, Gustavo adds another one in his per-crtc out-fence patches. And
      I want to add more stuff here for nonblocking commit helpers.
      
      In the future we can use this to store a pointer to the preceeding
      state, making an atomic update entirely free-standing. This will be
      needed to be able to queue them up with a depth > 1.
      
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-12-git-send-email-daniel.vetter@ffwll.ch
      5d943aa6
    • Daniel Vetter's avatar
      drm: Consolidate plane arrays in drm_atomic_state · b8b5342b
      Daniel Vetter authored
      
      
      It's kinda pointless to have 2 separate mallocs for these. And when we
      add more per-plane state in the future it's even more pointless.
      
      Right now there's no such thing planned, but both Gustavo's per-crtc
      fence patches, and some nonblocking commit helpers I'm playing around
      with will add more per-crtc stuff. It makes sense to also consolidate
      planes, just for consistency.
      
      In the future we can use this to store a pointer to the preceeding
      state, making an atomic update entirely free-standing. This will be
      needed to be able to queue them up with a depth > 1.
      
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-11-git-send-email-daniel.vetter@ffwll.ch
      b8b5342b
    • Daniel Vetter's avatar
      drm: Consolidate connector arrays in drm_atomic_state · 63e83c1d
      Daniel Vetter authored
      
      
      It's kinda pointless to have 2 separate mallocs for these. And when we
      add more per-connector state in the future it's even more pointless.
      
      Right now there's no such thing planned, but both Gustavo's per-crtc
      fence patches, and some nonblocking commit helpers I'm playing around
      with will add more per-crtc stuff. It makes sense to also consolidate
      connectors, just for consistency.
      
      In the future we can use this to store a pointer to the preceeding
      state, making an atomic update entirely free-standing. This will be
      needed to be able to queue them up with a depth > 1.
      
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-10-git-send-email-daniel.vetter@ffwll.ch
      63e83c1d
    • Daniel Vetter's avatar
      drm/atomic: Add drm_atomic_crtc_state_for_each_plane_state · 2f196b7c
      Daniel Vetter authored
      
      
      ... and use it in msm&vc4. Again just want to encapsulate
      drm_atomic_state internals a bit.
      
      The const threading is a bit awkward in vc4 since C sucks, but I still
      think it's worth to enforce this. Eventually I want to make all the
      obj->state pointers const too, but that's a lot more work ...
      
      v2: Provide safe macro to wrap up the unsafe helper better, suggested
      by Maarten.
      
      v3: Fixup subject (Maarten) and spelling fixes (Eric Engestrom).
      
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Eric Engestrom <eric.engestrom@imgtec.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464877304-4213-1-git-send-email-daniel.vetter@ffwll.ch
      2f196b7c
    • Daniel Vetter's avatar
      drm/doc: Appease sphinx · 2e7a5701
      Daniel Vetter authored
      
      
      Mostly this is unexpected indents. But really it's just a
      demonstration for my patch, all these issues have been found&fixed
      using the correct source file and line number support I just added.
      All line numbers have been perfectly accurate.
      
      One issue looked a bit fishy in intel_lrc.c, where I don't quite grok
      what sphinx is unhappy about. But since that file looks like it has
      never seen a proper kernel-doc parser I figured better to fix in a
      separate path.
      
      v2: Use fancy new &drm_device->struct_mutex linking (Jani).
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: linux-doc@vger.kernel.org
      Cc: Jonathan Corbet <corbet@lwn.net>
      Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      2e7a5701
    • Daniel Vetter's avatar
      drm/exynos: Use for_each_crtc_in_state · 8e01550e
      Daniel Vetter authored
      
      
      We want to hide drm_atomic_state internals better.
      
      v2: Use drm_crtc_mask (Maarten).
      
      Cc: Inki Dae <inki.dae@samsung.com>
      Acked-by: default avatarInki Dae <inki.dae@samsung.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-8-git-send-email-daniel.vetter@ffwll.ch
      8e01550e
    • Daniel Vetter's avatar
      drm/omap: Use for_each_plane_in_state · 82072573
      Daniel Vetter authored
      
      
      We want to hide drm_atomic_stat internals a bit better.
      
      v2: Use drm_crtc_mask (Maarten).
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-7-git-send-email-daniel.vetter@ffwll.ch
      82072573
    • Daniel Vetter's avatar
      drm/vc4: Use for_each_plane_in_state · 833cd78a
      Daniel Vetter authored
      
      
      We want to hide drm_atomic_stat internals a bit better.
      
      Cc: Eric Anholt <eric@anholt.net>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-6-git-send-email-daniel.vetter@ffwll.ch
      833cd78a
    • Daniel Vetter's avatar
      drm/rcar-du: Use for_each_*_in_state · 09ad807b
      Daniel Vetter authored
      
      
      We want to hide drm_atomic_state internals better.
      
      v2: Use drm_crtc_mask (Maarten).
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-5-git-send-email-daniel.vetter@ffwll.ch
      09ad807b
    • Daniel Vetter's avatar
      drm/msm: Use for_each_*_in_state · 8d76b79f
      Daniel Vetter authored
      
      
      We want to hide drm_atomic_state internals
      
      v2: Review from Maarten:
      - remove whitespace change in rockchip driver that slipped in.
      - use drm_crtc_mask insted of open-coding it.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-4-git-send-email-daniel.vetter@ffwll.ch
      8d76b79f
    • Daniel Vetter's avatar
      drm/i915: Use drm_atomic_get_existing_plane_state · 831655e5
      Daniel Vetter authored
      
      
      We want to encapsulate the drm_atomic_state internals.
      
      v2: Use intel_atomic_get_existing_plane_state (Maarten).
      
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-3-git-send-email-daniel.vetter@ffwll.ch
      831655e5
    • Daniel Vetter's avatar
      drm/hdlcd: Clean up crtc hooks · 9fb3fc70
      Daniel Vetter authored
      
      
      Those are all no longer needed for a pure atomic driver.
      
      Cc: Liviu Dudau <Liviu.Dudau@arm.com>
      Tested-by: default avatarLiviu Dudau <Liviu.Dudau@arm.com>
      Acked-by: default avatarLiviu Dudau <Liviu.Dudau@arm.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-17-git-send-email-daniel.vetter@ffwll.ch
      9fb3fc70
    • Daniel Vetter's avatar
      drm/atomic-helper: use for_each_*_in_state more · be9174a4
      Daniel Vetter authored
      
      
      This avois leaking drm_atomic_state internals into the helpers. The
      only place where this still happens after this patch is drm_atomic_helper_swap_state().
      It's unavoidable there, and maybe a good indicator we should actually
      move that function into drm_atomic.c.
      
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-2-git-send-email-daniel.vetter@ffwll.ch
      be9174a4
    • Chris Wilson's avatar
      drm: Only create a cmdline mode if no probed modes match · 5f0c3f99
      Chris Wilson authored
      The intention of using video=<connector>:<mode> is primarily to select
      the user's preferred resolution at startup. Currently we always create a
      new mode irrespective of whether the monitor has a native mode at the
      desired resolution. This has the issue that we may then select the fake
      mode rather the native mode during fb_helper->inital_config() and so
      if the fake mode is invalid we then end up with a loss of signal. Oops.
      This invalid fake mode would also be exported to userspace, who
      potentially may make the same mistake.
      
      To avoid this issue, we filter out the added command line mode if we
      detect the desired resolution (and clock if specified) amongst the
      probed modes. This fixes the immediate problem of adding a duplicate
      mode, but perhaps more generically we should avoid adding a GTF mode if
      the monitor has an EDID that is not GTF-compatible, or similarly for
      CVT.
      
      Was meant to fix a regression from
      
      commit eaf99c74
      
      
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Wed Aug 6 10:08:32 2014 +0200
      
          drm: Perform cmdline mode parsing during connector initialisation
      
      but Radek explained that the original bug is no longer reproducible on
      latest kernels.
      
      v2: Explicitly delete our earlier cmdline mode
      v3: Mode pruning should now be sufficient to delete stale cmdline modes
      v4: Compute the vrefresh for the probed mode
      
      Reported-by: default avatarRadek Dostál <rd@radekdostal.com>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Radek Dostál <rd@radekdostal.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Cc: Julia Lemire <jlemire@matrox.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      [danvet: Drop cc: stable since no longer a pressing bugfix, just
      nice-to-have.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464774651-20376-1-git-send-email-chris@chris-wilson.co.uk
      5f0c3f99
    • Christian König's avatar
      dma-buf/fence: add signal_on_any to the fence array v2 · f7104568
      Christian König authored
      
      
      If @signal_on_any is true the fence array signals if any fence in the array
      signals, otherwise it signals when all fences in the array signal.
      
      v2: fix signaled test and add comment suggested by Chris Wilson.
      
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Acked-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464786612-5010-4-git-send-email-deathsimple@vodafone.de
      f7104568
    • Gustavo Padovan's avatar
      dma-buf/fence: add fence_array fences v6 · b3dfbdf2
      Gustavo Padovan authored
      
      
      struct fence_array inherits from struct fence and carries a
      collection of fences that needs to be waited together.
      
      It is useful to translate a sync_file to a fence to remove the complexity
      of dealing with sync_files on DRM drivers. So even if there are many
      fences in the sync_file that needs to waited for a commit to happen,
      they all get added to the fence_collection and passed for DRM use as
      a standard struct fence.
      
      That means that no changes needed to any driver besides supporting fences.
      
      To avoid fence_array's fence allocates a new timeline if needed (when
      combining fences from different timelines).
      
      v2: Comments by Daniel Vetter:
      	- merge fence_collection_init() and fence_collection_add()
      	- only add callbacks at ->enable_signalling()
      	- remove fence_collection_put()
      	- check for type on to_fence_collection()
      	- adjust fence_is_later() and fence_later() to WARN_ON() if they
      	are used with collection fences.
      
      v3: - Initialize fence_cb.node at fence init.
      
          Comments by Chris Wilson:
      	- return "unbound" on fence_collection_get_timeline_name()
      	- don't stop adding callbacks if one fails
      	- remove redundant !! on fence_collection_enable_signaling()
      	- remove redundant () on fence_collection_signaled
      	- use fence_default_wait() instead
      
      v4 (chk): Rework, simplification and cleanup:
      	- Drop FENCE_NO_CONTEXT handling, always allocate a context.
      	- Rename to fence_array.
      	- Return fixed driver name.
      	- Register only one callback at a time.
      	- Document that create function takes ownership of array.
      
      v5 (chk): More work and fixes:
      	- Avoid deadlocks by adding all callbacks at once again.
      	- Stop trying to remove the callbacks.
      	- Provide context and sequence number for the array fence.
      
      v6 (chk): Fixes found during testing
      	- Fix stupid typo in _enable_signaling().
      
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Acked-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      [danvet: Improve commit message as suggested by Gustavo.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464786612-5010-3-git-send-email-deathsimple@vodafone.de
      b3dfbdf2