mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-02-08 09:10:03 +00:00
525.47.22
This commit is contained in:
@@ -481,6 +481,7 @@ static inline void HsIncrementNextIndex(
|
||||
}
|
||||
|
||||
static inline void HsChangeSurfaceFlipRefCount(
|
||||
NVDevEvoPtr pDevEvo,
|
||||
NVSurfaceEvoPtr pSurfaceEvo,
|
||||
NvBool increase)
|
||||
{
|
||||
@@ -488,7 +489,7 @@ static inline void HsChangeSurfaceFlipRefCount(
|
||||
if (increase) {
|
||||
nvEvoIncrementSurfaceRefCnts(pSurfaceEvo);
|
||||
} else {
|
||||
nvEvoDecrementSurfaceRefCnts(pSurfaceEvo);
|
||||
nvEvoDecrementSurfaceRefCnts(pDevEvo, pSurfaceEvo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,8 +69,6 @@ NVEvoApiHandlesRec *nvGetSurfaceHandlesFromOpenDev(
|
||||
struct NvKmsPerOpenDev *pOpenDev);
|
||||
const NVEvoApiHandlesRec *nvGetSurfaceHandlesFromOpenDevConst(
|
||||
const struct NvKmsPerOpenDev *pOpenDev);
|
||||
NVDevEvoPtr nvGetDevEvoFromOpenDev(
|
||||
const struct NvKmsPerOpenDev *pOpenDev);
|
||||
|
||||
void nvKmsServiceNonStallInterrupt(void *dataPtr, NvU32 dataU32);
|
||||
|
||||
|
||||
@@ -47,7 +47,8 @@ void nvEvoIncrementSurfaceStructRefCnt(NVSurfaceEvoPtr pSurfaceEvo);
|
||||
void nvEvoDecrementSurfaceStructRefCnt(NVSurfaceEvoPtr pSurfaceEvo);
|
||||
|
||||
void nvEvoIncrementSurfaceRefCnts(NVSurfaceEvoPtr pSurfaceEvo);
|
||||
void nvEvoDecrementSurfaceRefCnts(NVSurfaceEvoPtr pSurfaceEvo);
|
||||
void nvEvoDecrementSurfaceRefCnts(NVDevEvoPtr pDevEvo,
|
||||
NVSurfaceEvoPtr pSurfaceEvo);
|
||||
|
||||
NvBool nvEvoSurfaceRefCntsTooLarge(const NVSurfaceEvoRec *pSurfaceEvo);
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ SetCursorImage(NVDispEvoPtr pDispEvo,
|
||||
}
|
||||
|
||||
if (pSurfaceEvoOld) {
|
||||
nvEvoDecrementSurfaceRefCnts(pSurfaceEvoOld);
|
||||
nvEvoDecrementSurfaceRefCnts(pDevEvo, pSurfaceEvoOld);
|
||||
}
|
||||
|
||||
pDevEvo->gpus[sd].headState[head].cursor.pSurfaceEvo = pSurfaceEvoNew;
|
||||
|
||||
@@ -2368,7 +2368,7 @@ static void ChangeSurfaceFlipRefCount(
|
||||
if (increase) {
|
||||
nvEvoIncrementSurfaceRefCnts(pSurfaceEvo);
|
||||
} else {
|
||||
nvEvoDecrementSurfaceRefCnts(pSurfaceEvo);
|
||||
nvEvoDecrementSurfaceRefCnts(pDevEvo, pSurfaceEvo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1835,16 +1835,21 @@ static void HsConfigInitFlipQueue(
|
||||
}
|
||||
|
||||
static void HsConfigUpdateSurfaceRefCount(
|
||||
NVDevEvoPtr pDevEvo,
|
||||
const NVHsChannelConfig *pChannelConfig,
|
||||
NvBool increase)
|
||||
{
|
||||
HsChangeSurfaceFlipRefCount(pChannelConfig->warpMesh.pSurface, increase);
|
||||
HsChangeSurfaceFlipRefCount(
|
||||
pDevEvo, pChannelConfig->warpMesh.pSurface, increase);
|
||||
|
||||
HsChangeSurfaceFlipRefCount(pChannelConfig->pBlendTexSurface, increase);
|
||||
HsChangeSurfaceFlipRefCount(
|
||||
pDevEvo, pChannelConfig->pBlendTexSurface, increase);
|
||||
|
||||
HsChangeSurfaceFlipRefCount(pChannelConfig->pOffsetTexSurface, increase);
|
||||
HsChangeSurfaceFlipRefCount(
|
||||
pDevEvo, pChannelConfig->pOffsetTexSurface, increase);
|
||||
|
||||
HsChangeSurfaceFlipRefCount(pChannelConfig->cursor.pSurfaceEvo, increase);
|
||||
HsChangeSurfaceFlipRefCount(
|
||||
pDevEvo, pChannelConfig->cursor.pSurfaceEvo, increase);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -2444,6 +2449,7 @@ void nvHsConfigStart(
|
||||
*/
|
||||
if (pHsConfigOneHead->pHsChannel != NULL) {
|
||||
HsConfigUpdateSurfaceRefCount(
|
||||
pDevEvo,
|
||||
&pHsConfigOneHead->channelConfig,
|
||||
TRUE /* increase */);
|
||||
}
|
||||
@@ -2454,6 +2460,7 @@ void nvHsConfigStart(
|
||||
*/
|
||||
if (pDispEvo->pHsChannel[apiHead] != NULL) {
|
||||
HsConfigUpdateSurfaceRefCount(
|
||||
pDevEvo,
|
||||
&pDispEvo->pHsChannel[apiHead]->config,
|
||||
FALSE /* increase */);
|
||||
}
|
||||
|
||||
@@ -197,6 +197,8 @@ static void HsIoctlSetCursorImage(
|
||||
NVHsChannelEvoRec *pHsChannel,
|
||||
NVSurfaceEvoRec *pSurfaceEvo)
|
||||
{
|
||||
NVDevEvoPtr pDevEvo = pHsChannel->pDispEvo->pDevEvo;
|
||||
|
||||
/*
|
||||
* Increment the refcnt of the new surface, and
|
||||
* decrement the refcnt of the old surface.
|
||||
@@ -206,10 +208,10 @@ static void HsIoctlSetCursorImage(
|
||||
*/
|
||||
|
||||
HsChangeSurfaceFlipRefCount(
|
||||
pSurfaceEvo, TRUE /* increase */);
|
||||
pDevEvo, pSurfaceEvo, TRUE /* increase */);
|
||||
|
||||
HsChangeSurfaceFlipRefCount(
|
||||
pHsChannel->config.cursor.pSurfaceEvo, FALSE /* increase */);
|
||||
pDevEvo, pHsChannel->config.cursor.pSurfaceEvo, FALSE /* increase */);
|
||||
|
||||
pHsChannel->config.cursor.pSurfaceEvo = pSurfaceEvo;
|
||||
|
||||
|
||||
@@ -549,24 +549,25 @@ static NvBool HsFlipQueueEntryIsReady(
|
||||
* Update the reference count of all the surfaces described in the pHwState.
|
||||
*/
|
||||
static void HsUpdateFlipQueueEntrySurfaceRefCount(
|
||||
NVDevEvoPtr pDevEvo,
|
||||
const NVFlipChannelEvoHwState *pHwState,
|
||||
NvBool increase)
|
||||
{
|
||||
HsChangeSurfaceFlipRefCount(
|
||||
pHwState->pSurfaceEvo[NVKMS_LEFT], increase);
|
||||
pDevEvo, pHwState->pSurfaceEvo[NVKMS_LEFT], increase);
|
||||
|
||||
HsChangeSurfaceFlipRefCount(
|
||||
pHwState->pSurfaceEvo[NVKMS_RIGHT], increase);
|
||||
pDevEvo, pHwState->pSurfaceEvo[NVKMS_RIGHT], increase);
|
||||
|
||||
HsChangeSurfaceFlipRefCount(
|
||||
pHwState->completionNotifier.surface.pSurfaceEvo, increase);
|
||||
pDevEvo, pHwState->completionNotifier.surface.pSurfaceEvo, increase);
|
||||
|
||||
if (!pHwState->syncObject.usingSyncpt) {
|
||||
HsChangeSurfaceFlipRefCount(
|
||||
pHwState->syncObject.u.semaphores.acquireSurface.pSurfaceEvo, increase);
|
||||
pDevEvo, pHwState->syncObject.u.semaphores.acquireSurface.pSurfaceEvo, increase);
|
||||
|
||||
HsChangeSurfaceFlipRefCount(
|
||||
pHwState->syncObject.u.semaphores.releaseSurface.pSurfaceEvo, increase);
|
||||
pDevEvo, pHwState->syncObject.u.semaphores.releaseSurface.pSurfaceEvo, increase);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -605,7 +606,7 @@ static void HsReleaseFlipQueueEntry(
|
||||
* HeadSurface no longer needs to read from the surfaces in pHwState;
|
||||
* decrement their reference counts.
|
||||
*/
|
||||
HsUpdateFlipQueueEntrySurfaceRefCount(pHwState, FALSE);
|
||||
HsUpdateFlipQueueEntrySurfaceRefCount(pDevEvo, pHwState, FALSE);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -687,6 +688,7 @@ void nvHsPushFlipQueueEntry(
|
||||
const NvU8 layer,
|
||||
const NVFlipChannelEvoHwState *pHwState)
|
||||
{
|
||||
NVDevEvoPtr pDevEvo = pHsChannel->pDispEvo->pDevEvo;
|
||||
NVListRec *pFlipQueue = &pHsChannel->flipQueue[layer].queue;
|
||||
NVHsChannelFlipQueueEntry *pEntry = nvCalloc(1, sizeof(*pEntry));
|
||||
|
||||
@@ -703,7 +705,7 @@ void nvHsPushFlipQueueEntry(
|
||||
|
||||
/* Increment the ref counts on the surfaces in the flip queue entry. */
|
||||
|
||||
HsUpdateFlipQueueEntrySurfaceRefCount(&pEntry->hwState, TRUE);
|
||||
HsUpdateFlipQueueEntrySurfaceRefCount(pDevEvo, &pEntry->hwState, TRUE);
|
||||
|
||||
/* "Fast forward" through existing flip queue entries that are ready. */
|
||||
|
||||
@@ -2092,6 +2094,17 @@ static NvBool HsCanOmitNonSgHsUpdate(NVHsChannelEvoPtr pHsChannel)
|
||||
const NVSwapGroupRec *pHeadSwapGroup =
|
||||
pHsChannel->pDispEvo->pSwapGroup[pHsChannel->apiHead];
|
||||
|
||||
/*
|
||||
* When fullscreen swapgroup flipping, updating
|
||||
* non-swapgroup content at vblank is unnecessary and
|
||||
* dangerous, since it results in releasing client
|
||||
* semaphores before their contents have actually been
|
||||
* displayed.
|
||||
*/
|
||||
if (pHsChannel->swapGroupFlipping) {
|
||||
return NV_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* In the case of a fullscreen swapgroup, we can generally omit updating
|
||||
* the headsurface entirely upon vblank as long as the client is
|
||||
@@ -2251,8 +2264,11 @@ static void HsVBlankCallback(NVDispEvoRec *pDispEvo,
|
||||
*/
|
||||
|
||||
/*
|
||||
* When fullscreen swapgroup flipping, we don't need to update
|
||||
* non-swapgroup content at vblank.
|
||||
* When fullscreen swapgroup flipping, updating
|
||||
* non-swapgroup content at vblank is unnecessary and
|
||||
* dangerous, since it results in releasing client
|
||||
* semaphores before their contents have actually been
|
||||
* displayed.
|
||||
*/
|
||||
if (!pHsChannel->swapGroupFlipping) {
|
||||
nvHsNextFrame(pHsDevice, pHsChannel,
|
||||
|
||||
@@ -992,7 +992,7 @@ void nvEvoFreeClientSurfaces(NVDevEvoPtr pDevEvo,
|
||||
nvEvoDestroyApiHandle(pOpenDevSurfaceHandles, surfaceHandle);
|
||||
|
||||
if (isOwner) {
|
||||
nvEvoDecrementSurfaceRefCnts(pSurfaceEvo);
|
||||
nvEvoDecrementSurfaceRefCnts(pDevEvo, pSurfaceEvo);
|
||||
} else {
|
||||
nvEvoDecrementSurfaceStructRefCnt(pSurfaceEvo);
|
||||
}
|
||||
@@ -1037,7 +1037,7 @@ void nvEvoUnregisterSurface(NVDevEvoPtr pDevEvo,
|
||||
/* Remove the handle from the calling client's namespace. */
|
||||
nvEvoDestroyApiHandle(pOpenDevSurfaceHandles, surfaceHandle);
|
||||
|
||||
nvEvoDecrementSurfaceRefCnts(pSurfaceEvo);
|
||||
nvEvoDecrementSurfaceRefCnts(pDevEvo, pSurfaceEvo);
|
||||
}
|
||||
|
||||
void nvEvoReleaseSurface(NVDevEvoPtr pDevEvo,
|
||||
@@ -1075,15 +1075,13 @@ void nvEvoIncrementSurfaceRefCnts(NVSurfaceEvoPtr pSurfaceEvo)
|
||||
pSurfaceEvo->structRefCnt++;
|
||||
}
|
||||
|
||||
void nvEvoDecrementSurfaceRefCnts(NVSurfaceEvoPtr pSurfaceEvo)
|
||||
void nvEvoDecrementSurfaceRefCnts(NVDevEvoPtr pDevEvo,
|
||||
NVSurfaceEvoPtr pSurfaceEvo)
|
||||
{
|
||||
nvAssert(pSurfaceEvo->rmRefCnt >= 1);
|
||||
pSurfaceEvo->rmRefCnt--;
|
||||
|
||||
if (pSurfaceEvo->rmRefCnt == 0) {
|
||||
NVDevEvoPtr pDevEvo =
|
||||
nvGetDevEvoFromOpenDev(pSurfaceEvo->owner.pOpenDev);
|
||||
|
||||
/*
|
||||
* Don't sync if this surface was registered as not requiring display
|
||||
* hardware access, to WAR timeouts that result from OGL unregistering
|
||||
@@ -1288,7 +1286,7 @@ void nvEvoUnregisterDeferredRequestFifo(
|
||||
pDeferredRequestFifo->fifo,
|
||||
0);
|
||||
|
||||
nvEvoDecrementSurfaceRefCnts(pDeferredRequestFifo->pSurfaceEvo);
|
||||
nvEvoDecrementSurfaceRefCnts(pDevEvo, pDeferredRequestFifo->pSurfaceEvo);
|
||||
|
||||
nvFree(pDeferredRequestFifo);
|
||||
}
|
||||
|
||||
@@ -5568,13 +5568,6 @@ NvBool nvSurfaceEvoInAnyOpens(const NVSurfaceEvoRec *pSurfaceEvo)
|
||||
}
|
||||
#endif
|
||||
|
||||
NVDevEvoPtr nvGetDevEvoFromOpenDev(
|
||||
const struct NvKmsPerOpenDev *pOpenDev)
|
||||
{
|
||||
nvAssert(pOpenDev != NULL);
|
||||
return pOpenDev->pDevEvo;
|
||||
}
|
||||
|
||||
const struct NvKmsFlipPermissions *nvGetFlipPermissionsFromOpenDev(
|
||||
const struct NvKmsPerOpenDev *pOpenDev)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user