Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: iczero <iczero@hellomouse.net>
To: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 3/3] drm/i915: Factor out a function disabling fused-off display
Date: Mon, 6 Feb 2023 21:45:39 -0500	[thread overview]
Message-ID: <c9247d6d-db79-1e6c-c9d7-cdc4f2592140@hellomouse.net> (raw)
In-Reply-To: <20230206163512.2841513-3-imre.deak@intel.com>

On 2/6/23 11:35, Imre Deak wrote:
> Factor out a function used both on older and new platforms to disable
> the display functionality if the display is fused-off.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>   drivers/gpu/drm/i915/intel_device_info.c | 34 +++++++++++++-----------
>   1 file changed, 18 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index 044ac552c9280..9d6d1fad9f1d9 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -369,6 +369,21 @@ void intel_device_info_runtime_init_early(struct drm_i915_private *i915)
>   	intel_device_info_subplatform_init(i915);
>   }
>   
> +static void disable_fused_off_display(struct drm_i915_private *i915)
> +{
> +	struct intel_runtime_info *runtime = RUNTIME_INFO(i915);
> +
> +	drm_info(&i915->drm, "Display fused off, disabling\n");
> +
> +	runtime->pipe_mask = 0;
> +	runtime->cpu_transcoder_mask = 0;
> +	runtime->fbc_mask = 0;
> +	runtime->has_hdcp = 0;
> +	runtime->fbc_mask = 0;
> +	runtime->has_dmc = 0;
> +	runtime->has_dsc = 0;
> +}
> +
>   /**
>    * intel_device_info_runtime_init - initialize runtime info
>    * @dev_priv: the i915 device
> @@ -454,11 +469,7 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
>   		    sfuse_strap & SFUSE_STRAP_DISPLAY_DISABLED ||
>   		    (HAS_PCH_CPT(dev_priv) &&
>   		     !(sfuse_strap & SFUSE_STRAP_FUSE_LOCK))) {
> -			drm_info(&dev_priv->drm,
> -				 "Display fused off, disabling\n");
> -			runtime->pipe_mask = 0;
> -			runtime->cpu_transcoder_mask = 0;
> -			runtime->fbc_mask = 0;
> +			disable_fused_off_display(dev_priv);
>   		} else if (fuse_strap & IVB_PIPE_C_DISABLE) {
>   			drm_info(&dev_priv->drm, "PipeC fused off\n");
>   			runtime->pipe_mask &= ~BIT(PIPE_C);
> @@ -502,17 +513,8 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
>   	}
>   
>   	if ((IS_DGFX(dev_priv) || DISPLAY_VER(dev_priv) >= 14) &&
> -	    !(intel_de_read(dev_priv, GU_CNTL_PROTECTED) & DEPRESENT)) {
> -		drm_info(&dev_priv->drm, "Display fused off, disabling\n");
> -
> -		runtime->pipe_mask = 0;
> -		runtime->cpu_transcoder_mask = 0;
> -		runtime->fbc_mask = 0;
> -		runtime->has_hdcp = 0;
> -		runtime->fbc_mask = 0;
> -		runtime->has_dmc = 0;
> -		runtime->has_dsc = 0;
> -	}
> +	    !(intel_de_read(dev_priv, GU_CNTL_PROTECTED) & DEPRESENT))
> +		disable_fused_off_display(dev_priv);
>   
>   	if (GRAPHICS_VER(dev_priv) == 6 && i915_vtd_active(dev_priv)) {
>   		drm_info(&dev_priv->drm,
>
Tested on Intel Arc A370M. Thank you for the fix.

Tested-by: iczero <iczero@hellomouse.net>


  reply	other threads:[~2023-02-07  2:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 16:35 [Intel-gfx] [PATCH 1/3] drm/i915: Move display power initialization during driver probing later Imre Deak
2023-02-06 16:35 ` [Intel-gfx] [PATCH 2/3] drm/i915/dgfx, mtl+: Disable display functionality if it's globally fused-off Imre Deak
2023-02-07 10:17   ` Jani Nikula
2023-02-07 11:37     ` Imre Deak
2023-02-07 12:10       ` Jani Nikula
2023-02-06 16:35 ` [Intel-gfx] [PATCH 3/3] drm/i915: Factor out a function disabling fused-off display Imre Deak
2023-02-07  2:45   ` iczero [this message]
2023-02-07 10:21   ` Jani Nikula
2023-02-07 11:46     ` Imre Deak
2023-02-06 19:38 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Move display power initialization during driver probing later Patchwork
2023-02-07  4:23 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=c9247d6d-db79-1e6c-c9d7-cdc4f2592140@hellomouse.net \
    --to=iczero@hellomouse.net \
    --cc=intel-gfx@lists.freedesktop.org \
    /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