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,
	"Chris Wilson" <chris@chris-wilson.co.uk>
Subject: Re: [PATCH 01/16] drm/i915: Properly set PCH as NOP when display is disabled
Date: Sat, 03 Nov 2018 23:41:10 +0200	[thread overview]
Message-ID: <8736shet55.fsf@intel.com> (raw)
In-Reply-To: <20181012215218.5119-1-jose.souza@intel.com>

On Fri, 12 Oct 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.

I'm growing this nagging feeling that this may be the wrong direction.

It's just that disabling an existing display and not having display are
two very different things. Even if our goal here is use the former to
test the latter, I think it's more subtle than this. You already saw
some of this in patch 15 of this series. You can't just pretend there's
no display if you also want to gain benefits.

I'm also not sure if we need to go as far as Chris is suggesting in [1],
but assuming disable display means num_pipes = 0 from start prevents us
from doing that later on, because we'll start making assumptions. Like
you already do in this series.

Again, there's a bunch of useful stuff in the series that could be
merged with a different ordering. Including patches 3-5 that look
superficially good but do need an in-depth review. The init sequences
are hard, and we should add more asserts and comments on the ordering,
because we tend to forget why things are the way they are.


BR,
Jani.

[1] https://patchwork.freedesktop.org/series/51000/

>
> 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 baac35f698f9..e3efc3dd8a30 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -1649,6 +1649,11 @@ i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent)
>  	memcpy(device_info, match_info, sizeof(*device_info));
>  	device_info->device_id = pdev->device;
>  
> +	if (i915_modparams.disable_display) {
> +		DRM_INFO("Display disabled (module parameter)\n");
> +		device_info->num_pipes = 0;
> +	}
> +
>  	BUILD_BUG_ON(INTEL_MAX_PLATFORMS >
>  		     BITS_PER_TYPE(device_info->platform_mask));
>  	BUG_ON(device_info->gen > BITS_PER_TYPE(device_info->gen_mask));
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index 03df4e33763d..69be3f211737 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -775,12 +775,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

  parent reply	other threads:[~2018-11-03 21:41 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 21:52 [PATCH 01/16] drm/i915: Properly set PCH as NOP when display is disabled José Roberto de Souza
2018-10-12 21:52 ` [PATCH 02/16] drm/i915: Move out non-display related calls from display/modeset init/cleanup José Roberto de Souza
2018-10-15 11:14   ` Chris Wilson
2018-10-15 23:51     ` Souza, Jose
2018-10-12 21:52 ` [PATCH 03/16] drm/i915: Move drm_vblank_init() to i915_load_modeset_init() José Roberto de Souza
2018-10-12 21:52 ` [PATCH 04/16] drm/i915: Move FBC init and cleanup calls to modeset functions José Roberto de Souza
2018-10-12 21:52 ` [PATCH 05/16] drm/i915: Move intel_init_ipc() call to i915_load_modeset_init() José Roberto de Souza
2018-10-12 21:52 ` [PATCH 06/16] drm/i915: Don't call modeset related functions when display is disabled José Roberto de Souza
2018-10-22  8:25   ` Jani Nikula
2018-10-22  8:37     ` Chris Wilson
2018-10-22  9:00       ` Jani Nikula
2018-10-25 17:38         ` Souza, Jose
2019-04-08 20:50         ` Chris Wilson
2019-08-24  9:51           ` Chris Wilson
2018-10-12 21:52 ` [PATCH 07/16] drm/i915: Remove redundant checks for num_pipes == 0 José Roberto de Souza
2018-10-22  8:31   ` Jani Nikula
2018-10-12 21:52 ` [PATCH 08/16] drm/i915: Keep overlay functions naming consistent José Roberto de Souza
2018-10-22  8:32   ` Jani Nikula
2018-10-12 21:52 ` [PATCH 09/16] drm/i915: Do not reset display when display is disabled José Roberto de Souza
2018-10-22  8:34   ` Jani Nikula
2018-10-12 21:52 ` [PATCH 10/16] drm/i915: Do not initialize display clocks " José Roberto de Souza
2018-10-22  8:37   ` Jani Nikula
2018-10-12 21:52 ` [PATCH 11/16] drm/i915: Do not initialize display core " José Roberto de Souza
2018-10-22  8:39   ` Jani Nikula
2018-10-12 21:52 ` [PATCH 12/16] drm/i915: Warn when display irq functions is executed " José Roberto de Souza
2018-10-22  8:40   ` Jani Nikula
2018-10-12 21:52 ` [PATCH 13/16] drm/i915: Do not print DC off mismatch state when DMC firmware in not loaded José Roberto de Souza
2018-10-15 10:58   ` Imre Deak
2018-10-16  1:31     ` Souza, Jose
2018-10-16  9:35       ` Imre Deak
2018-10-12 21:52 ` [PATCH 14/16] drm/i915: Do not turn power wells on or off when display is disabled José Roberto de Souza
2018-10-22  8:50   ` Jani Nikula
2018-10-12 21:52 ` [PATCH 15/16] drm/i915: Power down any power well left on by BIOS José Roberto de Souza
2018-10-15 11:06   ` Imre Deak
2018-10-16  0:05     ` Souza, Jose
2018-10-16  9:39       ` Imre Deak
2018-10-12 21:52 ` [PATCH 16/16] drm/i915: Guard debugfs against invalid access when display is disabled José Roberto de Souza
2018-10-22  8:52   ` Jani Nikula
2018-10-12 22:03 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/16] drm/i915: Properly set PCH as NOP " Patchwork
2018-10-12 22:07 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-10-12 22:27 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-13  2:46 ` ✓ Fi.CI.IGT: " Patchwork
2018-11-03 21:41 ` Jani Nikula [this message]
2018-11-30  8:29   ` [PATCH 01/16] " Lucas De Marchi

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=8736shet55.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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.