From patchwork Sat Sep 29 12:00:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinu Gorle X-Patchwork-Id: 10620735 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C24D96CB for ; Sat, 29 Sep 2018 12:01:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0BFD2A5F2 for ; Sat, 29 Sep 2018 12:01:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4F6A2A71B; Sat, 29 Sep 2018 12:01:04 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 6BC312A747 for ; Sat, 29 Sep 2018 12:01:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728244AbeI2S3L (ORCPT ); Sat, 29 Sep 2018 14:29:11 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:53194 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728241AbeI2S3K (ORCPT ); Sat, 29 Sep 2018 14:29:10 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E722760B7F; Sat, 29 Sep 2018 12:00:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222457; bh=F1MtYhnXdGfQ6iKMBLdLmFe2T2EZmwMzIVbji0LHeX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U0D5ccPgao1aPF2DXyOB175RnLporFlG+/5jAFf6E13JqxsZ8zXmkXXkUD+coHeGs mxNmvLDML2pmUrhPD1MnHugSZO5jaa/ZZnSSdriKB/dr1hesBlgq/JTwvc6uxXmYdO OvELIJWx/iZ51FA2YYyTqEgFA2SrpBw6fKIsf0FI= Received: from sgorle-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sgorle@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0D21460C4F; Sat, 29 Sep 2018 12:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538222457; bh=F1MtYhnXdGfQ6iKMBLdLmFe2T2EZmwMzIVbji0LHeX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U0D5ccPgao1aPF2DXyOB175RnLporFlG+/5jAFf6E13JqxsZ8zXmkXXkUD+coHeGs mxNmvLDML2pmUrhPD1MnHugSZO5jaa/ZZnSSdriKB/dr1hesBlgq/JTwvc6uxXmYdO OvELIJWx/iZ51FA2YYyTqEgFA2SrpBw6fKIsf0FI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0D21460C4F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sgorle@codeaurora.org From: Srinu Gorle To: stanimir.varbanov@linaro.org, hverkuil@xs4all.nl, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, sgorle@codeaurora.org Cc: acourbot@chromium.org, vgarodia@codeaurora.org Subject: [PATCH v1 3/5] media: venus: do not destroy video session during queue setup Date: Sat, 29 Sep 2018 17:30:30 +0530 Message-Id: <1538222432-25894-4-git-send-email-sgorle@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> References: <1538222432-25894-1-git-send-email-sgorle@codeaurora.org> 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 - open and close video sessions for plane properties is incorrect. - add check to ensure, same instance persist from driver open to close. Signed-off-by: Srinu Gorle --- drivers/media/platform/qcom/venus/hfi.c | 3 +++ drivers/media/platform/qcom/venus/vdec.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/media/platform/qcom/venus/hfi.c b/drivers/media/platform/qcom/venus/hfi.c index 36a4784..59c34ba 100644 --- a/drivers/media/platform/qcom/venus/hfi.c +++ b/drivers/media/platform/qcom/venus/hfi.c @@ -207,6 +207,9 @@ int hfi_session_init(struct venus_inst *inst, u32 pixfmt) const struct hfi_ops *ops = core->ops; int ret; + if (inst->state >= INST_INIT && inst->state < INST_STOP) + return 0; + inst->hfi_codec = to_codec_type(pixfmt); reinit_completion(&inst->done); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index afe3b36..0035cf2 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -700,6 +700,8 @@ static int vdec_num_buffers(struct venus_inst *inst, unsigned int *in_num, *out_num = HFI_BUFREQ_COUNT_MIN(&bufreq, ver); + return 0; + deinit: hfi_session_deinit(inst);