From patchwork Wed Sep 28 21:21:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Parrot X-Patchwork-Id: 9355039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DD05160757 for ; Wed, 28 Sep 2016 21:27:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBB9E296D8 for ; Wed, 28 Sep 2016 21:27:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF3CF29700; Wed, 28 Sep 2016 21:27:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E7BA296D8 for ; Wed, 28 Sep 2016 21:27:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754512AbcI1V1a (ORCPT ); Wed, 28 Sep 2016 17:27:30 -0400 Received: from bear.ext.ti.com ([198.47.19.11]:58194 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933372AbcI1VV7 (ORCPT ); Wed, 28 Sep 2016 17:21:59 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id u8SLLqc8029268; Wed, 28 Sep 2016 16:21:52 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8SLLqVv024961; Wed, 28 Sep 2016 16:21:52 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Wed, 28 Sep 2016 16:21:51 -0500 Received: from uda0869644a.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u8SLLqKf010276; Wed, 28 Sep 2016 16:21:52 -0500 From: Benoit Parrot To: Hans Verkuil CC: , Subject: [Patch 16/35] media: ti-vpe: vpe: Setup srcdst parameters in start_streaming Date: Wed, 28 Sep 2016 16:21:52 -0500 Message-ID: <20160928212152.27040-1-bparrot@ti.com> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nikhil Devshatwar For deinterlacing operation, each operation needs 2 fields in the history. This is achieved by holding three buffers in ctx->src_vbs[0,1,2] (f,f-1,f-2) This is achieved by using the ctx->sequence which gets reset via the s_fmt ioctl. These buffers are dequeued in stream OFF by calling free_vbs() But the corresponding references aren't removed anywhere. When application tries to stream ON and OFF continuously, s_fmt ioctl won't be called and it won't setup the srcdst parameters. Setting source/destination parameters in stream ON ioctl would make sure that the context is re-initialized before it is being used by the driver. Signed-off-by: Nikhil Devshatwar Signed-off-by: Benoit Parrot --- drivers/media/platform/ti-vpe/vpe.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/platform/ti-vpe/vpe.c b/drivers/media/platform/ti-vpe/vpe.c index ab677f34a627..08b363feb4fc 100644 --- a/drivers/media/platform/ti-vpe/vpe.c +++ b/drivers/media/platform/ti-vpe/vpe.c @@ -869,6 +869,7 @@ static int set_srcdst_params(struct vpe_ctx *ctx) } free_vbs(ctx); + ctx->src_vbs[2] = ctx->src_vbs[1] = ctx->src_vbs[0] = NULL; ret = realloc_mv_buffers(ctx, mv_buf_size); if (ret) @@ -1991,6 +1992,9 @@ static int vpe_start_streaming(struct vb2_queue *q, unsigned int count) if (ctx->deinterlacing) config_edi_input_mode(ctx, 0x0); + if (ctx->sequence != 0) + set_srcdst_params(ctx); + return 0; }