1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright (C) 2021 Collabora Ltd, Emil Velikov <emil.velikov@collabora.com>
14 static const struct hantro_fmt sama5d4_vdec_postproc_fmts[] = {
16 .fourcc = V4L2_PIX_FMT_YUYV,
17 .codec_mode = HANTRO_MODE_NONE,
18 .postprocessed = true,
22 static const struct hantro_fmt sama5d4_vdec_fmts[] = {
24 .fourcc = V4L2_PIX_FMT_NV12,
25 .codec_mode = HANTRO_MODE_NONE,
28 .fourcc = V4L2_PIX_FMT_MPEG2_SLICE,
29 .codec_mode = HANTRO_MODE_MPEG2_DEC,
37 .step_height = MB_DIM,
41 .fourcc = V4L2_PIX_FMT_VP8_FRAME,
42 .codec_mode = HANTRO_MODE_VP8_DEC,
50 .step_height = MB_DIM,
54 .fourcc = V4L2_PIX_FMT_H264_SLICE,
55 .codec_mode = HANTRO_MODE_H264_DEC,
63 .step_height = MB_DIM,
69 * Supported codec ops.
72 static const struct hantro_codec_ops sama5d4_vdec_codec_ops[] = {
73 [HANTRO_MODE_MPEG2_DEC] = {
74 .run = hantro_g1_mpeg2_dec_run,
75 .reset = hantro_g1_reset,
76 .init = hantro_mpeg2_dec_init,
77 .exit = hantro_mpeg2_dec_exit,
79 [HANTRO_MODE_VP8_DEC] = {
80 .run = hantro_g1_vp8_dec_run,
81 .reset = hantro_g1_reset,
82 .init = hantro_vp8_dec_init,
83 .exit = hantro_vp8_dec_exit,
85 [HANTRO_MODE_H264_DEC] = {
86 .run = hantro_g1_h264_dec_run,
87 .reset = hantro_g1_reset,
88 .init = hantro_h264_dec_init,
89 .exit = hantro_h264_dec_exit,
93 static const struct hantro_irq sama5d4_irqs[] = {
94 { "vdec", hantro_g1_irq },
97 static const char * const sama5d4_clk_names[] = { "vdec_clk" };
99 const struct hantro_variant sama5d4_vdec_variant = {
100 .dec_fmts = sama5d4_vdec_fmts,
101 .num_dec_fmts = ARRAY_SIZE(sama5d4_vdec_fmts),
102 .postproc_fmts = sama5d4_vdec_postproc_fmts,
103 .num_postproc_fmts = ARRAY_SIZE(sama5d4_vdec_postproc_fmts),
104 .postproc_ops = &hantro_g1_postproc_ops,
105 .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
107 .codec_ops = sama5d4_vdec_codec_ops,
108 .irqs = sama5d4_irqs,
109 .num_irqs = ARRAY_SIZE(sama5d4_irqs),
110 .clk_names = sama5d4_clk_names,
111 .num_clocks = ARRAY_SIZE(sama5d4_clk_names),