1. 23 11月, 2017 1 次提交
  2. 25 10月, 2017 1 次提交
    • K
      drm: Check mode object lease status in all master ioctl paths [v4] · 7de440db
      Keith Packard 提交于
      Attempts to modify un-leased objects are rejected with an error.
      Information returned about unleased objects is modified to make them
      appear unusable and/or disconnected.
      
      Changes for v2 as suggested by Daniel Vetter <daniel.vetter@ffwll.ch>:
      
       * With the change in the __drm_mode_object_find API to pass the
         file_priv along, we can now centralize most of the lease-based
         access checks in that function.
      
       * A few places skip that API and require in-line checks.
      
      Changes for v3 provided by Dave Airlie <airlied@redhat.com>
      
       * remove support for leasing encoders.
       * add support for leasing planes.
      
      Changes for v4
      
       * Only call drm_lease_held if DRIVER_MODESET.
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      7de440db
  3. 21 10月, 2017 1 次提交
    • K
      drm: Reorganize drm_pending_event to support future event types [v2] · bd386e51
      Keith Packard 提交于
      Place drm_event_vblank in a new union that includes that and a bare
      drm_event structure. This will allow new members of that union to be
      added in the future without changing code related to the existing vbl
      event type.
      
      Assignments to the crtc_id field are now done when the event is
      allocated, rather than when delievered. This way, delivery doesn't
      need to have the crtc ID available.
      
      v2:
       * Remove 'dev' argument from create_vblank_event
      
      	It wasn't being used anyways, and if we need it in the future,
      	we can always get it from crtc->dev.
      
       * Check for MODESETTING before looking for crtc in queue_vblank_event
      
      	UMS drivers will oops if we try to get a crtc, so make sure
      	we're modesetting before we try to find a crtc_id to fill into
      	the event.
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      (cherry picked from commit dc695b85fde88eca3ef3b03fcd82f15b6bc6e462)
      bd386e51
  4. 17 10月, 2017 1 次提交
  5. 12 10月, 2017 1 次提交
  6. 13 9月, 2017 3 次提交
  7. 14 8月, 2017 1 次提交
  8. 09 8月, 2017 1 次提交
  9. 08 8月, 2017 2 次提交
    • D
      drm: Handle properties in the core for atomic drivers · 144a7999
      Daniel Vetter 提交于
      The reason behind the original indirection through the helper
      functions was to allow existing drivers to overwrite how they handle
      properties. For example when a vendor-specific userspace had
      expectations that didn't match atomic. That seemed likely, since
      atomic is standardizing a _lot_ more of the behaviour of a kms driver.
      
      But 20 drivers later there's no such need at all. Worse, this forces
      all drivers to hook up the default behaviour, breaking userspace if
      they forget to do that. And it forces us to export a bunch of core
      function just for those helpers.
      
      And finally, these helpers are the last places using
      drm_atomic_legacy_backoff() and the implicit acquire_ctx.
      
      This patch here just implements the new behaviour and updates the
      docs. Follow-up patches will garbage-collect all the dead code.
      
      v2: Fixup docs even better!
      
      v3: Make it actually work ...
      
      v4: Drop the uses_atomic_modeset() checks from the previous patch
      again, since they're now moved up in the callchain.
      
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: Archit Taneja <architt@codeaurora.org> (v3)
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170725120204.2107-1-daniel.vetter@ffwll.ch
      144a7999
    • D
      drm: Don't update property values for atomic drivers · 4a97a3da
      Daniel Vetter 提交于
      Atomic drivers only use the property value store for immutable (i.e.
      can't be set by userspace, but the kernel can still adjust it)
      properties. The only tricky part is the removal of the update in
      drm_atomic_helper_update_legacy_modeset_state().
      
      This was added in
      
      commit 8c10342c (tag: topic/drm-misc-2015-07-28)
      Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Date:   Mon Jul 27 13:24:29 2015 +0200
      
          drm/atomic: Update legacy DPMS state during modesets, v3.
      
      by copying it from the i915 code, where it was originally added in
      
      commit 68d34720
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Sep 6 22:08:35 2012 +0200
      
          drm/i915: update dpms property in set_mode
      
      for the legacy modeset code. The reason we needed this hack was that
      i915 didn't yet set DRIVER_ATOMIC, and we checked for that instead of
      the newer-ish drm_drv_uses_atomic_modeset(), which avoids such
      troubles. With the correct feature checks this isn't needed anymore at
      all.
      
      Also make sure that drivers don't accidentally get this wrong by
      making the exported version of drm_object_property_get_value() only
      work for legacy drivers. Only gma500 uses it anyway.
      
      v2: Fixup the uses_atomic_modeset() checks (Maarten)
      
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170725120137.1903-1-daniel.vetter@ffwll.ch
      4a97a3da
  10. 02 8月, 2017 2 次提交
    • B
      drm: Create a format/modifier blob · db1689aa
      Ben Widawsky 提交于
      Updated blob layout (Rob, Daniel, Kristian, xerpi)
      
      v2:
      * Removed __packed, and alignment (.+)
      * Fix indent in drm_format_modifier fields (Liviu)
      * Remove duplicated modifier > 64 check (Liviu)
      * Change comment about modifier (Liviu)
      * Remove arguments to blob creation, use plane instead (Liviu)
      * Fix data types (Ben)
      * Make the blob part of uapi (Daniel)
      
      v3:
      Remove unused ret field.
      Change i, and j to unsigned int (Emil)
      
      v4:
      Use plane->modifier_count instead of recounting (Daniel)
      
      v5:
      Rename modifiers to modifiers_property (Ville)
      Use sizeof(__u32) instead to reflect UAPI nature (Ville)
      Make BUILD_BUG_ON for blob header size
      
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Kristian H. Kristensen <hoegsberg@gmail.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: Daniel Stone <daniels@collabora.com> (v2)
      Reviewed-by: Liviu Dudau <liviu@dudau.co.uk> (v2)
      Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (v3)
      Signed-off-by: NDaniel Stone <daniels@collabora.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170724034641.13369-2-ben@bwidawsk.net
      db1689aa
    • B
      drm: Plumb modifiers through plane init · e6fc3b68
      Ben Widawsky 提交于
      This is the plumbing for supporting fb modifiers on planes. Modifiers
      have already been introduced to some extent, but this series will extend
      this to allow querying modifiers per plane. Based on this, the client to
      enable optimal modifications for framebuffers.
      
      This patch simply allows the DRM drivers to initialize their list of
      supported modifiers upon initializing the plane.
      
      v2: A minor addition from Daniel
      
      v3:
      * Updated commit message
      * s/INVALID/DRM_FORMAT_MOD_INVALID (Liviu)
      * Remove some excess newlines (Liviu)
      * Update comment for > 64 modifiers (Liviu)
      
      v4: Minor comment adjustments (Liviu)
      
      v5: Some new platforms added due to rebase
      
      v6: Add some missed plane inits (or maybe they're new - who knows at
      this point) (Daniel)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: Daniel Stone <daniels@collabora.com> (v2)
      Reviewed-by: NLiviu Dudau <Liviu.Dudau@arm.com>
      Signed-off-by: NDaniel Stone <daniels@collabora.com>
      e6fc3b68
  11. 23 5月, 2017 1 次提交
  12. 08 4月, 2017 1 次提交
  13. 05 4月, 2017 1 次提交
  14. 31 3月, 2017 2 次提交
  15. 29 3月, 2017 8 次提交
  16. 28 2月, 2017 2 次提交
  17. 25 1月, 2017 1 次提交
  18. 09 1月, 2017 1 次提交
  19. 30 12月, 2016 1 次提交
  20. 15 12月, 2016 2 次提交
    • V
      drm: Replace 'format->format' comparisons to just 'format' comparisons · dbd4d576
      Ville Syrjälä 提交于
      Rather than compare the format u32s of two format infos, we can direclty
      compare the format info pointers themselves. Noramlly all the ->format
      pointers all point to somwehere in the big array, so this is a valid
      way to test for equality.
      
      Also drivers may want to point ->format at a private format info struct
      instead (eg. for special compressed formats with extra planes), so
      just comparing the pixel format values wouldn't necessaritly even work.
      But comparing the pointers will also take care of that case.
      
      @@
      struct drm_framebuffer *a;
      struct drm_framebuffer *b;
      @@
      (
      - a->format->format != b->format->format
      + a->format != b->format
      |
      - a->format->format == b->format->format
      + a->format == b->format
      )
      
      @@
      struct drm_plane_state *a;
      struct drm_plane_state *b;
      @@
      (
      - a->fb->format->format != b->fb->format->format
      + a->fb->format != b->fb->format
      |
      - a->fb->format->format == b->fb->format->format
      + a->fb->format == b->fb->format
      )
      
      @@
      struct drm_crtc *crtc;
      struct drm_framebuffer *x;
      @@
      (
      - crtc->primary->fb->format->format != x->format->format
      + crtc->primary->fb->format != x->format
      |
      - x->format->format != crtc->primary->fb->format->format
      + x->format != crtc->primary->fb->format
      )
      
      @@
      struct drm_mode_set *set;
      @@
      - set->fb->format->format != set->crtc->primary->fb->format->format
      + set->fb->format != set->crtc->primary->fb->format
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Suggested-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-35-git-send-email-ville.syrjala@linux.intel.comReviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      dbd4d576
    • 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
  21. 14 12月, 2016 1 次提交
  22. 08 12月, 2016 1 次提交
  23. 30 11月, 2016 1 次提交
  24. 16 11月, 2016 1 次提交
    • 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
  25. 12 11月, 2016 1 次提交
  26. 04 10月, 2016 1 次提交