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,
20 .min_width
= FMT_MIN_WIDTH
,
21 .max_width
= FMT_HD_WIDTH
,
23 .min_height
= FMT_MIN_HEIGHT
,
24 .max_height
= FMT_HD_HEIGHT
,
25 .step_height
= MB_DIM
,
30 static const struct hantro_fmt sama5d4_vdec_fmts
[] = {
32 .fourcc
= V4L2_PIX_FMT_NV12
,
33 .codec_mode
= HANTRO_MODE_NONE
,
35 .min_width
= FMT_MIN_WIDTH
,
36 .max_width
= FMT_HD_WIDTH
,
38 .min_height
= FMT_MIN_HEIGHT
,
39 .max_height
= FMT_HD_HEIGHT
,
40 .step_height
= MB_DIM
,
44 .fourcc
= V4L2_PIX_FMT_MPEG2_SLICE
,
45 .codec_mode
= HANTRO_MODE_MPEG2_DEC
,
48 .min_width
= FMT_MIN_WIDTH
,
49 .max_width
= FMT_HD_WIDTH
,
51 .min_height
= FMT_MIN_HEIGHT
,
52 .max_height
= FMT_HD_HEIGHT
,
53 .step_height
= MB_DIM
,
57 .fourcc
= V4L2_PIX_FMT_VP8_FRAME
,
58 .codec_mode
= HANTRO_MODE_VP8_DEC
,
61 .min_width
= FMT_MIN_WIDTH
,
62 .max_width
= FMT_HD_WIDTH
,
64 .min_height
= FMT_MIN_HEIGHT
,
65 .max_height
= FMT_HD_HEIGHT
,
66 .step_height
= MB_DIM
,
70 .fourcc
= V4L2_PIX_FMT_H264_SLICE
,
71 .codec_mode
= HANTRO_MODE_H264_DEC
,
74 .min_width
= FMT_MIN_WIDTH
,
75 .max_width
= FMT_HD_WIDTH
,
77 .min_height
= FMT_MIN_HEIGHT
,
78 .max_height
= FMT_HD_HEIGHT
,
79 .step_height
= MB_DIM
,
85 * Supported codec ops.
88 static const struct hantro_codec_ops sama5d4_vdec_codec_ops
[] = {
89 [HANTRO_MODE_MPEG2_DEC
] = {
90 .run
= hantro_g1_mpeg2_dec_run
,
91 .reset
= hantro_g1_reset
,
92 .init
= hantro_mpeg2_dec_init
,
93 .exit
= hantro_mpeg2_dec_exit
,
95 [HANTRO_MODE_VP8_DEC
] = {
96 .run
= hantro_g1_vp8_dec_run
,
97 .reset
= hantro_g1_reset
,
98 .init
= hantro_vp8_dec_init
,
99 .exit
= hantro_vp8_dec_exit
,
101 [HANTRO_MODE_H264_DEC
] = {
102 .run
= hantro_g1_h264_dec_run
,
103 .reset
= hantro_g1_reset
,
104 .init
= hantro_h264_dec_init
,
105 .exit
= hantro_h264_dec_exit
,
109 static const struct hantro_irq sama5d4_irqs
[] = {
110 { "vdec", hantro_g1_irq
},
113 static const char * const sama5d4_clk_names
[] = { "vdec_clk" };
115 const struct hantro_variant sama5d4_vdec_variant
= {
116 .dec_fmts
= sama5d4_vdec_fmts
,
117 .num_dec_fmts
= ARRAY_SIZE(sama5d4_vdec_fmts
),
118 .postproc_fmts
= sama5d4_vdec_postproc_fmts
,
119 .num_postproc_fmts
= ARRAY_SIZE(sama5d4_vdec_postproc_fmts
),
120 .postproc_ops
= &hantro_g1_postproc_ops
,
121 .codec
= HANTRO_MPEG2_DECODER
| HANTRO_VP8_DECODER
|
123 .codec_ops
= sama5d4_vdec_codec_ops
,
124 .irqs
= sama5d4_irqs
,
125 .num_irqs
= ARRAY_SIZE(sama5d4_irqs
),
126 .clk_names
= sama5d4_clk_names
,
127 .num_clocks
= ARRAY_SIZE(sama5d4_clk_names
),