fix: BMG returns non-zero maxClockRate in zeDeviceGetMemoryProperties

Implemented getDeviceMemoryMaxClkRate() override for BMG Linux to query
actual memory clock rate from DRM driver instead of returning 0.

Updated unit test to dynamically verify maxClockRate matches ProductHelper
return value instead of expecting hardcoded 0.

Related-To: NEO-16805

Signed-off-by: Jack Myers <jack.myers@intel.com>
This commit is contained in:
Jack Myers
2025-11-26 00:26:24 +00:00
committed by Compute-Runtime-Automation
parent 6acdd40126
commit 175c8a821f
3 changed files with 35 additions and 1 deletions

View File

@@ -6,6 +6,7 @@
*/
#include "shared/source/helpers/hw_info.h"
#include "shared/source/os_interface/linux/drm_neo.h"
#include "shared/source/os_interface/product_helper_hw.h"
#include "shared/source/xe2_hpg_core/hw_cmds_bmg.h"
#include "shared/source/xe2_hpg_core/hw_info_bmg.h"
@@ -49,5 +50,20 @@ bool ProductHelperHw<gfxProduct>::useSharedSystemUsm() const {
return false;
}
template <>
uint32_t ProductHelperHw<gfxProduct>::getDeviceMemoryMaxClkRate(const HardwareInfo &hwInfo, const OSInterface *osIface, uint32_t subDeviceIndex) const {
if (osIface == nullptr) {
return 0;
}
auto pDrm = osIface->getDriverModel()->as<Drm>();
uint32_t memoryMaxClkRateInMhz = 0;
if (pDrm->getDeviceMemoryMaxClockRateInMhz(subDeviceIndex, memoryMaxClkRateInMhz) == false) {
return 0;
}
return memoryMaxClkRateInMhz;
}
template class ProductHelperHw<gfxProduct>;
} // namespace NEO