Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp497567pxk; Thu, 24 Sep 2020 10:34:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7voCHuw0NFsvrBvH2K/7ut/LD/wn65sZ1g8DjVsj8M7wGzb1gqkiWXAIQway7+v8Gh5YO X-Received: by 2002:a17:906:a45a:: with SMTP id cb26mr1036644ejb.387.1600968874711; Thu, 24 Sep 2020 10:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600968874; cv=none; d=google.com; s=arc-20160816; b=MmmBtNZiogsuOiU3RbXnJb7h/BZkhgHoBXen2jwKhX4UFU4BpLwZYW2GXKX0fKOSe4 IyGfsmRuOvtLwPMfuUzaMbUKFLi0f6qGq8loxg39D2WGYh8enpbMy/A83zxb5yp6Fado uEaZyG1UyxLCgUpIbB9qFgFgwCe37RqsGqobwNG8cvU8AV3ij6LbDe1gSVaMr9nN/1iZ F0bHn7TwnsOMtLXIrgJXgzxflnyzJjYmWo+c6eQmRwme05hHgCGxUUilOaC8A7hzwQ52 nVrhGEIc1A4v8ObN4LQAuZ/GHb8+oLrgt1lF5fDF6mW/bwHSQfUqyqO/cUUOJs65V7kQ Kwng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=xMe8+ijxaD+YL+VGLNiQKUvRQEbSfAFvxtTTFabbX0w=; b=vqGsFf/d3/6YtZEuBdgz52wu89jyyK+bmf5ZZ4wsIi51Ot4r+DI56NuGyJGK9n9/aW EMNwaVYdrXZZu2Zbn/3BeJjdAhAAl4yZdCz8Kl94GKGExdt57AnYByGVCYraS6W8vjfI jQLWB3I/Ypg0S8NZxBfvvDr2/3JcjdJh7lnQvP7Do7BseMF8J0L6QpcxBbJ/Hz0lq2gj 8lrNbgXduvx5tcit0VFvq5tbhVoVoXbOXRj8jUFq5nJVahuaKHiHx356yeFCC2JmG0zL w/FuDUywouKmpKtOQZLJbZy6YF1cCdbQjrdvgPIx9cbGRrHQKAj4d5RtxXQ/ZoUEaQhm LYLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id wk12si138594ejb.130.2020.09.24.10.34.10; Thu, 24 Sep 2020 10:34:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728589AbgIXRbf (ORCPT + 99 others); Thu, 24 Sep 2020 13:31:35 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:33711 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726915AbgIXRbf (ORCPT ); Thu, 24 Sep 2020 13:31:35 -0400 Received: from ironmsg-lv-alpha.qualcomm.com ([10.47.202.13]) by alexa-out.qualcomm.com with ESMTP; 24 Sep 2020 10:31:34 -0700 Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg-lv-alpha.qualcomm.com with ESMTP/TLS/AES256-SHA; 24 Sep 2020 10:31:31 -0700 Received: from dikshita-linux.qualcomm.com ([10.204.65.237]) by ironmsg01-blr.qualcomm.com with ESMTP; 24 Sep 2020 23:01:18 +0530 Received: by dikshita-linux.qualcomm.com (Postfix, from userid 347544) id B049A4E7F; Thu, 24 Sep 2020 23:01:17 +0530 (IST) From: Dikshita Agarwal To: linux-media@vger.kernel.org, stanimir.varbanov@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, Dikshita Agarwal Subject: [PATCH 1/2] venus: venc: update output format based on capture format. Date: Thu, 24 Sep 2020 23:01:13 +0530 Message-Id: <1600968674-11559-2-git-send-email-dikshita@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1600968674-11559-1-git-send-email-dikshita@codeaurora.org> References: <1600968674-11559-1-git-send-email-dikshita@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org update output format parameters when s_fmt is called on capture port as recommended in encoder spec. Signed-off-by: Dikshita Agarwal --- drivers/media/platform/qcom/venus/venc.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index c591d00..7d2aaa8 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -382,31 +382,33 @@ static int venc_s_fmt(struct file *file, void *fh, struct v4l2_format *f) memset(&format, 0, sizeof(format)); - format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; - format.fmt.pix_mp.pixelformat = pixfmt_out; + format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + format.fmt.pix_mp.pixelformat = pixfmt_cap; format.fmt.pix_mp.width = orig_pixmp.width; format.fmt.pix_mp.height = orig_pixmp.height; venc_try_fmt_common(inst, &format); - if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { - inst->out_width = format.fmt.pix_mp.width; - inst->out_height = format.fmt.pix_mp.height; - inst->colorspace = pixmp->colorspace; - inst->ycbcr_enc = pixmp->ycbcr_enc; - inst->quantization = pixmp->quantization; - inst->xfer_func = pixmp->xfer_func; + if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + inst->width = format.fmt.pix_mp.width; + inst->height = format.fmt.pix_mp.height; } memset(&format, 0, sizeof(format)); - format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - format.fmt.pix_mp.pixelformat = pixfmt_cap; + format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; + format.fmt.pix_mp.pixelformat = pixfmt_out; format.fmt.pix_mp.width = orig_pixmp.width; format.fmt.pix_mp.height = orig_pixmp.height; venc_try_fmt_common(inst, &format); - inst->width = format.fmt.pix_mp.width; - inst->height = format.fmt.pix_mp.height; + inst->out_width = format.fmt.pix_mp.width; + inst->out_height = format.fmt.pix_mp.height; + if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + inst->colorspace = pixmp->colorspace; + inst->ycbcr_enc = pixmp->ycbcr_enc; + inst->quantization = pixmp->quantization; + inst->xfer_func = pixmp->xfer_func; + } if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) inst->fmt_out = fmt; -- 1.9.1