mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-01 12:33:12 +08:00
Moving to D3DDDI_ALLOCATIONINFO v2
Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6a43b6b609
commit
75e427f2e8
@@ -39,7 +39,8 @@ bool Gdi::setupHwQueueProcAddresses() {
|
||||
bool Gdi::getAllProcAddresses() {
|
||||
openAdapterFromHdc = reinterpret_cast<PFND3DKMT_OPENADAPTERFROMHDC>(gdiDll.getProcAddress("D3DKMTOpenAdapterFromHdc"));
|
||||
openAdapterFromLuid = reinterpret_cast<PFND3DKMT_OPENADAPTERFROMLUID>(gdiDll.getProcAddress("D3DKMTOpenAdapterFromLuid"));
|
||||
createAllocation = reinterpret_cast<PFND3DKMT_CREATEALLOCATION>(gdiDll.getProcAddress("D3DKMTCreateAllocation"));
|
||||
createAllocation_ = reinterpret_cast<PFND3DKMT_CREATEALLOCATION>(gdiDll.getProcAddress("D3DKMTCreateAllocation"));
|
||||
createAllocation2 = reinterpret_cast<PFND3DKMT_CREATEALLOCATION>(gdiDll.getProcAddress("D3DKMTCreateAllocation2"));
|
||||
destroyAllocation = reinterpret_cast<PFND3DKMT_DESTROYALLOCATION>(gdiDll.getProcAddress("D3DKMTDestroyAllocation"));
|
||||
destroyAllocation2 = reinterpret_cast<PFND3DKMT_DESTROYALLOCATION2>(gdiDll.getProcAddress("D3DKMTDestroyAllocation2"));
|
||||
queryAdapterInfo = reinterpret_cast<PFND3DKMT_QUERYADAPTERINFO>(gdiDll.getProcAddress("D3DKMTQueryAdapterInfo"));
|
||||
@@ -84,7 +85,7 @@ bool Gdi::getAllProcAddresses() {
|
||||
getDeviceState = reinterpret_cast<PFND3DKMT_GETDEVICESTATE>(gdiDll.getProcAddress("D3DKMTGetDeviceState"));
|
||||
|
||||
// clang-format off
|
||||
if (openAdapterFromHdc && openAdapterFromLuid && createAllocation && destroyAllocation
|
||||
if (openAdapterFromHdc && openAdapterFromLuid && createAllocation2 && destroyAllocation
|
||||
&& destroyAllocation2 && queryAdapterInfo && closeAdapter && createDevice
|
||||
&& destroyDevice && escape && createContext && destroyContext
|
||||
&& openResource && queryResourceInfo && lock && unlock && render
|
||||
|
||||
@@ -25,7 +25,8 @@ class Gdi {
|
||||
|
||||
ThkWrapper<IN OUT D3DKMT_OPENADAPTERFROMHDC *> openAdapterFromHdc{};
|
||||
ThkWrapper<IN OUT D3DKMT_OPENADAPTERFROMLUID *> openAdapterFromLuid{};
|
||||
ThkWrapper<IN OUT D3DKMT_CREATEALLOCATION *> createAllocation{};
|
||||
ThkWrapper<IN OUT D3DKMT_CREATEALLOCATION *> createAllocation_{};
|
||||
ThkWrapper<IN OUT D3DKMT_CREATEALLOCATION *> createAllocation2{};
|
||||
ThkWrapper<IN CONST D3DKMT_DESTROYALLOCATION *> destroyAllocation{};
|
||||
ThkWrapper<IN CONST D3DKMT_DESTROYALLOCATION2 *> destroyAllocation2{};
|
||||
ThkWrapper<IN CONST D3DKMT_QUERYADAPTERINFO *> queryAdapterInfo{};
|
||||
|
||||
@@ -512,7 +512,7 @@ bool Wddm::freeGpuVirtualAddress(D3DGPU_VIRTUAL_ADDRESS &gpuPtr, uint64_t size)
|
||||
|
||||
NTSTATUS Wddm::createAllocation(const void *alignedCpuPtr, const Gmm *gmm, D3DKMT_HANDLE &outHandle, D3DKMT_HANDLE &outResourceHandle, D3DKMT_HANDLE *outSharedHandle) {
|
||||
NTSTATUS status = STATUS_UNSUCCESSFUL;
|
||||
D3DDDI_ALLOCATIONINFO AllocationInfo = {0};
|
||||
D3DDDI_ALLOCATIONINFO2 AllocationInfo = {0};
|
||||
D3DKMT_CREATEALLOCATION CreateAllocation = {0};
|
||||
|
||||
if (gmm == nullptr)
|
||||
@@ -534,10 +534,10 @@ NTSTATUS Wddm::createAllocation(const void *alignedCpuPtr, const Gmm *gmm, D3DKM
|
||||
CreateAllocation.Flags.CreateShared = outSharedHandle ? TRUE : FALSE;
|
||||
CreateAllocation.Flags.RestrictSharedAccess = FALSE;
|
||||
CreateAllocation.Flags.CreateResource = outSharedHandle || alignedCpuPtr ? TRUE : FALSE;
|
||||
CreateAllocation.pAllocationInfo = &AllocationInfo;
|
||||
CreateAllocation.pAllocationInfo2 = &AllocationInfo;
|
||||
CreateAllocation.hDevice = device;
|
||||
|
||||
status = getGdi()->createAllocation(&CreateAllocation);
|
||||
status = getGdi()->createAllocation2(&CreateAllocation);
|
||||
if (status != STATUS_SUCCESS) {
|
||||
DEBUG_BREAK_IF(true);
|
||||
return status;
|
||||
@@ -578,7 +578,7 @@ bool Wddm::setAllocationPriority(const D3DKMT_HANDLE *handles, uint32_t allocati
|
||||
|
||||
bool Wddm::createAllocation64k(const Gmm *gmm, D3DKMT_HANDLE &outHandle) {
|
||||
NTSTATUS status = STATUS_SUCCESS;
|
||||
D3DDDI_ALLOCATIONINFO AllocationInfo = {0};
|
||||
D3DDDI_ALLOCATIONINFO2 AllocationInfo = {0};
|
||||
D3DKMT_CREATEALLOCATION CreateAllocation = {0};
|
||||
|
||||
AllocationInfo.pSystemMem = 0;
|
||||
@@ -590,10 +590,10 @@ bool Wddm::createAllocation64k(const Gmm *gmm, D3DKMT_HANDLE &outHandle) {
|
||||
CreateAllocation.pPrivateRuntimeData = NULL;
|
||||
CreateAllocation.pPrivateDriverData = NULL;
|
||||
CreateAllocation.Flags.CreateResource = FALSE;
|
||||
CreateAllocation.pAllocationInfo = &AllocationInfo;
|
||||
CreateAllocation.pAllocationInfo2 = &AllocationInfo;
|
||||
CreateAllocation.hDevice = device;
|
||||
|
||||
status = getGdi()->createAllocation(&CreateAllocation);
|
||||
status = getGdi()->createAllocation2(&CreateAllocation);
|
||||
|
||||
if (status != STATUS_SUCCESS) {
|
||||
DEBUG_BREAK_IF(true);
|
||||
@@ -608,7 +608,7 @@ bool Wddm::createAllocation64k(const Gmm *gmm, D3DKMT_HANDLE &outHandle) {
|
||||
|
||||
NTSTATUS Wddm::createAllocationsAndMapGpuVa(OsHandleStorage &osHandles) {
|
||||
NTSTATUS status = STATUS_UNSUCCESSFUL;
|
||||
D3DDDI_ALLOCATIONINFO AllocationInfo[maxFragmentsCount] = {{0}};
|
||||
D3DDDI_ALLOCATIONINFO2 AllocationInfo[maxFragmentsCount] = {{0}};
|
||||
D3DKMT_CREATEALLOCATION CreateAllocation = {0};
|
||||
|
||||
auto allocationCount = 0;
|
||||
@@ -643,11 +643,11 @@ NTSTATUS Wddm::createAllocationsAndMapGpuVa(OsHandleStorage &osHandles) {
|
||||
CreateAllocation.Flags.CreateShared = FALSE;
|
||||
CreateAllocation.Flags.RestrictSharedAccess = FALSE;
|
||||
CreateAllocation.Flags.CreateResource = FALSE;
|
||||
CreateAllocation.pAllocationInfo = AllocationInfo;
|
||||
CreateAllocation.pAllocationInfo2 = AllocationInfo;
|
||||
CreateAllocation.hDevice = device;
|
||||
|
||||
while (status == STATUS_UNSUCCESSFUL) {
|
||||
status = getGdi()->createAllocation(&CreateAllocation);
|
||||
status = getGdi()->createAllocation2(&CreateAllocation);
|
||||
|
||||
if (status != STATUS_SUCCESS) {
|
||||
PRINT_DEBUG_STRING(DebugManager.flags.PrintDebugMessages.get(), stderr, __FUNCTION__ "status: %d", status);
|
||||
@@ -1109,7 +1109,7 @@ bool Wddm::configureDeviceAddressSpace() {
|
||||
deviceCallbacks.PagingQueue = pagingQueue;
|
||||
deviceCallbacks.PagingFence = pagingQueueSyncObject;
|
||||
|
||||
deviceCallbacks.DevCbPtrs.KmtCbPtrs.pfnAllocate = getGdi()->createAllocation;
|
||||
deviceCallbacks.DevCbPtrs.KmtCbPtrs.pfnAllocate = getGdi()->createAllocation_;
|
||||
deviceCallbacks.DevCbPtrs.KmtCbPtrs.pfnDeallocate = getGdi()->destroyAllocation;
|
||||
deviceCallbacks.DevCbPtrs.KmtCbPtrs.pfnMapGPUVA = getGdi()->mapGpuVirtualAddress;
|
||||
deviceCallbacks.DevCbPtrs.KmtCbPtrs.pfnMakeResident = getGdi()->makeResident;
|
||||
|
||||
Reference in New Issue
Block a user