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.
This commit is contained in:
Chia-I Wu 2014-03-10 12:11:33 +08:00
parent 0b462d3ab1
commit d80f0c34b7
2 changed files with 15 additions and 3 deletions

View File

@ -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)

View File

@ -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,