Re: [Intel-gfx] [PATCH 1/2] drm/i915: Collect gtier properly on HSW.

2014-08-04 Thread Paulo Zanoni
2014-08-01 13:12 GMT-03:00 Rodrigo Vivi rodrigo.v...@intel.com:
 GTIER and DEIER doesn't have same interface on HSW so this or operation
 makes the information provided useless.

 v2: since we have gtier variable already let's split for everybody
 and avoid the strange | op.
 Also avoid overriding the value that was set for vlv. In this case I
 believe that we should reorganize the whole function, but I'll respect
 the comment that ask to not touch the order and let this organization
 work to be done later.
 v3: moving VLV check to the right place.

 Cc: Paulo Zanoni paulo.r.zan...@intel.com
 Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com

Reviewed-by: Paulo Zanoni paulo.r.zan...@intel.com

 ---
  drivers/gpu/drm/i915/i915_drv.h   |  1 +
  drivers/gpu/drm/i915/i915_gpu_error.c | 21 +++--
  2 files changed, 12 insertions(+), 10 deletions(-)

 diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
 index d604f4f..60227b2 100644
 --- a/drivers/gpu/drm/i915/i915_drv.h
 +++ b/drivers/gpu/drm/i915/i915_drv.h
 @@ -317,6 +317,7 @@ struct drm_i915_error_state {
 u32 eir;
 u32 pgtbl_er;
 u32 ier;
 +   u32 gtier;
 u32 ccid;
 u32 derrmr;
 u32 forcewake;
 diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c 
 b/drivers/gpu/drm/i915/i915_gpu_error.c
 index 0b3f694..c8f901f 100644
 --- a/drivers/gpu/drm/i915/i915_gpu_error.c
 +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
 @@ -359,6 +359,8 @@ int i915_error_state_to_str(struct 
 drm_i915_error_state_buf *m,
 err_printf(m, PCI ID: 0x%04x\n, dev-pdev-device);
 err_printf(m, EIR: 0x%08x\n, error-eir);
 err_printf(m, IER: 0x%08x\n, error-ier);
 +   if (HAS_PCH_SPLIT(dev) || IS_VALLEYVIEW(dev))
 +   err_printf(m, GTIER: 0x%08x\n, error-gtier);
 err_printf(m, PGTBL_ER: 0x%08x\n, error-pgtbl_er);
 err_printf(m, FORCEWAKE: 0x%08x\n, error-forcewake);
 err_printf(m, DERRMR: 0x%08x\n, error-derrmr);
 @@ -1102,7 +1104,8 @@ static void i915_capture_reg_state(struct 
 drm_i915_private *dev_priv,

 /* 1: Registers specific to a single generation */
 if (IS_VALLEYVIEW(dev)) {
 -   error-ier = I915_READ(GTIER) | I915_READ(VLV_IER);
 +   error-gtier = I915_READ(GTIER);
 +   error-ier = I915_READ(VLV_IER);
 error-forcewake = I915_READ(FORCEWAKE_VLV);
 }

 @@ -1135,16 +1138,14 @@ static void i915_capture_reg_state(struct 
 drm_i915_private *dev_priv,
 if (HAS_HW_CONTEXTS(dev))
 error-ccid = I915_READ(CCID);

 -   if (HAS_PCH_SPLIT(dev))
 -   error-ier = I915_READ(DEIER) | I915_READ(GTIER);
 -   else {
 -   if (IS_GEN2(dev))
 -   error-ier = I915_READ16(IER);
 -   else
 -   error-ier = I915_READ(IER);
 +   if (HAS_PCH_SPLIT(dev)) {
 +   error-ier = I915_READ(DEIER);
 +   error-gtier = I915_READ(GTIER);
 +   } else if (IS_GEN2(dev)) {
 +   error-ier = I915_READ16(IER);
 +   } else if (!IS_VALLEYVIEW(dev)) {
 +   error-ier = I915_READ(IER);
 }
 -
 -   /* 4: Everything else */
 error-eir = I915_READ(EIR);
 error-pgtbl_er = I915_READ(PGTBL_ER);

 --
 1.9.1

 ___
 Intel-gfx mailing list
 Intel-gfx@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 1/2] drm/i915: Collect gtier properly on HSW.

2014-08-01 Thread Rodrigo Vivi
GTIER and DEIER doesn't have same interface on HSW so this or operation
makes the information provided useless.

v2: since we have gtier variable already let's split for everybody
and avoid the strange | op.
Also avoid overriding the value that was set for vlv. In this case I
believe that we should reorganize the whole function, but I'll respect
the comment that ask to not touch the order and let this organization
work to be done later.

Cc: Paulo Zanoni paulo.r.zan...@intel.com
Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
---
 drivers/gpu/drm/i915/i915_drv.h   |  1 +
 drivers/gpu/drm/i915/i915_gpu_error.c | 24 ++--
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index d604f4f..60227b2 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -317,6 +317,7 @@ struct drm_i915_error_state {
u32 eir;
u32 pgtbl_er;
u32 ier;
+   u32 gtier;
u32 ccid;
u32 derrmr;
u32 forcewake;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c 
b/drivers/gpu/drm/i915/i915_gpu_error.c
index 0b3f694..76c67dd 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -359,6 +359,8 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf 
*m,
err_printf(m, PCI ID: 0x%04x\n, dev-pdev-device);
err_printf(m, EIR: 0x%08x\n, error-eir);
err_printf(m, IER: 0x%08x\n, error-ier);
+   if (HAS_PCH_SPLIT(dev) || IS_VALLEYVIEW(dev))
+   err_printf(m, GTIER: 0x%08x\n, error-gtier);
err_printf(m, PGTBL_ER: 0x%08x\n, error-pgtbl_er);
err_printf(m, FORCEWAKE: 0x%08x\n, error-forcewake);
err_printf(m, DERRMR: 0x%08x\n, error-derrmr);
@@ -1102,7 +1104,8 @@ static void i915_capture_reg_state(struct 
drm_i915_private *dev_priv,
 
/* 1: Registers specific to a single generation */
if (IS_VALLEYVIEW(dev)) {
-   error-ier = I915_READ(GTIER) | I915_READ(VLV_IER);
+   error-gtier = I915_READ(GTIER);
+   error-ier = I915_READ(VLV_IER);
error-forcewake = I915_READ(FORCEWAKE_VLV);
}
 
@@ -1135,17 +1138,18 @@ static void i915_capture_reg_state(struct 
drm_i915_private *dev_priv,
if (HAS_HW_CONTEXTS(dev))
error-ccid = I915_READ(CCID);
 
-   if (HAS_PCH_SPLIT(dev))
-   error-ier = I915_READ(DEIER) | I915_READ(GTIER);
-   else {
-   if (IS_GEN2(dev))
-   error-ier = I915_READ16(IER);
-   else
-   error-ier = I915_READ(IER);
+   if (HAS_PCH_SPLIT(dev)) {
+   error-ier = I915_READ(DEIER);
+   error-gtier = I915_READ(GTIER);
+   } else if (IS_GEN2(dev)) {
+   error-ier = I915_READ16(IER);
+   } else {
+   error-ier = I915_READ(IER);
}
 
-   /* 4: Everything else */
-   error-eir = I915_READ(EIR);
+   /* do not override what was set above for VLV */
+   if (!IS_VALLEYVIEW(dev))
+   error-eir = I915_READ(EIR);
error-pgtbl_er = I915_READ(PGTBL_ER);
 
i915_get_extra_instdone(dev, error-extra_instdone);
-- 
1.9.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/2] drm/i915: Collect gtier properly on HSW.

2014-08-01 Thread Paulo Zanoni
2014-08-01 6:13 GMT-03:00 Rodrigo Vivi rodrigo.v...@intel.com:
 GTIER and DEIER doesn't have same interface on HSW so this or operation
 makes the information provided useless.

 v2: since we have gtier variable already let's split for everybody
 and avoid the strange | op.
 Also avoid overriding the value that was set for vlv. In this case I
 believe that we should reorganize the whole function, but I'll respect
 the comment that ask to not touch the order and let this organization
 work to be done later.

 Cc: Paulo Zanoni paulo.r.zan...@intel.com
 Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
 ---
  drivers/gpu/drm/i915/i915_drv.h   |  1 +
  drivers/gpu/drm/i915/i915_gpu_error.c | 24 ++--
  2 files changed, 15 insertions(+), 10 deletions(-)

 diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
 index d604f4f..60227b2 100644
 --- a/drivers/gpu/drm/i915/i915_drv.h
 +++ b/drivers/gpu/drm/i915/i915_drv.h
 @@ -317,6 +317,7 @@ struct drm_i915_error_state {
 u32 eir;
 u32 pgtbl_er;
 u32 ier;
 +   u32 gtier;
 u32 ccid;
 u32 derrmr;
 u32 forcewake;
 diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c 
 b/drivers/gpu/drm/i915/i915_gpu_error.c
 index 0b3f694..76c67dd 100644
 --- a/drivers/gpu/drm/i915/i915_gpu_error.c
 +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
 @@ -359,6 +359,8 @@ int i915_error_state_to_str(struct 
 drm_i915_error_state_buf *m,
 err_printf(m, PCI ID: 0x%04x\n, dev-pdev-device);
 err_printf(m, EIR: 0x%08x\n, error-eir);
 err_printf(m, IER: 0x%08x\n, error-ier);
 +   if (HAS_PCH_SPLIT(dev) || IS_VALLEYVIEW(dev))
 +   err_printf(m, GTIER: 0x%08x\n, error-gtier);

Optional bikeshed: you could just check for Gen = 5 here.


 err_printf(m, PGTBL_ER: 0x%08x\n, error-pgtbl_er);
 err_printf(m, FORCEWAKE: 0x%08x\n, error-forcewake);
 err_printf(m, DERRMR: 0x%08x\n, error-derrmr);
 @@ -1102,7 +1104,8 @@ static void i915_capture_reg_state(struct 
 drm_i915_private *dev_priv,

 /* 1: Registers specific to a single generation */
 if (IS_VALLEYVIEW(dev)) {
 -   error-ier = I915_READ(GTIER) | I915_READ(VLV_IER);
 +   error-gtier = I915_READ(GTIER);
 +   error-ier = I915_READ(VLV_IER);
 error-forcewake = I915_READ(FORCEWAKE_VLV);
 }

 @@ -1135,17 +1138,18 @@ static void i915_capture_reg_state(struct 
 drm_i915_private *dev_priv,
 if (HAS_HW_CONTEXTS(dev))
 error-ccid = I915_READ(CCID);

 -   if (HAS_PCH_SPLIT(dev))
 -   error-ier = I915_READ(DEIER) | I915_READ(GTIER);
 -   else {
 -   if (IS_GEN2(dev))
 -   error-ier = I915_READ16(IER);
 -   else
 -   error-ier = I915_READ(IER);
 +   if (HAS_PCH_SPLIT(dev)) {
 +   error-ier = I915_READ(DEIER);
 +   error-gtier = I915_READ(GTIER);
 +   } else if (IS_GEN2(dev)) {
 +   error-ier = I915_READ16(IER);
 +   } else {
 +   error-ier = I915_READ(IER);

We're still overwriting VLV's IER here.

 }

 -   /* 4: Everything else */
 -   error-eir = I915_READ(EIR);
 +   /* do not override what was set above for VLV */
 +   if (!IS_VALLEYVIEW(dev))
 +   error-eir = I915_READ(EIR);

I don't see EIR being set above on VLV. It was IER, not EIR.


 error-pgtbl_er = I915_READ(PGTBL_ER);

 i915_get_extra_instdone(dev, error-extra_instdone);
 --
 1.9.1

 ___
 Intel-gfx mailing list
 Intel-gfx@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 1/2] drm/i915: Collect gtier properly on HSW.

2014-08-01 Thread Rodrigo Vivi
GTIER and DEIER doesn't have same interface on HSW so this or operation
makes the information provided useless.

v2: since we have gtier variable already let's split for everybody
and avoid the strange | op.
Also avoid overriding the value that was set for vlv. In this case I
believe that we should reorganize the whole function, but I'll respect
the comment that ask to not touch the order and let this organization
work to be done later.
v3: moving VLV check to the right place.

Cc: Paulo Zanoni paulo.r.zan...@intel.com
Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
---
 drivers/gpu/drm/i915/i915_drv.h   |  1 +
 drivers/gpu/drm/i915/i915_gpu_error.c | 21 +++--
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index d604f4f..60227b2 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -317,6 +317,7 @@ struct drm_i915_error_state {
u32 eir;
u32 pgtbl_er;
u32 ier;
+   u32 gtier;
u32 ccid;
u32 derrmr;
u32 forcewake;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c 
b/drivers/gpu/drm/i915/i915_gpu_error.c
index 0b3f694..c8f901f 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -359,6 +359,8 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf 
*m,
err_printf(m, PCI ID: 0x%04x\n, dev-pdev-device);
err_printf(m, EIR: 0x%08x\n, error-eir);
err_printf(m, IER: 0x%08x\n, error-ier);
+   if (HAS_PCH_SPLIT(dev) || IS_VALLEYVIEW(dev))
+   err_printf(m, GTIER: 0x%08x\n, error-gtier);
err_printf(m, PGTBL_ER: 0x%08x\n, error-pgtbl_er);
err_printf(m, FORCEWAKE: 0x%08x\n, error-forcewake);
err_printf(m, DERRMR: 0x%08x\n, error-derrmr);
@@ -1102,7 +1104,8 @@ static void i915_capture_reg_state(struct 
drm_i915_private *dev_priv,
 
/* 1: Registers specific to a single generation */
if (IS_VALLEYVIEW(dev)) {
-   error-ier = I915_READ(GTIER) | I915_READ(VLV_IER);
+   error-gtier = I915_READ(GTIER);
+   error-ier = I915_READ(VLV_IER);
error-forcewake = I915_READ(FORCEWAKE_VLV);
}
 
@@ -1135,16 +1138,14 @@ static void i915_capture_reg_state(struct 
drm_i915_private *dev_priv,
if (HAS_HW_CONTEXTS(dev))
error-ccid = I915_READ(CCID);
 
-   if (HAS_PCH_SPLIT(dev))
-   error-ier = I915_READ(DEIER) | I915_READ(GTIER);
-   else {
-   if (IS_GEN2(dev))
-   error-ier = I915_READ16(IER);
-   else
-   error-ier = I915_READ(IER);
+   if (HAS_PCH_SPLIT(dev)) {
+   error-ier = I915_READ(DEIER);
+   error-gtier = I915_READ(GTIER);
+   } else if (IS_GEN2(dev)) {
+   error-ier = I915_READ16(IER);
+   } else if (!IS_VALLEYVIEW(dev)) {
+   error-ier = I915_READ(IER);
}
-
-   /* 4: Everything else */
error-eir = I915_READ(EIR);
error-pgtbl_er = I915_READ(PGTBL_ER);
 
-- 
1.9.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/2] drm/i915: Collect gtier properly on HSW.

2014-07-30 Thread Paulo Zanoni
2014-07-28 12:19 GMT-03:00 Rodrigo Vivi rodrigo.v...@intel.com:
 GTIER and DEIER doesn't have same interface on HSW so this or operation
 makes the information provided useless.

 Cc: Paulo Zanoni paulo.r.zan...@intel.com
 Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
 ---
  drivers/gpu/drm/i915/i915_drv.h   |  1 +
  drivers/gpu/drm/i915/i915_gpu_error.c | 16 ++--
  2 files changed, 11 insertions(+), 6 deletions(-)

 diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
 index ef38c3b..ccb97f1 100644
 --- a/drivers/gpu/drm/i915/i915_drv.h
 +++ b/drivers/gpu/drm/i915/i915_drv.h
 @@ -314,6 +314,7 @@ struct drm_i915_error_state {
 u32 eir;
 u32 pgtbl_er;
 u32 ier;
 +   u32 gtier;
 u32 ccid;
 u32 derrmr;
 u32 forcewake;
 diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c 
 b/drivers/gpu/drm/i915/i915_gpu_error.c
 index 0b3f694..372fea3 100644
 --- a/drivers/gpu/drm/i915/i915_gpu_error.c
 +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
 @@ -359,6 +359,8 @@ int i915_error_state_to_str(struct 
 drm_i915_error_state_buf *m,
 err_printf(m, PCI ID: 0x%04x\n, dev-pdev-device);
 err_printf(m, EIR: 0x%08x\n, error-eir);
 err_printf(m, IER: 0x%08x\n, error-ier);
 +   if (IS_HASWELL(dev))
 +   err_printf(m, GTIER: 0x%08x\n, error-gtier);
 err_printf(m, PGTBL_ER: 0x%08x\n, error-pgtbl_er);
 err_printf(m, FORCEWAKE: 0x%08x\n, error-forcewake);
 err_printf(m, DERRMR: 0x%08x\n, error-derrmr);
 @@ -1135,13 +1137,15 @@ static void i915_capture_reg_state(struct 
 drm_i915_private *dev_priv,
 if (HAS_HW_CONTEXTS(dev))
 error-ccid = I915_READ(CCID);

 -   if (HAS_PCH_SPLIT(dev))
 +   if (IS_HASWELL(dev)) {
 +   error-ier = I915_READ(DEIER);
 +   error-gtier = I915_READ(GTIER);
 +   } else if (HAS_PCH_SPLIT(dev)) {
 error-ier = I915_READ(DEIER) | I915_READ(GTIER);

You did a change for HSW only, but we have these bits since Gen5. Why
don't you do this change for the whole HAS_PCH_SPLIT chunk instead of
adding a HSW-specific piece?

I am not a huge user of these error state files, I can't really think
why we would want to or the IER bits, so your patch looks correct to
me.


 -   else {
 -   if (IS_GEN2(dev))
 -   error-ier = I915_READ16(IER);
 -   else
 -   error-ier = I915_READ(IER);
 +   } else if (IS_GEN2(dev)) {
 +   error-ier = I915_READ16(IER);
 +   } else {
 +   error-ier = I915_READ(IER);

While reviewing your patch I also noticed that at the top of this
function we set error-ier for VLV, but then at this point we just
overwrite what was previously set. You could write another patch to
fix VLV too :)


 }

 /* 4: Everything else */
 --
 1.9.3

 ___
 Intel-gfx mailing list
 Intel-gfx@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 1/2] drm/i915: Collect gtier properly on HSW.

2014-07-30 Thread Rodrigo Vivi
On Wed, Jul 30, 2014 at 10:53 AM, Paulo Zanoni przan...@gmail.com wrote:

 2014-07-28 12:19 GMT-03:00 Rodrigo Vivi rodrigo.v...@intel.com:
  GTIER and DEIER doesn't have same interface on HSW so this or operation
  makes the information provided useless.
 
  Cc: Paulo Zanoni paulo.r.zan...@intel.com
  Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
  ---
   drivers/gpu/drm/i915/i915_drv.h   |  1 +
   drivers/gpu/drm/i915/i915_gpu_error.c | 16 ++--
   2 files changed, 11 insertions(+), 6 deletions(-)
 
  diff --git a/drivers/gpu/drm/i915/i915_drv.h
 b/drivers/gpu/drm/i915/i915_drv.h
  index ef38c3b..ccb97f1 100644
  --- a/drivers/gpu/drm/i915/i915_drv.h
  +++ b/drivers/gpu/drm/i915/i915_drv.h
  @@ -314,6 +314,7 @@ struct drm_i915_error_state {
  u32 eir;
  u32 pgtbl_er;
  u32 ier;
  +   u32 gtier;
  u32 ccid;
  u32 derrmr;
  u32 forcewake;
  diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c
 b/drivers/gpu/drm/i915/i915_gpu_error.c
  index 0b3f694..372fea3 100644
  --- a/drivers/gpu/drm/i915/i915_gpu_error.c
  +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
  @@ -359,6 +359,8 @@ int i915_error_state_to_str(struct
 drm_i915_error_state_buf *m,
  err_printf(m, PCI ID: 0x%04x\n, dev-pdev-device);
  err_printf(m, EIR: 0x%08x\n, error-eir);
  err_printf(m, IER: 0x%08x\n, error-ier);
  +   if (IS_HASWELL(dev))
  +   err_printf(m, GTIER: 0x%08x\n, error-gtier);
  err_printf(m, PGTBL_ER: 0x%08x\n, error-pgtbl_er);
  err_printf(m, FORCEWAKE: 0x%08x\n, error-forcewake);
  err_printf(m, DERRMR: 0x%08x\n, error-derrmr);
  @@ -1135,13 +1137,15 @@ static void i915_capture_reg_state(struct
 drm_i915_private *dev_priv,
  if (HAS_HW_CONTEXTS(dev))
  error-ccid = I915_READ(CCID);
 
  -   if (HAS_PCH_SPLIT(dev))
  +   if (IS_HASWELL(dev)) {
  +   error-ier = I915_READ(DEIER);
  +   error-gtier = I915_READ(GTIER);
  +   } else if (HAS_PCH_SPLIT(dev)) {
  error-ier = I915_READ(DEIER) | I915_READ(GTIER);

 You did a change for HSW only, but we have these bits since Gen5. Why
 don't you do this change for the whole HAS_PCH_SPLIT chunk instead of
 adding a HSW-specific piece?

 I am not a huge user of these error state files, I can't really think
 why we would want to or the IER bits, so your patch looks correct to
 me.


I believe before HSW they had the same interface both DEIR and GTIER, but
since I'm splitting it for HSW you are right we can split everywhere else
with or without common interface.




  -   else {
  -   if (IS_GEN2(dev))
  -   error-ier = I915_READ16(IER);
  -   else
  -   error-ier = I915_READ(IER);
  +   } else if (IS_GEN2(dev)) {
  +   error-ier = I915_READ16(IER);
  +   } else {
  +   error-ier = I915_READ(IER);

 While reviewing your patch I also noticed that at the top of this
 function we set error-ier for VLV, but then at this point we just
 overwrite what was previously set. You could write another patch to
 fix VLV too :)


Yeah, it is messy...  I'll also split for VLV and organize a bit to avoid
overwriting...




  }
 
  /* 4: Everything else */
  --
  1.9.3
 
  ___
  Intel-gfx mailing list
  Intel-gfx@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/intel-gfx



 --
 Paulo Zanoni
 ___
 Intel-gfx mailing list
 Intel-gfx@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/intel-gfx




-- 
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 1/2] drm/i915: Collect gtier properly on HSW.

2014-07-28 Thread Rodrigo Vivi
GTIER and DEIER doesn't have same interface on HSW so this or operation
makes the information provided useless.

Cc: Paulo Zanoni paulo.r.zan...@intel.com
Signed-off-by: Rodrigo Vivi rodrigo.v...@intel.com
---
 drivers/gpu/drm/i915/i915_drv.h   |  1 +
 drivers/gpu/drm/i915/i915_gpu_error.c | 16 ++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ef38c3b..ccb97f1 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -314,6 +314,7 @@ struct drm_i915_error_state {
u32 eir;
u32 pgtbl_er;
u32 ier;
+   u32 gtier;
u32 ccid;
u32 derrmr;
u32 forcewake;
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c 
b/drivers/gpu/drm/i915/i915_gpu_error.c
index 0b3f694..372fea3 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -359,6 +359,8 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf 
*m,
err_printf(m, PCI ID: 0x%04x\n, dev-pdev-device);
err_printf(m, EIR: 0x%08x\n, error-eir);
err_printf(m, IER: 0x%08x\n, error-ier);
+   if (IS_HASWELL(dev))
+   err_printf(m, GTIER: 0x%08x\n, error-gtier);
err_printf(m, PGTBL_ER: 0x%08x\n, error-pgtbl_er);
err_printf(m, FORCEWAKE: 0x%08x\n, error-forcewake);
err_printf(m, DERRMR: 0x%08x\n, error-derrmr);
@@ -1135,13 +1137,15 @@ static void i915_capture_reg_state(struct 
drm_i915_private *dev_priv,
if (HAS_HW_CONTEXTS(dev))
error-ccid = I915_READ(CCID);
 
-   if (HAS_PCH_SPLIT(dev))
+   if (IS_HASWELL(dev)) {
+   error-ier = I915_READ(DEIER);
+   error-gtier = I915_READ(GTIER);
+   } else if (HAS_PCH_SPLIT(dev)) {
error-ier = I915_READ(DEIER) | I915_READ(GTIER);
-   else {
-   if (IS_GEN2(dev))
-   error-ier = I915_READ16(IER);
-   else
-   error-ier = I915_READ(IER);
+   } else if (IS_GEN2(dev)) {
+   error-ier = I915_READ16(IER);
+   } else {
+   error-ier = I915_READ(IER);
}
 
/* 4: Everything else */
-- 
1.9.3

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx