Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: MIT */
0002 /* Copyright (C) 2006-2016 Oracle Corporation */
0003 
0004 #ifndef __VBOXVIDEO_GUEST_H__
0005 #define __VBOXVIDEO_GUEST_H__
0006 
0007 #include <linux/genalloc.h>
0008 #include "vboxvideo.h"
0009 
0010 /*
0011  * Structure grouping the context needed for sending graphics acceleration
0012  * information to the host via VBVA.  Each screen has its own VBVA buffer.
0013  */
0014 struct vbva_buf_ctx {
0015     /* Offset of the buffer in the VRAM section for the screen */
0016     u32 buffer_offset;
0017     /* Length of the buffer in bytes */
0018     u32 buffer_length;
0019     /* Set if we wrote to the buffer faster than the host could read it */
0020     bool buffer_overflow;
0021     /* VBVA record that we are currently preparing for the host, or NULL */
0022     struct vbva_record *record;
0023     /*
0024      * Pointer to the VBVA buffer mapped into the current address space.
0025      * Will be NULL if VBVA is not enabled.
0026      */
0027     struct vbva_buffer *vbva;
0028 };
0029 
0030 int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location);
0031 int hgsmi_send_caps_info(struct gen_pool *ctx, u32 caps);
0032 int hgsmi_test_query_conf(struct gen_pool *ctx);
0033 int hgsmi_query_conf(struct gen_pool *ctx, u32 index, u32 *value_ret);
0034 int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags,
0035                    u32 hot_x, u32 hot_y, u32 width, u32 height,
0036                    u8 *pixels, u32 len);
0037 int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position,
0038               u32 x, u32 y, u32 *x_host, u32 *y_host);
0039 
0040 bool vbva_enable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
0041          struct vbva_buffer *vbva, s32 screen);
0042 void vbva_disable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
0043           s32 screen);
0044 bool vbva_buffer_begin_update(struct vbva_buf_ctx *vbva_ctx,
0045                   struct gen_pool *ctx);
0046 void vbva_buffer_end_update(struct vbva_buf_ctx *vbva_ctx);
0047 bool vbva_write(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
0048         const void *p, u32 len);
0049 void vbva_setup_buffer_context(struct vbva_buf_ctx *vbva_ctx,
0050                    u32 buffer_offset, u32 buffer_length);
0051 
0052 void hgsmi_process_display_info(struct gen_pool *ctx, u32 display,
0053                 s32 origin_x, s32 origin_y, u32 start_offset,
0054                 u32 pitch, u32 width, u32 height,
0055                 u16 bpp, u16 flags);
0056 int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y,
0057                    u32 width, u32 height);
0058 int hgsmi_get_mode_hints(struct gen_pool *ctx, unsigned int screens,
0059              struct vbva_modehint *hints);
0060 
0061 #endif