Message ID | 20191002112953.16642-1-stanimir.varbanov@linaro.org (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from <linux-media-owner@vger.kernel.org>) id 1iFcpc-0008VZ-C9; Wed, 02 Oct 2019 11:30:08 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726377AbfJBLaG (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Wed, 2 Oct 2019 07:30:06 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34077 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbfJBLaG (ORCPT <rfc822; linux-media@vger.kernel.org>); Wed, 2 Oct 2019 07:30:06 -0400 Received: by mail-wr1-f67.google.com with SMTP id a11so19256661wrx.1 for <linux-media@vger.kernel.org>; Wed, 02 Oct 2019 04:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=c+HawoUCN0wDXl6yXcj90og2sCV58k1+u/97qXquZg8=; b=swHPdpIbspRHp/fPlwdIn3d2attRFOXkBd2S+HfnGVsf0GuCz1djbGnsDEU7h1E/Rf g/3ejgq4H7Su2BT5ai+/DyfL5z11fxuE+ebKxfLgkb16IX6aidsXQychtVnG5FquQzj0 k3PlsYmhlj7CY8bpVvjJkRzBz1xoq+aDCd713E1JoUGQ1dYZYft3rp7M6Bp4KFsXp2x/ d8eI8w9gZEux5mgOxC/Zb6WX1Wa+6Jz/e64MMe3hNEDI2nXyiLaxinvdKKu0/ccKHmOL aiGdw5vvbpfeHgBLjn8jgyiiKtU6hmqKtCNnhE58yK5aKpy9qD52PAPuaCYBmGBNgEkZ Qvqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=c+HawoUCN0wDXl6yXcj90og2sCV58k1+u/97qXquZg8=; b=qQkLb1g2Ps90ekpkdMql2WQmRSpbcXjjLYiEeVdM6pQKIXCn0ZMhC1Yoi9rSl+GRmo FFEYCm/Yl/NofiNDB1/qAHvHyMcb0auv9p7HLz0wG7Y+ioOowhwHnr/5grlLw6PMmX5Y +5FIgwGQE0ZJGOwq/zlvedOl1u76N9N9uKJzg2U/oNpbRWKPYckb116waS3xuRvPcv8Q 7nLlRQOVeuj2qJkR5ICM0sSk5nz9FlYCP2JD9SJIcIoQbHsN3O2SqIv4scmp++blyfUa 9ajwiEdP8Wu2PVu/RmJjPH38Azamvd6YQAIEJrVAGAkPeM4h4BEON3RCdvzBpV8CXOHL LFXg== X-Gm-Message-State: APjAAAVKdidEjSTK4r3PNEB2fsuypaBtXvhEttA2VajeZRID8tfSGJfq OZRCAlCedI1b6kRtsJ5cKjdNFXdFq2k= X-Google-Smtp-Source: APXvYqzCudC6RWViI4ecqPsoOcPnDNcmO80Kt8+/eOsupB+g8O4ldLGzx5wW25Gu5kpzV4f2nkPwjQ== X-Received: by 2002:a5d:6606:: with SMTP id n6mr2132985wru.389.1570015803880; Wed, 02 Oct 2019 04:30:03 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id v6sm12267740wma.24.2019.10.02.04.30.02 for <linux-media@vger.kernel.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 04:30:03 -0700 (PDT) From: Stanimir Varbanov <stanimir.varbanov@linaro.org> To: linux-media@vger.kernel.org Subject: [GIT PULL for v5.5] Venus updates, take 2 Date: Wed, 2 Oct 2019 14:29:53 +0300 Message-Id: <20191002112953.16642-1-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org |
Series |
[GIT,PULL,for,v5.5] Venus updates, take 2
|
|
Pull-request
git://linuxtv.org/svarbanov/media_tree.git tags/venus-for-v5.5Message
Stanimir Varbanov
Oct. 2, 2019, 11:29 a.m. UTC
Hi Mauro, The Venus driver updates include: * three fixes: fail to suspend, enum frameinterval issue with encoder and frequency table modifications for v3 to handle performance issues. * two new features: interconnect bandwidth support on v4 and more precise clock-scaling on v4. Please pull. Changes since v1: Fixed checkpatch error/warn in 0003-venus-venc-Fix-enum-frameintervals.patch regards, Stan The following changes since commit 503e59365dd134b2c63864f14e2de0476284b003: media: i2c: ov2659: Switch to SPDX Licensing (2019-10-01 17:39:16 -0300) are available in the Git repository at: git://linuxtv.org/svarbanov/media_tree.git tags/venus-for-v5.5 for you to fetch changes up to e8938a0b5beb6f0fafc921010375cda64a5a4592: venus: Update clock scaling (2019-10-02 14:17:23 +0300) ---------------------------------------------------------------- Venus updates for v5.5 ---------------------------------------------------------------- Aniket Masule (2): venus: Add codec data table venus: Update clock scaling Loic Poulain (1): venus: core: Fix msm8996 frequency table Stanimir Varbanov (3): venus: Use on-chip interconnect API venus: venc: Fix enum frameintervals venus: Fix occasionally failures to suspend drivers/media/platform/Kconfig | 1 + drivers/media/platform/qcom/venus/core.c | 56 +++++- drivers/media/platform/qcom/venus/core.h | 30 ++++ drivers/media/platform/qcom/venus/helpers.c | 246 ++++++++++++++++++++++++-- drivers/media/platform/qcom/venus/helpers.h | 3 +- drivers/media/platform/qcom/venus/hfi_venus.c | 6 + drivers/media/platform/qcom/venus/vdec.c | 8 +- drivers/media/platform/qcom/venus/venc.c | 27 ++- 8 files changed, 346 insertions(+), 31 deletions(-)
Comments
From: builder@linuxtv.org
Pull request: https://patchwork.linuxtv.org/patch/59114/
Build log: https://builder.linuxtv.org/job/patchwork/18656/
Build time: 00:02:36
Link: https://lore.kernel.org/linux-media/20191002112953.16642-1-stanimir.varbanov@linaro.org
gpg: Signature made Wed 02 Oct 2019 11:18:59 AM UTC
gpg: using RSA key E1558C2497CE3CCC2B5AA30F25B55FC81B7035F2
gpg: Good signature from "Stanimir Varbanov <stanimir.varbanov@linaro.org>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 34CF E039 8A16 AD93 18FD D5E8 A6D0 26D8 E358 14D4
Subkey fingerprint: E155 8C24 97CE 3CCC 2B5A A30F 25B5 5FC8 1B70 35F2
Summary: no issues
Em Wed, 2 Oct 2019 14:29:53 +0300 Stanimir Varbanov <stanimir.varbanov@linaro.org> escreveu: > Hi Mauro, > > The Venus driver updates include: > > * three fixes: fail to suspend, enum frameinterval issue with encoder > and frequency table modifications for v3 to handle performance issues. > * two new features: interconnect bandwidth support on v4 and more precise > clock-scaling on v4. > > Please pull. > > Changes since v1: > Fixed checkpatch error/warn in 0003-venus-venc-Fix-enum-frameintervals.patch > > regards, > Stan > > The following changes since commit 503e59365dd134b2c63864f14e2de0476284b003: > > media: i2c: ov2659: Switch to SPDX Licensing (2019-10-01 17:39:16 -0300) > > are available in the Git repository at: > > git://linuxtv.org/svarbanov/media_tree.git tags/venus-for-v5.5 > > for you to fetch changes up to e8938a0b5beb6f0fafc921010375cda64a5a4592: > > venus: Update clock scaling (2019-10-02 14:17:23 +0300) > > ---------------------------------------------------------------- > Venus updates for v5.5 > > ---------------------------------------------------------------- > Aniket Masule (2): > venus: Add codec data table > venus: Update clock scaling > > Loic Poulain (1): > venus: core: Fix msm8996 frequency table > > Stanimir Varbanov (3): > venus: Use on-chip interconnect API > venus: venc: Fix enum frameintervals > venus: Fix occasionally failures to suspend Hmm... I'm not seeing the patches at the ML. Please always send them to the ML, in order for them to be properly reviewed. Btw, I have some issues related to this patch: venus: venc: Fix enum frameintervals Thanks, Mauro
Em Wed, 2 Oct 2019 14:29:53 +0300 Stanimir Varbanov <stanimir.varbanov@linaro.org> escreveu: > Hi Mauro, > > The Venus driver updates include: > > * three fixes: fail to suspend, enum frameinterval issue with encoder > and frequency table modifications for v3 to handle performance issues. > * two new features: interconnect bandwidth support on v4 and more precise > clock-scaling on v4. > > Please pull. > > Stanimir Varbanov (3): > venus: venc: Fix enum frameintervals > From c430fca8f2b9b7274a1186f85b69c469378dbd8a Mon Sep 17 00:00:00 2001 > From: Stanimir Varbanov <stanimir.varbanov@linaro.org> > Date: Tue, 22 Jan 2019 12:53:22 +0200 > Subject: venus: venc: Fix enum frameintervals > To: Linux Media Mailing List <linux-media@vger.kernel.org> > Cc: Mauro Carvalho Chehab <mchehab@infradead.org> > > This fixes an issue when setting the encoder framerate because of > missing precision. Now the frameinterval type is changed to > TYPE_CONTINUOUS and step = 1. Also the math is changed when > framerate property is called - the firmware side expects the > framerate in Q16 values. > > Signed-off-by: Loic Poulain <loic.poulain@linaro.org> > Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> > --- > drivers/media/platform/qcom/venus/venc.c | 23 ++++++++++++++++------- > 1 file changed, 16 insertions(+), 7 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c > index 1b7fb2d5887c..d0a97754ef18 100644 > --- a/drivers/media/platform/qcom/venus/venc.c > +++ b/drivers/media/platform/qcom/venus/venc.c > @@ -22,6 +22,7 @@ > #include "venc.h" > > #define NUM_B_FRAMES_MAX 4 > +#define FRAMERATE_FACTOR BIT(16) > > /* > * Three resons to keep MPLANE formats (despite that the number of planes > @@ -576,7 +577,7 @@ static int venc_enum_frameintervals(struct file *file, void *fh, > struct venus_inst *inst = to_inst(file); > const struct venus_format *fmt; > > - fival->type = V4L2_FRMIVAL_TYPE_STEPWISE; > + fival->type = V4L2_FRMIVAL_TYPE_CONTINUOUS; > > fmt = find_format(inst, fival->pixel_format, > V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); > @@ -599,12 +600,12 @@ static int venc_enum_frameintervals(struct file *file, void *fh, > fival->height < frame_height_min(inst)) > return -EINVAL; > > - fival->stepwise.min.numerator = 1; > - fival->stepwise.min.denominator = frate_max(inst); > - fival->stepwise.max.numerator = 1; > - fival->stepwise.max.denominator = frate_min(inst); > + fival->stepwise.min.numerator = FRAMERATE_FACTOR; > + fival->stepwise.min.denominator = frate_max(inst) * FRAMERATE_FACTOR; > + fival->stepwise.max.numerator = FRAMERATE_FACTOR; > + fival->stepwise.max.denominator = frate_min(inst) * FRAMERATE_FACTOR; Hmm... this change seems plain wrong to me... Why do you want to change the numerator? I mean: 1/frame_min(inst) is equal to: (const * 1) / (const * frame_min(inst)) Also, on every other driver, the returned fractions are normalized. > fival->stepwise.step.numerator = 1; > - fival->stepwise.step.denominator = frate_max(inst); > + fival->stepwise.step.denominator = 1; > > return 0; > } > @@ -649,6 +650,7 @@ static int venc_set_properties(struct venus_inst *inst) > struct hfi_quantization quant; > struct hfi_quantization_range quant_range; > u32 ptype, rate_control, bitrate, profile = 0, level = 0; > + u64 framerate; > int ret; > > ret = venus_helper_set_work_mode(inst, VIDC_WORK_MODE_2); > @@ -659,9 +661,16 @@ static int venc_set_properties(struct venus_inst *inst) > if (ret) > return ret; > > + framerate = inst->timeperframe.denominator * FRAMERATE_FACTOR; > + /* next line is to round up */ > + framerate += inst->timeperframe.numerator - 1; > + do_div(framerate, inst->timeperframe.numerator); > + > ptype = HFI_PROPERTY_CONFIG_FRAME_RATE; > frate.buffer_type = HFI_BUFFER_OUTPUT; > - frate.framerate = inst->fps * (1 << 16); > + frate.framerate = framerate; > + if (frate.framerate > frate_max(inst) * FRAMERATE_FACTOR) > + frate.framerate = frate_max(inst) * FRAMERATE_FACTOR; You should not assume that userspace will be multiplying by the frame factor. I mean, the driver should work the same way, no matter if userspace is setting the framerate as: 1/30, 2/60, ... n/(n *30) > > ret = hfi_session_set_property(inst, ptype, &frate); > if (ret) > -- > 2.21.0 > Thanks, Mauro
Hi Mauro, On 10/2/19 5:01 PM, Mauro Carvalho Chehab wrote: > Em Wed, 2 Oct 2019 14:29:53 +0300 > Stanimir Varbanov <stanimir.varbanov@linaro.org> escreveu: > >> Hi Mauro, >> >> The Venus driver updates include: >> >> * three fixes: fail to suspend, enum frameinterval issue with encoder >> and frequency table modifications for v3 to handle performance issues. >> * two new features: interconnect bandwidth support on v4 and more precise >> clock-scaling on v4. >> >> Please pull. >> >> Changes since v1: >> Fixed checkpatch error/warn in 0003-venus-venc-Fix-enum-frameintervals.patch >> >> regards, >> Stan >> >> The following changes since commit 503e59365dd134b2c63864f14e2de0476284b003: >> >> media: i2c: ov2659: Switch to SPDX Licensing (2019-10-01 17:39:16 -0300) >> >> are available in the Git repository at: >> >> git://linuxtv.org/svarbanov/media_tree.git tags/venus-for-v5.5 >> >> for you to fetch changes up to e8938a0b5beb6f0fafc921010375cda64a5a4592: >> >> venus: Update clock scaling (2019-10-02 14:17:23 +0300) >> >> ---------------------------------------------------------------- >> Venus updates for v5.5 >> >> ---------------------------------------------------------------- >> Aniket Masule (2): >> venus: Add codec data table >> venus: Update clock scaling >> >> Loic Poulain (1): >> venus: core: Fix msm8996 frequency table >> >> Stanimir Varbanov (3): >> venus: Use on-chip interconnect API >> venus: venc: Fix enum frameintervals >> venus: Fix occasionally failures to suspend > > Hmm... I'm not seeing the patches at the ML. Please always send them > to the ML, in order for them to be properly reviewed. All patches are posted on linux-media at least, maybe the problem is because I changed patch subject to start with upper-case instead of lower-case in pull request. > > Btw, I have some issues related to this patch: > > venus: venc: Fix enum frameintervals > > Thanks, > Mauro >
Hi Mauro, On 10/2/19 5:09 PM, Mauro Carvalho Chehab wrote: > Em Wed, 2 Oct 2019 14:29:53 +0300 > Stanimir Varbanov <stanimir.varbanov@linaro.org> escreveu: > >> Hi Mauro, >> >> The Venus driver updates include: >> >> * three fixes: fail to suspend, enum frameinterval issue with encoder >> and frequency table modifications for v3 to handle performance issues. >> * two new features: interconnect bandwidth support on v4 and more precise >> clock-scaling on v4. >> >> Please pull. >> >> Stanimir Varbanov (3): >> venus: venc: Fix enum frameintervals > >> From c430fca8f2b9b7274a1186f85b69c469378dbd8a Mon Sep 17 00:00:00 2001 >> From: Stanimir Varbanov <stanimir.varbanov@linaro.org> >> Date: Tue, 22 Jan 2019 12:53:22 +0200 >> Subject: venus: venc: Fix enum frameintervals >> To: Linux Media Mailing List <linux-media@vger.kernel.org> >> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> >> >> This fixes an issue when setting the encoder framerate because of >> missing precision. Now the frameinterval type is changed to >> TYPE_CONTINUOUS and step = 1. Also the math is changed when >> framerate property is called - the firmware side expects the >> framerate in Q16 values. >> >> Signed-off-by: Loic Poulain <loic.poulain@linaro.org> >> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> >> --- >> drivers/media/platform/qcom/venus/venc.c | 23 ++++++++++++++++------- >> 1 file changed, 16 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c >> index 1b7fb2d5887c..d0a97754ef18 100644 >> --- a/drivers/media/platform/qcom/venus/venc.c >> +++ b/drivers/media/platform/qcom/venus/venc.c >> @@ -22,6 +22,7 @@ >> #include "venc.h" >> >> #define NUM_B_FRAMES_MAX 4 >> +#define FRAMERATE_FACTOR BIT(16) >> >> /* >> * Three resons to keep MPLANE formats (despite that the number of planes >> @@ -576,7 +577,7 @@ static int venc_enum_frameintervals(struct file *file, void *fh, >> struct venus_inst *inst = to_inst(file); >> const struct venus_format *fmt; >> >> - fival->type = V4L2_FRMIVAL_TYPE_STEPWISE; >> + fival->type = V4L2_FRMIVAL_TYPE_CONTINUOUS; >> >> fmt = find_format(inst, fival->pixel_format, >> V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); >> @@ -599,12 +600,12 @@ static int venc_enum_frameintervals(struct file *file, void *fh, >> fival->height < frame_height_min(inst)) >> return -EINVAL; >> >> - fival->stepwise.min.numerator = 1; >> - fival->stepwise.min.denominator = frate_max(inst); >> - fival->stepwise.max.numerator = 1; >> - fival->stepwise.max.denominator = frate_min(inst); >> + fival->stepwise.min.numerator = FRAMERATE_FACTOR; >> + fival->stepwise.min.denominator = frate_max(inst) * FRAMERATE_FACTOR; >> + fival->stepwise.max.numerator = FRAMERATE_FACTOR; >> + fival->stepwise.max.denominator = frate_min(inst) * FRAMERATE_FACTOR; > > Hmm... this change seems plain wrong to me... Why do you want to change > the numerator? I mean: > > 1/frame_min(inst) > > is equal to: > > (const * 1) / (const * frame_min(inst)) > > Also, on every other driver, the returned fractions are normalized. Agree, this looks suspicious. I will drop this patch from pull request. I will look into the other drivers once again. > >> fival->stepwise.step.numerator = 1; >> - fival->stepwise.step.denominator = frate_max(inst); >> + fival->stepwise.step.denominator = 1; >> >> return 0; >> } >> @@ -649,6 +650,7 @@ static int venc_set_properties(struct venus_inst *inst) >> struct hfi_quantization quant; >> struct hfi_quantization_range quant_range; >> u32 ptype, rate_control, bitrate, profile = 0, level = 0; >> + u64 framerate; >> int ret; >> >> ret = venus_helper_set_work_mode(inst, VIDC_WORK_MODE_2); >> @@ -659,9 +661,16 @@ static int venc_set_properties(struct venus_inst *inst) >> if (ret) >> return ret; >> >> + framerate = inst->timeperframe.denominator * FRAMERATE_FACTOR; >> + /* next line is to round up */ >> + framerate += inst->timeperframe.numerator - 1; >> + do_div(framerate, inst->timeperframe.numerator); >> + >> ptype = HFI_PROPERTY_CONFIG_FRAME_RATE; >> frate.buffer_type = HFI_BUFFER_OUTPUT; >> - frate.framerate = inst->fps * (1 << 16); >> + frate.framerate = framerate; >> + if (frate.framerate > frate_max(inst) * FRAMERATE_FACTOR) >> + frate.framerate = frate_max(inst) * FRAMERATE_FACTOR; > > You should not assume that userspace will be multiplying by the > frame factor. I mean, the driver should work the same way, no matter > if userspace is setting the framerate as: > > 1/30, 2/60, ... n/(n *30) Agreed.