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);
}
/**
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);
}
/**
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))
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;
used /= 4;
drm_intel_decode_set_batch_pointer(winsys->decode,
- intel_bo_get_virtual(bo), intel_bo_get_offset(bo), used);
+ gem_bo(bo)->virtual, gem_bo(bo)->offset64, used);
drm_intel_decode(winsys->decode);
return gem_bo(bo)->size;
}
-unsigned long
-intel_bo_get_offset(const struct intel_bo *bo)
-{
- return gem_bo(bo)->offset;
-}
-
void *
intel_bo_get_virtual(const struct intel_bo *bo)
{
}
int
-intel_bo_emit_reloc(struct intel_bo *bo, uint32_t offset,
- struct intel_bo *target_bo, uint32_t target_offset,
- uint32_t read_domains, uint32_t write_domain)
+intel_bo_add_reloc(struct intel_bo *bo, uint32_t offset,
+ struct intel_bo *target_bo, uint32_t target_offset,
+ uint32_t read_domains, uint32_t write_domain,
+ uint64_t *presumed_offset)
{
- return drm_intel_bo_emit_reloc(gem_bo(bo), offset,
+ int err;
+
+ err = drm_intel_bo_emit_reloc(gem_bo(bo), offset,
gem_bo(target_bo), target_offset,
read_domains, write_domain);
+
+ *presumed_offset = gem_bo(target_bo)->offset64 + target_offset;
+
+ return err;
}
int
}
void
-intel_bo_clear_relocs(struct intel_bo *bo, int start)
+intel_bo_truncate_relocs(struct intel_bo *bo, int start)
{
drm_intel_gem_bo_clear_relocs(gem_bo(bo), start);
}
bool
-intel_bo_references(struct intel_bo *bo, struct intel_bo *target_bo)
+intel_bo_has_reloc(struct intel_bo *bo, struct intel_bo *target_bo)
{
return drm_intel_bo_references(gem_bo(bo), gem_bo(target_bo));
}
unsigned long
intel_bo_get_size(const struct intel_bo *bo);
-/**
- * Return the last-seen-by-GPU offset of \p bo.
- */
-unsigned long
-intel_bo_get_offset(const struct intel_bo *bo);
-
/**
* Return the pointer to the memory area of the mapped \p bo.
*/
* \p target_offset.
*/
int
-intel_bo_emit_reloc(struct intel_bo *bo, uint32_t offset,
- struct intel_bo *target_bo, uint32_t target_offset,
- uint32_t read_domains, uint32_t write_domain);
+intel_bo_add_reloc(struct intel_bo *bo, uint32_t offset,
+ struct intel_bo *target_bo, uint32_t target_offset,
+ uint32_t read_domains, uint32_t write_domain,
+ uint64_t *presumed_offset);
/**
* Return the current number of relocations.
intel_bo_get_reloc_count(struct intel_bo *bo);
/**
- * Discard all relocations except the first \p start ones.
+ * Truncate all relocations except the first \p start ones.
*
* Combined with \p intel_bo_get_reloc_count(), they can be used to undo the
- * \p intel_bo_emit_reloc() calls that were just made.
+ * \p intel_bo_add_reloc() calls that were just made.
*/
void
-intel_bo_clear_relocs(struct intel_bo *bo, int start);
+intel_bo_truncate_relocs(struct intel_bo *bo, int start);
/**
* Return true if \p target_bo is on the relocation list of \p bo, or on
* the relocation list of some bo that is referenced by \p bo.
*/
bool
-intel_bo_references(struct intel_bo *bo, struct intel_bo *target_bo);
+intel_bo_has_reloc(struct intel_bo *bo, struct intel_bo *target_bo);
/**
* Submit \p bo for execution.