Bug 7349

Summary: LCD monitor is seen as CRT
Product: ACPI Reporter: Ismail Donmez (ismail)
Component: Power-VideoAssignee: Zhang Rui (rui.zhang)
Status: CLOSED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: acpi-bugzilla
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.19-rc1 Subsystem:
Regression: --- Bisected commit-id:
Attachments: acpidump output
make several changes for video driver according to ACPI spec.
identify more video output devices

Description Ismail Donmez 2006-10-11 09:31:54 UTC
[~]> cat /proc/acpi/video/*/*/info
device_id:    0x0100
type:         CRT
known by bios: no
device_id:    0x0320
type:         UNKNOWN
known by bios: no
device_id:    0x0410
type:         UNKNOWN
known by bios: no
device_id:    0x0240
type:         UNKNOWN
known by bios: no
device_id:    0x0100
type:         CRT
known by bios: no
device_id:    0x0111
type:         UNKNOWN
known by bios: no
device_id:    0x0118
type:         UNKNOWN
known by bios: no
device_id:    0x0200
type:         TVOUT
known by bios: no

I will attach acpidump output.
Comment 1 Ismail Donmez 2006-10-11 09:32:48 UTC
Created attachment 9224 [details]
acpidump output
Comment 2 Zhang Rui 2006-10-12 00:20:28 UTC
According to the ACPI spec, the Bit 11:8 of device_id 
stands for display type
1 
Comment 3 Zhang Rui 2006-10-13 00:45:34 UTC
Created attachment 9243 [details]
make several changes for video driver according to ACPI spec.

This patch makes two changes for video driver:
1. get display type from Device Attributes instead of device_id.
2. check whether the video device can be detected by bios or not.

There is another fallible place in your acpidump output.
The return value of \_SB.PCI0.PEGP.NGFX._DOD method is 16bit
while 32bit device attributes should be returned according to the ACPI spec.
This may be a bios bug, and video driver can not get the display type listed in
this _DOD method.
Can you try this patch and paste the result? :)
Comment 4 Zhang Rui 2006-10-15 19:03:07 UTC
Created attachment 9250 [details]
identify more video output devices

Only part of the video bus has an _DOD method.
We should mark this kind of devices as "unknown".
Comment 5 Ismail Donmez 2006-10-16 06:36:48 UTC
Ok now at least one LCD shows up with the latest patch:

[~]> cat /proc/acpi/video/*/*/info
device_id:    0x0100
type:         CRT
known by bios: no
device_id:    0x0320
type:         DVI
known by bios: no
device_id:    0x0410
type:         LCD
known by bios: no
device_id:    0x0240
type:         TVOUT
known by bios: no
device_id:    0x0100
type:         UNKNOWN
known by bios: no
device_id:    0x0111
type:         UNKNOWN
known by bios: no
device_id:    0x0118
type:         UNKNOWN
known by bios: no
device_id:    0x0200
type:         UNKNOWN
known by bios: no
Comment 6 Zhang Rui 2006-10-16 18:35:59 UTC
I think this is the right result.
Two problems we should make clear:
1. On many laptops today, a number of devices can be connected to the graphics 
adapter in the machine. These devices are on the motherboard and generally are 
not directly enumerable by the video driver; for this reason, all motherboard 
VGA attached devices are listed in the ACPI namespace.
"Info" will show all the video devices listed in the ACPI namespace, not the 
one in use currently.
And there are 8 devices in the DSDT. So the output should list 8 video output 
devices.
2. As shown below, one of the _DOD methods( \_SB.PCI0.PEGP.NGFX._DOD )is buggy 
because the return value of _DOD method should be a buffer containing an array 
of 32-bit device attributes. 
And when Bit 31 is 0, no assumptions can be made on which ID will be used for 
any particular display type. Contact the Video Chip vendor for details of the 
ID scheme employed.
Video driver gets the device attribute and found that Bit 31 is 0. Then 
display type is set to UNKNOWN as a result.
Method (_DOD, 0, NotSerialized)
{
    Return (Package (0x04)
    {
        0x0100, 
        0x0118, 
        0x0200, 
        0x0111
    })
}
Comment 7 Len Brown 2007-01-03 20:36:23 UTC
patch in comment #4 merged into acpi-test
Comment 8 Len Brown 2007-03-08 01:19:10 UTC
shipped in 2.6.21-rc1
closed