summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
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/winsys
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/winsys')
-rw-r--r--src/gallium/winsys/intel/drm/intel_drm_winsys.c27
-rw-r--r--src/gallium/winsys/intel/intel_winsys.h21
2 files changed, 22 insertions, 26 deletions
diff --git a/src/gallium/winsys/intel/drm/intel_drm_winsys.c b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
index cfd1adde2e9..ad91281e62e 100644
--- a/src/gallium/winsys/intel/drm/intel_drm_winsys.c
+++ b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
@@ -386,7 +386,7 @@ intel_winsys_decode_commands(struct intel_winsys *winsys,
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);
@@ -411,12 +411,6 @@ intel_bo_get_size(const struct intel_bo *bo)
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)
{
@@ -465,13 +459,20 @@ intel_bo_pread(struct intel_bo *bo, unsigned long 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 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
@@ -481,13 +482,13 @@ intel_bo_get_reloc_count(struct intel_bo *bo)
}
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));
}
diff --git a/src/gallium/winsys/intel/intel_winsys.h b/src/gallium/winsys/intel/intel_winsys.h
index 4a58d6c0bca..cdd47def651 100644
--- a/src/gallium/winsys/intel/intel_winsys.h
+++ b/src/gallium/winsys/intel/intel_winsys.h
@@ -205,12 +205,6 @@ 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.
*/
void *
@@ -270,9 +264,10 @@ intel_bo_pread(struct intel_bo *bo, unsigned long offset,
* \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.
@@ -281,20 +276,20 @@ int
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.