1/*
2 * Copyright (C) 2013 Google, Inc.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef _VIDEO_ADF_CLIENT_H_
16#define _VIDEO_ADF_CLIENT_H_
17
18#include <video/adf.h>
19
20int adf_interface_blank(struct adf_interface *intf, u8 state);
21u8 adf_interface_dpms_state(struct adf_interface *intf);
22
23void adf_interface_current_mode(struct adf_interface *intf,
24		struct drm_mode_modeinfo *mode);
25size_t adf_interface_modelist(struct adf_interface *intf,
26		struct drm_mode_modeinfo *modelist, size_t n_modes);
27int adf_interface_set_mode(struct adf_interface *intf,
28		struct drm_mode_modeinfo *mode);
29int adf_interface_get_screen_size(struct adf_interface *intf, u16 *width,
30		u16 *height);
31int adf_interface_simple_buffer_alloc(struct adf_interface *intf, u16 w, u16 h,
32		u32 format, struct dma_buf **dma_buf, u32 *offset, u32 *pitch);
33struct sync_fence *adf_interface_simple_post(struct adf_interface *intf,
34		struct adf_buffer *buf);
35
36bool adf_overlay_engine_supports_format(struct adf_overlay_engine *eng,
37		u32 format);
38
39size_t adf_device_attachments(struct adf_device *dev,
40		struct adf_attachment *attachments, size_t n_attachments);
41size_t adf_device_attachments_allowed(struct adf_device *dev,
42		struct adf_attachment *attachments, size_t n_attachments);
43bool adf_device_attached(struct adf_device *dev, struct adf_overlay_engine *eng,
44		struct adf_interface *intf);
45bool adf_device_attach_allowed(struct adf_device *dev,
46		struct adf_overlay_engine *eng, struct adf_interface *intf);
47int adf_device_attach(struct adf_device *dev, struct adf_overlay_engine *eng,
48		struct adf_interface *intf);
49int adf_device_detach(struct adf_device *dev, struct adf_overlay_engine *eng,
50		struct adf_interface *intf);
51
52struct sync_fence *adf_device_post(struct adf_device *dev,
53		struct adf_interface **intfs, size_t n_intfs,
54		struct adf_buffer *bufs, size_t n_bufs, void *custom_data,
55		size_t custom_data_size);
56struct sync_fence *adf_device_post_nocopy(struct adf_device *dev,
57		struct adf_interface **intfs, size_t n_intfs,
58		struct adf_buffer *bufs, size_t n_bufs, void *custom_data,
59		size_t custom_data_size);
60
61#endif /* _VIDEO_ADF_CLIENT_H_ */
62