1. 27 12月, 2016 2 次提交
  2. 20 12月, 2016 1 次提交
  3. 19 12月, 2016 1 次提交
  4. 18 12月, 2016 9 次提交
  5. 16 12月, 2016 2 次提交
  6. 15 12月, 2016 6 次提交
    • 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
    • V
      drm: Nuke fb->bits_per_pixel · 272725c7
      Ville Syrjälä 提交于
      Replace uses of fb->bits_per_pixel with fb->format->cpp[0]*8.
      Less duplicated information is a good thing.
      
      Note that I didn't put parens around the cpp*8 in the below cocci script,
      on account of not wanting spurious parens all over the place. Instead I
      did the unsafe way, and tried to look over the entire diff to spot if
      any dangerous expressions were produced. I didn't see any.
      
      There are some cases where previously the code did X*bpp/8, so the
      division happened after the multiplication. Those are now just X*cpp
      so the division effectively happens before the multiplication,
      but that is perfectly fine since bpp is always a multiple of 8.
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       drm_helper_mode_fill_fb_struct(...) {
      	...
      -	FB->bits_per_pixel = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       i9xx_get_initial_plane_config(...) {
      	...
      -	FB->bits_per_pixel = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       ironlake_get_initial_plane_config(...) {
      	...
      -	FB->bits_per_pixel = E;
      	...
       }
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
       skylake_get_initial_plane_config(...) {
      	...
      -	FB->bits_per_pixel = E;
      	...
       }
      
      @@
      struct drm_framebuffer FB;
      expression E;
      @@
      (
      - E * FB.bits_per_pixel / 8
      + E * FB.format->cpp[0]
      |
      - FB.bits_per_pixel / 8
      + FB.format->cpp[0]
      |
      - E * FB.bits_per_pixel >> 3
      + E * FB.format->cpp[0]
      |
      - FB.bits_per_pixel >> 3
      + FB.format->cpp[0]
      |
      - (FB.bits_per_pixel + 7) / 8
      + FB.format->cpp[0]
      |
      - FB.bits_per_pixel
      + FB.format->cpp[0] * 8
      |
      - FB.format->cpp[0] * 8 != 8
      + FB.format->cpp[0] != 1
      )
      
      @@
      struct drm_framebuffer *FB;
      expression E;
      @@
      (
      - E * FB->bits_per_pixel / 8
      + E * FB->format->cpp[0]
      |
      - FB->bits_per_pixel / 8
      + FB->format->cpp[0]
      |
      - E * FB->bits_per_pixel >> 3
      + E * FB->format->cpp[0]
      |
      - FB->bits_per_pixel >> 3
      + FB->format->cpp[0]
      |
      - (FB->bits_per_pixel + 7) / 8
      + FB->format->cpp[0]
      |
      - FB->bits_per_pixel
      + FB->format->cpp[0] * 8
      |
      - FB->format->cpp[0] * 8 != 8
      + FB->format->cpp[0] != 1
      )
      
      @@
      struct drm_plane_state *state;
      expression E;
      @@
      (
      - E * state->fb->bits_per_pixel / 8
      + E * state->fb->format->cpp[0]
      |
      - state->fb->bits_per_pixel / 8
      + state->fb->format->cpp[0]
      |
      - E * state->fb->bits_per_pixel >> 3
      + E * state->fb->format->cpp[0]
      |
      - state->fb->bits_per_pixel >> 3
      + state->fb->format->cpp[0]
      |
      - (state->fb->bits_per_pixel + 7) / 8
      + state->fb->format->cpp[0]
      |
      - state->fb->bits_per_pixel
      + state->fb->format->cpp[0] * 8
      |
      - state->fb->format->cpp[0] * 8 != 8
      + state->fb->format->cpp[0] != 1
      )
      
      @@
      @@
      - (8 * 8)
      + 8 * 8
      
      @@
      struct drm_framebuffer FB;
      @@
      - (FB.format->cpp[0])
      + FB.format->cpp[0]
      
      @@
      struct drm_framebuffer *FB;
      @@
      - (FB->format->cpp[0])
      + FB->format->cpp[0]
      
      @@
      @@
       struct drm_framebuffer {
      	 ...
      -	 int bits_per_pixel;
      	 ...
       };
      
      v2: Clean up the 'cpp*8 != 8' and '(8 * 8)' cases (Laurent)
      v3: Adjusted the semantic patch a bit and regenerated due to code
          changes
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
      Link: http://patchwork.freedesktop.org/patch/msgid/1481751140-18352-1-git-send-email-ville.syrjala@linux.intel.com
      272725c7
    • V
      drm: Nuke fb->depth · b00c600e
      Ville Syrjälä 提交于
      Replace uses of fb->depth with fb->format->depth. Less duplicate
      information is a good thing.
      
      @@
      struct drm_framebuffer *fb;
      expression E;
      @@
       drm_helper_mode_fill_fb_struct(...) {
      	...
      -	fb->depth = E;
      	...
       }
      
      @@
      struct nouveau_framebuffer *fb;
      @@
      - fb->base.depth
      + fb->base.format->depth
      
      @@
      struct drm_framebuffer fb;
      @@
      - fb.depth
      + fb.format->depth
      
      @@
      struct drm_framebuffer *fb;
      @@
      - fb->depth
      + fb->format->depth
      
      @@
      struct drm_framebuffer fb;
      @@
      - (fb.format->depth)
      + fb.format->depth
      
      @@
      struct drm_framebuffer *fb;
      @@
      - (fb->format->depth)
      + fb->format->depth
      
      @@
      @@
       struct drm_framebuffer {
      	 ...
      -	 unsigned int depth;
      	 ...
       };
      
      v2: Drop the vmw stuff (Daniel)
          Rerun spatch due to code changes
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1481751095-18249-1-git-send-email-ville.syrjala@linux.intel.com
      b00c600e
    • V
      drm: Add drm_framebuffer_plane_{width,height}() · 8f8f6a6c
      Ville Syrjälä 提交于
      Add variants of drm_format_plane_{width,height}() that take an entire fb
      object instead of just the format. These should be more efficent as they
      can just look up the format info from the fb->format pointer rather than
      having to look it up (using a linear search based on the format).
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-30-git-send-email-ville.syrjala@linux.intel.com
      8f8f6a6c
    • V
      drm: Store a pointer to drm_format_info under drm_framebuffer · e14c23c6
      Ville Syrjälä 提交于
      To avoid having to look up the format information struct every time,
      let's just store a pointer to it under drm_framebuffer.
      
      v2: Don't populate the fb->format pointer in drm_framebuffer_init().
          instead we'll treat a NULL format as an error later
      
      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)
      Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-20-git-send-email-ville.syrjala@linux.intel.comReviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      e14c23c6
    • V
      drm: Pass 'dev' to drm_helper_mode_fill_fb_struct() · a3f913ca
      Ville Syrjälä 提交于
      Pass the drm_device to drm_helper_mode_fill_fb_struct() so that we can
      populate fb->dev early. Will make it easier to use the fb before we
      register it.
      
      @@
      identifier fb, mode_cmd;
      @@
       void drm_helper_mode_fill_fb_struct(
      +				     struct drm_device *dev,
      				     struct drm_framebuffer *fb,
      				     const struct drm_mode_fb_cmd2 *mode_cmd
      				     );
      
      @@
      identifier fb, mode_cmd;
      @@
       void drm_helper_mode_fill_fb_struct(
      +				     struct drm_device *dev,
      				     struct drm_framebuffer *fb,
      				     const struct drm_mode_fb_cmd2 *mode_cmd
      				     )
      { ... }
      
      @@
      function func;
      identifier dev;
      expression E1, E2;
      @@
      func(struct drm_device *dev, ...)
      {
       ...
       drm_helper_mode_fill_fb_struct(
      +				dev,
      				E1, E2);
       ...
      }
      
      @@
      expression E1, E2;
      @@
       drm_helper_mode_fill_fb_struct(
      +				dev,
      				E1, E2);
      
      v2: Rerun spatch due to code changes
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1481748539-18283-1-git-send-email-ville.syrjala@linux.intel.com
      a3f913ca
  7. 13 12月, 2016 1 次提交
  8. 10 12月, 2016 1 次提交
  9. 08 12月, 2016 1 次提交
  10. 01 12月, 2016 1 次提交
  11. 29 11月, 2016 1 次提交
  12. 28 11月, 2016 2 次提交
  13. 25 11月, 2016 1 次提交
  14. 24 11月, 2016 1 次提交
  15. 22 11月, 2016 2 次提交
  16. 17 11月, 2016 1 次提交
  17. 16 11月, 2016 6 次提交
    • 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 fence timeline to drm_crtc · 6d6003c4
      Gustavo Padovan 提交于
      Create one timeline context for each CRTC to be able to handle out-fences
      and signal them. It adds a few members to struct drm_crtc: fence_context,
      where we store the context we get from fence_context_alloc(), the
      fence seqno and the fence lock, that we pass in fence_init() to be
      used by the fence.
      
      v2: Comment by Daniel Stone:
      	- add BUG_ON() to fence_to_crtc() macro
      
      v3: Comment by Ville Syrjälä
      	- Use more meaningful name as crtc timeline name
      
      v4: Comments by Brian Starkey
      	- Use even more meaninful name for the crtc timeline
      	- add doc for timeline_name
          Comment by Daniel Vetter
      	- use in-line style for comments
      
          - rebase after fence -> dma_fence rename
      
      v5: Comment by Daniel Vetter
      	- Add doc for drm_crtc_fence_ops
      
      v6: Comment by Chris Wilson
      	- Move fence_to_crtc to drm_crtc.c
      	- Move export of drm_crtc_fence_ops to drm_crtc_internal.h
      
          - rebase against latest drm-misc
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v5)
      Reviewed-by: Sean Paul <seanpaul@chromium.org> (v5)
      Tested-by: Robert Foss <robert.foss@collabora.com> (v5)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479220628-10204-1-git-send-email-gustavo@padovan.org
      6d6003c4
    • 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
    • D
      drm: drm_irq.h header cleanup · b9876d50
      Daniel Vetter 提交于
      - Drop extern for functions, it's noise.
      - Move&consolidate drm.ko internal parts into drm-internal.h.
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161114090255.31595-6-daniel.vetter@ffwll.ch
      b9876d50
    • D
      drm/irq: Unexport drm_vblank_on/off · 2d1e331f
      Daniel Vetter 提交于
      Only remaining use was in amdgpu, and trivial to convert over to
      drm_crtc_vblank_* variants.
      
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161114090255.31595-5-daniel.vetter@ffwll.ch
      2d1e331f
    • D
      drm/irq: Make drm_vblank_pre/post_modeset internal · 07600c53
      Daniel Vetter 提交于
      Now that all drivers are switched over to drm_crtc_vblank_on/off we
      can relegate pre/post_modeset to the purely drm_irq.c internal role of
      supporting old ums userspace.
      
      As usual switch to the drm_legacy_ prefix to make it clear this is
      for old drivers only.
      
      v2: Rebase on top of Thierry's s/int crtc/unsigned int pipe/ changes.
      
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      07600c53
  18. 15 11月, 2016 1 次提交