Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp685753pxk; Thu, 24 Sep 2020 16:11:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynpxZx35F1o96B2wX8ZEdKja48v9ggRhIYS+lZ9HUOEN88i0CU3p+gfxDADV35yOhhqw3l X-Received: by 2002:a17:906:fccb:: with SMTP id qx11mr923375ejb.429.1600989061351; Thu, 24 Sep 2020 16:11:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600989061; cv=none; d=google.com; s=arc-20160816; b=zsa4f5FVPmeQwiIaaJNJ1bgcFHfhiz5sYZPxq62zGCCEJVblhqVdYIUgKPL/QM7fNE 6M+knPOEG/qo2gxtTNCE9I2nbV7UZDNI2kVdfdbxkoF9WXktLMNQwponr9jITUFmpWMv Y21JRLSlwFEO0HfW3qXoNkSoQgFM5KqdJjZKhEm6ODJ01zY1dYIshoj0gDJhNt58tySF 4wTlR2M3QeFuhokgAXSsb+oDlzhz/pj5cq7jChs0WODx36Rw64hn9hVsA7GgvPnm9qox 8f23vNXTSJ1EwTesJ4nZgGihvRwmGGepuOKm9nsBqQQ7YspkADlM7b7X2Vl5o2oOZ8IK gcxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=H3ni0Y+vSF2RMFAfsz5zuDv9PYzkhH62P7J2wILvdjQ=; b=dIf65K+7vhnaIcLsAo2dyJk+sMMznhTm1igg0Ig0HmWZu8vruw1bqztkVOiw8pbT+6 1wIRddNZ0wlRa6MS6MBd35oi7KyE/e5m6lrx2iLz41z/8f/oNeyNgMwUqV4CrTtpwPl3 FofZJ2bxZI17J4fwNVKsa0al/uGOa3Q0gvSDKGinDKlWpXiXT8mxW1IfOUcI5CSnWRnC gmuClzCrdONCP8i20BlVPYyJKIbE0hIZsUxjZqHBDL/tn1V3wxr2epm1zqjHgqAcw0g0 R8pOnEiBXzUIYCmwWOMs34mUvUlkZjS2L5rySbBxLu5QScsNswfP3ywI3W7nu+ey9Yko 3stg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o6Y3gTgQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si706294edc.505.2020.09.24.16.10.38; Thu, 24 Sep 2020 16:11:01 -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; dkim=pass header.i=@linaro.org header.s=google header.b=o6Y3gTgQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726746AbgIXXJb (ORCPT + 99 others); Thu, 24 Sep 2020 19:09:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726704AbgIXXJb (ORCPT ); Thu, 24 Sep 2020 19:09:31 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2ADD7C0613CE for ; Thu, 24 Sep 2020 16:09:30 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id w2so1057273wmi.1 for ; Thu, 24 Sep 2020 16:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=H3ni0Y+vSF2RMFAfsz5zuDv9PYzkhH62P7J2wILvdjQ=; b=o6Y3gTgQITjiMUNU82jHpnkLfXXPBo3p11EL4xZvgWtldHngBe/nxDsl1lhGSmyozl xiGKQRXWzNk84TKcjOFIoRqxXbK9wRu/1sgddatbPBLC8S5S+/Pzx05yflWN1QrVG5Rk 8MgJqMe3zhT6ibrSO9KauT/CgTb98HmWw6wBFAzp5i06sLgsQNUNbV0SEMvivgkPDa9N EBYLRW7EuoGRHJFToV1V9ULAq6nw/gJJAWCkZ/YBHvumpd9XU/JBU3ormQlPXRTjMyTE n9+eKc74ulKJlm2l3pP+MSKRtAYDQQoSJHq744M07DbnhQJnQUqYOXOBJYEeGiDDm6+4 3IAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=H3ni0Y+vSF2RMFAfsz5zuDv9PYzkhH62P7J2wILvdjQ=; b=tuOZLSHrjkU1pbFRrfRS9/Rzdhm+nnla+lYlPZR6IAGbuItjmCz+RcaKU8GB9TWMz5 mrJuznIqKDtI2tiZ9nUGy6TBjwCsRDD3UkpOhAFjjr4Okg6Y6UtO/rMBzBRMpkJj4NUF KCLNPnYlLDZ7YhJJRPKAsKwOJAGBNSNbKKwlvzdqMuliiucdBAuc7z9y0ViLC/usQZgN YskUzBf4tBTZcHg34z6kCJFWR8vV1/fBxW2M4KmUYOjG13VfP244o8IKFbv8W6vfzXD3 I3GCPKn6NYdsfr3IeNtmCeg1a4RomE0sJsrxwIrWT06Wcdmnlb/4K6rnExqTm3FClycb QNqA== X-Gm-Message-State: AOAM532B14dgT/1PoWLeUKCaxV+5Wks2eJYMDey0KS3Y/fCKNl+13MAK ig15jxDtTl5yokTpt/mV/JxA2g== X-Received: by 2002:a1c:b608:: with SMTP id g8mr970827wmf.106.1600988968831; Thu, 24 Sep 2020 16:09:28 -0700 (PDT) Received: from [192.168.1.7] ([195.24.90.54]) by smtp.googlemail.com with ESMTPSA id q12sm659384wrp.17.2020.09.24.16.09.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Sep 2020 16:09:28 -0700 (PDT) Subject: Re: [PATCH 2/2] venus: venc: fix handlig of S_SELECTION and G_SELECTION To: Dikshita Agarwal , linux-media@vger.kernel.org, stanimir.varbanov@linaro.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org References: <1600968674-11559-1-git-send-email-dikshita@codeaurora.org> <1600968674-11559-3-git-send-email-dikshita@codeaurora.org> From: Stanimir Varbanov Message-ID: Date: Fri, 25 Sep 2020 02:09:26 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1600968674-11559-3-git-send-email-dikshita@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/24/20 8:31 PM, Dikshita Agarwal wrote: > 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) { In fact the 'if' statement is not needed. Just fill s->r. > + s->r.top = 0; > + s->r.left = 0; > + s->r.width = inst->width; > + s->r.height = inst->height; > + } > break; > default: > return -EINVAL; > -- regards, Stan