diff options
author | Eric Anholt <[email protected]> | 2015-06-12 12:47:47 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2015-06-16 15:15:14 -0700 |
commit | 6dd55b49090da22d3a8e9226507a95e914eaf10f (patch) | |
tree | df82a883e62f7b1b5468fe061d926ab9a8c473ea /src/gallium/drivers/vc4/kernel | |
parent | 731ac05cc4e444175288032a76a29c95059af038 (diff) |
vc4: Handle refcounting the exec BO like we do in the kernel.
This reduces the diff to the kernel, and will be useful when I make the
kernel allocate more BOs as part of validation.
Diffstat (limited to 'src/gallium/drivers/vc4/kernel')
-rw-r--r-- | src/gallium/drivers/vc4/kernel/vc4_drv.h | 5 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/kernel/vc4_gem.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/kernel/vc4_drv.h b/src/gallium/drivers/vc4/kernel/vc4_drv.h index dede7162c42..8e9230b8949 100644 --- a/src/gallium/drivers/vc4/kernel/vc4_drv.h +++ b/src/gallium/drivers/vc4/kernel/vc4_drv.h @@ -52,6 +52,11 @@ struct vc4_exec_info { struct vc4_bo_exec_state *bo; uint32_t bo_count; + /* List of other BOs used in the job that need to be released + * once the job is complete. + */ + struct list_head unref_list; + /* Current unvalidated indices into @bo loaded by the non-hardware * VC4_PACKET_GEM_HANDLES. */ diff --git a/src/gallium/drivers/vc4/kernel/vc4_gem.c b/src/gallium/drivers/vc4/kernel/vc4_gem.c index ac29ab35dbc..e559ddd1d4e 100644 --- a/src/gallium/drivers/vc4/kernel/vc4_gem.c +++ b/src/gallium/drivers/vc4/kernel/vc4_gem.c @@ -114,6 +114,9 @@ vc4_cl_validate(struct drm_device *dev, struct vc4_exec_info *exec) } #endif + list_addtail(&to_vc4_bo(&exec->exec_bo->base)->unref_head, + &exec->unref_list); + exec->ct0ca = exec->exec_bo->paddr + bin_offset; exec->ct1ca = exec->exec_bo->paddr + render_offset; |