graphics_output.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2009 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GRUB_EFI_GOP_HEADER
  19. #define GRUB_EFI_GOP_HEADER 1
  20. /* Based on UEFI specification. */
  21. #define GRUB_EFI_GOP_GUID \
  22. { 0x9042a9de, 0x23dc, 0x4a38, { 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a }}
  23. typedef enum
  24. {
  25. GRUB_EFI_GOT_RGBA8,
  26. GRUB_EFI_GOT_BGRA8,
  27. GRUB_EFI_GOT_BITMASK,
  28. GRUB_EFI_GOT_BLT_ONLY,
  29. }
  30. grub_efi_gop_pixel_format_t;
  31. typedef enum
  32. {
  33. GRUB_EFI_BLT_VIDEO_FILL,
  34. GRUB_EFI_BLT_VIDEO_TO_BLT_BUFFER,
  35. GRUB_EFI_BLT_BUFFER_TO_VIDEO,
  36. GRUB_EFI_BLT_VIDEO_TO_VIDEO,
  37. GRUB_EFI_BLT_OPERATION_MAX
  38. }
  39. grub_efi_gop_blt_operation_t;
  40. struct grub_efi_gop_blt_pixel
  41. {
  42. grub_uint8_t blue;
  43. grub_uint8_t green;
  44. grub_uint8_t red;
  45. grub_uint8_t reserved;
  46. };
  47. struct grub_efi_gop_pixel_bitmask
  48. {
  49. grub_uint32_t r;
  50. grub_uint32_t g;
  51. grub_uint32_t b;
  52. grub_uint32_t a;
  53. };
  54. struct grub_efi_gop_mode_info
  55. {
  56. grub_efi_uint32_t version;
  57. grub_efi_uint32_t width;
  58. grub_efi_uint32_t height;
  59. grub_efi_gop_pixel_format_t pixel_format;
  60. struct grub_efi_gop_pixel_bitmask pixel_bitmask;
  61. grub_efi_uint32_t pixels_per_scanline;
  62. };
  63. struct grub_efi_gop_mode
  64. {
  65. grub_efi_uint32_t max_mode;
  66. grub_efi_uint32_t mode;
  67. struct grub_efi_gop_mode_info *info;
  68. grub_efi_uintn_t info_size;
  69. grub_efi_physical_address_t fb_base;
  70. grub_efi_uintn_t fb_size;
  71. };
  72. /* Forward declaration. */
  73. struct grub_efi_gop;
  74. typedef grub_efi_status_t
  75. (__grub_efi_api *grub_efi_gop_query_mode_t) (struct grub_efi_gop *this,
  76. grub_efi_uint32_t mode_number,
  77. grub_efi_uintn_t *size_of_info,
  78. struct grub_efi_gop_mode_info **info);
  79. typedef grub_efi_status_t
  80. (__grub_efi_api *grub_efi_gop_set_mode_t) (struct grub_efi_gop *this,
  81. grub_efi_uint32_t mode_number);
  82. typedef grub_efi_status_t
  83. (__grub_efi_api *grub_efi_gop_blt_t) (struct grub_efi_gop *this,
  84. void *buffer,
  85. grub_efi_uintn_t operation,
  86. grub_efi_uintn_t sx,
  87. grub_efi_uintn_t sy,
  88. grub_efi_uintn_t dx,
  89. grub_efi_uintn_t dy,
  90. grub_efi_uintn_t width,
  91. grub_efi_uintn_t height,
  92. grub_efi_uintn_t delta);
  93. struct grub_efi_gop
  94. {
  95. grub_efi_gop_query_mode_t query_mode;
  96. grub_efi_gop_set_mode_t set_mode;
  97. grub_efi_gop_blt_t blt;
  98. struct grub_efi_gop_mode *mode;
  99. };
  100. #endif