From patchwork Thu Jun 6 14:07:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13688550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61A48C25B75 for ; Thu, 6 Jun 2024 14:07:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AC17210E0E5; Thu, 6 Jun 2024 14:07:15 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="iW/ylP7E"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id D738C10E0E5 for ; Thu, 6 Jun 2024 14:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717682832; x=1749218832; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WX+kuQH3EmV1ETjVehwP+C/Cl7XT7HPrK9Ew+3KS0sc=; b=iW/ylP7EY0UqRA3btE5LhQyXSLKjvaqj0uhFIxyrrWmCK7nXuCezDFqf Mi6d4E8ozRLNpZFkInKMo9sKjhcwjsVMqbBFjr/hsVC/i8ZshXIO8dzR7 /+DwIRt0KOL7TSwKhO0yQNThvKuGUy7b7pWlMzVpkZQ0r/K006JTRsKP9 c4gwzBDaBe72SKtrEs3xkbmn8zjlBveVQzIsWtIqx+uvxtk+QmqHh9owB m1Jx+DbkX36SyLCCTZ2h4Jkn43iv7/08eC6IloRhyRQs8oP7up3zcbo4H eKYt1+b2aLW+tenltrz9hJqayjogiwiJ4dppcmda56awelHjpaLPgaohg Q==; X-CSE-ConnectionGUID: btMPMaaPSvSiDOPjXVTd+g== X-CSE-MsgGUID: 6T0JseQSSJ2FJPV6tPAmgg== X-IronPort-AV: E=McAfee;i="6600,9927,11095"; a="24986506" X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="24986506" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 07:07:11 -0700 X-CSE-ConnectionGUID: cjAa3I64SkySJpziyVTUAQ== X-CSE-MsgGUID: 21DeVi/zQNylR/VV+R+6qw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="42543557" Received: from unknown (HELO localhost) ([10.237.66.160]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 07:07:10 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com Subject: [PATCH 1/2] drm/i915/dmc: convert intel_dmc_print_error_state() to drm_printer Date: Thu, 6 Jun 2024 17:07:04 +0300 Message-Id: <20240606140705.3072987-1-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Use the regular drm printer, so we can drop the i915_error_printf() usage. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- drivers/gpu/drm/i915/display/intel_dmc.c | 15 +++++++-------- drivers/gpu/drm/i915/display/intel_dmc.h | 6 +++--- drivers/gpu/drm/i915/i915_gpu_error.c | 3 ++- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c index 852c11aa3205..73977b173898 100644 --- a/drivers/gpu/drm/i915/display/intel_dmc.c +++ b/drivers/gpu/drm/i915/display/intel_dmc.c @@ -26,7 +26,6 @@ #include #include "i915_drv.h" -#include "i915_gpu_error.h" #include "i915_reg.h" #include "intel_de.h" #include "intel_dmc.h" @@ -1185,7 +1184,7 @@ void intel_dmc_fini(struct drm_i915_private *i915) } } -void intel_dmc_print_error_state(struct drm_i915_error_state_buf *m, +void intel_dmc_print_error_state(struct drm_printer *p, struct drm_i915_private *i915) { struct intel_dmc *dmc = i915_to_dmc(i915); @@ -1193,13 +1192,13 @@ void intel_dmc_print_error_state(struct drm_i915_error_state_buf *m, if (!HAS_DMC(i915)) return; - i915_error_printf(m, "DMC initialized: %s\n", str_yes_no(dmc)); - i915_error_printf(m, "DMC loaded: %s\n", - str_yes_no(intel_dmc_has_payload(i915))); + drm_printf(p, "DMC initialized: %s\n", str_yes_no(dmc)); + drm_printf(p, "DMC loaded: %s\n", + str_yes_no(intel_dmc_has_payload(i915))); if (dmc) - i915_error_printf(m, "DMC fw version: %d.%d\n", - DMC_VERSION_MAJOR(dmc->version), - DMC_VERSION_MINOR(dmc->version)); + drm_printf(p, "DMC fw version: %d.%d\n", + DMC_VERSION_MAJOR(dmc->version), + DMC_VERSION_MINOR(dmc->version)); } static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused) diff --git a/drivers/gpu/drm/i915/display/intel_dmc.h b/drivers/gpu/drm/i915/display/intel_dmc.h index fd607afff2ef..54cff6002e31 100644 --- a/drivers/gpu/drm/i915/display/intel_dmc.h +++ b/drivers/gpu/drm/i915/display/intel_dmc.h @@ -8,9 +8,9 @@ #include -struct drm_i915_error_state_buf; -struct drm_i915_private; enum pipe; +struct drm_i915_private; +struct drm_printer; void intel_dmc_init(struct drm_i915_private *i915); void intel_dmc_load_program(struct drm_i915_private *i915); @@ -22,7 +22,7 @@ void intel_dmc_suspend(struct drm_i915_private *i915); void intel_dmc_resume(struct drm_i915_private *i915); bool intel_dmc_has_payload(struct drm_i915_private *i915); void intel_dmc_debugfs_register(struct drm_i915_private *i915); -void intel_dmc_print_error_state(struct drm_i915_error_state_buf *m, +void intel_dmc_print_error_state(struct drm_printer *p, struct drm_i915_private *i915); void assert_dmc_loaded(struct drm_i915_private *i915); diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 625b3c024540..3fee7ad0ec51 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -836,6 +836,7 @@ static void err_print_gt_engines(struct drm_i915_error_state_buf *m, static void __err_print_to_sgl(struct drm_i915_error_state_buf *m, struct i915_gpu_coredump *error) { + struct drm_printer p = i915_error_printer(m); const struct intel_engine_coredump *ee; struct timespec64 ts; @@ -873,7 +874,7 @@ static void __err_print_to_sgl(struct drm_i915_error_state_buf *m, err_printf(m, "IOMMU enabled?: %d\n", error->iommu); - intel_dmc_print_error_state(m, m->i915); + intel_dmc_print_error_state(&p, m->i915); err_printf(m, "RPM wakelock: %s\n", str_yes_no(error->wakelock)); err_printf(m, "PM suspended: %s\n", str_yes_no(error->suspended)); From patchwork Thu Jun 6 14:07:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13688551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6227C27C54 for ; Thu, 6 Jun 2024 14:07:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A14EB10E114; Thu, 6 Jun 2024 14:07:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="E/wC1yIk"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id B5E3610E0F2 for ; Thu, 6 Jun 2024 14:07:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717682836; x=1749218836; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7GhHi5Io+OIAGgKVgOzeCLVlAMCaGBz9Im8qqQiiDi0=; b=E/wC1yIk9xFi3nUTpYxmqHdqDN96hPc8JUMLEAa/DP9ank2ASNw4YXG9 bMOTIaGgzjS33jS+jKDe8ICu0D/RtIusJV+VMpLB0QV0MdOhQWiF+1xKP 7IxqwrC+YmcV5oF+BoQLVsWbt0mG1Efq8UlhWFjlnXNgsllFpRWBudmC2 3CUZYXUFlJKHXKf9Ob2kVAdnciLPRdjQGvtyzYo4kYQmHlk6Zu2N4w+nL n4kNTT9bW6wVKlqqGIg35/FzvlpKgc2FhjH6FKReUVJ5DVZex41iS0jIM fQNju1+IMljRDmz7/AZMO/dA7NPtEiy2y9mmB4qZbk7Wkinn1Nul687/Q Q==; X-CSE-ConnectionGUID: pYZjsi2UTPG9GAzSGiizcw== X-CSE-MsgGUID: sexJqVxERVGjdeHzR0gWZg== X-IronPort-AV: E=McAfee;i="6600,9927,11095"; a="14471291" X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="14471291" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 07:07:15 -0700 X-CSE-ConnectionGUID: 2TrsnmPQTjqp2O9gvB3j6g== X-CSE-MsgGUID: 2uJll4OnStemLa4MCEy/UQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="37984374" Received: from unknown (HELO localhost) ([10.237.66.160]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 07:07:14 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com Subject: [PATCH 2/2] drm/i915/overlay: convert intel_overlay_print_error_state() to drm_printer Date: Thu, 6 Jun 2024 17:07:05 +0300 Message-Id: <20240606140705.3072987-2-jani.nikula@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240606140705.3072987-1-jani.nikula@intel.com> References: <20240606140705.3072987-1-jani.nikula@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Use the regular drm printer, so we can drop the i915_error_printf() usage. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi --- drivers/gpu/drm/i915/display/intel_overlay.c | 11 +++++------ drivers/gpu/drm/i915/display/intel_overlay.h | 6 +++--- drivers/gpu/drm/i915/i915_gpu_error.c | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c index 1c2099ed5514..b97087f8e311 100644 --- a/drivers/gpu/drm/i915/display/intel_overlay.c +++ b/drivers/gpu/drm/i915/display/intel_overlay.c @@ -1485,15 +1485,14 @@ intel_overlay_capture_error_state(struct drm_i915_private *dev_priv) } void -intel_overlay_print_error_state(struct drm_i915_error_state_buf *m, +intel_overlay_print_error_state(struct drm_printer *p, struct intel_overlay_error_state *error) { - i915_error_printf(m, "Overlay, status: 0x%08x, interrupt: 0x%08x\n", - error->dovsta, error->isr); - i915_error_printf(m, " Register file at 0x%08lx:\n", - error->base); + drm_printf(p, "Overlay, status: 0x%08x, interrupt: 0x%08x\n", + error->dovsta, error->isr); + drm_printf(p, " Register file at 0x%08lx:\n", error->base); -#define P(x) i915_error_printf(m, " " #x ": 0x%08x\n", error->regs.x) +#define P(x) drm_printf(p, " " #x ": 0x%08x\n", error->regs.x) P(OBUF_0Y); P(OBUF_1Y); P(OBUF_0U); diff --git a/drivers/gpu/drm/i915/display/intel_overlay.h b/drivers/gpu/drm/i915/display/intel_overlay.h index c3f68fce6f08..f28a09c062d0 100644 --- a/drivers/gpu/drm/i915/display/intel_overlay.h +++ b/drivers/gpu/drm/i915/display/intel_overlay.h @@ -8,8 +8,8 @@ struct drm_device; struct drm_file; -struct drm_i915_error_state_buf; struct drm_i915_private; +struct drm_printer; struct intel_overlay; struct intel_overlay_error_state; @@ -24,7 +24,7 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data, void intel_overlay_reset(struct drm_i915_private *dev_priv); struct intel_overlay_error_state * intel_overlay_capture_error_state(struct drm_i915_private *dev_priv); -void intel_overlay_print_error_state(struct drm_i915_error_state_buf *e, +void intel_overlay_print_error_state(struct drm_printer *p, struct intel_overlay_error_state *error); #else static inline void intel_overlay_setup(struct drm_i915_private *dev_priv) @@ -55,7 +55,7 @@ intel_overlay_capture_error_state(struct drm_i915_private *dev_priv) { return NULL; } -static inline void intel_overlay_print_error_state(struct drm_i915_error_state_buf *e, +static inline void intel_overlay_print_error_state(struct drm_printer *p, struct intel_overlay_error_state *error) { } diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 3fee7ad0ec51..96c6cafd5b9e 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -905,7 +905,7 @@ static void __err_print_to_sgl(struct drm_i915_error_state_buf *m, } if (error->overlay) - intel_overlay_print_error_state(m, error->overlay); + intel_overlay_print_error_state(&p, error->overlay); err_print_capabilities(m, error); err_print_params(m, &error->params);