drm/i915: Dump DSC state to dmesg and debugfs/i915_display_info
authorImre Deak <imre.deak@intel.com>
Mon, 5 Aug 2024 15:07:55 +0000 (18:07 +0300)
committerImre Deak <imre.deak@intel.com>
Tue, 6 Aug 2024 09:33:26 +0000 (12:33 +0300)
Dump the DSC state to dmesg during HW readout and state computation as
well as the i915_display_info debugfs entry.

v2: Rebase on the s/DRM_X16/FXP_Q4 change.

Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240805150802.3568970-7-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_crtc_state_dump.c
drivers/gpu/drm/i915/display/intel_display_debugfs.c
drivers/gpu/drm/i915/display/intel_vdsc.c
drivers/gpu/drm/i915/display/intel_vdsc.h

index 6df526e189b5b896a0124860c659e29c53c720a3..705ec5ad385c83b7f710b6946a69a4e10de07a9d 100644 (file)
@@ -10,6 +10,7 @@
 #include "intel_crtc_state_dump.h"
 #include "intel_display_types.h"
 #include "intel_hdmi.h"
+#include "intel_vdsc.h"
 #include "intel_vrr.h"
 
 static void intel_dump_crtc_timings(struct drm_printer *p,
@@ -369,6 +370,8 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config,
        else if (IS_VALLEYVIEW(i915))
                vlv_dump_csc(&p, "wgc csc", &pipe_config->csc);
 
+       intel_vdsc_state_dump(&p, 0, pipe_config);
+
 dump_planes:
        if (!state)
                return;
index 5cf9b4af9adfbe7f45b9db5a91fed07757f9c51e..9c5a3f5beda258c2af61a2870679228800fb7079 100644 (file)
@@ -36,6 +36,7 @@
 #include "intel_pps.h"
 #include "intel_psr.h"
 #include "intel_psr_regs.h"
+#include "intel_vdsc.h"
 #include "intel_wm.h"
 
 static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
@@ -551,6 +552,7 @@ static void crtc_updates_add(struct intel_crtc *crtc)
 static void intel_crtc_info(struct seq_file *m, struct intel_crtc *crtc)
 {
        struct drm_i915_private *dev_priv = node_to_i915(m->private);
+       struct drm_printer p = drm_seq_file_printer(m);
        const struct intel_crtc_state *crtc_state =
                to_intel_crtc_state(crtc->base.state);
        struct intel_encoder *encoder;
@@ -581,6 +583,8 @@ static void intel_crtc_info(struct seq_file *m, struct intel_crtc *crtc)
                           crtc_state->joiner_pipes,
                           intel_crtc_is_joiner_secondary(crtc_state) ? "slave" : "master");
 
+       intel_vdsc_state_dump(&p, 1, crtc_state);
+
        for_each_intel_encoder_mask(&dev_priv->drm, encoder,
                                    crtc_state->uapi.encoder_mask)
                intel_encoder_info(m, crtc, encoder);
index ff717dc1a2ce53dc370f12790828108cca73fee1..404ed05371cb883be08e7e75e8c6810d16864179 100644 (file)
@@ -990,3 +990,23 @@ void intel_dsc_get_config(struct intel_crtc_state *crtc_state)
 out:
        intel_display_power_put(dev_priv, power_domain, wakeref);
 }
+
+static void intel_vdsc_dump_state(struct drm_printer *p, int indent,
+                                 const struct intel_crtc_state *crtc_state)
+{
+       drm_printf_indent(p, indent,
+                         "dsc-dss: compressed-bpp:" FXP_Q4_FMT ", slice-count: %d, split: %s\n",
+                         FXP_Q4_ARGS(crtc_state->dsc.compressed_bpp_x16),
+                         crtc_state->dsc.slice_count,
+                         str_yes_no(crtc_state->dsc.dsc_split));
+}
+
+void intel_vdsc_state_dump(struct drm_printer *p, int indent,
+                          const struct intel_crtc_state *crtc_state)
+{
+       if (!crtc_state->dsc.compression_enable)
+               return;
+
+       intel_vdsc_dump_state(p, indent, crtc_state);
+       drm_dsc_dump_config(p, indent, &crtc_state->dsc.config);
+}
index 2cc41ff0890942586d143ddc7db27fbf2beb5a53..290b2e9b3482e7ae9a7cbf4f4d27dc131a524eb4 100644 (file)
@@ -8,6 +8,8 @@
 
 #include <linux/types.h>
 
+struct drm_printer;
+
 enum transcoder;
 struct intel_crtc;
 struct intel_crtc_state;
@@ -27,5 +29,7 @@ void intel_dsc_dsi_pps_write(struct intel_encoder *encoder,
                             const struct intel_crtc_state *crtc_state);
 void intel_dsc_dp_pps_write(struct intel_encoder *encoder,
                            const struct intel_crtc_state *crtc_state);
+void intel_vdsc_state_dump(struct drm_printer *p, int indent,
+                          const struct intel_crtc_state *crtc_state);
 
 #endif /* __INTEL_VDSC_H__ */