All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: [PATCH 13/15] OMAPDSS: workaround for MFLAG + NV12 issue
Date: Thu, 26 Feb 2015 12:49:07 +0000	[thread overview]
Message-ID: <1424954949-12801-13-git-send-email-tomi.valkeinen@ti.com> (raw)
In-Reply-To: <1424954949-12801-1-git-send-email-tomi.valkeinen@ti.com>

It was found that having two displays enabled and having an NV12 overlay
on one of the displays will cause underflows/synclosts. Debugging this
pointed to some issue with MFLAG.

It is unclear why this issue is happening, but it looks like there is a
HW bug related to MFLAG and FIFO management. Disabling MFLAG makes this
issue go away, but then we lose the benefit of MFLAG. Also forcing MFLAG
always on makes the issue go away.

Also, using certain values for MFLAG_START, MFLAG thresholds and PRELOAD
makes the issue go away, but there was no obvious logic to which values
work and which don't.

As a workaround until more information about this is found, force MFLAG
always on to make NV12 usable.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/fbdev/omap2/dss/dispc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c
index 6b056d0ce187..f4fc77d9d3bf 100644
--- a/drivers/video/fbdev/omap2/dss/dispc.c
+++ b/drivers/video/fbdev/omap2/dss/dispc.c
@@ -1328,8 +1328,18 @@ static void dispc_init_mflag(void)
 {
 	int i;
 
+	/*
+	 * HACK: NV12 color format and MFLAG seem to have problems working
+	 * together: using two displays, and having an NV12 overlay on one of
+	 * the displays will cause underflows/synclosts when MFLAG_CTRL=2.
+	 * Changing MFLAG thresholds and PRELOAD to certain values seem to
+	 * remove the errors, but there doesn't seem to be a clear logic on
+	 * which values work and which not.
+	 *
+	 * As a work-around, set force MFLAG to always on.
+	 */
 	dispc_write_reg(DISPC_GLOBAL_MFLAG_ATTRIBUTE,
-		(2 << 0) |	/* MFLAG_CTRL = enable */
+		(1 << 0) |	/* MFLAG_CTRL = force always on */
 		(0 << 2));	/* MFLAG_START = disable */
 
 	for (i = 0; i < dss_feat_get_num_ovls(); ++i) {
-- 
2.3.0


WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: [PATCH 13/15] OMAPDSS: workaround for MFLAG + NV12 issue
Date: Thu, 26 Feb 2015 14:49:07 +0200	[thread overview]
Message-ID: <1424954949-12801-13-git-send-email-tomi.valkeinen@ti.com> (raw)
In-Reply-To: <1424954949-12801-1-git-send-email-tomi.valkeinen@ti.com>

It was found that having two displays enabled and having an NV12 overlay
on one of the displays will cause underflows/synclosts. Debugging this
pointed to some issue with MFLAG.

It is unclear why this issue is happening, but it looks like there is a
HW bug related to MFLAG and FIFO management. Disabling MFLAG makes this
issue go away, but then we lose the benefit of MFLAG. Also forcing MFLAG
always on makes the issue go away.

Also, using certain values for MFLAG_START, MFLAG thresholds and PRELOAD
makes the issue go away, but there was no obvious logic to which values
work and which don't.

As a workaround until more information about this is found, force MFLAG
always on to make NV12 usable.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/fbdev/omap2/dss/dispc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c
index 6b056d0ce187..f4fc77d9d3bf 100644
--- a/drivers/video/fbdev/omap2/dss/dispc.c
+++ b/drivers/video/fbdev/omap2/dss/dispc.c
@@ -1328,8 +1328,18 @@ static void dispc_init_mflag(void)
 {
 	int i;
 
+	/*
+	 * HACK: NV12 color format and MFLAG seem to have problems working
+	 * together: using two displays, and having an NV12 overlay on one of
+	 * the displays will cause underflows/synclosts when MFLAG_CTRL=2.
+	 * Changing MFLAG thresholds and PRELOAD to certain values seem to
+	 * remove the errors, but there doesn't seem to be a clear logic on
+	 * which values work and which not.
+	 *
+	 * As a work-around, set force MFLAG to always on.
+	 */
 	dispc_write_reg(DISPC_GLOBAL_MFLAG_ATTRIBUTE,
-		(2 << 0) |	/* MFLAG_CTRL = enable */
+		(1 << 0) |	/* MFLAG_CTRL = force always on */
 		(0 << 2));	/* MFLAG_START = disable */
 
 	for (i = 0; i < dss_feat_get_num_ovls(); ++i) {
-- 
2.3.0


  parent reply	other threads:[~2015-02-26 12:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 12:48 [PATCH 01/15] OMAPDSS: fix AM43xx minimum pixel clock divider Tomi Valkeinen
2015-02-26 12:48 ` Tomi Valkeinen
2015-02-26 12:48 ` [PATCH 02/15] OMAPDSS: HDMI5: Increase DDC SDA-HOLD time Tomi Valkeinen
2015-02-26 12:48   ` Tomi Valkeinen
2015-02-26 12:48 ` [PATCH 03/15] OMAPDSS: fix paddr check for TILER addresses Tomi Valkeinen
2015-02-26 12:48   ` Tomi Valkeinen
2015-02-26 12:48 ` [PATCH 04/15] OMAPDSS: TFP410: fix input sync signals Tomi Valkeinen
2015-02-26 12:48   ` Tomi Valkeinen
2015-02-26 12:48 ` [PATCH 05/15] OMAPDSS: DISPC: remove OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES Tomi Valkeinen
2015-02-26 12:48   ` Tomi Valkeinen
2015-02-26 12:49 ` [PATCH 06/15] OMAPDSS: DISPC: explicit handling for sync and de levels Tomi Valkeinen
2015-02-26 12:49   ` Tomi Valkeinen
2015-02-26 12:49 ` [PATCH 07/15] OMAPDSS: change signal_level & signal_edge enum values Tomi Valkeinen
2015-02-26 12:49   ` Tomi Valkeinen
2015-02-26 12:49 ` [PATCH 08/15] OMAPDSS: DISPC: change sync_pclk_edge default value Tomi Valkeinen
2015-02-26 12:49   ` Tomi Valkeinen
2015-02-26 12:49 ` [PATCH 09/15] OMAPDSS: DISPC: fix div by zero issue in overlay scaling Tomi Valkeinen
2015-02-26 12:49   ` Tomi Valkeinen
2015-02-26 12:49 ` [PATCH 10/15] OMAPDSS: DISPC: lock access to DISPC_CONTROL & DISPC_CONFIG Tomi Valkeinen
2015-02-26 12:49   ` Tomi Valkeinen
2015-02-26 12:49 ` [PATCH 11/15] OMAPDSS: setup default fifo thresholds Tomi Valkeinen
2015-02-26 12:49   ` Tomi Valkeinen
2015-02-26 12:49 ` [PATCH 12/15] OMAPDSS: Add support for MFLAG Tomi Valkeinen
2015-02-26 12:49   ` Tomi Valkeinen
2015-02-26 12:49 ` Tomi Valkeinen [this message]
2015-02-26 12:49   ` [PATCH 13/15] OMAPDSS: workaround for MFLAG + NV12 issue Tomi Valkeinen
2015-02-26 12:49 ` [PATCH 14/15] OMAPDSS: HDMI: hdmi synclost work-around Tomi Valkeinen
2015-02-26 12:49   ` Tomi Valkeinen
2015-02-26 12:49 ` [PATCH 15/15] OMAPDSS: disable VT switch Tomi Valkeinen
2015-02-26 12:49   ` Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424954949-12801-13-git-send-email-tomi.valkeinen@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.