drm: mxsfb: Enable recovery on underflow
Subsystems (4)
Marek Vasut
maintainerPATCH 1/1 drm: mxsfb: Enable recovery on underflow
There is some sort of corner case behavior of the controller, which could rarely be triggered at least on i.MX6SX connected to 800x480 DPI panel and i.MX8MM connected to DPI->DSI->LVDS bridged 1920x1080 panel (and likely on other setups too), where the image on the panel shifts to the right and wraps around. This happens either when the controller is enabled on boot or even later during run time. The condition does not correct itself automatically, i.e. the display image remains shifted.
It seems this problem is known and is due to sporadic underflows of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow IRQs, neither of the IRQs trigger and neither IRQ status bit is asserted when this condition occurs.
All known revisions of the LCDIF IP have CTRL1 RECOVER_ON_UNDERFLOW bit, which is described in the reference manual since i.MX23 as "
Set this bit to enable the LCDIF block to recover in the next field/frame if there was an underflow in the current field/frame.
"
Enable this bit to mitigate the sporadic underflows.
--- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 29 +++++++++++++++++++++++++++++ drivers/gpu/drm/mxsfb/mxsfb_regs.h | 1 + 2 files changed, 30 insertions(+)
drivers/gpu/drm/mxsfb/mxsfb_kms.c +29 -0
@@ -115,6 +115,35 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) reg |=VDCTRL4_SYNC_SIGNALS_ON ;writel (reg, mxsfb->base +LCDC_VDCTRL4 ); +/* +* Enable recovery on underflow. +* +* There is some sort of corner case behavior of the controller, +* which could rarely be triggered at least on i.MX6SX connected +* to 800x480 DPI panel and i.MX8MM connected to DPI->DSI->LVDS +* bridged 1920x1080 panel (and likely on other setups too), where +* the image on the panel shifts to the right and wraps around. +* This happens either when the controller is enabled on boot or +* even later during run time. The condition does not correct +* itself automatically, i.e. the display image remains shifted. +* +* It seems this problem is known and is due to sporadic underflows +* of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow +* IRQs, neither of the IRQs trigger and neither IRQ status bit is +* asserted when this condition occurs. +* +* All known revisions of the LCDIF IP have CTRL1 RECOVER_ON_UNDERFLOW +* bit, which is described in the reference manual since i.MX23 as +* " +* Set this bit to enable the LCDIF block to recover in the next +* field/frame if there was an underflow in the current field/frame. +* " +* Enable this bit to mitigate the sporadic underflows. +*/ + reg =readl (mxsfb->base +LCDC_CTRL1 ); + reg |=CTRL1_RECOVER_ON_UNDERFLOW ; +writel (reg, mxsfb->base +LCDC_CTRL1 ); +writel (CTRL_RUN , mxsfb->base +LCDC_CTRL +REG_SET ); }
drivers/gpu/drm/mxsfb/mxsfb_regs.h +1 -0
@@ -54,6 +54,7 @@#define CTRL_DF24 BIT(1)#define CTRL_RUN BIT(0) +#define CTRL1_RECOVER_ON_UNDERFLOW BIT(24)#define CTRL1_FIFO_CLEAR BIT(21)#define CTRL1_SET_BYTE_PACKAGING (x) (((x) & 0xf) << 16)#define CTRL1_GET_BYTE_PACKAGING (x) (((x) >> 16) & 0xf)
Signature · 1 line
2.30.2
Am Montag, dem 21.06.2021 um 00:47 +0200 schrieb Marek Vasut:
Quoted 22 lines
There is some sort of corner case behavior of the controller, which could rarely be triggered at least on i.MX6SX connected to 800x480 DPI panel and i.MX8MM connected to
DPI->DSI->LVDSbridged 1920x1080 panel (and likely on other setups too), where the image on the panel shifts to the right and wraps around. This happens either when the controller is enabled on boot or even later during run time. The condition does not correct itself automatically, i.e. the display image remains shifted.It seems this problem is known and is due to sporadic underflows of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow IRQs, neither of the IRQs trigger and neither IRQ status bit is asserted when this condition occurs.
All known revisions of the LCDIF IP have CTRL1
RECOVER_ON_UNDERFLOWbit, which is described in the reference manual since i.MX23 as "
Set this bit to enable the LCDIF block to recover in the next field/frame if there was an underflow in the current field/frame.
"
Enable this bit to mitigate the sporadic underflows.
Quoted 2 lines
Fixes 45d59d704080 ("drm: Add new driver for MXSFB controller")Signed-off-by Marek Vasut <[email protected]>
Quoted 62 lines
Cc Daniel Abrecht <[email protected]>Cc Emil Velikov <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Lucas Stach <[email protected]>Cc Stefan Agner <[email protected]>--- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 29 +++++++++++++++++++++++++++++ drivers/gpu/drm/mxsfb/mxsfb_regs.h | 1 + 2 files changed, 30 insertions(+)drivers/gpu/drm/mxsfb/mxsfb_kms.c +29
-0@@ -115,6 +115,35 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) reg |=VDCTRL4_SYNC_SIGNALS_ON ;writel (reg, mxsfb->base +LCDC_VDCTRL4 ); +/* +* Enable recovery on underflow. +* +* There is some sort of corner case behavior of the controller, +* which could rarely be triggered at least on i.MX6SX connected +* to 800x480 DPI panel and i.MX8MM connected to DPI->DSI->LVDS +* bridged 1920x1080 panel (and likely on other setups too), where +* the image on the panel shifts to the right and wraps around. +* This happens either when the controller is enabled on boot or +* even later during run time. The condition does not correct +* itself automatically, i.e. the display image remains shifted. +* +* It seems this problem is known and is due to sporadic underflows +* of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow +* IRQs, neither of the IRQs trigger and neither IRQ status bit is +* asserted when this condition occurs. +* +* All known revisions of the LCDIF IP have CTRL1 RECOVER_ON_UNDERFLOW +* bit, which is described in the reference manual since i.MX23 as +* " +* Set this bit to enable the LCDIF block to recover in the next +* field/frame if there was an underflow in the current field/frame. +* " +* Enable this bit to mitigate the sporadic underflows. +*/ + reg =readl (mxsfb->base +LCDC_CTRL1 ); + reg |=CTRL1_RECOVER_ON_UNDERFLOW ; +writel (reg, mxsfb->base +LCDC_CTRL1 ); +writel (CTRL_RUN , mxsfb->base +LCDC_CTRL +REG_SET ); }drivers/gpu/drm/mxsfb/mxsfb_regs.h +1
-0@@ -54,6 +54,7 @@#define CTRL_DF24 BIT(1)#define CTRL_RUN BIT(0) +#define CTRL1_RECOVER_ON_UNDERFLOW BIT(24)#define CTRL1_FIFO_CLEAR BIT(21)#define CTRL1_SET_BYTE_PACKAGING (x) (((x) & 0xf) << 16)#define CTRL1_GET_BYTE_PACKAGING (x) (((x) >> 16) & 0xf)
Hi Marek,
Thank you for the patch.
Quoted 60 lines · Marek Vasut
There is some sort of corner case behavior of the controller, which could rarely be triggered at least on i.MX6SX connected to 800x480 DPI panel and i.MX8MM connected to
DPI->DSI->LVDSbridged 1920x1080 panel (and likely on other setups too), where the image on the panel shifts to the right and wraps around. This happens either when the controller is enabled on boot or even later during run time. The condition does not correct itself automatically, i.e. the display image remains shifted.It seems this problem is known and is due to sporadic underflows of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow IRQs, neither of the IRQs trigger and neither IRQ status bit is asserted when this condition occurs.
All known revisions of the LCDIF IP have CTRL1
RECOVER_ON_UNDERFLOWbit, which is described in the reference manual since i.MX23 as "
Set this bit to enable the LCDIF block to recover in the next field/frame if there was an underflow in the current field/frame.
"
Enable this bit to mitigate the sporadic underflows.Fixes 45d59d704080 ("drm: Add new driver for MXSFB controller")Signed-off-by Marek Vasut <[email protected]>Cc Daniel Abrecht <[email protected]>Cc Emil Velikov <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Lucas Stach <[email protected]>Cc Stefan Agner <[email protected]>--- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 29 +++++++++++++++++++++++++++++ drivers/gpu/drm/mxsfb/mxsfb_regs.h | 1 + 2 files changed, 30 insertions(+)drivers/gpu/drm/mxsfb/mxsfb_kms.c +18
-0@@ -115,6 +115,35 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) reg |=VDCTRL4_SYNC_SIGNALS_ON ;writel (reg, mxsfb->base +LCDC_VDCTRL4 ); +/* +* Enable recovery on underflow. +* +* There is some sort of corner case behavior of the controller, +* which could rarely be triggered at least on i.MX6SX connected +* to 800x480 DPI panel and i.MX8MM connected to DPI->DSI->LVDS +* bridged 1920x1080 panel (and likely on other setups too), where +* the image on the panel shifts to the right and wraps around. +* This happens either when the controller is enabled on boot or +* even later during run time. The condition does not correct +* itself automatically, i.e. the display image remains shifted. +* +* It seems this problem is known and is due to sporadic underflows +* of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow +* IRQs, neither of the IRQs trigger and neither IRQ status bit is +* asserted when this condition occurs. +* +* All known revisions of the LCDIF IP have CTRL1 RECOVER_ON_UNDERFLOW
drivers/gpu/drm/mxsfb/mxsfb_kms.c static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) · line 145
Quoted 10 lines
drivers/gpu/drm/mxsfb/mxsfb_kms.c +10
-0+* bit, which is described in the reference manual since i.MX23 as +* " +* Set this bit to enable the LCDIF block to recover in the next +* field/frame if there was an underflow in the current field/frame. +* " +* Enable this bit to mitigate the sporadic underflows. +*/ + reg =readl (mxsfb->base +LCDC_CTRL1 ); + reg |=CTRL1_RECOVER_ON_UNDERFLOW ; +writel (reg, mxsfb->base +LCDC_CTRL1 );
Looks good to me. Thanks for the detailed explanation.
Quoted 16 lines
drivers/gpu/drm/mxsfb/mxsfb_kms.c +1
-0+writel (CTRL_RUN , mxsfb->base +LCDC_CTRL +REG_SET ); }drivers/gpu/drm/mxsfb/mxsfb_regs.h +1
-0@@ -54,6 +54,7 @@#define CTRL_DF24 BIT(1)#define CTRL_RUN BIT(0) +#define CTRL1_RECOVER_ON_UNDERFLOW BIT(24)#define CTRL1_FIFO_CLEAR BIT(21)#define CTRL1_SET_BYTE_PACKAGING (x) (((x) & 0xf) << 16)#define CTRL1_GET_BYTE_PACKAGING (x) (((x) >> 16) & 0xf)
Signature · 3 lines
Regards, Laurent Pinchart
Marek Vasut
maintainerQuoted 78 lines · Laurent Pinchart
Hi Marek,
Thank you for the patch.
Quoted 60 lines · Marek Vasut
There is some sort of corner case behavior of the controller, which could rarely be triggered at least on i.MX6SX connected to 800x480 DPI panel and i.MX8MM connected to
DPI->DSI->LVDSbridged 1920x1080 panel (and likely on other setups too), where the image on the panel shifts to the right and wraps around. This happens either when the controller is enabled on boot or even later during run time. The condition does not correct itself automatically, i.e. the display image remains shifted.It seems this problem is known and is due to sporadic underflows of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow IRQs, neither of the IRQs trigger and neither IRQ status bit is asserted when this condition occurs.
All known revisions of the LCDIF IP have CTRL1
RECOVER_ON_UNDERFLOWbit, which is described in the reference manual since i.MX23 as "
Set this bit to enable the LCDIF block to recover in the next field/frame if there was an underflow in the current field/frame.
"
Enable this bit to mitigate the sporadic underflows.Fixes 45d59d704080 ("drm: Add new driver for MXSFB controller")Signed-off-by Marek Vasut <[email protected]>Cc Daniel Abrecht <[email protected]>Cc Emil Velikov <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Lucas Stach <[email protected]>Cc Stefan Agner <[email protected]>--- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 29 +++++++++++++++++++++++++++++ drivers/gpu/drm/mxsfb/mxsfb_regs.h | 1 + 2 files changed, 30 insertions(+)drivers/gpu/drm/mxsfb/mxsfb_kms.c +18
-0@@ -115,6 +115,35 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) reg |=VDCTRL4_SYNC_SIGNALS_ON ;writel (reg, mxsfb->base +LCDC_VDCTRL4 ); +/* +* Enable recovery on underflow. +* +* There is some sort of corner case behavior of the controller, +* which could rarely be triggered at least on i.MX6SX connected +* to 800x480 DPI panel and i.MX8MM connected to DPI->DSI->LVDS +* bridged 1920x1080 panel (and likely on other setups too), where +* the image on the panel shifts to the right and wraps around. +* This happens either when the controller is enabled on boot or +* even later during run time. The condition does not correct +* itself automatically, i.e. the display image remains shifted. +* +* It seems this problem is known and is due to sporadic underflows +* of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow +* IRQs, neither of the IRQs trigger and neither IRQ status bit is +* asserted when this condition occurs. +* +* All known revisions of the LCDIF IP have CTRL1 RECOVER_ON_UNDERFLOW drivers/gpu/drm/mxsfb/mxsfb_kms.c static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) · line 145
Quoted 10 lines
drivers/gpu/drm/mxsfb/mxsfb_kms.c +10
-0+* bit, which is described in the reference manual since i.MX23 as +* " +* Set this bit to enable the LCDIF block to recover in the next +* field/frame if there was an underflow in the current field/frame. +* " +* Enable this bit to mitigate the sporadic underflows. +*/ + reg =readl (mxsfb->base +LCDC_CTRL1 ); + reg |=CTRL1_RECOVER_ON_UNDERFLOW ; +writel (reg, mxsfb->base +LCDC_CTRL1 );Looks good to me. Thanks for the detailed explanation.
Quoted 1 line
Reviewed-by Laurent Pinchart <[email protected]>
So who do I CC to pick it? Robert ? There are a few more mxsfb fixes which are RB'd and would be nice if they were picked too.
Marek Vasut
maintainerQuoted 82 lines · Marek Vasut
Quoted 81 lines · Laurent Pinchart
Hi Marek,
Thank you for the patch.
Quoted 65 lines · Marek Vasut
There is some sort of corner case behavior of the controller, which could rarely be triggered at least on i.MX6SX connected to 800x480 DPI panel and i.MX8MM connected to
DPI->DSI->LVDSbridged 1920x1080 panel (and likely on other setups too), where the image on the panel shifts to the right and wraps around. This happens either when the controller is enabled on boot or even later during run time. The condition does not correct itself automatically, i.e. the display image remains shifted.It seems this problem is known and is due to sporadic underflows of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow IRQs, neither of the IRQs trigger and neither IRQ status bit is asserted when this condition occurs.
All known revisions of the LCDIF IP have CTRL1
RECOVER_ON_UNDERFLOWbit, which is described in the reference manual since i.MX23 as "
Set this bit to enable the LCDIF block to recover in the next field/frame if there was an underflow in the current field/frame. "
Enable this bit to mitigate the sporadic underflows.Fixes 45d59d704080 ("drm: Add new driver for MXSFB controller")Signed-off-by Marek Vasut <[email protected]>Cc Daniel Abrecht <[email protected]>Cc Emil Velikov <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Lucas Stach <[email protected]>Cc Stefan Agner <[email protected]>---
drivers/gpu/drm/mxsfb/mxsfb_kms.c | 29 +++++++++++++++++++++++++++++drivers/gpu/drm/mxsfb/mxsfb_regs.h| 1 +2 files changed, 30 insertions(+)drivers/gpu/drm/mxsfb/mxsfb_kms.c +14
-0@@ -115,6 +115,35 @@ static void mxsfb_enable_controller(struct mxsfb_drm_private *mxsfb) reg |= VDCTRL4_SYNC_SIGNALS_ON; writel(reg, mxsfb->base + LCDC_VDCTRL4); + /* +* Enable recovery on underflow. +* +* There is some sort of corner case behavior of the controller, +* which could rarely be triggered at least on i.MX6SX connected +* to 800x480 DPI panel and i.MX8MM connected to DPI->DSI->LVDS +* bridged 1920x1080 panel (and likely on other setups too), where +* the image on the panel shifts to the right and wraps around. +* This happens either when the controller is enabled on boot or +* even later during run time. The condition does not correct +* itself automatically, i.e. the display image remains shifted. +* +* It seems this problem is known and is due to sporadic underflows +* of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow
+ * IRQs, neither of the IRQs trigger and neither IRQ status bit is + * asserted when this condition occurs.
+ *
+ * All known revisions of the LCDIF IP have CTRL1RECOVER_ON_UNDERFLOW
+ * bit, which is described in the reference manual since i.MX23 as + * "
+ * Set this bit to enable the LCDIF block to recover in the nextQuoted 8 lines
+ * field/frame if there was an underflow in the current field/frame.
+ * "
+ * Enable this bit to mitigate the sporadic underflows. + */
+ reg =readl(mxsfb->base + LCDC_CTRL1);
+ reg |=CTRL1_RECOVER_ON_UNDERFLOW;
+writel(reg, mxsfb->base + LCDC_CTRL1);Looks good to me. Thanks for the detailed explanation.
Quoted 3 lines
Quoted 1 line
Reviewed-by Laurent Pinchart <[email protected]>So who do I CC to pick it? Robert ? There are a few more mxsfb fixes which are RB'd and would be nice if they were picked too.
+CC Daniel, can those RB'd mxsfb patches be picked ?
Quoted 23 lines · Marek Vasut
There is some sort of corner case behavior of the controller, which could rarely be triggered at least on i.MX6SX connected to 800x480 DPI panel and i.MX8MM connected to
DPI->DSI->LVDSbridged 1920x1080 panel (and likely on other setups too), where the image on the panel shifts to the right and wraps around. This happens either when the controller is enabled on boot or even later during run time. The condition does not correct itself automatically, i.e. the display image remains shifted.It seems this problem is known and is due to sporadic underflows of the LCDIF FIFO. While the LCDIF IP does have underflow/overflow IRQs, neither of the IRQs trigger and neither IRQ status bit is asserted when this condition occurs.
All known revisions of the LCDIF IP have CTRL1
RECOVER_ON_UNDERFLOWbit, which is described in the reference manual since i.MX23 as "
Set this bit to enable the LCDIF block to recover in the next field/frame if there was an underflow in the current field/frame.
"
Enable this bit to mitigate the sporadic underflows.
Quoted 8 lines
Fixes 45d59d704080 ("drm: Add new driver for MXSFB controller")Signed-off-by Marek Vasut <[email protected]>Cc Daniel Abrecht <[email protected]>Cc Emil Velikov <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Lucas Stach <[email protected]>Cc Stefan Agner <[email protected]>---