diff options
author | Andrii Simiklit <[email protected]> | 2018-09-12 19:05:45 +0300 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2018-10-30 12:09:17 -0700 |
commit | e4e0fd5ffe1de9078ac8906155e1a80ca2006994 (patch) | |
tree | b7ef205ca124b24ba476295f382d390e6e438467 /src | |
parent | a9031bf9b55602d93cccef6c926e2179c23205b4 (diff) |
i965/batch: don't ignore the 'brw_new_batch' call for a 'new batch'
If we restore the 'new batch' using 'intel_batchbuffer_reset_to_saved'
function we must restore the default state of the batch using
'brw_new_batch' function because the 'intel_batchbuffer_flush'
function will not do it for the 'new batch' again.
At least the following fields of the batch
'state_base_address_emitted','aperture_space', 'state_used'
should be restored to default values to avoid:
1. the aperture_space overflow
2. the missed STATE_BASE_ADDRESS commad in the batch
3. the memory overconsumption of the 'statebuffer'
due to uncleared 'state_used' field.
etc.
v2: merge with new commits, changes was minimized, added the 'fixes' tag
v3: added in to patch series
Fixes: 3faf56ffbdeb "intel: Add an interface for saving/restoring
the batchbuffer state."
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107626
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_batchbuffer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c index 2dc6eb80b1a..6207de5a06f 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c @@ -55,6 +55,8 @@ static void intel_batchbuffer_reset(struct brw_context *brw); +static void +brw_new_batch(struct brw_context *brw); static void dump_validation_list(struct intel_batchbuffer *batch) @@ -318,6 +320,8 @@ intel_batchbuffer_reset_to_saved(struct brw_context *brw) brw->batch.exec_count = brw->batch.saved.exec_count; brw->batch.map_next = brw->batch.saved.map_next; + if (USED_BATCH(brw->batch) == 0) + brw_new_batch(brw); } void |