2 * Copyright (C) 2006-2017 Oracle Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
23 #ifndef __VBOXVIDEO_GUEST_H__
24 #define __VBOXVIDEO_GUEST_H__
26 #include <linux/genalloc.h>
27 #include "vboxvideo.h"
30 * Structure grouping the context needed for sending graphics acceleration
31 * information to the host via VBVA. Each screen has its own VBVA buffer.
34 /** Offset of the buffer in the VRAM section for the screen */
36 /** Length of the buffer in bytes */
38 /** Set if we wrote to the buffer faster than the host could read it */
40 /** VBVA record that we are currently preparing for the host, or NULL */
41 struct vbva_record *record;
43 * Pointer to the VBVA buffer mapped into the current address space.
44 * Will be NULL if VBVA is not enabled.
46 struct vbva_buffer *vbva;
50 * @name Base HGSMI APIs
53 int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location);
54 int hgsmi_send_caps_info(struct gen_pool *ctx, u32 caps);
55 int hgsmi_test_query_conf(struct gen_pool *ctx);
56 int hgsmi_query_conf(struct gen_pool *ctx, u32 index, u32 *value_ret);
57 int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags,
58 u32 hot_x, u32 hot_y, u32 width, u32 height,
60 int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position,
61 u32 x, u32 y, u32 *x_host, u32 *y_host);
68 bool vbva_enable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
69 struct vbva_buffer *vbva, s32 screen);
70 void vbva_disable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
72 bool vbva_buffer_begin_update(struct vbva_buf_ctx *vbva_ctx,
73 struct gen_pool *ctx);
74 void vbva_buffer_end_update(struct vbva_buf_ctx *vbva_ctx);
75 bool vbva_write(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
76 const void *p, u32 len);
77 void vbva_setup_buffer_context(struct vbva_buf_ctx *vbva_ctx,
78 u32 buffer_offset, u32 buffer_length);
82 * @name Modesetting APIs
85 void hgsmi_process_display_info(struct gen_pool *ctx, u32 display,
86 s32 origin_x, s32 origin_y, u32 start_offset,
87 u32 pitch, u32 width, u32 height,
89 int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y,
90 u32 width, u32 height);
91 int hgsmi_get_mode_hints(struct gen_pool *ctx, unsigned int screens,
92 struct vbva_modehint *hints);