Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/display/debug: Expose crtc current bpc via debugfs

This new debugfs will expose the currently using bpc by crtc.
It is very useful for verifying whether we enter the correct
output color depth from IGT.

This patch will also add the connector's max supported bpc to
"i915_display_info" debugfs.

Example:
cat /sys/kernel/debug/dri/0/crtc-0/i915_current_bpc
Current: 8

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220519095149.3560034-3-bhanuprakash.modem@intel.com

authored by

Bhanuprakash Modem and committed by
Jani Nikula
fa373eb2 67d935b4

+28
+28
drivers/gpu/drm/i915/display/intel_display_debugfs.c
··· 590 590 seq_puts(m, "\tHDCP version: "); 591 591 intel_hdcp_info(m, intel_connector); 592 592 593 + seq_printf(m, "\tmax bpc: %u\n", connector->display_info.bpc); 594 + 593 595 intel_panel_info(m, intel_connector); 594 596 595 597 seq_printf(m, "\tmodes:\n"); ··· 2204 2202 .write = i915_dsc_bpp_write 2205 2203 }; 2206 2204 2205 + /* 2206 + * Returns the Current CRTC's bpc. 2207 + * Example usage: cat /sys/kernel/debug/dri/0/crtc-0/i915_current_bpc 2208 + */ 2209 + static int i915_current_bpc_show(struct seq_file *m, void *data) 2210 + { 2211 + struct intel_crtc *crtc = to_intel_crtc(m->private); 2212 + struct intel_crtc_state *crtc_state; 2213 + int ret; 2214 + 2215 + ret = drm_modeset_lock_single_interruptible(&crtc->base.mutex); 2216 + if (ret) 2217 + return ret; 2218 + 2219 + crtc_state = to_intel_crtc_state(crtc->base.state); 2220 + seq_printf(m, "Current: %u\n", crtc_state->pipe_bpp / 3); 2221 + 2222 + drm_modeset_unlock(&crtc->base.mutex); 2223 + 2224 + return ret; 2225 + } 2226 + DEFINE_SHOW_ATTRIBUTE(i915_current_bpc); 2227 + 2207 2228 /** 2208 2229 * intel_connector_debugfs_add - add i915 specific connector debugfs files 2209 2230 * @connector: pointer to a registered drm_connector ··· 2297 2272 2298 2273 crtc_updates_add(crtc); 2299 2274 intel_fbc_crtc_debugfs_add(to_intel_crtc(crtc)); 2275 + 2276 + debugfs_create_file("i915_current_bpc", 0444, crtc->debugfs_entry, crtc, 2277 + &i915_current_bpc_fops); 2300 2278 }