From: "Jouni Högander" <jouni.hogander@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Luca Coelho <luciano.coelho@intel.com>
Subject: [Intel-gfx] [PATCH v4 02/23] drm/i915/display: Dump also display parameters
Date: Tue, 24 Oct 2023 15:40:48 +0300 [thread overview]
Message-ID: <20231024124109.384973-3-jouni.hogander@intel.com> (raw)
In-Reply-To: <20231024124109.384973-1-jouni.hogander@intel.com>
GPU error dump contained all module parameters. If we are moving
display parameters to intel_display_params.[ch] they are not dumped
into GPU error dump. This patch is adding moved display parameters
back to GPU error dump. Display parameters are also included in
i915_capabilities
v2: Add parameters to i915_capabilities as well
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
---
.../drm/i915/display/intel_display_params.c | 57 +++++++++++++++++++
.../drm/i915/display/intel_display_params.h | 3 +
drivers/gpu/drm/i915/i915_debugfs.c | 3 +
drivers/gpu/drm/i915/i915_gpu_error.c | 3 +
drivers/gpu/drm/i915/i915_gpu_error.h | 2 +
5 files changed, 68 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_display_params.c b/drivers/gpu/drm/i915/display/intel_display_params.c
index 91953ae27144..11ee73a98b5b 100644
--- a/drivers/gpu/drm/i915/display/intel_display_params.c
+++ b/drivers/gpu/drm/i915/display/intel_display_params.c
@@ -27,6 +27,63 @@ static struct intel_display_params intel_display_modparams __read_mostly = {
* debugfs mode to 0.
*/
+__maybe_unused
+static void _param_print_bool(struct drm_printer *p, const char *driver_name,
+ const char *name, bool val)
+{
+ drm_printf(p, "%s.%s=%s\n", driver_name, name, str_yes_no(val));
+}
+
+__maybe_unused
+static void _param_print_int(struct drm_printer *p, const char *driver_name,
+ const char *name, int val)
+{
+ drm_printf(p, "%s.%s=%d\n", driver_name, name, val);
+}
+
+__maybe_unused
+static void _param_print_uint(struct drm_printer *p, const char *driver_name,
+ const char *name, unsigned int val)
+{
+ drm_printf(p, "%s.%s=%u\n", driver_name, name, val);
+}
+
+__maybe_unused
+static void _param_print_ulong(struct drm_printer *p, const char *driver_name,
+ const char *name, unsigned long val)
+{
+ drm_printf(p, "%s.%s=%lu\n", driver_name, name, val);
+}
+
+__maybe_unused
+static void _param_print_charp(struct drm_printer *p, const char *driver_name,
+ const char *name, const char *val)
+{
+ drm_printf(p, "%s.%s=%s\n", driver_name, name, val);
+}
+
+#define _param_print(p, driver_name, name, val) \
+ _Generic(val, \
+ bool : _param_print_bool, \
+ int : _param_print_int, \
+ unsigned int : _param_print_uint, \
+ unsigned long : _param_print_ulong, \
+ char * : _param_print_charp)(p, driver_name, name, val)
+
+/**
+ * intel_display_params_dump - dump intel display modparams
+ * @i915: i915 device
+ * @p: the &drm_printer
+ *
+ * Pretty printer for i915 modparams.
+ */
+void intel_display_params_dump(struct drm_i915_private *i915, struct drm_printer *p)
+{
+#define PRINT(T, x, ...) _param_print(p, i915->drm.driver->name, #x, i915->display.params.x);
+ INTEL_DISPLAY_PARAMS_FOR_EACH(PRINT);
+#undef PRINT
+}
+
__maybe_unused static void _param_dup_charp(char **valp)
{
*valp = kstrdup(*valp ? *valp : "", GFP_ATOMIC);
diff --git a/drivers/gpu/drm/i915/display/intel_display_params.h b/drivers/gpu/drm/i915/display/intel_display_params.h
index 9f4f45d410a3..eac66042da4d 100644
--- a/drivers/gpu/drm/i915/display/intel_display_params.h
+++ b/drivers/gpu/drm/i915/display/intel_display_params.h
@@ -7,6 +7,7 @@
#define _INTEL_DISPLAY_PARAMS_H_
struct drm_printer;
+struct drm_i915_private;
/*
* Invoke param, a function-like macro, for each intel display param, with
@@ -28,6 +29,8 @@ struct intel_display_params {
};
#undef MEMBER
+void intel_display_params_dump(struct drm_i915_private *i915,
+ struct drm_printer *p);
void intel_display_params_copy(struct intel_display_params *dest);
void intel_display_params_free(struct intel_display_params *params);
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index e9b79c2c37d8..af0077f6a6d0 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -32,6 +32,8 @@
#include <drm/drm_debugfs.h>
+#include "display/intel_display_params.h"
+
#include "gem/i915_gem_context.h"
#include "gt/intel_gt.h"
#include "gt/intel_gt_buffer_pool.h"
@@ -74,6 +76,7 @@ static int i915_capabilities(struct seq_file *m, void *data)
kernel_param_lock(THIS_MODULE);
i915_params_dump(&i915->params, &p);
+ intel_display_params_dump(i915, &p);
kernel_param_unlock(THIS_MODULE);
return 0;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index b4e31e59c799..8275f9b6a47d 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -660,6 +660,7 @@ static void err_print_params(struct drm_i915_error_state_buf *m,
struct drm_printer p = i915_error_printer(m);
i915_params_dump(params, &p);
+ intel_display_params_dump(m->i915, &p);
}
static void err_print_pciid(struct drm_i915_error_state_buf *m,
@@ -1027,6 +1028,7 @@ static void i915_vma_coredump_free(struct i915_vma_coredump *vma)
static void cleanup_params(struct i915_gpu_coredump *error)
{
i915_params_free(&error->params);
+ intel_display_params_free(&error->display_params);
}
static void cleanup_uc(struct intel_uc_coredump *uc)
@@ -1988,6 +1990,7 @@ static void capture_gen(struct i915_gpu_coredump *error)
error->suspend_count = i915->suspend_count;
i915_params_copy(&error->params, &i915->params);
+ intel_display_params_copy(&error->display_params);
memcpy(&error->device_info,
INTEL_INFO(i915),
sizeof(error->device_info));
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.h b/drivers/gpu/drm/i915/i915_gpu_error.h
index 9f5971f5e980..4ce227f7e1e1 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.h
+++ b/drivers/gpu/drm/i915/i915_gpu_error.h
@@ -15,6 +15,7 @@
#include <drm/drm_mm.h>
#include "display/intel_display_device.h"
+#include "display/intel_display_params.h"
#include "gt/intel_engine.h"
#include "gt/intel_gt_types.h"
#include "gt/uc/intel_uc_fw.h"
@@ -214,6 +215,7 @@ struct i915_gpu_coredump {
struct intel_display_runtime_info display_runtime_info;
struct intel_driver_caps driver_caps;
struct i915_params params;
+ struct intel_display_params display_params;
struct intel_overlay_error_state *overlay;
--
2.34.1
next prev parent reply other threads:[~2023-10-24 12:41 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 12:40 [Intel-gfx] [PATCH v4 00/23] Framework for display parameters Jouni Högander
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 01/23] drm/i915/display: Add framework to add parameters specific to display Jouni Högander
2023-10-24 12:40 ` Jouni Högander [this message]
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 03/23] drm/i915/display: Move enable_fbc module parameter under display Jouni Högander
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 04/23] drm/i915/display: Move psr related module parameters " Jouni Högander
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 05/23] drm/i915/display: Move vbt_firmware module parameter " Jouni Högander
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 06/23] drm/i915/display: Move lvds_channel_mode " Jouni Högander
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 07/23] drm/i915/display: Move panel_use_ssc " Jouni Högander
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 08/23] drm/i915/display: Move vbt_sdvo_panel_type " Jouni Högander
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 09/23] drm/i915/display: Move enable_dc " Jouni Högander
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 10/23] drm/i915/display: Move enable_dpt " Jouni Högander
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 11/23] drm/i915/display: Move enable_sagv " Jouni Högander
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 12/23] drm/i915/display: Move disable_power_well " Jouni Högander
2023-10-24 12:40 ` [Intel-gfx] [PATCH v4 13/23] drm/i915/display: Move enable_ips " Jouni Högander
2023-10-24 12:41 ` [Intel-gfx] [PATCH v4 14/23] drm/i915/display: Move invert_brightness " Jouni Högander
2023-10-24 12:41 ` [Intel-gfx] [PATCH v4 15/23] drm/i915/display: Move edp_vswing " Jouni Högander
2023-10-24 12:41 ` [Intel-gfx] [PATCH v4 16/23] drm/i915/display: Move enable_dpcd_backlight " Jouni Högander
2023-10-24 12:41 ` [Intel-gfx] [PATCH v4 17/23] drm/i915/display: Move load_detect_test " Jouni Högander
2023-10-24 12:41 ` [Intel-gfx] [PATCH v4 18/23] drm/i915/display: Move force_reset_modeset_test " Jouni Högander
2023-10-24 12:41 ` [Intel-gfx] [PATCH v4 19/23] drm/i915/display: Move disable_display " Jouni Högander
2023-10-24 12:41 ` [Intel-gfx] [PATCH v4 20/23] drm/i915/display: Use device parameters instead of module in I915_STATE_WARN Jouni Högander
2023-10-24 12:41 ` [Intel-gfx] [PATCH v4 21/23] drm/i915/display: Move verbose_state_checks under display Jouni Högander
2023-10-24 12:55 ` Coelho, Luciano
2023-10-24 12:41 ` [Intel-gfx] [PATCH v4 22/23] drm/i915/display: Move nuclear_pageflip " Jouni Högander
2023-10-24 12:41 ` [Intel-gfx] [PATCH v4 23/23] drm/i915/display: Move enable_dp_mst " Jouni Högander
2023-10-24 23:19 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Framework for display parameters (rev5) Patchwork
2023-10-24 23:19 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-10-24 23:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-10-25 15:00 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-10-26 9:23 ` [Intel-gfx] [PATCH v4 00/23] Framework for display parameters Hogander, Jouni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231024124109.384973-3-jouni.hogander@intel.com \
--to=jouni.hogander@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=luciano.coelho@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox