From: Daniel Vetter Subject: Re: [PATCH v2] drm/i915: only enable sdvo hotplug irq if needed Date: Mon, 3 Sep 2012 09:44:49 +0200 Message-ID: <20120903074449.GE5225@phenom.ffwll.local> References: <1346233413-29139-1-git-send-email-jani.nikula@intel.com> <1346238522-18314-1-git-send-email-jani.nikula@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bk0-f49.google.com (mail-bk0-f49.google.com [209.85.214.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 898AD9EB56 for ; Mon, 3 Sep 2012 00:44:20 -0700 (PDT) Received: by bkcji2 with SMTP id ji2so2143757bkc.36 for ; Mon, 03 Sep 2012 00:44:19 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1346238522-18314-1-git-send-email-jani.nikula@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Jani Nikula Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Aug 29, 2012 at 02:08:42PM +0300, Jani Nikula wrote: > Avoid constant wakeups caused by noisy irq lines when we don't even care > about the irq. This should be particularly useful for i945g/gm where the > hotplug has been disabled: > > commit 768b107e4b3be0acf6f58e914afe4f337c00932b > Author: Daniel Vetter > Date: Fri May 4 11:29:56 2012 +0200 > > drm/i915: disable sdvo hotplug on i945g/gm > > v2: While at it, remove the bogus hotplug_active read, and do not mask > hotplug_active[0] before checking whether the irq is needed, per discussion > with Daniel on IRC. > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=38442 > Signed-off-by: Jani Nikula > > --- > > N.B. This really needs a Tested-by from the bug reporter. Picked up for -fixes (with the tested-by + cc: stable added), thanks for the patch. -Daniel > --- > drivers/gpu/drm/i915/intel_sdvo.c | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c > index d81bb0b..123afd3 100644 > --- a/drivers/gpu/drm/i915/intel_sdvo.c > +++ b/drivers/gpu/drm/i915/intel_sdvo.c > @@ -2573,7 +2573,6 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) > hotplug_mask = intel_sdvo->is_sdvob ? > SDVOB_HOTPLUG_INT_STATUS_I915 : SDVOC_HOTPLUG_INT_STATUS_I915; > } > - dev_priv->hotplug_supported_mask |= hotplug_mask; > > drm_encoder_helper_add(&intel_encoder->base, &intel_sdvo_helper_funcs); > > @@ -2581,14 +2580,6 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) > if (!intel_sdvo_get_capabilities(intel_sdvo, &intel_sdvo->caps)) > goto err; > > - /* Set up hotplug command - note paranoia about contents of reply. > - * We assume that the hardware is in a sane state, and only touch > - * the bits we think we understand. > - */ > - intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_ACTIVE_HOT_PLUG, > - &intel_sdvo->hotplug_active, 2); > - intel_sdvo->hotplug_active[0] &= ~0x3; > - > if (intel_sdvo_output_setup(intel_sdvo, > intel_sdvo->caps.output_flags) != true) { > DRM_DEBUG_KMS("SDVO output failed to setup on %s\n", > @@ -2596,6 +2587,12 @@ bool intel_sdvo_init(struct drm_device *dev, uint32_t sdvo_reg, bool is_sdvob) > goto err; > } > > + /* Only enable the hotplug irq if we need it, to work around noisy > + * hotplug lines. > + */ > + if (intel_sdvo->hotplug_active[0]) > + dev_priv->hotplug_supported_mask |= hotplug_mask; > + > intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo, sdvo_reg); > > /* Set the input timing to the screen. Assume always input 0. */ > -- > 1.7.9.5 > -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48