drm/amdgpu: new ids flag for tmz
Subsystems (3)
PATCH 1/1 drm/amdgpu: new ids flag for tmz
Allows UMD to know if TMZ is supported and enabled.
This commit also bumps KMS_DRIVER_MINOR so UMD knows if it can rely on AMDGPU_IDS_FLAGS_TMZ.
---
Patch for using it in Mesa is at https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049
(ac/gpu_info: add detection of TMZ support).
Pierre-Eric
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 ++ include/uapi/drm/amdgpu_drm.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -1
@@ -88,9 +88,10 @@* - 3.37.0 - L2 is invalidated before SDMA IBs, needed for correctness * - 3.38.0 - Add AMDGPU_IB_FLAG_EMIT_MEM_SYNC * - 3.39.0 - DMABUF implicit sync does a full pipeline sync +* - 3.40.0 - Add AMDGPU_IDS_FLAGS_TMZ */ #define KMS_DRIVER_MAJOR 3 -#define KMS_DRIVER_MINOR 39 +#define KMS_DRIVER_MINOR 40#define KMS_DRIVER_PATCHLEVEL 0int amdgpu_vram_limit =0 ;
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2 -0
@@ -736,6 +736,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file dev_info.ids_flags |=AMDGPU_IDS_FLAGS_FUSION ;if (amdgpu_mcbp ||amdgpu_sriov_vf (adev)) dev_info.ids_flags |=AMDGPU_IDS_FLAGS_PREEMPTION ; +if (adev->gmc.tmz_enabled) + dev_info.ids_flags |=AMDGPU_IDS_FLAGS_TMZ ; vm_size = adev->vm_manager.max_pfn *AMDGPU_GPU_PAGE_SIZE ; vm_size -=AMDGPU_VA_RESERVED_SIZE ;
include/uapi/drm/amdgpu_drm.h +1 -0
@@ -676,6 +676,7 @@ struct drm_amdgpu_cs_chunk_data {*/ #define AMDGPU_IDS_FLAGS_FUSION 0x1#define AMDGPU_IDS_FLAGS_PREEMPTION 0x2 +#define AMDGPU_IDS_FLAGS_TMZ 0x4/* indicate if acceleration can be working */ #define AMDGPU_INFO_ACCEL_WORKING 0x00
Signature · 6 lines
2.26.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 30.07.20 um 12:25 schrieb Pierre-Eric Pelloux-Prayer:
Quoted 19 lines
Allows UMD to know if TMZ is supported and enabled.
This commit also bumpsKMS_DRIVER_MINORso UMD knows if it can rely onAMDGPU_IDS_FLAGS_TMZ.
---
Patch for using it in Mesa is at https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049
(ac/gpu_info: add detection of TMZ support).Pierre-Eric
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 ++ include/uapi/drm/amdgpu_drm.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 94
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2
-1@@ -88,9 +88,10 @@* - 3.37.0 - L2 is invalidated before SDMA IBs, needed for correctness * - 3.38.0 - Add AMDGPU_IB_FLAG_EMIT_MEM_SYNC * - 3.39.0 - DMABUF implicit sync does a full pipeline sync +* - 3.40.0 - Add AMDGPU_IDS_FLAGS_TMZ */ #define KMS_DRIVER_MAJOR 3 -#define KMS_DRIVER_MINOR 39 +#define KMS_DRIVER_MINOR 40
I don't think we need this. Unused ids_flags should be zero on older kernels.
That's why we have this in the first place.
Christian.
Quoted 21 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0#define KMS_DRIVER_PATCHLEVEL 0int amdgpu_vram_limit =0 ;drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2
-0@@ -736,6 +736,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file dev_info.ids_flags |=AMDGPU_IDS_FLAGS_FUSION ;if (amdgpu_mcbp ||amdgpu_sriov_vf (adev)) dev_info.ids_flags |=AMDGPU_IDS_FLAGS_PREEMPTION ; +if (adev->gmc.tmz_enabled) + dev_info.ids_flags |=AMDGPU_IDS_FLAGS_TMZ ; vm_size = adev->vm_manager.max_pfn *AMDGPU_GPU_PAGE_SIZE ; vm_size -=AMDGPU_VA_RESERVED_SIZE ;include/uapi/drm/amdgpu_drm.h +0
-0
include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_cs_chunk_data { · line 682
Quoted 7 lines
include/uapi/drm/amdgpu_drm.h +1
-0@@ -676,6 +676,7 @@ struct drm_amdgpu_cs_chunk_data {*/ #define AMDGPU_IDS_FLAGS_FUSION 0x1#define AMDGPU_IDS_FLAGS_PREEMPTION 0x2 +#define AMDGPU_IDS_FLAGS_TMZ 0x4/* indicate if acceleration can be working */ #define AMDGPU_INFO_ACCEL_WORKING 0x00
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Hi Christian,
Quoted 15 lines · Christian König
Am 30.07.20 um 12:25 schrieb Pierre-Eric Pelloux-Prayer:
Quoted 14 lines
Allows UMD to know if TMZ is supported and enabled.
This commit also bumpsKMS_DRIVER_MINORso UMD knows if it can rely onAMDGPU_IDS_FLAGS_TMZ.
---
Patch for using it in Mesa is at https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049
(ac/gpu_info: add detection of TMZ support).Pierre-Eric
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c| 3 ++-
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c| 2 ++
include/uapi/drm/amdgpu_drm.h | 1 +3 files changed, 5 insertions(+), 1 deletion(-)
Quoted 15 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 94
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2
-1@@ -88,9 +88,10 @@* - 3.37.0 - L2 is invalidated before SDMA IBs, needed for correctness * - 3.38.0 - Add AMDGPU_IB_FLAG_EMIT_MEM_SYNC * - 3.39.0 - DMABUF implicit sync does a full pipeline sync +* - 3.40.0 - Add AMDGPU_IDS_FLAGS_TMZ */ #define KMS_DRIVER_MAJOR 3 -#define KMS_DRIVER_MINOR 39 +#define KMS_DRIVER_MINOR 40I don't think we need this. Unused
ids_flagsshould be zero on older kernels.
If we don't increase KMS_DRIVER_MINOR then:
ids_flags & AMDGPU_IDS_FLAGS_TMZ == 0
has 2 meanings:
- TMZ is not enabled
- or TMZ might be enabled but it's not reported by the kernel
If you prefer not bumping KMS_DRIVER_MINOR that's fine though. Mesa can check if TMZ is really disabled by trying to allocate a TMZ buffer.
Thanks,
Pierre-Eric
Quoted 27 lines
That's why we have this in the first place.
Christian.
Quoted 22 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0#define KMS_DRIVER_PATCHLEVEL 0 int amdgpu_vram_limit = 0;drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2
-0@@ -736,6 +736,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file dev_info.ids_flags |= AMDGPU_IDS_FLAGS_FUSION; if (amdgpu_mcbp || amdgpu_sriov_vf(adev)) dev_info.ids_flags |= AMDGPU_IDS_FLAGS_PREEMPTION; + if (adev->gmc.tmz_enabled) + dev_info.ids_flags |= AMDGPU_IDS_FLAGS_TMZ; vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE; vm_size -= AMDGPU_VA_RESERVED_SIZE;include/uapi/drm/amdgpu_drm.h +0
-0@@ -676,6 +676,7 @@ struct drm_amdgpu_cs_chunk_data {*/ #define AMDGPU_IDS_FLAGS_FUSION 0x1 #define AMDGPU_IDS_FLAGS_PREEMPTION 0x2
Quoted 8 lines
include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_cs_chunk_data { · line 682
Quoted 3 lines
include/uapi/drm/amdgpu_drm.h +1
-0+#define AMDGPU_IDS_FLAGS_TMZ 0x4 /* indicate if acceleration can be working */ #define AMDGPU_INFO_ACCEL_WORKING 0x00_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 30.07.20 um 12:59 schrieb Pierre-Eric Pelloux-Prayer:
Quoted 32 lines
Hi Christian,
Quoted 15 lines · Christian König
Am 30.07.20 um 12:25 schrieb Pierre-Eric Pelloux-Prayer:
Quoted 14 lines
Allows UMD to know if TMZ is supported and enabled.
This commit also bumpsKMS_DRIVER_MINORso UMD knows if it can rely onAMDGPU_IDS_FLAGS_TMZ.
---
Patch for using it in Mesa is at https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049
(ac/gpu_info: add detection of TMZ support).Pierre-Eric
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 ++ include/uapi/drm/amdgpu_drm.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-)Quoted 14 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c line 94
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2
-1@@ -88,9 +88,10 @@* - 3.37.0 - L2 is invalidated before SDMA IBs, needed for correctness * - 3.38.0 - Add AMDGPU_IB_FLAG_EMIT_MEM_SYNC * - 3.39.0 - DMABUF implicit sync does a full pipeline sync +* - 3.40.0 - Add AMDGPU_IDS_FLAGS_TMZ */ #define KMS_DRIVER_MAJOR 3 -#define KMS_DRIVER_MINOR 39 +#define KMS_DRIVER_MINOR 40I don't think we need this. Unused
ids_flagsshould be zero on older kernels.
Quoted 7 lines
If we don't increase
KMS_DRIVER_MINORthen:ids_flags & AMDGPU_IDS_FLAGS_TMZ == 0has 2 meanings:
- TMZ is not enabled
- or TMZ might be enabled but it's not reported by the kernel
Ah! Yeah that's a good argument.
We need to note that in the commit message.
And maybe call the flag TMZ_ENABLED to make clear what this is good for.
Thanks,
Christian.
Quoted 40 lines
If you prefer not bumping
KMS_DRIVER_MINORthat's fine though. Mesa can check if TMZ is really disabled by trying to allocate a TMZ buffer.Thanks,
Pierre-EricQuoted 25 lines
That's why we have this in the first place.
Christian.
Quoted 21 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +0
-0#define KMS_DRIVER_PATCHLEVEL 0 int amdgpu_vram_limit = 0;drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +2
-0@@ -736,6 +736,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file dev_info.ids_flags |= AMDGPU_IDS_FLAGS_FUSION; if (amdgpu_mcbp || amdgpu_sriov_vf(adev)) dev_info.ids_flags |= AMDGPU_IDS_FLAGS_PREEMPTION; + if (adev->gmc.tmz_enabled) + dev_info.ids_flags |= AMDGPU_IDS_FLAGS_TMZ; vm_size = adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE; vm_size -= AMDGPU_VA_RESERVED_SIZE;include/uapi/drm/amdgpu_drm.h +0
-0@@ -676,6 +676,7 @@ struct drm_amdgpu_cs_chunk_data {*/ #define AMDGPU_IDS_FLAGS_FUSION 0x1Quoted 8 lines
include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_cs_chunk_data { · line 682
Quoted 4 lines
include/uapi/drm/amdgpu_drm.h +1
-0#define AMDGPU_IDS_FLAGS_PREEMPTION 0x2 +#define AMDGPU_IDS_FLAGS_TMZ 0x4 /* indicate if acceleration can be working */ #define AMDGPU_INFO_ACCEL_WORKING 0x00_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx