summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-03-08 15:57:51 +0800
committerChia-I Wu <[email protected]>2014-03-10 16:42:42 +0800
commit90786613e98a4d9e5dbb733c18003c36992aba30 (patch)
tree48357daa44daa524c220d0390ac3ab746af718ac /src/gallium/drivers/ilo
parent76ed4f75dd16a8ab8f999f6c85968f7549557da2 (diff)
ilo: rework winsys bo reloc functions
Rename intel_bo_emit_reloc() to intel_bo_add_reloc(), intel_bo_clear_relocs() to intel_bo_truncate_relocs(), and intel_bo_references() to intel_bo_has_reloc(). Besides, we need intel_bo_get_offset() only to get the presumed offset afer adding a reloc entry. Remove the function and make intel_bo_add_reloc() return the presumed offset. While at it, switch to gem_bo->offset64 from gem_bo->offset.
Diffstat (limited to 'src/gallium/drivers/ilo')
-rw-r--r--src/gallium/drivers/ilo/ilo_cp.c2
-rw-r--r--src/gallium/drivers/ilo/ilo_cp.h15
-rw-r--r--src/gallium/drivers/ilo/ilo_query.c2
-rw-r--r--src/gallium/drivers/ilo/ilo_transfer.c2
4 files changed, 13 insertions, 8 deletions
diff --git a/src/gallium/drivers/ilo/ilo_cp.c b/src/gallium/drivers/ilo/ilo_cp.c
index 85d40aa7a5f..55d90266cb5 100644
--- a/src/gallium/drivers/ilo/ilo_cp.c
+++ b/src/gallium/drivers/ilo/ilo_cp.c
@@ -77,7 +77,7 @@ ilo_cp_longjmp(struct ilo_cp *cp, const struct ilo_cp_jmp_buf *jmp)
cp->size = jmp->size;
cp->used = jmp->used;
cp->stolen = jmp->stolen;
- intel_bo_clear_relocs(cp->bo, jmp->reloc_count);
+ intel_bo_truncate_relocs(cp->bo, jmp->reloc_count);
}
/**
diff --git a/src/gallium/drivers/ilo/ilo_cp.h b/src/gallium/drivers/ilo/ilo_cp.h
index 6d6bb16716e..9a09ac9106a 100644
--- a/src/gallium/drivers/ilo/ilo_cp.h
+++ b/src/gallium/drivers/ilo/ilo_cp.h
@@ -330,15 +330,20 @@ static inline void
ilo_cp_write_bo(struct ilo_cp *cp, uint32_t val, struct intel_bo *bo,
uint32_t read_domains, uint32_t write_domain)
{
- if (bo) {
- intel_bo_emit_reloc(cp->bo, cp->cmd_cur * 4,
- bo, val, read_domains, write_domain);
+ uint64_t presumed_offset;
- ilo_cp_write(cp, val + intel_bo_get_offset(bo));
+ if (bo) {
+ intel_bo_add_reloc(cp->bo, cp->cmd_cur * 4, bo, val,
+ read_domains, write_domain, &presumed_offset);
}
else {
- ilo_cp_write(cp, val);
+ presumed_offset = 0;
}
+
+ /* 32-bit addressing */
+ assert(presumed_offset == (uint64_t) ((uint32_t) presumed_offset));
+
+ ilo_cp_write(cp, (uint32_t) presumed_offset);
}
/**
diff --git a/src/gallium/drivers/ilo/ilo_query.c b/src/gallium/drivers/ilo/ilo_query.c
index 5154ddbdefc..59a6b0686c3 100644
--- a/src/gallium/drivers/ilo/ilo_query.c
+++ b/src/gallium/drivers/ilo/ilo_query.c
@@ -168,7 +168,7 @@ ilo_get_query_result(struct pipe_context *pipe, struct pipe_query *query,
return false;
if (q->bo) {
- if (intel_bo_references(ilo->cp->bo, q->bo))
+ if (intel_bo_has_reloc(ilo->cp->bo, q->bo))
ilo_cp_flush(ilo->cp, "syncing for queries");
if (!wait && intel_bo_is_busy(q->bo))
diff --git a/src/gallium/drivers/ilo/ilo_transfer.c b/src/gallium/drivers/ilo/ilo_transfer.c
index 5b8a6588e94..b6e52e1651c 100644
--- a/src/gallium/drivers/ilo/ilo_transfer.c
+++ b/src/gallium/drivers/ilo/ilo_transfer.c
@@ -39,7 +39,7 @@
static bool
is_bo_busy(struct ilo_context *ilo, struct intel_bo *bo, bool *need_flush)
{
- const bool referenced = intel_bo_references(ilo->cp->bo, bo);
+ const bool referenced = intel_bo_has_reloc(ilo->cp->bo, bo);
if (need_flush)
*need_flush = referenced;