From patchwork Fri Aug 18 14:16:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 9909173 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 2083B602C8 for ; Fri, 18 Aug 2017 14:18:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 115CF28C3B for ; Fri, 18 Aug 2017 14:18:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05FD928C40; Fri, 18 Aug 2017 14:18:42 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=unavailable 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 9A4BE28C3B for ; Fri, 18 Aug 2017 14:18:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753142AbdHROQs (ORCPT ); Fri, 18 Aug 2017 10:16:48 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:38026 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753123AbdHROQq (ORCPT ); Fri, 18 Aug 2017 10:16:46 -0400 Received: by mail-wr0-f177.google.com with SMTP id 5so47464566wrz.5 for ; Fri, 18 Aug 2017 07:16:46 -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=fPvxh0qR9CW6WhPE5CJMXBqbGYGNaBIq2sr3FMXrPZM=; b=EaJLf6liG2i161ib+BVCt3tJMdsmV5GWeYW8mTXE+WElQxyGF9q/4VkE7YvhGEmvlO s9c+0tFV8uO8RrCxQcTC5rWWnghy38lTjOoIma9bsluXPxdPb/TgUJNdgitwEaK4rlHw cM8N7X9K25RbUI4bkxviEU8z+nCxEvM6f7HMY= 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=fPvxh0qR9CW6WhPE5CJMXBqbGYGNaBIq2sr3FMXrPZM=; b=Zvx5C4qTjC1ggrVK7V9GOv+k+m1zHIszAJLaKItpmM0DmvLSeUJypZ3EbYn7k/HfUQ edivQbp1NvoIPomenWPcc2QrbLKCtn/fWxkO1uNiY1TEwUQEwAjO9UnKqD+TVVp4xaki YXX9zZ4+JTsKWbu5LIZ+/08t2XGiQBVQCWbSVAWfT2VSOjusoaJhUla9FhWwBROasuQ4 JLgccbWKntK4Em/rHD+f6MVYG/8KM7rDgASyOlVGgGkNNX5e0nplUKJlCNqnqrQxD/XB 0KcJzI9dwooS/ClZoZ5JPvyYnA07aKDvb5ir92lCZGsuJh900izqNDQae1AtWpsboyau lF0g== X-Gm-Message-State: AHYfb5itz/UXMoqap/d1zZoA4M/QFYtE09HgvanuGxIdoR1BalCR9KXH 2thb7TpyO+APkakn X-Received: by 10.223.160.240 with SMTP id n45mr5361589wrn.74.1503065805474; Fri, 18 Aug 2017 07:16:45 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 55sm1387383wrv.32.2017.08.18.07.16.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Aug 2017 07:16:45 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: Pawel Osciak , Marek Szyprowski , Kyungmin Park , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stanimir Varbanov Subject: [PATCH 2/7] media: venus: venc: set correct resolution on compressed stream Date: Fri, 18 Aug 2017 17:16:01 +0300 Message-Id: <20170818141606.4835-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170818141606.4835-1-stanimir.varbanov@linaro.org> References: <20170818141606.4835-1-stanimir.varbanov@linaro.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 This change the alignment restriction for output type of buffers only, also set corect input resolution and fill bidirectional vb2 queue flag in order to map output type buffers read/write. The last is needed by encoder firmware to add padding at the bottom of output (input buffers). Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/venc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 39748e7a08e4..01af1ac89edf 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -289,7 +289,7 @@ venc_try_fmt_common(struct venus_inst *inst, struct v4l2_format *f) pixmp->height = clamp(pixmp->height, inst->cap_height.min, inst->cap_height.max); - if (inst->core->res->hfi_version == HFI_VERSION_1XX) + if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) pixmp->height = ALIGN(pixmp->height, 32); pixmp->width = ALIGN(pixmp->width, 2); @@ -747,8 +747,8 @@ static int venc_init_session(struct venus_inst *inst) if (ret) return ret; - ret = venus_helper_set_input_resolution(inst, inst->out_width, - inst->out_height); + ret = venus_helper_set_input_resolution(inst, inst->width, + inst->height); if (ret) goto deinit; @@ -1010,6 +1010,8 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, src_vq->allow_zero_bytesused = 1; src_vq->min_buffers_needed = 1; src_vq->dev = inst->core->dev; + if (inst->core->res->hfi_version == HFI_VERSION_1XX) + src_vq->bidirectional = 1; ret = vb2_queue_init(src_vq); if (ret) return ret;