2 * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
3 * Copyright (C) 2017 Linaro Ltd.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #ifndef __VENUS_HELPERS_H__
16 #define __VENUS_HELPERS_H__
18 #include <media/videobuf2-v4l2.h>
22 bool venus_helper_check_codec(struct venus_inst
*inst
, u32 v4l2_pixfmt
);
23 struct vb2_v4l2_buffer
*venus_helper_find_buf(struct venus_inst
*inst
,
24 unsigned int type
, u32 idx
);
25 void venus_helper_buffers_done(struct venus_inst
*inst
,
26 enum vb2_buffer_state state
);
27 int venus_helper_vb2_buf_init(struct vb2_buffer
*vb
);
28 int venus_helper_vb2_buf_prepare(struct vb2_buffer
*vb
);
29 void venus_helper_vb2_buf_queue(struct vb2_buffer
*vb
);
30 void venus_helper_vb2_stop_streaming(struct vb2_queue
*q
);
31 int venus_helper_vb2_start_streaming(struct venus_inst
*inst
);
32 void venus_helper_m2m_device_run(void *priv
);
33 void venus_helper_m2m_job_abort(void *priv
);
34 int venus_helper_get_bufreq(struct venus_inst
*inst
, u32 type
,
35 struct hfi_buffer_requirements
*req
);
36 int venus_helper_set_input_resolution(struct venus_inst
*inst
,
37 unsigned int width
, unsigned int height
);
38 int venus_helper_set_output_resolution(struct venus_inst
*inst
,
39 unsigned int width
, unsigned int height
);
40 int venus_helper_set_num_bufs(struct venus_inst
*inst
, unsigned int input_bufs
,
41 unsigned int output_bufs
);
42 int venus_helper_set_color_format(struct venus_inst
*inst
, u32 fmt
);
43 void venus_helper_acquire_buf_ref(struct vb2_v4l2_buffer
*vbuf
);
44 void venus_helper_release_buf_ref(struct venus_inst
*inst
, unsigned int idx
);
45 void venus_helper_init_instance(struct venus_inst
*inst
);