amdgpu: remove load and unload callbacks (v3)
Subsystems (3)
cover amdgpu: remove load and unload callbacks (v3)
These are deprecated and the drm will soon start warning when drivers still use them. It was a long and twisty road, but seems to work.
v2: Add additional patch (13/15) which should fix the crash reported by Thomas Zimmermann.
v3: Fix dp aux registration harder, add missing kconfig guard
Alex Deucher (15):
drm/amdgpu: rename amdgpu_debugfs_preempt_cleanup drm/amdgpu/ttm: move debugfs init into core amdgpu debugfs drm/amdgpu/pm: move debugfs init into core amdgpu debugfs drm/amdgpu/sa: move debugfs init into core amdgpu debugfs drm/amdgpu/fence: move debugfs init into core amdgpu debugfs drm/amdgpu/gem: move debugfs init into core amdgpu debugfs drm/amdgpu/regs: move debugfs init into core amdgpu debugfs drm/amdgpu/firmware: move debugfs init into core amdgpu debugfs drm/amdgpu: don't call drm_connector_register for non-MST ports drm/amdgpu/display: move debugfs init into core amdgpu debugfs (v2) drm/amd/display: move dpcd debugfs members setup drm/amdgpu/display: add a late register connector callback drm/amdgpu/display: split dp connector registration (v2) drm/amdgpu/ring: move debugfs init into core amdgpu debugfs drm/amdgpu: drop legacy drm load and unload callbacks
.../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 17 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 69 ++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 - drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 9 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 3 + drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 10 +-- drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 1 - .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 26 +++---- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 + .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 13 ++-- 19 files changed, 140 insertions(+), 89 deletions(-)
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/15 drm/amdgpu: rename amdgpu_debugfs_preempt_cleanup
to amdgpu_debugfs_fini. It will be used for other things in the future.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +2 -2
@@ -1229,7 +1229,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) ARRAY_SIZE(amdgpu_debugfs_list)); } -void amdgpu_debugfs_preempt_cleanup (struct amdgpu_device *adev) +void amdgpu_debugfs_fini (struct amdgpu_device *adev) {debugfs_remove (adev->debugfs_preempt); }
@@ -1239,7 +1239,7 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) {return 0 ; } -void amdgpu_debugfs_preempt_cleanup (struct amdgpu_device *adev) { } +void amdgpu_debugfs_fini (struct amdgpu_device *adev) { }int amdgpu_debugfs_regs_init (struct amdgpu_device *adev) {return 0 ;
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h +1 -1
@@ -34,7 +34,7 @@ struct amdgpu_debugfs {int amdgpu_debugfs_regs_init (struct amdgpu_device *adev);void amdgpu_debugfs_regs_cleanup (struct amdgpu_device *adev);int amdgpu_debugfs_init (struct amdgpu_device *adev); -void amdgpu_debugfs_preempt_cleanup (struct amdgpu_device *adev); +void amdgpu_debugfs_fini (struct amdgpu_device *adev);int amdgpu_debugfs_add_files (struct amdgpu_device *adev,const struct drm_info_list *files,unsigned nfiles);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
@@ -3260,7 +3260,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev)amdgpu_ucode_sysfs_fini (adev);if (IS_ENABLED (CONFIG_PERF_EVENTS ))amdgpu_pmu_fini (adev); -amdgpu_debugfs_preempt_cleanup (adev); +amdgpu_debugfs_fini (adev);if (amdgpu_discovery && adev->asic_type >=CHIP_NAVI10 )amdgpu_discovery_fini (adev); }
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/15 drm/amdgpu/ttm: move debugfs init into core amdgpu debugfs
In reply to Alex DeucherIn order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for ttm.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 10 ++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 ++------------ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 3 +++ 3 files changed, 15 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +10 -0
@@ -1216,6 +1216,8 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL,int amdgpu_debugfs_init (struct amdgpu_device *adev) { +int r; + adev->debugfs_preempt = debugfs_create_file("amdgpu_preempt_ib", 0600, adev->ddev->primary->debugfs_root, adev,
@@ -1225,12 +1227,20 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)return -EIO ; } +/* Register debugfs entries for amdgpu_ttm */ + r =amdgpu_ttm_debugfs_init (adev); +if (r) { +DRM_ERROR ("Failed to init debugfs\n" ); +return r; + } +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }void amdgpu_debugfs_fini (struct amdgpu_device *adev) { +amdgpu_ttm_debugfs_fini (adev);debugfs_remove (adev->debugfs_preempt); }
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -12
@@ -68,9 +68,6 @@ static int amdgpu_map_buffer(struct ttm_buffer_object *bo,struct amdgpu_ring *ring, uint64_t *addr); -static int amdgpu_ttm_debugfs_init (struct amdgpu_device *adev); -static void amdgpu_ttm_debugfs_fini (struct amdgpu_device *adev); -static int amdgpu_invalidate_caches (struct ttm_bo_device *bdev,uint32_t flags) {return 0 ;
@@ -1921,12 +1918,6 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)return r; } -/* Register debugfs entries for amdgpu_ttm */ - r =amdgpu_ttm_debugfs_init (adev); -if (r) { -DRM_ERROR ("Failed to init debugfs\n" ); -return r; - }return 0 ; }
@@ -1948,7 +1939,6 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev)if (!adev->mman.initialized)return ; -amdgpu_ttm_debugfs_fini (adev);amdgpu_ttm_training_reserve_vram_fini (adev);/* return the IP Discovery TMR memory back to VRAM */ amdgpu_bo_free_kernel (&adev->discovery_memory,NULL ,NULL );
@@ -2548,7 +2538,7 @@ static const struct {#endif -static int amdgpu_ttm_debugfs_init (struct amdgpu_device *adev) +int amdgpu_ttm_debugfs_init (struct amdgpu_device *adev) {#if defined(CONFIG_DEBUG_FS )unsigned count;
@@ -2584,7 +2574,7 @@ static int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev)#endif } -static void amdgpu_ttm_debugfs_fini (struct amdgpu_device *adev) +void amdgpu_ttm_debugfs_fini (struct amdgpu_device *adev) {#if defined(CONFIG_DEBUG_FS )unsigned i;
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +3 -0
@@ -133,4 +133,7 @@ uint64_t amdgpu_ttm_tt_pde_flags(struct ttm_tt *ttm, struct ttm_mem_reg *mem);uint64_t amdgpu_ttm_tt_pte_flags (struct amdgpu_device *adev,struct ttm_tt *ttm,struct ttm_mem_reg *mem); +int amdgpu_ttm_debugfs_init (struct amdgpu_device *adev); +void amdgpu_ttm_debugfs_fini (struct amdgpu_device *adev); +#endif
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/15 drm/amdgpu/pm: move debugfs init into core amdgpu debugfs
In reply to Alex DeucherIn order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for pm.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 +++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 9 +-------- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +7 -0
@@ -31,6 +31,7 @@#include <drm/drm_debugfs.h> #include "amdgpu.h" +#include "amdgpu_pm.h" /** * amdgpu_debugfs_add_files - Add simple debugfs entries
@@ -1234,6 +1235,12 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)return r; } + r =amdgpu_debugfs_pm_init (adev); +if (r) { +DRM_ERROR ("Failed to register debugfs file for dpm!\n" ); +return r; + } +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +1 -8
@@ -41,8 +41,6 @@#include "hwmgr.h" #define WIDTH_4K 3840 -static int amdgpu_debugfs_pm_init (struct amdgpu_device *adev); -static const struct cg_flag_name clocks[] = { {AMD_CG_SUPPORT_GFX_MGCG ,"Graphics Medium Grain Clock Gating" }, {AMD_CG_SUPPORT_GFX_MGLS ,"Graphics Medium Grain memory Light Sleep" },
@@ -3398,11 +3396,6 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)DRM_ERROR ("failed to create device file unique_id\n" );return ret; } - ret =amdgpu_debugfs_pm_init (adev); -if (ret) { -DRM_ERROR ("Failed to register debugfs file for dpm!\n" ); -return ret; - }if ((adev->asic_type >=CHIP_VEGA10 ) && !(adev->flags &AMD_IS_APU )) {
@@ -3669,7 +3662,7 @@ static const struct drm_info_list amdgpu_pm_info_list[] = { };#endif -static int amdgpu_debugfs_pm_init (struct amdgpu_device *adev) +int amdgpu_debugfs_pm_init (struct amdgpu_device *adev) {#if defined(CONFIG_DEBUG_FS )return amdgpu_debugfs_add_files (adev, amdgpu_pm_info_list,ARRAY_SIZE (amdgpu_pm_info_list));
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h +2 -0
@@ -43,4 +43,6 @@ void amdgpu_dpm_enable_uvd(struct amdgpu_device *adev, bool enable);void amdgpu_dpm_enable_vce (struct amdgpu_device *adev,bool enable);void amdgpu_dpm_enable_jpeg (struct amdgpu_device *adev,bool enable); +int amdgpu_debugfs_pm_init (struct amdgpu_device *adev); +#endif
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/15 drm/amdgpu/sa: move debugfs init into core amdgpu debugfs
In reply to Alex DeucherIn order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for SA (sub allocator).
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 7 ++----- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 + 3 files changed, 7 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +4 -0
@@ -1241,6 +1241,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)return r; } +if (amdgpu_debugfs_sa_init (adev)) { +dev_err (adev->dev,"failed to register debugfs file for SA\n" ); + } +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +2 -5
@@ -48,7 +48,6 @@* produce command buffers which are send to the kernel and * put in IBs for execution by the requested ring. */ -static int amdgpu_debugfs_sa_init (struct amdgpu_device *adev);/** * amdgpu_ib_get - request an IB (Indirect Buffer)
@@ -295,9 +294,7 @@ int amdgpu_ib_pool_init(struct amdgpu_device *adev) } adev->ib_pool_ready = true; -if (amdgpu_debugfs_sa_init (adev)) { -dev_err (adev->dev,"failed to register debugfs file for SA\n" ); - } +return 0 ; }
@@ -421,7 +418,7 @@ static const struct drm_info_list amdgpu_debugfs_sa_list[] = {#endif -static int amdgpu_debugfs_sa_init (struct amdgpu_device *adev) +int amdgpu_debugfs_sa_init (struct amdgpu_device *adev) {#if defined(CONFIG_DEBUG_FS )return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_sa_list,1 );
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +1 -0
@@ -330,6 +330,7 @@ void amdgpu_sa_bo_free(struct amdgpu_device *adev,void amdgpu_sa_bo_dump_debug_info (struct amdgpu_sa_manager *sa_manager,struct seq_file *m);#endif +int amdgpu_debugfs_sa_init (struct amdgpu_device *adev);bool amdgpu_bo_support_uswc (u64 bo_flags);
Signature · 6 lines
2.24.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 5/15 drm/amdgpu/fence: move debugfs init into core amdgpu debugfs
In reply to Alex DeucherIn order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for fence handling.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +3 -0
@@ -1245,6 +1245,9 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)dev_err (adev->dev,"failed to register debugfs file for SA\n" ); } +if (amdgpu_debugfs_fence_init (adev)) +dev_err (adev->dev,"fence debugfs file creation failed\n" ); +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +0 -3
@@ -503,9 +503,6 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring,*/ int amdgpu_fence_driver_init (struct amdgpu_device *adev) { -if (amdgpu_debugfs_fence_init (adev)) -dev_err (adev->dev,"fence debugfs file creation failed\n" ); -return 0 ; }
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/15 drm/amdgpu/gem: move debugfs init into core amdgpu debugfs
In reply to Alex DeucherIn order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for gem.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +4 -0
@@ -1248,6 +1248,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)if (amdgpu_debugfs_fence_init (adev))dev_err (adev->dev,"fence debugfs file creation failed\n" ); + r =amdgpu_debugfs_gem_init (adev); +if (r) +DRM_ERROR ("registering gem debugfs failed (%d).\n" , r); +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
@@ -3123,10 +3123,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, }else adev->ucode_sysfs_en = true; - r =amdgpu_debugfs_gem_init (adev); -if (r) -DRM_ERROR ("registering gem debugfs failed (%d).\n" , r); - r =amdgpu_debugfs_regs_init (adev);if (r)DRM_ERROR ("registering register debugfs failed (%d).\n" , r);
Signature · 6 lines
2.24.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 7/15 drm/amdgpu/regs: move debugfs init into core amdgpu debugfs
In reply to Alex DeucherIn order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for register access files.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +4 -0
@@ -1252,6 +1252,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)if (r)DRM_ERROR ("registering gem debugfs failed (%d).\n" , r); + r =amdgpu_debugfs_regs_init (adev); +if (r) +DRM_ERROR ("registering register debugfs failed (%d).\n" , r); +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
@@ -3123,10 +3123,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, }else adev->ucode_sysfs_en = true; - r =amdgpu_debugfs_regs_init (adev); -if (r) -DRM_ERROR ("registering register debugfs failed (%d).\n" , r); - r =amdgpu_debugfs_firmware_init (adev);if (r)DRM_ERROR ("registering firmware debugfs failed (%d).\n" , r);
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/15 drm/amdgpu/firmware: move debugfs init into core amdgpu debugfs
In reply to Alex DeucherIn order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for firmware.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 ++++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +4 -0
@@ -1256,6 +1256,10 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)if (r)DRM_ERROR ("registering register debugfs failed (%d).\n" , r); + r =amdgpu_debugfs_firmware_init (adev); +if (r) +DRM_ERROR ("registering firmware debugfs failed (%d).\n" , r); +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -4
@@ -3123,10 +3123,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, }else adev->ucode_sysfs_en = true; - r =amdgpu_debugfs_firmware_init (adev); -if (r) -DRM_ERROR ("registering firmware debugfs failed (%d).\n" , r); - r =amdgpu_debugfs_init (adev);if (r)DRM_ERROR ("Creating debugfs files failed (%d).\n" , r);
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/15 drm/amdgpu: don't call drm_connector_register for non-MST ports
In reply to Alex DeucherThe core does this for us now.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 1 - drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 1 - drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 - 3 files changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +0 -1
@@ -1931,7 +1931,6 @@ amdgpu_connector_add(struct amdgpu_device *adev, connector->polled =DRM_CONNECTOR_POLL_HPD ; connector->display_info.subpixel_order = subpixel_order; -drm_connector_register (connector);if (has_aux)amdgpu_atombios_dp_aux_init (amdgpu_connector);
drivers/gpu/drm/amd/amdgpu/dce_virtual.c +0 -1
@@ -609,7 +609,6 @@ static int dce_virtual_connector_encoder_init(struct amdgpu_device *adev, connector->display_info.subpixel_order = SubPixelHorizontalRGB; connector->interlace_allowed = false; connector->doublescan_allowed = false; -drm_connector_register (connector);/* link them */ drm_connector_attach_encoder (connector, encoder);
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
@@ -5839,7 +5839,6 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,drm_connector_attach_encoder ( &aconnector->base, &aencoder->base); -drm_connector_register (&aconnector->base);#if defined(CONFIG_DEBUG_FS )connector_debugfs_init (aconnector); aconnector->debugfs_dpcd_address =0 ;
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/15 drm/amdgpu/display: move debugfs init into core amdgpu debugfs (v2)
In reply to Alex DeucherIn order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for display.
v2: add config guard for DC
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 8 ++++++++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ----- 2 files changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +8 -0
@@ -32,6 +32,7 @@#include "amdgpu.h" #include "amdgpu_pm.h" +#include "amdgpu_dm_debugfs.h" /** * amdgpu_debugfs_add_files - Add simple debugfs entries
@@ -1260,6 +1261,13 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)if (r)DRM_ERROR ("registering firmware debugfs failed (%d).\n" , r); +#if defined(CONFIG_DRM_AMD_DC ) +if (amdgpu_device_has_dc_support (adev)) { +if (dtn_debugfs_init (adev)) +DRM_ERROR ("amdgpu: failed initialize dtn debugfs support.\n" ); + } +#endif +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -5
@@ -991,11 +991,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) goto error; } -#if defined(CONFIG_DEBUG_FS ) -if (dtn_debugfs_init (adev)) -DRM_ERROR ("amdgpu: failed initialize dtn debugfs support.\n" ); -#endif -DRM_DEBUG_DRIVER ("KMS initialized.\n" );return 0 ;
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/15 drm/amd/display: move dpcd debugfs members setup
In reply to Alex DeucherInto the function that creates the debugfs files rather than setting them explicitly in the callers.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 +++ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
@@ -5836,8 +5836,6 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,#if defined(CONFIG_DEBUG_FS )connector_debugfs_init (aconnector); - aconnector->debugfs_dpcd_address =0 ; - aconnector->debugfs_dpcd_size =0 ;#endif if (connector_type == DRM_MODE_CONNECTOR_DisplayPort
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +3 -0
@@ -1066,6 +1066,9 @@ void connector_debugfs_init(struct amdgpu_dm_connector *connector)debugfs_create_file_unsafe ("force_yuv420_output" ,0644 , dir, connector, &force_yuv420_output_fops); + connector->debugfs_dpcd_address =0 ; + connector->debugfs_dpcd_size =0 ; + }/*
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +0 -2
@@ -158,8 +158,6 @@ amdgpu_dm_mst_connector_late_register(struct drm_connector *connector)#if defined(CONFIG_DEBUG_FS )connector_debugfs_init (amdgpu_dm_connector); - amdgpu_dm_connector->debugfs_dpcd_address =0 ; - amdgpu_dm_connector->debugfs_dpcd_size =0 ;#endif return drm_dp_mst_connector_late_register (connector, port);
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/15 drm/amdgpu/display: add a late register connector callback
In reply to Alex DeucherTo handle debugfs setup on non DP MST connectors.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +14 -4
@@ -4486,6 +4486,19 @@ amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector)return &new_state->base; } +static int +amdgpu_dm_connector_late_register (struct drm_connector *connector) +{ +struct amdgpu_dm_connector *amdgpu_dm_connector = +to_amdgpu_dm_connector (connector); + +#if defined(CONFIG_DEBUG_FS ) +connector_debugfs_init (amdgpu_dm_connector); +#endif + +return 0 ; +} +static const struct drm_connector_funcs amdgpu_dm_connector_funcs = { .reset = amdgpu_dm_connector_funcs_reset, .detect = amdgpu_dm_connector_detect,
@@ -4495,6 +4508,7 @@ static const struct drm_connector_funcs amdgpu_dm_connector_funcs = { .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, .atomic_set_property = amdgpu_dm_connector_atomic_set_property, .atomic_get_property = amdgpu_dm_connector_atomic_get_property, + .late_register = amdgpu_dm_connector_late_register, .early_unregister = amdgpu_dm_connector_unregister };
@@ -5834,10 +5848,6 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,drm_connector_attach_encoder ( &aconnector->base, &aencoder->base); -#if defined(CONFIG_DEBUG_FS ) -connector_debugfs_init (aconnector); -#endif -if (connector_type == DRM_MODE_CONNECTOR_DisplayPort || connector_type == DRM_MODE_CONNECTOR_eDP)amdgpu_dm_initialize_dp_connector (dm, aconnector);
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 12/15] drm/amdgpu/display: add a late register connector callback
Quoted 19 lines · Alex Deucher
To handle debugfs setup on non DP MST connectors.
Reviewed-by Harry Wentland <[email protected]>Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-0@@ -4486,6 +4486,19 @@ amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector)return &new_state->base; } +static int +amdgpu_dm_connector_late_register (struct drm_connector *connector)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector) · line 4500
Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +10
-0+{ +struct amdgpu_dm_connector *amdgpu_dm_connector = +to_amdgpu_dm_connector (connector); + +#if defined(CONFIG_DEBUG_FS ) +connector_debugfs_init (amdgpu_dm_connector); +#endif + +return 0 ; +}
This introduced a compiler warning:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function ‘amdgpu_dm_connector_late_register’:drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:4726:30: warning: unused variable ‘amdgpu_dm_connector’ [-Wunused-variable]
4726 | struct amdgpu_dm_connector *amdgpu_dm_connector =
| ^~~~~~~~~~~~~~~~~~~
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/15 drm/amdgpu/display: split dp connector registration (v2)
In reply to Alex DeucherSplit into init and register functions to avoid a segfault in some configs when the load/unload callbacks are removed.
v2:
- add back accidently dropped has_aux setting
- set dev in late_register
--- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 16 ++++++++++++++++ drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 10 ++-------- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 11 ++++++++--- 3 files changed, 26 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +16 -0
@@ -1461,6 +1461,20 @@ static enum drm_mode_status amdgpu_connector_dp_mode_valid(struct drm_connectorreturn MODE_OK ; } +static int +amdgpu_connector_late_register (struct drm_connector *connector) +{ +struct amdgpu_connector *amdgpu_connector =to_amdgpu_connector (connector); +int r =0 ; + +if (amdgpu_connector->ddc_bus->has_aux) { + amdgpu_connector->ddc_bus->aux.dev = amdgpu_connector->base.kdev; + r =drm_dp_aux_register (&amdgpu_connector->ddc_bus->aux); + } + +return r; +} +static const struct drm_connector_helper_funcs amdgpu_connector_dp_helper_funcs = { .get_modes = amdgpu_connector_dp_get_modes, .mode_valid = amdgpu_connector_dp_mode_valid,
@@ -1475,6 +1489,7 @@ static const struct drm_connector_funcs amdgpu_connector_dp_funcs = { .early_unregister = amdgpu_connector_unregister, .destroy = amdgpu_connector_destroy, .force = amdgpu_connector_dvi_force, + .late_register = amdgpu_connector_late_register, };static const struct drm_connector_funcs amdgpu_connector_edp_funcs = {
@@ -1485,6 +1500,7 @@ static const struct drm_connector_funcs amdgpu_connector_edp_funcs = { .early_unregister = amdgpu_connector_unregister, .destroy = amdgpu_connector_destroy, .force = amdgpu_connector_dvi_force, + .late_register = amdgpu_connector_late_register, };void
drivers/gpu/drm/amd/amdgpu/atombios_dp.c +2 -8
@@ -186,16 +186,10 @@ amdgpu_atombios_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *mvoid amdgpu_atombios_dp_aux_init (struct amdgpu_connector *amdgpu_connector) { -int ret; - amdgpu_connector->ddc_bus->rec.hpd = amdgpu_connector->hpd.hpd; - amdgpu_connector->ddc_bus->aux.dev = amdgpu_connector->base.kdev; amdgpu_connector->ddc_bus->aux.transfer = amdgpu_atombios_dp_aux_transfer; - ret =drm_dp_aux_register (&amdgpu_connector->ddc_bus->aux); -if (!ret) - amdgpu_connector->ddc_bus->has_aux = true; - -WARN (ret,"drm_dp_aux_register_i2c_bus() failed with error %d\n" , ret); +drm_dp_aux_init (&amdgpu_connector->ddc_bus->aux); + amdgpu_connector->ddc_bus->has_aux = true; }/***** general DP utility functions *****/
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +8 -3
@@ -155,6 +155,13 @@ amdgpu_dm_mst_connector_late_register(struct drm_connector *connector)struct amdgpu_dm_connector *amdgpu_dm_connector =to_amdgpu_dm_connector (connector);struct drm_dp_mst_port *port = amdgpu_dm_connector->port; +int r; + + r =drm_dp_aux_register (&amdgpu_dm_connector->dm_dp_aux.aux); +if (r) +return r; +drm_dp_cec_register_connector (&amdgpu_dm_connector->dm_dp_aux.aux, + connector);#if defined(CONFIG_DEBUG_FS )connector_debugfs_init (amdgpu_dm_connector);
@@ -484,9 +491,7 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm, aconnector->dm_dp_aux.aux.transfer = dm_dp_aux_transfer; aconnector->dm_dp_aux.ddc_service = aconnector->dc_link->ddc; -drm_dp_aux_register (&aconnector->dm_dp_aux.aux); -drm_dp_cec_register_connector (&aconnector->dm_dp_aux.aux, - &aconnector->base); +drm_dp_aux_init (&aconnector->dm_dp_aux.aux);if (aconnector->base.connector_type == DRM_MODE_CONNECTOR_eDP)return ;
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/15 drm/amdgpu/ring: move debugfs init into core amdgpu debugfs
In reply to Alex DeucherIn order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for rings.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 23 ++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +++----------- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++++ 3 files changed, 29 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +22 -1
@@ -1218,7 +1218,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL,int amdgpu_debugfs_init (struct amdgpu_device *adev) { -int r; +int r, i; adev->debugfs_preempt = debugfs_create_file("amdgpu_preempt_ib", 0600,
@@ -1268,12 +1268,33 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) }#endif +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; + +if (amdgpu_debugfs_ring_init (adev, ring)) { +DRM_ERROR ("Failed to register debugfs file for rings !\n" ); + } + } +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }void amdgpu_debugfs_fini (struct amdgpu_device *adev) { +int i; + +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; + +amdgpu_debugfs_ring_fini (ring); + }amdgpu_ttm_debugfs_fini (adev);debugfs_remove (adev->debugfs_preempt); }
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +3 -12
@@ -48,9 +48,6 @@* wptr. The GPU then starts fetching commands and executes * them until the pointers are equal again. */ -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring); -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring);/** * amdgpu_ring_alloc - allocate space on the ring buffer
@@ -334,10 +331,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,for (i =0 ; i <DRM_SCHED_PRIORITY_MAX ; ++i)atomic_set (&ring->num_jobs[i],0 ); -if (amdgpu_debugfs_ring_init (adev, ring)) { -DRM_ERROR ("Failed to register debugfs file for rings !\n" ); - } -return 0 ; }
@@ -367,8 +360,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring) &ring->gpu_addr, (void **)&ring->ring); -amdgpu_debugfs_ring_fini (ring); -dma_fence_put (ring->vmid_wait); ring->vmid_wait =NULL ; ring->me =0 ;
@@ -485,8 +476,8 @@ static const struct file_operations amdgpu_debugfs_ring_fops = {#endif -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring) +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )struct drm_minor *minor = adev->ddev->primary;
@@ -507,7 +498,7 @@ static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,return 0 ; } -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )debugfs_remove (ring->ent);
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +4 -0
@@ -329,4 +329,8 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring,int amdgpu_ring_test_helper (struct amdgpu_ring *ring); +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring); +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring); +#endif
Signature · 6 lines
2.24.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 14/15] drm/amdgpu/ring: move debugfs init into core amdgpu debugfs
Quoted 35 lines · Alex Deucher
In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for rings.
Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 23 ++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +++----------- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++++ 3 files changed, 29 insertions(+), 13 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +7
-1@@ -1218,7 +1218,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL,int amdgpu_debugfs_init (struct amdgpu_device *adev) { -int r; +int r, i; adev->debugfs_preempt = debugfs_create_file("amdgpu_preempt_ib", 0600,@@ -1268,12 +1268,33 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) }#endif +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; +
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c int amdgpu_debugfs_init(struct amdgpu_device *adev) · line 1286
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +5
-0+if (amdgpu_debugfs_ring_init (adev, ring)) { +DRM_ERROR ("Failed to register debugfs file for rings !\n" ); + } + } +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }void amdgpu_debugfs_fini (struct amdgpu_device *adev)
btw debugfs_fini shouldn't be needed anymore, Greg KH removed this all. drm core removes all debugfs files recusrively for you, there should be 0 need for debugfs cleanup.
Also at least my tree doesn't even have this, where does this apply to? -Daniel
Quoted 88 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +10
-0{ +int i; + +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; + +amdgpu_debugfs_ring_fini (ring); + }amdgpu_ttm_debugfs_fini (adev);debugfs_remove (adev->debugfs_preempt); }drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +3
-12@@ -48,9 +48,6 @@* wptr. The GPU then starts fetching commands and executes * them until the pointers are equal again. */ -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring); -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring);/** * amdgpu_ring_alloc - allocate space on the ring buffer @@ -334,10 +331,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,for (i =0 ; i <DRM_SCHED_PRIORITY_MAX ; ++i)atomic_set (&ring->num_jobs[i],0 ); -if (amdgpu_debugfs_ring_init (adev, ring)) { -DRM_ERROR ("Failed to register debugfs file for rings !\n" ); - } -return 0 ; }@@ -367,8 +360,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring) &ring->gpu_addr, (void **)&ring->ring); -amdgpu_debugfs_ring_fini (ring); -dma_fence_put (ring->vmid_wait); ring->vmid_wait =NULL ; ring->me =0 ;@@ -485,8 +476,8 @@ static const struct file_operations amdgpu_debugfs_ring_fops = {#endif -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring) +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )struct drm_minor *minor = adev->ddev->primary;@@ -507,7 +498,7 @@ static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,return 0 ; } -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )debugfs_remove (ring->ent);drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +4
-0@@ -329,4 +329,8 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring,int amdgpu_ring_test_helper (struct amdgpu_ring *ring); +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring); +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring); +#endif Signature · 6 lines
2.24.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerRe: [PATCH 14/15] drm/amdgpu/ring: move debugfs init into core amdgpu debugfs
Am 13.02.20 um 10:54 schrieb Daniel Vetter:
Quoted 45 lines · Alex Deucher
Quoted 44 lines
In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for rings.
Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 23 ++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +++----------- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++++ 3 files changed, 29 insertions(+), 13 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +12
-1@@ -1218,7 +1218,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL,int amdgpu_debugfs_init (struct amdgpu_device *adev) { -int r; +int r, i; adev->debugfs_preempt = debugfs_create_file("amdgpu_preempt_ib", 0600,@@ -1268,12 +1268,33 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) }#endif +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; + +if (amdgpu_debugfs_ring_init (adev, ring)) { +DRM_ERROR ("Failed to register debugfs file for rings !\n" ); + } + } +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c int amdgpu_debugfs_init(struct amdgpu_device *adev) · line 1286
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0
-0void amdgpu_debugfs_fini (struct amdgpu_device *adev)btw
debugfs_finishouldn't be needed anymore, Greg KH removed this all. drm core removes all debugfs files recusrively for you, there should be 0 need for debugfs cleanup.
Oh, yes please. Removing that was on my TODO list for an eternity as well.
Quoted 2 lines
Also at least my tree doesn't even have this, where does this apply to?
I would guess amd-staging-drm-next, but it might be that Alex is waiting for the next rebase to land.
Christian.
Quoted 86 lines
-Daniel
Quoted 84 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +10
-0{ +int i; + +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; + +amdgpu_debugfs_ring_fini (ring); + }amdgpu_ttm_debugfs_fini (adev);debugfs_remove (adev->debugfs_preempt); }drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +3
-12@@ -48,9 +48,6 @@* wptr. The GPU then starts fetching commands and executes * them until the pointers are equal again. */ -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring); -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring);/** * amdgpu_ring_alloc - allocate space on the ring buffer @@ -334,10 +331,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,for (i =0 ; i <DRM_SCHED_PRIORITY_MAX ; ++i)atomic_set (&ring->num_jobs[i],0 ); -if (amdgpu_debugfs_ring_init (adev, ring)) { -DRM_ERROR ("Failed to register debugfs file for rings !\n" ); - } -return 0 ; }@@ -367,8 +360,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring) &ring->gpu_addr, (void **)&ring->ring); -amdgpu_debugfs_ring_fini (ring); -dma_fence_put (ring->vmid_wait); ring->vmid_wait =NULL ; ring->me =0 ;@@ -485,8 +476,8 @@ static const struct file_operations amdgpu_debugfs_ring_fops = {#endif -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring) +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )struct drm_minor *minor = adev->ddev->primary;@@ -507,7 +498,7 @@ static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,return 0 ; } -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )debugfs_remove (ring->ent);drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +4
-0@@ -329,4 +329,8 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring,int amdgpu_ring_test_helper (struct amdgpu_ring *ring); +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring); +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring); +#endif Signature · 1 line
2.24.1
Quoted 4 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=02%7C01%7Cchristian.koenig%40amd.com%7C0fa2f611ed814861bf6908d7b06abf6a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637171844839285121&sdata=ey6I%2B8fjxpNeFT%2ByFEl3rNubbG4S%2F5hdSkRdX8%2BPJLk%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 14/15] drm/amdgpu/ring: move debugfs init into core amdgpu debugfs
Quoted 52 lines · Christian König
Am 13.02.20 um 10:54 schrieb Daniel Vetter:
Quoted 45 lines · Alex Deucher
Quoted 44 lines
In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for rings.
Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 23 ++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +++----------- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++++ 3 files changed, 29 insertions(+), 13 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +12
-1@@ -1218,7 +1218,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL,int amdgpu_debugfs_init (struct amdgpu_device *adev) { -int r; +int r, i; adev->debugfs_preempt = debugfs_create_file("amdgpu_preempt_ib", 0600,@@ -1268,12 +1268,33 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) }#endif +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; + +if (amdgpu_debugfs_ring_init (adev, ring)) { +DRM_ERROR ("Failed to register debugfs file for rings !\n" ); + } + } +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c int amdgpu_debugfs_init(struct amdgpu_device *adev) · line 1286
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0
-0void amdgpu_debugfs_fini (struct amdgpu_device *adev)btw
debugfs_finishouldn't be needed anymore, Greg KH removed this all. drm core removes all debugfs files recusrively for you, there should be 0 need for debugfs cleanup.
Quoted 8 lines
Oh, yes please. Removing that was on my TODO list for an eternity as well.
Quoted 2 lines
Also at least my tree doesn't even have this, where does this apply to?
I would guess amd-staging-drm-next, but it might be that Alex is waiting for the next rebase to land.
Patches are against my drm-next branch which is based on fdo drm-next. There are a number of files which the driver creates directly rather than through drm.
Alex
Quoted 88 lines
Christian.
Quoted 86 lines
-Daniel
Quoted 84 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +10
-0{ +int i; + +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; + +amdgpu_debugfs_ring_fini (ring); + }amdgpu_ttm_debugfs_fini (adev);debugfs_remove (adev->debugfs_preempt); }drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +3
-12@@ -48,9 +48,6 @@* wptr. The GPU then starts fetching commands and executes * them until the pointers are equal again. */ -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring); -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring);/** * amdgpu_ring_alloc - allocate space on the ring buffer @@ -334,10 +331,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,for (i =0 ; i <DRM_SCHED_PRIORITY_MAX ; ++i)atomic_set (&ring->num_jobs[i],0 ); -if (amdgpu_debugfs_ring_init (adev, ring)) { -DRM_ERROR ("Failed to register debugfs file for rings !\n" ); - } -return 0 ; }@@ -367,8 +360,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring) &ring->gpu_addr, (void **)&ring->ring); -amdgpu_debugfs_ring_fini (ring); -dma_fence_put (ring->vmid_wait); ring->vmid_wait =NULL ; ring->me =0 ;@@ -485,8 +476,8 @@ static const struct file_operations amdgpu_debugfs_ring_fops = {#endif -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring) +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )struct drm_minor *minor = adev->ddev->primary;@@ -507,7 +498,7 @@ static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,return 0 ; } -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )debugfs_remove (ring->ent);drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +4
-1@@ -329,4 +329,8 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring,int amdgpu_ring_test_helper (struct amdgpu_ring *ring); +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring); +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring); +#endif --2.24.1
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=02%7C01%7Cchristian.koenig%40amd.com%7C0fa2f611ed814861bf6908d7b06abf6a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637171844839285121&sdata=ey6I%2B8fjxpNeFT%2ByFEl3rNubbG4S%2F5hdSkRdX8%2BPJLk%3D&reserved=0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Christian König
maintainerRe: [PATCH 14/15] drm/amdgpu/ring: move debugfs init into core amdgpu debugfs
Am 13.02.20 um 15:32 schrieb Alex Deucher:
Quoted 54 lines
Quoted 52 lines · Christian König
Am 13.02.20 um 10:54 schrieb Daniel Vetter:
Quoted 45 lines · Alex Deucher
Quoted 44 lines
In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for rings.
Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 23 ++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +++----------- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++++ 3 files changed, 29 insertions(+), 13 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +12
-1@@ -1218,7 +1218,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL,int amdgpu_debugfs_init (struct amdgpu_device *adev) { -int r; +int r, i; adev->debugfs_preempt = debugfs_create_file("amdgpu_preempt_ib", 0600,@@ -1268,12 +1268,33 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) }#endif +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; + +if (amdgpu_debugfs_ring_init (adev, ring)) { +DRM_ERROR ("Failed to register debugfs file for rings !\n" ); + } + } +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c int amdgpu_debugfs_init(struct amdgpu_device *adev) · line 1286
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0
-0void amdgpu_debugfs_fini (struct amdgpu_device *adev)btw
debugfs_finishouldn't be needed anymore, Greg KH removed this all. drm core removes all debugfs files recusrively for you, there should be 0 need for debugfs cleanup.Oh, yes please. Removing that was on my TODO list for an eternity as well.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Also at least my tree doesn't even have this, where does this apply to?
I would guess amd-staging-drm-next, but it might be that Alex is waiting for the next rebase to land.
Patches are against my drm-next branch which is based on fdo drm-next. There are a number of files which the driver creates directly rather than through drm.
The last time I locked it I was about to completely nuke creating anything through DRM and just create it directly.
As Daniel wrote we also don't have to remove anything explicitly, that is done implicitly when the whole directory is removed.
Christian.
Quoted 91 lines
Alex
Quoted 88 lines
Christian.
Quoted 86 lines
-Daniel
Quoted 84 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +10
-0{ +int i; + +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; + +amdgpu_debugfs_ring_fini (ring); + }amdgpu_ttm_debugfs_fini (adev);debugfs_remove (adev->debugfs_preempt); }drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +3
-12@@ -48,9 +48,6 @@* wptr. The GPU then starts fetching commands and executes * them until the pointers are equal again. */ -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring); -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring);/** * amdgpu_ring_alloc - allocate space on the ring buffer @@ -334,10 +331,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,for (i =0 ; i <DRM_SCHED_PRIORITY_MAX ; ++i)atomic_set (&ring->num_jobs[i],0 ); -if (amdgpu_debugfs_ring_init (adev, ring)) { -DRM_ERROR ("Failed to register debugfs file for rings !\n" ); - } -return 0 ; }@@ -367,8 +360,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring) &ring->gpu_addr, (void **)&ring->ring); -amdgpu_debugfs_ring_fini (ring); -dma_fence_put (ring->vmid_wait); ring->vmid_wait =NULL ; ring->me =0 ;@@ -485,8 +476,8 @@ static const struct file_operations amdgpu_debugfs_ring_fops = {#endif -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring) +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )struct drm_minor *minor = adev->ddev->primary;@@ -507,7 +498,7 @@ static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,return 0 ; } -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )debugfs_remove (ring->ent);drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +4
-1@@ -329,4 +329,8 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring,int amdgpu_ring_test_helper (struct amdgpu_ring *ring); +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring); +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring); +#endif --2.24.1
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=02%7C01%7Cchristian.koenig%40amd.com%7C0647e5ecad344fb4d19208d7b09198d6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637172011693912378&sdata=dBwdfJW2nPzwPZJYklNexgu0NWT3vGSOgbO79SLQ%2B74%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 14/15] drm/amdgpu/ring: move debugfs init into core amdgpu debugfs
Quoted 64 lines · Christian König
Am 13.02.20 um 15:32 schrieb Alex Deucher:
Quoted 54 lines
Quoted 52 lines · Christian König
Am 13.02.20 um 10:54 schrieb Daniel Vetter:
Quoted 45 lines · Alex Deucher
Quoted 44 lines
In order to remove the load and unload drm callbacks, we need to reorder the init sequence to move all the drm debugfs file handling. Do this for rings.
Acked-by Christian König <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 23 ++++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +++----------- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++++ 3 files changed, 29 insertions(+), 13 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +12
-1@@ -1218,7 +1218,7 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_ib_preempt, NULL,int amdgpu_debugfs_init (struct amdgpu_device *adev) { -int r; +int r, i; adev->debugfs_preempt = debugfs_create_file("amdgpu_preempt_ib", 0600,@@ -1268,12 +1268,33 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev) }#endif +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; + +if (amdgpu_debugfs_ring_init (adev, ring)) { +DRM_ERROR ("Failed to register debugfs file for rings !\n" ); + } + } +return amdgpu_debugfs_add_files (adev, amdgpu_debugfs_list,ARRAY_SIZE (amdgpu_debugfs_list)); }Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c int amdgpu_debugfs_init(struct amdgpu_device *adev) · line 1286
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0
-0void amdgpu_debugfs_fini (struct amdgpu_device *adev)btw
debugfs_finishouldn't be needed anymore, Greg KH removed this all. drm core removes all debugfs files recusrively for you, there should be 0 need for debugfs cleanup.Oh, yes please. Removing that was on my TODO list for an eternity as well.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Also at least my tree doesn't even have this, where does this apply to?
I would guess amd-staging-drm-next, but it might be that Alex is waiting for the next rebase to land.
Patches are against my drm-next branch which is based on fdo drm-next. There are a number of files which the driver creates directly rather than through drm.
Quoted 5 lines
The last time I locked it I was about to completely nuke creating anything through DRM and just create it directly.
As Daniel wrote we also don't have to remove anything explicitly, that is done implicitly when the whole directory is removed.
I dunno. Most of this stuff has been there for years. Maybe someone wants to take a look if it can be further cleaned up. It builds fine against current kernels.
Alex
Quoted 94 lines
Christian.
Quoted 91 lines
Alex
Quoted 88 lines
Christian.
Quoted 86 lines
-Daniel
Quoted 84 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +10
-0{ +int i; + +for (i =0 ; i <AMDGPU_MAX_RINGS ; ++i) { +struct amdgpu_ring *ring = adev->rings[i]; + +if (!ring) +continue ; + +amdgpu_debugfs_ring_fini (ring); + }amdgpu_ttm_debugfs_fini (adev);debugfs_remove (adev->debugfs_preempt); }drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +3
-12@@ -48,9 +48,6 @@* wptr. The GPU then starts fetching commands and executes * them until the pointers are equal again. */ -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring); -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring);/** * amdgpu_ring_alloc - allocate space on the ring buffer @@ -334,10 +331,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,for (i =0 ; i <DRM_SCHED_PRIORITY_MAX ; ++i)atomic_set (&ring->num_jobs[i],0 ); -if (amdgpu_debugfs_ring_init (adev, ring)) { -DRM_ERROR ("Failed to register debugfs file for rings !\n" ); - } -return 0 ; }@@ -367,8 +360,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring) &ring->gpu_addr, (void **)&ring->ring); -amdgpu_debugfs_ring_fini (ring); -dma_fence_put (ring->vmid_wait); ring->vmid_wait =NULL ; ring->me =0 ;@@ -485,8 +476,8 @@ static const struct file_operations amdgpu_debugfs_ring_fops = {#endif -static int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, -struct amdgpu_ring *ring) +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )struct drm_minor *minor = adev->ddev->primary;@@ -507,7 +498,7 @@ static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,return 0 ; } -static void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring) {#if defined(CONFIG_DEBUG_FS )debugfs_remove (ring->ent);drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h +4
-1@@ -329,4 +329,8 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring,int amdgpu_ring_test_helper (struct amdgpu_ring *ring); +int amdgpu_debugfs_ring_init (struct amdgpu_device *adev, +struct amdgpu_ring *ring); +void amdgpu_debugfs_ring_fini (struct amdgpu_ring *ring); +#endif --2.24.1
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&data=02%7C01%7Cchristian.koenig%40amd.com%7C0647e5ecad344fb4d19208d7b09198d6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637172011693912378&sdata=dBwdfJW2nPzwPZJYklNexgu0NWT3vGSOgbO79SLQ%2B74%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/15 drm/amdgpu: drop legacy drm load and unload callbacks
In reply to Alex DeucherWe've moved the debugfs handling into a centralized place so we can remove the legacy load an unload callbacks.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++++++++++-- 2 files changed, 11 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -5
@@ -3123,10 +3123,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, }else adev->ucode_sysfs_en = true; - r =amdgpu_debugfs_init (adev); -if (r) -DRM_ERROR ("Creating debugfs files failed (%d).\n" , r); -if ((amdgpu_testing &1 )) {if (adev->accel_working)amdgpu_test_moves (adev);
@@ -3248,7 +3244,6 @@ void amdgpu_device_fini(struct amdgpu_device *adev)amdgpu_ucode_sysfs_fini (adev);if (IS_ENABLED (CONFIG_PERF_EVENTS ))amdgpu_pmu_fini (adev); -amdgpu_debugfs_fini (adev);if (amdgpu_discovery && adev->asic_type >=CHIP_NAVI10 )amdgpu_discovery_fini (adev); }
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +11 -2
@@ -1031,6 +1031,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) {struct drm_device *dev; +struct amdgpu_device *adev;unsigned long flags = ent->driver_data;int ret, retry =0 ;bool supports_atomic = false;
@@ -1100,6 +1101,8 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,pci_set_drvdata (pdev, dev); +amdgpu_driver_load_kms (dev, ent->driver_data); + retry_init: ret =drm_dev_register (dev, ent->driver_data);if (ret == -EAGAIN && ++retry <=3 ) {
@@ -1110,6 +1113,11 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, }else if (ret) goto err_pci; + adev = dev->dev_private; + ret =amdgpu_debugfs_init (adev); +if (ret) +DRM_ERROR ("Creating debugfs files failed (%d).\n" , ret); +return 0 ; err_pci:
@@ -1123,6 +1131,7 @@ static void amdgpu_pci_remove(struct pci_dev *pdev) {struct drm_device *dev =pci_get_drvdata (pdev); +struct amdgpu_device *adev = dev->dev_private;#ifdef MODULE if (THIS_MODULE ->state !=MODULE_STATE_GOING )
@@ -1130,6 +1139,8 @@ amdgpu_pci_remove(struct pci_dev *pdev)DRM_ERROR ("Hotplug removal is not supported\n" );drm_dev_unplug (dev);drm_dev_put (dev); +amdgpu_debugfs_fini (adev); +amdgpu_driver_unload_kms (dev);pci_disable_device (pdev);pci_set_drvdata (pdev,NULL ); }
@@ -1436,11 +1447,9 @@ static struct drm_driver kms_driver = {DRIVER_GEM |DRIVER_RENDER |DRIVER_MODESET |DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE, - .load = amdgpu_driver_load_kms, .open = amdgpu_driver_open_kms, .postclose = amdgpu_driver_postclose_kms, .lastclose = amdgpu_driver_lastclose_kms, - .unload = amdgpu_driver_unload_kms, .get_vblank_counter = amdgpu_get_vblank_counter_kms, .enable_vblank = amdgpu_enable_vblank_kms, .disable_vblank = amdgpu_disable_vblank_kms,
Signature · 6 lines
2.24.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Hi
Am 07.02.20 um 20:50 schrieb Alex Deucher:
Quoted 6 lines
These are deprecated and the drm will soon start warning when drivers still use them. It was a long and twisty road, but seems to work.
v2: Add additional patch (13/15) which should fix the crash reported by Thomas Zimmermann.
v3: Fix dp aux registration harder, add missing kconfig guard
No more stacktraces.
Quoted 39 lines
Alex Deucher (15):
drm/amdgpu: renameamdgpu_debugfs_preempt_cleanupdrm/amdgpu/ttm: move debugfs init into core amdgpu debugfs drm/amdgpu/pm: move debugfs init into core amdgpu debugfs drm/amdgpu/sa: move debugfs init into core amdgpu debugfs drm/amdgpu/fence: move debugfs init into core amdgpu debugfs drm/amdgpu/gem: move debugfs init into core amdgpu debugfs drm/amdgpu/regs: move debugfs init into core amdgpu debugfs drm/amdgpu/firmware: move debugfs init into core amdgpu debugfs drm/amdgpu: don't calldrm_connector_registerfor non-MST ports drm/amdgpu/display: move debugfs init into core amdgpu debugfs (v2) drm/amd/display: move dpcd debugfs members setup drm/amdgpu/display: add a late register connector callback drm/amdgpu/display: split dp connector registration (v2) drm/amdgpu/ring: move debugfs init into core amdgpu debugfs drm/amdgpu: drop legacy drm load and unload callbacks.../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 17 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 69 ++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 - drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 9 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 3 + drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 10 +-- drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 1 - .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 26 +++---- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 + .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 13 ++-- 19 files changed, 140 insertions(+), 89 deletions(-)
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Alex
Am 07.02.20 um 20:50 schrieb Alex Deucher:
Quoted 2 lines
These are deprecated and the drm will soon start warning when drivers still use them. It was a long and twisty road, but seems to work.
Are you going to convert radeon as well? It's the only remaining KMS driver that uses load.
Best regards
Thomas
Quoted 43 lines
v2: Add additional patch (13/15) which should fix the crash reported by Thomas Zimmermann.
v3: Fix dp aux registration harder, add missing kconfig guardAlex Deucher (15):
drm/amdgpu: renameamdgpu_debugfs_preempt_cleanupdrm/amdgpu/ttm: move debugfs init into core amdgpu debugfs drm/amdgpu/pm: move debugfs init into core amdgpu debugfs drm/amdgpu/sa: move debugfs init into core amdgpu debugfs drm/amdgpu/fence: move debugfs init into core amdgpu debugfs drm/amdgpu/gem: move debugfs init into core amdgpu debugfs drm/amdgpu/regs: move debugfs init into core amdgpu debugfs drm/amdgpu/firmware: move debugfs init into core amdgpu debugfs drm/amdgpu: don't calldrm_connector_registerfor non-MST ports drm/amdgpu/display: move debugfs init into core amdgpu debugfs (v2) drm/amd/display: move dpcd debugfs members setup drm/amdgpu/display: add a late register connector callback drm/amdgpu/display: split dp connector registration (v2) drm/amdgpu/ring: move debugfs init into core amdgpu debugfs drm/amdgpu: drop legacy drm load and unload callbacks.../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 17 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 69 ++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 - drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 9 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 3 + drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 10 +-- drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 1 - .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 26 +++---- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 + .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 13 ++-- 19 files changed, 140 insertions(+), 89 deletions(-)
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 9 lines · Thomas Zimmermann
Hi Alex
Am 07.02.20 um 20:50 schrieb Alex Deucher:
Quoted 2 lines
These are deprecated and the drm will soon start warning when drivers still use them. It was a long and twisty road, but seems to work.
Are you going to convert radeon as well? It's the only remaining KMS driver that uses load.
It's on my todo list, hopefully this kernel cycle.
Alex
Quoted 48 lines
Best regards
ThomasQuoted 34 lines
v2: Add additional patch (13/15) which should fix the crash reported by Thomas Zimmermann.
v3: Fix dp aux registration harder, add missing kconfig guardAlex Deucher (15):
drm/amdgpu: renameamdgpu_debugfs_preempt_cleanupdrm/amdgpu/ttm: move debugfs init into core amdgpu debugfs drm/amdgpu/pm: move debugfs init into core amdgpu debugfs drm/amdgpu/sa: move debugfs init into core amdgpu debugfs drm/amdgpu/fence: move debugfs init into core amdgpu debugfs drm/amdgpu/gem: move debugfs init into core amdgpu debugfs drm/amdgpu/regs: move debugfs init into core amdgpu debugfs drm/amdgpu/firmware: move debugfs init into core amdgpu debugfs drm/amdgpu: don't calldrm_connector_registerfor non-MST ports drm/amdgpu/display: move debugfs init into core amdgpu debugfs (v2) drm/amd/display: move dpcd debugfs members setup drm/amdgpu/display: add a late register connector callback drm/amdgpu/display: split dp connector registration (v2) drm/amdgpu/ring: move debugfs init into core amdgpu debugfs drm/amdgpu: drop legacy drm load and unload callbacks.../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 17 ++++- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 69 ++++++++++++++++++- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.h | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ----- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 13 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 3 - drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 9 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 15 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 4 ++Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h | 3 + drivers/gpu/drm/amd/amdgpu/atombios_dp.c | 10 +-- drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 1 - .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 26 +++---- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 + .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 13 ++-- 19 files changed, 140 insertions(+), 89 deletions(-)
Quoted 8 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx