2007-06-28 00:53:31 +02:00
|
|
|
/** @file
|
2007-11-22 07:00:39 +01:00
|
|
|
UGA IO protocol from the EFI 1.10 specification.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
Abstraction of a very simple graphics device.
|
2007-06-28 00:53:31 +02:00
|
|
|
|
2008-07-25 12:37:15 +02:00
|
|
|
Copyright (c) 2006 - 2008, Intel Corporation
|
2007-06-28 00:53:31 +02:00
|
|
|
All rights reserved. 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
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2007-06-28 00:53:31 +02:00
|
|
|
**/
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
#ifndef __UGA_IO_H__
|
|
|
|
#define __UGA_IO_H__
|
|
|
|
|
|
|
|
#define EFI_UGA_IO_PROTOCOL_GUID \
|
2007-06-28 00:53:31 +02:00
|
|
|
{ 0x61a4d49e, 0x6f68, 0x4f1b, { 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0xb, 0x7, 0xa2 } }
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
typedef struct _EFI_UGA_IO_PROTOCOL EFI_UGA_IO_PROTOCOL;
|
|
|
|
|
|
|
|
typedef UINT32 UGA_STATUS;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
UgaDtParentBus = 1,
|
|
|
|
UgaDtGraphicsController,
|
|
|
|
UgaDtOutputController,
|
|
|
|
UgaDtOutputPort,
|
|
|
|
UgaDtOther
|
2008-12-08 15:48:27 +01:00
|
|
|
} UGA_DEVICE_TYPE, *PUGA_DEVICE_TYPE;
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
typedef UINT32 UGA_DEVICE_ID, *PUGA_DEVICE_ID;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
UGA_DEVICE_TYPE deviceType;
|
|
|
|
UGA_DEVICE_ID deviceId;
|
|
|
|
UINT32 ui32DeviceContextSize;
|
|
|
|
UINT32 ui32SharedContextSize;
|
2008-12-08 15:48:27 +01:00
|
|
|
} UGA_DEVICE_DATA, *PUGA_DEVICE_DATA;
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
typedef struct _UGA_DEVICE {
|
|
|
|
VOID *pvDeviceContext;
|
|
|
|
VOID *pvSharedContext;
|
|
|
|
VOID *pvRunTimeContext;
|
|
|
|
struct _UGA_DEVICE *pParentDevice;
|
|
|
|
VOID *pvBusIoServices;
|
|
|
|
VOID *pvStdIoServices;
|
|
|
|
UGA_DEVICE_DATA deviceData;
|
2008-12-08 15:48:27 +01:00
|
|
|
} UGA_DEVICE, *PUGA_DEVICE;
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
UgaIoGetVersion = 1,
|
|
|
|
UgaIoGetChildDevice,
|
|
|
|
UgaIoStartDevice,
|
|
|
|
UgaIoStopDevice,
|
|
|
|
UgaIoFlushDevice,
|
|
|
|
UgaIoResetDevice,
|
|
|
|
UgaIoGetDeviceState,
|
|
|
|
UgaIoSetDeviceState,
|
|
|
|
UgaIoSetPowerState,
|
|
|
|
UgaIoGetMemoryConfiguration,
|
|
|
|
UgaIoSetVideoMode,
|
|
|
|
UgaIoCopyRectangle,
|
|
|
|
UgaIoGetEdidSegment,
|
|
|
|
UgaIoDeviceChannelOpen,
|
|
|
|
UgaIoDeviceChannelClose,
|
|
|
|
UgaIoDeviceChannelRead,
|
|
|
|
UgaIoDeviceChannelWrite,
|
|
|
|
UgaIoGetPersistentDataSize,
|
|
|
|
UgaIoGetPersistentData,
|
|
|
|
UgaIoSetPersistentData,
|
|
|
|
UgaIoGetDevicePropertySize,
|
|
|
|
UgaIoGetDeviceProperty,
|
|
|
|
UgaIoBtPrivateInterface
|
2008-12-08 15:48:27 +01:00
|
|
|
} UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;
|
2007-06-19 12:12:02 +02:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
IN UGA_IO_REQUEST_CODE ioRequestCode;
|
|
|
|
IN VOID *pvInBuffer;
|
|
|
|
IN UINT64 ui64InBufferSize;
|
|
|
|
OUT VOID *pvOutBuffer;
|
|
|
|
IN UINT64 ui64OutBufferSize;
|
|
|
|
OUT UINT64 ui64BytesReturned;
|
2007-07-13 05:21:40 +02:00
|
|
|
} UGA_IO_REQUEST, *PUGA_IO_REQUEST;
|
|
|
|
|
|
|
|
|
2008-10-31 05:26:08 +01:00
|
|
|
/**
|
2009-06-04 07:49:29 +02:00
|
|
|
Dynamically allocate storage for a child UGA_DEVICE.
|
2008-10-31 05:26:08 +01:00
|
|
|
|
|
|
|
@param[in] This The EFI_UGA_IO_PROTOCOL instance.
|
|
|
|
@param[in] ParentDevice ParentDevice specifies a pointer to the parent device of Device.
|
2007-07-13 05:21:40 +02:00
|
|
|
@param[in] DeviceData A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()
|
2008-10-31 05:26:08 +01:00
|
|
|
with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice.
|
|
|
|
@param[in] RunTimeContext Context to associate with Device.
|
2007-07-13 05:21:40 +02:00
|
|
|
@param[out] Device The Device returns a dynamically allocated child UGA_DEVICE object
|
2008-10-31 05:26:08 +01:00
|
|
|
for ParentDevice. The caller is responsible for deleting Device.
|
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS Device was returned.
|
|
|
|
@retval EFI_INVALID_PARAMETER One of the arguments was not valid.
|
|
|
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
**/
|
2007-06-19 12:12:02 +02:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_UGA_IO_PROTOCOL_CREATE_DEVICE)(
|
2007-07-13 05:21:40 +02:00
|
|
|
IN EFI_UGA_IO_PROTOCOL *This,
|
|
|
|
IN UGA_DEVICE *ParentDevice,
|
|
|
|
IN UGA_DEVICE_DATA *DeviceData,
|
2007-06-19 12:12:02 +02:00
|
|
|
IN VOID *RunTimeContext,
|
|
|
|
OUT UGA_DEVICE **Device
|
|
|
|
);
|
|
|
|
|
|
|
|
|
2008-10-31 05:26:08 +01:00
|
|
|
/**
|
2009-06-04 07:49:29 +02:00
|
|
|
Delete a dynamically allocated child UGA_DEVICE object that was allocated via CreateDevice().
|
2008-10-31 05:26:08 +01:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
@param[in] This The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is
|
2008-10-31 05:26:08 +01:00
|
|
|
defined in Section 10.7.
|
2007-07-13 05:21:40 +02:00
|
|
|
@param[in] Device The Device points to a UGA_DEVICE object that was dynamically
|
|
|
|
allocated via a CreateDevice() call.
|
2008-10-31 05:26:08 +01:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS Device was returned.
|
|
|
|
@retval EFI_INVALID_PARAMETER The Device was not allocated via CreateDevice().
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
**/
|
2007-06-19 12:12:02 +02:00
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-06-24 09:14:18 +02:00
|
|
|
(EFIAPI *EFI_UGA_IO_PROTOCOL_DELETE_DEVICE)(
|
2007-06-19 12:12:02 +02:00
|
|
|
IN EFI_UGA_IO_PROTOCOL * This,
|
|
|
|
IN UGA_DEVICE * Device
|
|
|
|
);
|
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
/**
|
2008-07-17 10:45:10 +02:00
|
|
|
This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2008-07-17 10:45:10 +02:00
|
|
|
@param pDevice pDevice specifies a pointer to a device object associated with a
|
2007-06-19 12:12:02 +02:00
|
|
|
device enumerated by a pIoRequest->ioRequestCode of type
|
|
|
|
UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL
|
|
|
|
is represented by pDevice being set to NULL.
|
|
|
|
|
2008-07-17 10:45:10 +02:00
|
|
|
@param pIoRequest
|
|
|
|
pIoRequest points to a caller allocated buffer that contains data
|
2007-06-19 12:12:02 +02:00
|
|
|
defined by pIoRequest->ioRequestCode. See Related Definitions for
|
|
|
|
a definition of UGA_IO_REQUEST_CODE s and their associated data
|
|
|
|
structures.
|
|
|
|
|
2008-07-17 10:45:10 +02:00
|
|
|
@return UGA_STATUS
|
2007-06-19 12:12:02 +02:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
**/
|
2008-07-17 10:45:10 +02:00
|
|
|
typedef UGA_STATUS
|
|
|
|
(EFIAPI *PUGA_FW_SERVICE_DISPATCH)(
|
|
|
|
IN PUGA_DEVICE pDevice,
|
|
|
|
IN OUT PUGA_IO_REQUEST pIoRequest
|
|
|
|
);
|
|
|
|
|
2008-10-13 04:54:29 +02:00
|
|
|
///
|
|
|
|
/// Provides a basic abstraction to send I/O requests to the graphics device and any of its children.
|
|
|
|
///
|
2007-06-19 12:12:02 +02:00
|
|
|
struct _EFI_UGA_IO_PROTOCOL {
|
|
|
|
EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;
|
|
|
|
EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;
|
|
|
|
PUGA_FW_SERVICE_DISPATCH DispatchService;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiUgaIoProtocolGuid;
|
|
|
|
|
|
|
|
//
|
|
|
|
// Data structure that is stored in the EFI Configuration Table with the
|
|
|
|
// EFI_UGA_IO_PROTOCOL_GUID. The option ROMs listed in this table may have
|
|
|
|
// EBC UGA drivers.
|
|
|
|
//
|
|
|
|
typedef struct {
|
|
|
|
UINT32 Version;
|
|
|
|
UINT32 HeaderSize;
|
|
|
|
UINT32 SizeOfEntries;
|
|
|
|
UINT32 NumberOfEntries;
|
|
|
|
} EFI_DRIVER_OS_HANDOFF_HEADER;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
EfiUgaDriverFromPciRom,
|
|
|
|
EfiUgaDriverFromSystem,
|
|
|
|
EfiDriverHandoffMax
|
|
|
|
} EFI_DRIVER_HANOFF_ENUM;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
EFI_DRIVER_HANOFF_ENUM Type;
|
|
|
|
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
|
|
|
VOID *PciRomImage;
|
|
|
|
UINT64 PciRomSize;
|
|
|
|
} EFI_DRIVER_OS_HANDOFF;
|
|
|
|
|
|
|
|
#endif
|