/** @file
This file produces the graphics abstration of UGA Draw. It is called by
CirrusLogic5430.c file which deals with the EFI 1.1 driver model.
This file just does graphics.
Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CirrusLogic5430.h"
//
// UGA Draw Protocol Member Functions
//
)
{
if (Private->HardwareNeedsStarting) {
return EFI_NOT_STARTED;
}
if ((HorizontalResolution == NULL) ||
(VerticalResolution == NULL) ||
(ColorDepth == NULL) ||
(RefreshRate == NULL)) {
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
}
)
{
continue;
}
continue;
}
continue;
}
continue;
}
if (Private->LineBuffer) {
}
return EFI_OUT_OF_RESOURCES;
}
return EFI_SUCCESS;
}
return EFI_NOT_FOUND;
}
)
{
UINTN X;
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
//
// If Delta is zero, then the entire BltBuffer is being used, so Delta
// is the number of bytes in each row of BltBuffer. Since BltBuffer is Width pixels size,
// the number of bytes in each row can be computed.
//
if (Delta == 0) {
}
//
// We need to fill the Virtual Screen buffer with the blt data.
// The virtual screen is upside down, as the first row is the bootom row of
// the image.
//
//
// Make sure the SourceX, SourceY, DestinationX, DestinationY, Width, and Height parameters
// are valid for the operation and the current screen geometry.
//
if (BltOperation == EfiUgaVideoToBltBuffer) {
//
// Video to BltBuffer: Source is Video, destination is BltBuffer
//
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
} else {
//
// BltBuffer to Video: Source is BltBuffer, destination is Video
//
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
}
//
// We have to raise to TPL Notify, so we make an atomic write the frame buffer.
// We would not want a timer based event (Cursor, ...) to come in while we are
// doing this operation.
//
switch (BltOperation) {
case EfiUgaVideoToBltBuffer:
//
// Video to BltBuffer: Source is Video, destination is BltBuffer
//
0,
Width >> 2,
);
} else {
0,
);
}
for (X = 0; X < Width; X++) {
Blt = (EFI_UGA_PIXEL *) ((UINT8 *) BltBuffer + (DstY * Delta) + (DestinationX + X) * sizeof (EFI_UGA_PIXEL));
}
}
break;
case EfiUgaVideoToVideo:
//
// Perform hardware acceleration for Video to Video operations
//
SourceOffset = (SourceY * Private->ModeData[Private->CurrentMode].HorizontalResolution) + (SourceX);
Offset = (DestinationY * Private->ModeData[Private->CurrentMode].HorizontalResolution) + (DestinationX);
;
break;
case EfiUgaVideoFill:
0,
);
} else {
0,
);
}
} else {
0,
Width >> 2,
);
} else {
0,
);
}
}
}
break;
case EfiUgaBltBufferToVideo:
for (X = 0; X < Width; X++) {
Blt = (EFI_UGA_PIXEL *) ((UINT8 *) BltBuffer + (SrcY * Delta) + (SourceX + X) * sizeof (EFI_UGA_PIXEL));
Private->LineBuffer[X] = (UINT8) ((Blt->Red & 0xe0) | ((Blt->Green >> 3) & 0x1c) | ((Blt->Blue >> 6) & 0x03));
}
0,
Width >> 2,
);
} else {
0,
);
}
}
break;
default:
break;
}
return EFI_SUCCESS;
}
//
// Construction and Destruction functions
//
)
{
//
// Fill in Private->UgaDraw protocol
//
//
// Initialize the private data
//
Private->CurrentMode = 0;
//
// Initialize the hardware
//
);
DrawLogo (
);
return EFI_SUCCESS;
}