* [PATCH] drm/i915: Check whether the output is running after completing the modeswitch
@ 2011-03-29 13:43 Chris Wilson
2011-03-29 16:48 ` Jesse Barnes
2011-03-29 17:07 ` Eric Anholt
0 siblings, 2 replies; 5+ messages in thread
From: Chris Wilson @ 2011-03-29 13:43 UTC (permalink / raw)
To: intel-gfx
Proof-of-concept sanity check to see if we did successfully enable the
pipe. Without a means of report back the error and forcibly reverting back
to the previous configuration, the error message is a little useless.
---
drivers/gpu/drm/i915/intel_display.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5c7385b..ac9050d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3161,7 +3161,22 @@ static void i9xx_crtc_prepare(struct drm_crtc *crtc)
static void i9xx_crtc_commit(struct drm_crtc *crtc)
{
+ struct drm_i915_private *dev_priv = crtc->dev->dev_private;
+ int pipe = to_intel_crtc(crtc)->pipe;
+
i9xx_crtc_enable(crtc);
+
+ if (INTEL_INFO(crtc->dev)->gen >= 4) {
+ u32 reg = PIPEDSL(pipe);
+ u32 line = I915_READ(reg);
+ if (wait_for(I915_READ(reg) != line, 50))
+ DRM_ERROR("failed to switch modes, output not running\n");
+ } else {
+ u32 reg = PIPEFRAMEPIXEL(pipe);
+ u32 pixel = I915_READ(reg) & PIPE_PIXEL_MASK;
+ if (wait_for((I915_READ(reg) & PIPE_PIXEL_MASK) != pixel, 50))
+ DRM_ERROR("failed to switch modes, output not running\n");
+ }
}
static void ironlake_crtc_prepare(struct drm_crtc *crtc)
@@ -3171,7 +3186,16 @@ static void ironlake_crtc_prepare(struct drm_crtc *crtc)
static void ironlake_crtc_commit(struct drm_crtc *crtc)
{
+ struct drm_i915_private *dev_priv = crtc->dev->dev_private;
+ int pipe = to_intel_crtc(crtc)->pipe;
+ u32 reg = PIPEDSL(pipe);
+ u32 line;
+
ironlake_crtc_enable(crtc);
+
+ line = I915_READ(reg);
+ if (wait_for(I915_READ(reg) != line, 50))
+ DRM_ERROR("failed to switch modes, output not running\n");
}
void intel_encoder_prepare (struct drm_encoder *encoder)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] drm/i915: Check whether the output is running after completing the modeswitch
2011-03-29 13:43 [PATCH] drm/i915: Check whether the output is running after completing the modeswitch Chris Wilson
@ 2011-03-29 16:48 ` Jesse Barnes
2011-03-29 16:58 ` Chris Wilson
2011-03-29 17:07 ` Eric Anholt
1 sibling, 1 reply; 5+ messages in thread
From: Jesse Barnes @ 2011-03-29 16:48 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Tue, 29 Mar 2011 14:43:46 +0100
Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Proof-of-concept sanity check to see if we did successfully enable the
> pipe. Without a means of report back the error and forcibly reverting back
> to the previous configuration, the error message is a little useless.
> ---
> drivers/gpu/drm/i915/intel_display.c | 24 ++++++++++++++++++++++++
> 1 files changed, 24 insertions(+), 0 deletions(-)
Still, it's a nice assertion at least.
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
--
Jesse Barnes, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Check whether the output is running after completing the modeswitch
2011-03-29 16:48 ` Jesse Barnes
@ 2011-03-29 16:58 ` Chris Wilson
0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2011-03-29 16:58 UTC (permalink / raw)
To: Jesse Barnes; +Cc: intel-gfx
On Tue, 29 Mar 2011 09:48:24 -0700, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> Still, it's a nice assertion at least.
It's a nice idea. But we need to wait much, much longer before even
trying...
Something to improve.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Check whether the output is running after completing the modeswitch
2011-03-29 13:43 [PATCH] drm/i915: Check whether the output is running after completing the modeswitch Chris Wilson
2011-03-29 16:48 ` Jesse Barnes
@ 2011-03-29 17:07 ` Eric Anholt
2011-03-29 17:17 ` Chris Wilson
1 sibling, 1 reply; 5+ messages in thread
From: Eric Anholt @ 2011-03-29 17:07 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
[-- Attachment #1.1: Type: text/plain, Size: 479 bytes --]
On Tue, 29 Mar 2011 14:43:46 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Proof-of-concept sanity check to see if we did successfully enable the
> pipe. Without a means of report back the error and forcibly reverting back
> to the previous configuration, the error message is a little useless.
I still like it -- it's something that could be watched for in testing,
at least. Did you find that some failures to successfully program modes
not incrementing scanlines?
[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Check whether the output is running after completing the modeswitch
2011-03-29 17:07 ` Eric Anholt
@ 2011-03-29 17:17 ` Chris Wilson
0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2011-03-29 17:17 UTC (permalink / raw)
To: Eric Anholt, intel-gfx
On Tue, 29 Mar 2011 10:07:45 -0700, Eric Anholt <eric@anholt.net> wrote:
> On Tue, 29 Mar 2011 14:43:46 +0100, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > Proof-of-concept sanity check to see if we did successfully enable the
> > pipe. Without a means of report back the error and forcibly reverting back
> > to the previous configuration, the error message is a little useless.
>
> I still like it -- it's something that could be watched for in testing,
> at least. Did you find that some failures to successfully program modes
> not incrementing scanlines?
The external DP at least seems to take some time before it is up and
running. Of course, that could also be an artefact of a bug within our
modesetting...
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-03-29 17:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-29 13:43 [PATCH] drm/i915: Check whether the output is running after completing the modeswitch Chris Wilson
2011-03-29 16:48 ` Jesse Barnes
2011-03-29 16:58 ` Chris Wilson
2011-03-29 17:07 ` Eric Anholt
2011-03-29 17:17 ` Chris Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox