From patchwork Mon Apr 14 14:52:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 3982201 Return-Path: X-Original-To: patchwork-davinci@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 2CDA09F2BA for ; Mon, 14 Apr 2014 14:53:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 55211200FF for ; Mon, 14 Apr 2014 14:53:40 +0000 (UTC) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 36DE9201BF for ; Mon, 14 Apr 2014 14:53:39 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s3EErcOn030756 for ; Mon, 14 Apr 2014 09:53:38 -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 s3EErcch032634 for ; Mon, 14 Apr 2014 09:53:38 -0500 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.174.1; Mon, 14 Apr 2014 09:53:37 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3EErbc2018020 for ; Mon, 14 Apr 2014 09:53:37 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id C005480627 for ; Mon, 14 Apr 2014 09:53:37 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dlelxv84.itg.ti.com (dlelxv84.itg.ti.com [172.17.0.246]) by linux.omap.com (Postfix) with ESMTP id BDDA980626 for ; Mon, 14 Apr 2014 09:52:46 -0500 (CDT) Received: from red.ext.ti.com (red.ext.ti.com [192.94.93.37]) by dlelxv84.itg.ti.com (8.14.3/8.13.8) with ESMTP id s3EEqktq004111 for ; Mon, 14 Apr 2014 09:52:46 -0500 Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id s3EEqhZu026123 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 14 Apr 2014 09:52:46 -0500 Received: from [216.82.250.99:49018] by server-1.bemta-12.messagelabs.com id 4D/FD-10268-B36FB435; Mon, 14 Apr 2014 14:52:43 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-15.tower-126.messagelabs.com!1397487162!11758688!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.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15816 invoked from network); 14 Apr 2014 14:52:43 -0000 Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com) (209.85.160.45) by server-15.tower-126.messagelabs.com with RC4-SHA encrypted SMTP; 14 Apr 2014 14:52:43 -0000 Received: by mail-pb0-f45.google.com with SMTP id uo5so8297159pbc.18 for ; Mon, 14 Apr 2014 07:52:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=pqLRyCgUNwX+TbQgNmr6SDCCE8dx6wi9jaMnNZD8H3c=; b=vgIGTfClslxIwqUBeMwRY3PDvWU1cWL8N9IQTE6rL626xdUzj47kWNCcwSFA8cf6b4 0cfaZ/GHxNSGTEYqk5lTyRLhQB5IesV+ixfTpaqvYyehwXP7UZTTknn4iknxA84p2wvL sQifbiOiDiWt+GAHTE5qAc4XwQXVmUnASDfJXhSOiNGPybIcXV48jDHlsI8CASq9PFnf 0hgPXfGTOJInFYtWGeJ+oUIqyZT40OjQJyWZyKEu7GJgMgzvlOi8ZRAyFNrQaV8Xlm4t U3qyTNr6o/M3525Pv8a8MiBWjEsvwsT7wzhUWG/xhS5s+vFq+EVwHzqPqUyyFS3wumOI hHZw== X-Received: by 10.66.102.39 with SMTP id fl7mr44303053pab.43.1397487161879; Mon, 14 Apr 2014 07:52:41 -0700 (PDT) Received: from localhost.localdomain ([49.203.180.184]) by mx.google.com with ESMTPSA id id10sm34287705pbc.35.2014.04.14.07.52.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Apr 2014 07:52:41 -0700 (PDT) From: "Lad, Prabhakar" To: LMML Subject: [PATCH] media: davinci: vpbe: release buffers in case start_streaming call back fails Date: Mon, 14 Apr 2014 20:22:31 +0530 Message-ID: <1397487151-6185-1-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.9.5 CC: LKML , DLOS , Mauro Carvalho Chehab 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 X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 From: "Lad, Prabhakar" this patch adds support to release the buffer by calling vb2_buffer_done(), with state marked as VB2_BUF_STATE_QUEUED if start_streaming() call back fails. Signed-off-by: Lad, Prabhakar --- drivers/media/platform/davinci/vpbe_display.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c index a9ad949..c8403ab 100644 --- a/drivers/media/platform/davinci/vpbe_display.c +++ b/drivers/media/platform/davinci/vpbe_display.c @@ -355,8 +355,17 @@ static int vpbe_start_streaming(struct vb2_queue *vq, unsigned int count) /* Set parameters in OSD and VENC */ ret = vpbe_set_osd_display_params(fh->disp_dev, layer); - if (ret < 0) + if (ret < 0) { + struct vpbe_disp_buffer *buf, *tmp; + + vb2_buffer_done(&layer->cur_frm->vb, VB2_BUF_STATE_QUEUED); + list_for_each_entry_safe(buf, tmp, &layer->dma_queue, list) { + list_del(&buf->list); + vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED); + } + return ret; + } /* * if request format is yuv420 semiplanar, need to