summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/intel/drm
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-03-08 17:32:37 +0800
committerChia-I Wu <[email protected]>2014-03-10 16:42:42 +0800
commit249b1ad98440fee5174aa490e7c3269b88de8904 (patch)
tree1f97d8f3ebd0f18a56414fb4e0b3e56b2c0f02f9 /src/gallium/winsys/intel/drm
parent3e324f99d3b8f6b9da00c3f90719fba19e77ae7d (diff)
ilo: rework winsys batch buffer functions
Rename intel_winsys_check_aperture_size() to intel_winsys_can_submit_bo(), intel_bo_exec() to intel_winsys_submit_bo(), and intel_winsys_decode_commands() to intel_winsys_decode_bo(). Make a semantic change to ignore intel_context when the ring is not the render ring.
Diffstat (limited to 'src/gallium/winsys/intel/drm')
-rw-r--r--src/gallium/winsys/intel/drm/intel_drm_winsys.c48
1 files changed, 27 insertions, 21 deletions
diff --git a/src/gallium/winsys/intel/drm/intel_drm_winsys.c b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
index e119f9ed9a1..12ed2e43355 100644
--- a/src/gallium/winsys/intel/drm/intel_drm_winsys.c
+++ b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
@@ -356,18 +356,38 @@ intel_winsys_export_handle(struct intel_winsys *winsys,
return 0;
}
+bool
+intel_winsys_can_submit_bo(struct intel_winsys *winsys,
+ struct intel_bo **bo_array,
+ int count)
+{
+ return !drm_intel_bufmgr_check_aperture_space((drm_intel_bo **) bo_array,
+ count);
+}
+
int
-intel_winsys_check_aperture_space(struct intel_winsys *winsys,
- struct intel_bo **bo_array,
- int count)
+intel_winsys_submit_bo(struct intel_winsys *winsys,
+ struct intel_bo *bo, int used,
+ struct intel_context *ctx,
+ unsigned long flags)
{
- return drm_intel_bufmgr_check_aperture_space((drm_intel_bo **) bo_array,
- count);
+ /* logical contexts are only available for the render ring */
+ if ((flags & 0x7) > INTEL_EXEC_RENDER)
+ ctx = NULL;
+
+ if (ctx) {
+ return drm_intel_gem_bo_context_exec(gem_bo(bo),
+ (drm_intel_context *) ctx, used, flags);
+ }
+ else {
+ return drm_intel_bo_mrb_exec(gem_bo(bo),
+ used, NULL, 0, 0, flags);
+ }
}
void
-intel_winsys_decode_commands(struct intel_winsys *winsys,
- struct intel_bo *bo, int used)
+intel_winsys_decode_bo(struct intel_winsys *winsys,
+ struct intel_bo *bo, int used)
{
void *ptr;
@@ -510,20 +530,6 @@ intel_bo_has_reloc(struct intel_bo *bo, struct intel_bo *target_bo)
}
int
-intel_bo_exec(struct intel_bo *bo, int used,
- struct intel_context *ctx, unsigned long flags)
-{
- if (ctx) {
- return drm_intel_gem_bo_context_exec(gem_bo(bo),
- (drm_intel_context *) ctx, used, flags);
- }
- else {
- return drm_intel_bo_mrb_exec(gem_bo(bo),
- used, NULL, 0, 0, flags);
- }
-}
-
-int
intel_bo_wait(struct intel_bo *bo, int64_t timeout)
{
int err;