xref: /linux/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h
4  *
5  * Header file for Samsung MFC (Multi Function Codec - FIMV) driver
6  * Contains declarations of hw related functions.
7  *
8  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
9  *		http://www.samsung.com/
10  */
11 
12 #ifndef S5P_MFC_OPR_V6_H_
13 #define S5P_MFC_OPR_V6_H_
14 
15 #include "s5p_mfc_common.h"
16 #include "s5p_mfc_opr.h"
17 
18 #define MFC_CTRL_MODE_CUSTOM	MFC_CTRL_MODE_SFR
19 
20 #define MB_WIDTH(x_size)		DIV_ROUND_UP(x_size, 16)
21 #define MB_HEIGHT(y_size)		DIV_ROUND_UP(y_size, 16)
22 #define S5P_MFC_DEC_MV_SIZE(x, y, offset)	(MB_WIDTH(x) * \
23 					(((MB_HEIGHT(y) + 1) / 2) * 2) * 64 + (offset))
24 #define S5P_MFC_LCU_WIDTH(x_size)	DIV_ROUND_UP(x_size, 32)
25 #define S5P_MFC_LCU_HEIGHT(y_size)	DIV_ROUND_UP(y_size, 32)
26 
27 #define s5p_mfc_dec_hevc_mv_size(x, y) \
28 	(DIV_ROUND_UP(x, 64) * DIV_ROUND_UP(y, 64) * 256 + 512)
29 
30 /* Definition */
31 #define ENC_MULTI_SLICE_MB_MAX		((1 << 30) - 1)
32 #define ENC_MULTI_SLICE_BIT_MIN		2800
33 #define ENC_INTRA_REFRESH_MB_MAX	((1 << 18) - 1)
34 #define ENC_VBV_BUF_SIZE_MAX		((1 << 30) - 1)
35 #define ENC_H264_LOOP_FILTER_AB_MIN	-12
36 #define ENC_H264_LOOP_FILTER_AB_MAX	12
37 #define ENC_H264_RC_FRAME_RATE_MAX	((1 << 16) - 1)
38 #define ENC_H263_RC_FRAME_RATE_MAX	((1 << 16) - 1)
39 #define ENC_H264_PROFILE_MAX		3
40 #define ENC_H264_LEVEL_MAX		42
41 #define ENC_MPEG4_VOP_TIME_RES_MAX	((1 << 16) - 1)
42 #define FRAME_DELTA_H264_H263		1
43 #define LOOSE_CBR_MAX			5
44 #define TIGHT_CBR_MAX			10
45 #define ENC_HEVC_RC_FRAME_RATE_MAX	((1 << 16) - 1)
46 #define ENC_HEVC_QP_INDEX_MIN		-12
47 #define ENC_HEVC_QP_INDEX_MAX		12
48 #define ENC_HEVC_LOOP_FILTER_MIN	-12
49 #define ENC_HEVC_LOOP_FILTER_MAX	12
50 #define ENC_HEVC_LEVEL_MAX		62
51 
52 #define FRAME_DELTA_DEFAULT		1
53 
54 const struct s5p_mfc_hw_ops *s5p_mfc_init_hw_ops_v6(void);
55 const struct s5p_mfc_regs *s5p_mfc_init_regs_v6_plus(struct s5p_mfc_dev *dev);
56 #endif /* S5P_MFC_OPR_V6_H_ */
57