lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPBb6MUWieRTvrYR_UacVe-EAD1_VjTMehL7J2P=Ni8W7ELsXw@mail.gmail.com>
Date:   Mon, 12 Nov 2018 17:35:37 +0900
From:   Alexandre Courbot <acourbot@...omium.org>
To:     Tomasz Figa <tfiga@...omium.org>
Cc:     mgottam@...eaurora.org,
        Stanimir Varbanov <stanimir.varbanov@...aro.org>,
        Hans Verkuil <hverkuil@...all.nl>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Linux Media Mailing List <linux-media@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-arm-msm@...r.kernel.org, vgarodia@...eaurora.org
Subject: Re: [PATCH v2] media: venus: add support for selection rectangles

On Fri, Nov 9, 2018 at 7:31 PM Tomasz Figa <tfiga@...omium.org> wrote:
>
> Hi Malathi,
>
> On Fri, Nov 9, 2018 at 6:20 PM <mgottam@...eaurora.org> wrote:
> >
> > On 2018-11-09 07:56, Tomasz Figa wrote:
> > > Hi Malathi,
> > >
> > > On Fri, Nov 9, 2018 at 4:39 PM Malathi Gottam <mgottam@...eaurora.org>
> > > wrote:
> > >>
> > >> Handles target type crop by setting the new active rectangle
> > >> to hardware. The new rectangle should be within YUV size.
> > >>
> > >> Signed-off-by: Malathi Gottam <mgottam@...eaurora.org>
> > >> ---
> > >>  drivers/media/platform/qcom/venus/venc.c | 26
> > >> ++++++++++++++++++++++----
> > >>  1 file changed, 22 insertions(+), 4 deletions(-)
> > >>
> > >> diff --git a/drivers/media/platform/qcom/venus/venc.c
> > >> b/drivers/media/platform/qcom/venus/venc.c
> > >> index ce85962..d26c129 100644
> > >> --- a/drivers/media/platform/qcom/venus/venc.c
> > >> +++ b/drivers/media/platform/qcom/venus/venc.c
> > >> @@ -478,16 +478,34 @@ static int venc_g_fmt(struct file *file, void
> > >> *fh, struct v4l2_format *f)
> > >>  venc_s_selection(struct file *file, void *fh, struct v4l2_selection
> > >> *s)
> > >>  {
> > >>         struct venus_inst *inst = to_inst(file);
> > >> +       int ret;
> > >> +       u32 buftype;

Looks like these two variables are not used anymore?

> > >>
> > >>         if (s->type != V4L2_BUF_TYPE_VIDEO_OUTPUT)
> > >>                 return -EINVAL;
> > >>
> > >>         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.left != 0) {
> > >> +                       s->r.width += s->r.left;
> > >> +                       s->r.left = 0;
> > >> +               }
> > >> +
> > >> +               if (s->r.top != 0) {
> > >> +                       s->r.height += s->r.top;
> > >> +                       s->r.top = 0;
> > >> +               }
> > >> +
> > >> +               if (s->r.width > inst->width)
> > >> +                       s->r.width = inst->width;
> > >> +               else
> > >> +                       inst->width = s->r.width;
> > >> +
> > >> +               if (s->r.height > inst->height)
> > >> +                       s->r.height = inst->height;
> > >> +               else
> > >> +                       inst->height = s->r.height;
> > >> +
> > >
> > > From semantic point of view, it looks fine, but where is the rectangle
> > > actually set to the hardware?
> > >
> > > Best regards,
> > > Tomasz
> >
> > As this set selection call occurs before the hfi session initialization,
> > for now we are holding these values in driver.
> >
> > As this call is followed by VIDIOC_REQBUFS(), as a part of this
> > we have venc_init_session
> >
> > static int venc_init_session(struct venus_inst *inst)
> > {
> >         int ret;
> >
> >         ret = hfi_session_init(inst, inst->fmt_cap->pixfmt);
> >         if (ret)
> >                 return ret;
> >
> >         ret = venus_helper_set_input_resolution(inst, inst->width,
> >                                                 inst->height);
> >         if (ret)
> >                 goto deinit;
> >
> >         ret = venus_helper_set_output_resolution(inst, inst->width,
> >                                                  inst->height,
> >                                                  HFI_BUFFER_OUTPUT);
>
> Something sounds not right here. Shouldn't one of the width/height be
> the OUPUT format and the other the selection CROP target rectangle?

Yeah, I don't see where the stride of the input (from HFI perspective)
buffer is set, so unless I missed something that would not capture the
correct part of the buffer.

Also doesn't Venus support non-zero left and top parameters for the
selection rectangle?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ