Patch "drm: kirin: Revert "Fix for hikey620 display offset problem"" has been added to the 5.4-stable tree

2020-03-10 Thread gregkh


This is a note to let you know that I've just added the patch titled

drm: kirin: Revert "Fix for hikey620 display offset problem"

to the 5.4-stable tree which can be found at:

http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
 drm-kirin-revert-fix-for-hikey620-display-offset-problem.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let  know about it.


>From 1b79cfd99ff5127e6a143767b51694a527b3ea38 Mon Sep 17 00:00:00 2001
From: John Stultz 
Date: Tue, 3 Mar 2020 16:32:28 +
Subject: drm: kirin: Revert "Fix for hikey620 display offset problem"

From: John Stultz 

commit 1b79cfd99ff5127e6a143767b51694a527b3ea38 upstream.

This reverts commit ff57c6513820efe945b61863cf4a51b79f18b592.

With the commit ff57c6513820 ("drm: kirin: Fix for hikey620
display offset problem") we added support for handling LDI
overflows by resetting the hardware.

However, its been observed that when we do hit the LDI overflow
condition, the irq seems to be screaming, and we do nothing but
stream:
  [drm:ade_irq_handler [kirin_drm]] *ERROR* LDI underflow!
over and over to the screen

I've tried a few appraoches to avoid this, but none has yet
been successful and the cure here is worse then the original
disease, so revert this for now.

Cc: Xinliang Liu 
Cc: Rongrong Zou 
Cc: Xinwei Kong 
Cc: Chen Feng 
Cc: Sam Ravnborg 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel 
Fixes: ff57c6513820 ("drm: kirin: Fix for hikey620 display offset problem")
Signed-off-by: John Stultz 
Acked-by: Xinliang Liu 
Signed-off-by: Xinliang Liu 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20200303163228.52741-1-john.stu...@linaro.org
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h |1 -
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c |   20 
 2 files changed, 21 deletions(-)

--- a/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
@@ -83,7 +83,6 @@
 #define VSIZE_OFST 20
 #define LDI_INT_EN 0x741C
 #define FRAME_END_INT_EN_OFST  1
-#define UNDERFLOW_INT_EN_OFST  2
 #define LDI_CTRL   0x7420
 #define BPP_OFST   3
 #define DATA_GATE_EN   BIT(2)
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -46,7 +46,6 @@ struct ade_hw_ctx {
struct clk *media_noc_clk;
struct clk *ade_pix_clk;
struct reset_control *reset;
-   struct work_struct display_reset_wq;
bool power_on;
int irq;
 
@@ -136,7 +135,6 @@ static void ade_init(struct ade_hw_ctx *
 */
ade_update_bits(base + ADE_CTRL, FRM_END_START_OFST,
FRM_END_START_MASK, REG_EFFECTIVE_IN_ADEEN_FRMEND);
-   ade_update_bits(base + LDI_INT_EN, UNDERFLOW_INT_EN_OFST, MASK(1), 1);
 }
 
 static bool ade_crtc_mode_fixup(struct drm_crtc *crtc,
@@ -304,17 +302,6 @@ static void ade_crtc_disable_vblank(stru
MASK(1), 0);
 }
 
-static void drm_underflow_wq(struct work_struct *work)
-{
-   struct ade_hw_ctx *ctx = container_of(work, struct ade_hw_ctx,
- display_reset_wq);
-   struct drm_device *drm_dev = ctx->crtc->dev;
-   struct drm_atomic_state *state;
-
-   state = drm_atomic_helper_suspend(drm_dev);
-   drm_atomic_helper_resume(drm_dev, state);
-}
-
 static irqreturn_t ade_irq_handler(int irq, void *data)
 {
struct ade_hw_ctx *ctx = data;
@@ -331,12 +318,6 @@ static irqreturn_t ade_irq_handler(int i
MASK(1), 1);
drm_crtc_handle_vblank(crtc);
}
-   if (status & BIT(UNDERFLOW_INT_EN_OFST)) {
-   ade_update_bits(base + LDI_INT_CLR, UNDERFLOW_INT_EN_OFST,
-   MASK(1), 1);
-   DRM_ERROR("LDI underflow!");
-   schedule_work(>display_reset_wq);
-   }
 
return IRQ_HANDLED;
 }
@@ -919,7 +900,6 @@ static void *ade_hw_ctx_alloc(struct pla
if (ret)
return ERR_PTR(-EIO);
 
-   INIT_WORK(>display_reset_wq, drm_underflow_wq);
ctx->crtc = crtc;
 
return ctx;


Patches currently in stable-queue which might be from john.stu...@linaro.org are

queue-5.4/usb-dwc3-gadget-update-chain-bit-correctly-when-using-sg-list.patch
queue-5.4/drm-msm-fix-return-type-of-dsi_mgr_connector_mode_va.patch
queue-5.4/drm-kirin-revert-fix-for-hikey620-display-offset-problem.patch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Patch "drm: kirin: Revert "Fix for hikey620 display offset problem"" has been added to the 5.5-stable tree

2020-03-10 Thread gregkh


This is a note to let you know that I've just added the patch titled

drm: kirin: Revert "Fix for hikey620 display offset problem"

to the 5.5-stable tree which can be found at:

http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
 drm-kirin-revert-fix-for-hikey620-display-offset-problem.patch
and it can be found in the queue-5.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let  know about it.


>From 1b79cfd99ff5127e6a143767b51694a527b3ea38 Mon Sep 17 00:00:00 2001
From: John Stultz 
Date: Tue, 3 Mar 2020 16:32:28 +
Subject: drm: kirin: Revert "Fix for hikey620 display offset problem"

From: John Stultz 

commit 1b79cfd99ff5127e6a143767b51694a527b3ea38 upstream.

This reverts commit ff57c6513820efe945b61863cf4a51b79f18b592.

With the commit ff57c6513820 ("drm: kirin: Fix for hikey620
display offset problem") we added support for handling LDI
overflows by resetting the hardware.

However, its been observed that when we do hit the LDI overflow
condition, the irq seems to be screaming, and we do nothing but
stream:
  [drm:ade_irq_handler [kirin_drm]] *ERROR* LDI underflow!
over and over to the screen

I've tried a few appraoches to avoid this, but none has yet
been successful and the cure here is worse then the original
disease, so revert this for now.

Cc: Xinliang Liu 
Cc: Rongrong Zou 
Cc: Xinwei Kong 
Cc: Chen Feng 
Cc: Sam Ravnborg 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel 
Fixes: ff57c6513820 ("drm: kirin: Fix for hikey620 display offset problem")
Signed-off-by: John Stultz 
Acked-by: Xinliang Liu 
Signed-off-by: Xinliang Liu 
Link: 
https://patchwork.freedesktop.org/patch/msgid/20200303163228.52741-1-john.stu...@linaro.org
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h |1 -
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c |   20 
 2 files changed, 21 deletions(-)

--- a/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
@@ -83,7 +83,6 @@
 #define VSIZE_OFST 20
 #define LDI_INT_EN 0x741C
 #define FRAME_END_INT_EN_OFST  1
-#define UNDERFLOW_INT_EN_OFST  2
 #define LDI_CTRL   0x7420
 #define BPP_OFST   3
 #define DATA_GATE_EN   BIT(2)
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -46,7 +46,6 @@ struct ade_hw_ctx {
struct clk *media_noc_clk;
struct clk *ade_pix_clk;
struct reset_control *reset;
-   struct work_struct display_reset_wq;
bool power_on;
int irq;
 
@@ -136,7 +135,6 @@ static void ade_init(struct ade_hw_ctx *
 */
ade_update_bits(base + ADE_CTRL, FRM_END_START_OFST,
FRM_END_START_MASK, REG_EFFECTIVE_IN_ADEEN_FRMEND);
-   ade_update_bits(base + LDI_INT_EN, UNDERFLOW_INT_EN_OFST, MASK(1), 1);
 }
 
 static bool ade_crtc_mode_fixup(struct drm_crtc *crtc,
@@ -304,17 +302,6 @@ static void ade_crtc_disable_vblank(stru
MASK(1), 0);
 }
 
-static void drm_underflow_wq(struct work_struct *work)
-{
-   struct ade_hw_ctx *ctx = container_of(work, struct ade_hw_ctx,
- display_reset_wq);
-   struct drm_device *drm_dev = ctx->crtc->dev;
-   struct drm_atomic_state *state;
-
-   state = drm_atomic_helper_suspend(drm_dev);
-   drm_atomic_helper_resume(drm_dev, state);
-}
-
 static irqreturn_t ade_irq_handler(int irq, void *data)
 {
struct ade_hw_ctx *ctx = data;
@@ -331,12 +318,6 @@ static irqreturn_t ade_irq_handler(int i
MASK(1), 1);
drm_crtc_handle_vblank(crtc);
}
-   if (status & BIT(UNDERFLOW_INT_EN_OFST)) {
-   ade_update_bits(base + LDI_INT_CLR, UNDERFLOW_INT_EN_OFST,
-   MASK(1), 1);
-   DRM_ERROR("LDI underflow!");
-   schedule_work(>display_reset_wq);
-   }
 
return IRQ_HANDLED;
 }
@@ -919,7 +900,6 @@ static void *ade_hw_ctx_alloc(struct pla
if (ret)
return ERR_PTR(-EIO);
 
-   INIT_WORK(>display_reset_wq, drm_underflow_wq);
ctx->crtc = crtc;
 
return ctx;


Patches currently in stable-queue which might be from john.stu...@linaro.org are

queue-5.5/usb-dwc3-gadget-update-chain-bit-correctly-when-using-sg-list.patch
queue-5.5/drm-msm-fix-return-type-of-dsi_mgr_connector_mode_va.patch
queue-5.5/drm-kirin-revert-fix-for-hikey620-display-offset-problem.patch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: kirin: Revert "Fix for hikey620 display offset problem"

2020-03-05 Thread Xinliang Liu
On Wed, 4 Mar 2020 at 00:32, John Stultz  wrote:
>
> This reverts commit ff57c6513820efe945b61863cf4a51b79f18b592.
>
> With the commit ff57c6513820 ("drm: kirin: Fix for hikey620
> display offset problem") we added support for handling LDI
> overflows by resetting the hardware.
>
> However, its been observed that when we do hit the LDI overflow
> condition, the irq seems to be screaming, and we do nothing but
> stream:
>   [drm:ade_irq_handler [kirin_drm]] *ERROR* LDI underflow!
> over and over to the screen
>
> I've tried a few appraoches to avoid this, but none has yet
> been successful and the cure here is worse then the original
> disease, so revert this for now.

Sorry to hear that. Then it seems such underflow errors can't be
recovered via reset.
Anyway, for this patch
Acked-by: Xinliang Liu 

And applied to drm-misc .

-xinliang

>
> Cc: Xinliang Liu 
> Cc: Rongrong Zou 
> Cc: Xinwei Kong 
> Cc: Chen Feng 
> Cc: Sam Ravnborg 
> Cc: David Airlie 
> Cc: Daniel Vetter 
> Cc: dri-devel 
> Fixes: ff57c6513820 ("drm: kirin: Fix for hikey620 display offset problem")
> Signed-off-by: John Stultz 
> ---
>  .../gpu/drm/hisilicon/kirin/kirin_ade_reg.h   |  1 -
>  .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c   | 20 ---
>  2 files changed, 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h 
> b/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
> index 0da860200410..e2ac09894a6d 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
> @@ -83,7 +83,6 @@
>  #define VSIZE_OFST 20
>  #define LDI_INT_EN 0x741C
>  #define FRAME_END_INT_EN_OFST  1
> -#define UNDERFLOW_INT_EN_OFST  2
>  #define LDI_CTRL   0x7420
>  #define BPP_OFST   3
>  #define DATA_GATE_EN   BIT(2)
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c 
> b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> index 73cd28a6ea07..86000127d4ee 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> @@ -46,7 +46,6 @@ struct ade_hw_ctx {
> struct clk *media_noc_clk;
> struct clk *ade_pix_clk;
> struct reset_control *reset;
> -   struct work_struct display_reset_wq;
> bool power_on;
> int irq;
>
> @@ -136,7 +135,6 @@ static void ade_init(struct ade_hw_ctx *ctx)
>  */
> ade_update_bits(base + ADE_CTRL, FRM_END_START_OFST,
> FRM_END_START_MASK, REG_EFFECTIVE_IN_ADEEN_FRMEND);
> -   ade_update_bits(base + LDI_INT_EN, UNDERFLOW_INT_EN_OFST, MASK(1), 1);
>  }
>
>  static bool ade_crtc_mode_fixup(struct drm_crtc *crtc,
> @@ -304,17 +302,6 @@ static void ade_crtc_disable_vblank(struct drm_crtc 
> *crtc)
> MASK(1), 0);
>  }
>
> -static void drm_underflow_wq(struct work_struct *work)
> -{
> -   struct ade_hw_ctx *ctx = container_of(work, struct ade_hw_ctx,
> - display_reset_wq);
> -   struct drm_device *drm_dev = ctx->crtc->dev;
> -   struct drm_atomic_state *state;
> -
> -   state = drm_atomic_helper_suspend(drm_dev);
> -   drm_atomic_helper_resume(drm_dev, state);
> -}
> -
>  static irqreturn_t ade_irq_handler(int irq, void *data)
>  {
> struct ade_hw_ctx *ctx = data;
> @@ -331,12 +318,6 @@ static irqreturn_t ade_irq_handler(int irq, void *data)
> MASK(1), 1);
> drm_crtc_handle_vblank(crtc);
> }
> -   if (status & BIT(UNDERFLOW_INT_EN_OFST)) {
> -   ade_update_bits(base + LDI_INT_CLR, UNDERFLOW_INT_EN_OFST,
> -   MASK(1), 1);
> -   DRM_ERROR("LDI underflow!");
> -   schedule_work(>display_reset_wq);
> -   }
>
> return IRQ_HANDLED;
>  }
> @@ -919,7 +900,6 @@ static void *ade_hw_ctx_alloc(struct platform_device 
> *pdev,
> if (ret)
> return ERR_PTR(-EIO);
>
> -   INIT_WORK(>display_reset_wq, drm_underflow_wq);
> ctx->crtc = crtc;
>
> return ctx;
> --
> 2.17.1
>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: kirin: Revert "Fix for hikey620 display offset problem"

2020-03-05 Thread Xinliang Liu
On Wed, 4 Mar 2020 at 17:28, Xinliang Liu  wrote:
>
> On Wed, 4 Mar 2020 at 00:32, John Stultz  wrote:
> >
> > This reverts commit ff57c6513820efe945b61863cf4a51b79f18b592.
> >
> > With the commit ff57c6513820 ("drm: kirin: Fix for hikey620
> > display offset problem") we added support for handling LDI
> > overflows by resetting the hardware.
> >
> > However, its been observed that when we do hit the LDI overflow
> > condition, the irq seems to be screaming, and we do nothing but
> > stream:
> >   [drm:ade_irq_handler [kirin_drm]] *ERROR* LDI underflow!
> > over and over to the screen
> >
> > I've tried a few appraoches to avoid this, but none has yet
> > been successful and the cure here is worse then the original
> > disease, so revert this for now.
>
> Sorry to hear that. Then it seems such underflow errors can't be
> recovered via reset.
> Anyway, for this patch
> Acked-by: Xinliang Liu 

Sorry , should be:
 Acked-by: Xinliang Liu 

>
> And applied to drm-misc .
>
> -xinliang
>
> >
> > Cc: Xinliang Liu 
> > Cc: Rongrong Zou 
> > Cc: Xinwei Kong 
> > Cc: Chen Feng 
> > Cc: Sam Ravnborg 
> > Cc: David Airlie 
> > Cc: Daniel Vetter 
> > Cc: dri-devel 
> > Fixes: ff57c6513820 ("drm: kirin: Fix for hikey620 display offset problem")
> > Signed-off-by: John Stultz 
> > ---
> >  .../gpu/drm/hisilicon/kirin/kirin_ade_reg.h   |  1 -
> >  .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c   | 20 ---
> >  2 files changed, 21 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h 
> > b/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
> > index 0da860200410..e2ac09894a6d 100644
> > --- a/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
> > +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
> > @@ -83,7 +83,6 @@
> >  #define VSIZE_OFST 20
> >  #define LDI_INT_EN 0x741C
> >  #define FRAME_END_INT_EN_OFST  1
> > -#define UNDERFLOW_INT_EN_OFST  2
> >  #define LDI_CTRL   0x7420
> >  #define BPP_OFST   3
> >  #define DATA_GATE_EN   BIT(2)
> > diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c 
> > b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> > index 73cd28a6ea07..86000127d4ee 100644
> > --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> > +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> > @@ -46,7 +46,6 @@ struct ade_hw_ctx {
> > struct clk *media_noc_clk;
> > struct clk *ade_pix_clk;
> > struct reset_control *reset;
> > -   struct work_struct display_reset_wq;
> > bool power_on;
> > int irq;
> >
> > @@ -136,7 +135,6 @@ static void ade_init(struct ade_hw_ctx *ctx)
> >  */
> > ade_update_bits(base + ADE_CTRL, FRM_END_START_OFST,
> > FRM_END_START_MASK, REG_EFFECTIVE_IN_ADEEN_FRMEND);
> > -   ade_update_bits(base + LDI_INT_EN, UNDERFLOW_INT_EN_OFST, MASK(1), 
> > 1);
> >  }
> >
> >  static bool ade_crtc_mode_fixup(struct drm_crtc *crtc,
> > @@ -304,17 +302,6 @@ static void ade_crtc_disable_vblank(struct drm_crtc 
> > *crtc)
> > MASK(1), 0);
> >  }
> >
> > -static void drm_underflow_wq(struct work_struct *work)
> > -{
> > -   struct ade_hw_ctx *ctx = container_of(work, struct ade_hw_ctx,
> > - display_reset_wq);
> > -   struct drm_device *drm_dev = ctx->crtc->dev;
> > -   struct drm_atomic_state *state;
> > -
> > -   state = drm_atomic_helper_suspend(drm_dev);
> > -   drm_atomic_helper_resume(drm_dev, state);
> > -}
> > -
> >  static irqreturn_t ade_irq_handler(int irq, void *data)
> >  {
> > struct ade_hw_ctx *ctx = data;
> > @@ -331,12 +318,6 @@ static irqreturn_t ade_irq_handler(int irq, void *data)
> > MASK(1), 1);
> > drm_crtc_handle_vblank(crtc);
> > }
> > -   if (status & BIT(UNDERFLOW_INT_EN_OFST)) {
> > -   ade_update_bits(base + LDI_INT_CLR, UNDERFLOW_INT_EN_OFST,
> > -   MASK(1), 1);
> > -   DRM_ERROR("LDI underflow!");
> > -   schedule_work(>display_reset_wq);
> > -   }
> >
> > return IRQ_HANDLED;
> >  }
> > @@ -919,7 +900,6 @@ static void *ade_hw_ctx_alloc(struct platform_device 
> > *pdev,
> > if (ret)
> > return ERR_PTR(-EIO);
> >
> > -   INIT_WORK(>display_reset_wq, drm_underflow_wq);
> > ctx->crtc = crtc;
> >
> > return ctx;
> > --
> > 2.17.1
> >
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm: kirin: Revert "Fix for hikey620 display offset problem"

2020-03-03 Thread John Stultz
This reverts commit ff57c6513820efe945b61863cf4a51b79f18b592.

With the commit ff57c6513820 ("drm: kirin: Fix for hikey620
display offset problem") we added support for handling LDI
overflows by resetting the hardware.

However, its been observed that when we do hit the LDI overflow
condition, the irq seems to be screaming, and we do nothing but
stream:
  [drm:ade_irq_handler [kirin_drm]] *ERROR* LDI underflow!
over and over to the screen

I've tried a few appraoches to avoid this, but none has yet
been successful and the cure here is worse then the original
disease, so revert this for now.

Cc: Xinliang Liu 
Cc: Rongrong Zou 
Cc: Xinwei Kong 
Cc: Chen Feng 
Cc: Sam Ravnborg 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel 
Fixes: ff57c6513820 ("drm: kirin: Fix for hikey620 display offset problem")
Signed-off-by: John Stultz 
---
 .../gpu/drm/hisilicon/kirin/kirin_ade_reg.h   |  1 -
 .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c   | 20 ---
 2 files changed, 21 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h 
b/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
index 0da860200410..e2ac09894a6d 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
@@ -83,7 +83,6 @@
 #define VSIZE_OFST 20
 #define LDI_INT_EN 0x741C
 #define FRAME_END_INT_EN_OFST  1
-#define UNDERFLOW_INT_EN_OFST  2
 #define LDI_CTRL   0x7420
 #define BPP_OFST   3
 #define DATA_GATE_EN   BIT(2)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c 
b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
index 73cd28a6ea07..86000127d4ee 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -46,7 +46,6 @@ struct ade_hw_ctx {
struct clk *media_noc_clk;
struct clk *ade_pix_clk;
struct reset_control *reset;
-   struct work_struct display_reset_wq;
bool power_on;
int irq;
 
@@ -136,7 +135,6 @@ static void ade_init(struct ade_hw_ctx *ctx)
 */
ade_update_bits(base + ADE_CTRL, FRM_END_START_OFST,
FRM_END_START_MASK, REG_EFFECTIVE_IN_ADEEN_FRMEND);
-   ade_update_bits(base + LDI_INT_EN, UNDERFLOW_INT_EN_OFST, MASK(1), 1);
 }
 
 static bool ade_crtc_mode_fixup(struct drm_crtc *crtc,
@@ -304,17 +302,6 @@ static void ade_crtc_disable_vblank(struct drm_crtc *crtc)
MASK(1), 0);
 }
 
-static void drm_underflow_wq(struct work_struct *work)
-{
-   struct ade_hw_ctx *ctx = container_of(work, struct ade_hw_ctx,
- display_reset_wq);
-   struct drm_device *drm_dev = ctx->crtc->dev;
-   struct drm_atomic_state *state;
-
-   state = drm_atomic_helper_suspend(drm_dev);
-   drm_atomic_helper_resume(drm_dev, state);
-}
-
 static irqreturn_t ade_irq_handler(int irq, void *data)
 {
struct ade_hw_ctx *ctx = data;
@@ -331,12 +318,6 @@ static irqreturn_t ade_irq_handler(int irq, void *data)
MASK(1), 1);
drm_crtc_handle_vblank(crtc);
}
-   if (status & BIT(UNDERFLOW_INT_EN_OFST)) {
-   ade_update_bits(base + LDI_INT_CLR, UNDERFLOW_INT_EN_OFST,
-   MASK(1), 1);
-   DRM_ERROR("LDI underflow!");
-   schedule_work(>display_reset_wq);
-   }
 
return IRQ_HANDLED;
 }
@@ -919,7 +900,6 @@ static void *ade_hw_ctx_alloc(struct platform_device *pdev,
if (ret)
return ERR_PTR(-EIO);
 
-   INIT_WORK(>display_reset_wq, drm_underflow_wq);
ctx->crtc = crtc;
 
return ctx;
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm: kirin: Revert "Fix for hikey620 display offset problem"

2020-02-18 Thread John Stultz
This reverts commit ff57c6513820efe945b61863cf4a51b79f18b592.

With the commit ff57c6513820 ("drm: kirin: Fix for hikey620
display offset problem") we added support for handling LDI
overflows by resetting the hardware.

However, its been observed that when we do hit the LDI overflow
condition, the irq seems to be screaming, and we do nothing but
stream:
  [drm:ade_irq_handler [kirin_drm]] *ERROR* LDI underflow!
over and over to the screen

I've tried a few appraoches to avoid this, but none has yet
been successful and the cure here is worse then the original
disease, so revert this for now.

Cc: Xinliang Liu 
Cc: Rongrong Zou 
Cc: Xinwei Kong 
Cc: Chen Feng 
Cc: Sam Ravnborg 
Cc: David Airlie 
Cc: Daniel Vetter 
Cc: dri-devel 
Fixes: ff57c6513820 ("drm: kirin: Fix for hikey620 display offset problem")
Signed-off-by: John Stultz 
---
 .../gpu/drm/hisilicon/kirin/kirin_ade_reg.h   |  1 -
 .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c   | 20 ---
 2 files changed, 21 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h 
b/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
index 0da860200410..e2ac09894a6d 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h
@@ -83,7 +83,6 @@
 #define VSIZE_OFST 20
 #define LDI_INT_EN 0x741C
 #define FRAME_END_INT_EN_OFST  1
-#define UNDERFLOW_INT_EN_OFST  2
 #define LDI_CTRL   0x7420
 #define BPP_OFST   3
 #define DATA_GATE_EN   BIT(2)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c 
b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
index 73cd28a6ea07..86000127d4ee 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -46,7 +46,6 @@ struct ade_hw_ctx {
struct clk *media_noc_clk;
struct clk *ade_pix_clk;
struct reset_control *reset;
-   struct work_struct display_reset_wq;
bool power_on;
int irq;
 
@@ -136,7 +135,6 @@ static void ade_init(struct ade_hw_ctx *ctx)
 */
ade_update_bits(base + ADE_CTRL, FRM_END_START_OFST,
FRM_END_START_MASK, REG_EFFECTIVE_IN_ADEEN_FRMEND);
-   ade_update_bits(base + LDI_INT_EN, UNDERFLOW_INT_EN_OFST, MASK(1), 1);
 }
 
 static bool ade_crtc_mode_fixup(struct drm_crtc *crtc,
@@ -304,17 +302,6 @@ static void ade_crtc_disable_vblank(struct drm_crtc *crtc)
MASK(1), 0);
 }
 
-static void drm_underflow_wq(struct work_struct *work)
-{
-   struct ade_hw_ctx *ctx = container_of(work, struct ade_hw_ctx,
- display_reset_wq);
-   struct drm_device *drm_dev = ctx->crtc->dev;
-   struct drm_atomic_state *state;
-
-   state = drm_atomic_helper_suspend(drm_dev);
-   drm_atomic_helper_resume(drm_dev, state);
-}
-
 static irqreturn_t ade_irq_handler(int irq, void *data)
 {
struct ade_hw_ctx *ctx = data;
@@ -331,12 +318,6 @@ static irqreturn_t ade_irq_handler(int irq, void *data)
MASK(1), 1);
drm_crtc_handle_vblank(crtc);
}
-   if (status & BIT(UNDERFLOW_INT_EN_OFST)) {
-   ade_update_bits(base + LDI_INT_CLR, UNDERFLOW_INT_EN_OFST,
-   MASK(1), 1);
-   DRM_ERROR("LDI underflow!");
-   schedule_work(>display_reset_wq);
-   }
 
return IRQ_HANDLED;
 }
@@ -919,7 +900,6 @@ static void *ade_hw_ctx_alloc(struct platform_device *pdev,
if (ret)
return ERR_PTR(-EIO);
 
-   INIT_WORK(>display_reset_wq, drm_underflow_wq);
ctx->crtc = crtc;
 
return ctx;
-- 
2.17.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel