1 1.1 riastrad /* $NetBSD: vboxvideo_guest.h,v 1.2 2021/12/18 23:45:44 riastradh Exp $ */ 2 1.1 riastrad 3 1.1 riastrad /* SPDX-License-Identifier: MIT */ 4 1.1 riastrad /* Copyright (C) 2006-2016 Oracle Corporation */ 5 1.1 riastrad 6 1.1 riastrad #ifndef __VBOXVIDEO_GUEST_H__ 7 1.1 riastrad #define __VBOXVIDEO_GUEST_H__ 8 1.1 riastrad 9 1.1 riastrad #include <linux/genalloc.h> 10 1.1 riastrad #include "vboxvideo.h" 11 1.1 riastrad 12 1.1 riastrad /* 13 1.1 riastrad * Structure grouping the context needed for sending graphics acceleration 14 1.1 riastrad * information to the host via VBVA. Each screen has its own VBVA buffer. 15 1.1 riastrad */ 16 1.1 riastrad struct vbva_buf_ctx { 17 1.1 riastrad /* Offset of the buffer in the VRAM section for the screen */ 18 1.1 riastrad u32 buffer_offset; 19 1.1 riastrad /* Length of the buffer in bytes */ 20 1.1 riastrad u32 buffer_length; 21 1.1 riastrad /* Set if we wrote to the buffer faster than the host could read it */ 22 1.1 riastrad bool buffer_overflow; 23 1.1 riastrad /* VBVA record that we are currently preparing for the host, or NULL */ 24 1.1 riastrad struct vbva_record *record; 25 1.1 riastrad /* 26 1.1 riastrad * Pointer to the VBVA buffer mapped into the current address space. 27 1.1 riastrad * Will be NULL if VBVA is not enabled. 28 1.1 riastrad */ 29 1.1 riastrad struct vbva_buffer *vbva; 30 1.1 riastrad }; 31 1.1 riastrad 32 1.1 riastrad int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location); 33 1.1 riastrad int hgsmi_send_caps_info(struct gen_pool *ctx, u32 caps); 34 1.1 riastrad int hgsmi_test_query_conf(struct gen_pool *ctx); 35 1.1 riastrad int hgsmi_query_conf(struct gen_pool *ctx, u32 index, u32 *value_ret); 36 1.1 riastrad int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags, 37 1.1 riastrad u32 hot_x, u32 hot_y, u32 width, u32 height, 38 1.1 riastrad u8 *pixels, u32 len); 39 1.1 riastrad int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position, 40 1.1 riastrad u32 x, u32 y, u32 *x_host, u32 *y_host); 41 1.1 riastrad 42 1.1 riastrad bool vbva_enable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx, 43 1.1 riastrad struct vbva_buffer *vbva, s32 screen); 44 1.1 riastrad void vbva_disable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx, 45 1.1 riastrad s32 screen); 46 1.1 riastrad bool vbva_buffer_begin_update(struct vbva_buf_ctx *vbva_ctx, 47 1.1 riastrad struct gen_pool *ctx); 48 1.1 riastrad void vbva_buffer_end_update(struct vbva_buf_ctx *vbva_ctx); 49 1.1 riastrad bool vbva_write(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx, 50 1.1 riastrad const void *p, u32 len); 51 1.1 riastrad void vbva_setup_buffer_context(struct vbva_buf_ctx *vbva_ctx, 52 1.1 riastrad u32 buffer_offset, u32 buffer_length); 53 1.1 riastrad 54 1.1 riastrad void hgsmi_process_display_info(struct gen_pool *ctx, u32 display, 55 1.1 riastrad s32 origin_x, s32 origin_y, u32 start_offset, 56 1.1 riastrad u32 pitch, u32 width, u32 height, 57 1.1 riastrad u16 bpp, u16 flags); 58 1.1 riastrad int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y, 59 1.1 riastrad u32 width, u32 height); 60 1.1 riastrad int hgsmi_get_mode_hints(struct gen_pool *ctx, unsigned int screens, 61 1.1 riastrad struct vbva_modehint *hints); 62 1.1 riastrad 63 1.1 riastrad #endif 64