All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH] drm/i915: reorder setup sequence to have irqs for output setup
Date: Thu,  6 Sep 2012 15:43:39 +0200	[thread overview]
Message-ID: <1346939019-5866-1-git-send-email-daniel.vetter@ffwll.ch> (raw)

Otherwise the new&shiny irq-driven gmbus and dp aux code won't work that
well. Noticed since the dp aux code doesn't have an automatic fallback
with a timeout (since the hw provides for that already).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_dma.c      |  5 ++---
 drivers/gpu/drm/i915/i915_drv.h      |  2 +-
 drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++--
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 2cba7b4..58320e0 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1325,9 +1325,8 @@ static int i915_load_modeset_init(struct drm_device *dev)
 	if (ret)
 		goto cleanup_gem_stolen;
 
-	intel_modeset_gem_init(dev);
-
-	ret = drm_irq_install(dev);
+	/* Note: This also enables irqs. */
+	ret = intel_modeset_gem_init(dev);
 	if (ret)
 		goto cleanup_gem;
 
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9fce782..5c8d5e3 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1536,7 +1536,7 @@ static inline void intel_unregister_dsm_handler(void) { return; }
 /* modesetting */
 extern void intel_modeset_init_hw(struct drm_device *dev);
 extern void intel_modeset_init(struct drm_device *dev);
-extern void intel_modeset_gem_init(struct drm_device *dev);
+extern int intel_modeset_gem_init(struct drm_device *dev);
 extern void intel_modeset_cleanup(struct drm_device *dev);
 extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state);
 extern void intel_modeset_setup_hw_state(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 6658367..01289eb 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7948,7 +7948,6 @@ void intel_modeset_init(struct drm_device *dev)
 
 	/* Just disable it once at startup */
 	i915_disable_vga(dev);
-	intel_setup_outputs(dev);
 }
 
 static void
@@ -8206,13 +8205,25 @@ void intel_modeset_setup_hw_state(struct drm_device *dev)
 	drm_mode_config_reset(dev);
 }
 
-void intel_modeset_gem_init(struct drm_device *dev)
+int intel_modeset_gem_init(struct drm_device *dev)
 {
+	int ret;
+
 	intel_modeset_init_hw(dev);
 
 	intel_setup_overlay(dev);
 
+	ret = drm_irq_install(dev);
+	if (ret)
+		return ret;
+
+	/* Importanat: Output setup needs working interrupts to use
+	 * interrupt-driven gmbus and dp aux. */
+	intel_setup_outputs(dev);
+
 	intel_modeset_setup_hw_state(dev);
+
+	return 0;
 }
 
 void intel_modeset_cleanup(struct drm_device *dev)
-- 
1.7.11.2

             reply	other threads:[~2012-09-06 14:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 13:43 Daniel Vetter [this message]
2012-09-09  1:59 ` [PATCH] drm/i915: reorder setup sequence to have irqs for output setup Ben Widawsky
2012-09-09  9:50   ` Daniel Vetter
2012-09-09 17:42     ` 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=1346939019-5866-1-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --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 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.