Thanks
Elvin
-----Original Message-----
From: Michael Chang [mailto:***@suse.com]=20
Sent: Monday, June 04, 2012 3:15 PM
To: edk2-***@lists.sourceforge.net
Subject: Re: [edk2] ConOut Protocol
Consplitter GOP protocol is constructed from real physical GOP protocol =
on video devices. When there is only 1 video device in system, the mode in =
Consplitter GOP protocol is this video device mode, if there are more than =
1 video devices in system, the mode in Consplitter GOP protocol are interse=
ction of all video devices modes. You mentioned in the case it is stride (P=
ixelPerLine) property, the virtual device GOP says 1366 but the physical de=
vice handle uses 1376. It is strange to me. You could check ConSplitterAddG=
raphicsOutputMode (), it creates GOP modes for Consplitter, for the first v=
ideo devices, it uses "CopyMem (CurrentGraphicsOutputMode->Info, GraphicsOu=
tput->Mode->Info, GraphicsOutput->Mode->SizeOfInfo);" to creates the first =
mode, in this code, what is the value of PixelsPerScanLine in your case?
FWIW. I paste the output of GOP handles. Note the translated CouOut variabl=
e device path is 'PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)'.
I will check the code pieces you pointed out and get the information you re=
quested, but since I don't have the source used in the uefi box, I'm not su=
re if I could get that if it requires insert debug output and rebuild.
$ dh -p GraphicsOutput
Handle dump by protocol 'GraphicsOutput'
D5: Txtout GraphicsOutput
146: DevPath (..0x0,0x0)/AcpiAdr(0x80010400))Txtout GraphicsOutput EdidDis=
covered EdidActive ConOut=20
$ dh D5
Handle D5 (BBEEC318)
Txtout (B81E5100) Attrib 7
* mode 0: col 80 row 25
mode 1: error Unsupported
mode 2: col 120 row 36
mode 3: col 128 row 40
mode 4: col 170 row 40
GraphicsOutput (B8401498)=20
HorizontalReslution 1366
VerticalReslution 768
PixelFormat PixelBlueGreenRedReserved8BitPerColor
PixelsPerScanLine 1366
FrameBufferBase 0xC0000000
FrameBufferSize 0x300000
62BDF38A-E3D5-492C-950C-23A7F66E672E (00000000)
F42F7782-012E-4C12-9956-49F94304F721 (B84014D8
$ dh 146
Handle 146 (BAD65698)
Dpath (BAD65618)=20
ACPI Device Path for Acpi
HID PNP0A03, UID 0
Hardware Device Path for PCI
Function (0) Device (1)
Hardware Device Path for PCI
Function (0) Device (0)
ACPI Device Path for AcpiAdr
Adr 80010400
AsStr: 'PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)/AcpiAdr(0x80010400)'
Txtout (BAE2E330) Attrib 7
* mode 0: col 80 row 25
mode 1: error Unsupported
mode 2: col 120 row 36
mode 3: col 128 row 40
mode 4: col 170 row 40
GraphicsOutput (BC0A7040)=20
HorizontalReslution 1366
VerticalReslution 768
PixelFormat PixelBlueGreenRedReserved8BitPerColor
PixelsPerScanLine 1376
FrameBufferBase 0xC0000000
FrameBufferSize 0x408000
EdidDiscovered (BC0A71C0)=20
EdidActive (BC0A71D0)=20
ConOut (0)=20
Thanks,
Michael
=20
Thanks
Elvin
-----Original Message-----
Sent: Monday, June 04, 2012 1:06 PM
Subject: Re: [edk2] ConOut Protocol
=20
Hi,
In UEFI spec, it mentioned about the ConOut global UEFI variable is=20
the device path (EFI_DEVICE_PATH_PROTOCOL) of default output=20
console, but seems don't have description on ConOut protocol, which=20
I could only find on EFI 1.10 Driver Writer's Guide
These protocols are part part of an implementation of the platforms con=
sole splitter and not part of the specification.
It is common (but not required) for a platform to implement a ConSplite=
r driver that produces a virtual console device, and this is the console th=
at is pointed to by the EFI System Table. So the ConSpliter redirects the c=
onsole output to multiple physical console devices. An example would be red=
irecting the output to a graphics card and a serial port at the same time.
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/MdeModulePk
g/
Universal/Console/ConSplitterDxe/
=20
Thanks to point me this. Yeah I think the cause of the problem is related=
with this virtual device created by ConSpliter driver (Thanks to the docum=
ent, I couldn't figure out what this virtual device come from and usage bef=
ore and now I learned that :)). It possesses GOP protocol as well and the m=
ode info is not identical with physical one in use. In the case it is strid=
e (PixelPerLine) property, the virtual device GOP says 1366 but the physica=
l device handle uses 1376.
=20
The Elilo picks 1366 instead of 1376 as it has no way to distinguish that=
and writes to linux kernel header. When kernel boots up the efifb (EFI fir=
mware framebuffer driver) would set mode according to what kernel header in=
structs it and then screen garbled because of stride not correct ..
=20
Could this be a bug of UEFI firmware ? Suppose that the retrieved info sh=
ould be identical with the on physical device in use. Or still it's up to t=
he EFI application or bootloader's responsibility to locate and use the phy=
sical's one handle (ie .. not trust the GOP info in the virtual device. ).
=20
"Driver #32 will install a ConOut device GUID on the handle if the=20
device path is listed in the ConOut global EFI variable ..."
"EFI uses these three protocols (ConIn, ConOut, and ErrOut) to mark=20
devices in the system, which have been selected by the user as=20
ConIn, ConOut, and StdErr. These protocols are actually just a GUID=20
without any services or data."
On my UEFI desktop "dh -p ConOut" reveals the handles.
I interested in this topic is becasue I want to leverage this=20
protocol to judge the correct handle if there are more than one=20
handle provides GOP protocol. For example, elilo simply picks the=20
first located device handle with GOP and use it, however in some=20
circumstance it leads to a garbled screen due to the handle is not=20
associated with the real physical output device.
Bad idea as they are part of an implementation, and not part of the spe=
c.
But I am now afarid that since this protocol is not in=20
specifcation, it would not be mandatory for drivers to install it=20
and may need to figure out other way to circumvant it (or anyone=20
has good suggestion to judge the correct handle to use for GOP mode=20
information during boot? )
Best thing to do is to use the ConOut variable. It will be a single or =
multi instance device path that represents the current console output devic=
es. So in our example above there would be a device path for the graphics c=
ard, and a device path for the serial device. Note there could be multiple =
GOP devices listed, not sure if you =A0plan to support that.
=20
Maybe to know the GOP of phyiscal device handle that console device in us=
e is sufficient.
=20
So basically you have a loop to extract device paths out of the ConOut =
variable, and for each device path you use the LocateDevicePath() boot serv=
ice to find the handle that contains the GOP. =A0You then use HandleProtoco=
l() to get a pointer to the GOP so you can access the frame buffer info.
=20
I did try the LocateDevicePath on the ConOut variable to find the handle =
contains GOP, but failed because the handle in interest is "child" device p=
ath of what ConOut variable contains. I need some way to manipulate the chi=
ld/parent handles and looked at EDK2's source to get some idea(like devtree=
), and finally give up the idea because I found the needed boot service for=
manipulating that is absent in gnu-efi which elilo relies on for interacti=
ng efi firmware.
=20
The edk2 has BSD =A0licensed device path library functions that you=20
may find useful, like GetNextDevicePathInstance ()
=20
Yeah. I'll give EDK2 a try. I found that gnu-efi is good, but lacks many =
new boot service and handy libs in EDK2 (Maybe I am wrong, because gnu-efi =
version in the distro I'm working is not latest). To have EDK2 be wider or =
easier adopted in linux distribution, we have to package it and somehow hav=
e to circumvent it's build infrastructure to be able to packaged and distri=
buted (in general an approach like make.
make install). It's now working in progress.
=20
https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/MdePkg/Libr
ar y/UefiDevicePathLib/UefiDevicePathLib.c
=20
Thanks,
Michael
=20
Thanks,
Andrew
Thanks,
Michael
-------------------------------------------------------------------
--
---------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and=20
threat landscape has changed and how IT managers can respond.
Discussions will include endpoint security, mobile security and the=20
latest in malware threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
--------------------------------------------------------------------
--
--------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and=20
threat landscape has changed and how IT managers can respond.
Discussions will include endpoint security, mobile security and the=20
latest in malware threats.
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
=20
----------------------------------------------------------------------
--------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and=20
threat landscape has changed and how IT managers can respond.=20
Discussions will include endpoint security, mobile security and the=20
latest in malware threats.=20
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
=20
----------------------------------------------------------------------
--------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and=20
threat landscape has changed and how IT managers can respond.=20
Discussions will include endpoint security, mobile security and the=20
latest in malware threats.=20
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
edk2-devel mailing list
https://lists.sourceforge.net/lists/listinfo/edk2-devel
--
Michael Chang
Software Engineer
Rm. B, 26F, No.216, Tun Hwa S. Rd., Sec.2 Taipei 106, Taiwan, R.O.C
+886223760030
***@suse.com
SUSE
---------------------------------------------------------------------------=
---
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat la=
ndscape has changed and how IT managers can respond. Discussions will inclu=
de endpoint security, mobile security and the latest in malware threats. ht=
tp://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/