diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-11-10 11:50:15 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-11-10 13:02:49 +0000 |
commit | cc2b13c9c05e57dc5004d93b56f332ea95f0a4ef (patch) | |
tree | e5fa359340b41e4a679928b5b4ef64051aac2adf /src/sna/kgem.c | |
parent | 0c4a2bcc3d63ecc02e3a940e38e9a416b51ad0c8 (diff) |
sna: Specify read/write domains for no-relocation fastpath
On review (read triggering BUGs), we do need to supply the domain tracking
of the buffers that is being replaced from the relocation path.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.c')
-rw-r--r-- | src/sna/kgem.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index ea56adf9..28e69c3b 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -114,8 +114,6 @@ search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags); #define LOCAL_I915_EXEC_NO_RELOC (1<<10) #define LOCAL_I915_EXEC_HANDLE_LUT (1<<11) -#define LOCAL_EXEC_OBJECT_WRITE (1<<1) - #define LOCAL_I915_GEM_USERPTR 0x32 #define LOCAL_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_USERPTR, struct local_i915_gem_userptr) struct local_i915_gem_userptr { @@ -2315,7 +2313,9 @@ void _kgem_submit(struct kgem *kgem) kgem->exec[i].alignment = 0; kgem->exec[i].offset = rq->bo->presumed_offset; kgem->exec[i].flags = 0; - kgem->exec[i].rsvd1 = 0; + kgem->exec[i].rsvd1 = (I915_GEM_DOMAIN_COMMAND | + I915_GEM_DOMAIN_INSTRUCTION | + I915_GEM_DOMAIN_VERTEX); kgem->exec[i].rsvd2 = 0; rq->bo->target_handle = kgem->has_handle_lut ? i : handle; @@ -3925,9 +3925,10 @@ uint32_t kgem_add_reloc(struct kgem *kgem, kgem->reloc[index].target_handle = bo->target_handle; kgem->reloc[index].presumed_offset = bo->presumed_offset; - if (read_write_domain & 0x7ff) { + bo->exec->rsvd1 |= read_write_domain >> 16; + if (read_write_domain & 0x7fff) { assert(!bo->snoop || kgem->can_blt_cpu); - bo->exec->flags |= LOCAL_EXEC_OBJECT_WRITE; + bo->exec->rsvd1 |= (uint64_t)(read_write_domain & 0x7fff) << 32; kgem_bo_mark_dirty(bo); } @@ -4353,10 +4354,10 @@ void kgem_bo_sync__gtt(struct kgem *kgem, struct kgem_bo *bo) void kgem_clear_dirty(struct kgem *kgem) { - struct kgem_request *rq = kgem->next_request; + struct list * const buffers = &kgem->next_request->buffers; struct kgem_bo *bo; - list_for_each_entry(bo, &rq->buffers, request) { + list_for_each_entry(bo, buffers, request) { if (!bo->dirty) break; |