Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1519721

Re: [PATCH v3 5/9] media: venus: venc: add video encoder files

From Hans Verkuil <hverkuil@xs4all.nl>
Newsgroups linux.kernel
Subject Re: [PATCH v3 5/9] media: venus: venc: add video encoder files
Date 2016-11-11 12:50 +0100
Message-ID <sCivg-3KY-23@gated-at.bofh.it> (permalink)
References <sAW3L-6lw-3@gated-at.bofh.it> <sAW3M-6lw-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The comments I made before about start_streaming and the use of struct venus_ctrl
apply here as well and I won't repeat them.

On 11/07/2016 06:33 PM, Stanimir Varbanov wrote:
> This adds encoder part of the driver plus encoder controls.
> 
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/venc.c       | 1212 ++++++++++++++++++++++++
>  drivers/media/platform/qcom/venus/venc.h       |   32 +
>  drivers/media/platform/qcom/venus/venc_ctrls.c |  396 ++++++++
>  3 files changed, 1640 insertions(+)
>  create mode 100644 drivers/media/platform/qcom/venus/venc.c
>  create mode 100644 drivers/media/platform/qcom/venus/venc.h
>  create mode 100644 drivers/media/platform/qcom/venus/venc_ctrls.c
> 
> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
> new file mode 100644
> index 000000000000..35572eaffb9e
> --- /dev/null
> +++ b/drivers/media/platform/qcom/venus/venc.c

<snip>

> +static int
> +venc_s_selection(struct file *file, void *fh, struct v4l2_selection *s)
> +{
> +	struct venus_inst *inst = to_inst(file);
> +
> +	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;
> +		break;
> +	default:
> +		return -EINVAL;
> +	}
> +
> +	return 0;
> +}

Why implement s_selection if I can't change the selection?

> +
> +static int
> +venc_reqbufs(struct file *file, void *fh, struct v4l2_requestbuffers *b)
> +{
> +	struct vb2_queue *queue = to_vb2q(file, b->type);
> +
> +	if (!queue)
> +		return -EINVAL;
> +
> +	return vb2_reqbufs(queue, b);
> +}

Use the m2m helpers if at all possible.

Regards,

	Hans

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/9] Qualcomm video decoder/encoder driver Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2016-11-07 18:50 +0100
  [PATCH v3 3/9] media: venus: adding core part and helper functions Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2016-11-07 18:50 +0100
    Re: [PATCH v3 3/9] media: venus: adding core part and helper  functions Stephen Boyd <sboyd@codeaurora.org> - 2016-11-10 22:50 +0100
      Re: [PATCH v3 3/9] media: venus: adding core part and helper  functions Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2016-11-11 17:20 +0100
        Re: [PATCH v3 3/9] media: venus: adding core part and helper  functions Stephen Boyd <sboyd@codeaurora.org> - 2016-11-12 00:00 +0100
    Re: [PATCH v3 3/9] media: venus: adding core part and helper  functions Hans Verkuil <hverkuil@xs4all.nl> - 2016-11-11 12:40 +0100
      Re: [PATCH v3 3/9] media: venus: adding core part and helper  functions Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2016-11-14 10:50 +0100
        Re: [PATCH v3 3/9] media: venus: adding core part and helper  functions Hans Verkuil <hverkuil@xs4all.nl> - 2016-11-14 10:50 +0100
          Re: [PATCH v3 3/9] media: venus: adding core part and helper  functions Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2016-11-14 11:20 +0100
            Re: [PATCH v3 3/9] media: venus: adding core part and helper  functions Hans Verkuil <hverkuil@xs4all.nl> - 2016-11-14 11:30 +0100
              Re: [PATCH v3 3/9] media: venus: adding core part and helper  functions Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2016-11-17 10:20 +0100
  Re: [PATCH v3 0/9] Qualcomm video decoder/encoder driver Hans Verkuil <hverkuil@xs4all.nl> - 2016-11-11 12:50 +0100
    Re: [PATCH v3 0/9] Qualcomm video decoder/encoder driver Javier Martinez Canillas <javier@dowhile0.org> - 2016-11-11 13:20 +0100
      Re: [PATCH v3 0/9] Qualcomm video decoder/encoder driver Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2016-11-14 16:00 +0100
        Re: [PATCH v3 0/9] Qualcomm video decoder/encoder driver Hans Verkuil <hverkuil@xs4all.nl> - 2016-11-14 16:10 +0100
  Re: [PATCH v3 5/9] media: venus: venc: add video encoder files Hans Verkuil <hverkuil@xs4all.nl> - 2016-11-11 12:50 +0100
    Re: [PATCH v3 5/9] media: venus: venc: add video encoder files Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2016-11-14 11:30 +0100

csiph-web