mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
drm/encoder: register per-encoder debugfs dir
Each of connectors and CRTCs used by the DRM device provides debugfs directory, which is used by several standard debugfs files and can further be extended by the driver. Add such generic debugfs directories for encoder. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20231203115315.1306124-2-dmitry.baryshkov@linaro.org
This commit is contained in:
@@ -589,4 +589,29 @@ void drm_debugfs_crtc_remove(struct drm_crtc *crtc)
|
||||
crtc->debugfs_entry = NULL;
|
||||
}
|
||||
|
||||
void drm_debugfs_encoder_add(struct drm_encoder *encoder)
|
||||
{
|
||||
struct drm_minor *minor = encoder->dev->primary;
|
||||
struct dentry *root;
|
||||
char *name;
|
||||
|
||||
name = kasprintf(GFP_KERNEL, "encoder-%d", encoder->index);
|
||||
if (!name)
|
||||
return;
|
||||
|
||||
root = debugfs_create_dir(name, minor->debugfs_root);
|
||||
kfree(name);
|
||||
|
||||
encoder->debugfs_entry = root;
|
||||
|
||||
if (encoder->funcs->debugfs_init)
|
||||
encoder->funcs->debugfs_init(encoder, root);
|
||||
}
|
||||
|
||||
void drm_debugfs_encoder_remove(struct drm_encoder *encoder)
|
||||
{
|
||||
debugfs_remove_recursive(encoder->debugfs_entry);
|
||||
encoder->debugfs_entry = NULL;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_DEBUG_FS */
|
||||
|
||||
Reference in New Issue
Block a user