From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2AA2C47420 for ; Thu, 1 Oct 2020 01:32:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6773207C3 for ; Thu, 1 Oct 2020 01:32:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CwCHnsvd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730333AbgJABcr (ORCPT ); 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-Google-Smtp-Source: ABdhPJwriYyFKzwZP52UTFmcet3nKi89GTuVOFxGrQE5RbDCMNt7v0uDBdMs+Y8opRk47bniQ9+I6w== 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