diff options
author | Marek Olšák <[email protected]> | 2019-04-04 10:02:27 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-05-16 13:10:07 -0400 |
commit | 187f1c999f90c3bef5b657bf386f076436149c1c (patch) | |
tree | 4a328da617b950daaf5fcd8cd1fb69fd843aa670 /src/gallium/winsys | |
parent | 4eb377d1c3363b3a372fb2c812fc741730c2cef7 (diff) |
winsys/amdgpu: add REWIND emulation via INDIRECT_BUFFER into cs_check_space
Acked-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 20 | ||||
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 3 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index eb973bf8102..555150a7018 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -1031,7 +1031,8 @@ static bool amdgpu_cs_validate(struct radeon_cmdbuf *rcs) return true; } -static bool amdgpu_cs_check_space(struct radeon_cmdbuf *rcs, unsigned dw) +static bool amdgpu_cs_check_space(struct radeon_cmdbuf *rcs, unsigned dw, + bool force_chaining) { struct amdgpu_ib *ib = amdgpu_ib(rcs); struct amdgpu_cs *cs = amdgpu_cs_from_ib(ib); @@ -1048,16 +1049,21 @@ static bool amdgpu_cs_check_space(struct radeon_cmdbuf *rcs, unsigned dw) ib->max_check_space_size = MAX2(ib->max_check_space_size, safe_byte_size); - if (requested_size > amdgpu_ib_max_submit_dwords(ib->ib_type)) - return false; + /* If force_chaining is true, we can't return. We have to chain. */ + if (!force_chaining) { + if (requested_size > amdgpu_ib_max_submit_dwords(ib->ib_type)) + return false; - ib->max_ib_size = MAX2(ib->max_ib_size, requested_size); + ib->max_ib_size = MAX2(ib->max_ib_size, requested_size); - if (rcs->current.max_dw - rcs->current.cdw >= dw) - return true; + if (rcs->current.max_dw - rcs->current.cdw >= dw) + return true; + } - if (!amdgpu_cs_has_chaining(cs)) + if (!amdgpu_cs_has_chaining(cs)) { + assert(!force_chaining); return false; + } /* Allocate a new chunk */ if (rcs->num_prev >= rcs->max_prev) { diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c index 670d2f57de6..7de748a4aff 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c @@ -424,7 +424,8 @@ static bool radeon_drm_cs_validate(struct radeon_cmdbuf *rcs) return status; } -static bool radeon_drm_cs_check_space(struct radeon_cmdbuf *rcs, unsigned dw) +static bool radeon_drm_cs_check_space(struct radeon_cmdbuf *rcs, unsigned dw, + bool force_chaining) { assert(rcs->current.cdw <= rcs->current.max_dw); return rcs->current.max_dw - rcs->current.cdw >= dw; |