]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConSplitterDxe / ConSplitterGraphics.c
1 /** @file
2 Support for Graphics output spliter.
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8 **/
9
10 #include "ConSplitter.h"
11
12 CHAR16 mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL };
13
14 /**
15 Returns information for an available graphics mode that the graphics device
16 and the set of active video output devices supports.
17
18 @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
19 @param ModeNumber The mode number to return information on.
20 @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
21 @param Info A pointer to callee allocated buffer that returns information about ModeNumber.
22
23 @retval EFI_SUCCESS Mode information returned.
24 @retval EFI_BUFFER_TOO_SMALL The Info buffer was too small.
25 @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
26 @retval EFI_INVALID_PARAMETER One of the input args was NULL.
27 @retval EFI_OUT_OF_RESOURCES No resource available.
28
29 **/
30 EFI_STATUS
31 EFIAPI
32 ConSplitterGraphicsOutputQueryMode (
33 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
34 IN UINT32 ModeNumber,
35 OUT UINTN *SizeOfInfo,
36 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
37 )
38 {
39 TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
40 EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
41 EFI_STATUS Status;
42 UINTN Index;
43
44 if ((This == NULL) || (Info == NULL) || (SizeOfInfo == NULL) || (ModeNumber >= This->Mode->MaxMode)) {
45 return EFI_INVALID_PARAMETER;
46 }
47
48 //
49 // retrieve private data
50 //
51 Private = GRAPHICS_OUTPUT_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
52
53 GraphicsOutput = NULL;
54
55 if (Private->CurrentNumberOfGraphicsOutput == 1) {
56 //
57 // Find the only one GraphicsOutput.
58 //
59 for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
60 GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
61 if (GraphicsOutput != NULL) {
62 break;
63 }
64 }
65 }
66
67 if (GraphicsOutput != NULL) {
68 //
69 // If only one physical GOP device exist, return its information.
70 //
71 Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32)ModeNumber, SizeOfInfo, Info);
72 return Status;
73 } else {
74 //
75 // If 2 more phyiscal GOP device exist or GOP protocol does not exist,
76 // return GOP information (PixelFormat is PixelBltOnly) created in ConSplitterAddGraphicsOutputMode ().
77 //
78 *Info = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
79 if (*Info == NULL) {
80 return EFI_OUT_OF_RESOURCES;
81 }
82
83 *SizeOfInfo = sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
84 CopyMem (*Info, &Private->GraphicsOutputModeBuffer[ModeNumber], *SizeOfInfo);
85 }
86
87 return EFI_SUCCESS;
88 }
89
90 /**
91 Set the video device into the specified mode and clears the visible portions of
92 the output display to black.
93
94 @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
95 @param ModeNumber Abstraction that defines the current video mode.
96
97 @retval EFI_SUCCESS The graphics mode specified by ModeNumber was selected.
98 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
99 @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
100 @retval EFI_OUT_OF_RESOURCES No resource available.
101
102 **/
103 EFI_STATUS
104 EFIAPI
105 ConSplitterGraphicsOutputSetMode (
106 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
107 IN UINT32 ModeNumber
108 )
109 {
110 EFI_STATUS Status;
111 TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
112 UINTN Index;
113 EFI_STATUS ReturnStatus;
114 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Mode;
115 EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
116 EFI_GRAPHICS_OUTPUT_PROTOCOL *PhysicalGraphicsOutput;
117 UINTN NumberIndex;
118 UINTN SizeOfInfo;
119 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
120 EFI_UGA_DRAW_PROTOCOL *UgaDraw;
121
122 if (ModeNumber >= This->Mode->MaxMode) {
123 return EFI_UNSUPPORTED;
124 }
125
126 Private = GRAPHICS_OUTPUT_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
127 Mode = &Private->GraphicsOutputModeBuffer[ModeNumber];
128
129 ReturnStatus = EFI_SUCCESS;
130 GraphicsOutput = NULL;
131 PhysicalGraphicsOutput = NULL;
132 //
133 // return the worst status met
134 //
135 for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
136 GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
137 if (GraphicsOutput != NULL) {
138 PhysicalGraphicsOutput = GraphicsOutput;
139 //
140 // Find corresponding ModeNumber of this GraphicsOutput instance
141 //
142 for (NumberIndex = 0; NumberIndex < GraphicsOutput->Mode->MaxMode; NumberIndex++) {
143 Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32)NumberIndex, &SizeOfInfo, &Info);
144 if (EFI_ERROR (Status)) {
145 return Status;
146 }
147
148 if ((Info->HorizontalResolution == Mode->HorizontalResolution) && (Info->VerticalResolution == Mode->VerticalResolution)) {
149 FreePool (Info);
150 break;
151 }
152
153 FreePool (Info);
154 }
155
156 Status = GraphicsOutput->SetMode (GraphicsOutput, (UINT32)NumberIndex);
157 if (EFI_ERROR (Status)) {
158 ReturnStatus = Status;
159 }
160 } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
161 UgaDraw = Private->TextOutList[Index].UgaDraw;
162 if (UgaDraw != NULL) {
163 Status = UgaDraw->SetMode (
164 UgaDraw,
165 Mode->HorizontalResolution,
166 Mode->VerticalResolution,
167 32,
168 60
169 );
170 if (EFI_ERROR (Status)) {
171 ReturnStatus = Status;
172 }
173 }
174 }
175 }
176
177 This->Mode->Mode = ModeNumber;
178
179 if ((Private->CurrentNumberOfGraphicsOutput == 1) && (PhysicalGraphicsOutput != NULL)) {
180 //
181 // If only one physical GOP device exist, copy physical information to consplitter.
182 //
183 CopyMem (This->Mode->Info, PhysicalGraphicsOutput->Mode->Info, PhysicalGraphicsOutput->Mode->SizeOfInfo);
184 This->Mode->SizeOfInfo = PhysicalGraphicsOutput->Mode->SizeOfInfo;
185 This->Mode->FrameBufferBase = PhysicalGraphicsOutput->Mode->FrameBufferBase;
186 This->Mode->FrameBufferSize = PhysicalGraphicsOutput->Mode->FrameBufferSize;
187 } else {
188 //
189 // If 2 more phyiscal GOP device exist or GOP protocol does not exist,
190 // return GOP information (PixelFormat is PixelBltOnly) created in ConSplitterAddGraphicsOutputMode ().
191 //
192 CopyMem (This->Mode->Info, &Private->GraphicsOutputModeBuffer[ModeNumber], This->Mode->SizeOfInfo);
193 }
194
195 return ReturnStatus;
196 }
197
198 /**
199 The following table defines actions for BltOperations.
200
201 EfiBltVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY)
202 directly to every pixel of the video display rectangle
203 (DestinationX, DestinationY)
204 (DestinationX + Width, DestinationY + Height).
205 Only one pixel will be used from the BltBuffer. Delta is NOT used.
206 EfiBltVideoToBltBuffer - Read data from the video display rectangle
207 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
208 the BltBuffer rectangle (DestinationX, DestinationY )
209 (DestinationX + Width, DestinationY + Height). If DestinationX or
210 DestinationY is not zero then Delta must be set to the length in bytes
211 of a row in the BltBuffer.
212 EfiBltBufferToVideo - Write data from the BltBuffer rectangle
213 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
214 video display rectangle (DestinationX, DestinationY)
215 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
216 not zero then Delta must be set to the length in bytes of a row in the
217 BltBuffer.
218 EfiBltVideoToVideo - Copy from the video display rectangle
219 (SourceX, SourceY) (SourceX + Width, SourceY + Height) .
220 to the video display rectangle (DestinationX, DestinationY)
221 (DestinationX + Width, DestinationY + Height).
222 The BltBuffer and Delta are not used in this mode.
223
224 @param This Protocol instance pointer.
225 @param BltBuffer Buffer containing data to blit into video buffer.
226 This buffer has a size of
227 Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
228 @param BltOperation Operation to perform on BlitBuffer and video
229 memory
230 @param SourceX X coordinate of source for the BltBuffer.
231 @param SourceY Y coordinate of source for the BltBuffer.
232 @param DestinationX X coordinate of destination for the BltBuffer.
233 @param DestinationY Y coordinate of destination for the BltBuffer.
234 @param Width Width of rectangle in BltBuffer in pixels.
235 @param Height Hight of rectangle in BltBuffer in pixels.
236 @param Delta OPTIONAL.
237
238 @retval EFI_SUCCESS The Blt operation completed.
239 @retval EFI_INVALID_PARAMETER BltOperation is not valid.
240 @retval EFI_DEVICE_ERROR A hardware error occurred writting to the video
241 buffer.
242
243 **/
244 EFI_STATUS
245 EFIAPI
246 ConSplitterGraphicsOutputBlt (
247 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
248 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL,
249 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
250 IN UINTN SourceX,
251 IN UINTN SourceY,
252 IN UINTN DestinationX,
253 IN UINTN DestinationY,
254 IN UINTN Width,
255 IN UINTN Height,
256 IN UINTN Delta OPTIONAL
257 )
258 {
259 EFI_STATUS Status;
260 EFI_STATUS ReturnStatus;
261 TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
262 UINTN Index;
263 EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
264 EFI_UGA_DRAW_PROTOCOL *UgaDraw;
265
266 if ((This == NULL) || (((UINTN)BltOperation) >= EfiGraphicsOutputBltOperationMax)) {
267 return EFI_INVALID_PARAMETER;
268 }
269
270 Private = GRAPHICS_OUTPUT_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
271
272 ReturnStatus = EFI_SUCCESS;
273
274 //
275 // return the worst status met
276 //
277 for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
278 GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
279 if (GraphicsOutput != NULL) {
280 Status = GraphicsOutput->Blt (
281 GraphicsOutput,
282 BltBuffer,
283 BltOperation,
284 SourceX,
285 SourceY,
286 DestinationX,
287 DestinationY,
288 Width,
289 Height,
290 Delta
291 );
292 if (EFI_ERROR (Status)) {
293 ReturnStatus = Status;
294 } else if (BltOperation == EfiBltVideoToBltBuffer) {
295 //
296 // Only need to read the data into buffer one time
297 //
298 return EFI_SUCCESS;
299 }
300 }
301
302 UgaDraw = Private->TextOutList[Index].UgaDraw;
303 if ((UgaDraw != NULL) && FeaturePcdGet (PcdUgaConsumeSupport)) {
304 Status = UgaDraw->Blt (
305 UgaDraw,
306 (EFI_UGA_PIXEL *)BltBuffer,
307 (EFI_UGA_BLT_OPERATION)BltOperation,
308 SourceX,
309 SourceY,
310 DestinationX,
311 DestinationY,
312 Width,
313 Height,
314 Delta
315 );
316 if (EFI_ERROR (Status)) {
317 ReturnStatus = Status;
318 } else if (BltOperation == EfiBltVideoToBltBuffer) {
319 //
320 // Only need to read the data into buffer one time
321 //
322 return EFI_SUCCESS;
323 }
324 }
325 }
326
327 return ReturnStatus;
328 }
329
330 /**
331 Return the current video mode information.
332
333 @param This The EFI_UGA_DRAW_PROTOCOL instance.
334 @param HorizontalResolution The size of video screen in pixels in the X dimension.
335 @param VerticalResolution The size of video screen in pixels in the Y dimension.
336 @param ColorDepth Number of bits per pixel, currently defined to be 32.
337 @param RefreshRate The refresh rate of the monitor in Hertz.
338
339 @retval EFI_SUCCESS Mode information returned.
340 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
341 @retval EFI_INVALID_PARAMETER One of the input args was NULL.
342
343 **/
344 EFI_STATUS
345 EFIAPI
346 ConSplitterUgaDrawGetMode (
347 IN EFI_UGA_DRAW_PROTOCOL *This,
348 OUT UINT32 *HorizontalResolution,
349 OUT UINT32 *VerticalResolution,
350 OUT UINT32 *ColorDepth,
351 OUT UINT32 *RefreshRate
352 )
353 {
354 TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
355
356 if ((HorizontalResolution == NULL) ||
357 (VerticalResolution == NULL) ||
358 (RefreshRate == NULL) ||
359 (ColorDepth == NULL))
360 {
361 return EFI_INVALID_PARAMETER;
362 }
363
364 //
365 // retrieve private data
366 //
367 Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
368
369 *HorizontalResolution = Private->UgaHorizontalResolution;
370 *VerticalResolution = Private->UgaVerticalResolution;
371 *ColorDepth = Private->UgaColorDepth;
372 *RefreshRate = Private->UgaRefreshRate;
373
374 return EFI_SUCCESS;
375 }
376
377 /**
378 Set the current video mode information.
379
380 @param This The EFI_UGA_DRAW_PROTOCOL instance.
381 @param HorizontalResolution The size of video screen in pixels in the X dimension.
382 @param VerticalResolution The size of video screen in pixels in the Y dimension.
383 @param ColorDepth Number of bits per pixel, currently defined to be 32.
384 @param RefreshRate The refresh rate of the monitor in Hertz.
385
386 @retval EFI_SUCCESS Mode information returned.
387 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
388 @retval EFI_OUT_OF_RESOURCES Out of resources.
389
390 **/
391 EFI_STATUS
392 EFIAPI
393 ConSplitterUgaDrawSetMode (
394 IN EFI_UGA_DRAW_PROTOCOL *This,
395 IN UINT32 HorizontalResolution,
396 IN UINT32 VerticalResolution,
397 IN UINT32 ColorDepth,
398 IN UINT32 RefreshRate
399 )
400 {
401 EFI_STATUS Status;
402 TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
403 UINTN Index;
404 EFI_STATUS ReturnStatus;
405 EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
406 UINTN NumberIndex;
407 UINTN SizeOfInfo;
408 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
409 EFI_UGA_DRAW_PROTOCOL *UgaDraw;
410
411 Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
412
413 ReturnStatus = EFI_SUCCESS;
414
415 //
416 // Update the Mode data
417 //
418 Private->UgaHorizontalResolution = HorizontalResolution;
419 Private->UgaVerticalResolution = VerticalResolution;
420 Private->UgaColorDepth = ColorDepth;
421 Private->UgaRefreshRate = RefreshRate;
422
423 //
424 // return the worst status met
425 //
426 for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
427 GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
428 if (GraphicsOutput != NULL) {
429 //
430 // Find corresponding ModeNumber of this GraphicsOutput instance
431 //
432 for (NumberIndex = 0; NumberIndex < GraphicsOutput->Mode->MaxMode; NumberIndex++) {
433 Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32)NumberIndex, &SizeOfInfo, &Info);
434 if (EFI_ERROR (Status)) {
435 return Status;
436 }
437
438 if ((Info->HorizontalResolution == HorizontalResolution) && (Info->VerticalResolution == VerticalResolution)) {
439 FreePool (Info);
440 break;
441 }
442
443 FreePool (Info);
444 }
445
446 Status = GraphicsOutput->SetMode (GraphicsOutput, (UINT32)NumberIndex);
447 if (EFI_ERROR (Status)) {
448 ReturnStatus = Status;
449 }
450 } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
451 UgaDraw = Private->TextOutList[Index].UgaDraw;
452 if (UgaDraw != NULL) {
453 Status = UgaDraw->SetMode (
454 UgaDraw,
455 HorizontalResolution,
456 VerticalResolution,
457 ColorDepth,
458 RefreshRate
459 );
460 if (EFI_ERROR (Status)) {
461 ReturnStatus = Status;
462 }
463 }
464 }
465 }
466
467 return ReturnStatus;
468 }
469
470 /**
471 Blt a rectangle of pixels on the graphics screen.
472
473 The following table defines actions for BltOperations.
474
475 EfiUgaVideoFill:
476 Write data from the BltBuffer pixel (SourceX, SourceY)
477 directly to every pixel of the video display rectangle
478 (DestinationX, DestinationY)
479 (DestinationX + Width, DestinationY + Height).
480 Only one pixel will be used from the BltBuffer. Delta is NOT used.
481 EfiUgaVideoToBltBuffer:
482 Read data from the video display rectangle
483 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
484 the BltBuffer rectangle (DestinationX, DestinationY )
485 (DestinationX + Width, DestinationY + Height). If DestinationX or
486 DestinationY is not zero then Delta must be set to the length in bytes
487 of a row in the BltBuffer.
488 EfiUgaBltBufferToVideo:
489 Write data from the BltBuffer rectangle
490 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
491 video display rectangle (DestinationX, DestinationY)
492 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
493 not zero then Delta must be set to the length in bytes of a row in the
494 BltBuffer.
495 EfiUgaVideoToVideo:
496 Copy from the video display rectangle
497 (SourceX, SourceY) (SourceX + Width, SourceY + Height) .
498 to the video display rectangle (DestinationX, DestinationY)
499 (DestinationX + Width, DestinationY + Height).
500 The BltBuffer and Delta are not used in this mode.
501
502 @param This Protocol instance pointer.
503 @param BltBuffer Buffer containing data to blit into video buffer. This
504 buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
505 @param BltOperation Operation to perform on BlitBuffer and video memory
506 @param SourceX X coordinate of source for the BltBuffer.
507 @param SourceY Y coordinate of source for the BltBuffer.
508 @param DestinationX X coordinate of destination for the BltBuffer.
509 @param DestinationY Y coordinate of destination for the BltBuffer.
510 @param Width Width of rectangle in BltBuffer in pixels.
511 @param Height Hight of rectangle in BltBuffer in pixels.
512 @param Delta OPTIONAL
513
514 @retval EFI_SUCCESS The Blt operation completed.
515 @retval EFI_INVALID_PARAMETER BltOperation is not valid.
516 @retval EFI_DEVICE_ERROR A hardware error occurred writting to the video buffer.
517
518 **/
519 EFI_STATUS
520 EFIAPI
521 ConSplitterUgaDrawBlt (
522 IN EFI_UGA_DRAW_PROTOCOL *This,
523 IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
524 IN EFI_UGA_BLT_OPERATION BltOperation,
525 IN UINTN SourceX,
526 IN UINTN SourceY,
527 IN UINTN DestinationX,
528 IN UINTN DestinationY,
529 IN UINTN Width,
530 IN UINTN Height,
531 IN UINTN Delta OPTIONAL
532 )
533 {
534 EFI_STATUS Status;
535 TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
536 UINTN Index;
537 EFI_STATUS ReturnStatus;
538 EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
539
540 Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
541
542 ReturnStatus = EFI_SUCCESS;
543 //
544 // return the worst status met
545 //
546 for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
547 GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
548 if (GraphicsOutput != NULL) {
549 Status = GraphicsOutput->Blt (
550 GraphicsOutput,
551 (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)BltBuffer,
552 (EFI_GRAPHICS_OUTPUT_BLT_OPERATION)BltOperation,
553 SourceX,
554 SourceY,
555 DestinationX,
556 DestinationY,
557 Width,
558 Height,
559 Delta
560 );
561 if (EFI_ERROR (Status)) {
562 ReturnStatus = Status;
563 } else if (BltOperation == EfiUgaVideoToBltBuffer) {
564 //
565 // Only need to read the data into buffer one time
566 //
567 return EFI_SUCCESS;
568 }
569 }
570
571 if ((Private->TextOutList[Index].UgaDraw != NULL) && FeaturePcdGet (PcdUgaConsumeSupport)) {
572 Status = Private->TextOutList[Index].UgaDraw->Blt (
573 Private->TextOutList[Index].UgaDraw,
574 BltBuffer,
575 BltOperation,
576 SourceX,
577 SourceY,
578 DestinationX,
579 DestinationY,
580 Width,
581 Height,
582 Delta
583 );
584 if (EFI_ERROR (Status)) {
585 ReturnStatus = Status;
586 } else if (BltOperation == EfiUgaVideoToBltBuffer) {
587 //
588 // Only need to read the data into buffer one time
589 //
590 return EFI_SUCCESS;
591 }
592 }
593 }
594
595 return ReturnStatus;
596 }
597
598 /**
599 Sets the output device(s) to a specified mode.
600
601 @param Private Text Out Splitter pointer.
602 @param ModeNumber The mode number to set.
603
604 **/
605 VOID
606 TextOutSetMode (
607 IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private,
608 IN UINTN ModeNumber
609 )
610 {
611 //
612 // No need to do extra check here as whether (Column, Row) is valid has
613 // been checked in ConSplitterTextOutSetCursorPosition. And (0, 0) should
614 // always be supported.
615 //
616 Private->TextOutMode.Mode = (INT32)ModeNumber;
617 Private->TextOutMode.CursorColumn = 0;
618 Private->TextOutMode.CursorRow = 0;
619 Private->TextOutMode.CursorVisible = TRUE;
620
621 return;
622 }