520.61.05

This commit is contained in:
Andy Ritger
2022-10-10 14:59:24 -07:00
parent fe0728787f
commit 90eb10774f
758 changed files with 88383 additions and 26493 deletions

View File

@@ -118,12 +118,6 @@ struct NvKmsKapiSurface {
NvKmsSurfaceHandle hKmsHandle;
};
enum NvKmsKapiAllocationType {
NVKMS_KAPI_ALLOCATION_TYPE_SCANOUT = 0,
NVKMS_KAPI_ALLOCATION_TYPE_NOTIFIER = 1,
};
static inline void *nvKmsKapiCalloc(size_t nmem, size_t size)
{
return nvInternalAlloc(nmem * size, NV_TRUE);

View File

@@ -416,6 +416,12 @@ struct NvKmsKapiCreateSurfaceParams {
NvU8 log2GobsPerBlockY;
};
enum NvKmsKapiAllocationType {
NVKMS_KAPI_ALLOCATION_TYPE_SCANOUT = 0,
NVKMS_KAPI_ALLOCATION_TYPE_NOTIFIER = 1,
NVKMS_KAPI_ALLOCATION_TYPE_OFFSCREEN = 2,
};
struct NvKmsKapiFunctionsTable {
/*!
@@ -609,6 +615,8 @@ struct NvKmsKapiFunctionsTable {
* \param [in] device A device allocated using allocateDevice().
*
* \param [in] layout BlockLinear or Pitch.
*
* \param [in] type Allocation type.
*
* \param [in] size Size, in bytes, of the memory to allocate.
*
@@ -624,6 +632,7 @@ struct NvKmsKapiFunctionsTable {
(
struct NvKmsKapiDevice *device,
enum NvKmsSurfaceMemoryLayout layout,
enum NvKmsKapiAllocationType type,
NvU64 size,
NvU8 *compressible
);
@@ -637,6 +646,8 @@ struct NvKmsKapiFunctionsTable {
* \param [in] device A device allocated using allocateDevice().
*
* \param [in] layout BlockLinear or Pitch.
*
* \param [in] type Allocation type.
*
* \param [in] size Size, in bytes, of the memory to allocate.
*
@@ -652,6 +663,7 @@ struct NvKmsKapiFunctionsTable {
(
struct NvKmsKapiDevice *device,
enum NvKmsSurfaceMemoryLayout layout,
enum NvKmsKapiAllocationType type,
NvU64 size,
NvU8 *compressible
);

View File

@@ -452,7 +452,7 @@ NvBool nvKmsKapiAllocateSystemMemory(struct NvKmsKapiDevice *device,
{
NvU32 ret;
NV_MEMORY_ALLOCATION_PARAMS memAllocParams = { };
const NvKmsDispIOCoherencyModes *pIOCoherencyModes;
const NvKmsDispIOCoherencyModes *pIOCoherencyModes = NULL;
memAllocParams.owner = NVKMS_RM_HEAP_ID;
memAllocParams.size = size;
@@ -521,6 +521,9 @@ NvBool nvKmsKapiAllocateSystemMemory(struct NvKmsKapiDevice *device,
pIOCoherencyModes = &device->nisoIOCoherencyModes;
break;
case NVKMS_KAPI_ALLOCATION_TYPE_OFFSCREEN:
memAllocParams.flags |= NVOS32_ALLOC_FLAGS_NO_SCANOUT;
break;
default:
nvKmsKapiLogDeviceDebug(device, "Unknown Allocation Type");
@@ -532,7 +535,7 @@ NvBool nvKmsKapiAllocateSystemMemory(struct NvKmsKapiDevice *device,
memAllocParams.attr2 = FLD_SET_DRF(OS32, _ATTR2, _GPU_CACHEABLE, _NO,
memAllocParams.attr2);
if (!pIOCoherencyModes->coherent) {
if (pIOCoherencyModes == NULL || !pIOCoherencyModes->coherent) {
memAllocParams.attr = FLD_SET_DRF(OS32, _ATTR, _COHERENCY,
_WRITE_COMBINE, memAllocParams.attr);
} else {
@@ -673,6 +676,15 @@ NvBool nvKmsKapiAllocateVideoMemory(struct NvKmsKapiDevice *device,
memAllocParams.attr);
break;
case NVKMS_KAPI_ALLOCATION_TYPE_OFFSCREEN:
memAllocParams.type = NVOS32_TYPE_IMAGE;
memAllocParams.flags |=
NVOS32_ALLOC_FLAGS_NO_SCANOUT |
NVOS32_ALLOC_FLAGS_FORCE_MEM_GROWS_UP;
memAllocParams.attr =
FLD_SET_DRF(OS32, _ATTR, _PHYSICALITY, _NONCONTIGUOUS,
memAllocParams.attr);
break;
default:
nvKmsKapiLogDeviceDebug(device, "Unknown Allocation Type");
return NV_FALSE;
@@ -1219,6 +1231,7 @@ static struct NvKmsKapiMemory* AllocateVideoMemory
(
struct NvKmsKapiDevice *device,
enum NvKmsSurfaceMemoryLayout layout,
enum NvKmsKapiAllocationType type,
NvU64 size,
NvU8 *compressible
)
@@ -1236,7 +1249,7 @@ static struct NvKmsKapiMemory* AllocateVideoMemory
hRmHandle,
layout,
size,
NVKMS_KAPI_ALLOCATION_TYPE_SCANOUT,
type,
compressible)) {
nvKmsKapiFreeRmHandle(device, hRmHandle);
FreeMemory(device, memory);
@@ -1258,6 +1271,7 @@ static struct NvKmsKapiMemory* AllocateSystemMemory
(
struct NvKmsKapiDevice *device,
enum NvKmsSurfaceMemoryLayout layout,
enum NvKmsKapiAllocationType type,
NvU64 size,
NvU8 *compressible
)
@@ -1275,7 +1289,7 @@ static struct NvKmsKapiMemory* AllocateSystemMemory
hRmHandle,
layout,
size,
NVKMS_KAPI_ALLOCATION_TYPE_SCANOUT,
type,
compressible)) {
nvKmsKapiFreeRmHandle(device, hRmHandle);
FreeMemory(device, memory);