summaryrefslogtreecommitdiff
path: root/drivers/media/platform/sti/delta/delta-cfg.h
blob: c6388f575800aeada48439b3a693370eb8497d80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * Copyright (C) STMicroelectronics SA 2015
 * Author: Hugues Fruchet <hugues.fruchet@st.com> for STMicroelectronics.
 * License terms:  GNU General Public License (GPL), version 2
 */

#ifndef DELTA_CFG_H
#define DELTA_CFG_H

#define DELTA_FW_VERSION "21.1-3"

#define DELTA_MIN_WIDTH  32
#define DELTA_MAX_WIDTH  4096
#define DELTA_MIN_HEIGHT 32
#define DELTA_MAX_HEIGHT 2400

/* DELTA requires a 32x32 pixels alignment for frames */
#define DELTA_WIDTH_ALIGNMENT    32
#define DELTA_HEIGHT_ALIGNMENT   32

#define DELTA_DEFAULT_WIDTH  DELTA_MIN_WIDTH
#define DELTA_DEFAULT_HEIGHT DELTA_MIN_HEIGHT
#define DELTA_DEFAULT_FRAMEFORMAT  V4L2_PIX_FMT_NV12
#define DELTA_DEFAULT_STREAMFORMAT V4L2_PIX_FMT_MJPEG

#define DELTA_MAX_RESO (DELTA_MAX_WIDTH * DELTA_MAX_HEIGHT)

/* guard value for number of access units */
#define DELTA_MAX_AUS 10

/* IP perf dependent, can be tuned */
#define DELTA_PEAK_FRAME_SMOOTHING 2

/*
 * guard output frame count:
 * - at least 1 frame needed for display
 * - at worst 21
 *   ( max h264 dpb (16) +
 *     decoding peak smoothing (2) +
 *     user display pipeline (3) )
 */
#define DELTA_MIN_FRAME_USER    1
#define DELTA_MAX_DPB           16
#define DELTA_MAX_FRAME_USER    3 /* platform/use-case dependent */
#define DELTA_MAX_FRAMES (DELTA_MAX_DPB + DELTA_PEAK_FRAME_SMOOTHING +\
			  DELTA_MAX_FRAME_USER)

#if DELTA_MAX_FRAMES > VIDEO_MAX_FRAME
#undef DELTA_MAX_FRAMES
#define DELTA_MAX_FRAMES (VIDEO_MAX_FRAME)
#endif

/* extra space to be allocated to store codec specific data per frame */
#define DELTA_MAX_FRAME_PRIV_SIZE 100

/* PM runtime auto power-off after 5ms of inactivity */
#define DELTA_HW_AUTOSUSPEND_DELAY_MS 5

#define DELTA_MAX_DECODERS 10
#ifdef CONFIG_VIDEO_STI_DELTA_MJPEG
extern const struct delta_dec mjpegdec;
#endif

#endif /* DELTA_CFG_H */