1. 17 11月, 2016 30 次提交
  2. 16 11月, 2016 10 次提交
    • 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
    • P
      drm/i915/bxt: Broxton decoupled MMIO · 85ee17eb
      Praveen Paneri 提交于
      Decoupled MMIO is an alternative way to access forcewake domain
      registers, which requires less cycles for a single read/write and
      avoids frequent software forcewake.
      This certainly gives advantage over the forcewake as this new
      mechanism “decouples” CPU cycles and allow them to complete even
      when GT is in a CPD (frequency change) or C6 state.
      
      This can co-exist with forcewake and we will continue to use forcewake
      as appropriate. E.g. 64-bit register writes to avoid writing 2 dwords
      separately and land into funny situations.
      
      v2:
      - Moved platform check out of the function and got rid of duplicate
       functions to find out decoupled power domain (Chris)
      - Added a check for forcewake already held and skipped decoupled
       access (Chris)
      - Skipped writing 64 bit registers through decoupled MMIO (Chris)
      
      v3:
      - Improved commit message with more info on decoupled mmio (Tvrtko)
      - Changed decoupled operation to enum and used u32 instead of
       uint_32 data type for register offset (Tvrtko)
      - Moved HAS_DECOUPLED_MMIO to device info (Tvrtko)
      - Added lookup table for converting fw_engine to pd_engine (Tvrtko)
      - Improved __gen9_decoupled_read and __gen9_decoupled_write
       routines (Tvrtko)
      
      v4:
      - Fixed alignment and variable names (Chris)
      - Write GEN9_DECOUPLED_REG0_DW1 register in just one go (Zhe Wang)
      
      v5:
      - Changed HAS_DECOUPLED_MMIO() argument name to dev_priv (Tvrtko)
      - Sanitize info->had_decoupled_mmio at init (Chris)
      Signed-off-by: NZhe Wang <zhe1.wang@intel.com>
      Signed-off-by: NPraveen Paneri <praveen.paneri@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479230360-22395-1-git-send-email-praveen.paneri@intel.com
      85ee17eb
    • 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
    • J
      drm/bridge: analogix_dp: return error if transfer none byte · 19423ba7
      Jianqun Xu 提交于
      Reference from drm_dp_aux description (about transfer):
      Upon success, the implementation should return the number of payload bytes
      that were transferred, or a negative error-code on failure. Helpers
      propagate errors from the .transfer() function, with the exception of
      the -EBUSY error, which causes a transaction to be retried. On a short,
      helpers will return -EPROTO to make it simpler to check for failure.
      
      The analogix_dp_transfer will return num_transferred, but if there is none
      byte been transferred, the return value will be 0, which means success, we
      should return error-code if transfer none byte.
      
      for (retry = 0; retry < 32; retry++) {
      	err = aux->transfer(aux, &msg);
      	if (err < 0) {
      		if (err == -EBUSY)
      			continue;
      
      		goto unlock;
      	}
      }
      
      Cc: zain wang <wzz@rock-chips.com>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NJianqun Xu <jay.xu@rock-chips.com>
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Link: http://patchwork.freedesktop.org/patch/msgid/1479255219-7243-1-git-send-email-jay.xu@rock-chips.com
      19423ba7
    • P
      drm/i915/gvt: check workload empty before real scan · 0aaee4cc
      Pei Zhang 提交于
      This patch will fix warning log print during command scan caused by
      empty workload (ring head equals tail). This patch avoid going into
      real scan process if workload is empty. It's guest's responsibility
      to make sure if an empty workload is proper to submit to HW.
      
      [v2] modify the patch description. It's a fix, not a w/a.
      Signed-off-by: NPei Zhang <pei.zhang@intel.com>
      Signed-off-by: NZhenyu Wang <zhenyuw@linux.intel.com>
      0aaee4cc
    • D
      Merge tag 'sunxi-drm-for-4.10' of... · 4473904c
      Dave Airlie 提交于
      Merge tag 'sunxi-drm-for-4.10' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux into drm-next
      
      sun4i-drm changes for 4.10
      
      Support for the Allwinner A31 SoC display engine using the sun4i-drm
      driver.
      
      * tag 'sunxi-drm-for-4.10' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux:
        drm/sun4i: Add a few formats
        drm/sun4i: Add compatible strings for A31/A31s display pipelines
        drm/sun4i: Add compatible string for A31/A31s TCON (timing controller)
        drm/sun4i: tcon: Move SoC specific quirks to a DT matched data structure
        drm/sun4i: sun6i-drc: Support DRC on A31 and A31s
      4473904c
    • D
      Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/media into drm-next · 1a3865d6
      Dave Airlie 提交于
      rcar-du -next branch.
      
      * 'drm/next/du' of git://linuxtv.org/pinchartl/media:
        drm: rcar-du: Fix LVDS start sequence on Gen3
        drm: rcar-du: Fix H/V sync signal polarity configuration
        drm: rcar-du: Fix display timing controller parameter
        drm: rcar-du: Fix dot clock routing configuration
        drm: rcar-du: Add R8A7796 support
        drm: rcar-du: Add R8A7792 support
        drm: rcar-du: Simplify and fix probe error handling
        drm: rcar-du: Fix crash in encoder failure error path
        drm: rcar-du: Remove memory allocation error message
        drm: rcar-du: Remove test for impossible error condition
        drm: rcar-du: Bring HDMI encoder comments in line with the driver
        drm: rcar-du: Constify node argument to rcar_du_lvds_connector_init()
        video: of: Constify node argument to display timing functions
      1a3865d6
    • 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