drm/amdgpu: add VRAM lost query
Subsystems (3)
PATCH 1/1 drm/amdgpu: add VRAM lost query
From: Christian König <[email protected]>
Allows userspace to figure out if VRAM was lost.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 +++ include/uapi/drm/amdgpu_drm.h | 1 + 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
@@ -762,6 +762,9 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file }return copy_to_user (out, &ui32,min (size,4u )) ? -EFAULT :0 ; } +case AMDGPU_INFO_VRAM_LOST_COUNTER : + ui32 =atomic_read (&adev->vram_lost_counter); +return copy_to_user (out, &ui32,min (size,4u )) ? -EFAULT :0 ;default :DRM_DEBUG_KMS ("Invalid request %d\n" , info->query);return -EINVAL ;
include/uapi/drm/amdgpu_drm.h +1 -0
@@ -632,6 +632,7 @@ struct drm_amdgpu_cs_chunk_data {#define AMDGPU_INFO_SENSOR_VDDGFX 0x7/* Number of VRAM page faults on CPU access. */ #define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E +#define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F#define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0#define AMDGPU_INFO_MMR_SE_INDEX_MASK 0xff
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1507564426-8374-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org
Nicolai Hähnle
Reviewed-byQuoted 5 lines · Christian König
From: Christian König <[email protected]>
Allows userspace to figure out if VRAM was lost.
Signed-off-by Christian König <[email protected]>
Yes, I think we can use this in Mesa. We'll need to actually code this up, but for now this patch is:
Reviewed-by Nicolai Hähnle <[email protected]>
Quoted 32 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 +++ include/uapi/drm/amdgpu_drm.h | 1 + 2 files changed, 4 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3
-0@@ -762,6 +762,9 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file }return copy_to_user (out, &ui32,min (size,4u )) ? -EFAULT :0 ; } +case AMDGPU_INFO_VRAM_LOST_COUNTER : + ui32 =atomic_read (&adev->vram_lost_counter); +return copy_to_user (out, &ui32,min (size,4u )) ? -EFAULT :0 ;default :DRM_DEBUG_KMS ("Invalid request %d\n" , info->query);return -EINVAL ;include/uapi/drm/amdgpu_drm.h +1
-0@@ -632,6 +632,7 @@ struct drm_amdgpu_cs_chunk_data {#define AMDGPU_INFO_SENSOR_VDDGFX 0x7/* Number of VRAM page faults on CPU access. */ #define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E +#define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F#define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0#define AMDGPU_INFO_MMR_SE_INDEX_MASK 0xff
Signature · 6 lines
Lerne, wie die Welt wirklich ist, Aber vergiss niemals, wie sie sein sollte. _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx