iris: make sure command buffer is the 1st bo in exec_bos array
For single thread case, command buffer is always the 1st bo be added to exec_bos. For multi threads case, other bos may be added before command buffer is added, which will lead to GPU hang.
Here is an example of the failure case:
- Thread A call iris_batch_flush to submit batch.
- Thread A reset exec_count to 0.
- Thread B call add_bo_to_batch to add other bo to the same batch.
- Thread A call iris_batch_reset to create new command buffer.
This patch try to minimize the time between step 2 and 4. It will drop the bos added in step 3. For my test case, GPU hang cannot be reproduced again.
Signed-off-by: Shuicheng Lin shuicheng.lin@intel.com