/** @file\r
Graphics Output Protocol functions for the QEMU video controller.\r
\r
- Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
QemuVideoCompleteModeData (Private, This->Mode);\r
\r
//\r
- // Allocate when using first time.\r
+ // Re-initialize the frame buffer configure when mode changes.\r
//\r
- if (Private->FrameBufferBltConfigure == NULL) {\r
- Status = FrameBufferBltConfigure (\r
- (VOID*) (UINTN) This->Mode->FrameBufferBase,\r
- This->Mode->Info,\r
- Private->FrameBufferBltConfigure,\r
- &Private->FrameBufferBltConfigureSize\r
- );\r
- ASSERT (Status == RETURN_BUFFER_TOO_SMALL);\r
+ Status = FrameBufferBltConfigure (\r
+ (VOID*) (UINTN) This->Mode->FrameBufferBase,\r
+ This->Mode->Info,\r
+ Private->FrameBufferBltConfigure,\r
+ &Private->FrameBufferBltConfigureSize\r
+ );\r
+ if (Status == RETURN_BUFFER_TOO_SMALL) {\r
+ //\r
+ // Frame buffer configure may be larger in new mode.\r
+ //\r
+ if (Private->FrameBufferBltConfigure != NULL) {\r
+ FreePool (Private->FrameBufferBltConfigure);\r
+ }\r
Private->FrameBufferBltConfigure =\r
AllocatePool (Private->FrameBufferBltConfigureSize);\r
- }\r
+ ASSERT (Private->FrameBufferBltConfigure != NULL);\r
\r
- //\r
- // Create the configuration for FrameBufferBltLib\r
- //\r
- ASSERT (Private->FrameBufferBltConfigure != NULL);\r
- Status = FrameBufferBltConfigure (\r
- (VOID*) (UINTN) This->Mode->FrameBufferBase,\r
- This->Mode->Info,\r
- Private->FrameBufferBltConfigure,\r
- &Private->FrameBufferBltConfigureSize\r
- );\r
+ //\r
+ // Create the configuration for FrameBufferBltLib\r
+ //\r
+ Status = FrameBufferBltConfigure (\r
+ (VOID*) (UINTN) This->Mode->FrameBufferBase,\r
+ This->Mode->Info,\r
+ Private->FrameBufferBltConfigure,\r
+ &Private->FrameBufferBltConfigureSize\r
+ );\r
+ }\r
ASSERT (Status == RETURN_SUCCESS);\r
\r
return EFI_SUCCESS;\r