xref: /linux/drivers/media/platform/st/sti/delta/delta-cfg.h (revision fd7d598270724cc787982ea48bbe17ad383a8b7f)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) STMicroelectronics SA 2015
4  * Author: Hugues Fruchet <hugues.fruchet@st.com> for STMicroelectronics.
5  */
6 
7 #ifndef DELTA_CFG_H
8 #define DELTA_CFG_H
9 
10 #define DELTA_FW_VERSION "21.1-3"
11 
12 #define DELTA_MIN_WIDTH  32
13 #define DELTA_MAX_WIDTH  4096
14 #define DELTA_MIN_HEIGHT 32
15 #define DELTA_MAX_HEIGHT 2400
16 
17 /* DELTA requires a 32x32 pixels alignment for frames */
18 #define DELTA_WIDTH_ALIGNMENT    32
19 #define DELTA_HEIGHT_ALIGNMENT   32
20 
21 #define DELTA_DEFAULT_WIDTH  DELTA_MIN_WIDTH
22 #define DELTA_DEFAULT_HEIGHT DELTA_MIN_HEIGHT
23 #define DELTA_DEFAULT_FRAMEFORMAT  V4L2_PIX_FMT_NV12
24 #define DELTA_DEFAULT_STREAMFORMAT V4L2_PIX_FMT_MJPEG
25 
26 #define DELTA_MAX_RESO (DELTA_MAX_WIDTH * DELTA_MAX_HEIGHT)
27 
28 /* guard value for number of access units */
29 #define DELTA_MAX_AUS 10
30 
31 /* IP perf dependent, can be tuned */
32 #define DELTA_PEAK_FRAME_SMOOTHING 2
33 
34 /*
35  * guard output frame count:
36  * - at least 1 frame needed for display
37  * - at worst 21
38  *   ( max h264 dpb (16) +
39  *     decoding peak smoothing (2) +
40  *     user display pipeline (3) )
41  */
42 #define DELTA_MIN_FRAME_USER    1
43 #define DELTA_MAX_DPB           16
44 #define DELTA_MAX_FRAME_USER    3 /* platform/use-case dependent */
45 #define DELTA_MAX_FRAMES (DELTA_MAX_DPB + DELTA_PEAK_FRAME_SMOOTHING +\
46 			  DELTA_MAX_FRAME_USER)
47 
48 #if DELTA_MAX_FRAMES > VIDEO_MAX_FRAME
49 #undef DELTA_MAX_FRAMES
50 #define DELTA_MAX_FRAMES (VIDEO_MAX_FRAME)
51 #endif
52 
53 /* extra space to be allocated to store codec specific data per frame */
54 #define DELTA_MAX_FRAME_PRIV_SIZE 100
55 
56 /* PM runtime auto power-off after 5ms of inactivity */
57 #define DELTA_HW_AUTOSUSPEND_DELAY_MS 5
58 
59 #define DELTA_MAX_DECODERS 10
60 #ifdef CONFIG_VIDEO_STI_DELTA_MJPEG
61 extern const struct delta_dec mjpegdec;
62 #endif
63 
64 #endif /* DELTA_CFG_H */
65