2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
5 * Header file for Exynos Repeater driver
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #ifndef _EXYNOS_REPEATER_H_
13 #define _EXYNOS_REPEATER_H_
15 #include <linux/dma-buf.h>
17 #define MAX_SHARED_BUF_NUM 3
20 * struct shared_buffer_info
22 * @pixel_format : pixel_format of bufs
23 * @width : width of bufs
24 * @height : height of bufs
25 * @buffer_count : valid buffer count of bufs
26 * @bufs : pointer of struct dma_buf for buffer sharing.
28 struct shared_buffer_info
{
33 struct dma_buf
*bufs
[MAX_SHARED_BUF_NUM
];
37 * hwfc_request_buffer - Get infomation of shared buffer
38 * @info: information of shared buffer
39 * owner: G2D is 0, MFC is 1
41 * G2D/MFC calls it to get shared buffer information.
42 * Repeater increments reference count on the dma-buf.
43 * G2D/MFC should decrement reference count on the dma-buf.
44 * If repeater has valid buffer, it returns a zero.
45 * If repeater don't have valid buffer, it returns a errno.
48 #ifdef CONFIG_VIDEO_EXYNOS_REPEATER
49 int hwfc_request_buffer(struct shared_buffer_info
*info
, int owner
);
51 static inline int hwfc_request_buffer(struct shared_buffer_info
*info
, int owner
)
58 * hwfc_get_valid_buffer - Get shared buf idx for capture output
59 * @buf_idx: shared buf idx for capture output
61 * G2D call it to get shared buffer index for capture output.
62 * If repeater has valid buffer for capture output, it returns a zero.
63 * If repeater don't have valid buffer for capture output, it returns a errno.
66 #ifdef CONFIG_VIDEO_EXYNOS_REPEATER
67 int hwfc_get_valid_buffer(int *buf_idx
);
69 static inline int hwfc_get_valid_buffer(int *buf_idx
)
76 * hwfc_set_valid_buffer - Set shared buf idx & job id for capture output
77 * @buf_idx : shared buf idx for capture output
78 * @capture_idx : hwfc capture idx
80 * G2D calls it after G2D H/W starts capture.
83 #ifdef CONFIG_VIDEO_EXYNOS_REPEATER
84 int hwfc_set_valid_buffer(int buf_idx
, int capture_idx
);
86 static inline int hwfc_set_valid_buffer(int buf_idx
, int capture_idx
)
93 * hwfc_encoding_done - Set ret about encoding
94 * @encoding_ret : ret about encoding
96 * MFC calls it when encoding is done.
99 #ifdef CONFIG_VIDEO_EXYNOS_REPEATER
100 int hwfc_encoding_done(int encoding_ret
);
102 static inline int hwfc_encoding_done(int encoding_ret
)
108 #endif /* _EXYNOS_REPEATER_H_ */