All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [PATCH 11.5/13] drm/i915: remove QUIRK_NO_PCH_PWM_ENABLE
Date: Thu, 14 Nov 2013 12:14:29 +0200	[thread overview]
Message-ID: <1384424069-15078-1-git-send-email-jani.nikula@intel.com> (raw)
In-Reply-To: <abfedf3695358dd040016a700d3662b3d5faa982.1383920621.git.jani.nikula@intel.com>

The quirk was added as what I'd say was a stopgap measure in

commit e85843bec6c2ea7c10ec61238396891cc2b753a9
Author: Kamal Mostafa <kamal@canonical.com>
Date:   Fri Jul 19 15:02:01 2013 -0700

    drm/i915: quirk no PCH_PWM_ENABLE for Dell XPS13 backlight

without really digging into what was going on.

Also, as mentioned in the related bug [1], having the quirk regressed
some of the machines it was supposed to fix to begin with, and there
were patches posted to disable the quirk on such machines [2]!

The fact is, we do need the BLM_PCH_PWM_ENABLE bit set to have
backlight. With the quirk, we've relied on BIOS to have set it, and our
save/restore code to retain it. With the full backlight setup at enable,
we have no place for things that rely on previous state.

With the per platform hooks, we've also made a change in the PCH
platform enable order: setting the backlight duty cycle between CPU and
PCH PWM enable. Some experimenting and

commit 770c12312ad617172b1a65b911d3e6564fc5aca8
Author: Takashi Iwai <tiwai@suse.de>
Date:   Sat Aug 11 08:56:42 2012 +0200

    drm/i915: Fix blank panel at reopening lid

indicate that we can't set the backlight before enabling CPU PWM; the
value just won't stick. But AFAICT we should do it before enabling the
PCH PWM.

Finally, any fallout we should fix properly, preferrably without quirks,
and absolutely without quirks that rely on existing state. With the per
platform hooks have much more flexibility to adjust the sequence as
required by platforms.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=47941
[2] http://lkml.kernel.org/r/1378229848-29113-1-git-send-email-kamal@canonical.com

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h      |    1 -
 drivers/gpu/drm/i915/intel_display.c |   16 ----------------
 drivers/gpu/drm/i915/intel_panel.c   |    4 ----
 3 files changed, 21 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index c243b8e..e726ab9 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -717,7 +717,6 @@ enum intel_sbi_destination {
 #define QUIRK_PIPEA_FORCE (1<<0)
 #define QUIRK_LVDS_SSC_DISABLE (1<<1)
 #define QUIRK_INVERT_BRIGHTNESS (1<<2)
-#define QUIRK_NO_PCH_PWM_ENABLE (1<<3)
 
 struct intel_fbdev;
 struct intel_fbc_work;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 25ef080..b9f763c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10456,17 +10456,6 @@ static void quirk_invert_brightness(struct drm_device *dev)
 	DRM_INFO("applying inverted panel brightness quirk\n");
 }
 
-/*
- * Some machines (Dell XPS13) suffer broken backlight controls if
- * BLM_PCH_PWM_ENABLE is set.
- */
-static void quirk_no_pcm_pwm_enable(struct drm_device *dev)
-{
-	struct drm_i915_private *dev_priv = dev->dev_private;
-	dev_priv->quirks |= QUIRK_NO_PCH_PWM_ENABLE;
-	DRM_INFO("applying no-PCH_PWM_ENABLE quirk\n");
-}
-
 struct intel_quirk {
 	int device;
 	int subsystem_vendor;
@@ -10526,11 +10515,6 @@ static struct intel_quirk intel_quirks[] = {
 	 * seem to use inverted backlight PWM.
 	 */
 	{ 0x2a42, 0x1025, PCI_ANY_ID, quirk_invert_brightness },
-
-	/* Dell XPS13 HD Sandy Bridge */
-	{ 0x0116, 0x1028, 0x052e, quirk_no_pcm_pwm_enable },
-	/* Dell XPS13 HD and XPS13 FHD Ivy Bridge */
-	{ 0x0166, 0x1028, 0x058b, quirk_no_pcm_pwm_enable },
 };
 
 static void intel_init_quirks(struct drm_device *dev)
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 0986472..da088e3 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -749,10 +749,6 @@ static void pch_enable_backlight(struct intel_connector *connector)
 	pch_ctl2 = panel->backlight.max << 16;
 	I915_WRITE(BLC_PWM_PCH_CTL2, pch_ctl2);
 
-	/* XXX: transitional */
-	if (dev_priv->quirks & QUIRK_NO_PCH_PWM_ENABLE)
-		return;
-
 	pch_ctl1 = 0;
 	if (panel->backlight.active_low_pwm)
 		pch_ctl1 |= BLM_PCH_POLARITY;
-- 
1.7.9.5

  parent reply	other threads:[~2013-11-14 10:12 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 14:48 [PATCH 00/13] drm/i915: backlight rewrite Jani Nikula
2013-11-08 14:48 ` [PATCH 01/13] drm/i915: clean up backlight conditional build Jani Nikula
2013-11-12 21:23   ` Imre Deak
2013-11-08 14:48 ` [PATCH 02/13] drm/i915: make backlight info per-connector Jani Nikula
2013-11-12 21:29   ` Imre Deak
2013-11-08 14:48 ` [PATCH 03/13] drm/i915: make asle notifications update backlight on all connectors Jani Nikula
2013-11-12 21:29   ` Imre Deak
2013-11-08 14:48 ` [PATCH 04/13] drm/i915: handle backlight through chip specific functions Jani Nikula
2013-11-12 21:36   ` Imre Deak
2013-11-12 23:19     ` Daniel Vetter
2013-11-08 14:48 ` [PATCH 05/13] drm/i915: fix gen2-gen3 backlight set Jani Nikula
2013-11-12 22:00   ` Imre Deak
2013-11-13  8:27     ` Jani Nikula
2013-11-13  9:04       ` Daniel Vetter
2013-11-13  9:12       ` Imre Deak
2013-11-08 14:48 ` [PATCH 06/13] drm/i915: vlv does not have pipe field in backlight registers Jani Nikula
2013-11-12 22:00   ` Imre Deak
2013-11-08 14:48 ` [PATCH 07/13] drm/i915: move backlight level setting in enable/disable to hooks Jani Nikula
2013-11-12 22:01   ` Imre Deak
2013-11-08 14:49 ` [PATCH 08/13] drm/i915: use the initialized backlight max value instead of reading it Jani Nikula
2013-11-12 22:42   ` Imre Deak
2013-11-13  8:39     ` Jani Nikula
2013-11-13  9:12       ` Daniel Vetter
2013-11-08 14:49 ` [PATCH 09/13] drm/i915: debug print on backlight register Jani Nikula
2013-11-12 22:48   ` Imre Deak
2013-11-13 10:22     ` Daniel Vetter
2013-11-08 14:49 ` [PATCH 10/13] drm/i915: gather backlight information at setup Jani Nikula
2013-11-13 17:01   ` Imre Deak
2013-11-14  5:19     ` Jani Nikula
2013-11-14  8:22       ` Imre Deak
2013-11-08 14:49 ` [PATCH 11/13] drm/i915: do full backlight setup at enable time Jani Nikula
2013-11-13 17:53   ` Imre Deak
2013-11-14  5:43     ` Jani Nikula
2013-11-14  8:27       ` Daniel Vetter
2013-11-14  8:28       ` Imre Deak
2013-11-14 10:13   ` [PATCH v2 " Jani Nikula
2013-11-14 10:46     ` Imre Deak
2013-11-14 10:14   ` Jani Nikula [this message]
2013-11-14 10:50     ` [PATCH 11.5/13] drm/i915: remove QUIRK_NO_PCH_PWM_ENABLE Imre Deak
2013-11-08 14:49 ` [PATCH 12/13] drm/i915: nuke get max backlight functions Jani Nikula
2013-11-13 17:54   ` Imre Deak
2013-11-08 14:49 ` [PATCH 13/13] drm/i915: do not save/restore backlight registers Jani Nikula
2013-11-12 23:25   ` Daniel Vetter
2013-11-13  8:40     ` Jani Nikula
2013-11-13 10:56     ` [PATCH v2] drm/i915: do not save/restore backlight registers in KMS Jani Nikula
2013-11-13 18:05       ` Imre Deak
2013-11-14 11:22         ` Daniel Vetter
2013-11-11  8:36 ` [PATCH 00/13] drm/i915: backlight rewrite Jani Nikula
2013-11-12 21:22 ` Imre Deak

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=1384424069-15078-1-git-send-email-jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --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.