* [PATCH] drm/i915: Don't hardcode the number of pipes in the error state dump
@ 2012-08-15 16:57 Damien Lespiau
2012-08-15 17:00 ` Chris Wilson
0 siblings, 1 reply; 5+ messages in thread
From: Damien Lespiau @ 2012-08-15 16:57 UTC (permalink / raw)
To: intel-gfx
From: Damien Lespiau <damien.lespiau@intel.com>
New-ish devices have 3 pipes, so let's not just hardcode 2 but use the
for_each_pipe() macro and make struct intel_display_error_state is big
enough.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1d24d55..d4cfb31 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7470,7 +7470,7 @@ struct intel_display_error_state {
u32 position;
u32 base;
u32 size;
- } cursor[2];
+ } cursor[I915_MAX_PIPES];
struct intel_pipe_error_state {
u32 conf;
@@ -7482,7 +7482,7 @@ struct intel_display_error_state {
u32 vtotal;
u32 vblank;
u32 vsync;
- } pipe[2];
+ } pipe[I915_MAX_PIPES];
struct intel_plane_error_state {
u32 control;
@@ -7492,7 +7492,7 @@ struct intel_display_error_state {
u32 addr;
u32 surface;
u32 tile_offset;
- } plane[2];
+ } plane[I915_MAX_PIPES];
};
struct intel_display_error_state *
@@ -7506,7 +7506,7 @@ intel_display_capture_error_state(struct drm_device *dev)
if (error == NULL)
return NULL;
- for (i = 0; i < 2; i++) {
+ for_each_pipe(i) {
error->cursor[i].control = I915_READ(CURCNTR(i));
error->cursor[i].position = I915_READ(CURPOS(i));
error->cursor[i].base = I915_READ(CURBASE(i));
@@ -7539,9 +7539,10 @@ intel_display_print_error_state(struct seq_file *m,
struct drm_device *dev,
struct intel_display_error_state *error)
{
+ drm_i915_private_t *dev_priv = dev->dev_private;
int i;
- for (i = 0; i < 2; i++) {
+ for_each_pipe(i) {
seq_printf(m, "Pipe [%d]:\n", i);
seq_printf(m, " CONF: %08x\n", error->pipe[i].conf);
seq_printf(m, " SRC: %08x\n", error->pipe[i].source);
--
1.7.7.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Don't hardcode the number of pipes in the error state dump
2012-08-15 16:57 Damien Lespiau
@ 2012-08-15 17:00 ` Chris Wilson
0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2012-08-15 17:00 UTC (permalink / raw)
To: Damien Lespiau, intel-gfx
On Wed, 15 Aug 2012 17:57:36 +0100, Damien Lespiau <damien.lespiau@gmail.com> wrote:
> From: Damien Lespiau <damien.lespiau@intel.com>
>
> New-ish devices have 3 pipes, so let's not just hardcode 2 but use the
> for_each_pipe() macro and make struct intel_display_error_state is big
> enough.
Also add the number of pipes emitted to the error state, just in case
the decoder wants to be smart.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] drm/i915: Don't hardcode the number of pipes in the error state dump
@ 2012-08-15 18:23 Damien Lespiau
2012-08-15 18:42 ` Chris Wilson
0 siblings, 1 reply; 5+ messages in thread
From: Damien Lespiau @ 2012-08-15 18:23 UTC (permalink / raw)
To: intel-gfx
From: Damien Lespiau <damien.lespiau@intel.com>
New-ish devices have 3 pipes, so let's not just hardcode 2 but use the
for_each_pipe() macro and make struct intel_display_error_state is big
enough.
V2: Also add the number of pipes emitted (Chris Wilson)
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 1d24d55..28e463e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7470,7 +7470,7 @@ struct intel_display_error_state {
u32 position;
u32 base;
u32 size;
- } cursor[2];
+ } cursor[I915_MAX_PIPES];
struct intel_pipe_error_state {
u32 conf;
@@ -7482,7 +7482,7 @@ struct intel_display_error_state {
u32 vtotal;
u32 vblank;
u32 vsync;
- } pipe[2];
+ } pipe[I915_MAX_PIPES];
struct intel_plane_error_state {
u32 control;
@@ -7492,7 +7492,7 @@ struct intel_display_error_state {
u32 addr;
u32 surface;
u32 tile_offset;
- } plane[2];
+ } plane[I915_MAX_PIPES];
};
struct intel_display_error_state *
@@ -7506,7 +7506,7 @@ intel_display_capture_error_state(struct drm_device *dev)
if (error == NULL)
return NULL;
- for (i = 0; i < 2; i++) {
+ for_each_pipe(i) {
error->cursor[i].control = I915_READ(CURCNTR(i));
error->cursor[i].position = I915_READ(CURPOS(i));
error->cursor[i].base = I915_READ(CURBASE(i));
@@ -7539,9 +7539,11 @@ intel_display_print_error_state(struct seq_file *m,
struct drm_device *dev,
struct intel_display_error_state *error)
{
+ drm_i915_private_t *dev_priv = dev->dev_private;
int i;
- for (i = 0; i < 2; i++) {
+ seq_printf(m, "Num Pipes: %d\n", dev_priv->num_pipe);
+ for_each_pipe(i) {
seq_printf(m, "Pipe [%d]:\n", i);
seq_printf(m, " CONF: %08x\n", error->pipe[i].conf);
seq_printf(m, " SRC: %08x\n", error->pipe[i].source);
--
1.7.7.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Don't hardcode the number of pipes in the error state dump
2012-08-15 18:23 [PATCH] drm/i915: Don't hardcode the number of pipes in the error state dump Damien Lespiau
@ 2012-08-15 18:42 ` Chris Wilson
2012-08-15 22:40 ` Daniel Vetter
0 siblings, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2012-08-15 18:42 UTC (permalink / raw)
To: Damien Lespiau, intel-gfx
On Wed, 15 Aug 2012 19:23:25 +0100, Damien Lespiau <damien.lespiau@gmail.com> wrote:
> From: Damien Lespiau <damien.lespiau@intel.com>
>
> New-ish devices have 3 pipes, so let's not just hardcode 2 but use the
> for_each_pipe() macro and make struct intel_display_error_state is big
> enough.
>
> V2: Also add the number of pipes emitted (Chris Wilson)
>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
I guess next on your list will be adding some of the PCH register
states, along with a list of active encoders / connectors etc.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Don't hardcode the number of pipes in the error state dump
2012-08-15 18:42 ` Chris Wilson
@ 2012-08-15 22:40 ` Daniel Vetter
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2012-08-15 22:40 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
On Wed, Aug 15, 2012 at 07:42:15PM +0100, Chris Wilson wrote:
> On Wed, 15 Aug 2012 19:23:25 +0100, Damien Lespiau <damien.lespiau@gmail.com> wrote:
> > From: Damien Lespiau <damien.lespiau@intel.com>
> >
> > New-ish devices have 3 pipes, so let's not just hardcode 2 but use the
> > for_each_pipe() macro and make struct intel_display_error_state is big
> > enough.
> >
> > V2: Also add the number of pipes emitted (Chris Wilson)
> >
> > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Queued for -next, thanks for the patch.
> I guess next on your list will be adding some of the PCH register
> states, along with a list of active encoders / connectors etc.
I'm not sure that's worth it, at least usually the gt doesn't fall over
when we anger the pch ... Simply grabbing a register dump for interesting
configurations and comparing them worksforme.
-Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-08-15 22:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-15 18:23 [PATCH] drm/i915: Don't hardcode the number of pipes in the error state dump Damien Lespiau
2012-08-15 18:42 ` Chris Wilson
2012-08-15 22:40 ` Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2012-08-15 16:57 Damien Lespiau
2012-08-15 17:00 ` Chris Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox