2
0

framebuffer.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef QEMU_FRAMEBUFFER_H
  2. #define QEMU_FRAMEBUFFER_H
  3. #include "exec/memory.h"
  4. /* Framebuffer device helper routines. */
  5. typedef void (*drawfn)(void *, uint8_t *, const uint8_t *, int, int);
  6. /* framebuffer_update_memory_section: Update framebuffer
  7. * #MemoryRegionSection, for example if the framebuffer is switched to
  8. * a different memory area.
  9. *
  10. * @mem_section: Output #MemoryRegionSection, to be passed to
  11. * framebuffer_update_display().
  12. * @root: #MemoryRegion within which the framebuffer lies
  13. * @base: Base address of the framebuffer within @root.
  14. * @rows: Height of the screen.
  15. * @src_width: Number of bytes in framebuffer memory between two rows.
  16. */
  17. void framebuffer_update_memory_section(
  18. MemoryRegionSection *mem_section,
  19. MemoryRegion *root,
  20. hwaddr base,
  21. unsigned rows,
  22. unsigned src_width);
  23. /* framebuffer_update_display: Draw the framebuffer on a surface.
  24. *
  25. * @ds: #DisplaySurface to draw to.
  26. * @mem_section: #MemoryRegionSection provided by
  27. * framebuffer_update_memory_section().
  28. * @cols: Width the screen.
  29. * @rows: Height of the screen.
  30. * @src_width: Number of bytes in framebuffer memory between two rows.
  31. * @dest_row_pitch: Number of bytes in the surface data between two rows.
  32. * Negative if the framebuffer is stored in the opposite order (e.g.
  33. * bottom-to-top) compared to the framebuffer.
  34. * @dest_col_pitch: Number of bytes in the surface data between two pixels.
  35. * Negative if the framebuffer is stored in the opposite order (e.g.
  36. * right-to-left) compared to the framebuffer.
  37. * @invalidate: True if the function should redraw the whole screen
  38. * without checking the DIRTY_MEMORY_VGA dirty bitmap.
  39. * @fn: Drawing function to be called for each row that has to be drawn.
  40. * @opaque: Opaque pointer passed to @fn.
  41. * @first_row: Pointer to an integer, receives the number of the first row
  42. * that was drawn (either the first dirty row, or 0 if @invalidate is true).
  43. * @last_row: Pointer to an integer, receives the number of the last row that
  44. * was drawn (either the last dirty row, or @rows-1 if @invalidate is true).
  45. */
  46. void framebuffer_update_display(
  47. DisplaySurface *ds,
  48. MemoryRegionSection *mem_section,
  49. int cols,
  50. int rows,
  51. int src_width,
  52. int dest_row_pitch,
  53. int dest_col_pitch,
  54. int invalidate,
  55. drawfn fn,
  56. void *opaque,
  57. int *first_row,
  58. int *last_row);
  59. #endif