From patchwork Tue May 15 07:58:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 135834 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp668377lji; Tue, 15 May 2018 01:00:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqBB57088g2W8seUQadDPD1vkqYL7aWiLWVcbPq7akkl9qDg46he3pRdnJs2FcqfMA0fIn3 X-Received: by 2002:a63:b144:: with SMTP id g4-v6mr11204324pgp.253.1526371202099; Tue, 15 May 2018 01:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526371202; cv=none; d=google.com; s=arc-20160816; b=NPpC3UzsM3wH4OwQRLqSb0++Tc/dK0QWChRjjnFVLZXnoOu42c6hRs+YgAy8BA+QxD XQ12UsU5+2PvT+IpCUgeyAYR1tn3Ty5cjJgHe0F+YmFq6cYwwrCVq8EnOQmgiSMAg2C9 2kNZ/VdiCb3ZjDoOGeOlp4xDLmmrxFkBkni0hzauI2+hwQoMz6v3EgYmxe0VXw3GZhV/ yw2RDvJSgISIjpO7GdDvExcszAikWY0v/HQXhVZOlKmgpMuEBFJs0pbbzVgI3z/rc1T4 CcfCqq6n5jw/jDgFaI+Li8U9UJq4jrZqB49aw0eweZCyoQRc9gkGcjbbindY5Km9BeL8 zbdA== 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=B3zcQ+Nddm28/i04nstpD/wOS+xVnQqkWTyM5YaDQ0A=; b=F7KsvxUDH5VH5um72w1eCIvB528qFCQR2g3ZBhz2koEznOM/19QD6/zyO+WuPFRs+X YINHbXQk5pW5fchH78aRYjJGGDkTttacGq22oLpGVKPavBSTEHXN42FxwVCka44D2Z6M R7agwgJFntYoFCCGA5DE65uLa5XcGLu6Y6Q/VeMnkBABKNvVw2LbPp9crP5uGlQ0O0r/ KBhTytDlus30AOWUroQmYuyyUezBjYKr9/NV/Rf638rT96+c7GcM1v4ljm9iBqnNeB/C Z7yEIA5A388Db53snEnvzU+2vzLoVIAOLLvSs1EBd8AhmNYhFMIbNnR1wPuG2IrDfG8Z w54Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LBQVoYV7; 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 r10-v6si8803116pgs.647.2018.05.15.01.00.01; Tue, 15 May 2018 01:00:02 -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=LBQVoYV7; 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 S1752656AbeEOH76 (ORCPT + 29 others); Tue, 15 May 2018 03:59:58 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:36849 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752560AbeEOH7z (ORCPT ); Tue, 15 May 2018 03:59:55 -0400 Received: by mail-wr0-f195.google.com with SMTP id p4-v6so14930652wrh.3 for ; Tue, 15 May 2018 00:59:54 -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=B3zcQ+Nddm28/i04nstpD/wOS+xVnQqkWTyM5YaDQ0A=; b=LBQVoYV7yPMe9FvQMtvMzJR+QOM3pqS4YNMmbhj0P0pnm6ZLu6nkVfl6UY3UyoHJhq zhB7szd3l3e64z7WarR5c2jQ+b2JWQFCsJ9rYCCMovGQJoEibcbq+JDvRyNw1pVxPIFK ZQm8ugSn06mPEldezkhL0EOrMDLFUrPKc27U0= 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=B3zcQ+Nddm28/i04nstpD/wOS+xVnQqkWTyM5YaDQ0A=; b=XAArMpZvpnJTKXabSkv5TotYbsiP0prFdcicLUt8s/M1Ml/atp6oGjQVkYPPxNWmB6 XHjtNGPeSMla6+izQhpIr8Egp/9Rt9ysc13JCZ5NhrbgeM4e+8CPeSdvFagQN02uq2tc RKUOeKgfhGP1pM/vBSiaqc8u31YQjVC2VPJIQDZ9GdHfmBovjogtV8VG1Fjj2YkGo5li vpeUQ7otRSqOGFa1a/FKDn2wKHJT+BNZS+kpg+kNTaMjXSYhnTEaQWFGzybsD3DP3GAx SPIJ04n7tQVBTISFX93s7aOXQ+5ihactix/C6hAmKIBY/KVMHGZTsad5VS7AeIoB3aW9 2Vrw== X-Gm-Message-State: ALKqPwenqOUb2ps3dOWITUOGf+1AVWU9GbvbElAl3wtCKgQ006yPSQhh YlMAgNTMfPrhSU3Lc4ciExpZag== X-Received: by 2002:adf:b352:: with SMTP id k18-v6mr9246692wrd.207.1526371193969; Tue, 15 May 2018 00:59:53 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 4-v6sm10918510wmg.40.2018.05.15.00.59.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 00:59:53 -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 , Stanimir Varbanov Subject: [PATCH v2 25/29] venus: vdec: new function for output configuration Date: Tue, 15 May 2018 10:58:55 +0300 Message-Id: <20180515075859.17217-26-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180515075859.17217-1-stanimir.varbanov@linaro.org> References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make a new function vdec_output_conf() for decoder output configuration. vdec_output_conf() will set properties via HFI interface related to the output configuration, and keep vdec_set_properties() which will set properties related to decoding parameters. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/vdec.c | 35 ++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) -- 2.14.1 diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 5a5e3e2fece4..3a699af0ab58 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -545,6 +545,23 @@ static const struct v4l2_ioctl_ops vdec_ioctl_ops = { static int vdec_set_properties(struct venus_inst *inst) { struct vdec_controls *ctr = &inst->controls.dec; + struct hfi_enable en = { .enable = 1 }; + u32 ptype; + int ret; + + if (ctr->post_loop_deb_mode) { + ptype = HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER; + en.enable = 1; + ret = hfi_session_set_property(inst, ptype, &en); + if (ret) + return ret; + } + + return 0; +} + +static int vdec_output_conf(struct venus_inst *inst) +{ struct venus_core *core = inst->core; struct hfi_enable en = { .enable = 1 }; u32 ptype; @@ -569,14 +586,6 @@ static int vdec_set_properties(struct venus_inst *inst) if (ret) return ret; - if (ctr->post_loop_deb_mode) { - ptype = HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER; - en.enable = 1; - ret = hfi_session_set_property(inst, ptype, &en); - if (ret) - return ret; - } - return 0; } @@ -724,7 +733,6 @@ static int vdec_verify_conf(struct venus_inst *inst) static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) { struct venus_inst *inst = vb2_get_drv_priv(q); - struct venus_core *core = inst->core; int ret; mutex_lock(&inst->lock); @@ -753,12 +761,9 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) if (ret) goto deinit_sess; - if (core->res->hfi_version == HFI_VERSION_3XX) { - ret = venus_helper_set_bufsize(inst, inst->output_buf_size, - HFI_BUFFER_OUTPUT); - if (ret) - goto deinit_sess; - } + ret = vdec_output_conf(inst); + if (ret) + goto deinit_sess; ret = vdec_verify_conf(inst); if (ret)