Skip to content
Snippets Groups Projects
Select Git revision
  • 071750e550af46b5d3a84ad56c2a108c3e136284
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

i915_gem_execbuffer.c

Blame
    • Chris Wilson's avatar
      071750e5
      drm/i915: Disable EXEC_OBJECT_ASYNC when doing relocations · 071750e5
      Chris Wilson authored
      
      If we write a relocation into the buffer, we require our own implicit
      synchronisation added after the start of the execbuf, outside of the
      user's control. As we may end up clflushing, or doing the patch itself
      on the GPU, asynchronously we need to look at the implicit serialisation
      on obj->resv and hence need to disable EXEC_OBJECT_ASYNC for this
      object.
      
      If the user does trigger a stall for relocations, we make sure the stall
      is complete enough so that the batch is not submitted before we complete
      those relocations.
      
      Fixes: 77ae9957 ("drm/i915: Enable userspace to opt-out of implicit fencing")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      071750e5
      History
      drm/i915: Disable EXEC_OBJECT_ASYNC when doing relocations
      Chris Wilson authored
      
      If we write a relocation into the buffer, we require our own implicit
      synchronisation added after the start of the execbuf, outside of the
      user's control. As we may end up clflushing, or doing the patch itself
      on the GPU, asynchronously we need to look at the implicit serialisation
      on obj->resv and hence need to disable EXEC_OBJECT_ASYNC for this
      object.
      
      If the user does trigger a stall for relocations, we make sure the stall
      is complete enough so that the batch is not submitted before we complete
      those relocations.
      
      Fixes: 77ae9957 ("drm/i915: Enable userspace to opt-out of implicit fencing")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
    i915_gem_execbuffer.c 50.55 KiB
    /*
     * Copyright © 2008,2010 Intel Corporation
     *
     * Permission is hereby granted, free of charge, to any person obtaining a
     * copy of this software and associated documentation files (the "Software"),
     * to deal in the Software without restriction, including without limitation
     * the rights to use, copy, modify, merge, publish, distribute, sublicense,
     * and/or sell copies of the Software, and to permit persons to whom the
     * Software is furnished to do so, subject to the following conditions:
     *
     * The above copyright notice and this permission notice (including the next
     * paragraph) shall be included in all copies or substantial portions of the
     * Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
     * IN THE SOFTWARE.
     *
     * Authors:
     *    Eric Anholt <eric@anholt.net>
     *    Chris Wilson <chris@chris-wilson.co.uk>
     *
     */
    
    #include <linux/dma_remapping.h>
    #include <linux/reservation.h>
    #include <linux/sync_file.h>
    #include <linux/uaccess.h>
    
    #include <drm/drmP.h>
    #include <drm/i915_drm.h>
    
    #include "i915_drv.h"
    #include "i915_gem_clflush.h"
    #include "i915_trace.h"
    #include "intel_drv.h"
    #include "intel_frontbuffer.h"
    
    #define DBG_USE_CPU_RELOC 0 /* -1 force GTT relocs; 1 force CPU relocs */
    
    #define  __EXEC_OBJECT_HAS_PIN		(1<<31)
    #define  __EXEC_OBJECT_HAS_FENCE	(1<<30)
    #define  __EXEC_OBJECT_NEEDS_MAP	(1<<29)
    #define  __EXEC_OBJECT_NEEDS_BIAS	(1<<28)
    #define  __EXEC_OBJECT_INTERNAL_FLAGS (0xf<<28) /* all of the above */
    
    #define BATCH_OFFSET_BIAS (256*1024)
    
    #define __I915_EXEC_ILLEGAL_FLAGS \
    	(__I915_EXEC_UNKNOWN_FLAGS | I915_EXEC_CONSTANTS_MASK)
    
    struct i915_execbuffer {
    	struct drm_i915_private *i915;
    	struct drm_file *file;
    	struct drm_i915_gem_execbuffer2 *args;
    	struct drm_i915_gem_exec_object2 *exec;
    	struct intel_engine_cs *engine;
    	struct i915_gem_context *ctx;
    	struct i915_address_space *vm;
    	struct i915_vma *batch;
    	struct drm_i915_gem_request *request;
    	u32 batch_start_offset;
    	u32 batch_len;
    	unsigned int dispatch_flags;
    	struct drm_i915_gem_exec_object2 shadow_exec_entry;
    	bool need_relocs;