The hypervisor has been supplying this information for a couple of major releases. Make use of it. The need to set a flag in the capabilities field also points out that the prior setting of that field from the hypervisor interface's gbl_caps one was wrong, so that code gets deleted (there's also no equivalent of this in native boot code). Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Unified · Split
| @@ -62,14 +62,18 @@ void __init xen_init_vga(const struct dom0_vga_console_info *info, size_t size) · 61 unmodified lines | |||
| 62 | break; | 62 | break; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | if (size >= offsetof(struct dom0_vga_console_info, | ||
| 66 | u.vesa_lfb.gbl_caps) | ||
| 67 | + sizeof(info->u.vesa_lfb.gbl_caps)) | ||
| 68 | screen_info->capabilities = info->u.vesa_lfb.gbl_caps; | ||
| 69 | if (size >= offsetof(struct dom0_vga_console_info, | 65 | if (size >= offsetof(struct dom0_vga_console_info, |
| 70 | u.vesa_lfb.mode_attrs) | 66 | u.vesa_lfb.mode_attrs) |
| 71 | + sizeof(info->u.vesa_lfb.mode_attrs)) | 67 | + sizeof(info->u.vesa_lfb.mode_attrs)) |
| 72 | screen_info->vesa_attributes = info->u.vesa_lfb.mode_attrs; | 68 | screen_info->vesa_attributes = info->u.vesa_lfb.mode_attrs; |
| 69 | |||
| 70 | if (size >= offsetof(struct dom0_vga_console_info, | ||
| 71 | u.vesa_lfb.ext_lfb_base) | ||
| 72 | + sizeof(info->u.vesa_lfb.ext_lfb_base) | ||
| 73 | && info->u.vesa_lfb.ext_lfb_base) { | ||
| 74 | screen_info->ext_lfb_base = info->u.vesa_lfb.ext_lfb_base; | ||
| 75 | screen_info->capabilities |= VIDEO_CAPABILITY_64BIT_BASE; | ||
| 76 | } | ||
| 73 | break; | 77 | break; |
| 74 | } | 78 | } |
| 75 | } | 79 | } |
| @@ -722,6 +722,9 @@ struct dom0_vga_console_info { · 721 unmodified lines | |||
| 722 | uint32_t gbl_caps; | 722 | uint32_t gbl_caps; |
| 723 | /* Mode attributes (offset 0x0, VESA command 0x4f01). */ | 723 | /* Mode attributes (offset 0x0, VESA command 0x4f01). */ |
| 724 | uint16_t mode_attrs; | 724 | uint16_t mode_attrs; |
| 725 | uint16_t pad; | ||
| 726 | /* high 32 bits of lfb_base */ | ||
| 727 | uint32_t ext_lfb_base; | ||
| 725 | } vesa_lfb; | 728 | } vesa_lfb; |
| 726 | } u; | 729 | } u; |
| 727 | }; | 730 | }; |