From 3afaf7c7680e096dc3b72c491cda43c3528cd02b Mon Sep 17 00:00:00 2001 From: Anvesh Bakwad Date: Tue, 25 Aug 2026 17:57:49 +0000 Subject: [PATCH] feature: add support for error threshold uAPI Related-To: SYSM-396 Signed-off-by: Anvesh Bakwad --- .../shared/linux/nl_api/sysman_drm_nl_api.cpp | 84 ++++++++++--------- .../shared/linux/nl_api/sysman_drm_nl_api.h | 7 +- .../linux/nl_api/sysman_drm_ras_uapi_ext.h | 29 ------- .../sources/linux/nl_api/mock_nl_api.cpp | 17 ++-- .../linux/nl_api/test_sysman_drm_nl_api.cpp | 14 ++-- third_party/uapi/drm-next/.version | 2 +- third_party/uapi/drm-next/drm/drm_ras.h | 30 +++++-- 7 files changed, 87 insertions(+), 96 deletions(-) delete mode 100644 level_zero/sysman/source/shared/linux/nl_api/sysman_drm_ras_uapi_ext.h diff --git a/level_zero/sysman/source/shared/linux/nl_api/sysman_drm_nl_api.cpp b/level_zero/sysman/source/shared/linux/nl_api/sysman_drm_nl_api.cpp index 9deefaae000b3..48d11c4d183f2 100644 --- a/level_zero/sysman/source/shared/linux/nl_api/sysman_drm_nl_api.cpp +++ b/level_zero/sysman/source/shared/linux/nl_api/sysman_drm_nl_api.cpp @@ -103,7 +103,7 @@ int DrmNlApi::handleMsg(struct nl_msg *msg) { int DrmNlApi::handleAck(struct nl_msg *msg) { auto isAckOnlyCmd = [](uint16_t cmdOp) { - return cmdOp == DRM_RAS_CMD_CLEAR_ERROR_COUNTER || cmdOp == NEO_DRM_RAS_CMD_SET_ERROR_THRESHOLD; + return cmdOp == DRM_RAS_CMD_CLEAR_ERROR_COUNTER || cmdOp == DRM_RAS_CMD_SET_ERROR_THRESHOLD; }; struct nlmsghdr *nlh = pNlApi->nlmsgHdr(msg); @@ -284,17 +284,17 @@ ze_result_t DrmNlApi::getErrorThresholdRsp(struct nl_cache_ops *ops, struct genl DrmErrorThreshold *threshold = reinterpret_cast(currentOperation->pOutput); UNRECOVERABLE_IF(threshold == nullptr); - if (info->attrs[NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_ID]) { + if (info->attrs[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID]) { threshold->errorId = pNlApi->nlaGetU32( - info->attrs[NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_ID]); + info->attrs[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID]); } - if (info->attrs[NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_NAME]) { + if (info->attrs[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_NAME]) { threshold->errorName = pNlApi->nlaGetString( - info->attrs[NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_NAME]); + info->attrs[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_NAME]); } - if (info->attrs[NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_THRESHOLD]) { + if (info->attrs[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_THRESHOLD]) { threshold->threshold = pNlApi->nlaGetU32( - info->attrs[NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_THRESHOLD]); + info->attrs[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_THRESHOLD]); } currentOperation->done = true; @@ -477,12 +477,12 @@ ze_result_t DrmNlApi::issueRequestSetThreshold(const uint32_t &nodeId, const uin } struct nl_msg *msg; - result = allocMsg(NEO_DRM_RAS_CMD_SET_ERROR_THRESHOLD, false, msg); + result = allocMsg(DRM_RAS_CMD_SET_ERROR_THRESHOLD, false, msg); if (ZE_RESULT_SUCCESS == result) { - pNlApi->nlaPutU32(msg, NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_NODE_ID, nodeId); - pNlApi->nlaPutU32(msg, NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_ID, errorId); - pNlApi->nlaPutU32(msg, NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_THRESHOLD, threshold); - result = performTransaction(NEO_DRM_RAS_CMD_SET_ERROR_THRESHOLD, msg, nullptr, false); + pNlApi->nlaPutU32(msg, DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID, nodeId); + pNlApi->nlaPutU32(msg, DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID, errorId); + pNlApi->nlaPutU32(msg, DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_THRESHOLD, threshold); + result = performTransaction(DRM_RAS_CMD_SET_ERROR_THRESHOLD, msg, nullptr, false); } cleanupConnection(); @@ -496,11 +496,11 @@ ze_result_t DrmNlApi::issueRequestGetThreshold(const uint32_t &nodeId, const uin } struct nl_msg *msg; - result = allocMsg(NEO_DRM_RAS_CMD_GET_ERROR_THRESHOLD, false, msg); + result = allocMsg(DRM_RAS_CMD_GET_ERROR_THRESHOLD, false, msg); if (ZE_RESULT_SUCCESS == result) { - pNlApi->nlaPutU32(msg, NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_NODE_ID, nodeId); - pNlApi->nlaPutU32(msg, NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_ID, errorId); - result = performTransaction(NEO_DRM_RAS_CMD_GET_ERROR_THRESHOLD, msg, pOutput, false); + pNlApi->nlaPutU32(msg, DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID, nodeId); + pNlApi->nlaPutU32(msg, DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID, errorId); + result = performTransaction(DRM_RAS_CMD_GET_ERROR_THRESHOLD, msg, pOutput, false); } cleanupConnection(); @@ -533,22 +533,25 @@ void DrmNlApi::setupNlOperations() { nodePolicy[DRM_RAS_A_NODE_ATTRS_NODE_NAME].type = NLA_NUL_STRING; nodePolicy[DRM_RAS_A_NODE_ATTRS_NODE_TYPE].type = NLA_U32; - // Setup error counter attribute policy + // Setup error counter attribute policy, shared by the error counter and the error threshold commands memset(errorPolicy, 0, sizeof(nla_policy) * (DRM_RAS_A_ERROR_COUNTER_ATTRS_MAX + 1)); errorPolicy[DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID].type = NLA_U32; errorPolicy[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID].type = NLA_U32; errorPolicy[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_NAME].type = NLA_NUL_STRING; errorPolicy[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_VALUE].type = NLA_U32; + errorPolicy[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_THRESHOLD].type = NLA_U32; - // Setup threshold attribute policy - memset(thresholdPolicy, 0, sizeof(nla_policy) * (NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_MAX + 1)); - thresholdPolicy[NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_NODE_ID].type = NLA_U32; - thresholdPolicy[NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_ID].type = NLA_U32; - thresholdPolicy[NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_NAME].type = NLA_NUL_STRING; - thresholdPolicy[NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_THRESHOLD].type = NLA_U32; + // Setup error event attribute policy + memset(eventPolicy, 0, sizeof(nla_policy) * (DRM_RAS_A_ERROR_EVENT_ATTRS_MAX + 1)); + eventPolicy[DRM_RAS_A_ERROR_EVENT_ATTRS_DEVICE_NAME].type = NLA_NUL_STRING; + eventPolicy[DRM_RAS_A_ERROR_EVENT_ATTRS_NODE_ID].type = NLA_U32; + eventPolicy[DRM_RAS_A_ERROR_EVENT_ATTRS_NODE_NAME].type = NLA_NUL_STRING; + eventPolicy[DRM_RAS_A_ERROR_EVENT_ATTRS_ERROR_ID].type = NLA_U32; + eventPolicy[DRM_RAS_A_ERROR_EVENT_ATTRS_ERROR_NAME].type = NLA_NUL_STRING; + eventPolicy[DRM_RAS_A_ERROR_EVENT_ATTRS_ERROR_VALUE].type = NLA_U32; // Setup commands - memset(newCmds, 0, sizeof(genl_cmd) * NEO_DRM_RAS_CMD_MAX); + memset(newCmds, 0, sizeof(genl_cmd) * DRM_RAS_CMD_MAX); newCmds[0].c_id = DRM_RAS_CMD_LIST_NODES; newCmds[0].c_name = const_cast("LIST_NODES"); @@ -568,29 +571,28 @@ void DrmNlApi::setupNlOperations() { newCmds[2].c_attr_policy = errorPolicy; newCmds[2].c_msg_parser = nullptr; // ACK-only command, no data parser needed - newCmds[3].c_id = NEO_DRM_RAS_CMD_SET_ERROR_THRESHOLD; - newCmds[3].c_name = const_cast("SET_ERROR_THRESHOLD"); - newCmds[3].c_maxattr = NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_MAX; - newCmds[3].c_attr_policy = thresholdPolicy; - newCmds[3].c_msg_parser = nullptr; // SET has no reply payload; ACK is handled by NL_CB_ACK + newCmds[3].c_id = DRM_RAS_CMD_ERROR_EVENT; + newCmds[3].c_name = const_cast("ERROR_EVENT"); + newCmds[3].c_maxattr = DRM_RAS_A_ERROR_EVENT_ATTRS_MAX; + newCmds[3].c_attr_policy = eventPolicy; + newCmds[3].c_msg_parser = nullptr; // Events parsed in handleEventMsg - newCmds[4].c_id = NEO_DRM_RAS_CMD_GET_ERROR_THRESHOLD; + newCmds[4].c_id = DRM_RAS_CMD_GET_ERROR_THRESHOLD; newCmds[4].c_name = const_cast("GET_ERROR_THRESHOLD"); - newCmds[4].c_maxattr = NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_MAX; - newCmds[4].c_attr_policy = thresholdPolicy; + newCmds[4].c_maxattr = DRM_RAS_A_ERROR_COUNTER_ATTRS_MAX; + newCmds[4].c_attr_policy = errorPolicy; newCmds[4].c_msg_parser = &drmNlOperationGetThreshold; - newCmds[5].c_id = DRM_RAS_CMD_ERROR_EVENT; - newCmds[5].c_name = const_cast("ERROR_EVENT"); + newCmds[5].c_id = DRM_RAS_CMD_SET_ERROR_THRESHOLD; + newCmds[5].c_name = const_cast("SET_ERROR_THRESHOLD"); newCmds[5].c_maxattr = DRM_RAS_A_ERROR_COUNTER_ATTRS_MAX; newCmds[5].c_attr_policy = errorPolicy; - newCmds[5].c_msg_parser = nullptr; // Events parsed in handleEventMsg + newCmds[5].c_msg_parser = nullptr; // SET has no reply payload; ACK is handled by NL_CB_ACK - // Use fixed family name - ops.o_name = const_cast(DRM_RAS_FAMILY_NAME); // "drm-ras" + ops.o_name = const_cast(DRM_RAS_FAMILY_NAME); ops.o_hdrsize = 0U; ops.o_cmds = newCmds; - ops.o_ncmds = NEO_DRM_RAS_CMD_MAX; + ops.o_ncmds = DRM_RAS_CMD_MAX; } ze_result_t DrmNlApi::subscribeToEvents() { @@ -669,7 +671,7 @@ ze_result_t DrmNlApi::initEventSocket() { return ZE_RESULT_ERROR_UNKNOWN; } - eventGroupId = pNlApi->genlCtrlResolveGrp(nlEventSock, DRM_RAS_FAMILY_NAME, "error-notify"); + eventGroupId = pNlApi->genlCtrlResolveGrp(nlEventSock, DRM_RAS_FAMILY_NAME, DRM_RAS_MCGRP_ERROR_REPORT); if (eventGroupId < 0) { cleanupEventSocket(); return ZE_RESULT_ERROR_UNKNOWN; @@ -723,10 +725,10 @@ ze_result_t DrmNlApi::parseEventMessage(struct nl_msg *msg, DrmRasEvent &event) event = {}; while (pNlApi->nlaOk(nla, rem)) { switch (pNlApi->nlaType(nla)) { - case DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID: + case DRM_RAS_A_ERROR_EVENT_ATTRS_NODE_ID: event.nodeId = pNlApi->nlaGetU32(nla); break; - case DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID: + case DRM_RAS_A_ERROR_EVENT_ATTRS_ERROR_ID: event.errorId = pNlApi->nlaGetU32(nla); break; } diff --git a/level_zero/sysman/source/shared/linux/nl_api/sysman_drm_nl_api.h b/level_zero/sysman/source/shared/linux/nl_api/sysman_drm_nl_api.h index bcb7a298cdda9..1ee8a7fd68eb6 100644 --- a/level_zero/sysman/source/shared/linux/nl_api/sysman_drm_nl_api.h +++ b/level_zero/sysman/source/shared/linux/nl_api/sysman_drm_nl_api.h @@ -7,10 +7,11 @@ #pragma once #include "level_zero/sysman/source/shared/linux/nl_api/sysman_drm_ras_types.h" -#include "level_zero/sysman/source/shared/linux/nl_api/sysman_drm_ras_uapi_ext.h" #include "level_zero/sysman/source/shared/linux/nl_api/sysman_nl_api.h" #include +#include "third_party/uapi/drm-next/drm/drm_ras.h" + #include #include @@ -84,10 +85,10 @@ class DrmNlApi { ze_result_t issueRequestClearErrorCounter(const uint32_t &nodeId, const uint32_t &errorId); void setupNlOperations(); - struct genl_cmd newCmds[NEO_DRM_RAS_CMD_MAX] = {}; + struct genl_cmd newCmds[DRM_RAS_CMD_MAX] = {}; struct nla_policy nodePolicy[DRM_RAS_A_NODE_ATTRS_MAX + 1] = {}; struct nla_policy errorPolicy[DRM_RAS_A_ERROR_COUNTER_ATTRS_MAX + 1] = {}; - struct nla_policy thresholdPolicy[NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_MAX + 1] = {}; + struct nla_policy eventPolicy[DRM_RAS_A_ERROR_EVENT_ATTRS_MAX + 1] = {}; struct genl_ops ops = {}; std::string deviceName = {}; DrmRasEvent pendingEvent = {}; diff --git a/level_zero/sysman/source/shared/linux/nl_api/sysman_drm_ras_uapi_ext.h b/level_zero/sysman/source/shared/linux/nl_api/sysman_drm_ras_uapi_ext.h deleted file mode 100644 index bcc26bf4fca04..0000000000000 --- a/level_zero/sysman/source/shared/linux/nl_api/sysman_drm_ras_uapi_ext.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2026 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#pragma once - -#include "third_party/uapi/drm-next/drm/drm_ras.h" - -enum { - NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_NODE_ID = 1, - NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_ID, - NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_NAME, - NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_VALUE, - NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_THRESHOLD, - - __NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_MAX, - NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_MAX = (__NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_MAX - 1) -}; - -#define DRM_RAS_CMD_CLEAR_ERROR_COUNTER 3 -#define NEO_DRM_RAS_CMD_GET_ERROR_THRESHOLD 4 -#define NEO_DRM_RAS_CMD_SET_ERROR_THRESHOLD 5 -#define DRM_RAS_CMD_ERROR_EVENT 6 - -/* Total number of RAS commands including all extensions */ -#define NEO_DRM_RAS_CMD_MAX 6 diff --git a/level_zero/sysman/test/unit_tests/sources/linux/nl_api/mock_nl_api.cpp b/level_zero/sysman/test/unit_tests/sources/linux/nl_api/mock_nl_api.cpp index 52a401682876d..2234bca5dfce8 100644 --- a/level_zero/sysman/test/unit_tests/sources/linux/nl_api/mock_nl_api.cpp +++ b/level_zero/sysman/test/unit_tests/sources/linux/nl_api/mock_nl_api.cpp @@ -7,7 +7,6 @@ #include "level_zero/sysman/test/unit_tests/sources/linux/nl_api/mock_nl_api.h" -#include "level_zero/sysman/source/shared/linux/nl_api/sysman_drm_ras_uapi_ext.h" #include "level_zero/sysman/source/shared/linux/nl_api/sysman_iaf_nl_api.h" #include "gtest/gtest.h" @@ -338,11 +337,11 @@ int MockNlApi::genlHandleMsg(struct nl_msg *msg, void *arg) { } } } else if (getThreshold) { - next = addAttrib(info, next, NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_ID, 1); - next = addAttrib(info, next, NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_NAME, 7); - addAttrib(info, next, NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_ERROR_THRESHOLD, mockThresholdValue); + next = addAttrib(info, next, DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID, 1); + next = addAttrib(info, next, DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_NAME, 7); + addAttrib(info, next, DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_THRESHOLD, mockThresholdValue); for (int i = 0; i < pOps->o_ncmds; i++) { - if (pOps->o_cmds[i].c_id == NEO_DRM_RAS_CMD_GET_ERROR_THRESHOLD && pOps->o_cmds[i].c_msg_parser != nullptr) { + if (pOps->o_cmds[i].c_id == DRM_RAS_CMD_GET_ERROR_THRESHOLD && pOps->o_cmds[i].c_msg_parser != nullptr) { if (0 == (pOps->o_cmds[i].c_msg_parser)(reinterpret_cast(this), &pOps->o_cmds[i], &info, arg)) { succeeded = true; } @@ -453,11 +452,11 @@ int MockNlApi::nlRecvmsgsDefault(struct nl_sock *sock) { eventAttrChain = new MyNlattr; MyNlattr *next = eventAttrChain; - next->type = DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID; + next->type = DRM_RAS_A_ERROR_EVENT_ATTRS_NODE_ID; next->content = eventNodeId; next = next->addNext(); - next->type = DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID; + next->type = DRM_RAS_A_ERROR_EVENT_ATTRS_ERROR_ID; next->content = eventErrorId; } else if (isEventSocket && !receiveEventData) { // Clear event attribute chain for event socket when not receiving event data @@ -635,11 +634,11 @@ struct nlattr *MockNlApi::nlmsgAttrdata(const struct nlmsghdr *hdr, int attr) { if (eventAttrChain == nullptr) { // Create a chain of two attributes: nodeId and errorId auto *nodeAttr = new MyNlattr(); - nodeAttr->type = DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID; + nodeAttr->type = DRM_RAS_A_ERROR_EVENT_ATTRS_NODE_ID; nodeAttr->content = eventNodeId; auto *errorAttr = new MyNlattr(); - errorAttr->type = DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID; + errorAttr->type = DRM_RAS_A_ERROR_EVENT_ATTRS_ERROR_ID; errorAttr->content = eventErrorId; nodeAttr->next = errorAttr; diff --git a/level_zero/sysman/test/unit_tests/sources/linux/nl_api/test_sysman_drm_nl_api.cpp b/level_zero/sysman/test/unit_tests/sources/linux/nl_api/test_sysman_drm_nl_api.cpp index 805b4fa82abe9..6821a53657e9a 100644 --- a/level_zero/sysman/test/unit_tests/sources/linux/nl_api/test_sysman_drm_nl_api.cpp +++ b/level_zero/sysman/test/unit_tests/sources/linux/nl_api/test_sysman_drm_nl_api.cpp @@ -1250,7 +1250,7 @@ TEST_F(SysmanDrmNlApiFixture, GivenDrmNlApiInstanceWhenParseEventMessageWithOnly delete pNlApiPtr->eventAttrChain; } pNlApiPtr->eventAttrChain = new MyNlattr; - pNlApiPtr->eventAttrChain->type = DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID; + pNlApiPtr->eventAttrChain->type = DRM_RAS_A_ERROR_EVENT_ATTRS_NODE_ID; pNlApiPtr->eventAttrChain->content = 99; pNlApiPtr->eventAttrChain->next = nullptr; ze_result_t result = drmNlApi->parseEventMessage(msg, event); @@ -1279,7 +1279,7 @@ TEST_F(SysmanDrmNlApiFixture, GivenDrmNlApiInstanceWhenParseEventMessageWithOnly delete pNlApiPtr->eventAttrChain; } pNlApiPtr->eventAttrChain = new MyNlattr; - pNlApiPtr->eventAttrChain->type = DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID; + pNlApiPtr->eventAttrChain->type = DRM_RAS_A_ERROR_EVENT_ATTRS_ERROR_ID; pNlApiPtr->eventAttrChain->content = 456; pNlApiPtr->eventAttrChain->next = nullptr; ze_result_t result = drmNlApi->parseEventMessage(msg, event); @@ -1406,7 +1406,7 @@ TEST_F(SysmanDrmNlApiFixture, GivenDrmNlApiInstanceWhenParseEventMessageWithUnkn MyNlattr *current = chain; // First: NODE_ID - current->type = DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID; + current->type = DRM_RAS_A_ERROR_EVENT_ATTRS_NODE_ID; current->content = 100; current->next = new MyNlattr; current = current->next; @@ -1418,7 +1418,7 @@ TEST_F(SysmanDrmNlApiFixture, GivenDrmNlApiInstanceWhenParseEventMessageWithUnkn current = current->next; // Third: ERROR_ID - current->type = DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID; + current->type = DRM_RAS_A_ERROR_EVENT_ATTRS_ERROR_ID; current->content = 200; current->next = new MyNlattr; current = current->next; @@ -1537,13 +1537,13 @@ TEST_F(SysmanDrmNlApiFixture, GivenDrmNlApiInstanceAndAllocMsgFailsWhenCallingGe TEST_F(SysmanDrmNlApiFixture, GivenDrmNlApiAndNoThresholdAttrsWhenCallingGetErrorThresholdRspThenThresholdRemainsZero) { DrmErrorThreshold threshold = {}; - drmNlApi->currentOperation = std::make_unique(NEO_DRM_RAS_CMD_GET_ERROR_THRESHOLD, &threshold); + drmNlApi->currentOperation = std::make_unique(DRM_RAS_CMD_GET_ERROR_THRESHOLD, &threshold); auto pNlApi = std::make_unique(); drmNlApi->pNlApi = std::move(pNlApi); - auto attrs = std::make_unique(NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_MAX + 1); - std::fill(attrs.get(), attrs.get() + NEO_DRM_RAS_A_ERROR_THRESHOLD_ATTRS_MAX + 1, nullptr); + auto attrs = std::make_unique(DRM_RAS_A_ERROR_COUNTER_ATTRS_MAX + 1); + std::fill(attrs.get(), attrs.get() + DRM_RAS_A_ERROR_COUNTER_ATTRS_MAX + 1, nullptr); struct genl_info info = {}; info.attrs = attrs.get(); diff --git a/third_party/uapi/drm-next/.version b/third_party/uapi/drm-next/.version index cdc4fbdad6181..7b6e336269bf2 100644 --- a/third_party/uapi/drm-next/.version +++ b/third_party/uapi/drm-next/.version @@ -1,3 +1,3 @@ git_revision: c44e278ce02efd0c4be79a8eda1ea6885c1ce5ec git_url: https://gitlab.freedesktop.org/drm/kernel.git - +patch: https://patchwork.freedesktop.org/patch/747140/ diff --git a/third_party/uapi/drm-next/drm/drm_ras.h b/third_party/uapi/drm-next/drm/drm_ras.h index 3a89cd83b9f7b..c819124f71859 100644 --- a/third_party/uapi/drm-next/drm/drm_ras.h +++ b/third_party/uapi/drm-next/drm/drm_ras.h @@ -4,8 +4,8 @@ /* YNL-GEN uapi header */ /* To regenerate run: tools/net/ynl/ynl-regen.sh */ -#ifndef _LINUX_DRM_RAS_H -#define _LINUX_DRM_RAS_H +#ifndef _UAPI_LINUX_DRM_RAS_H +#define _UAPI_LINUX_DRM_RAS_H #define DRM_RAS_FAMILY_NAME "drm-ras" #define DRM_RAS_FAMILY_VERSION 1 @@ -33,18 +33,36 @@ enum { DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID, DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_NAME, DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_VALUE, + DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_THRESHOLD, __DRM_RAS_A_ERROR_COUNTER_ATTRS_MAX, DRM_RAS_A_ERROR_COUNTER_ATTRS_MAX = (__DRM_RAS_A_ERROR_COUNTER_ATTRS_MAX - 1) }; enum { - DRM_RAS_CMD_LIST_NODES = 1, - DRM_RAS_CMD_GET_ERROR_COUNTER, - DRM_RAS_CMD_CLEAR_ERROR_COUNTER, + DRM_RAS_A_ERROR_EVENT_ATTRS_DEVICE_NAME = 1, + DRM_RAS_A_ERROR_EVENT_ATTRS_NODE_ID, + DRM_RAS_A_ERROR_EVENT_ATTRS_NODE_NAME, + DRM_RAS_A_ERROR_EVENT_ATTRS_ERROR_ID, + DRM_RAS_A_ERROR_EVENT_ATTRS_ERROR_NAME, + DRM_RAS_A_ERROR_EVENT_ATTRS_ERROR_VALUE, + + __DRM_RAS_A_ERROR_EVENT_ATTRS_MAX, + DRM_RAS_A_ERROR_EVENT_ATTRS_MAX = (__DRM_RAS_A_ERROR_EVENT_ATTRS_MAX - 1) +}; + +enum { + DRM_RAS_CMD_LIST_NODES = 1, + DRM_RAS_CMD_GET_ERROR_COUNTER, + DRM_RAS_CMD_CLEAR_ERROR_COUNTER, + DRM_RAS_CMD_ERROR_EVENT, + DRM_RAS_CMD_GET_ERROR_THRESHOLD, + DRM_RAS_CMD_SET_ERROR_THRESHOLD, __DRM_RAS_CMD_MAX, DRM_RAS_CMD_MAX = (__DRM_RAS_CMD_MAX - 1) }; -#endif /* _LINUX_DRM_RAS_H */ +#define DRM_RAS_MCGRP_ERROR_REPORT "error-report" + +#endif /* _UAPI_LINUX_DRM_RAS_H */