Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp611138imm; Thu, 5 Jul 2018 06:06:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd1bbfxQLy6Uaw07gJXO6Rkt2YTa4OgfexmcpDT1Hn+rZiAFuitb5L+cb/Atf3ezaICwf7R X-Received: by 2002:a65:450a:: with SMTP id n10-v6mr5389216pgq.392.1530796012334; Thu, 05 Jul 2018 06:06:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796012; cv=none; d=google.com; s=arc-20160816; b=0+RnJouATbMsuJTF+Enac9qod80mMhqzv9FPR71mR1KpD7NOyhhitRiHRSN+RBxYQU /0A65yBJKEjQt1lJpCF1npIou3XNN4peXyZ/zKH5cPXChAzosNb29GN1MQ2N6DROADYJ KuUfVx7Mv6A/FQQ4xR7P39YUdZahUGDrdumY/yZl9mst6CmZ0b+tDyb+rFFV5ORLfGnX RSy2cc3GC7kxdtiHNDns7zt8ynX4M1qieL3aq5OrBXSKEc8DNdntAznGxlpwBjbRlG2Q 5yHx6sYhkeerPaQvfvGe4TwOJ3zkyDW8kvpM1EuUQX0PnXS3PA1dMJEBeCds206su86m CxOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=e5wWhN2jYs/ZNqU0dtOSF3cvtPwdzRHe2yaBwOQivks=; b=fbJw3QZ382R+tFjZm0ZD5XlhB7BZ1XZ+wtyd8kKLrARdBhPNua5zkJjR0jU7QLVu1R nJbH8bBosAQsYKbosaAViha+9aLFcxNzWYn2z6QlPkKjJLSgn5pmg4t2V8NQ/2qif87/ /t5U0myYemVEimId1dLPr3wcx1sIqgpIqPpK8s2KaflQc/251LZ+pGR+QV6T7F0LymR0 idGUbUVXwXzIM/vmZ+eRRSC2RjHqyTp9i60YscZiUyKNutlWA4vFymWPZMhZXjBarQpW P0Wr1QXVVTh6BbtjvGVCbG5RImBu48pRo8E1Wy6NbtDRLHovv1SZIXNBQkraWPWNn4Nc qp6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a5Lk6Xyo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si5850731ply.344.2018.07.05.06.06.37; Thu, 05 Jul 2018 06:06:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a5Lk6Xyo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754483AbeGENFa (ORCPT + 99 others); Thu, 5 Jul 2018 09:05:30 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42500 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754416AbeGENFX (ORCPT ); Thu, 5 Jul 2018 09:05:23 -0400 Received: by mail-wr1-f66.google.com with SMTP id p1-v6so1140251wrs.9 for ; Thu, 05 Jul 2018 06:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e5wWhN2jYs/ZNqU0dtOSF3cvtPwdzRHe2yaBwOQivks=; b=a5Lk6Xyoxppfo7CfNnaBtoSzhiIo6gmq1xYEYzgSXWtGTnAOliaJcK5qU8WhddlDn+ qFlyBi1Zgpf/6d4yOtxJTxNk8uTIl08Z33KeU+f6MjN5AC5DREG9nyz71uOc0QWrqdeK ESaO/R0xhk6vmh/yIf8ys6IGg/zohAKcscJZE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=e5wWhN2jYs/ZNqU0dtOSF3cvtPwdzRHe2yaBwOQivks=; b=tMrCrXka2PYVCi/c3uW4aYYU3RIIjdOvpMJaeAL732UG5BgWuecbb0Yd3MrPrd6g57 Vzl83chi6CPENV9iEj/loUAnlRtUY8yZOi8y6NIwimv/WCvUE+szu/yeg0zJXlzhdOR6 eBwi4HafEqZQZ7XfuQ9rVzNdXgMp/Dlu6NQezQxLvYBCE9Qmsh3S9a4hYm/860epZm4E ob0mcmpX/e3Ww9bT8UniWWIE2Pwmh1DrBz4NKMzJCvRGfR07PRRg52qkUuNbx8RA/pXH +d2mfuQlhVO4keYF6S1dPMfvw5z7N5/YbEAmyn+5hx01d28pknj42bGOtMqMYwAZB5YJ szgA== X-Gm-Message-State: APt69E1W8L88cZjqCbFJo2LzGmyQ4/ZDfw4Fw8LG8FAQtP18EFCQSZlP I3KNirDI5gWdagTJI7bx6ZloRREYRl4= X-Received: by 2002:adf:9c12:: with SMTP id f18-v6mr4649973wrc.93.1530795922298; Thu, 05 Jul 2018 06:05:22 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 11-v6sm2109102wrw.67.2018.07.05.06.05.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05:21 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Alexandre Courbot , Stanimir Varbanov Subject: [PATCH v5 14/27] venus: helpers: add a helper function to set dynamic buffer mode Date: Thu, 5 Jul 2018 16:03:48 +0300 Message-Id: <20180705130401.24315-15-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180705130401.24315-1-stanimir.varbanov@linaro.org> References: <20180705130401.24315-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adds a new helper function to set dynamic buffer mode if it is supported by current HFI version. The dynamic buffer mode is set unconditionally for both decoder outputs. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 22 ++++++++++++++++++++++ drivers/media/platform/qcom/venus/helpers.h | 1 + drivers/media/platform/qcom/venus/vdec.c | 15 +++------------ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 27c4a4060c4e..29cc84777125 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -524,6 +524,28 @@ int venus_helper_set_color_format(struct venus_inst *inst, u32 pixfmt) } EXPORT_SYMBOL_GPL(venus_helper_set_color_format); +int venus_helper_set_dyn_bufmode(struct venus_inst *inst) +{ + const u32 ptype = HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE; + struct hfi_buffer_alloc_mode mode; + int ret; + + if (!is_dynamic_bufmode(inst)) + return 0; + + mode.type = HFI_BUFFER_OUTPUT; + mode.mode = HFI_BUFFER_MODE_DYNAMIC; + + ret = hfi_session_set_property(inst, ptype, &mode); + if (ret) + return ret; + + mode.type = HFI_BUFFER_OUTPUT2; + + return hfi_session_set_property(inst, ptype, &mode); +} +EXPORT_SYMBOL_GPL(venus_helper_set_dyn_bufmode); + static void delayed_process_buf_func(struct work_struct *work) { struct venus_buffer *buf, *n; diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 0e64aa95624a..52b961ed491e 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -40,6 +40,7 @@ int venus_helper_set_output_resolution(struct venus_inst *inst, int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, unsigned int output_bufs); int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt); +int venus_helper_set_dyn_bufmode(struct venus_inst *inst); void venus_helper_acquire_buf_ref(struct vb2_v4l2_buffer *vbuf); void venus_helper_release_buf_ref(struct venus_inst *inst, unsigned int idx); void venus_helper_init_instance(struct venus_inst *inst); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 95892090e2f3..c37779d82fec 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -557,18 +557,9 @@ static int vdec_set_properties(struct venus_inst *inst) return ret; } - if (core->res->hfi_version == HFI_VERSION_3XX || - inst->cap_bufs_mode_dynamic) { - struct hfi_buffer_alloc_mode mode; - - ptype = HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE; - mode.type = HFI_BUFFER_OUTPUT; - mode.mode = HFI_BUFFER_MODE_DYNAMIC; - - ret = hfi_session_set_property(inst, ptype, &mode); - if (ret) - return ret; - } + ret = venus_helper_set_dyn_bufmode(inst); + if (ret) + return ret; if (ctr->post_loop_deb_mode) { ptype = HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER; -- 2.14.1