Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp80982pxk; Wed, 30 Sep 2020 18:34:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzge/yl3rYw1q1KerOFwVNP6dnVDrWCD5EVwJzb97MHWbZR4u/J6rB+G3zkDSLBtbbGzL3 X-Received: by 2002:a17:906:c2d5:: with SMTP id ch21mr5550832ejb.281.1601516075576; Wed, 30 Sep 2020 18:34:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601516075; cv=none; d=google.com; s=arc-20160816; b=bqchBd7djuAmAwFbkB0JMJhvkl6o7Xb03NiUsY6cGPCnAeHxn6BEIjpiXF+BEI5WZK OLjc4o/QUxhuYqat9+SxOxWj5DZzC9ipXrqse8Gf8AZ9zjHBX0BQJyIqRdbxtjWNyvZR 91hLm5erCsEFl2hRV2hbvmBLdT1/NjFaFHuDNk0e10QcbdyGEku/3emXGhvUf33Ibv/n wjo1DFPQc0hdsPP6N2EskplYngUrXt4U+WKGbVZPXlPzd45I3LDi0p1Pec4VaxA9g6zK sWZyPzSFDKWm1Cq37Fe8KfwCK5CUh749dk9+1KHnt5vANI7dCrIEpM8r+FwRJ0wpkC3e 58Fw== 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=taNiUPgBuzMtfz2VM9oZBpI+WyEOvFg81s4+iAbTStM=; b=sxj5699FwRrmdJVNUNeCKrNYCAFZJKzDT9ShlSWk7W6+EpbVvOsyOdbZv4ZwcGUo6T snc4nsPjwDRxYmrHTgFXHsYDKzM+dWvqzFqmlrjQsRPm+jb6QasluX0XNDsuae6hlbM5 pCSl92WUsSJT+9z7JyDG5QDM5jUQVPb0a2xxXsaqmL6skUY8Tp8a69Q/nhWB+Zp8a9Nl qIzySi480BESHkKmvFHwVYL58OBwleE7pao2VJq/qJvOG0cAc5WDLu0RRZnx5WaciAoX ygv92M4vCC7xScR3cc5YWYxA6S6z23RwpXGlFh0tOhwvpJqLgcDLIR5eA2WrRwCmF3DI eJ7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CwCHnsvd; 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 u6si2242830edx.293.2020.09.30.18.34.13; Wed, 30 Sep 2020 18:34:35 -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=CwCHnsvd; 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 S1730296AbgJABcr (ORCPT + 99 others); Wed, 30 Sep 2020 21:32:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbgJABcr (ORCPT ); Wed, 30 Sep 2020 21:32:47 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84CC7C061755 for ; Wed, 30 Sep 2020 18:32:45 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id x23so1272610wmi.3 for ; Wed, 30 Sep 2020 18:32:45 -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=taNiUPgBuzMtfz2VM9oZBpI+WyEOvFg81s4+iAbTStM=; b=CwCHnsvdzIMqvRK5CFoVqMi2xm6rngci01pOEOfHnTg9zi+FMu48ewMHQ4f9GUvs1G Sa3KEzZo3Nier4Ns/sniD3VMZEjuSWh4jlGj7O0mLUtfnTSInogDw7Y3qhsdrOHkL2Wi p1WYVCOreYiBMPWWUlbQHiq2CjBFZ87CF1U4nlecGHxRUfEK8woSkswBtdiqrZloKg6r 5Qhpftb+yNjI9dmiumHFq+/8cHRU043gMY2lfMaN+ql2TS9zd3ZanMYHBwFLf8BSLT6B Ww7Cu7buIFAfmFv6A+YutaPsmBuBIAwzeAIgri7QfsVgjMCKcaOhQXXy6Zl+oJTP1tH4 Ts7g== 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=taNiUPgBuzMtfz2VM9oZBpI+WyEOvFg81s4+iAbTStM=; b=CctQz8ZIC0joOvnWbJLfY6CidfsMMaDZT+cpgS0mEKyXG1hgkXlFQAYzdr2g+nteyF LIfIQ3qyBQyj2c8+MpP26loADeHXclpuY4HAhc0kFQ5iy4xaw2iRhrnHsyea1v5jZIVq dhnGeVML7a6qMJubEazdjyjyF0BU1mqbDtumdHupg7MDB2IjY/tweUluh3cnXaD5KomY 4KKY7TR7Za/mwpGLUT3IDdsjnPasyzO9e1/dDNDMUyBVnbPPmmvF84B7t/c57Z6RdJzm Mi2wIDWS63JZZ9egIWLQnAdjjlIANxe5IEwIkKU3UQpepKlqlfMJ6zizAZ9Loq8lc2Tf 6NyQ== X-Gm-Message-State: AOAM530Jqq7gUyibxA/x5XrIXrwcNC2DXnN9DNpOtQXbo/OOlhit/NXH nv9WYIIhqOIyD/oO6QN8RLgX1fiIsQBHiKjE X-Received: by 2002:a1c:4604:: with SMTP id t4mr5608525wma.156.1601515964155; Wed, 30 Sep 2020 18:32:44 -0700 (PDT) Received: from [192.168.1.7] ([195.24.90.54]) by smtp.googlemail.com with ESMTPSA id h1sm5998328wrx.33.2020.09.30.18.32.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Sep 2020 18:32:43 -0700 (PDT) Subject: Re: [PATCH 2/2] venus: venc: fix handlig of S_SELECTION and G_SELECTION To: Tomasz Figa , Dikshita Agarwal Cc: Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , Vikash Garodia 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: Thu, 1 Oct 2020 04:32:41 +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: 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 Hi Tomasz, On 9/25/20 11:55 PM, Tomasz Figa wrote: > Hi Dikshita, Stanimir, > > On Thu, Sep 24, 2020 at 7: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; >> }inter >> @@ -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; > > What's the point of exposing the selection API if no selection can > actually be done? If someone can guarantee that dropping of s_selection will not break userspace applications I'm fine with removing it. I implemented g/s_selection with the idea to add crop functionality later because with current firmware interface it needs more work. -- regards, Stan