Skip to content

Commit

Permalink
media: verisilicon: Save bit depth for AV1 decoder
Browse files Browse the repository at this point in the history
Store bit depth information from AV1 sequence control.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
  • Loading branch information
Benjamin Gaignard authored and intel-lab-lkp committed Dec 19, 2022
1 parent d600409 commit c29cd88
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions drivers/media/platform/verisilicon/hantro_drv.c
Expand Up @@ -324,6 +324,25 @@ static int hantro_vp9_s_ctrl(struct v4l2_ctrl *ctrl)
return 0;
}

static int hantro_av1_s_ctrl(struct v4l2_ctrl *ctrl)
{
struct hantro_ctx *ctx;

ctx = container_of(ctrl->handler,
struct hantro_ctx, ctrl_handler);

switch (ctrl->id) {
case V4L2_CID_STATELESS_AV1_SEQUENCE:
ctx->bit_depth = ctrl->p_new.p_av1_sequence->bit_depth;
break;
default:
return -EINVAL;
}

return 0;
}


static const struct v4l2_ctrl_ops hantro_ctrl_ops = {
.try_ctrl = hantro_try_ctrl,
};
Expand All @@ -336,6 +355,12 @@ static const struct v4l2_ctrl_ops hantro_vp9_ctrl_ops = {
.s_ctrl = hantro_vp9_s_ctrl,
};

static const struct v4l2_ctrl_ops hantro_av1_ctrl_ops = {
.try_ctrl = hantro_try_ctrl,
.s_ctrl = hantro_av1_s_ctrl,
};


#define HANTRO_JPEG_ACTIVE_MARKERS (V4L2_JPEG_ACTIVE_MARKER_APP0 | \
V4L2_JPEG_ACTIVE_MARKER_COM | \
V4L2_JPEG_ACTIVE_MARKER_DQT | \
Expand Down Expand Up @@ -513,6 +538,7 @@ static const struct hantro_ctrl controls[] = {
.codec = HANTRO_AV1_DECODER,
.cfg = {
.id = V4L2_CID_STATELESS_AV1_SEQUENCE,
.ops = &hantro_av1_ctrl_ops,
},
}, {
.codec = HANTRO_AV1_DECODER,
Expand Down

0 comments on commit c29cd88

Please sign in to comment.