mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
feature: set priority for lowPriority contexts
Related-To: NEO-10168 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
068f6a25c6
commit
72725e6ba9
@@ -137,9 +137,13 @@ bool IoctlHelperXe::initialize() {
|
||||
xeLog("DRM_XE_QUERY_CONFIG_VA_BITS\t\t%#llx\n",
|
||||
config->info[DRM_XE_QUERY_CONFIG_VA_BITS]);
|
||||
|
||||
xeLog("DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY\t\t%#llx\n",
|
||||
config->info[DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY]);
|
||||
|
||||
chipsetId = config->info[DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID] & 0xffff;
|
||||
revId = static_cast<int>((config->info[DRM_XE_QUERY_CONFIG_REV_AND_DEVICE_ID] >> 16) & 0xff);
|
||||
hasVram = config->info[DRM_XE_QUERY_CONFIG_FLAGS] & DRM_XE_QUERY_CONFIG_FLAG_HAS_VRAM ? 1 : 0;
|
||||
maxExecQueuePriority = config->info[DRM_XE_QUERY_CONFIG_MAX_EXEC_QUEUE_PRIORITY] & 0xffff;
|
||||
|
||||
memset(&queryConfig, 0, sizeof(queryConfig));
|
||||
queryConfig.query = DRM_XE_DEVICE_QUERY_HWCONFIG;
|
||||
|
||||
@@ -178,6 +178,7 @@ class IoctlHelperXe : public IoctlHelper {
|
||||
int revId = 0;
|
||||
int defaultAlignment = 0;
|
||||
int hasVram = 0;
|
||||
int maxExecQueuePriority = 0;
|
||||
uint32_t xeVmId = 0;
|
||||
int xeFileHandle = 0;
|
||||
std::mutex xeLock;
|
||||
|
||||
@@ -5,12 +5,26 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/source/os_interface/linux/os_context_linux.h"
|
||||
#include "shared/source/os_interface/linux/xe/ioctl_helper_xe.h"
|
||||
|
||||
#include "drm/xe_drm.h"
|
||||
|
||||
namespace NEO {
|
||||
void IoctlHelperXe::setContextProperties(const OsContextLinux &osContext, void *extProperties, uint32_t &extIndexInOut) {
|
||||
|
||||
auto &ext = *reinterpret_cast<std::array<drm_xe_ext_set_property, maxContextSetProperties> *>(extProperties);
|
||||
|
||||
if (osContext.isLowPriority()) {
|
||||
ext[extIndexInOut].base.name = DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY;
|
||||
ext[extIndexInOut].property = DRM_XE_EXEC_QUEUE_SET_PROPERTY_PRIORITY;
|
||||
ext[extIndexInOut].value = 0;
|
||||
if (extIndexInOut > 0) {
|
||||
ext[extIndexInOut - 1].base.next_extension = castToUint64(&ext[extIndexInOut]);
|
||||
}
|
||||
extIndexInOut++;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user