mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-02-08 00:59:58 +00:00
520.56.06
This commit is contained in:
@@ -636,33 +636,27 @@ typedef enum
|
||||
#define NV_GET_NV_STATE(pGpu) \
|
||||
(nv_state_t *)((pGpu) ? (pGpu)->pOsGpuInfo : NULL)
|
||||
|
||||
static inline NvBool IS_REG_OFFSET(nv_state_t *nv, NvU64 offset, NvU64 length)
|
||||
{
|
||||
return ((offset >= nv->regs->cpu_address) &&
|
||||
((offset + (length - 1)) <= (nv->regs->cpu_address + (nv->regs->size - 1))));
|
||||
}
|
||||
#define IS_REG_OFFSET(nv, offset, length) \
|
||||
(((offset) >= (nv)->regs->cpu_address) && \
|
||||
(((offset) + ((length)-1)) <= \
|
||||
(nv)->regs->cpu_address + ((nv)->regs->size-1)))
|
||||
|
||||
static inline NvBool IS_FB_OFFSET(nv_state_t *nv, NvU64 offset, NvU64 length)
|
||||
{
|
||||
return ((nv->fb) && (offset >= nv->fb->cpu_address) &&
|
||||
((offset + (length - 1)) <= (nv->fb->cpu_address + (nv->fb->size - 1))));
|
||||
}
|
||||
#define IS_FB_OFFSET(nv, offset, length) \
|
||||
(((nv)->fb) && ((offset) >= (nv)->fb->cpu_address) && \
|
||||
(((offset) + ((length)-1)) <= (nv)->fb->cpu_address + ((nv)->fb->size-1)))
|
||||
|
||||
static inline NvBool IS_UD_OFFSET(nv_state_t *nv, NvU64 offset, NvU64 length)
|
||||
{
|
||||
return ((nv->ud.cpu_address != 0) && (nv->ud.size != 0) &&
|
||||
(offset >= nv->ud.cpu_address) &&
|
||||
((offset + (length - 1)) <= (nv->ud.cpu_address + (nv->ud.size - 1))));
|
||||
}
|
||||
#define IS_UD_OFFSET(nv, offset, length) \
|
||||
(((nv)->ud.cpu_address != 0) && ((nv)->ud.size != 0) && \
|
||||
((offset) >= (nv)->ud.cpu_address) && \
|
||||
(((offset) + ((length)-1)) <= (nv)->ud.cpu_address + ((nv)->ud.size-1)))
|
||||
|
||||
static inline NvBool IS_IMEM_OFFSET(nv_state_t *nv, NvU64 offset, NvU64 length)
|
||||
{
|
||||
return ((nv->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address != 0) &&
|
||||
(nv->bars[NV_GPU_BAR_INDEX_IMEM].size != 0) &&
|
||||
(offset >= nv->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address) &&
|
||||
((offset + (length - 1)) <= (nv->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address +
|
||||
(nv->bars[NV_GPU_BAR_INDEX_IMEM].size - 1))));
|
||||
}
|
||||
#define IS_IMEM_OFFSET(nv, offset, length) \
|
||||
(((nv)->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address != 0) && \
|
||||
((nv)->bars[NV_GPU_BAR_INDEX_IMEM].size != 0) && \
|
||||
((offset) >= (nv)->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address) && \
|
||||
(((offset) + ((length) - 1)) <= \
|
||||
(nv)->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address + \
|
||||
((nv)->bars[NV_GPU_BAR_INDEX_IMEM].size - 1)))
|
||||
|
||||
#define NV_RM_MAX_MSIX_LINES 8
|
||||
|
||||
|
||||
@@ -780,8 +780,10 @@ static NV_STATUS RmAccessRegistry(
|
||||
RmStatus = NV_ERR_INVALID_STRING_LENGTH;
|
||||
goto done;
|
||||
}
|
||||
|
||||
// get access to client's parmStr
|
||||
RMAPI_PARAM_COPY_INIT(parmStrParamCopy, tmpParmStr, clientParmStrAddress, ParmStrLength, 1);
|
||||
parmStrParamCopy.flags |= RMAPI_PARAM_COPY_FLAGS_ZERO_BUFFER;
|
||||
RmStatus = rmapiParamsAcquire(&parmStrParamCopy, NV_TRUE);
|
||||
if (RmStatus != NV_OK)
|
||||
{
|
||||
@@ -2027,7 +2029,6 @@ static NV_STATUS RmGetAllocPrivate(
|
||||
PMEMORY_DESCRIPTOR pMemDesc;
|
||||
NvU32 pageOffset;
|
||||
NvU64 pageCount;
|
||||
NvU64 endingOffset;
|
||||
RsResourceRef *pResourceRef;
|
||||
RmResource *pRmResource;
|
||||
void *pMemData;
|
||||
@@ -2088,9 +2089,8 @@ static NV_STATUS RmGetAllocPrivate(
|
||||
if (rmStatus != NV_OK)
|
||||
goto done;
|
||||
|
||||
endingOffset = pageOffset + length;
|
||||
pageCount = (endingOffset / os_page_size);
|
||||
pageCount += (*pPageIndex + ((endingOffset % os_page_size) ? 1 : 0));
|
||||
pageCount = ((pageOffset + length) / os_page_size);
|
||||
pageCount += (*pPageIndex + (((pageOffset + length) % os_page_size) ? 1 : 0));
|
||||
|
||||
if (pageCount > NV_RM_PAGES_TO_OS_PAGES(pMemDesc->PageCount))
|
||||
{
|
||||
|
||||
@@ -638,15 +638,6 @@ osInitNvMapping(
|
||||
sysApplyLockingPolicy(pSys);
|
||||
|
||||
pGpu->busInfo.IntLine = nv->interrupt_line;
|
||||
|
||||
//
|
||||
// Set the DMA address size as soon as we have the HAL to call to
|
||||
// determine the precise number of physical address bits supported
|
||||
// by the architecture. DMA allocations should not be made before
|
||||
// this point.
|
||||
//
|
||||
nv_set_dma_address_size(nv, gpuGetPhysAddrWidth_HAL(pGpu, ADDR_SYSMEM));
|
||||
|
||||
pGpu->dmaStartAddress = (RmPhysAddr)nv_get_dma_start_address(nv);
|
||||
if (nv->fb != NULL)
|
||||
{
|
||||
@@ -735,6 +726,15 @@ osTeardownScalability(
|
||||
return clTeardownPcie(pGpu, pCl);
|
||||
}
|
||||
|
||||
static inline void
|
||||
RmSetDeviceDmaAddressSize(
|
||||
nv_state_t *nv,
|
||||
NvU8 numDmaAddressBits
|
||||
)
|
||||
{
|
||||
nv_set_dma_address_size(nv, numDmaAddressBits);
|
||||
}
|
||||
|
||||
static void
|
||||
populateDeviceAttributes(
|
||||
OBJGPU *pGpu,
|
||||
@@ -884,6 +884,8 @@ RmInitNvDevice(
|
||||
return;
|
||||
}
|
||||
|
||||
RmSetDeviceDmaAddressSize(nv, gpuGetPhysAddrWidth_HAL(pGpu, ADDR_SYSMEM));
|
||||
|
||||
os_disable_console_access();
|
||||
|
||||
status->rmStatus = gpumgrStateInitGpu(pGpu);
|
||||
@@ -1187,7 +1189,7 @@ NvBool RmInitPrivateState(
|
||||
// Set up a reasonable default DMA address size, based on the minimum
|
||||
// possible on currently supported GPUs.
|
||||
//
|
||||
nv_set_dma_address_size(pNv, NV_GPU_MIN_SUPPORTED_DMA_ADDR_WIDTH);
|
||||
RmSetDeviceDmaAddressSize(pNv, NV_GPU_MIN_SUPPORTED_DMA_ADDR_WIDTH);
|
||||
|
||||
os_mem_set(nvp, 0, sizeof(*nvp));
|
||||
nvp->status = NV_ERR_INVALID_STATE;
|
||||
@@ -1581,7 +1583,7 @@ NvBool RmInitAdapter(
|
||||
//
|
||||
if (nv->request_firmware)
|
||||
{
|
||||
nv_set_dma_address_size(nv, NV_GSP_GPU_MIN_SUPPORTED_DMA_ADDR_WIDTH);
|
||||
RmSetDeviceDmaAddressSize(nv, NV_GSP_GPU_MIN_SUPPORTED_DMA_ADDR_WIDTH);
|
||||
|
||||
gspFwHandle = nv_get_firmware(nv, NV_FIRMWARE_GSP,
|
||||
&gspFw.pBuf,
|
||||
|
||||
Reference in New Issue
Block a user