vboxvideo_guest.h 2.3 KB

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