File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
shared/source/os_interface/linux/xe Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -806,12 +806,20 @@ uint64_t IoctlHelperXe::getPreferredLocationArgs(MemAdvise memAdviseOp) {
806806 // Assumes that the default location is Device VRAM.
807807 const auto preferredLocation = static_cast <uint64_t >(getDrmParamValue (DrmParam::memoryAdviseLocationDevice));
808808 const auto policy = static_cast <uint64_t >(getDrmParamValue (DrmParam::memoryAdviseMigrationPolicyAllPages));
809- param = (preferredLocation << 32 ) | policy;
809+ const auto regionInstance = static_cast <uint64_t >(0 );
810+ param = (preferredLocation << 32 ) | (policy << 16 ) | regionInstance;
811+ } break ;
812+ case MemAdvise::setPreferredLocation: {
813+ const auto preferredLocation = static_cast <uint64_t >(deviceFd);
814+ const auto policy = static_cast <uint64_t >(getDrmParamValue (DrmParam::memoryAdviseMigrationPolicyAllPages));
815+ const auto regionInstance = static_cast <uint64_t >(1 );
816+ param = (preferredLocation << 32 ) | (policy << 16 ) | regionInstance;
810817 } break ;
811818 case MemAdvise::setSystemMemoryPreferredLocation: {
812819 const auto preferredLocation = static_cast <uint64_t >(getDrmParamValue (DrmParam::memoryAdviseLocationSystem));
813820 const auto policy = static_cast <uint64_t >(getDrmParamValue (DrmParam::memoryAdviseMigrationPolicySystemPages));
814- param = (preferredLocation << 32 ) | policy;
821+ const auto regionInstance = static_cast <uint64_t >(0 );
822+ param = (preferredLocation << 32 ) | (policy << 16 ) | regionInstance;
815823 } break ;
816824 default :
817825 xeLog (" Invalid advise operation %s\n " , __FUNCTION__);
You can’t perform that action at this time.
0 commit comments