diff options
author | Chia-I Wu <[email protected]> | 2014-03-10 12:11:33 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-03-10 16:42:42 +0800 |
commit | d80f0c34b733a874adfdd3a2267e4deec345cc6b (patch) | |
tree | 95b475e21db77313948b1bc711198bb316da54b5 /src/gallium/winsys | |
parent | 0b462d3ab13af9bba9c9b21bf67de6d2b1857786 (diff) |
ilo: set I915_EXEC_NO_RELOC when available
The winsys makes it clear that the pipe drivers should write presumed offsets.
We can always set I915_EXEC_NO_RELOC when the kernel supports it.
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/intel/drm/intel_drm_winsys.c | 16 | ||||
-rw-r--r-- | src/gallium/winsys/intel/intel_winsys.h | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/gallium/winsys/intel/drm/intel_drm_winsys.c b/src/gallium/winsys/intel/drm/intel_drm_winsys.c index 1dc9b1cfefc..364f221dc2f 100644 --- a/src/gallium/winsys/intel/drm/intel_drm_winsys.c +++ b/src/gallium/winsys/intel/drm/intel_drm_winsys.c @@ -48,6 +48,7 @@ struct intel_winsys { int fd; drm_intel_bufmgr *bufmgr; struct intel_winsys_info info; + unsigned long exec_flags; struct drm_intel_decode *decode; }; @@ -108,7 +109,7 @@ test_reg_read(struct intel_winsys *winsys, uint32_t reg) } static bool -init_info(struct intel_winsys *winsys) +probe_winsys(struct intel_winsys *winsys) { struct intel_winsys_info *info = &winsys->info; int val; @@ -147,6 +148,14 @@ init_info(struct intel_winsys *winsys) get_param(winsys, I915_PARAM_HAS_GEN7_SOL_RESET, &val); info->has_gen7_sol_reset = val; + /* + * pipe drivers are expected to write the presumed offsets after adding + * reloc entries + */ + get_param(winsys, I915_PARAM_HAS_EXEC_NO_RELOC, &val); + if (val) + winsys->exec_flags |= I915_EXEC_NO_RELOC; + return true; } @@ -168,7 +177,7 @@ intel_winsys_create_for_fd(int fd) return NULL; } - if (!init_info(winsys)) { + if (!probe_winsys(winsys)) { drm_intel_bufmgr_destroy(winsys->bufmgr); FREE(winsys); return NULL; @@ -384,7 +393,8 @@ intel_winsys_submit_bo(struct intel_winsys *winsys, struct intel_context *ctx, unsigned long flags) { - const unsigned long exec_flags = (unsigned long) ring | flags; + const unsigned long exec_flags = + winsys->exec_flags | (unsigned long) ring | flags; /* logical contexts are only available for the render ring */ if (ring != INTEL_RING_RENDER) diff --git a/src/gallium/winsys/intel/intel_winsys.h b/src/gallium/winsys/intel/intel_winsys.h index c37fa1129e2..8140588dfa2 100644 --- a/src/gallium/winsys/intel/intel_winsys.h +++ b/src/gallium/winsys/intel/intel_winsys.h @@ -264,6 +264,8 @@ intel_bo_pread(struct intel_bo *bo, unsigned long offset, * When \p bo is submitted for execution, and if \p target_bo has moved, * the kernel will patch \p bo at \p offset to \p target_bo->offset plus * \p target_offset. + * + * \p presumed_offset should be written to \p bo at \p offset. */ int intel_bo_add_reloc(struct intel_bo *bo, uint32_t offset, |