mirror of
https://github.com/torvalds/linux.git
synced 2026-07-30 11:11:26 +02:00
drm/i915: Convert pipe_config_buffer_mismatch() to drm_printer
Utilize drm_printer in pipe_config_infoframe_mismatch() to avoid a bit of code duplication. print_hex_dump() doesn't know anything about the printer so it still needs the DRM_UT_KMS check and special handling for the loglevel. But at least we end up with a bit less copy-pasta. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240215164055.30585-6-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
parent
78d319a234
commit
d449f04716
|
|
@ -4876,33 +4876,34 @@ pipe_config_buffer_mismatch(bool fastset, const struct intel_crtc *crtc,
|
|||
const char *name,
|
||||
const u8 *a, const u8 *b, size_t len)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
|
||||
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
|
||||
struct drm_printer p;
|
||||
const char *loglevel;
|
||||
|
||||
if (fastset) {
|
||||
if (!drm_debug_enabled(DRM_UT_KMS))
|
||||
return;
|
||||
|
||||
/* only dump up to the last difference */
|
||||
len = memcmp_diff_len(a, b, len);
|
||||
p = drm_dbg_printer(&i915->drm, DRM_UT_KMS, NULL);
|
||||
loglevel = KERN_DEBUG;
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"[CRTC:%d:%s] fastset requirement not met in %s buffer\n",
|
||||
crtc->base.base.id, crtc->base.name, name);
|
||||
print_hex_dump(KERN_DEBUG, "expected: ", DUMP_PREFIX_NONE,
|
||||
16, 0, a, len, false);
|
||||
print_hex_dump(KERN_DEBUG, "found: ", DUMP_PREFIX_NONE,
|
||||
16, 0, b, len, false);
|
||||
drm_printf(&p, "[CRTC:%d:%s] fastset requirement not met in %s buffer\n",
|
||||
crtc->base.base.id, crtc->base.name, name);
|
||||
} else {
|
||||
/* only dump up to the last difference */
|
||||
len = memcmp_diff_len(a, b, len);
|
||||
p = drm_err_printer(&i915->drm, NULL);
|
||||
loglevel = KERN_ERR;
|
||||
|
||||
drm_err(&dev_priv->drm, "[CRTC:%d:%s] mismatch in %s buffer\n",
|
||||
crtc->base.base.id, crtc->base.name, name);
|
||||
print_hex_dump(KERN_ERR, "expected: ", DUMP_PREFIX_NONE,
|
||||
16, 0, a, len, false);
|
||||
print_hex_dump(KERN_ERR, "found: ", DUMP_PREFIX_NONE,
|
||||
16, 0, b, len, false);
|
||||
drm_printf(&p, "[CRTC:%d:%s] mismatch in %s buffer\n",
|
||||
crtc->base.base.id, crtc->base.name, name);
|
||||
}
|
||||
|
||||
/* only dump up to the last difference */
|
||||
len = memcmp_diff_len(a, b, len);
|
||||
|
||||
print_hex_dump(loglevel, "expected: ", DUMP_PREFIX_NONE,
|
||||
16, 0, a, len, false);
|
||||
print_hex_dump(loglevel, "found: ", DUMP_PREFIX_NONE,
|
||||
16, 0, b, len, false);
|
||||
}
|
||||
|
||||
static void __printf(4, 5)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user