All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: intel-gfx@lists.freedesktop.org, "Mcallister,
	Jeffrey" <jeffrey.mcallister@intel.com>
Subject: Re: [PATCH 2/9] drm/i915: Support PCH no display
Date: Sun, 17 Mar 2013 22:13:25 +0100	[thread overview]
Message-ID: <20130317211325.GY9021@phenom.ffwll.local> (raw)
In-Reply-To: <1363198868-21787-3-git-send-email-ben@bwidawsk.net>

On Wed, Mar 13, 2013 at 11:21:01AM -0700, Ben Widawsky wrote:
> GEN supports a fusing option which subtracts the PCH display (making the
> CPU display also useless). In this configuration MMIO which gets decoded
> to a certain range will hang the CPU.
> 
> For us, this is sort of the equivalent of having no pipes, and we can
> easily modify some code to not do certain things with no pipes.
> 
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> ---
>  drivers/gpu/drm/i915/i915_dma.c      | 20 ++++++++++++++------
>  drivers/gpu/drm/i915/intel_crt.c     |  3 +++
>  drivers/gpu/drm/i915/intel_display.c | 10 ++++++++--
>  drivers/gpu/drm/i915/intel_fb.c      |  3 +++
>  drivers/gpu/drm/i915/intel_overlay.c |  3 +++
>  5 files changed, 31 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index ebcfe2e..d925504 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1322,6 +1322,10 @@ static int i915_load_modeset_init(struct drm_device *dev)
>  	/* Always safe in the mode setting case. */
>  	/* FIXME: do pre/post-mode set stuff in core KMS code */
>  	dev->vblank_disable_allowed = 1;
> +	if (INTEL_INFO(dev)->num_pipes == 0) {
> +		dev_priv->mm.suspended = 0;
> +		return 0;
> +	}
>  
>  	ret = intel_fbdev_init(dev);
>  	if (ret)
> @@ -1630,9 +1634,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
>  	mutex_init(&dev_priv->rps.hw_lock);
>  	mutex_init(&dev_priv->modeset_restore_lock);
>  
> -	ret = drm_vblank_init(dev, INTEL_INFO(dev)->num_pipes);
> -	if (ret)
> -		goto out_gem_unload;
> +	if (INTEL_INFO(dev)->num_pipes) {
> +		ret = drm_vblank_init(dev, INTEL_INFO(dev)->num_pipes);
> +		if (ret)
> +			goto out_gem_unload;
> +	}
>  
>  	/* Start out suspended */
>  	dev_priv->mm.suspended = 1;
> @@ -1647,9 +1653,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
>  
>  	i915_setup_sysfs(dev);
>  
> -	/* Must be done after probing outputs */
> -	intel_opregion_init(dev);
> -	acpi_video_register();
> +	if (INTEL_INFO(dev)->num_pipes) {
> +		/* Must be done after probing outputs */
> +		intel_opregion_init(dev);
> +		acpi_video_register();
> +	}
>  
>  	if (IS_GEN5(dev))
>  		intel_gpu_ips_init(dev_priv);
> diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
> index cfc9687..e794c6c 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -736,6 +736,9 @@ void intel_crt_init(struct drm_device *dev)
>  	if (dmi_check_system(intel_no_crt))
>  		return;
>  
> +	if (INTEL_INFO(dev)->num_pipes == 0)
> +		return;

Imo better to move this up in the callchain since we should never ever
bother to probe connectors with no pipes.

> +
>  	crt = kzalloc(sizeof(struct intel_crt), GFP_KERNEL);
>  	if (!crt)
>  		return;
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 23379e7..d6dbffd 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -7682,6 +7682,9 @@ intel_modeset_check_state(struct drm_device *dev)
>  	struct intel_encoder *encoder;
>  	struct intel_connector *connector;
>  
> +	if (INTEL_INFO(dev)->num_pipes == 0)
> +		return;

Presuming our works correctly this should never be called if there's no
pipes. Could be that the lid handler is offending us, but that one
shouldn't be registered without a panel. Can you please check whether we
really need this?

> +
>  	list_for_each_entry(connector, &dev->mode_config.connector_list,
>  			    base.head) {
>  		/* This also checks the encoder/connector hw state with the
> @@ -8326,7 +8329,9 @@ static void intel_setup_outputs(struct drm_device *dev)
>  	if (!(HAS_DDI(dev) && (I915_READ(DDI_BUF_CTL(PORT_A)) & DDI_A_4_LANES)))
>  		intel_crt_init(dev);
>  
> -	if (HAS_DDI(dev)) {
> +	if (INTEL_INFO(dev)->num_pipes == 0) {
> +		DRM_DEBUG_KMS("Skipping output detection\n");

Move this up and add an early return, then all the other output checks
should be redundant. There's some other stuff called from
intel_modeset_init which might need to be guarded.

> +	} else if (HAS_DDI(dev)) {
>  		int found;
>  
>  		/* Haswell uses DDI functions to detect digital outputs */
> @@ -8443,7 +8448,8 @@ static void intel_setup_outputs(struct drm_device *dev)
>  
>  	intel_init_pch_refclk(dev);

If you drop everything in setup_outputs you also don't have to deal with
the pch_refclock stuff.

Cheers, Daniel

> -	drm_helper_move_panel_connectors_to_head(dev);
> +	if (INTEL_INFO(dev)->num_pipes)
> +		drm_helper_move_panel_connectors_to_head(dev);
>  }
>  
>  static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb)
> diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
> index dcdb1d3..5f825c2 100644
> --- a/drivers/gpu/drm/i915/intel_fb.c
> +++ b/drivers/gpu/drm/i915/intel_fb.c
> @@ -295,6 +295,9 @@ void intel_fb_restore_mode(struct drm_device *dev)
>  	struct drm_mode_config *config = &dev->mode_config;
>  	struct drm_plane *plane;
>  
> +	if (!INTEL_INFO(dev)->num_pipes)
> +		return;
> +
>  	drm_modeset_lock_all(dev);
>  
>  	ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper);
> diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
> index 67a2501..e7fbf2e 100644
> --- a/drivers/gpu/drm/i915/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/intel_overlay.c
> @@ -1323,6 +1323,9 @@ void intel_setup_overlay(struct drm_device *dev)
>  	if (!HAS_OVERLAY(dev))
>  		return;
>  
> +	if (INTEL_INFO(dev)->num_pipes == 0)
> +		return;
> +
>  	overlay = kzalloc(sizeof(struct intel_overlay), GFP_KERNEL);
>  	if (!overlay)
>  		return;
> -- 
> 1.8.1.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-03-17 21:10 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-13 18:20 [PATCH 0/9] displayless PCH Ben Widawsky
2013-03-13 18:21 ` [PATCH 1/9] drm/i915: Move num_pipes to intel info Ben Widawsky
2013-03-13 18:31   ` Chris Wilson
2013-03-13 18:36     ` Ben Widawsky
2013-03-13 21:05   ` [PATCH 01/10] [v2] " Ben Widawsky
2013-03-19 19:25   ` [PATCH 1/9] " Jesse Barnes
2013-03-19 23:06     ` Daniel Vetter
2013-03-13 18:21 ` [PATCH 2/9] drm/i915: Support PCH no display Ben Widawsky
2013-03-17 21:13   ` Daniel Vetter [this message]
2013-03-13 18:21 ` [PATCH 3/9] drm/i915: PCH_NOP Ben Widawsky
2013-03-17 21:05   ` Daniel Vetter
2013-03-17 21:14     ` Daniel Vetter
2013-03-13 18:21 ` [PATCH 4/9] drm/i915: Don't touch South display when PCH_NOP Ben Widawsky
2013-03-14 11:44   ` Jani Nikula
2013-03-14 15:55     ` [PATCH 04/10] [v2] drm/i915: Don't touch South Display " Ben Widawsky
2013-03-17 21:21       ` Daniel Vetter
2013-03-18 23:05         ` Ben Widawsky
2013-03-13 18:21 ` [PATCH 5/9] drm/i915: Don't initialize watermark stuff with PCH_NOP Ben Widawsky
2013-03-13 18:47   ` Chris Wilson
2013-03-13 21:06   ` [PATCH 05/10] [v2] " Ben Widawsky
2013-03-17 21:02     ` Daniel Vetter
2013-03-19  0:45       ` Ben Widawsky
2013-03-13 18:21 ` [PATCH 6/9] drm/i915: PCH_NOP suspend/resume Ben Widawsky
2013-03-17 21:28   ` Daniel Vetter
2013-03-19  0:51     ` Ben Widawsky
2013-03-19  7:51       ` Daniel Vetter
2013-03-19 17:53         ` Ben Widawsky
2013-03-13 18:21 ` [PATCH 7/9] drm/i915: Don't wait for PCH on reset Ben Widawsky
2013-03-19 19:36   ` Jesse Barnes
2013-03-20 16:43     ` [PATCH] " Ben Widawsky
2013-03-20 16:58       ` Jesse Barnes
2013-03-13 18:21 ` [PATCH 8/9] drm/i915: Set PCH_NOP Ben Widawsky
2013-03-17 21:36   ` Daniel Vetter
2013-03-13 18:21 ` [PATCH 9/9] drm/i915: Add a pipeless ivybridge configuration Ben Widawsky
2013-03-13 18:52   ` Chris Wilson
2013-03-13 21:08   ` [PATCH 09/10] drm/i915: Introduce IVB_FEATURES for device definition Ben Widawsky
2013-03-13 21:08     ` [PATCH 10/10] [v2] drm/i915: Add a pipeless ivybridge configuration Ben Widawsky
2013-03-15  4:05     ` [PATCH 09/10] drm/i915: Introduce IVB_FEATURES for device definition Ben Widawsky
2013-03-13 18:58 ` [PATCH 0/9] displayless PCH Chris Wilson
2013-03-13 19:05   ` Ben Widawsky

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=20130317211325.GY9021@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=ben@bwidawsk.net \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jeffrey.mcallister@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.