@@ -288,10 +288,10 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenFlushIs
288
288
}
289
289
290
290
HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenProcessResidencyIsCalledButSubCaptureIsDisabledThenItShouldntWriteMemory) {
291
+ auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
291
292
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , true );
292
293
auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
293
294
294
- auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
295
295
aubSubCaptureManagerMock->subCaptureMode = AubSubCaptureManager::SubCaptureMode::Toggle;
296
296
aubSubCaptureManagerMock->disableSubCapture ();
297
297
aubCsr->subCaptureManager = aubSubCaptureManagerMock.get ();
@@ -306,13 +306,13 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur
306
306
307
307
HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenProcessResidencyIsCalledButAllocationSizeIsZeroThenItShouldntWriteMemory) {
308
308
DebugManagerStateRestore stateRestore;
309
+ auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
309
310
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , true );
310
311
auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
311
312
312
313
const DispatchInfo dispatchInfo;
313
314
MultiDispatchInfo multiDispatchInfo;
314
315
multiDispatchInfo.push (dispatchInfo);
315
- auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
316
316
aubSubCaptureManagerMock->subCaptureMode = AubSubCaptureManager::SubCaptureMode::Toggle;
317
317
aubSubCaptureManagerMock->setSubCaptureToggleActive (true );
318
318
aubSubCaptureManagerMock->activateSubCapture (multiDispatchInfo);
@@ -327,11 +327,11 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur
327
327
}
328
328
329
329
HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenFlushIsCalledButSubCaptureIsDisabledThenItShouldntInitializeEngineInfo) {
330
+ auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
330
331
auto aubExecutionEnvironment = getEnvironment<AUBCommandStreamReceiverHw<FamilyType>>(true , true , true );
331
332
auto aubCsr = aubExecutionEnvironment->template getCsr <AUBCommandStreamReceiverHw<FamilyType>>();
332
333
LinearStream cs (aubExecutionEnvironment->commandBuffer );
333
334
334
- auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
335
335
aubSubCaptureManagerMock->subCaptureMode = AubSubCaptureManager::SubCaptureMode::Toggle;
336
336
aubSubCaptureManagerMock->disableSubCapture ();
337
337
aubCsr->subCaptureManager = aubSubCaptureManagerMock.get ();
@@ -436,11 +436,11 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInNonStanda
436
436
437
437
HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandaloneAndSubCaptureModeWhenFlushIsCalledButSubCaptureIsDisabledThenItShouldUpdateHwTagWithLatestSentTaskCount) {
438
438
DebugManagerStateRestore stateRestore;
439
+ auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
439
440
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , true );
440
441
auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
441
442
LinearStream cs (aubExecutionEnvironment->commandBuffer );
442
443
443
- auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
444
444
aubSubCaptureManagerMock->subCaptureMode = AubSubCaptureManager::SubCaptureMode::Toggle;
445
445
aubSubCaptureManagerMock->disableSubCapture ();
446
446
aubCsr->subCaptureManager = aubSubCaptureManagerMock.get ();
@@ -461,11 +461,11 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon
461
461
462
462
HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInNonStandaloneAndSubCaptureModeWhenFlushIsCalledButSubCaptureIsDisabledThenItShouldNotUpdateHwTagWithLatestSentTaskCount) {
463
463
DebugManagerStateRestore stateRestore;
464
+ auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
464
465
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , false );
465
466
auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
466
467
LinearStream cs (aubExecutionEnvironment->commandBuffer );
467
468
468
- auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
469
469
aubSubCaptureManagerMock->subCaptureMode = AubSubCaptureManager::SubCaptureMode::Toggle;
470
470
aubSubCaptureManagerMock->disableSubCapture ();
471
471
aubCsr->subCaptureManager = aubSubCaptureManagerMock.get ();
@@ -488,14 +488,14 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInNonStanda
488
488
HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenFlushIsCalledAndSubCaptureIsEnabledThenItShouldDeactivateSubCapture) {
489
489
DebugManagerStateRestore stateRestore;
490
490
491
+ auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
491
492
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , false );
492
493
auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
493
494
LinearStream cs (aubExecutionEnvironment->commandBuffer );
494
495
495
496
const DispatchInfo dispatchInfo;
496
497
MultiDispatchInfo multiDispatchInfo;
497
498
multiDispatchInfo.push (dispatchInfo);
498
- auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
499
499
aubSubCaptureManagerMock->subCaptureMode = AubSubCaptureManager::SubCaptureMode::Toggle;
500
500
aubSubCaptureManagerMock->setSubCaptureToggleActive (true );
501
501
aubSubCaptureManagerMock->activateSubCapture (multiDispatchInfo);
@@ -511,6 +511,32 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptur
511
511
EXPECT_FALSE (aubCsr->subCaptureManager ->isSubCaptureEnabled ());
512
512
}
513
513
514
+ HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInSubCaptureModeWhenFlushIsCalledAndSubCaptureIsEnabledThenItShouldCallPollForCompletion) {
515
+ DebugManagerStateRestore stateRestore;
516
+
517
+ auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
518
+ auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , false );
519
+ auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
520
+ LinearStream cs (aubExecutionEnvironment->commandBuffer );
521
+
522
+ const DispatchInfo dispatchInfo;
523
+ MultiDispatchInfo multiDispatchInfo;
524
+ multiDispatchInfo.push (dispatchInfo);
525
+ aubSubCaptureManagerMock->subCaptureMode = AubSubCaptureManager::SubCaptureMode::Toggle;
526
+ aubSubCaptureManagerMock->setSubCaptureToggleActive (true );
527
+ aubSubCaptureManagerMock->activateSubCapture (multiDispatchInfo);
528
+ aubCsr->subCaptureManager = aubSubCaptureManagerMock.get ();
529
+ ASSERT_TRUE (aubCsr->subCaptureManager ->isSubCaptureEnabled ());
530
+
531
+ BatchBuffer batchBuffer{cs.getGraphicsAllocation (), 0 , 0 , nullptr , false , false , QueueThrottle::MEDIUM, cs.getUsed (), &cs};
532
+
533
+ ResidencyContainer allocationsForResidency = {};
534
+
535
+ aubCsr->flush (batchBuffer, allocationsForResidency);
536
+
537
+ EXPECT_TRUE (aubCsr->pollForCompletionCalled );
538
+ }
539
+
514
540
HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandaloneModeWhenFlushIsCalledThenItShouldCallMakeResidentOnCommandBufferAllocation) {
515
541
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , true );
516
542
auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
@@ -610,6 +636,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInNonStanda
610
636
611
637
HWTEST_F (AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandaloneAndSubCaptureModeWhenFlushIsCalledAndSubCaptureIsEnabledThenItShouldCallMakeResidentOnCommandBufferAndResidencyAllocations) {
612
638
DebugManagerStateRestore stateRestore;
639
+ auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
613
640
auto aubExecutionEnvironment = getEnvironment<MockAubCsr<FamilyType>>(true , true , true );
614
641
auto aubCsr = aubExecutionEnvironment->template getCsr <MockAubCsr<FamilyType>>();
615
642
auto memoryManager = aubExecutionEnvironment->executionEnvironment ->memoryManager .get ();
@@ -619,7 +646,6 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverInStandalon
619
646
const DispatchInfo dispatchInfo;
620
647
MultiDispatchInfo multiDispatchInfo;
621
648
multiDispatchInfo.push (dispatchInfo);
622
- auto aubSubCaptureManagerMock = std::unique_ptr<AubSubCaptureManagerMock>(new AubSubCaptureManagerMock (" " ));
623
649
aubSubCaptureManagerMock->subCaptureMode = AubSubCaptureManager::SubCaptureMode::Toggle;
624
650
aubSubCaptureManagerMock->setSubCaptureToggleActive (true );
625
651
aubSubCaptureManagerMock->activateSubCapture (multiDispatchInfo);
0 commit comments