Files
linux/include/uapi/drm/drm_ras.h
T
Rodrigo Vivi c36218dc49 drm/ras: Introduce the DRM RAS infrastructure over generic netlink
Introduces the DRM RAS infrastructure over generic netlink.

The new interface allows drivers to expose RAS nodes and their
associated error counters to userspace in a structured and extensible
way. Each drm_ras node can register its own set of error counters, which
are then discoverable and queryable through netlink operations. This
lays the groundwork for reporting and managing hardware error states
in a unified manner across different DRM drivers.

Currently it only supports error-counter nodes. But it can be
extended later.

The registration is also not tied to any drm node, so it can be
used by accel devices as well.

It uses the new and mandatory YAML description format stored in
Documentation/netlink/specs/. This forces a single generic netlink
family namespace for the entire drm: "drm-ras".
But multiple-endpoints are supported within the single family.

Any modification to this API needs to be applied to
Documentation/netlink/specs/drm_ras.yaml before regenerating the
code:

$ tools/net/ynl/pyynl/ynl_gen_c.py --spec \
 Documentation/netlink/specs/drm_ras.yaml --mode uapi --header \
 -o include/uapi/drm/drm_ras.h

$ tools/net/ynl/pyynl/ynl_gen_c.py --spec \
  Documentation/netlink/specs/drm_ras.yaml --mode kernel \
  --header -o drivers/gpu/drm/drm_ras_nl.h

$ tools/net/ynl/pyynl/ynl_gen_c.py --spec \
  Documentation/netlink/specs/drm_ras.yaml \
  --mode kernel --source -o drivers/gpu/drm/drm_ras_nl.c

Cc: Zack McKevitt <[email protected]>
Cc: Lijo Lazar <[email protected]>
Cc: Hawking Zhang <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: [email protected]
Co-developed-by: Aravind Iddamsetty <[email protected]>
Signed-off-by: Aravind Iddamsetty <[email protected]>
Signed-off-by: Riana Tauro <[email protected]>
Reviewed-by: Zack McKevitt <[email protected]>
Acked-by: Jakub Kicinski <[email protected]>
Acked-by: Maarten Lankhorst <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Rodrigo Vivi <[email protected]>
2026-03-05 19:38:55 -05:00

50 lines
1.3 KiB
C

/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/drm_ras.yaml */
/* YNL-GEN uapi header */
/* To regenerate run: tools/net/ynl/ynl-regen.sh */
#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
/*
* Type of the node. Currently, only error-counter nodes are supported, which
* expose reliability counters for a hardware/software component.
*/
enum drm_ras_node_type {
DRM_RAS_NODE_TYPE_ERROR_COUNTER = 1,
};
enum {
DRM_RAS_A_NODE_ATTRS_NODE_ID = 1,
DRM_RAS_A_NODE_ATTRS_DEVICE_NAME,
DRM_RAS_A_NODE_ATTRS_NODE_NAME,
DRM_RAS_A_NODE_ATTRS_NODE_TYPE,
__DRM_RAS_A_NODE_ATTRS_MAX,
DRM_RAS_A_NODE_ATTRS_MAX = (__DRM_RAS_A_NODE_ATTRS_MAX - 1)
};
enum {
DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID = 1,
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_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_MAX,
DRM_RAS_CMD_MAX = (__DRM_RAS_CMD_MAX - 1)
};
#endif /* _UAPI_LINUX_DRM_RAS_H */