* [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
[not found] <20130409172820.GC27612@phenom.ffwll.local>
@ 2013-04-09 19:51 ` Daniel Vetter
2013-04-10 11:59 ` Richard Cochran
2013-04-11 18:22 ` Daniel Vetter
0 siblings, 2 replies; 15+ messages in thread
From: Daniel Vetter @ 2013-04-09 19:51 UTC (permalink / raw)
To: Intel Graphics Development
Cc: DRI Development, LKML, Dave Airlie, Daniel Vetter, Tomas Melin,
Richard Cochran, Chris Wilson, stable
It will be only consistent once we've restored all the crtcs. Since a
bunch of other callers also want to just restore a single crtc, add a
boolean to disable checking only where it doesn't make sense.
Note that intel_modeset_setup_hw_state already has a call to
intel_modeset_check_state at the end, so we don't reduce the amount of
checking.
v2: Try harder not to create a big patch (Chris).
References: https://lkml.org/lkml/2013/3/16/60
Cc: Tomas Melin <tomas.melin@iki.fi>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/gpu/drm/i915/intel_display.c | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8809813..2959fb8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7916,9 +7916,9 @@ intel_modeset_check_state(struct drm_device *dev)
}
}
-int intel_set_mode(struct drm_crtc *crtc,
- struct drm_display_mode *mode,
- int x, int y, struct drm_framebuffer *fb)
+static int __intel_set_mode(struct drm_crtc *crtc,
+ struct drm_display_mode *mode,
+ int x, int y, struct drm_framebuffer *fb)
{
struct drm_device *dev = crtc->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -8012,8 +8012,6 @@ done:
if (ret && crtc->enabled) {
crtc->hwmode = *saved_hwmode;
crtc->mode = *saved_mode;
- } else {
- intel_modeset_check_state(dev);
}
out:
@@ -8022,9 +8020,25 @@ out:
return ret;
}
+int intel_set_mode(struct drm_crtc *crtc,
+ struct drm_display_mode *mode,
+ int x, int y, struct drm_framebuffer *fb)
+{
+ int ret;
+
+ ret = __intel_set_mode(crtc, mode, x, y, fb);
+
+ if (ret == 0)
+ intel_modeset_check_state(crtc->dev);
+
+ return ret;
+}
+
void intel_crtc_restore_mode(struct drm_crtc *crtc)
{
- intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, crtc->fb);
+ __intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, crtc->fb);
+
+ intel_modeset_check_state(crtc->dev);
}
#undef for_each_intel_crtc_masked
@@ -9333,10 +9347,16 @@ setup_pipes:
}
if (force_restore) {
+ /*
+ * We need to use raw interfaces for restoring state to avoid
+ * checking (bogus) intermediate states.
+ */
for_each_pipe(pipe) {
struct drm_crtc *crtc =
dev_priv->pipe_to_crtc_mapping[pipe];
- intel_crtc_restore_mode(crtc);
+
+ __intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y,
+ crtc->fb);
}
list_for_each_entry(plane, &dev->mode_config.plane_list, head)
intel_plane_restore(plane);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-09 19:51 ` [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring Daniel Vetter
@ 2013-04-10 11:59 ` Richard Cochran
2013-04-10 12:07 ` Daniel Vetter
2013-04-11 18:22 ` Daniel Vetter
1 sibling, 1 reply; 15+ messages in thread
From: Richard Cochran @ 2013-04-10 11:59 UTC (permalink / raw)
To: Daniel Vetter
Cc: Intel Graphics Development, DRI Development, LKML, Dave Airlie,
Tomas Melin, Chris Wilson, stable
On Tue, Apr 09, 2013 at 09:51:30PM +0200, Daniel Vetter wrote:
> It will be only consistent once we've restored all the crtcs. Since a
> bunch of other callers also want to just restore a single crtc, add a
> boolean to disable checking only where it doesn't make sense.
>
> Note that intel_modeset_setup_hw_state already has a call to
> intel_modeset_check_state at the end, so we don't reduce the amount of
> checking.
>
> v2: Try harder not to create a big patch (Chris).
To what does tree does this patch apply?
Tried v3.8.6 and master d02a9a89.
Thanks,
Richard
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-10 11:59 ` Richard Cochran
@ 2013-04-10 12:07 ` Daniel Vetter
2013-04-10 17:27 ` Richard Cochran
0 siblings, 1 reply; 15+ messages in thread
From: Daniel Vetter @ 2013-04-10 12:07 UTC (permalink / raw)
To: Richard Cochran
Cc: Daniel Vetter, Intel Graphics Development, DRI Development, LKML,
Dave Airlie, Tomas Melin, Chris Wilson, stable
On Wed, Apr 10, 2013 at 01:59:02PM +0200, Richard Cochran wrote:
> On Tue, Apr 09, 2013 at 09:51:30PM +0200, Daniel Vetter wrote:
> > It will be only consistent once we've restored all the crtcs. Since a
> > bunch of other callers also want to just restore a single crtc, add a
> > boolean to disable checking only where it doesn't make sense.
> >
> > Note that intel_modeset_setup_hw_state already has a call to
> > intel_modeset_check_state at the end, so we don't reduce the amount of
> > checking.
> >
> > v2: Try harder not to create a big patch (Chris).
>
> To what does tree does this patch apply?
>
> Tried v3.8.6 and master d02a9a89.
It's written against drm-intel-next-queued at
http://cgit.freedesktop.org/~danvet/drm-intel
I've thought that it should apply pretty cleanly against older kernels,
too. Apparently it conflicts a bit in intel_modeset_setup_hw_state, you
can just do the s/intel_crtc_restore_mode/__intel_set_mode/ change
manually.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-10 12:07 ` Daniel Vetter
@ 2013-04-10 17:27 ` Richard Cochran
2013-04-10 18:32 ` Tomas Melin
2013-04-10 20:03 ` [Intel-gfx] " Daniel Vetter
0 siblings, 2 replies; 15+ messages in thread
From: Richard Cochran @ 2013-04-10 17:27 UTC (permalink / raw)
To: Intel Graphics Development, DRI Development, LKML, Dave Airlie,
Tomas Melin, Chris Wilson, stable
On Wed, Apr 10, 2013 at 02:07:24PM +0200, Daniel Vetter wrote:
>
> It's written against drm-intel-next-queued at
>
> http://cgit.freedesktop.org/~danvet/drm-intel
>
> I've thought that it should apply pretty cleanly against older kernels,
> too. Apparently it conflicts a bit in intel_modeset_setup_hw_state, you
> can just do the s/intel_crtc_restore_mode/__intel_set_mode/ change
> manually.
I couldn't see right away how to fix it up, so I just compiled your
drm-intel-next-queued plus this patch. If I close the netbook's lid
and open it again, the screen is blank, no backlight, and the machine
seems to be frozen.
I think I can live with the warning.
Thanks anyhow,
Richard
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-10 17:27 ` Richard Cochran
@ 2013-04-10 18:32 ` Tomas Melin
2013-04-11 5:16 ` Tomas Melin
2013-04-10 20:03 ` [Intel-gfx] " Daniel Vetter
1 sibling, 1 reply; 15+ messages in thread
From: Tomas Melin @ 2013-04-10 18:32 UTC (permalink / raw)
To: Richard Cochran
Cc: Intel Graphics Development, DRI Development, LKML, Dave Airlie,
Chris Wilson, stable
On Tue, Apr 9, 2013 at 10:51 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> v2: Try harder not to create a big patch (Chris).
>
Tested the patch applied to 3.9-rc6. Atleast on my machine that
helped, although once I managed to get the error (but not warning and
call trace as before):
[drm:i9xx_crtc_mode_set] *ERROR* Couldn't find PLL settings for mode!
On Wed, Apr 10, 2013 at 8:27 PM, Richard Cochran
<richardcochran@gmail.com> wrote:
> I couldn't see right away how to fix it up, so I just compiled your
> drm-intel-next-queued plus this patch. If I close the netbook's lid
> and open it again, the screen is blank, no backlight, and the machine
> seems to be frozen.
The patch doesn't apply at all to 3.8 since function crtc_restore_mode
is missing and also 3.9-rc6 was quite different.
This version of the patch applies atleast to 3.9-rc6 if you want to test it:
>From 9f498da114cea3d82c291b7090d4441664d7870c Mon Sep 17 00:00:00 2001
From: Tomas Melin <tomas.melin@iki.fi>
Date: Wed, 10 Apr 2013 18:53:42 +0300
Subject: [PATCH] applied patch
---
drivers/gpu/drm/i915/intel_display.c | 36 +++++++++++++++++++++++++++-------
1 file changed, 29 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c
b/drivers/gpu/drm/i915/intel_display.c
index b20d501..83b11c5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7771,9 +7771,9 @@ intel_modeset_check_state(struct drm_device *dev)
}
}
-int intel_set_mode(struct drm_crtc *crtc,
- struct drm_display_mode *mode,
- int x, int y, struct drm_framebuffer *fb)
+static int __intel_set_mode(struct drm_crtc *crtc,
+ struct drm_display_mode *mode,
+ int x, int y, struct drm_framebuffer *fb)
{
struct drm_device *dev = crtc->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -7863,18 +7863,33 @@ done:
if (ret && crtc->enabled) {
crtc->hwmode = *saved_hwmode;
crtc->mode = *saved_mode;
- } else {
- intel_modeset_check_state(dev);
}
out:
kfree(saved_mode);
return ret;
}
+int intel_set_mode(struct drm_crtc *crtc,
+ struct drm_display_mode *mode,
+ int x, int y, struct drm_framebuffer *fb)
+{
+ int ret;
+
+ ret = __intel_set_mode(crtc, mode, x, y, fb);
+
+ if (ret == 0)
+ intel_modeset_check_state(crtc->dev);
+
+ return ret;
+}
+
+
void intel_crtc_restore_mode(struct drm_crtc *crtc)
{
- intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, crtc->fb);
+ __intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, crtc->fb);
+
+ intel_modeset_check_state(crtc->dev);
}
#undef for_each_intel_crtc_masked
@@ -9172,8 +9187,15 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
}
if (force_restore) {
+ /*
+ * We need to use raw interfaces for restoring state to avoid
+ * checking (bogus) intermediate states.
+ */
for_each_pipe(pipe) {
- intel_crtc_restore_mode(dev_priv->pipe_to_crtc_mapping[pipe]);
+ struct drm_crtc *crtc =
+ dev_priv->pipe_to_crtc_mapping[pipe];
+ __intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y,
+ crtc->fb);
}
i915_redisable_vga(dev);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-10 17:27 ` Richard Cochran
2013-04-10 18:32 ` Tomas Melin
@ 2013-04-10 20:03 ` Daniel Vetter
2013-04-10 20:10 ` Daniel Vetter
2013-04-11 17:52 ` [Intel-gfx] " Richard Cochran
1 sibling, 2 replies; 15+ messages in thread
From: Daniel Vetter @ 2013-04-10 20:03 UTC (permalink / raw)
To: Richard Cochran
Cc: Intel Graphics Development, DRI Development, LKML, Dave Airlie,
Tomas Melin, Chris Wilson, stable
On Wed, Apr 10, 2013 at 7:27 PM, Richard Cochran
<richardcochran@gmail.com> wrote:
> On Wed, Apr 10, 2013 at 02:07:24PM +0200, Daniel Vetter wrote:
>>
>> It's written against drm-intel-next-queued at
>>
>> http://cgit.freedesktop.org/~danvet/drm-intel
>>
>> I've thought that it should apply pretty cleanly against older kernels,
>> too. Apparently it conflicts a bit in intel_modeset_setup_hw_state, you
>> can just do the s/intel_crtc_restore_mode/__intel_set_mode/ change
>> manually.
>
> I couldn't see right away how to fix it up, so I just compiled your
> drm-intel-next-queued plus this patch. If I close the netbook's lid
> and open it again, the screen is blank, no backlight, and the machine
> seems to be frozen.
>
> I think I can live with the warning.
That patch should crash at all, so this is not expected. Can you pls
check whether plain drm-intel-nightly is broken, too?
I'll quickly port the patch (in it's latest v3 version) to 3.9-rc
kernels for you to test.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-10 20:03 ` [Intel-gfx] " Daniel Vetter
@ 2013-04-10 20:10 ` Daniel Vetter
2013-04-11 17:52 ` [Intel-gfx] " Richard Cochran
1 sibling, 0 replies; 15+ messages in thread
From: Daniel Vetter @ 2013-04-10 20:10 UTC (permalink / raw)
To: Intel Graphics Development
Cc: DRI Development, LKML, Dave Airlie, Daniel Vetter, Tomas Melin,
Richard Cochran, Chris Wilson, stable
It will be only consistent once we've restored all the crtcs. Since a
bunch of other callers also want to just restore a single crtc, add a
boolean to disable checking only where it doesn't make sense.
Note that intel_modeset_setup_hw_state already has a call to
intel_modeset_check_state at the end, so we don't reduce the amount of
checking.
v2: Try harder not to create a big patch (Chris).
v3: Even smaller (still Chris). Also fix a trailing space.
v4: Rebased on top of 3.9-rc6.
References: https://lkml.org/lkml/2013/3/16/60
Cc: Tomas Melin <tomas.melin@iki.fi>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/gpu/drm/i915/intel_display.c | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b20d501..5f1eb50 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7771,9 +7771,9 @@ intel_modeset_check_state(struct drm_device *dev)
}
}
-int intel_set_mode(struct drm_crtc *crtc,
- struct drm_display_mode *mode,
- int x, int y, struct drm_framebuffer *fb)
+static int __intel_set_mode(struct drm_crtc *crtc,
+ struct drm_display_mode *mode,
+ int x, int y, struct drm_framebuffer *fb)
{
struct drm_device *dev = crtc->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -7863,8 +7863,6 @@ done:
if (ret && crtc->enabled) {
crtc->hwmode = *saved_hwmode;
crtc->mode = *saved_mode;
- } else {
- intel_modeset_check_state(dev);
}
out:
@@ -7872,6 +7870,20 @@ out:
return ret;
}
+int intel_set_mode(struct drm_crtc *crtc,
+ struct drm_display_mode *mode,
+ int x, int y, struct drm_framebuffer *fb)
+{
+ int ret;
+
+ ret = __intel_set_mode(crtc, mode, x, y, fb);
+
+ if (ret == 0)
+ intel_modeset_check_state(crtc->dev);
+
+ return ret;
+}
+
void intel_crtc_restore_mode(struct drm_crtc *crtc)
{
intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, crtc->fb);
@@ -9172,8 +9184,16 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
}
if (force_restore) {
+ /*
+ * We need to use raw interfaces for restoring state to avoid
+ * checking (bogus) intermediate states.
+ */
for_each_pipe(pipe) {
- intel_crtc_restore_mode(dev_priv->pipe_to_crtc_mapping[pipe]);
+ struct drm_crtc *crtc =
+ dev_priv->pipe_to_crtc_mapping[pipe];
+
+ __intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y,
+ crtc->fb);
}
i915_redisable_vga(dev);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-10 18:32 ` Tomas Melin
@ 2013-04-11 5:16 ` Tomas Melin
0 siblings, 0 replies; 15+ messages in thread
From: Tomas Melin @ 2013-04-11 5:16 UTC (permalink / raw)
To: Richard Cochran, daniel.vetter
Cc: Intel Graphics Development, DRI Development, LKML, Dave Airlie,
Chris Wilson, stable
On Wed, Apr 10, 2013 at 9:32 PM, Tomas Melin <tomas.melin@iki.fi> wrote:
> On Tue, Apr 9, 2013 at 10:51 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>> v2: Try harder not to create a big patch (Chris).
>>
> Tested the patch applied to 3.9-rc6. Atleast on my machine that
> helped, although once I managed to get the error (but not warning and
> call trace as before):
> [drm:i9xx_crtc_mode_set] *ERROR* Couldn't find PLL settings for mode!
>
Update: the situation where I still get an error is if the machine is
in standby with the lid open. Then close and open will generate that
kind of error. The patch however fixes the original problem.
thanks,
Tomas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-10 20:03 ` [Intel-gfx] " Daniel Vetter
2013-04-10 20:10 ` Daniel Vetter
@ 2013-04-11 17:52 ` Richard Cochran
2013-04-11 18:14 ` Daniel Vetter
1 sibling, 1 reply; 15+ messages in thread
From: Richard Cochran @ 2013-04-11 17:52 UTC (permalink / raw)
To: Daniel Vetter
Cc: Intel Graphics Development, DRI Development, LKML, Dave Airlie,
Tomas Melin, Chris Wilson, stable
On Wed, Apr 10, 2013 at 10:03:25PM +0200, Daniel Vetter wrote:
> That patch should crash at all, so this is not expected. Can you pls
> check whether plain drm-intel-nightly is broken, too?
I did try drm-intel-nightly just now (1dd83e3), and it also freezes
the machine. I first verified that the power button shutdown is
working (before starting X). Then, with X running, closing and
reopening the lid results in a blank screen (no backlight) and a
seemingly frozen box.
> I'll quickly port the patch (in it's latest v3 version) to 3.9-rc
> kernels for you to test.
Okay, I'll try this next.
Thanks,
Richard
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-11 17:52 ` [Intel-gfx] " Richard Cochran
@ 2013-04-11 18:14 ` Daniel Vetter
2013-04-11 18:37 ` Richard Cochran
2013-04-12 6:59 ` Richard Cochran
0 siblings, 2 replies; 15+ messages in thread
From: Daniel Vetter @ 2013-04-11 18:14 UTC (permalink / raw)
To: Richard Cochran
Cc: Intel Graphics Development, DRI Development, LKML, Dave Airlie,
Tomas Melin, Chris Wilson, stable
On Thu, Apr 11, 2013 at 7:52 PM, Richard Cochran
<richardcochran@gmail.com> wrote:
> On Wed, Apr 10, 2013 at 10:03:25PM +0200, Daniel Vetter wrote:
>
>> That patch should crash at all, so this is not expected. Can you pls
>> check whether plain drm-intel-nightly is broken, too?
>
> I did try drm-intel-nightly just now (1dd83e3), and it also freezes
> the machine. I first verified that the power button shutdown is
> working (before starting X). Then, with X running, closing and
> reopening the lid results in a blank screen (no backlight) and a
> seemingly frozen box.
I've just tracked down and fixed an bug which can lead to a hard-hang
in the crtc restore code (which is used both in the lid handler when
opening and on resume). If you could please test this patch (on top of
drm-intel-nightly):
https://patchwork.kernel.org/patch/2428971/
>> I'll quickly port the patch (in it's latest v3 version) to 3.9-rc
>> kernels for you to test.
>
> Okay, I'll try this next.
Thanks, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-09 19:51 ` [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring Daniel Vetter
2013-04-10 11:59 ` Richard Cochran
@ 2013-04-11 18:22 ` Daniel Vetter
2013-04-11 19:17 ` Chris Wilson
1 sibling, 1 reply; 15+ messages in thread
From: Daniel Vetter @ 2013-04-11 18:22 UTC (permalink / raw)
To: Intel Graphics Development
Cc: DRI Development, LKML, Dave Airlie, Daniel Vetter, Tomas Melin,
Richard Cochran, Chris Wilson, stable
It will be only consistent once we've restored all the crtcs. Since a
bunch of other callers also want to just restore a single crtc, add a
boolean to disable checking only where it doesn't make sense.
Note that intel_modeset_setup_hw_state already has a call to
intel_modeset_check_state at the end, so we don't reduce the amount of
checking.
v2: Try harder not to create a big patch (Chris).
v3: Even smaller (still Chris). Also fix a trailing space.
References: https://lkml.org/lkml/2013/3/16/60
Cc: Tomas Melin <tomas.melin@iki.fi>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
drivers/gpu/drm/i915/intel_display.c | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8809813..457a0a0 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7916,9 +7916,9 @@ intel_modeset_check_state(struct drm_device *dev)
}
}
-int intel_set_mode(struct drm_crtc *crtc,
- struct drm_display_mode *mode,
- int x, int y, struct drm_framebuffer *fb)
+static int __intel_set_mode(struct drm_crtc *crtc,
+ struct drm_display_mode *mode,
+ int x, int y, struct drm_framebuffer *fb)
{
struct drm_device *dev = crtc->dev;
drm_i915_private_t *dev_priv = dev->dev_private;
@@ -8012,8 +8012,6 @@ done:
if (ret && crtc->enabled) {
crtc->hwmode = *saved_hwmode;
crtc->mode = *saved_mode;
- } else {
- intel_modeset_check_state(dev);
}
out:
@@ -8022,6 +8020,20 @@ out:
return ret;
}
+int intel_set_mode(struct drm_crtc *crtc,
+ struct drm_display_mode *mode,
+ int x, int y, struct drm_framebuffer *fb)
+{
+ int ret;
+
+ ret = __intel_set_mode(crtc, mode, x, y, fb);
+
+ if (ret == 0)
+ intel_modeset_check_state(crtc->dev);
+
+ return ret;
+}
+
void intel_crtc_restore_mode(struct drm_crtc *crtc)
{
intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, crtc->fb);
@@ -9333,10 +9345,16 @@ setup_pipes:
}
if (force_restore) {
+ /*
+ * We need to use raw interfaces for restoring state to avoid
+ * checking (bogus) intermediate states.
+ */
for_each_pipe(pipe) {
struct drm_crtc *crtc =
dev_priv->pipe_to_crtc_mapping[pipe];
- intel_crtc_restore_mode(crtc);
+
+ __intel_set_mode(crtc, &crtc->mode, crtc->x, crtc->y,
+ crtc->fb);
}
list_for_each_entry(plane, &dev->mode_config.plane_list, head)
intel_plane_restore(plane);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-11 18:14 ` Daniel Vetter
@ 2013-04-11 18:37 ` Richard Cochran
2013-04-12 6:59 ` Richard Cochran
1 sibling, 0 replies; 15+ messages in thread
From: Richard Cochran @ 2013-04-11 18:37 UTC (permalink / raw)
To: Daniel Vetter
Cc: Intel Graphics Development, DRI Development, LKML, Dave Airlie,
Tomas Melin, Chris Wilson, stable
On Thu, Apr 11, 2013 at 08:14:10PM +0200, Daniel Vetter wrote:
>
> I've just tracked down and fixed an bug which can lead to a hard-hang
> in the crtc restore code (which is used both in the lid handler when
> opening and on resume). If you could please test this patch (on top of
> drm-intel-nightly):
>
> https://patchwork.kernel.org/patch/2428971/
Okay, will do.
> >> I'll quickly port the patch (in it's latest v3 version) to 3.9-rc
> >> kernels for you to test.
FWIW, this does work, no freeze, no warning, but instead:
Apr 11 20:30:49 netboy laptop-mode: Laptop mode
Apr 11 20:30:49 netboy laptop-mode: enabled,
Apr 11 20:30:49 netboy laptop-mode: not active [unchanged]
Apr 11 20:30:53 netboy kernel: [ 75.450783] [drm:i9xx_crtc_mode_set] *ERROR* Couldn't find PLL settings for mode!
Apr 11 20:30:53 netboy laptop-mode: Laptop mode
Apr 11 20:30:53 netboy laptop-mode: enabled,
Apr 11 20:30:53 netboy laptop-mode: not active [unchanged]
Thanks,
Richard
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-11 18:22 ` Daniel Vetter
@ 2013-04-11 19:17 ` Chris Wilson
2013-04-11 19:28 ` Daniel Vetter
0 siblings, 1 reply; 15+ messages in thread
From: Chris Wilson @ 2013-04-11 19:17 UTC (permalink / raw)
To: Daniel Vetter
Cc: Intel Graphics Development, DRI Development, LKML, Dave Airlie,
Tomas Melin, Richard Cochran, stable
On Thu, Apr 11, 2013 at 08:22:50PM +0200, Daniel Vetter wrote:
> It will be only consistent once we've restored all the crtcs. Since a
> bunch of other callers also want to just restore a single crtc, add a
> boolean to disable checking only where it doesn't make sense.
>
> Note that intel_modeset_setup_hw_state already has a call to
> intel_modeset_check_state at the end, so we don't reduce the amount of
> checking.
>
> v2: Try harder not to create a big patch (Chris).
>
> v3: Even smaller (still Chris). Also fix a trailing space.
>
> References: https://lkml.org/lkml/2013/3/16/60
> Cc: Tomas Melin <tomas.melin@iki.fi>
> Cc: Richard Cochran <richardcochran@gmail.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: stable@vger.kernel.org
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
I'm happy that you are not touching any paths other than mentioned in
the changelog, and that I think being quiet on the modeset is a good use
of the 'force' semantics, so
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-11 19:17 ` Chris Wilson
@ 2013-04-11 19:28 ` Daniel Vetter
0 siblings, 0 replies; 15+ messages in thread
From: Daniel Vetter @ 2013-04-11 19:28 UTC (permalink / raw)
To: Chris Wilson
Cc: Daniel Vetter, Intel Graphics Development, DRI Development, LKML,
Dave Airlie, Tomas Melin, Richard Cochran, stable
On Thu, Apr 11, 2013 at 08:17:42PM +0100, Chris Wilson wrote:
> On Thu, Apr 11, 2013 at 08:22:50PM +0200, Daniel Vetter wrote:
> > It will be only consistent once we've restored all the crtcs. Since a
> > bunch of other callers also want to just restore a single crtc, add a
> > boolean to disable checking only where it doesn't make sense.
> >
> > Note that intel_modeset_setup_hw_state already has a call to
> > intel_modeset_check_state at the end, so we don't reduce the amount of
> > checking.
> >
> > v2: Try harder not to create a big patch (Chris).
> >
> > v3: Even smaller (still Chris). Also fix a trailing space.
> >
> > References: https://lkml.org/lkml/2013/3/16/60
> > Cc: Tomas Melin <tomas.melin@iki.fi>
> > Cc: Richard Cochran <richardcochran@gmail.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> I'm happy that you are not touching any paths other than mentioned in
> the changelog, and that I think being quiet on the modeset is a good use
> of the 'force' semantics, so
>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Queued for -next, thanks for the review.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring
2013-04-11 18:14 ` Daniel Vetter
2013-04-11 18:37 ` Richard Cochran
@ 2013-04-12 6:59 ` Richard Cochran
1 sibling, 0 replies; 15+ messages in thread
From: Richard Cochran @ 2013-04-12 6:59 UTC (permalink / raw)
To: Daniel Vetter
Cc: Intel Graphics Development, DRI Development, LKML, Dave Airlie,
Tomas Melin, Chris Wilson, stable
On Thu, Apr 11, 2013 at 08:14:10PM +0200, Daniel Vetter wrote:
>
> I've just tracked down and fixed an bug which can lead to a hard-hang
> in the crtc restore code (which is used both in the lid handler when
> opening and on resume). If you could please test this patch (on top of
> drm-intel-nightly):
>
> https://patchwork.kernel.org/patch/2428971/
Now I can confirm this works fine, with no warnings, errors, or
freezes.
Thanks,
Richard
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2013-04-12 6:59 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20130409172820.GC27612@phenom.ffwll.local>
2013-04-09 19:51 ` [PATCH] drm/i915: don't check inconsistent modeset state when force-restoring Daniel Vetter
2013-04-10 11:59 ` Richard Cochran
2013-04-10 12:07 ` Daniel Vetter
2013-04-10 17:27 ` Richard Cochran
2013-04-10 18:32 ` Tomas Melin
2013-04-11 5:16 ` Tomas Melin
2013-04-10 20:03 ` [Intel-gfx] " Daniel Vetter
2013-04-10 20:10 ` Daniel Vetter
2013-04-11 17:52 ` [Intel-gfx] " Richard Cochran
2013-04-11 18:14 ` Daniel Vetter
2013-04-11 18:37 ` Richard Cochran
2013-04-12 6:59 ` Richard Cochran
2013-04-11 18:22 ` Daniel Vetter
2013-04-11 19:17 ` Chris Wilson
2013-04-11 19:28 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox