From patchwork Wed Jun 17 12:54:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 6625451 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 D899AC0433 for ; Wed, 17 Jun 2015 12:55:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0466020853 for ; Wed, 17 Jun 2015 12:55:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09C3320854 for ; Wed, 17 Jun 2015 12:55:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753997AbbFQMy6 (ORCPT ); Wed, 17 Jun 2015 08:54:58 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:40736 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754990AbbFQMy5 (ORCPT ); Wed, 17 Jun 2015 08:54:57 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id t5HCsrat032185; Wed, 17 Jun 2015 07:54:53 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t5HCsraH021709; Wed, 17 Jun 2015 07:54:53 -0500 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; Wed, 17 Jun 2015 07:54:53 -0500 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 t5HCsi7O002601; Wed, 17 Jun 2015 07:54:52 -0500 From: Tomi Valkeinen To: Laurent Pinchart , , CC: Tomi Valkeinen Subject: [PATCH 05/11] OMAPDSS: DISPC: fix row_inc for OMAP3 Date: Wed, 17 Jun 2015 15:54:29 +0300 Message-ID: <1434545675-477-6-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1434545675-477-1-git-send-email-tomi.valkeinen@ti.com> References: <1434545675-477-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=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 pixel_inc and row_inc work differently on OMAP2/3 and OMAP4+ DSS. On OMAP2/3 DSS, the pixel_inc is _not_ added by the HW at the end of the line, after the last pixel, whereas on OMAP4+ it is. The driver currently works for OMAP4+, but does not handle OMAP2/3 correctly, which leads to tilted image when row_inc is used. This patch adds a flag to DISPC driver so that the pixel_inc is added when required. Signed-off-by: Tomi Valkeinen --- drivers/video/fbdev/omap2/dss/dispc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c index ddce8fcfc5c1..4488d9367bd3 100644 --- a/drivers/video/fbdev/omap2/dss/dispc.c +++ b/drivers/video/fbdev/omap2/dss/dispc.c @@ -95,6 +95,9 @@ struct dispc_features { bool mstandby_workaround:1; bool set_max_preload:1; + + /* PIXEL_INC is not added to the last pixel of a line */ + bool last_pixel_inc_missing:1; }; #define DISPC_MAX_NR_FIFOS 5 @@ -2692,6 +2695,9 @@ static int dispc_ovl_setup_common(enum omap_plane plane, dispc_ovl_set_ba1_uv(plane, p_uv_addr + offset1); } + if (dispc.feat->last_pixel_inc_missing) + row_inc += pix_inc - 1; + dispc_ovl_set_row_inc(plane, row_inc); dispc_ovl_set_pix_inc(plane, pix_inc); @@ -3769,6 +3775,7 @@ static const struct dispc_features omap24xx_dispc_feats __initconst = { .num_fifos = 3, .no_framedone_tv = true, .set_max_preload = false, + .last_pixel_inc_missing = true, }; static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = { @@ -3789,6 +3796,7 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats __initconst = { .num_fifos = 3, .no_framedone_tv = true, .set_max_preload = false, + .last_pixel_inc_missing = true, }; static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = { @@ -3809,6 +3817,7 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats __initconst = { .num_fifos = 3, .no_framedone_tv = true, .set_max_preload = false, + .last_pixel_inc_missing = true, }; static const struct dispc_features omap44xx_dispc_feats __initconst = {