From: Jani Nikula <jani.nikula@linux.intel.com>
To: Paulo Zanoni <przanoni@gmail.com>, intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 1/4] drm/i915: get power domain in case the BIOS enabled eDP VDD
Date: Wed, 23 Apr 2014 14:02:33 +0300 [thread overview]
Message-ID: <87ioq0qpfa.fsf@intel.com> (raw)
In-Reply-To: <1398207345-1865-1-git-send-email-przanoni@gmail.com>
On Wed, 23 Apr 2014, Paulo Zanoni <przanoni@gmail.com> wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> If I unplug the eDP monitor, the BIOS of my machine will enable the
> VDD bit, then when the driver loads it will think VDD is enabled. It
> will detect that the eDP is not enabled and return false from
> intel_edp_init_connector. This will trigger a call to
> edp_panel_vdd_off_sync(), which trigger a WARN saying that the
> refcount of the power domain is less than zero.
>
> The problem happens because the driver gets a refcount whenever it
> enables the VDD bit, and puts the refcount whenever it disables the
> VDD bit. But on this case, the BIOS enabled VDD, so all we do is to
> call put() without calling get() first, so the code added is there to
> make sure we always have the get() in case the BIOS enabled the bit.
>
> v2: - Rebase
>
> Tested-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Patch 1/4 pushed to -fixes.
BR,
Jani.
> ---
> drivers/gpu/drm/i915/intel_dp.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 80e5598..44df493 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3785,7 +3785,8 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
> {
> struct drm_connector *connector = &intel_connector->base;
> struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> - struct drm_device *dev = intel_dig_port->base.base.dev;
> + struct intel_encoder *intel_encoder = &intel_dig_port->base;
> + struct drm_device *dev = intel_encoder->base.dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> struct drm_display_mode *fixed_mode = NULL;
> struct drm_display_mode *downclock_mode = NULL;
> @@ -3798,6 +3799,14 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
> if (!is_edp(intel_dp))
> return true;
>
> + /* The VDD bit needs a power domain reference, so if the bit is already
> + * enabled when we boot, grab this reference. */
> + if (edp_have_panel_vdd(intel_dp)) {
> + enum intel_display_power_domain power_domain;
> + power_domain = intel_display_port_power_domain(intel_encoder);
> + intel_display_power_get(dev_priv, power_domain);
> + }
> +
> /* Cache DPCD and EDID for edp. */
> intel_edp_panel_vdd_on(intel_dp);
> has_dpcd = intel_dp_get_dpcd(intel_dp);
> --
> 1.9.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
prev parent reply other threads:[~2014-04-23 11:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 21:47 [PATCH] drm/i915: get power domain in case the BIOS enabled eDP VDD Paulo Zanoni
2014-04-10 7:21 ` Daniel Vetter
2014-04-10 7:36 ` Chris Wilson
2014-04-11 13:21 ` Daniel Vetter
2014-04-22 22:55 ` [PATCH 1/4] " Paulo Zanoni
2014-04-22 22:55 ` [PATCH 2/4] drm/i915: add intel_dp_power_get/put Paulo Zanoni
2014-04-23 9:45 ` Ville Syrjälä
2014-04-24 13:49 ` [PATCH 2/4] drm/i915: add intel_encoder_power_get/put Paulo Zanoni
2014-04-24 14:11 ` Ville Syrjälä
2014-04-24 15:14 ` Daniel Vetter
2014-04-22 22:55 ` [PATCH 3/4] drm/i915: remove redundant is_edp() check Paulo Zanoni
2014-04-22 22:55 ` [PATCH 4/4] drm/i915: remove useless runtime PM get call Paulo Zanoni
2014-04-23 9:52 ` Ville Syrjälä
2014-04-24 13:50 ` [PATCH 4/4] drm/i915: remove useless runtime PM get calls Paulo Zanoni
2014-04-24 14:05 ` Ville Syrjälä
2014-07-14 15:59 ` Daniel Vetter
2014-04-23 6:59 ` [PATCH 1/4] drm/i915: get power domain in case the BIOS enabled eDP VDD Daniel Vetter
2014-04-23 11:02 ` Jani Nikula [this message]
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=87ioq0qpfa.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
--cc=przanoni@gmail.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.