Add wddm interface to get dedicated video memory size

Related-To: NEO-2687

Change-Id: I44b9cfad250c61d5fadcbdd09f68e2751b43a415
Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir 2019-07-29 14:32:37 +02:00
parent 4198e8f24f
commit 2e3f77a3e9
4 changed files with 12 additions and 0 deletions

View File

@ -144,6 +144,7 @@ bool Wddm::queryAdapterInfo() {
deviceRegistryPath = adapterInfo.DeviceRegistryPath;
systemSharedMemory = adapterInfo.SystemSharedMemory;
dedicatedVideoMemory = adapterInfo.DedicatedVideoMemory;
maxRenderFrequency = adapterInfo.MaxRenderFreq;
instrumentationEnabled = adapterInfo.Caps.InstrumentationIsEnabled != 0;
}
@ -812,6 +813,10 @@ uint64_t Wddm::getSystemSharedMemory() const {
return systemSharedMemory;
}
uint64_t Wddm::getDedicatedVideoMemory() const {
return dedicatedVideoMemory;
}
uint64_t Wddm::getMaxApplicationAddress() const {
return maximumApplicationAddress;
}

View File

@ -103,6 +103,7 @@ class Wddm {
}
uint64_t getSystemSharedMemory() const;
uint64_t getDedicatedVideoMemory() const;
uint64_t getMaxApplicationAddress() const;
@ -161,6 +162,7 @@ class Wddm {
std::unique_ptr<WorkaroundTable> workaroundTable;
GMM_GFX_PARTITIONING gfxPartition;
uint64_t systemSharedMemory = 0;
uint64_t dedicatedVideoMemory = 0;
uint32_t maxRenderFrequency = 0;
bool instrumentationEnabled = false;
std::string deviceRegistryPath;

View File

@ -25,6 +25,7 @@ class WddmMock : public Wddm {
public:
using Wddm::adapter;
using Wddm::currentPagingFenceValue;
using Wddm::dedicatedVideoMemory;
using Wddm::device;
using Wddm::featureTable;
using Wddm::gdi;

View File

@ -63,6 +63,10 @@ struct Wddm23Tests : public Wddm23TestsWithoutWddmInit {
}
};
TEST_F(Wddm23Tests, whenGetDedicatedVideoMemoryIsCalledThenCorrectValueIsReturned) {
EXPECT_EQ(wddm->dedicatedVideoMemory, wddm->getDedicatedVideoMemory());
}
TEST_F(Wddm23Tests, whenCreateContextIsCalledThenEnableHwQueues) {
EXPECT_TRUE(wddm->wddmInterface->hwQueuesSupported());
EXPECT_EQ(1u, getCreateContextDataFcn()->Flags.HwQueueSupported);