Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
device/oprom: Lists all supported vesa mode by oprom
This patch lists all supported vesa mode by oprom using Function 0x4F00 (return vbe controller information). This information might be useful for user to select correct vesa mode for oprom.
TEST=Enabling external pcie based graphics card on ICLRVP
Case 1: with unsupported vesa mode 0x118
Now coreboot will show below msg to user to know there is a potential issue with choosen vesa mode and better users know the failure rather going to depthcharge and debug further.
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4118 VBE: Function call invalid with unsupported video mode 0x118! User to select mode from below list - Supported Video Mode list for OpRom are: 0x110 0x111 0x113 0x114 0x116 0x117 0x119 0x11a 0x165 0x166 0x121 0x122 0x123 0x124 0x145 0x146 0x175 0x176 0x1d2 0x1d4
Error: In vbe_get_mode_info function
Case 2: with supported vesa mode 0x116
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4116 VBE: resolution: 1024x768@16 VBE: framebuffer: a0000000 VBE: Setting VESA mode 4116 VGA Option ROM was run
Change-Id: I02cba44374bc50ec3ec2819c97b6f5027c58387f Signed-off-by: Subrata Banik subrata.banik@intel.com --- M src/device/oprom/realmode/x86.c M src/device/oprom/yabel/vbe.c M src/include/vbe.h 3 files changed, 61 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/34284/1
diff --git a/src/device/oprom/realmode/x86.c b/src/device/oprom/realmode/x86.c index 9fe8747..ecd537a 100644 --- a/src/device/oprom/realmode/x86.c +++ b/src/device/oprom/realmode/x86.c @@ -36,6 +36,16 @@
#include "x86.h"
+typedef struct { + char signature[4]; + u16 version; + u8 *oem_string_ptr; + u32 capabilities; + u32 video_mode_ptr; + u16 total_memory; + char reserved[236]; +} __packed vbe_info_block; + /* The following symbols cannot be used directly. They need to be fixed up * to point to the correct address location after the code has been copied * to REALMODE_BASE. Absolute symbols are not used because those symbols are @@ -221,6 +231,44 @@ return mode_info_valid; }
+static int vbe_check_for_failure(int ah); + +static vbe_info_block vbe_get_ctrl_info(void) +{ + char *buffer = PTR_TO_REAL_MODE(__realmode_buffer); + vbe_info_block info; + u16 buffer_seg = (((unsigned long)buffer) >> 4) & 0xff00; + u16 buffer_adr = ((unsigned long)buffer) & 0xffff; + X86_EAX = realmode_interrupt(0x10, VESA_GET_INFO, 0x0000, 0x0000, 0x0000, + buffer_seg, buffer_adr); + if (vbe_check_for_failure(X86_AH)) + die("\nError: In %s function\n", __func__); + memcpy(&info, buffer, sizeof(vbe_info_block)); + + return info; +} + +static void vbe_oprom_list_supported_mode(uint16_t *video_mode_ptr) +{ + uint16_t mode; + printk(BIOS_DEBUG, "Supported Video Mode list for OpRom:\n"); + do { + mode = *video_mode_ptr++; + if (mode != 0xffff) + printk(BIOS_DEBUG, "%x\n", mode); + } while (mode != 0xffff); +} + +static void vbe_oprom_supported_mode_list(void) +{ + uint16_t segment, offset; + vbe_info_block info = vbe_get_ctrl_info(); + + offset = info.video_mode_ptr; + segment = info.video_mode_ptr >> 16; + + vbe_oprom_list_supported_mode((uint16_t *)((segment << 4) + offset)); +} /* * EAX register is used to indicate the completion status upon return from * VBE function in real mode. @@ -256,6 +304,7 @@ default: printk(BIOS_DEBUG, "VBE: Unsupported video mode %x!\n", CONFIG_FRAMEBUFFER_VESA_MODE); + vbe_oprom_supported_mode_list(); status = -1; break; } diff --git a/src/device/oprom/yabel/vbe.c b/src/device/oprom/yabel/vbe.c index 682bf00..8116c6b 100644 --- a/src/device/oprom/yabel/vbe.c +++ b/src/device/oprom/yabel/vbe.c @@ -59,6 +59,18 @@
#include <vbe.h>
+// these structs only store a subset of the VBE defined fields +// only those needed. +typedef struct { + char signature[4]; + u16 version; + u8 *oem_string_ptr; + u32 capabilities; + u16 video_mode_list[256]; // lets hope we never have more than + // 256 video modes... + u16 total_memory; +} vbe_info_t; + // pointer to VBEInfoBuffer, set by vbe_prepare u8 *vbe_info_buffer = 0;
diff --git a/src/include/vbe.h b/src/include/vbe.h index 2c40d05..67049be 100644 --- a/src/include/vbe.h +++ b/src/include/vbe.h @@ -34,18 +34,6 @@ u8 color_depth; } __packed screen_info_input_t;
-// these structs only store a subset of the VBE defined fields -// only those needed. -typedef struct { - char signature[4]; - u16 version; - u8 *oem_string_ptr; - u32 capabilities; - u16 video_mode_list[256]; // lets hope we never have more than - // 256 video modes... - u16 total_memory; -} vbe_info_t; - typedef struct { u16 mode_attributes; // 00 u8 win_a_attributes; // 02
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
Patch Set 1:
can we have any further review comment ?
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
Patch Set 2:
(2 comments)
general layout looks fine, but please don't return stack variables :-)
https://review.coreboot.org/c/coreboot/+/34284/2/src/device/oprom/realmode/x... File src/device/oprom/realmode/x86.c:
https://review.coreboot.org/c/coreboot/+/34284/2/src/device/oprom/realmode/x... PS2, Line 239: info that's a stack variable...
https://review.coreboot.org/c/coreboot/+/34284/2/src/device/oprom/realmode/x... PS2, Line 248: info ... and here you return it right before tearing down that part of the stack.
Hello Aaron Durbin, ron minnich, Arthur Heymans, Aamir Bohra, Duncan Laurie, build bot (Jenkins), Nico Huber, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34284
to look at the new patch set (#3).
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
device/oprom: Lists all supported vesa mode by oprom
This patch lists all supported vesa mode by oprom using Function 0x4F00 (return vbe controller information). This information might be useful for user to select correct vesa mode for oprom.
TEST=Enabling external pcie based graphics card on ICLRVP
Case 1: with unsupported vesa mode 0x118
Now coreboot will show below msg to user to know there is a potential issue with choosen vesa mode and better users know the failure rather going to depthcharge and debug further.
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4118 VBE: Function call invalid with unsupported video mode 0x118! User to select mode from below list - Supported Video Mode list for OpRom are: 0x110 0x111 0x113 0x114 0x116 0x117 0x119 0x11a 0x165 0x166 0x121 0x122 0x123 0x124 0x145 0x146 0x175 0x176 0x1d2 0x1d4
Error: In vbe_get_mode_info function
Case 2: with supported vesa mode 0x116
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4116 VBE: resolution: 1024x768@16 VBE: framebuffer: a0000000 VBE: Setting VESA mode 4116 VGA Option ROM was run
Change-Id: I02cba44374bc50ec3ec2819c97b6f5027c58387f Signed-off-by: Subrata Banik subrata.banik@intel.com --- M src/device/oprom/realmode/x86.c M src/device/oprom/yabel/vbe.c M src/include/vbe.h 3 files changed, 60 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/34284/3
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34284/2/src/device/oprom/realmode/x... File src/device/oprom/realmode/x86.c:
https://review.coreboot.org/c/coreboot/+/34284/2/src/device/oprom/realmode/x... PS2, Line 239: info
that's a stack variable...
Done
https://review.coreboot.org/c/coreboot/+/34284/2/src/device/oprom/realmode/x... PS2, Line 248: info
... and here you return it right before tearing down that part of the stack.
Done
Hello Aaron Durbin, ron minnich, Arthur Heymans, Aamir Bohra, Duncan Laurie, build bot (Jenkins), Nico Huber, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34284
to look at the new patch set (#4).
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
device/oprom: Lists all supported vesa mode by oprom
This patch lists all supported vesa mode by oprom using Function 0x4F00 (return vbe controller information). This information might be useful for user to select correct vesa mode for oprom.
TEST=Enabling external pcie based graphics card on ICLRVP
Case 1: with unsupported vesa mode 0x118
Now coreboot will show below msg to user to know there is a potential issue with choosen vesa mode and better users know the failure rather going to depthcharge and debug further.
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4118 VBE: Function call invalid with unsupported video mode 0x118! User to select mode from below list - Supported Video Mode list for OpRom are: 0x110 0x111 0x113 0x114 0x116 0x117 0x119 0x11a 0x165 0x166 0x121 0x122 0x123 0x124 0x145 0x146 0x175 0x176 0x1d2 0x1d4
Error: In vbe_get_mode_info function
Case 2: with supported vesa mode 0x116
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4116 VBE: resolution: 1024x768@16 VBE: framebuffer: a0000000 VBE: Setting VESA mode 4116 VGA Option ROM was run
Change-Id: I02cba44374bc50ec3ec2819c97b6f5027c58387f Signed-off-by: Subrata Banik subrata.banik@intel.com --- M src/device/oprom/realmode/x86.c M src/device/oprom/yabel/vbe.c M src/include/vbe.h 3 files changed, 60 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/34284/4
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
Patch Set 3: Code-Review+2
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
Patch Set 4:
Patch Set 3: Code-Review+2
sorry :( i saw one line (line 241) was >80, hence submitted another patchset
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
Patch Set 4: Code-Review+2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34284/4/src/device/oprom/realmode/x... File src/device/oprom/realmode/x86.c:
https://review.coreboot.org/c/coreboot/+/34284/4/src/device/oprom/realmode/x... PS4, Line 305: vbe_oprom_supported_mode_list(); This may lead to unwanted recursion and the `default` case makes it even more likely.
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
Patch Set 4: -Code-Review
(2 comments)
https://review.coreboot.org/c/coreboot/+/34284/4/src/device/oprom/realmode/x... File src/device/oprom/realmode/x86.c:
https://review.coreboot.org/c/coreboot/+/34284/4/src/device/oprom/realmode/x... PS4, Line 243: if (vbe_check_for_failure(X86_AH)) you could check for X86_AH == 3 here and handle it locally.
https://review.coreboot.org/c/coreboot/+/34284/4/src/device/oprom/realmode/x... PS4, Line 305: vbe_oprom_supported_mode_list();
This may lead to unwanted recursion and the `default` case makes it even […]
good catch
Hello Aaron Durbin, ron minnich, Arthur Heymans, Aamir Bohra, Duncan Laurie, build bot (Jenkins), Nico Huber, Patrick Georgi, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34284
to look at the new patch set (#5).
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
device/oprom: Lists all supported vesa mode by oprom
This patch lists all supported vesa mode by oprom using Function 0x4F00 (return vbe controller information). This information might be useful for user to select correct vesa mode for oprom.
TEST=Enabling external pcie based graphics card on ICLRVP
Case 1: with unsupported vesa mode 0x118
Now coreboot will show below msg to user to know there is a potential issue with choosen vesa mode and better users know the failure rather going to depthcharge and debug further.
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4118 VBE: Function call invalid with unsupported video mode 0x118! User to select mode from below list - Supported Video Mode list for OpRom are: 0x110 0x111 0x113 0x114 0x116 0x117 0x119 0x11a 0x165 0x166 0x121 0x122 0x123 0x124 0x145 0x146 0x175 0x176 0x1d2 0x1d4
Error: In vbe_get_mode_info function
Case 2: with supported vesa mode 0x116
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4116 VBE: resolution: 1024x768@16 VBE: framebuffer: a0000000 VBE: Setting VESA mode 4116 VGA Option ROM was run
Change-Id: I02cba44374bc50ec3ec2819c97b6f5027c58387f Signed-off-by: Subrata Banik subrata.banik@intel.com --- M src/device/oprom/realmode/x86.c M src/device/oprom/yabel/vbe.c M src/include/vbe.h 3 files changed, 61 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/34284/5
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34284/4/src/device/oprom/realmode/x... File src/device/oprom/realmode/x86.c:
https://review.coreboot.org/c/coreboot/+/34284/4/src/device/oprom/realmode/x... PS4, Line 243: if (vbe_check_for_failure(X86_AH))
you could check for X86_AH == 3 here and handle it locally.
technically VESA_GET_INFO can't return 0x3 because as per VBE Return Status description 0x3 signified that current video mode is invalid and this will only come with set mode function 0x4F02
AH == 03h: Function call invalid in current video mode
but the simplicity of vbe spec always shows AX has Vbe return status in case of all vbe function (0x0, 0x4f00/01/02 etc)
Output: AX = VBE Return Status
i understand the ugliness of this recursive call here, tried to remove this now and just make if(X86_AH) which will be only non-zero in case of any error from vbe function. Hope this solves our problem and avoid recursion.
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
Patch Set 5:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34284/4/src/device/oprom/realmode/x... File src/device/oprom/realmode/x86.c:
https://review.coreboot.org/c/coreboot/+/34284/4/src/device/oprom/realmode/x... PS4, Line 243: if (vbe_check_for_failure(X86_AH))
technically VESA_GET_INFO can't return 0x3 because as per VBE Return Status description 0x3 signifie […]
Done
https://review.coreboot.org/c/coreboot/+/34284/4/src/device/oprom/realmode/x... PS4, Line 305: vbe_oprom_supported_mode_list();
good catch
Done
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: Lists all supported vesa mode by oprom ......................................................................
Patch Set 5:
(1 comment)
Can this be tested in QEMU (with SeaVGABIOS(?))?
https://review.coreboot.org/c/coreboot/+/34284/5//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34284/5//COMMIT_MSG@7 PS5, Line 7: Lists List
Hello Aaron Durbin, ron minnich, Arthur Heymans, Aamir Bohra, Duncan Laurie, build bot (Jenkins), Nico Huber, Patrick Georgi, Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34284
to look at the new patch set (#6).
Change subject: device/oprom: List all supported vesa mode by oprom ......................................................................
device/oprom: List all supported vesa mode by oprom
This patch lists all supported vesa mode by oprom using Function 0x4F00 (return vbe controller information). This information might be useful for user to select correct vesa mode for oprom.
TEST=Enabling external pcie based graphics card on ICLRVP
Case 1: with unsupported vesa mode 0x118
Now coreboot will show below msg to user to know there is a potential issue with choosen vesa mode and better users know the failure rather going to depthcharge and debug further.
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4118 VBE: Function call invalid with unsupported video mode 0x118! User to select mode from below list - Supported Video Mode list for OpRom are: 0x110 0x111 0x113 0x114 0x116 0x117 0x119 0x11a 0x165 0x166 0x121 0x122 0x123 0x124 0x145 0x146 0x175 0x176 0x1d2 0x1d4
Error: In vbe_get_mode_info function
Case 2: with supported vesa mode 0x116
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4116 VBE: resolution: 1024x768@16 VBE: framebuffer: a0000000 VBE: Setting VESA mode 4116 VGA Option ROM was run
Change-Id: I02cba44374bc50ec3ec2819c97b6f5027c58387f Signed-off-by: Subrata Banik subrata.banik@intel.com --- M src/device/oprom/realmode/x86.c M src/device/oprom/yabel/vbe.c M src/include/vbe.h 3 files changed, 61 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/34284/6
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: List all supported vesa mode by oprom ......................................................................
Patch Set 6:
(1 comment)
Patch Set 5:
(1 comment)
Can this be tested in QEMU (with SeaVGABIOS(?))?
i believe yes, it can be tested.
https://review.coreboot.org/c/coreboot/+/34284/5//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34284/5//COMMIT_MSG@7 PS5, Line 7: Lists
List
Done
Patrick Georgi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: List all supported vesa mode by oprom ......................................................................
Patch Set 6: Code-Review+2
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: List all supported vesa mode by oprom ......................................................................
device/oprom: List all supported vesa mode by oprom
This patch lists all supported vesa mode by oprom using Function 0x4F00 (return vbe controller information). This information might be useful for user to select correct vesa mode for oprom.
TEST=Enabling external pcie based graphics card on ICLRVP
Case 1: with unsupported vesa mode 0x118
Now coreboot will show below msg to user to know there is a potential issue with choosen vesa mode and better users know the failure rather going to depthcharge and debug further.
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4118 VBE: Function call invalid with unsupported video mode 0x118! User to select mode from below list - Supported Video Mode list for OpRom are: 0x110 0x111 0x113 0x114 0x116 0x117 0x119 0x11a 0x165 0x166 0x121 0x122 0x123 0x124 0x145 0x146 0x175 0x176 0x1d2 0x1d4
Error: In vbe_get_mode_info function
Case 2: with supported vesa mode 0x116
Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 4116 VBE: resolution: 1024x768@16 VBE: framebuffer: a0000000 VBE: Setting VESA mode 4116 VGA Option ROM was run
Change-Id: I02cba44374bc50ec3ec2819c97b6f5027c58387f Signed-off-by: Subrata Banik subrata.banik@intel.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34284 Reviewed-by: Patrick Georgi pgeorgi@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/device/oprom/realmode/x86.c M src/device/oprom/yabel/vbe.c M src/include/vbe.h 3 files changed, 61 insertions(+), 12 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/src/device/oprom/realmode/x86.c b/src/device/oprom/realmode/x86.c index bf31bab..67e550c 100644 --- a/src/device/oprom/realmode/x86.c +++ b/src/device/oprom/realmode/x86.c @@ -36,6 +36,16 @@
#include "x86.h"
+typedef struct { + char signature[4]; + u16 version; + u8 *oem_string_ptr; + u32 capabilities; + u32 video_mode_ptr; + u16 total_memory; + char reserved[236]; +} __packed vbe_info_block; + /* The following symbols cannot be used directly. They need to be fixed up * to point to the correct address location after the code has been copied * to REALMODE_BASE. Absolute symbols are not used because those symbols are @@ -221,6 +231,44 @@ return mode_info_valid; }
+static int vbe_check_for_failure(int ah); + +static void vbe_get_ctrl_info(vbe_info_block *info) +{ + char *buffer = PTR_TO_REAL_MODE(__realmode_buffer); + u16 buffer_seg = (((unsigned long)buffer) >> 4) & 0xff00; + u16 buffer_adr = ((unsigned long)buffer) & 0xffff; + X86_EAX = realmode_interrupt(0x10, VESA_GET_INFO, 0x0000, 0x0000, + 0x0000, buffer_seg, buffer_adr); + /* If the VBE function completed successfully, 0x0 is returned in AH */ + if (X86_AH) + die("\nError: In %s function\n", __func__); + memcpy(info, buffer, sizeof(vbe_info_block)); +} + +static void vbe_oprom_list_supported_mode(uint16_t *video_mode_ptr) +{ + uint16_t mode; + printk(BIOS_DEBUG, "Supported Video Mode list for OpRom:\n"); + do { + mode = *video_mode_ptr++; + if (mode != 0xffff) + printk(BIOS_DEBUG, "%x\n", mode); + } while (mode != 0xffff); +} + +static void vbe_oprom_supported_mode_list(void) +{ + uint16_t segment, offset; + vbe_info_block info; + + vbe_get_ctrl_info(&info); + + offset = info.video_mode_ptr; + segment = info.video_mode_ptr >> 16; + + vbe_oprom_list_supported_mode((uint16_t *)((segment << 4) + offset)); +} /* * EAX register is used to indicate the completion status upon return from * VBE function in real mode. @@ -255,6 +303,7 @@ default: printk(BIOS_DEBUG, "VBE: Unsupported video mode %x!\n", CONFIG_FRAMEBUFFER_VESA_MODE); + vbe_oprom_supported_mode_list(); status = -1; break; } diff --git a/src/device/oprom/yabel/vbe.c b/src/device/oprom/yabel/vbe.c index 682bf00..8116c6b 100644 --- a/src/device/oprom/yabel/vbe.c +++ b/src/device/oprom/yabel/vbe.c @@ -59,6 +59,18 @@
#include <vbe.h>
+// these structs only store a subset of the VBE defined fields +// only those needed. +typedef struct { + char signature[4]; + u16 version; + u8 *oem_string_ptr; + u32 capabilities; + u16 video_mode_list[256]; // lets hope we never have more than + // 256 video modes... + u16 total_memory; +} vbe_info_t; + // pointer to VBEInfoBuffer, set by vbe_prepare u8 *vbe_info_buffer = 0;
diff --git a/src/include/vbe.h b/src/include/vbe.h index 2c40d05..67049be 100644 --- a/src/include/vbe.h +++ b/src/include/vbe.h @@ -34,18 +34,6 @@ u8 color_depth; } __packed screen_info_input_t;
-// these structs only store a subset of the VBE defined fields -// only those needed. -typedef struct { - char signature[4]; - u16 version; - u8 *oem_string_ptr; - u32 capabilities; - u16 video_mode_list[256]; // lets hope we never have more than - // 256 video modes... - u16 total_memory; -} vbe_info_t; - typedef struct { u16 mode_attributes; // 00 u8 win_a_attributes; // 02
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: List all supported vesa mode by oprom ......................................................................
Patch Set 7:
Can this be tested in QEMU (with SeaVGABIOS(?))?
i believe yes, it can be tested.
Not as easy as I though it would be. Qemu emulates an external graphics card by default and includes the option ROM. However, coreboot makes it hard to use (for reasons I don't understand, CB:4258). It's easy to patch (see below).
With this config:
CONFIG_VGA_ROM_RUN=y CONFIG_FRAMEBUFFER_SET_VESA_MODE=y CONFIG_FRAMEBUFFER_VESA_MODE_USER=y CONFIG_FRAMEBUFFER_VESA_MODE=0x1234
I get this:
$ qemu-system-i386 -bios build/coreboot.rom -serial stdio [...] PCI: 00:02.0 init ... CBFS: 'Master Header Locator' located CBFS at [200:40000) CBFS: Locating 'pci1234,1111.rom' CBFS: 'pci1234,1111.rom' not found. Option ROM address for PCI: 00:02.0 = fe060000 Copying VGA ROM Image from fe060000 to 0xc0000, 0x9600 bytes Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 5234 VBE: Function call failed!
Error: In vbe_get_mode_info function
Which seems correct regarding VBE spec. But it dies before it can show the list of supported video modes :-(
diff --git a/src/drivers/emulation/qemu/Kconfig b/src/drivers/emulation/qemu/Kconfig index 58daaa4487..e1c11a1479 100644 --- a/src/drivers/emulation/qemu/Kconfig +++ b/src/drivers/emulation/qemu/Kconfig @@ -1,5 +1,5 @@ config DRIVERS_EMULATION_QEMU_BOCHS - bool "bochs dispi interface vga driver" + bool default y depends on BOARD_EMULATION_QEMU_X86 depends on MAINBOARD_DO_NATIVE_VGA_INIT diff --git a/src/mainboard/emulation/qemu-i440fx/Kconfig b/src/mainboard/emulation/qemu-i440fx/Kconfig index 23526f96d9..e24196bcc4 100644 --- a/src/mainboard/emulation/qemu-i440fx/Kconfig +++ b/src/mainboard/emulation/qemu-i440fx/Kconfig @@ -11,7 +11,6 @@ config BOARD_SPECIFIC_OPTIONS select HAVE_ACPI_TABLES select BOARD_ROMSIZE_KB_256 select MAINBOARD_HAS_NATIVE_VGA_INIT - select MAINBOARD_FORCE_NATIVE_VGA_INIT select POSTCAR_STAGE select POSTCAR_CONSOLE
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34284 )
Change subject: device/oprom: List all supported vesa mode by oprom ......................................................................
Patch Set 7:
I get this:
$ qemu-system-i386 -bios build/coreboot.rom -serial stdio [...] PCI: 00:02.0 init ... CBFS: 'Master Header Locator' located CBFS at [200:40000) CBFS: Locating 'pci1234,1111.rom' CBFS: 'pci1234,1111.rom' not found. Option ROM address for PCI: 00:02.0 = fe060000 Copying VGA ROM Image from fe060000 to 0xc0000, 0x9600 bytes Calling Option ROM... ... Option ROM returned. VBE: Getting information about VESA mode 5234 VBE: Function call failed! Error: In vbe_get_mode_info function
Which seems correct regarding VBE spec. But it dies before it can show the list of supported video modes :-(
It guess its different error rather current video mode
AH == 0x01: Function call failed
the list of supported video modes will only appear in case of AH == 3