]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/debug: don't register files for unsupported HDMI InfoFrames
authorDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Wed, 7 Jan 2026 18:15:07 +0000 (20:15 +0200)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Mon, 19 Jan 2026 11:11:47 +0000 (13:11 +0200)
Having debugfs files for the InfoFrames that are not supported by the
driver is confusing, stop registering those in the debugfs.

Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20260107-limit-infoframes-2-v4-10-213d0d3bd490@oss.qualcomm.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drivers/gpu/drm/drm_debugfs.c

index 365cf337529fa2a88b69516d57360d212419c126..ae1c6126c2c592cc1db3b06f99e13b23076e987a 100644 (file)
@@ -672,6 +672,10 @@ static int create_hdmi_audio_infoframe_file(struct drm_connector *connector,
 {
        struct dentry *file;
 
+       if (!connector->hdmi.funcs ||
+           !connector->hdmi.funcs->audio.write_infoframe)
+               return 0;
+
        file = debugfs_create_file("audio", 0400, parent, connector, &audio_infoframe_fops);
        if (IS_ERR(file))
                return PTR_ERR(file);
@@ -726,6 +730,9 @@ static int create_hdmi_## _f ## _infoframe_file(struct drm_connector *connector,
 { \
        struct dentry *file; \
        \
+       if (!connector->hdmi.funcs || \
+           !connector->hdmi.funcs->_f.write_infoframe) \
+               return 0; \
        file = debugfs_create_file(#_f, 0400, parent, connector, &_f ## _infoframe_fops); \
        if (IS_ERR(file)) \
                return PTR_ERR(file); \