Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp496421pxk; Thu, 24 Sep 2020 10:33:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZx+SQrvN8e2yFWFwYD82tAWEK+Z68GJyxFLBC14V2D6KlxqJdtmOY64M/Cq3kjDBU3elf X-Received: by 2002:a50:baed:: with SMTP id x100mr1066323ede.384.1600968784371; Thu, 24 Sep 2020 10:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600968784; cv=none; d=google.com; s=arc-20160816; b=LpJT2NxP0m3sClUYHlDp2Kyr3U8OwwlvUnjBB/xOWctp8IMrwiXR2WmU4Ny0JBNCDa HTpOOL5rBVQq8FwFqqSbjcDEERQTwzITlem8l3EN5p/1lrNCEVI61mwULxfsaLRt3KUk Fh03LOfcLCEzH+FSTta63kVMwcyaohEVbX6SsCBwAk+km7Fa8/9nFHTpFqnj/pcHWQxF OBmDLWxuyXQS3kAJ5wN/2r7nW24hNBmtU7vpgW1T8OScfFog58gcjfEV1QEW64S7N0os T5vGIUeLzqIPhwj8x5M+34f+T4RgugyiRnSRzG07b7YfF6Mx94HFAIBkBbUsXLVUnrqz FaIg== 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=2BElNOVmQRnsSlIbDxN+yG3vLc48IiLrQm9bXFaeqf8=; b=nt1RUEaTSVSdQHHUB0xhhEV8Q42T48oRcYeXGKUkODfw3Q1vzmi9AJmQBreSRs+fbQ 6UzM6w5ley5g2yRW0y0RKri9L2+5zx1HO+cSMJPXR20qEUm3U7+VLaR1mnR7yRkUodxt Xkp9yLoPOoo+oUA2C9pNlH+r5sHZcbcqP3toj5j9RBDl7NGeYgLKcoMHi2kBu6SShB/S RtJSNUJnmME4YIE1LxQi96/xRUnr+it/NNt2ZJbhy+gLce36qaFY/n7chJ75rig9N7mf ejAU4RJv97x7NzpPXIPrMhQHuzP2SvPMOkB3otsTwS1Is26B87ATXdNMAYMoyoZZ80vM FTiQ== 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 w2si121335ejq.644.2020.09.24.10.32.41; Thu, 24 Sep 2020 10:33:04 -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 S1728647AbgIXRbh (ORCPT + 99 others); Thu, 24 Sep 2020 13:31:37 -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 S1728566AbgIXRbf (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:35 -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:33 -0700 Received: from dikshita-linux.qualcomm.com ([10.204.65.237]) by ironmsg01-blr.qualcomm.com with ESMTP; 24 Sep 2020 23:01:20 +0530 Received: by dikshita-linux.qualcomm.com (Postfix, from userid 347544) id 4B8DD4E7E; Thu, 24 Sep 2020 23:01:19 +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 2/2] venus: venc: fix handlig of S_SELECTION and G_SELECTION Date: Thu, 24 Sep 2020 23:01:14 +0530 Message-Id: <1600968674-11559-3-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 From: Stanimir Varbanov - return correct width and height for G_SELECTION - if requested rectangle wxh doesn't match with capture port wxh adjust the rectangle to supported wxh. Signed-off-by: Dikshita Agarwal --- drivers/media/platform/qcom/venus/venc.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 7d2aaa8..a2cc12d 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -463,13 +463,13 @@ static int venc_g_fmt(struct file *file, void *fh, struct v4l2_format *f) switch (s->target) { case V4L2_SEL_TGT_CROP_DEFAULT: case V4L2_SEL_TGT_CROP_BOUNDS: - s->r.width = inst->width; - s->r.height = inst->height; - break; - case V4L2_SEL_TGT_CROP: s->r.width = inst->out_width; s->r.height = inst->out_height; break; + case V4L2_SEL_TGT_CROP: + s->r.width = inst->width; + s->r.height = inst->height; + break; default: return -EINVAL; } @@ -490,10 +490,14 @@ static int venc_g_fmt(struct file *file, void *fh, struct v4l2_format *f) switch (s->target) { case V4L2_SEL_TGT_CROP: - if (s->r.width != inst->out_width || - s->r.height != inst->out_height || - s->r.top != 0 || s->r.left != 0) - return -EINVAL; + if (s->r.width != inst->width || + s->r.height != inst->height || + s->r.top != 0 || s->r.left != 0) { + s->r.top = 0; + s->r.left = 0; + s->r.width = inst->width; + s->r.height = inst->height; + } break; default: return -EINVAL; -- 1.9.1