diff options
author | Chia-I Wu <[email protected]> | 2014-03-08 15:57:51 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-03-10 16:42:42 +0800 |
commit | 90786613e98a4d9e5dbb733c18003c36992aba30 (patch) | |
tree | 48357daa44daa524c220d0390ac3ab746af718ac /src/gallium/drivers/ilo/ilo_cp.h | |
parent | 76ed4f75dd16a8ab8f999f6c85968f7549557da2 (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/ilo_cp.h')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_cp.h | 15 |
1 files changed, 10 insertions, 5 deletions
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); } /** |