From patchwork Thu Feb 26 12:49:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 5891901 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0253BBF440 for ; Thu, 26 Feb 2015 12:49:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A58320390 for ; Thu, 26 Feb 2015 12:49:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4731F203A0 for ; Thu, 26 Feb 2015 12:49:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932194AbbBZMtu (ORCPT ); Thu, 26 Feb 2015 07:49:50 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:60619 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932239AbbBZMtt (ORCPT ); Thu, 26 Feb 2015 07:49:49 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t1QCnnFv019551; Thu, 26 Feb 2015 06:49:49 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t1QCnmnR016719; Thu, 26 Feb 2015 06:49:48 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Thu, 26 Feb 2015 06:49:47 -0600 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t1QCnUhU030427; Thu, 26 Feb 2015 06:49:47 -0600 From: Tomi Valkeinen To: , CC: Tomi Valkeinen Subject: [PATCH 13/15] OMAPDSS: workaround for MFLAG + NV12 issue Date: Thu, 26 Feb 2015 14:49:07 +0200 Message-ID: <1424954949-12801-13-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1424954949-12801-1-git-send-email-tomi.valkeinen@ti.com> References: <1424954949-12801-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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) {