From patchwork Wed Dec 9 15:59:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 7809781 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 73E6E9F39B for ; Wed, 9 Dec 2015 16:00:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBA7B203C1 for ; Wed, 9 Dec 2015 16:00:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A6499204B0 for ; Wed, 9 Dec 2015 16:00:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752699AbbLIQAW (ORCPT ); Wed, 9 Dec 2015 11:00:22 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:34768 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752682AbbLIQAT (ORCPT ); Wed, 9 Dec 2015 11:00:19 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id tB9G0HV5017352; Wed, 9 Dec 2015 10:00:17 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id tB9G0H4I021149; Wed, 9 Dec 2015 10:00:17 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Wed, 9 Dec 2015 10:00:16 -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 tB9G02KC028647; Wed, 9 Dec 2015 10:00:16 -0600 From: Tomi Valkeinen To: , Laurent Pinchart CC: Tomi Valkeinen Subject: [PATCH 09/23] OMAPDSS: add 'has_writeback' flag Date: Wed, 9 Dec 2015 17:59:37 +0200 Message-ID: <1449676791-26304-10-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1449676791-26304-1-git-send-email-tomi.valkeinen@ti.com> References: <1449676791-26304-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 At the moment we have a function to get the number of writeback pipelines supported. However, the function is used in a wrong way, causing a wrong pipeline to get configured when trying to use WB. Also, we only have a single writeback pipeline on any of the DSS versions. To fix and simplify this, create a 'has_writeback' flag into the dispc driver, and after checking the flag, use OMAP_DSS_WB pipeline explicitly when calling the configuration functions. Signed-off-by: Tomi Valkeinen --- drivers/video/fbdev/omap2/dss/dispc.c | 11 +++++++---- drivers/video/fbdev/omap2/dss/dss_features.c | 10 ---------- drivers/video/fbdev/omap2/dss/dss_features.h | 1 - 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c index 0cccff2ffd4e..aa74b3da3718 100644 --- a/drivers/video/fbdev/omap2/dss/dispc.c +++ b/drivers/video/fbdev/omap2/dss/dispc.c @@ -102,6 +102,8 @@ struct dispc_features { /* POL_FREQ has ALIGN bit */ bool supports_sync_align:1; + + bool has_writeback:1; }; #define DISPC_MAX_NR_FIFOS 5 @@ -710,7 +712,6 @@ static void dispc_setup_color_conv_coef(void) { int i; int num_ovl = dss_feat_get_num_ovls(); - int num_wb = dss_feat_get_num_wbs(); const struct color_conv_coef ctbl_bt601_5_ovl = { 298, 409, 0, 298, -208, -100, 298, 0, 517, 0, }; @@ -721,8 +722,8 @@ static void dispc_setup_color_conv_coef(void) for (i = 1; i < num_ovl; i++) dispc_ovl_write_color_conv_coef(i, &ctbl_bt601_5_ovl); - for (; i < num_wb; i++) - dispc_ovl_write_color_conv_coef(i, &ctbl_bt601_5_wb); + if (dispc.feat->has_writeback) + dispc_ovl_write_color_conv_coef(OMAP_DSS_WB, &ctbl_bt601_5_wb); } static void dispc_ovl_set_ba0(enum omap_plane plane, u32 paddr) @@ -3562,7 +3563,7 @@ static void dispc_dump_regs(struct seq_file *s) DUMPREG(i, DISPC_OVL_ATTRIBUTES2); } - if (dss_feat_get_num_wbs()) { + if (dispc.feat->has_writeback) { i = OMAP_DSS_WB; DUMPREG(i, DISPC_OVL_BA0); DUMPREG(i, DISPC_OVL_BA1); @@ -3892,6 +3893,7 @@ static const struct dispc_features omap44xx_dispc_feats = { .gfx_fifo_workaround = true, .set_max_preload = true, .supports_sync_align = true, + .has_writeback = true, }; static const struct dispc_features omap54xx_dispc_feats = { @@ -3914,6 +3916,7 @@ static const struct dispc_features omap54xx_dispc_feats = { .mstandby_workaround = true, .set_max_preload = true, .supports_sync_align = true, + .has_writeback = true, }; static int dispc_init_features(struct platform_device *pdev) diff --git a/drivers/video/fbdev/omap2/dss/dss_features.c b/drivers/video/fbdev/omap2/dss/dss_features.c index 28fe9a3ca1fa..48951c5cb352 100644 --- a/drivers/video/fbdev/omap2/dss/dss_features.c +++ b/drivers/video/fbdev/omap2/dss/dss_features.c @@ -46,7 +46,6 @@ struct omap_dss_features { const int num_mgrs; const int num_ovls; - const int num_wbs; const enum omap_display_type *supported_displays; const enum omap_dss_output_id *supported_outputs; const enum omap_color_mode *supported_color_modes; @@ -735,7 +734,6 @@ static const struct omap_dss_features omap4430_es1_0_dss_features = { .num_mgrs = 3, .num_ovls = 4, - .num_wbs = 1, .supported_displays = omap4_dss_supported_displays, .supported_outputs = omap4_dss_supported_outputs, .supported_color_modes = omap4_dss_supported_color_modes, @@ -757,7 +755,6 @@ static const struct omap_dss_features omap4430_es2_0_1_2_dss_features = { .num_mgrs = 3, .num_ovls = 4, - .num_wbs = 1, .supported_displays = omap4_dss_supported_displays, .supported_outputs = omap4_dss_supported_outputs, .supported_color_modes = omap4_dss_supported_color_modes, @@ -779,7 +776,6 @@ static const struct omap_dss_features omap4_dss_features = { .num_mgrs = 3, .num_ovls = 4, - .num_wbs = 1, .supported_displays = omap4_dss_supported_displays, .supported_outputs = omap4_dss_supported_outputs, .supported_color_modes = omap4_dss_supported_color_modes, @@ -801,7 +797,6 @@ static const struct omap_dss_features omap5_dss_features = { .num_mgrs = 4, .num_ovls = 4, - .num_wbs = 1, .supported_displays = omap5_dss_supported_displays, .supported_outputs = omap5_dss_supported_outputs, .supported_color_modes = omap4_dss_supported_color_modes, @@ -826,11 +821,6 @@ int dss_feat_get_num_ovls(void) } EXPORT_SYMBOL(dss_feat_get_num_ovls); -int dss_feat_get_num_wbs(void) -{ - return omap_current_dss_features->num_wbs; -} - unsigned long dss_feat_get_param_min(enum dss_range_param param) { return omap_current_dss_features->dss_params[param].min; diff --git a/drivers/video/fbdev/omap2/dss/dss_features.h b/drivers/video/fbdev/omap2/dss/dss_features.h index 100f7a2d0638..0e75927339c7 100644 --- a/drivers/video/fbdev/omap2/dss/dss_features.h +++ b/drivers/video/fbdev/omap2/dss/dss_features.h @@ -86,7 +86,6 @@ enum dss_range_param { }; /* DSS Feature Functions */ -int dss_feat_get_num_wbs(void); unsigned long dss_feat_get_param_min(enum dss_range_param param); unsigned long dss_feat_get_param_max(enum dss_range_param param); enum omap_overlay_caps dss_feat_get_overlay_caps(enum omap_plane plane);