Commit 1c8f80c2 authored by Jani Nikula's avatar Jani Nikula

drm/i915/display: convert params to struct intel_display

Going forward, struct intel_display shall replace struct
drm_i915_private as the main display device data pointer type. Convert
intel_display_params.[ch] and intel_display_debugfs_params.[ch] to
struct intel_display.

Some stragglers are left behind where needed.
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/3e5cc1744eaf4708b08303e3e7e194035d7941cc.1724342644.git.jani.nikula@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 065ca63e
...@@ -1073,7 +1073,7 @@ void intel_display_debugfs_register(struct drm_i915_private *i915) ...@@ -1073,7 +1073,7 @@ void intel_display_debugfs_register(struct drm_i915_private *i915)
intel_opregion_debugfs_register(display); intel_opregion_debugfs_register(display);
intel_psr_debugfs_register(i915); intel_psr_debugfs_register(i915);
intel_wm_debugfs_register(i915); intel_wm_debugfs_register(i915);
intel_display_debugfs_params(i915); intel_display_debugfs_params(display);
} }
static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data) static int i915_hdcp_sink_capability_show(struct seq_file *m, void *data)
......
...@@ -151,13 +151,13 @@ intel_display_debugfs_create_uint(const char *name, umode_t mode, ...@@ -151,13 +151,13 @@ intel_display_debugfs_create_uint(const char *name, umode_t mode,
} while (0) } while (0)
/* add a subdirectory with files for each intel display param */ /* add a subdirectory with files for each intel display param */
void intel_display_debugfs_params(struct drm_i915_private *i915) void intel_display_debugfs_params(struct intel_display *display)
{ {
struct drm_minor *minor = i915->drm.primary; struct drm_minor *minor = display->drm->primary;
struct dentry *dir; struct dentry *dir;
char dirname[16]; char dirname[16];
snprintf(dirname, sizeof(dirname), "%s_params", i915->drm.driver->name); snprintf(dirname, sizeof(dirname), "%s_params", display->drm->driver->name);
dir = debugfs_lookup(dirname, minor->debugfs_root); dir = debugfs_lookup(dirname, minor->debugfs_root);
if (!dir) if (!dir)
dir = debugfs_create_dir(dirname, minor->debugfs_root); dir = debugfs_create_dir(dirname, minor->debugfs_root);
...@@ -171,7 +171,7 @@ void intel_display_debugfs_params(struct drm_i915_private *i915) ...@@ -171,7 +171,7 @@ void intel_display_debugfs_params(struct drm_i915_private *i915)
*/ */
#define REGISTER(T, x, unused, mode, ...) _intel_display_param_create_file( \ #define REGISTER(T, x, unused, mode, ...) _intel_display_param_create_file( \
dir, #x, mode, &i915->display.params.x); dir, #x, mode, &display->params.x);
INTEL_DISPLAY_PARAMS_FOR_EACH(REGISTER); INTEL_DISPLAY_PARAMS_FOR_EACH(REGISTER);
#undef REGISTER #undef REGISTER
} }
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
#ifndef __INTEL_DISPLAY_DEBUGFS_PARAMS__ #ifndef __INTEL_DISPLAY_DEBUGFS_PARAMS__
#define __INTEL_DISPLAY_DEBUGFS_PARAMS__ #define __INTEL_DISPLAY_DEBUGFS_PARAMS__
struct drm_i915_private; struct intel_display;
void intel_display_debugfs_params(struct drm_i915_private *i915); void intel_display_debugfs_params(struct intel_display *display);
#endif /* __INTEL_DISPLAY_DEBUGFS_PARAMS__ */ #endif /* __INTEL_DISPLAY_DEBUGFS_PARAMS__ */
...@@ -173,14 +173,14 @@ static void _param_print_charp(struct drm_printer *p, const char *driver_name, ...@@ -173,14 +173,14 @@ static void _param_print_charp(struct drm_printer *p, const char *driver_name,
/** /**
* intel_display_params_dump - dump intel display modparams * intel_display_params_dump - dump intel display modparams
* @i915: i915 device * @display: display device
* @p: the &drm_printer * @p: the &drm_printer
* *
* Pretty printer for i915 modparams. * Pretty printer for i915 modparams.
*/ */
void intel_display_params_dump(struct drm_i915_private *i915, struct drm_printer *p) void intel_display_params_dump(struct intel_display *display, struct drm_printer *p)
{ {
#define PRINT(T, x, ...) _param_print(p, i915->drm.driver->name, #x, i915->display.params.x); #define PRINT(T, x, ...) _param_print(p, display->drm->driver->name, #x, display->params.x);
INTEL_DISPLAY_PARAMS_FOR_EACH(PRINT); INTEL_DISPLAY_PARAMS_FOR_EACH(PRINT);
#undef PRINT #undef PRINT
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <linux/types.h> #include <linux/types.h>
struct drm_printer; struct drm_printer;
struct drm_i915_private; struct intel_display;
/* /*
* Invoke param, a function-like macro, for each intel display param, with * Invoke param, a function-like macro, for each intel display param, with
...@@ -56,7 +56,7 @@ struct intel_display_params { ...@@ -56,7 +56,7 @@ struct intel_display_params {
}; };
#undef MEMBER #undef MEMBER
void intel_display_params_dump(struct drm_i915_private *i915, void intel_display_params_dump(struct intel_display *display,
struct drm_printer *p); struct drm_printer *p);
void intel_display_params_copy(struct intel_display_params *dest); void intel_display_params_copy(struct intel_display_params *dest);
void intel_display_params_free(struct intel_display_params *params); void intel_display_params_free(struct intel_display_params *params);
......
...@@ -66,6 +66,7 @@ static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node) ...@@ -66,6 +66,7 @@ static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
static int i915_capabilities(struct seq_file *m, void *data) static int i915_capabilities(struct seq_file *m, void *data)
{ {
struct drm_i915_private *i915 = node_to_i915(m->private); struct drm_i915_private *i915 = node_to_i915(m->private);
struct intel_display *display = &i915->display;
struct drm_printer p = drm_seq_file_printer(m); struct drm_printer p = drm_seq_file_printer(m);
seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(i915)); seq_printf(m, "pch: %d\n", INTEL_PCH_TYPE(i915));
...@@ -77,7 +78,7 @@ static int i915_capabilities(struct seq_file *m, void *data) ...@@ -77,7 +78,7 @@ static int i915_capabilities(struct seq_file *m, void *data)
kernel_param_lock(THIS_MODULE); kernel_param_lock(THIS_MODULE);
i915_params_dump(&i915->params, &p); i915_params_dump(&i915->params, &p);
intel_display_params_dump(i915, &p); intel_display_params_dump(display, &p);
kernel_param_unlock(THIS_MODULE); kernel_param_unlock(THIS_MODULE);
return 0; return 0;
......
...@@ -660,9 +660,10 @@ static void err_print_params(struct drm_i915_error_state_buf *m, ...@@ -660,9 +660,10 @@ static void err_print_params(struct drm_i915_error_state_buf *m,
const struct i915_params *params) const struct i915_params *params)
{ {
struct drm_printer p = i915_error_printer(m); struct drm_printer p = i915_error_printer(m);
struct intel_display *display = &m->i915->display;
i915_params_dump(params, &p); i915_params_dump(params, &p);
intel_display_params_dump(m->i915, &p); intel_display_params_dump(display, &p);
} }
static void err_print_pciid(struct drm_i915_error_state_buf *m, static void err_print_pciid(struct drm_i915_error_state_buf *m,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment