From patchwork Mon Nov 18 12:44:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 3196391 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D05489F3AE for ; Mon, 18 Nov 2013 12:44:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96012205F2 for ; Mon, 18 Nov 2013 12:44:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72316205E2 for ; Mon, 18 Nov 2013 12:44:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751580Ab3KRMoW (ORCPT ); Mon, 18 Nov 2013 07:44:22 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:54022 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751409Ab3KRMoV (ORCPT ); Mon, 18 Nov 2013 07:44:21 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id rAICiKZE000382; Mon, 18 Nov 2013 06:44:20 -0600 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id rAICiK23005191; Mon, 18 Nov 2013 06:44:20 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Mon, 18 Nov 2013 06:44:20 -0600 Received: from deskari.tieu.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 rAICiFXb016345; Mon, 18 Nov 2013 06:44:19 -0600 From: Tomi Valkeinen To: , CC: Archit Taneja , Tomi Valkeinen Subject: [PATCH 3/4] OMAPDSS: apply fixes Date: Mon, 18 Nov 2013 14:44:08 +0200 Message-ID: <1384778649-9396-3-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1384778649-9396-1-git-send-email-tomi.valkeinen@ti.com> References: <1384778649-9396-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.4 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 When omapfb does ovl->get_overlay_info, ovl->set_overlay_info, the set function may fail even if the info has not been changed. This is because omapdss doesn't initialize the info, but expect the caller to set valid values. Normally that is the case, but there is at least one corner case: if omapfb has not allocated memory for the overlay yet, and the user uses ioctl to disable the overlay to make sure it's disabled. In this case get_overlay_info returns invalid data, but the user is only interested in setting the overlay to disabled, not configuring it, and set_overlay_info fails. The issue is made possible by the omapfb's setup_plane ioctl, which groups overlay configuration and overlay enable/disable bit into the same struct. Thus, when you are disabling an overlay, you are also configuring it. This is a bit counter intuitive, so I think it's better to initialize the info to some valid values. The fields requiring initialization are color_mode and rotation_type, and also we need to remove the check for (paddr == 0), as paddr is 0 for unallocated overlay (but it's still fine to disable the overlay). Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/apply.c | 3 +++ drivers/video/omap2/dss/overlay.c | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 24cd7c2..0a0b084 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c @@ -149,6 +149,9 @@ static void apply_init_priv(void) op = &dss_data.ovl_priv_data_array[i]; + op->info.color_mode = OMAP_DSS_COLOR_RGB16; + op->info.rotation_type = OMAP_DSS_ROT_DMA; + op->info.global_alpha = 255; switch (i) { diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c index eccde32..2f7cee9 100644 --- a/drivers/video/omap2/dss/overlay.c +++ b/drivers/video/omap2/dss/overlay.c @@ -113,11 +113,6 @@ void dss_uninit_overlays(struct platform_device *pdev) int dss_ovl_simple_check(struct omap_overlay *ovl, const struct omap_overlay_info *info) { - if (info->paddr == 0) { - DSSERR("check_overlay: paddr cannot be 0\n"); - return -EINVAL; - } - if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) { if (info->out_width != 0 && info->width != info->out_width) { DSSERR("check_overlay: overlay %d doesn't support "