1313#include <drm/drm_atomic.h>
1414#include <drm/drm_atomic_uapi.h>
1515#include <drm/drm_damage_helper.h>
16- #include <drm/drm_file.h>
1716#include <drm/drm_gem_atomic_helper.h>
1817
1918#include "msm_drv.h"
@@ -1388,78 +1387,22 @@ void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
13881387 pm_runtime_put_sync (& dpu_kms -> pdev -> dev );
13891388}
13901389
1391- static int _dpu_plane_init_debugfs (struct drm_plane * plane )
1390+ /* SSPP live inside dpu_plane private data only. Enumerate them here. */
1391+ void dpu_debugfs_sspp_init (struct dpu_kms * dpu_kms , struct dentry * debugfs_root )
13921392{
1393- struct dpu_plane * pdpu = to_dpu_plane (plane );
1394- struct dpu_kms * kms = _dpu_plane_get_kms (plane );
1395- const struct dpu_sspp_cfg * cfg = pdpu -> pipe_hw -> cap ;
1396- const struct dpu_sspp_sub_blks * sblk = cfg -> sblk ;
1397- struct dentry * debugfs_root ;
1398-
1399- /* create overall sub-directory for the pipe */
1400- debugfs_root =
1401- debugfs_create_dir (plane -> name ,
1402- plane -> dev -> primary -> debugfs_root );
1403-
1404- /* don't error check these */
1405- debugfs_create_xul ("features" , 0600 ,
1406- debugfs_root , (unsigned long * )& pdpu -> pipe_hw -> cap -> features );
1407-
1408- /* add register dump support */
1409- dpu_debugfs_create_regset32 ("src_blk" , 0400 ,
1410- debugfs_root ,
1411- sblk -> src_blk .base + cfg -> base ,
1412- sblk -> src_blk .len ,
1413- kms );
1414-
1415- if (cfg -> features & BIT (DPU_SSPP_SCALER_QSEED3 ) ||
1416- cfg -> features & BIT (DPU_SSPP_SCALER_QSEED3LITE ) ||
1417- cfg -> features & BIT (DPU_SSPP_SCALER_QSEED2 ) ||
1418- cfg -> features & BIT (DPU_SSPP_SCALER_QSEED4 ))
1419- dpu_debugfs_create_regset32 ("scaler_blk" , 0400 ,
1420- debugfs_root ,
1421- sblk -> scaler_blk .base + cfg -> base ,
1422- sblk -> scaler_blk .len ,
1423- kms );
1424-
1425- if (cfg -> features & BIT (DPU_SSPP_CSC ) ||
1426- cfg -> features & BIT (DPU_SSPP_CSC_10BIT ))
1427- dpu_debugfs_create_regset32 ("csc_blk" , 0400 ,
1428- debugfs_root ,
1429- sblk -> csc_blk .base + cfg -> base ,
1430- sblk -> csc_blk .len ,
1431- kms );
1432-
1433- debugfs_create_u32 ("xin_id" ,
1434- 0400 ,
1435- debugfs_root ,
1436- (u32 * ) & cfg -> xin_id );
1437- debugfs_create_u32 ("clk_ctrl" ,
1438- 0400 ,
1439- debugfs_root ,
1440- (u32 * ) & cfg -> clk_ctrl );
1441- debugfs_create_x32 ("creq_vblank" ,
1442- 0600 ,
1443- debugfs_root ,
1444- (u32 * ) & sblk -> creq_vblank );
1445- debugfs_create_x32 ("danger_vblank" ,
1446- 0600 ,
1447- debugfs_root ,
1448- (u32 * ) & sblk -> danger_vblank );
1393+ struct drm_plane * plane ;
1394+ struct dentry * entry = debugfs_create_dir ("sspp" , debugfs_root );
14491395
1450- return 0 ;
1451- }
1452- #else
1453- static int _dpu_plane_init_debugfs (struct drm_plane * plane )
1454- {
1455- return 0 ;
1456- }
1457- #endif
1396+ if (IS_ERR (entry ))
1397+ return ;
14581398
1459- static int dpu_plane_late_register (struct drm_plane * plane )
1460- {
1461- return _dpu_plane_init_debugfs (plane );
1399+ drm_for_each_plane (plane , dpu_kms -> dev ) {
1400+ struct dpu_plane * pdpu = to_dpu_plane (plane );
1401+
1402+ _dpu_hw_sspp_init_debugfs (pdpu -> pipe_hw , dpu_kms , entry );
1403+ }
14621404}
1405+ #endif
14631406
14641407static bool dpu_plane_format_mod_supported (struct drm_plane * plane ,
14651408 uint32_t format , uint64_t modifier )
@@ -1486,7 +1429,6 @@ static const struct drm_plane_funcs dpu_plane_funcs = {
14861429 .atomic_duplicate_state = dpu_plane_duplicate_state ,
14871430 .atomic_destroy_state = dpu_plane_destroy_state ,
14881431 .atomic_print_state = dpu_plane_atomic_print_state ,
1489- .late_register = dpu_plane_late_register ,
14901432 .format_mod_supported = dpu_plane_format_mod_supported ,
14911433};
14921434
0 commit comments