From patchwork Tue May 7 05:07:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar X-Patchwork-Id: 2531951 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by patchwork2.kernel.org (Postfix) with ESMTP id E0A8BDF215 for ; Tue, 7 May 2013 05:08:04 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r47584Hq011680 for ; Tue, 7 May 2013 00:08:04 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r47583Au013544 for ; Tue, 7 May 2013 00:08:04 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Tue, 7 May 2013 00:08:03 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r47583xC019303 for ; Tue, 7 May 2013 00:08:03 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id D043F8063B for ; Tue, 7 May 2013 00:08:03 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id F399B80626 for ; Tue, 7 May 2013 00:07:47 -0500 (CDT) Received: from neches.ext.ti.com (neches.ext.ti.com [192.91.81.29]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id r4757ljM000223 for ; Tue, 7 May 2013 00:07:47 -0500 (CDT) Received: from mail6.bemta7.messagelabs.com (mail6.bemta7.messagelabs.com [216.82.255.55]) by neches.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4757kKJ024852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 7 May 2013 00:07:47 -0500 Received: from [216.82.253.163:57162] by server-16.bemta-7.messagelabs.com id 91/80-22461-22C88815; Tue, 07 May 2013 05:07:46 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-6.tower-166.messagelabs.com!1367903265!16331752!1 X-Originating-IP: [209.85.160.45] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.8.6.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22935 invoked from network); 7 May 2013 05:07:46 -0000 Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com) (209.85.160.45) by server-6.tower-166.messagelabs.com with RC4-SHA encrypted SMTP; 7 May 2013 05:07:46 -0000 Received: by mail-pb0-f45.google.com with SMTP id ro12so131734pbb.4 for ; Mon, 06 May 2013 22:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=+kLQJZB/TOcfTGjGo8l3RYeFbVSoU0L43C6eRwcoO2k=; b=YOjNZGHkkAZTfeIYWxYNybj4kROTC21IQjNQa6a0NwWnOdV0Qxm2pccFy09daE9Tti ZjqbYS0fiuLQPI3zOMgRdAu25AKSjlv+qHlKBxyVRqZwJHJgJTNvqbAyLLhIyVCw9xIk qdS4CP5mj1oFfaaMIp3oY1EjrvO3uVhH3rscMPifvnFHZ9cBlHwBmZQfYhLklpPdLQHh NjiEsUr3gFolD1titR8HCQX7VkwuqGC+Ru9ARoZCTA7HN2Vy/2h4RTK6MxVDyCKbITJ4 aP5PunXFLDBQ0eE40fR3EStbwG122iNNWBs2R0iQnmy0SNmR1Z3kYI86Pe/GRHSwifZW YE9g== X-Received: by 10.66.48.197 with SMTP id o5mr1022152pan.196.1367903265363; Mon, 06 May 2013 22:07:45 -0700 (PDT) Received: from localhost.localdomain ([122.166.13.141]) by mx.google.com with ESMTPSA id cp1sm26675401pbc.42.2013.05.06.22.07.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 06 May 2013 22:07:44 -0700 (PDT) From: Prabhakar Lad To: LMML , Mauro Carvalho Chehab Subject: [PATCH v2] media: davinci: vpbe: fix layer availability for NV12 format Date: Tue, 7 May 2013 10:37:25 +0530 Message-ID: <1367903245-4494-1-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.4.1 CC: DLOS , LKML X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com From: Lad, Prabhakar For NV12 format, even if display data is single image, both VIDWIN0 and VIDWIN1 parameters must be used. The start address of Y data plane and C data plane is configured in VIDEOWIN0ADH/L and VIDEOWIN1ADH/L respectively. cuurently only one layer was requested, which is suffice for yuv422, but for yuv420(NV12) two layers are required and fix the same by requesting for other layer if pix fmt is NV12 during set_fmt. Signed-off-by: Lad, Prabhakar --- Changes for v2: 1: Dropped cpu_is_*() check in driver as, any way driver would fail to set NV12 if the device doesnt support it. drivers/media/platform/davinci/vpbe_display.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c index 0341dcc..4ceee3a 100644 --- a/drivers/media/platform/davinci/vpbe_display.c +++ b/drivers/media/platform/davinci/vpbe_display.c @@ -922,6 +922,21 @@ static int vpbe_display_s_fmt(struct file *file, void *priv, other video window */ layer->pix_fmt = *pixfmt; + if (pixfmt->pixelformat == V4L2_PIX_FMT_NV12) { + struct vpbe_layer *otherlayer; + + otherlayer = _vpbe_display_get_other_win_layer(disp_dev, layer); + /* if other layer is available, only + * claim it, do not configure it + */ + ret = osd_device->ops.request_layer(osd_device, + otherlayer->layer_info.id); + if (ret < 0) { + v4l2_err(&vpbe_dev->v4l2_dev, + "Display Manager failed to allocate layer\n"); + return -EBUSY; + } + } /* Get osd layer config */ osd_device->ops.get_layer_config(osd_device,