12 Oct, 2016

1 commit

  • Pull drm updates from Dave Airlie:
    "Core:
    - Fence destaging work
    - DRIVER_LEGACY to split off legacy drm drivers
    - drm_mm refactoring
    - Splitting drm_crtc.c into chunks and documenting better
    - Display info fixes
    - rbtree support for prime buffer lookup
    - Simple VGA DAC driver

    Panel:
    - Add Nexus 7 panel
    - More simple panels

    i915:
    - Refactoring GEM naming
    - Refactored vma/active tracking
    - Lockless request lookups
    - Better stolen memory support
    - FBC fixes
    - SKL watermark fixes
    - VGPU improvements
    - dma-buf fencing support
    - Better DP dongle support

    amdgpu:
    - Powerplay for Iceland asics
    - Improved GPU reset support
    - UVD/VEC powergating support for CZ/ST
    - Preinitialised VRAM buffer support
    - Virtual display support
    - Initial SI support
    - GTT rework
    - PCI shutdown callback support
    - HPD IRQ storm fixes

    amdkfd:
    - bugfixes

    tilcdc:
    - Atomic modesetting support

    mediatek:
    - AAL + GAMMA engine support
    - Hook up gamma LUT
    - Temporal dithering support

    imx:
    - Pixel clock from devicetree
    - drm bridge support for LVDS bridges
    - active plane reconfiguration
    - VDIC deinterlacer support
    - Frame synchronisation unit support
    - Color space conversion support

    analogix:
    - PSR support
    - Better panel on/off support

    rockchip:
    - rk3399 vop/crtc support
    - PSR support

    vc4:
    - Interlaced vblank timing
    - 3D rendering CPU overhead reduction
    - HDMI output fixes

    tda998x:
    - HDMI audio ASoC support

    sunxi:
    - Allwinner A33 support
    - better TCON support

    msm:
    - DT binding cleanups
    - Explicit fence-fd support

    sti:
    - remove sti415/416 support

    etnaviv:
    - MMUv2 refactoring
    - GC3000 support

    exynos:
    - Refactoring HDMI DCC/PHY
    - G2D pm regression fix
    - Page fault issues with wait for vblank

    There is no nouveau work in this tree, as Ben didn't get a pull
    request in, and he was fighting moving to atomic and adding mst
    support, so maybe best it waits for a cycle"

    * tag 'drm-for-v4.9' of git://people.freedesktop.org/~airlied/linux: (1412 commits)
    drm/crtc: constify drm_crtc_index parameter
    drm/i915: Fix conflict resolution from backmerge of v4.8-rc8 to drm-next
    drm/i915/guc: Unwind GuC workqueue reservation if request construction fails
    drm/i915: Reset the breadcrumbs IRQ more carefully
    drm/i915: Force relocations via cpu if we run out of idle aperture
    drm/i915: Distinguish last emitted request from last submitted request
    drm/i915: Allow DP to work w/o EDID
    drm/i915: Move long hpd handling into the hotplug work
    drm/i915/execlists: Reinitialise context image after GPU hang
    drm/i915: Use correct index for backtracking HUNG semaphores
    drm/i915: Unalias obj->phys_handle and obj->userptr
    drm/i915: Just clear the mmiodebug before a register access
    drm/i915/gen9: only add the planes actually affected by ddb changes
    drm/i915: Allow PCH DPLL sharing regardless of DPLL_SDVO_HIGH_SPEED
    drm/i915/bxt: Fix HDMI DPLL configuration
    drm/i915/gen9: fix the watermark res_blocks value
    drm/i915/gen9: fix plane_blocks_per_line on watermarks calculations
    drm/i915/gen9: minimum scanlines for Y tile is not always 4
    drm/i915/gen9: fix the WaWmMemoryReadLatency implementation
    drm/i915/kbl: KBL also needs to run the SAGV code
    ...

    Linus Torvalds
     

22 Sep, 2016

1 commit

  • When merging sync_files there is a case when we can end up with only one
    fence in the merged sync_file: when all fences belong to the same
    timeline.

    So for this case a fence_array is not created instead we just assigned the
    fence to sync_file->fence. Then we do not use the fences array anymore nor
    does free it.

    This patch frees the array.

    Reported-by: Chris Wilson
    Reviewed-by: Chris Wilson
    Signed-off-by: Gustavo Padovan
    Signed-off-by: Sean Paul
    Link: http://patchwork.freedesktop.org/patch/msgid/1474442419-6040-1-git-send-email-gustavo@padovan.org

    Gustavo Padovan
     

20 Sep, 2016

1 commit

  • When we merge several fences, if all of them are signaled already, we
    still keep one of them. So instead of using add_fence(), which will not
    increase the refcount of signaled fences, we should explicitly call
    fence_get() for the fence we are keeping.

    This patch fixes a kernel panic that can be triggered by creating a fence
    that is expired (or increasing the timeline until it expires), then
    creating a merged fence out of it, and deleting the merged fence. This
    will make the original expired fence's refcount go to zero.

    Testcase: igt/sw_sync/sync_expired_merge
    Signed-off-by: Rafael Antognolli
    Reviewed-by: Chris Wilson
    Reviewed-by: Gustavo Padovan
    Signed-off-by: Sumit Semwal
    Link: http://patchwork.freedesktop.org/patch/msgid/1473966865-4508-1-git-send-email-rafael.antognolli@intel.com

    Rafael Antognolli
     

13 Sep, 2016

1 commit

  • If we being polled with a timeout of zero, a nonblocking busy query,
    we don't need to install any fence callbacks as we will not be waiting.
    As we only install the callback once, the overhead comes from the atomic
    bit test that also causes serialisation between threads.

    Signed-off-by: Chris Wilson
    Cc: Sumit Semwal
    Cc: Gustavo Padovan
    Cc: linux-media@vger.kernel.org
    Cc: dri-devel@lists.freedesktop.org
    Cc: linaro-mm-sig@lists.linaro.org
    Reviewed-by: Gustavo Padovan
    Signed-off-by: Sumit Semwal
    Link: http://patchwork.freedesktop.org/patch/msgid/20160829181613.30722-1-chris@chris-wilson.co.uk

    Chris Wilson
     

22 Aug, 2016

1 commit

  • Signed-off-by: Rob Clark
    [danvet: Mark up as function for proper cross-linking.]
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1471640134-30888-1-git-send-email-robdclark@gmail.com

    Rob Clark
     

17 Aug, 2016

1 commit

  • Fix dma-buf kernel-doc warning and 2 minor typos in
    fence_array_create().

    Fixes this warning:
    ..//drivers/dma-buf/fence-array.c:124: warning: No description found for
    parameter 'signal_on_any'

    Signed-off-by: Randy Dunlap
    Cc: Sumit Semwal
    Cc: linux-media@vger.kernel.org
    Cc: dri-devel@lists.freedesktop.org
    Cc: linaro-mm-sig@lists.linaro.org
    Signed-off-by: Sumit Semwal
    Link: http://patchwork.freedesktop.org/patch/msgid/224865a5-947d-9a28-c60a-18fa86bc9329@infradead.org

    Randy Dunlap
     

16 Aug, 2016

1 commit

  • Rendering operations to the dma-buf are tracked implicitly via the
    reservation_object (dmabuf->resv). This is used to allow poll() to
    wait upon outstanding rendering (or just query the current status of
    rendering). The dma-buf sync ioctl allows userspace to prepare the
    dma-buf for CPU access, which should include waiting upon rendering.
    (Some drivers may need to do more work to ensure that the dma-buf mmap
    is coherent as well as complete.)

    v2: Always wait upon the reservation object implicitly. We choose to do
    it after the native handler in case it can do so more efficiently.

    Testcase: igt/prime_vgem
    Testcase: igt/gem_concurrent_blit # *vgem*
    Signed-off-by: Chris Wilson
    Cc: Sumit Semwal
    Cc: Daniel Vetter
    Cc: Eric Anholt
    Cc: linux-media@vger.kernel.org
    Cc: dri-devel@lists.freedesktop.org
    Cc: linaro-mm-sig@lists.linaro.org
    Cc: linux-kernel@vger.kernel.org
    Reviewed-by: Daniel Vetter
    Signed-off-by: Sumit Semwal
    Link: http://patchwork.freedesktop.org/patch/msgid/1471275738-31994-1-git-send-email-chris@chris-wilson.co.uk

    Chris Wilson
     

15 Aug, 2016

1 commit

  • SW_SYNC allows to run tests on the sync_file framework via debugfs on

    /sync/sw_sync

    Opening and closing the file triggers creation and release of a sync
    timeline. To create fences on this timeline the SW_SYNC_IOC_CREATE_FENCE
    ioctl should be used. To increment the timeline value use SW_SYNC_IOC_INC.

    Also it exports Sync information on

    /sync/info

    Signed-off-by: Gustavo Padovan
    Reviewed-by: Eric Engestrom
    Signed-off-by: Greg Kroah-Hartman

    Gustavo Padovan
     

11 Aug, 2016

4 commits

  • Signalling doesn't need to be enabled at sync_file creation, it is only
    required if userspace waiting the fence to signal through poll().

    Thus we delay fence_add_callback() until poll is called. It only adds the
    callback the first time poll() is called. This avoid re-adding the same
    callback multiple times.

    v2: rebase and update to work with new fence support for sync_file

    v3: use atomic operation to set enabled and protect fence_add_callback()

    v4: use user bit from fence flags (comment from Chris Wilson)

    v5: use ternary if on poll return (comment from Chris Wilson)

    Signed-off-by: Gustavo Padovan
    Reviewed-by: Chris Wilson
    Signed-off-by: Sumit Semwal
    [sumits: remove unused var status]
    Link: http://patchwork.freedesktop.org/patch/msgid/1470404378-27961-1-git-send-email-gustavo@padovan.org

    Gustavo Padovan
     
  • Creates a function that given an sync file descriptor returns a
    fence containing all fences in the sync_file.

    v2: Comments by Daniel Vetter
    - Adapt to new version of fence_collection_init()
    - Hold a reference for the fence we return

    v3:
    - Adapt to use fput() directly
    - rename to sync_file_get_fence() as we always return one fence

    v4: Adapt to use fence_array

    v5: set fence through fence_get()

    Signed-off-by: Gustavo Padovan
    Reviewed-by: Chris Wilson
    Acked-by: Christian König
    Signed-off-by: Sumit Semwal

    Gustavo Padovan
     
  • Create sync_file->fence to abstract the type of fence we are using for
    each sync_file. If only one fence is present we use a normal struct fence
    but if there is more fences to be added to the sync_file a fence_array
    is created.

    This change cleans up sync_file a bit. We don't need to have sync_file_cb
    array anymore. Instead, as we always have one fence, only one fence
    callback is registered per sync_file.

    v2: Comments from Chris Wilson and Christian König
    - Not using fence_ops anymore
    - fence_is_array() was created to differentiate fence from fence_array
    - fence_array_teardown() is now exported and used under fence_is_array()
    - struct sync_file lost num_fences member

    v3: Comments from Chris Wilson and Christian König
    - struct sync_file lost status member in favor of fence_is_signaled()
    - drop use of fence_array_teardown()
    - use sizeof(*fence) to allocate only an array on fence pointers

    v4: Comments from Chris Wilson
    - use sizeof(*fence) to reallocate array
    - fix typo in comments
    - protect num_fences sum against overflows
    - use array->base instead of casting the to struct fence

    v5: fixes checkpatch warnings

    v6: fix case where all fences are signaled.

    Signed-off-by: Gustavo Padovan
    Reviewed-by: Chris Wilson
    Acked-by: Christian König
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Sumit Semwal

    Gustavo Padovan
     
  • Add helper to check if fence is array.

    v2: Comments from Chris Wilson
    - remove ternary if from ops comparison
    - add EXPORT_SYMBOL(fence_array_ops)

    Cc: Chris Wilson
    Cc: Christian König
    Signed-off-by: Gustavo Padovan
    Reviewed-by: Chris Wilson
    Reviewed-by: Christian König
    Signed-off-by: Sumit Semwal

    Gustavo Padovan
     

18 Jul, 2016

1 commit

  • If we fail to create the anon file, we need to remember to release the
    module reference on the owner.

    Signed-off-by: Chris Wilson
    Reviewed-by: Joonas Lahtinen
    Cc: Joonas Lahtinen
    Cc: Sumit Semwal
    Cc: Daniel Vetter
    Cc: linux-media@vger.kernel.org
    Cc: dri-devel@lists.freedesktop.org
    Cc: linaro-mm-sig@lists.linaro.org
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1468840582-21469-1-git-send-email-chris@chris-wilson.co.uk

    Chris Wilson
     

13 Jul, 2016

1 commit


21 Jun, 2016

3 commits

  • There is only a single user of dma_buf_debugfs_create_file() and that
    one got the function pointer cast wrong. With that one fixed, there is
    no need to have a wrapper for debugfs_create_file(), just call it
    directly.

    With no users left, we can remove dma_buf_debugfs_create_file().

    While at it, simplify the error handling in dma_buf_init_debugfs()
    slightly.

    Signed-off-by: Mathias Krause
    Cc: Sumit Semwal
    Cc: Daniel Vetter
    Reviewed-by: Daniel Vetter
    Signed-off-by: Sumit Semwal
    Link: http://patchwork.freedesktop.org/patch/msgid/1466339491-12639-2-git-send-email-minipli@googlemail.com

    Mathias Krause
     
  • Change the error handling in dma_buf_init_debugfs() to remove the
    "dma_buf" directory if creating the "bufinfo" file fails. No need to
    have an empty debugfs directory around.

    Signed-off-by: Mathias Krause
    Cc: Sumit Semwal
    Cc: Daniel Vetter
    Signed-off-by: Sumit Semwal

    Mathias Krause
     
  • The callback function dma_buf_describe() returns an int not void so the
    function pointer cast in dma_buf_show() is wrong. dma_buf_describe() can
    also fail when acquiring the mutex gets interrupted so always returning
    0 in dma_buf_show() is wrong, too.

    Fix both issues by avoiding the indirection via dma_buf_show() and call
    dma_buf_describe() directly. Rename it to dma_buf_debug_show() to get it
    in line with the other functions.

    This type mismatch was caught by the PaX RAP plugin.

    Signed-off-by: Mathias Krause
    Cc: Sumit Semwal
    Cc: Daniel Vetter
    Cc: Brad Spengler
    Cc: PaX Team
    Signed-off-by: Sumit Semwal

    Mathias Krause
     

09 Jun, 2016

1 commit

  • As promised, piles of prep work all around:
    - drm_atomic_state rework, prep for nonblocking commit helpers
    - fence patches from Gustavo and Christian to prep for atomic fences and
    some cool work in ttm/amdgpu from Christian
    - drm event prep for both nonblocking commit and atomic fences
    - Gustavo seems on a crusade against the non-kms-native version of the
    vblank functions.
    - prep work from Boris to nuke all the silly ->best_encoder
    implementations we have (we really only need that for truly dynamic
    cases like dvi-i vs dvi-d or dp mst selecting the right transcoder on
    intel)
    - prep work from Laurent to rework the format handling functions
    - and few small things all over

    * tag 'topic/drm-misc-2016-06-07' of git://anongit.freedesktop.org/drm-intel: (47 commits)
    drm/dsi: Implement set tear scanline
    drm/fb_cma_helper: Implement fb_mmap callback
    drm/qxl: Remove useless drm_fb_get_bpp_depth() call
    drm/ast: Remove useless drm_fb_get_bpp_depth() call
    drm/atomic: Fix remaining places where !funcs->best_encoder is valid
    drm/core: Change declaration for gamma_set.
    Documentation: add fence-array to kernel DocBook
    drm/shmobile: use drm_crtc_vblank_{get,put}()
    drm/radeon: use drm_crtc_vblank_{get,put}()
    drm/qxl: use drm_crtc_vblank_{get,put}()
    drm/atmel: use drm_crtc_vblank_{get,put}()
    drm/armada: use drm_crtc_vblank_{get,put}()
    drm/amdgpu: use drm_crtc_vblank_{get,put}()
    drm/virtio: use drm_crtc_send_vblank_event()
    drm/udl: use drm_crtc_send_vblank_event()
    drm/qxl: use drm_crtc_send_vblank_event()
    drm/atmel: use drm_crtc_send_vblank_event()
    drm/armada: use drm_crtc_send_vblank_event()
    drm/doc: Switch to sphinx/rst fixed-width quoting
    drm/doc: Drop kerneldoc for static functions in drm_irq.c
    ...

    Dave Airlie
     

04 Jun, 2016

1 commit


02 Jun, 2016

3 commits

  • 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: Christian König
    Reviewed-by: Gustavo Padovan
    Acked-by: Sumit Semwal
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1464786612-5010-4-git-send-email-deathsimple@vodafone.de

    Christian König
     
  • 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: Gustavo Padovan
    Signed-off-by: Christian König
    Reviewed-by: Gustavo Padovan
    Acked-by: Sumit Semwal
    [danvet: Improve commit message as suggested by Gustavo.]
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1464786612-5010-3-git-send-email-deathsimple@vodafone.de

    Gustavo Padovan
     
  • Fence contexts are created on the fly (for example) by the GPU scheduler used
    in the amdgpu driver as a result of an userspace request. Because of this
    userspace could in theory force a wrap around of the 32bit context number
    if it doesn't behave well.

    Avoid this by increasing the context number to 64bits. This way even when
    userspace manages to allocate a billion contexts per second it takes more
    than 500 years for the context number to wrap around.

    v2: fix printf formats as well.

    Signed-off-by: Christian König
    Reviewed-by: Gustavo Padovan
    Acked-by: Sumit Semwal
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1464786612-5010-2-git-send-email-deathsimple@vodafone.de

    Christian König
     

01 Jun, 2016

2 commits


30 Apr, 2016

1 commit


21 Mar, 2016

1 commit

  • Just a bit of wording polish plus mentioning that it can fail and must
    be restarted.

    Requested by Sumit.

    v2: Fix them typos (Hans).

    Cc: Chris Wilson
    Cc: Tiago Vignatti
    Cc: Stéphane Marchesin
    Cc: David Herrmann
    Cc: Sumit Semwal
    Cc: Daniel Vetter
    CC: linux-media@vger.kernel.org
    Cc: dri-devel@lists.freedesktop.org
    Cc: linaro-mm-sig@lists.linaro.org
    Cc: intel-gfx@lists.freedesktop.org
    Cc: devel@driverdev.osuosl.org
    Cc: Hans Verkuil
    Acked-by: Sumit Semwal
    Acked-by: Hans Verkuil
    Signed-off-by: Daniel Vetter

    Daniel Vetter
     

19 Mar, 2016

1 commit

  • Drivers, especially i915.ko, can fail during the initial migration of a
    dma-buf for CPU access. However, the error code from the driver was not
    being propagated back to ioctl and so userspace was blissfully ignorant
    of the failure. Rendering corruption ensues.

    Whilst fixing the ioctl to return the error code from
    dma_buf_start_cpu_access(), also do the same for
    dma_buf_end_cpu_access(). For most drivers, dma_buf_end_cpu_access()
    cannot fail. i915.ko however, as most drivers would, wants to avoid being
    uninterruptible (as would be required to guarrantee no failure when
    flushing the buffer to the device). As userspace already has to handle
    errors from the SYNC_IOCTL, take advantage of this to be able to restart
    the syscall across signals.

    This fixes a coherency issue for i915.ko as well as reducing the
    uninterruptible hold upon its BKL, the struct_mutex.

    Fixes commit c11e391da2a8fe973c3c2398452000bed505851e
    Author: Daniel Vetter
    Date: Thu Feb 11 20:04:51 2016 -0200

    dma-buf: Add ioctls to allow userspace to flush

    Testcase: igt/gem_concurrent_blit/*dmabuf*interruptible
    Testcase: igt/prime_mmap_coherency/ioctl-errors
    Signed-off-by: Chris Wilson
    Cc: Tiago Vignatti
    Cc: Stéphane Marchesin
    Cc: David Herrmann
    Cc: Sumit Semwal
    Cc: Daniel Vetter
    CC: linux-media@vger.kernel.org
    Cc: dri-devel@lists.freedesktop.org
    Cc: linaro-mm-sig@lists.linaro.org
    Cc: intel-gfx@lists.freedesktop.org
    Cc: devel@driverdev.osuosl.org
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1458331359-2634-1-git-send-email-chris@chris-wilson.co.uk

    Chris Wilson
     

12 Feb, 2016

1 commit

  • The userspace might need some sort of cache coherency management e.g. when CPU
    and GPU domains are being accessed through dma-buf at the same time. To
    circumvent this problem there are begin/end coherency markers, that forward
    directly to existing dma-buf device drivers vfunc hooks. Userspace can make use
    of those markers through the DMA_BUF_IOCTL_SYNC ioctl. The sequence would be
    used like following:
    - mmap dma-buf fd
    - for each drawing/upload cycle in CPU 1. SYNC_START ioctl, 2. read/write
    to mmap area 3. SYNC_END ioctl. This can be repeated as often as you
    want (with the new data being consumed by the GPU or say scanout device)
    - munmap once you don't need the buffer any more

    v2 (Tiago): Fix header file type names (u64 -> __u64)
    v3 (Tiago): Add documentation. Use enum dma_buf_sync_flags to the begin/end
    dma-buf functions. Check for overflows in start/length.
    v4 (Tiago): use 2d regions for sync.
    v5 (Tiago): forget about 2d regions (v4); use _IOW in DMA_BUF_IOCTL_SYNC and
    remove range information from struct dma_buf_sync.
    v6 (Tiago): use __u64 structured padded flags instead enum. Adjust
    documentation about the recommendation on using sync ioctls.
    v7 (Tiago): Alex' nit on flags definition and being even more wording in the
    doc about sync usage.
    v9 (Tiago): remove useless is_dma_buf_file check. Fix sync.flags conditionals
    and its mask order check. Add include in dma-buf.h.

    Cc: Ville Syrjälä
    Cc: David Herrmann
    Cc: Sumit Semwal
    Reviewed-by: Stéphane Marchesin
    Signed-off-by: Daniel Vetter
    Signed-off-by: Tiago Vignatti
    Reviewed-by: David Herrmann
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1455228291-29640-1-git-send-email-tiago.vignatti@intel.com

    Daniel Vetter
     

09 Feb, 2016

1 commit

  • This patch removes range-based information used for optimizations in
    begin_cpu_access and end_cpu_access.

    We don't have any user nor implementation using range-based flush. It seems a
    consensus that if we ever want something like that again (or even more robust
    using 2D, 3D sub-range regions) we can use the upcoming dma-buf sync ioctl for
    such.

    Cc: Sumit Semwal
    Cc: Daniel Vetter
    Signed-off-by: Tiago Vignatti
    Reviewed-by: Stéphane Marchesin
    Signed-off-by: Daniel Vetter
    Link: http://patchwork.freedesktop.org/patch/msgid/1450820214-12509-3-git-send-email-tiago.vignatti@intel.com

    Tiago Vignatti
     

30 Oct, 2015

1 commit

  • Waiting for the first fence in an array of fences to signal.

    This is useful for device driver specific resource managers
    and also Vulkan needs something similar.

    v2: more parameter checks, handling for timeout==0,
    remove NULL entry support, better callback removal.

    Signed-off-by: Christian König
    Reviewed-by: Alex Deucher
    Reviewed-by: Maarten Lankhorst

    Christian König
     

21 May, 2015

1 commit


13 May, 2015

1 commit

  • Add reference counting on a kernel module that exports dma-buf and
    implements its operations. This prevents the module from being unloaded
    while DMABUF file is in use.

    The original patch [1] was submitted by Tomasz Stanislawski, but this
    is a simpler way to do it.

    v3: call module_put() as late as possible, per gregkh's comment.
    v2: move owner to struct dma_buf, and use DEFINE_DMA_BUF_EXPORT_INFO
    macro to simplify the change.

    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Sumit Semwal

    [1]: https://lkml.org/lkml/2012/8/8/163

    Sumit Semwal
     

21 Apr, 2015

1 commit

  • At present, dma_buf_export() takes a series of parameters, which
    makes it difficult to add any new parameters for exporters, if required.

    Make it simpler by moving all these parameters into a struct, and pass
    the struct * as parameter to dma_buf_export().

    While at it, unite dma_buf_export_named() with dma_buf_export(), and
    change all callers accordingly.

    Reviewed-by: Maarten Lankhorst
    Reviewed-by: Daniel Thompson
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Dave Airlie
    Signed-off-by: Sumit Semwal

    Sumit Semwal
     

22 Jan, 2015

3 commits

  • It was causing the return value of fence_is_signaled to be ignored, making
    reservation objects signal too early.

    Cc: stable@vger.kernel.org
    Reviewed-by: Maarten Lankhorst
    Reviewed-by: Alex Deucher
    Signed-off-by: Michel Dänzer
    Signed-off-by: Sumit Semwal

    Michel Dänzer
     
  • When specified timeout is zero for fence_wait_timeout, just check if the fence
    is signaled or not without wait.

    Signed-off-by: Jammy Zhou
    Reviewed-by: Christian König
    Reviewed-By: Maarten Lankhorst
    Signed-off-by: Sumit Semwal

    Jammy Zhou
     
  • When the timeout value passed to reservation_object_wait_timeout_rcu
    is zero, no wait should be done if the fences are not signaled.

    Return '1' for idle and '0' for busy if the specified timeout is '0'
    to keep consistent with the case of non-zero timeout.

    v2: call fence_put if not signaled in the case of timeout==0

    v3: switch to reservation_object_test_signaled_rcu

    Signed-off-by: Jammy Zhou
    Reviewed-by: Christian König
    Reviewed-by: Alex Deucher
    Reviewed-By: Maarten Lankhorst
    Signed-off-by: Sumit Semwal

    Jammy Zhou
     

04 Nov, 2014

1 commit


09 Oct, 2014

1 commit


28 Aug, 2014

1 commit


09 Jul, 2014

1 commit

  • This adds some extra functions to deal with rcu.

    reservation_object_get_fences_rcu() will obtain the list of shared
    and exclusive fences without obtaining the ww_mutex.

    reservation_object_wait_timeout_rcu() will wait on all fences of the
    reservation_object, without obtaining the ww_mutex.

    reservation_object_test_signaled_rcu() will test if all fences of the
    reservation_object are signaled without using the ww_mutex.

    reservation_object_get_excl and reservation_object_get_list require
    the reservation object to be held, updating requires
    write_seqcount_begin/end. If only the exclusive fence is needed,
    rcu_dereference followed by fence_get_rcu can be used, if the shared
    fences are needed it's recommended to use the supplied functions.

    Signed-off-by: Maarten Lankhorst
    Acked-by: Sumit Semwal
    Acked-by: Daniel Vetter
    Reviewed-By: Thomas Hellstrom
    Signed-off-by: Greg Kroah-Hartman

    Maarten Lankhorst