This commit is contained in:
Maneet Singh
2025-06-16 19:28:19 -07:00
parent 30e15d79de
commit fade1f7b20
35 changed files with 50249 additions and 49935 deletions

View File

@@ -102,7 +102,8 @@ void nvIdleLayerChannels(NVDevEvoRec *pDevEvo,
NvU32 layerMaskPerSdApiHead[NVKMS_MAX_SUBDEVICES][NVKMS_MAX_HEADS_PER_DISP]);
void nvEvoClearSurfaceUsage(NVDevEvoRec *pDevEvo,
NVSurfaceEvoPtr pSurfaceEvo);
NVSurfaceEvoPtr pSurfaceEvo,
const NvBool skipSync);
NvBool nvIdleBaseChannelOneApiHead(NVDispEvoRec *pDispEvo, NvU32 apiHead,
NvBool *pStoppedBase);

View File

@@ -1227,13 +1227,14 @@ void nvIdleLayerChannels(NVDevEvoRec *pDevEvo,
* in-flight methods flip away from this surface.
*/
void nvEvoClearSurfaceUsage(NVDevEvoRec *pDevEvo,
NVSurfaceEvoPtr pSurfaceEvo)
NVSurfaceEvoPtr pSurfaceEvo,
const NvBool skipSync)
{
NvU32 head;
/*
* If the core channel is no longer allocated, we don't need to
* sync. This assumes the channels are allocated/deallocated
* clear usage/sync. This assumes the channels are allocated/deallocated
* together.
*/
if (pDevEvo->core) {
@@ -1242,16 +1243,20 @@ void nvEvoClearSurfaceUsage(NVDevEvoRec *pDevEvo,
pDevEvo->hal->ClearSurfaceUsage(pDevEvo, pSurfaceEvo);
}
nvRMSyncEvoChannel(pDevEvo, pDevEvo->core, __LINE__);
/* HALs with ClearSurfaceUsage() require sync to ensure completion. */
if (!skipSync ||
(pDevEvo->hal->ClearSurfaceUsage != NULL)) {
nvRMSyncEvoChannel(pDevEvo, pDevEvo->core, __LINE__);
for (head = 0; head < pDevEvo->numHeads; head++) {
NvU32 layer;
for (head = 0; head < pDevEvo->numHeads; head++) {
NvU32 layer;
for (layer = 0; layer < pDevEvo->head[head].numLayers; layer++) {
NVEvoChannelPtr pChannel =
pDevEvo->head[head].layer[layer];
for (layer = 0; layer < pDevEvo->head[head].numLayers; layer++) {
NVEvoChannelPtr pChannel =
pDevEvo->head[head].layer[layer];
nvRMSyncEvoChannel(pDevEvo, pChannel, __LINE__);
nvRMSyncEvoChannel(pDevEvo, pChannel, __LINE__);
}
}
}
}

View File

@@ -1162,14 +1162,14 @@ void nvEvoDecrementSurfaceRefCntsWithSync(NVDevEvoPtr pDevEvo,
if (pSurfaceEvo->rmRefCnt == 0) {
/*
* Don't sync if this surface was registered as not requiring display
* hardware access, to WAR timeouts that result from OGL unregistering
* a deferred request fifo causing a sync here that may timeout if
* GLS hasn't had the opportunity to release semaphores with pending
* flips. (Bug 2050970)
* Don't clear usage/sync if this surface was registered as not
* requiring display hardware access, to WAR timeouts that result from
* OGL unregistering a deferred request fifo causing a sync here that
* may timeout if GLS hasn't had the opportunity to release semaphores
* with pending flips. (Bug 2050970)
*/
if (!skipSync && pSurfaceEvo->requireDisplayHardwareAccess) {
nvEvoClearSurfaceUsage(pDevEvo, pSurfaceEvo);
if (pSurfaceEvo->requireDisplayHardwareAccess) {
nvEvoClearSurfaceUsage(pDevEvo, pSurfaceEvo, skipSync);
}
FreeSurfaceEvoRm(pDevEvo, pSurfaceEvo);