Re: [PATCH 2/2] drm_print: Remove deprecated DRM_DEBUG_KMS_RATELIMITED()

2023-01-18 Thread Das, Nirmoy
On 1/18/2023 7:27 AM, Christian König wrote: Am 17.01.23 um 19:12 schrieb Das, Nirmoy: Hi Alex, On 1/17/2023 7:06 PM, Alex Deucher wrote: On Tue, Jan 17, 2023 at 1:05 PM Nirmoy Das wrote: There are no current users of DRM_DEBUG_KMS_RATELIMITED() so remove it. Cc: Maarten Lankhorst Cc

Re: [PATCH 2/2] drm_print: Remove deprecated DRM_DEBUG_KMS_RATELIMITED()

2023-01-17 Thread Das, Nirmoy
Hi Alex, On 1/17/2023 7:06 PM, Alex Deucher wrote: On Tue, Jan 17, 2023 at 1:05 PM Nirmoy Das wrote: There are no current users of DRM_DEBUG_KMS_RATELIMITED() so remove it. Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Sam Ravnborg

[PATCH v2] drm/radeon: Do not use deprecated drm log API

2023-01-17 Thread Nirmoy Das
Replace deprecated DRM_DEBUG_KMS_RATELIMITED() and DRM_ERROR() with proper APIs. v2: replace pr_err with dev_err(Alex). Cc: Alex Deucher Cc: Christian König Signed-off-by: Nirmoy Das --- drivers/gpu/drm/radeon/radeon_dp_auxch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions

[PATCH 2/2] drm_print: Remove deprecated DRM_DEBUG_KMS_RATELIMITED()

2023-01-17 Thread Nirmoy Das
There are no current users of DRM_DEBUG_KMS_RATELIMITED() so remove it. Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Sam Ravnborg Signed-off-by: Nirmoy Das Reviewed-by: Sam Ravnborg --- include/drm/drm_print.h | 3 --- 1 file

Re: [PATCH 1/2] drm/radeon: Do not use deprecated drm log API

2023-01-17 Thread Das, Nirmoy
On 1/17/2023 6:48 PM, Alex Deucher wrote: On Tue, Jan 17, 2023 at 12:45 PM Nirmoy Das wrote: Replace deprecated DRM_DEBUG_KMS_RATELIMITED() and DRM_ERROR() with proper APIs. Cc: Alex Deucher Cc: Christian König Signed-off-by: Nirmoy Das --- drivers/gpu/drm/radeon/radeon_dp_auxch.c | 5

[PATCH 1/2] drm/radeon: Do not use deprecated drm log API

2023-01-17 Thread Nirmoy Das
Replace deprecated DRM_DEBUG_KMS_RATELIMITED() and DRM_ERROR() with proper APIs. Cc: Alex Deucher Cc: Christian König Signed-off-by: Nirmoy Das --- drivers/gpu/drm/radeon/radeon_dp_auxch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon

[PATCH 2/2] drm_print: Remove deprecated DRM_DEBUG_KMS_RATELIMITED()

2023-01-17 Thread Nirmoy Das
There are no current users of DRM_DEBUG_KMS_RATELIMITED() so remove it. Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Sam Ravnborg Signed-off-by: Nirmoy Das --- include/drm/drm_print.h | 3 --- 1 file changed, 3 deletions(-) diff

Re: amd-staging-drm-next breaks suspend

2022-01-19 Thread Das, Nirmoy
memory to uninitialized GART ! Could you please also try https://patchwork.freedesktop.org/patch/469907/ ? Regards, Nirmoy +@Das, Nirmoy The only thing that touched that file recently was 72f686438de13f121c52f58d7445570a33dfdc61 Could you see if backing that out helps? Here's

Re: [PATCH] drm/amdgpu: Indent some if statements

2022-01-13 Thread Das, Nirmoy
Reviewed-by: Nirmoy Das On 1/13/2022 7:17 AM, Dan Carpenter wrote: These if statements need to be indented. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

Re: [PATCH 1/1] drm/amdgpu: move bo_va ref counting to internal funcs

2022-01-13 Thread Das, Nirmoy
On 1/13/2022 1:12 PM, Christian König wrote: Am 13.01.22 um 13:06 schrieb Nirmoy Das: GEM code should not deal with struct amdgpu_bo_va's ref_count. Move ref counting to amdgpu_vm.c. Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 11 +++   drivers/gpu/drm/amd

[PATCH 1/1] drm/amdgpu: move bo_va ref counting to internal funcs

2022-01-13 Thread Nirmoy Das
GEM code should not deal with struct amdgpu_bo_va's ref_count. Move ref counting to amdgpu_vm.c. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 11 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 38 +++-- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h

Re: [PATCH] drm/amdgpu: cleanup ttm debug sdma vram access function

2022-01-12 Thread Das, Nirmoy
LGTM acked-by: Nirmoy Das On 1/12/2022 7:52 PM, Jonathan Kim wrote: Some suggested cleanups to declutter ttm when doing debug VRAM access over SDMA. v2: rename post_mortem_allowed func to has_timeouts_enable. Signed-off-by: Jonathan Kim --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 9

Re: [PATCH 2/4] drm/amdkfd: remove unused function

2022-01-07 Thread Nirmoy
Found the commit that removed usages of this function. Fixes: dfcbe6d5f ("drm/amdgpu: Remove unused function pointers") On 1/7/22 09:51, Nirmoy Das wrote: Remove unused amdgpu_amdkfd_get_vram_usage() CC: felix.kuehl...@amd.com Signed-off-by: Nirmoy Das --- drivers/gpu/drm/

[PATCH REBASED 4/4] drm/amdgpu: recover gart table at resume

2022-01-07 Thread Nirmoy Das
v2: pin gart at amdgpu_gart_table_vram_alloc() Reviewed-by: Christian König Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 --- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 84 ++ drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 +- drivers/gpu

[PATCH 2/4] drm/amdkfd: remove unused function

2022-01-07 Thread Nirmoy Das
Remove unused amdgpu_amdkfd_get_vram_usage() CC: felix.kuehl...@amd.com Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 7 --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h | 1 - 2 files changed, 8 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

[PATCH REBASED 3/4] drm/amdgpu: do not pass ttm_resource_manager to vram_mgr

2022-01-07 Thread Nirmoy Das
Do not allow exported amdgpu_vram_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call vram_mgr functions. v2: pass adev's vram_mgr instead of adev Reviewed-by: Christian König Signed-off-by: Nirmoy Das

[PATCH REBASED 1/4] drm/amdgpu: do not pass ttm_resource_manager to gtt_mgr

2022-01-07 Thread Nirmoy Das
: pass adev's gtt_mgr instead of adev. Reviewed-by: Christian König Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 22 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++-- drivers/gpu/drm

Re: [PATCH] drm/amdgpu: avoid NULL pointer dereference

2021-12-29 Thread Das, Nirmoy
LGTM Acked-by: Nirmoy Das On 12/22/2021 3:19 PM, Guchun Chen wrote: amdgpu_umc_poison_handler for UMC RAS consumption gets called in KFD queue reset, but it needs to return early when RAS context is NULL. This can guarantee lower access to RAS context like in amdgpu_umc_do_page_retirement

Re: [RFC PATCH 3/3] drm/amdgpu: enable HIQ in amdgpu without kfd

2021-11-05 Thread Das, Nirmoy
On 11/5/2021 3:17 PM, Alex Deucher wrote: On Fri, Nov 5, 2021 at 10:09 AM Nirmoy Das wrote: There is a HW bug which prevents CP to read secure buffers with HIQ being configured and mapped using KIQ. KFD already does this for amdgpu but when kfd is not enabled amdgpu should that for itself

[RFC PATCH 2/3] drm/amdgpu: add HIQ eng_sel to KIQ packets

2021-11-05 Thread Nirmoy Das
Allow KIQ to map/unmap HIQ MQD as well. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 14 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 2 ++ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 4 ++-- 4 files

[RFC PATCH 3/3] drm/amdgpu: enable HIQ in amdgpu without kfd

2021-11-05 Thread Nirmoy Das
There is a HW bug which prevents CP to read secure buffers with HIQ being configured and mapped using KIQ. KFD already does this for amdgpu but when kfd is not enabled amdgpu should that for itself. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 14 - drivers/gpu

[RFC PATCH 1/3] drm/amdgpu: add HIQ ring to amdgpu

2021-11-05 Thread Nirmoy Das
Add HIQ ring structs and functions that will map HIQ using KIQ. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 142 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 24 drivers/gpu/drm

Re: [PATCH 6/6] drm/radeon: use dma_resv_wait_timeout() instead of manually waiting

2021-11-03 Thread Das, Nirmoy
Acked-by: Nirmoy Das On 10/28/2021 3:26 PM, Christian König wrote: Don't touch the exclusive fence manually here, but rather use the general dma_resv function. We did that for better hw reset handling but this doesn't necessary work correctly. Signed-off-by: Christian König --- drivers/gpu

Re: [PATCH 1/1] drm/amdgpu: return early on error while setting bar0 memtype

2021-11-02 Thread Das, Nirmoy
On 11/2/2021 12:33 PM, Christian König wrote: Am 02.11.21 um 12:18 schrieb Lazar, Lijo: On 11/2/2021 4:39 PM, Christian König wrote: Am 02.11.21 um 11:11 schrieb Das, Nirmoy: On 11/2/2021 9:00 AM, Lazar, Lijo wrote: On 10/29/2021 8:39 PM, Nirmoy Das wrote: We set WC memtype

Re: [PATCH 1/1] drm/amdgpu: return early on error while setting bar0 memtype

2021-11-02 Thread Das, Nirmoy
On 11/2/2021 9:00 AM, Lazar, Lijo wrote: On 10/29/2021 8:39 PM, Nirmoy Das wrote: We set WC memtype for aper_base but don't check return value of arch_io_reserve_memtype_wc(). Be more defensive and return early on error. Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/amd/amdgpu

Re: [PATCH 1/1] drm/amdgpu: remove unnecessary checks

2021-10-29 Thread Das, Nirmoy
ping! On 10/22/2021 1:03 PM, Nirmoy Das wrote: amdgpu_ttm_backend_bind() only needed for TTM_PL_TT and AMDGPU_PL_PREEMPT. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b

[PATCH 1/1] drm/amdgpu: return early on error while setting bar0 memtype

2021-10-29 Thread Nirmoy Das
We set WC memtype for aper_base but don't check return value of arch_io_reserve_memtype_wc(). Be more defensive and return early on error. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers

Re: [PATCH v4 1/3] drm/amdgpu: do not pass ttm_resource_manager to gtt_mgr

2021-10-22 Thread Das, Nirmoy
to test. Regards, Nirmoy Thanks, Christian. Am 22.10.21 um 12:54 schrieb Nirmoy Das: Do not allow exported amdgpu_gtt_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call gtt_mgr functions. v4: remove

[PATCH 1/1] drm/amdgpu: remove unnecessary checks

2021-10-22 Thread Nirmoy Das
amdgpu_ttm_backend_bind() only needed for TTM_PL_TT and AMDGPU_PL_PREEMPT. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index

Re: [PATCH v4 3/3] drm/amdgpu: recover gart table at resume

2021-10-22 Thread Nirmoy
On 10/22/21 12:54 PM, Nirmoy Das wrote: Get rid off pin/unpin of gart BO at resume/suspend and instead pin only once and try to recover gart content at resume time. This is much more stable in case there is OOM situation at 2nd call to amdgpu_device_evict_resources() while evicting GART table

[PATCH 3/3] drm/amdgpu: recover gart table at resume

2021-10-22 Thread Nirmoy Das
v2: pin gart at amdgpu_gart_table_vram_alloc() Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 --- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 84 ++ drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 +- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c

[PATCH 2/3] drm/amdgpu: do not pass ttm_resource_manager to vram_mgr

2021-10-22 Thread Nirmoy Das
Do not allow exported amdgpu_vram_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call vram_mgr functions. v2: pass adev's vram_mgr instead of adev Signed-off-by: Nirmoy Das Reviewed-by: Christian König

[PATCH v4 3/3] drm/amdgpu: recover gart table at resume

2021-10-22 Thread Nirmoy Das
() directly without checking its return value. v3: remove gart recovery from other places v2: pin gart at amdgpu_gart_table_vram_alloc() Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 --- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 82 ++ drivers/gpu

[PATCH v4 1/3] drm/amdgpu: do not pass ttm_resource_manager to gtt_mgr

2021-10-22 Thread Nirmoy Das
: pass adev's gtt_mgr instead of adev. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 22 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h

Re: [PATCH v3 1/3] drm/amdgpu: do not pass ttm_resource_manager to gtt_mgr

2021-10-22 Thread Nirmoy
On 10/22/21 11:44 AM, Christian König wrote: Am 22.10.21 um 11:32 schrieb Nirmoy Das: Do not allow exported amdgpu_gtt_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call gtt_mgr functions. v3: upcast

[PATCH v2 2/3] drm/amdgpu: do not pass ttm_resource_manager to vram_mgr

2021-10-22 Thread Nirmoy Das
Do not allow exported amdgpu_vram_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call vram_mgr functions. v2: pass adev's vram_mgr instead of adev Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu

[PATCH v3 3/3] drm/amdgpu: recover gart table at resume

2021-10-22 Thread Nirmoy Das
v2: pin gart at amdgpu_gart_table_vram_alloc() Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 --- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 80 ++ drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 +- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c

[PATCH v3 1/3] drm/amdgpu: do not pass ttm_resource_manager to gtt_mgr

2021-10-22 Thread Nirmoy Das
instead of adev Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 23 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 4 ++-- 4 files changed

[PATCH v2 2/3] drm/amdgpu: do not pass ttm_resource_manager to vram_mgr

2021-10-21 Thread Nirmoy Das
Do not allow exported amdgpu_vram_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call vram_mgr functions. v2: pass adev's vram_mgr instead of adev Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu

[PATCH v3 3/3] drm/amdgpu: recover gart table at resume

2021-10-21 Thread Nirmoy Das
v2: pin gart at amdgpu_gart_table_vram_alloc() Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 11 --- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 80 ++ drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 3 +- drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c

[PATCH v2 1/3] drm/amdgpu: do not pass ttm_resource_manager to gtt_mgr

2021-10-21 Thread Nirmoy Das
Do not allow exported amdgpu_gtt_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call gtt_mgr functions. v2: pass adev's gtt_mgr instead of adev Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu

Re: [PATCH 1/1] drm/amdgpu: fix BO leak after successful move test

2021-10-20 Thread Das, Nirmoy
On 10/20/2021 1:51 PM, Christian König wrote: Am 20.10.21 um 13:50 schrieb Christian König: Am 13.10.21 um 17:09 schrieb Nirmoy Das: GTT BO cleanup code is with in the test for loop and we would skip cleaning up GTT BO on success. Reported-by: zhang Signed-off-by: Nirmoy Das

Re: [PATCH 1/3] drm/amdgpu: do not pass ttm_resource_manager to gtt_mgr

2021-10-20 Thread Das, Nirmoy
On 10/20/2021 12:49 PM, Christian König wrote: Am 20.10.21 um 11:19 schrieb Lazar, Lijo: On 10/20/2021 2:18 PM, Das, Nirmoy wrote: On 10/20/2021 8:49 AM, Christian König wrote: Am 19.10.21 um 20:14 schrieb Nirmoy Das: Do not allow exported amdgpu_gtt_mgr_*() to accept any

Re: [PATCH v2 3/3] drm/amdgpu: recover gart table at resume

2021-10-20 Thread Das, Nirmoy
On 10/20/2021 12:51 PM, Christian König wrote: Am 20.10.21 um 12:21 schrieb Das, Nirmoy: On 10/20/2021 12:15 PM, Lazar, Lijo wrote: On 10/20/2021 3:42 PM, Das, Nirmoy wrote: On 10/20/2021 12:03 PM, Lazar, Lijo wrote: On 10/20/2021 3:23 PM, Das, Nirmoy wrote: On 10/20/2021 11:11

Re: [PATCH v2 3/3] drm/amdgpu: recover gart table at resume

2021-10-20 Thread Das, Nirmoy
On 10/20/2021 12:15 PM, Lazar, Lijo wrote: On 10/20/2021 3:42 PM, Das, Nirmoy wrote: On 10/20/2021 12:03 PM, Lazar, Lijo wrote: On 10/20/2021 3:23 PM, Das, Nirmoy wrote: On 10/20/2021 11:11 AM, Lazar, Lijo wrote: On 10/19/2021 11:44 PM, Nirmoy Das wrote: Get rid off pin/unpin

Re: [PATCH v2 3/3] drm/amdgpu: recover gart table at resume

2021-10-20 Thread Das, Nirmoy
On 10/20/2021 12:03 PM, Lazar, Lijo wrote: On 10/20/2021 3:23 PM, Das, Nirmoy wrote: On 10/20/2021 11:11 AM, Lazar, Lijo wrote: On 10/19/2021 11:44 PM, Nirmoy Das wrote: Get rid off pin/unpin of gart BO at resume/suspend and instead pin only once and try to recover gart content

Re: [PATCH v2 3/3] drm/amdgpu: recover gart table at resume

2021-10-20 Thread Das, Nirmoy
On 10/20/2021 11:11 AM, Lazar, Lijo wrote: On 10/19/2021 11:44 PM, Nirmoy Das wrote: Get rid off pin/unpin of gart BO at resume/suspend and instead pin only once and try to recover gart content at resume time. This is much more stable in case there is OOM situation at 2nd call

Re: [PATCH 1/1] drm/amdgpu: fix BO leak after successful move test

2021-10-20 Thread Das, Nirmoy
ping. On 10/13/2021 5:09 PM, Nirmoy Das wrote: GTT BO cleanup code is with in the test for loop and we would skip cleaning up GTT BO on success. Reported-by: zhang Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_test.c | 25 1 file changed, 12

Re: [PATCH 1/3] drm/amdgpu: do not pass ttm_resource_manager to gtt_mgr

2021-10-20 Thread Das, Nirmoy
On 10/20/2021 8:49 AM, Christian König wrote: Am 19.10.21 um 20:14 schrieb Nirmoy Das: Do not allow exported amdgpu_gtt_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call gtt_mgr functions. That's

Re: [PATCH v2 3/3] drm/amdgpu: recover gart table at resume

2021-10-20 Thread Das, Nirmoy
On 10/20/2021 8:52 AM, Christian König wrote: Am 19.10.21 um 20:14 schrieb Nirmoy Das: Get rid off pin/unpin of gart BO at resume/suspend and instead pin only once and try to recover gart content at resume time. This is much more stable in case there is OOM situation at 2nd call

[PATCH 1/3] drm/amdgpu: do not pass ttm_resource_manager to gtt_mgr

2021-10-19 Thread Nirmoy Das
Do not allow exported amdgpu_gtt_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call gtt_mgr functions. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +-- drivers/gpu/drm

[PATCH v2 3/3] drm/amdgpu: recover gart table at resume

2021-10-19 Thread Nirmoy Das
Get rid off pin/unpin of gart BO at resume/suspend and instead pin only once and try to recover gart content at resume time. This is much more stable in case there is OOM situation at 2nd call to amdgpu_device_evict_resources() while evicting GART table. Signed-off-by: Nirmoy Das --- drivers

[PATCH 2/3] drm/amdgpu: do not pass ttm_resource_manager to vram_mgr

2021-10-19 Thread Nirmoy Das
Do not allow exported amdgpu_vram_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call vram_mgr functions. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 3 +- drivers/gpu

Re: [PATCH 1/1] drm/amdgpu: recover gart table at resume

2021-10-19 Thread Das, Nirmoy
On 10/19/2021 5:43 PM, Christian König wrote: Am 19.10.21 um 15:22 schrieb Nirmoy Das: Get rid off pin/unpin and evict and swap back gart page table which should make things less likely to break. Also remove 2nd call to amdgpu_device_evict_resources() as we don't need it. Signed-off

[PATCH 1/1] drm/amdgpu: recover gart table at resume

2021-10-19 Thread Nirmoy Das
Get rid off pin/unpin and evict and swap back gart page table which should make things less likely to break. Also remove 2nd call to amdgpu_device_evict_resources() as we don't need it. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 - drivers/gpu/drm/amd

Re: [PATCH Review 1/1] drm/ttm: fix debugfs node create failed

2021-10-13 Thread Das, Nirmoy
On 10/13/2021 2:29 PM, Christian König wrote: Am 12.10.21 um 15:12 schrieb Das, Nirmoy: On 10/12/2021 1:58 PM, Stanley.Yang wrote: Test scenario: modprobe amdgpu -> rmmod amdgpu -> modprobe amdgpu Error log: [   54.396807] debugfs: File 'page_pool' in directory 'amdttm' a

Re: [PATCH 1/1] drm/amdgpu: release gtt bo after each move test

2021-10-13 Thread Das, Nirmoy
Please ignore this! On 10/13/2021 5:04 PM, Nirmoy Das wrote: When gart size is < gtt size this test will fail with -ENOMEM as we are not freeing gtt bo after each move test. This is generally not an issue when gart size >= gtt size. Reported-by: zhang Signed-off-by: Nirmoy Das --- d

[PATCH 1/1] drm/amdgpu: fix BO leak after successful move test

2021-10-13 Thread Nirmoy Das
GTT BO cleanup code is with in the test for loop and we would skip cleaning up GTT BO on success. Reported-by: zhang Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_test.c | 25 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/gpu

Re: [PATCH 1/1] drm/amdgpu: release gtt bo after each move test

2021-10-13 Thread Das, Nirmoy
On 10/13/2021 12:42 PM, Das, Nirmoy wrote: On 10/13/2021 3:22 AM, zhang wrote: Hi . Nirmoy If you let continue to unpin. this will  allways test a same va for gtt I think we should  rafresh calculate the value n Right, I guess then the test should only run till gart size. Actually

[PATCH 1/1] drm/amdgpu: release gtt bo after each move test

2021-10-13 Thread Nirmoy Das
When gart size is < gtt size this test will fail with -ENOMEM as we are not freeing gtt bo after each move test. This is generally not an issue when gart size >= gtt size. Reported-by: zhang Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_test.c | 2 +- 1 file chan

Re: [PATCH] drm/amdkfd: Fix an inappropriate error handling in allloc memory of gpu

2021-10-13 Thread Das, Nirmoy
LGTM as we create a gem object 1st and retrieve amdgpu_bo from the gem object. Acked-by: Nirmoy Das On 10/13/2021 9:28 AM, Lang Yu wrote: We should unreference a gem object instead of an amdgpu bo here. Fixes: 5ae0283e831a ("drm/amdgpu: Add userptr support for KFD") Signed-off-b

Re: [PATCH 1/1] drm/amdgpu: release gtt bo after each move test

2021-10-13 Thread Das, Nirmoy
On 10/13/2021 3:22 AM, zhang wrote: Hi . Nirmoy If you let continue to unpin. this will  allways test a same va for gtt I think we should  rafresh calculate  the value n Right, I guess then the test should only run till gart size. Regards, Nirmoy On 2021/10/12 20:10, Nirmoy Das

Re: [PATCH Review 1/1] drm/ttm: fix debugfs node create failed

2021-10-12 Thread Das, Nirmoy
lready present! [ 54.396848] debugfs: File 'buffer_objects' in directory 'amdttm' already present! We should instead add a check if those debugfs files already exist/created in ttm debugfs dir using debugfs_lookup() before creating. Regards, Nirmoy Reason: pag

[PATCH 1/1] drm/amdgpu: release gtt bo after each move test

2021-10-12 Thread Nirmoy Das
When gart size is < gtt size this test will fail with -ENOMEM as we are not freeing gtt bo after each move test. This is generally not an issue when gart size >= gtt size. Reported-by: zhang Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_test.c | 2 +- 1 file chan

Re: [PATCH 1/1] drm/amdgpu: unify BO evicting method in amdgpu_ttm

2021-10-07 Thread Das, Nirmoy
On 10/7/2021 12:38 PM, Christian König wrote: Am 07.10.21 um 12:00 schrieb Nirmoy Das: Unify BO evicting functionality for possible memory types in amdgpu_ttm.c. Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c |  8 +++---   drivers/gpu/drm/amd/amdgpu

[PATCH 1/1] drm/amdgpu: unify BO evicting method in amdgpu_ttm

2021-10-07 Thread Nirmoy Das
Unify BO evicting functionality for possible memory types in amdgpu_ttm.c. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 8 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 30 - drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 23

Re: [PATCH 1/1] drm/amdgpu: unify BO evicting method in amdgpu_ttm

2021-10-07 Thread Nirmoy
On 10/7/21 8:08 AM, Christian König wrote: Am 06.10.21 um 18:04 schrieb Nirmoy Das: Unify BO evicting functionality for possible memory types in amdgpu_ttm.c and remove corresponding function from amdgpu_object.c. Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c

[PATCH 1/1] drm/amdgpu: unify BO evicting method in amdgpu_ttm

2021-10-06 Thread Nirmoy Das
Unify BO evicting functionality for possible memory types in amdgpu_ttm.c and remove corresponding function from amdgpu_object.c. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 8 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +-- drivers/gpu/drm/amd

Re: [PATCH 1/1] drm/amdgpu: add and use amdgpu_bo_evict_gtt

2021-10-06 Thread Das, Nirmoy
On 10/6/2021 4:58 PM, Christian König wrote: Am 06.10.21 um 16:45 schrieb Nirmoy Das: Unify BO evicting functionality for VRAM and TT memory types in amdgpu_object.c. Use amdgpu_bo_evict_gtt() for evicting gtt memory similar to how we do that for amdgpu_debugfs_evict_vram(). Signed-off

[PATCH 1/1] drm/amdgpu: add and use amdgpu_bo_evict_gtt

2021-10-06 Thread Nirmoy Das
Unify BO evicting functionality for VRAM and TT memory types in amdgpu_object.c. Use amdgpu_bo_evict_gtt() for evicting gtt memory similar to how we do that for amdgpu_debugfs_evict_vram(). Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 +-- drivers/gpu/drm/amd

Re: [PATCH 1/1] drm/amdgpu: return early if debugfs is not initialized

2021-10-06 Thread Das, Nirmoy
On 10/6/2021 1:55 PM, Lazar, Lijo wrote: On 10/6/2021 3:21 PM, Nirmoy Das wrote: Check first if debugfs is initialized before creating amdgpu debugfs files. References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686 Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/amd/amdgpu

[PATCH 1/1] drm/amdgpu: return early if debugfs is not initialized

2021-10-06 Thread Nirmoy Das
Check first if debugfs is initialized before creating amdgpu debugfs files. References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686 Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd

Re: [PATCH 1/1] drm/amdgpu: ignore -EPERM error from debugfs

2021-10-06 Thread Das, Nirmoy
PM, Christian König wrote: Am 05.10.21 um 15:49 schrieb Das, Nirmoy: On 10/5/2021 3:22 PM, Christian König wrote: Am 05.10.21 um 15:11 schrieb Nirmoy Das: Debugfs core APIs will throw -EPERM when user disables debugfs using CONFIG_DEBUG_FS_ALLOW_NONE or with kernel param. We shouldn't see

Re: [PATCH 1/1] drm/amdgpu: ignore -EPERM error from debugfs

2021-10-05 Thread Das, Nirmoy
On 10/5/2021 3:22 PM, Christian König wrote: Am 05.10.21 um 15:11 schrieb Nirmoy Das: Debugfs core APIs will throw -EPERM when user disables debugfs using CONFIG_DEBUG_FS_ALLOW_NONE or with kernel param. We shouldn't see that as an error. Also validate drm root dentry before creating amdgpu

[PATCH 1/1] drm/amdgpu: ignore -EPERM error from debugfs

2021-10-05 Thread Nirmoy Das
Debugfs core APIs will throw -EPERM when user disables debugfs using CONFIG_DEBUG_FS_ALLOW_NONE or with kernel param. We shouldn't see that as an error. Also validate drm root dentry before creating amdgpu debugfs files. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c

Re: [PATCH 1/1] drm/amdgpu: init debugfs drm driver callback

2021-10-05 Thread Das, Nirmoy
On 10/5/2021 2:41 PM, Christian König wrote: Am 05.10.21 um 14:20 schrieb Das, Nirmoy: Hi Christian, On 10/5/2021 2:01 PM, Christian König wrote: Am 05.10.21 um 13:58 schrieb Nirmoy Das: drm_dev_register() will try to init driver's debugfs using drm_driver.debugfs_init call back function

Re: [PATCH 1/1] drm/amdgpu: init debugfs drm driver callback

2021-10-05 Thread Das, Nirmoy
Hi Christian, On 10/5/2021 2:01 PM, Christian König wrote: Am 05.10.21 um 13:58 schrieb Nirmoy Das: drm_dev_register() will try to init driver's debugfs using drm_driver.debugfs_init call back function. Use that callback also for amdgpu to intialize debugfs. Mhm, why is that useful? We

Re: [PATCH 1/1] drm/amdgpu: init debugfs drm driver callback

2021-10-05 Thread Das, Nirmoy
On 10/5/2021 2:01 PM, Christian König wrote: Am 05.10.21 um 13:58 schrieb Nirmoy Das: drm_dev_register() will try to init driver's debugfs using drm_driver.debugfs_init call back function. Use that callback also for amdgpu to intialize debugfs. Mhm, why is that useful? We rather wanted

Re: [PATCH 1/1] drm/amdgpu: init debugfs drm driver callback

2021-10-05 Thread Das, Nirmoy
On 10/5/2021 1:58 PM, Nirmoy Das wrote: drm_dev_register() will try to init driver's debugfs using drm_driver.debugfs_init call back function. Use that callback also for amdgpu to intialize debugfs. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 10

[PATCH 1/1] drm/amdgpu: init debugfs drm driver callback

2021-10-05 Thread Nirmoy Das
drm_dev_register() will try to init driver's debugfs using drm_driver.debugfs_init call back function. Use that callback also for amdgpu to intialize debugfs. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 10 +- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h

Re: [PATCH] drm/amdgpu: revert "Add autodump debugfs node for gpu reset v8"

2021-09-30 Thread Das, Nirmoy
Acked-by: Nirmoy Das On 9/30/2021 11:26 AM, Christian König wrote: This reverts commit 728e7e0cd61899208e924472b9e641dbeb0775c4. Further discussion reveals that this feature is severely broken and needs to be reverted ASAP. GPU reset can never be delayed by userspace even for debugging

[PATCH 1/1] drm/radeon: pass drm dev radeon_agp_head_init directly

2021-09-13 Thread Nirmoy Das
Pass drm dev directly as rdev->ddev gets initialized later on at radeon_device_init(). Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214375 Signed-off-by: Nirmoy Das --- drivers/gpu/drm/radeon/radeon_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/

Re: [PATCH 2/2] drm/amdgpu: cleanup debugfs for amdgpu rings

2021-09-08 Thread Das, Nirmoy
On 9/6/2021 6:45 PM, Sharma, Shashank wrote: On 9/5/2021 5:01 PM, Das, Nirmoy wrote: On 9/5/2021 10:03 AM, Sharma, Shashank wrote: On 9/3/2021 9:44 PM, Das, Nirmoy wrote: Hi Shashank, On 9/3/2021 5:51 PM, Das, Nirmoy wrote: On 9/3/2021 5:26 PM, Sharma, Shashank wrote: On 9/3/2021

Re: [PATCH 1/2] drm/amdgpu: fix use after free during BO move

2021-09-07 Thread Das, Nirmoy
 Acked-by: Nirmoy Das for the 1st patch and second patch is Reviewed-by: Nirmoy Das On 9/7/2021 10:14 AM, Christian König wrote: The memory backing old_mem is already freed at that point, move the check a bit more up. Signed-off-by: Christian König Fixes: bfa3357ef9ab ("drm/ttm: all

Re: [PATCH 2/2] drm/amdgpu: cleanup debugfs for amdgpu rings

2021-09-05 Thread Das, Nirmoy
On 9/5/2021 10:03 AM, Sharma, Shashank wrote: On 9/3/2021 9:44 PM, Das, Nirmoy wrote: Hi Shashank, On 9/3/2021 5:51 PM, Das, Nirmoy wrote: On 9/3/2021 5:26 PM, Sharma, Shashank wrote: On 9/3/2021 1:39 PM, Das, Nirmoy wrote: On 9/3/2021 8:36 AM, Sharma, Shashank wrote: On 9/2/2021

Re: [PATCH 2/2] drm/amdgpu: cleanup debugfs for amdgpu rings

2021-09-03 Thread Das, Nirmoy
Hi Shashank, On 9/3/2021 5:51 PM, Das, Nirmoy wrote: On 9/3/2021 5:26 PM, Sharma, Shashank wrote: On 9/3/2021 1:39 PM, Das, Nirmoy wrote: On 9/3/2021 8:36 AM, Sharma, Shashank wrote: On 9/2/2021 5:14 PM, Nirmoy Das wrote: Use debugfs_create_file_size API for creating ring debugfs file

Re: [PATCH 2/2] drm/amdgpu: cleanup debugfs for amdgpu rings

2021-09-03 Thread Das, Nirmoy
On 9/3/2021 5:26 PM, Sharma, Shashank wrote: On 9/3/2021 1:39 PM, Das, Nirmoy wrote: On 9/3/2021 8:36 AM, Sharma, Shashank wrote: On 9/2/2021 5:14 PM, Nirmoy Das wrote: Use debugfs_create_file_size API for creating ring debugfs file, also cleanup surrounding code. Signed-off

Re: [PATCH 1/2] drm/amdgpu: use IS_ERR for debugfs APIs

2021-09-03 Thread Das, Nirmoy
Hi Christian and Shashank, Please review the v2 : https://patchwork.freedesktop.org/patch/452175/ In v2, I am returning "PTR_ERR(ent)" instead of -EIO which I think makes more sense. Regards, Nirmoy On 9/3/2021 9:53 AM, Christian König wrote: Am 02.09.21 um 13:44 schrieb

Re: [PATCH 2/2] drm/amdgpu: cleanup debugfs for amdgpu rings

2021-09-03 Thread Das, Nirmoy
On 9/3/2021 8:36 AM, Sharma, Shashank wrote: On 9/2/2021 5:14 PM, Nirmoy Das wrote: Use debugfs_create_file_size API for creating ring debugfs file, also cleanup surrounding code. Signed-off-by: Nirmoy Das ---   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c |  4 +---   drivers/gpu/drm/amd

[PATCH v2 1/2] drm/amdgpu: use IS_ERR for debugfs APIs

2021-09-02 Thread Nirmoy Das
debugfs APIs returns encoded error so use IS_ERR for checking return value. v2: return PTR_ERR(ent) References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686 Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 10 -- drivers/gpu/drm/amd/amdgpu

[PATCH 2/2] drm/amdgpu: cleanup debugfs for amdgpu rings

2021-09-02 Thread Nirmoy Das
Use debugfs_create_file_size API for creating ring debugfs file, also cleanup surrounding code. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c| 18 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h

[PATCH 2/2] drm/amdgpu: cleanup debugfs for amdgpu rings

2021-09-02 Thread Nirmoy Das
Use debugfs_create_file_size API for creating ring debugfs file, also cleanup surrounding code. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c| 16 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h

[PATCH 1/2] drm/amdgpu: use IS_ERR for debugfs APIs

2021-09-02 Thread Nirmoy Das
debugfs APIs returns encoded error so use IS_ERR for checking return value. References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686 Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c| 2 +- 2 files changed

[PATCH v3 1/1] drm/amdgpu: detach ring priority from gfx priority

2021-08-26 Thread Nirmoy Das
to define its own priority levels. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 7 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 9 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/gpu

Re: [PATCH v2 1/1] drm/amdgpu: detach ring priority from gfx priority

2021-08-26 Thread Das, Nirmoy
On 8/26/2021 12:48 PM, Christian König wrote: Am 26.08.21 um 12:08 schrieb Nirmoy Das: Currently AMDGPU_RING_PRIO_MAX is redefinition of a max gfx hwip priority, this won't work well when we will have a hwip with different set of priorities than gfx. Also, HW ring priorities are different

[PATCH v2 1/1] drm/amdgpu: detach ring priority from gfx priority

2021-08-26 Thread Nirmoy Das
to define its own priority levels. Signed-off-by: Nirmoy Das Reviewed-by: Lijo Lazar --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 5 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 9 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu

Re: [PATCH 1/1] drm/amdgpu: detach ring priority from gfx priority

2021-08-26 Thread Das, Nirmoy
On 8/26/2021 11:54 AM, Christian König wrote: Am 26.08.21 um 11:27 schrieb Lazar, Lijo: On 8/25/2021 9:12 PM, Nirmoy Das wrote: Currently AMDGPU_RING_PRIO_MAX is redefinition of a max gfx hwip priority, this won't work well when we will have a hwip with different set of priorities than gfx

Re: [PATCH 1/1] drm/amdgpu: detach ring priority from gfx priority

2021-08-26 Thread Das, Nirmoy
On 8/26/2021 11:27 AM, Lazar, Lijo wrote: On 8/25/2021 9:12 PM, Nirmoy Das wrote: Currently AMDGPU_RING_PRIO_MAX is redefinition of a max gfx hwip priority, this won't work well when we will have a hwip with different set of priorities than gfx. Also, HW ring priorities are different from

[PATCH 1/1] drm/amdgpu: detach ring priority from gfx priority

2021-08-25 Thread Nirmoy Das
to define its own priority levels. Signed-off-by: Nirmoy Das --- drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 6 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 10 -- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h b/drivers/gpu/drm

Re: [PATCH 1/1] drm/amdgpu: rework context priority handling

2021-08-25 Thread Das, Nirmoy
On 8/25/2021 2:29 PM, Christian König wrote: Am 25.08.21 um 14:20 schrieb Lazar, Lijo: On 8/25/2021 4:52 PM, Nirmoy Das wrote: To get a hardware queue priority for a context, we are currently mapping AMDGPU_CTX_PRIORITY_* to DRM_SCHED_PRIORITY_* and then to hardware queue priority, which

  1   2   3   4   5   6   7   8   9   >