[SWDEV-481004] Fix for incorrect gfx_version number (#8)
The target_graphics_version was not formatted properly and was showing incorrect Target Name. Corrected this by fomatting major, minor and revision numbers. Signed-off-by: Bindhiya Kanangot Balakrishnan <Bindhiya.KanangotBalakrishnan@amd.com>
This commit is contained in:
committed by
GitHub
orang tua
aefc865bf4
melakukan
94dca7073b
+1
-1
@@ -5365,7 +5365,7 @@ rsmi_status_t rsmi_dev_target_graphics_version_get(uint32_t dv_ind,
|
||||
}
|
||||
if (ret == RSMI_STATUS_SUCCESS) {
|
||||
version = amd::smi::removeString(version, "gfx");
|
||||
*gfx_version = std::stoull(version);
|
||||
*gfx_version = uint64_t(std::stoull(version, nullptr, 16));
|
||||
}
|
||||
ss << __PRETTY_FUNCTION__
|
||||
<< " | ======= end ======= "
|
||||
|
||||
@@ -1193,11 +1193,13 @@ rsmi_status_t rsmi_get_gfx_target_version(uint32_t dv_ind, std::string *gfx_vers
|
||||
// separate out parts -> put back into normal graphics version format
|
||||
major = static_cast<uint64_t>((orig_target_version / 10000) * 100);
|
||||
minor = static_cast<uint64_t>((orig_target_version % 10000 / 100) * 10);
|
||||
if ((minor == 0) && (countDigit(major) < 4)) {
|
||||
major *= 10; // 0 as a minor is correct, but bump up by 10
|
||||
}
|
||||
rev = static_cast<uint64_t>(orig_target_version % 100);
|
||||
*gfx_version = "gfx" + std::to_string(major + minor + rev);
|
||||
|
||||
ss << std::hex << rev;
|
||||
std::string revision = ss.str();
|
||||
*gfx_version = "gfx" + std::to_string((major + minor)/10) + revision;
|
||||
|
||||
ss.str("");
|
||||
ss << __PRETTY_FUNCTION__
|
||||
<< " | " << std::dec << "kfd_target_version = " << orig_target_version
|
||||
<< "; major = " << major << "; minor = " << minor << "; rev = "
|
||||
|
||||
Reference in New Issue
Block a user