diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/1520-drm-amdgpu-add-ioctl-query-for-enabled-ras-features.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.19.8/1520-drm-amdgpu-add-ioctl-query-for-enabled-ras-features.patch | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/1520-drm-amdgpu-add-ioctl-query-for-enabled-ras-features.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/1520-drm-amdgpu-add-ioctl-query-for-enabled-ras-features.patch new file mode 100644 index 00000000..a1c392b4 --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/1520-drm-amdgpu-add-ioctl-query-for-enabled-ras-features.patch @@ -0,0 +1,86 @@ +From 68b255df3adfa78dd36591ee8b5d15d21aef9a91 Mon Sep 17 00:00:00 2001 +From: xinhui pan <xinhui.pan@amd.com> +Date: Mon, 17 Dec 2018 15:09:07 +0800 +Subject: [PATCH 1520/2940] drm/amdgpu: add ioctl query for enabled ras + features + +Signed-off-by: xinhui pan <xinhui.pan@amd.com> +Reviewed-by: Alex Deucher <alexander.deucher@amd.com> +Signed-off-by: Chaudhary Amit Kumar <Chaudharyamit.Kumar@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 9 +++++++ + include/uapi/drm/amdgpu_drm.h | 31 +++++++++++++++++++++++++ + 2 files changed, 40 insertions(+) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +index 00ca09b6682b..f3e063704960 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +@@ -39,6 +39,7 @@ + #include "amdgpu_amdkfd.h" + #include "amdgpu_gem.h" + #include "amdgpu_display.h" ++#include "amdgpu_ras.h" + + static void amdgpu_unregister_gpu_instance(struct amdgpu_device *adev) + { +@@ -949,6 +950,14 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file + case AMDGPU_INFO_VRAM_LOST_COUNTER: + ui32 = atomic_read(&adev->vram_lost_counter); + return copy_to_user(out, &ui32, min(size, 4u)) ? -EFAULT : 0; ++ case AMDGPU_INFO_RAS_ENABLED_FEATURES: { ++ struct amdgpu_ras *ras = amdgpu_ras_get_context(adev); ++ ++ if (!ras) ++ return -EINVAL; ++ return copy_to_user(out, &ras->features, ++ min(size, sizeof(ras->features))) ? -EFAULT : 0; ++ } + default: + DRM_DEBUG_KMS("Invalid request %d\n", info->query); + return -EINVAL; +diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h +index 0caf21158631..b28fe74b7725 100644 +--- a/include/uapi/drm/amdgpu_drm.h ++++ b/include/uapi/drm/amdgpu_drm.h +@@ -796,6 +796,37 @@ struct drm_amdgpu_cs_chunk_data { + /* Number of VRAM page faults on CPU access. */ + #define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E + #define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F ++/* query ras mask of enabled features*/ ++#define AMDGPU_INFO_RAS_ENABLED_FEATURES 0x20 ++ ++/* RAS MASK: UMC (VRAM) */ ++#define AMDGPU_INFO_RAS_ENABLED_UMC (1 << 0) ++/* RAS MASK: SDMA */ ++#define AMDGPU_INFO_RAS_ENABLED_SDMA (1 << 1) ++/* RAS MASK: GFX */ ++#define AMDGPU_INFO_RAS_ENABLED_GFX (1 << 2) ++/* RAS MASK: MMHUB */ ++#define AMDGPU_INFO_RAS_ENABLED_MMHUB (1 << 3) ++/* RAS MASK: ATHUB */ ++#define AMDGPU_INFO_RAS_ENABLED_ATHUB (1 << 4) ++/* RAS MASK: PCIE */ ++#define AMDGPU_INFO_RAS_ENABLED_PCIE (1 << 5) ++/* RAS MASK: HDP */ ++#define AMDGPU_INFO_RAS_ENABLED_HDP (1 << 6) ++/* RAS MASK: XGMI */ ++#define AMDGPU_INFO_RAS_ENABLED_XGMI (1 << 7) ++/* RAS MASK: DF */ ++#define AMDGPU_INFO_RAS_ENABLED_DF (1 << 8) ++/* RAS MASK: SMN */ ++#define AMDGPU_INFO_RAS_ENABLED_SMN (1 << 9) ++/* RAS MASK: SEM */ ++#define AMDGPU_INFO_RAS_ENABLED_SEM (1 << 10) ++/* RAS MASK: MP0 */ ++#define AMDGPU_INFO_RAS_ENABLED_MP0 (1 << 11) ++/* RAS MASK: MP1 */ ++#define AMDGPU_INFO_RAS_ENABLED_MP1 (1 << 12) ++/* RAS MASK: FUSE */ ++#define AMDGPU_INFO_RAS_ENABLED_FUSE (1 << 13) + + /* Hybrid Stack Specific Defs*/ + /* gpu capability */ +-- +2.17.1 + |