summaryrefslogtreecommitdiff
path: root/lib/intel_batchbuffer.h
diff options
context:
space:
mode:
authorZbigniew Kempczyński <zbigniew.kempczynski@intel.com>2020-06-04 12:03:51 +0200
committerChris Wilson <chris@chris-wilson.co.uk>2020-06-06 12:47:41 +0100
commit1cf93b17175276a871f52f4d46bd710943cd4277 (patch)
tree25c8d3315da9f7c981bd9c0a19e768aff4798676 /lib/intel_batchbuffer.h
parent5c60340ff0aeb43d0fa6818443ada0c5868d5dec (diff)
lib/intel_batchbuffer: add bb reset
For some scenarios we want to keep previous objects and their offsets and recreate only batchbuffer object. To allow user do that add bb reset function which can or not purge collected objects from previous run. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/intel_batchbuffer.h')
-rw-r--r--lib/intel_batchbuffer.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index ae052c17..0649fc22 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -405,8 +405,8 @@ igt_vme_func_t igt_get_media_vme_func(int devid);
/**
* igt_media_spinfunc_t:
- * @batch: batchbuffer object
- * @dst: destination i-g-t buffer object
+ * @i915: drm fd
+ * @buf: destination buffer object
* @spins: number of loops to execute
*
* This is the type of the per-platform media spin functions. The
@@ -420,8 +420,8 @@ igt_vme_func_t igt_get_media_vme_func(int devid);
* destination buffer on completion. This utility provides a simple way
* to keep the render engine busy for a set time for various tests.
*/
-typedef void (*igt_media_spinfunc_t)(struct intel_batchbuffer *batch,
- const struct igt_buf *dst, uint32_t spins);
+typedef void (*igt_media_spinfunc_t)(int i915,
+ struct intel_buf *buf, uint32_t spins);
igt_media_spinfunc_t igt_get_media_spinfunc(int devid);
@@ -443,6 +443,8 @@ struct intel_bb {
uint64_t gtt_size;
bool supports_48b_address;
+ uint32_t ctx;
+
void *root;
struct drm_i915_gem_exec_object2 *objects;
uint32_t num_objects;
@@ -457,6 +459,7 @@ struct intel_bb {
struct intel_bb *intel_bb_create(int i915, uint32_t size);
void intel_bb_destroy(struct intel_bb *ibb);
+void intel_bb_reset(struct intel_bb *ibb, bool purge_objects_cache);
void intel_bb_set_debug(struct intel_bb *ibb, bool debug);
static inline uint32_t intel_bb_offset(struct intel_bb *ibb)
@@ -524,5 +527,6 @@ void intel_bb_exec_with_context(struct intel_bb *ibb, uint32_t end_offset,
uint32_t ctx, uint64_t flags, bool sync);
uint64_t intel_bb_get_object_offset(struct intel_bb *ibb, uint32_t handle);
+bool intel_bb_object_offset_to_buf(struct intel_bb *ibb, struct intel_buf *buf);
#endif