All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "José Roberto de Souza" <jose.souza@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 02/20] drm/i915: Set PCH as NOP when display is disabled
Date: Thu, 09 Aug 2018 11:16:25 +0300	[thread overview]
Message-ID: <87k1p09cpy.fsf@intel.com> (raw)
In-Reply-To: <20180809001606.26876-2-jose.souza@intel.com>

On Wed, 08 Aug 2018, José Roberto de Souza <jose.souza@intel.com> wrote:
> num_pipes is set to 0 if disable_display is set inside
> intel_device_info_runtime_init() but when that happen PCH will
> already be set in intel_detect_pch().
>
> i915_driver_load()
> 	i915_driver_init_early()
> 		...
> 		intel_detect_pch()
> 		...
> 	...
> 	i915_driver_init_hw()
> 		intel_device_info_runtime_init()
>
> So now setting num_pipes = 0 earlier to avoid this problem.

Okay, this gets confusing. There are other paths in
intel_device_info_runtime_init() that set num_pipes = 0 and depend on
PCH having been detected. :(

>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c          | 5 +++++
>  drivers/gpu/drm/i915/intel_device_info.c | 8 ++------
>  2 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9dce55182c3a..7952f5877402 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -917,6 +917,11 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
>  	if (ret < 0)
>  		goto err_workqueues;
>  
> +	if (i915_modparams.disable_display) {
> +		DRM_INFO("Display disabled (module parameter)\n");
> +		device_info->num_pipes = 0;
> +	}
> +

Please look at the function as a whole, and note that this feels like a
random thing to add in the middle. Needs to be stowed away somewhere
deeper.

Overall, I think we need to be more accurate about the relationship of
num_pipes = 0 and PCH_NOP.


BR,
Jani.

>  	/* This must be called before any calls to HAS_PCH_* */
>  	intel_detect_pch(dev_priv);
>  
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index 0ef0c6448d53..67102b481c8f 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -776,12 +776,8 @@ void intel_device_info_runtime_init(struct intel_device_info *info)
>  			info->num_sprites[pipe] = 1;
>  	}
>  
> -	if (i915_modparams.disable_display) {
> -		DRM_INFO("Display disabled (module parameter)\n");
> -		info->num_pipes = 0;
> -	} else if (info->num_pipes > 0 &&
> -		   (IS_GEN7(dev_priv) || IS_GEN8(dev_priv)) &&
> -		   HAS_PCH_SPLIT(dev_priv)) {
> +	if (info->num_pipes > 0 && (IS_GEN7(dev_priv) || IS_GEN8(dev_priv)) &&
> +	    HAS_PCH_SPLIT(dev_priv)) {
>  		u32 fuse_strap = I915_READ(FUSE_STRAP);
>  		u32 sfuse_strap = I915_READ(SFUSE_STRAP);

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-08-09  8:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09  0:15 [PATCH 01/20] drm: Let userspace check if driver supports modeset José Roberto de Souza
2018-08-09  0:15 ` [PATCH 02/20] drm/i915: Set PCH as NOP when display is disabled José Roberto de Souza
2018-08-09  8:16   ` Jani Nikula [this message]
2018-08-09 20:35     ` Souza, Jose
2018-08-09  8:36   ` Chris Wilson
2018-08-09 20:38     ` Souza, Jose
2018-08-09  0:15 ` [PATCH 03/20] drm/i915/runtime_pm: Share code to enable/disable PCH reset handshake José Roberto de Souza
2018-08-09  0:15 ` [PATCH 04/20] drm/i915: Move out non-display related calls from display/modeset init/cleanup José Roberto de Souza
2018-08-09  0:15 ` [PATCH 05/20] drm/i915: Release POWER_DOMAIN_INIT reference when display is disabled José Roberto de Souza
2018-08-09  0:15 ` [PATCH 06/20] drm/i915: Move drm_vblank_init() to i915_load_modeset_init() José Roberto de Souza
2018-08-09  0:15 ` [PATCH 07/20] drm/i915: Move FBC init and cleanup calls to modeset functions José Roberto de Souza
2018-08-09  0:15 ` [PATCH 08/20] drm/i915: Do not modifiy reserved bit in gens that do not have IPC José Roberto de Souza
2018-08-09  0:15 ` [PATCH 09/20] drm/i915: Move intel_init_ipc() call to i915_load_modeset_init() José Roberto de Souza
2018-08-09  0:15 ` [PATCH 10/20] drm/i915: Do not call modeset related functions when display is disabled José Roberto de Souza
2018-08-09  0:15 ` [PATCH 11/20] drm/i915: Grab a runtime pm reference before run live selftests José Roberto de Souza
2018-08-09  0:15 ` [PATCH 12/20] drm/i915: Unset reset pch handshake when PCH is not present in one place José Roberto de Souza
2018-08-09  0:15 ` [PATCH 13/20] drm/i915: Remove redundant checks for num_pipes == 0 José Roberto de Souza
2018-08-09  0:16 ` [PATCH 14/20] drm/i915: Keep overlay functions naming consistent José Roberto de Souza
2018-08-09  0:16 ` [PATCH 15/20] drm/i915: Do not reset display when display is disabled José Roberto de Souza
2018-08-09  0:16 ` [PATCH 16/20] drm/i915: Do not initialize display clocks " José Roberto de Souza
2018-08-09  0:16 ` [PATCH 17/20] drm/i915: Remove duplicated definition of intel_update_rawclk José Roberto de Souza
2018-08-09  0:16 ` [PATCH 18/20] drm/i195: Do not initialize display core when display is disabled José Roberto de Souza
2018-08-09  0:16 ` [PATCH 19/20] drm/i915: Warn when display irq functions is executed " José Roberto de Souza
2018-08-09  0:16 ` [PATCH 20/20] drm/i915: Do not enable all power wells " José Roberto de Souza
2018-08-09  0:31 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/20] drm: Let userspace check if driver supports modeset Patchwork
2018-08-09  0:38 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-08-09  0:48 ` ✓ Fi.CI.BAT: success " Patchwork
2018-08-09  4:09 ` ✓ Fi.CI.IGT: " Patchwork
2018-08-09  8:34 ` [PATCH 01/20] " Chris Wilson
2018-08-15 20:34 ` Souza, Jose

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=87k1p09cpy.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jose.souza@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.