* [PATCH] gpu/drm/i915: Don't disable panel for modesetting if pfit hasn't changed
@ 2010-05-18 17:53 Matthew Garrett
2010-05-18 20:12 ` Jesse Barnes
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Garrett @ 2010-05-18 17:53 UTC (permalink / raw)
To: intel-gfx; +Cc: Matthew Garrett
It seems to be possible to program a new mode without disabling the panel
if the panel fitter setup doesn't change. Add support for that.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
drivers/gpu/drm/i915/intel_lvds.c | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index b66806a..1da0030 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -84,6 +84,16 @@ static u32 intel_lvds_get_max_backlight(struct drm_device *dev)
BACKLIGHT_MODULATION_FREQ_SHIFT) * 2;
}
+static void intel_lvds_lock_panel(struct drm_device *dev, bool lock)
+{
+ struct drm_i915_private *dev_priv = dev->dev_private;
+
+ if (lock)
+ I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) & 0x3);
+ else
+ I915_WRITE(PP_CONTROL, I915_READ(PP_CONTROL) | (0xabcd << 16));
+}
+
/**
* Sets the power state for the panel.
*/
@@ -555,6 +565,8 @@ static void intel_lvds_prepare(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
+ struct intel_encoder *intel_encoder = enc_to_intel_encoder(encoder);
+ struct intel_lvds_priv *lvds_priv = intel_encoder->dev_priv;
u32 reg;
if (HAS_PCH_SPLIT(dev))
@@ -566,7 +578,10 @@ static void intel_lvds_prepare(struct drm_encoder *encoder)
dev_priv->backlight_duty_cycle = (dev_priv->saveBLC_PWM_CTL &
BACKLIGHT_DUTY_CYCLE_MASK);
- intel_lvds_set_power(dev, false);
+ if (lvds_priv->pfit_control == I915_READ(PFIT_CONTROL))
+ intel_lvds_lock_panel(dev, false);
+ else
+ intel_lvds_set_power(dev, false);
}
static void intel_lvds_commit( struct drm_encoder *encoder)
@@ -578,7 +593,10 @@ static void intel_lvds_commit( struct drm_encoder *encoder)
dev_priv->backlight_duty_cycle =
intel_lvds_get_max_backlight(dev);
- intel_lvds_set_power(dev, true);
+ if ((I915_READ(PP_CONTROL) & (0xabcd << 16)) == (0xabcd << 16))
+ intel_lvds_lock_panel(dev, true);
+ else
+ intel_lvds_set_power(dev, true);
}
static void intel_lvds_mode_set(struct drm_encoder *encoder,
--
1.6.5.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] gpu/drm/i915: Don't disable panel for modesetting if pfit hasn't changed
2010-05-18 17:53 [PATCH] gpu/drm/i915: Don't disable panel for modesetting if pfit hasn't changed Matthew Garrett
@ 2010-05-18 20:12 ` Jesse Barnes
2010-09-08 16:44 ` Matthew Garrett
0 siblings, 1 reply; 4+ messages in thread
From: Jesse Barnes @ 2010-05-18 20:12 UTC (permalink / raw)
To: Matthew Garrett; +Cc: intel-gfx
On Tue, 18 May 2010 13:53:16 -0400
Matthew Garrett <mjg@redhat.com> wrote:
> It seems to be possible to program a new mode without disabling the panel
> if the panel fitter setup doesn't change. Add support for that.
>
> Signed-off-by: Matthew Garrett <mjg@redhat.com>
> ---
> drivers/gpu/drm/i915/intel_lvds.c | 22 ++++++++++++++++++++--
> 1 files changed, 20 insertions(+), 2 deletions(-)
Looks good, we should get it upstream early in this cycle to get it
some test coverage. If it doesn't work out it's easy to revert.
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
--
Jesse Barnes, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpu/drm/i915: Don't disable panel for modesetting if pfit hasn't changed
2010-05-18 20:12 ` Jesse Barnes
@ 2010-09-08 16:44 ` Matthew Garrett
2010-09-08 16:56 ` [PATCH] gpu/drm/i915: Dont disable panel for modesetting if pfit hasnt changed Chris Wilson
0 siblings, 1 reply; 4+ messages in thread
From: Matthew Garrett @ 2010-09-08 16:44 UTC (permalink / raw)
To: Jesse Barnes; +Cc: intel-gfx
On Tue, May 18, 2010 at 01:12:32PM -0700, Jesse Barnes wrote:
> On Tue, 18 May 2010 13:53:16 -0400
> Matthew Garrett <mjg@redhat.com> wrote:
>
> > It seems to be possible to program a new mode without disabling the panel
> > if the panel fitter setup doesn't change. Add support for that.
> >
> > Signed-off-by: Matthew Garrett <mjg@redhat.com>
> > ---
> > drivers/gpu/drm/i915/intel_lvds.c | 22 ++++++++++++++++++++--
> > 1 files changed, 20 insertions(+), 2 deletions(-)
>
> Looks good, we should get it upstream early in this cycle to get it
> some test coverage. If it doesn't work out it's easy to revert.
It doesn't look like this got merged?
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gpu/drm/i915: Dont disable panel for modesetting if pfit hasnt changed
2010-09-08 16:44 ` Matthew Garrett
@ 2010-09-08 16:56 ` Chris Wilson
0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2010-09-08 16:56 UTC (permalink / raw)
To: Matthew Garrett, Jesse Barnes; +Cc: intel-gfx
Applied to -next. Thanks for the friendly reminder.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-08 16:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-18 17:53 [PATCH] gpu/drm/i915: Don't disable panel for modesetting if pfit hasn't changed Matthew Garrett
2010-05-18 20:12 ` Jesse Barnes
2010-09-08 16:44 ` Matthew Garrett
2010-09-08 16:56 ` [PATCH] gpu/drm/i915: Dont disable panel for modesetting if pfit hasnt changed Chris Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).