• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Description:
19 */
20 #ifndef __VIDEO_FIRMWARE_FORMAT_
21 #define __VIDEO_FIRMWARE_FORMAT_
22 
23 #include <linux/slab.h>
24 
25 /* example: #define VIDEO_DEC_AV1  TAG('A', 'V', '1', '-')*/
26 #define TAG(a, b, c, d)\
27 	((a << 24) | (b << 16) | (c << 8) | d)
28 
29 /* fws define */
30 #define VIDEO_DEC_MPEG12		(0)
31 #define VIDEO_DEC_MPEG4_3		(1)
32 #define VIDEO_DEC_MPEG4_4		(2)
33 #define VIDEO_DEC_MPEG4_5		(3)
34 #define VIDEO_DEC_H263			(4)
35 #define VIDEO_DEC_MJPEG			(5)
36 #define VIDEO_DEC_MJPEG_MULTI		(6)
37 #define VIDEO_DEC_REAL_V8		(7)
38 #define VIDEO_DEC_REAL_V9		(8)
39 #define VIDEO_DEC_VC1			(9)
40 #define VIDEO_DEC_AVS			(10)
41 #define VIDEO_DEC_H264			(11)
42 #define VIDEO_DEC_H264_4k2K		(12)
43 #define VIDEO_DEC_H264_4k2K_SINGLE	(13)
44 #define VIDEO_DEC_H264_MVC		(14)
45 #define VIDEO_DEC_H264_MULTI		(15)
46 #define VIDEO_DEC_HEVC			(16)
47 #define VIDEO_DEC_HEVC_MMU		(17)
48 #define VIDEO_DEC_VP9			(18)
49 #define VIDEO_DEC_VP9_MMU		(19)
50 #define VIDEO_ENC_H264			(20)
51 #define VIDEO_ENC_JPEG			(21)
52 #define VIDEO_DEC_H264_MULTI_MMU	(23)
53 #define VIDEO_DEC_HEVC_G12A		(24)
54 #define VIDEO_DEC_VP9_G12A		(25)
55 #define VIDEO_DEC_AVS2			(26)
56 #define VIDEO_DEC_AVS2_MMU		(27)
57 #define VIDEO_DEC_AVS_GXM		(28)
58 #define VIDEO_DEC_AVS_NOCABAC		(29)
59 #define VIDEO_DEC_H264_MULTI_GXM	(30)
60 #define VIDEO_DEC_H264_MVC_GXM		(31)
61 #define VIDEO_DEC_VC1_G12A		(32)
62 #define VIDEO_DEC_MPEG12_MULTI		TAG('M', '1', '2', 'M')
63 #define VIDEO_DEC_MPEG4_4_MULTI		TAG('M', '4', '4', 'M')
64 #define VIDEO_DEC_MPEG4_5_MULTI		TAG('M', '4', '5', 'M')
65 #define VIDEO_DEC_H263_MULTI		TAG('2', '6', '3', 'M')
66 #define VIDEO_DEC_HEVC_MMU_SWAP		TAG('2', '6', '5', 'S')
67 #define VIDEO_DEC_AVS_MULTI		TAG('A', 'V', 'S', 'M')
68 #define VIDEO_DEC_AV1_MMU		TAG('A', 'V', '1', 'M')
69 
70 /* ... */
71 #define FIRMWARE_MAX			(UINT_MAX)
72 
73 #define VIDEO_PACKAGE			(0)
74 #define VIDEO_FW_FILE			(1)
75 
76 #define VIDEO_DECODE			(0)
77 #define VIDEO_ENCODE			(1)
78 #define VIDEO_MISC			(2)
79 
80 #define OPTEE_VDEC_LEGENCY		(0)
81 #define OPTEE_VDEC			(1)
82 #define OPTEE_VDEC_HEVC			(2)
83 
84 struct format_name_s {
85 	unsigned int format;
86 	const char *name;
87 };
88 
89 struct cpu_type_s {
90 	int type;
91 	const char *name;
92 };
93 
94 const char *get_fw_format_name(unsigned int format);
95 unsigned int get_fw_format(const char *name);
96 int fw_get_cpu(const char *name);
97 
98 #endif
99