[Intel-gfx] [PATCH v2 03/24] drm/i915/display: Move enable_fbc module parameter under display
Luca Coelho
luca at coelho.fi
Mon Oct 23 10:53:03 UTC 2023
On Mon, 2023-10-16 at 14:16 +0300, Jouni Högander wrote:
> Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
> ---
> drivers/gpu/drm/i915/display/i9xx_wm.c | 2 +-
> drivers/gpu/drm/i915/display/intel_display_params.c | 4 ++++
> drivers/gpu/drm/i915/display/intel_display_params.h | 3 ++-
> drivers/gpu/drm/i915/display/intel_fbc.c | 10 +++++-----
> drivers/gpu/drm/i915/i915_params.c | 4 ----
> drivers/gpu/drm/i915/i915_params.h | 1 -
> 6 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/i9xx_wm.c b/drivers/gpu/drm/i915/display/i9xx_wm.c
> index af0c79a4c9a4..b37c0d02d500 100644
> --- a/drivers/gpu/drm/i915/display/i9xx_wm.c
> +++ b/drivers/gpu/drm/i915/display/i9xx_wm.c
> @@ -2993,7 +2993,7 @@ static void ilk_wm_merge(struct drm_i915_private *dev_priv,
>
> /* ILK: LP2+ must be disabled when FBC WM is disabled but FBC enabled */
> if (DISPLAY_VER(dev_priv) == 5 && HAS_FBC(dev_priv) &&
> - dev_priv->params.enable_fbc && !merged->fbc_wm_enabled) {
> + dev_priv->display.params.enable_fbc && !merged->fbc_wm_enabled) {
> for (level = 2; level < num_levels; level++) {
> struct intel_wm_level *wm = &merged->wm[level];
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_params.c b/drivers/gpu/drm/i915/display/intel_display_params.c
> index 11ee73a98b5b..330613cd64db 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_params.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_params.c
> @@ -27,6 +27,10 @@ static struct intel_display_params intel_display_modparams __read_mostly = {
> * debugfs mode to 0.
> */
>
> +intel_display_param_named_unsafe(enable_fbc, int, 0400,
> + "Enable frame buffer compression for power savings "
> + "(default: -1 (use per-chip default))");
> +
> __maybe_unused
> static void _param_print_bool(struct drm_printer *p, const char *driver_name,
> const char *name, bool val)
> diff --git a/drivers/gpu/drm/i915/display/intel_display_params.h b/drivers/gpu/drm/i915/display/intel_display_params.h
> index a0fb3e1aa2f5..f1bdf2c6e5cd 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_params.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_params.h
> @@ -21,7 +21,8 @@ struct drm_i915_private;
> * mode: debugfs file permissions, one of {0400, 0600, 0}, use 0 to not create
> * debugfs file
> */
> -#define INTEL_DISPLAY_PARAMS_FOR_EACH(param)
> +#define INTEL_DISPLAY_PARAMS_FOR_EACH(param) \
> + param(int, enable_fbc, -1, 0600) \
>
> #define MEMBER(T, member, ...) T member;
> struct intel_display_params {
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> index 4820d21cc942..bde12fe62275 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> @@ -1174,7 +1174,7 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state,
> return 0;
> }
>
> - if (!i915->params.enable_fbc) {
> + if (!i915->display.params.enable_fbc) {
> plane_state->no_fbc_reason = "disabled per module param or by default";
> return 0;
> }
> @@ -1751,8 +1751,8 @@ void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *i915)
> */
> static int intel_sanitize_fbc_option(struct drm_i915_private *i915)
> {
> - if (i915->params.enable_fbc >= 0)
> - return !!i915->params.enable_fbc;
> + if (i915->display.params.enable_fbc >= 0)
> + return !!i915->display.params.enable_fbc;
It was like this before your change, but just as a side-comment, it
would e simpler to just return true here, because !!enable_fbc will
always be true here.
Reviewed-by: Luca Coelho <luciano.coelho at intel.com>
--
Cheers,
Luca.
More information about the Intel-gfx
mailing list