ACPI: video: fix LCD monitor seen as CRT

http://bugzilla.kernel.org/show_bug.cgi?id=7349

Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Rui Zhang 2007-01-03 23:40:53 -05:00 committed by Len Brown
parent 7523c4dd99
commit 82cae99980

View File

@ -57,6 +57,11 @@
#define ACPI_VIDEO_HEAD_INVALID (~0u - 1) #define ACPI_VIDEO_HEAD_INVALID (~0u - 1)
#define ACPI_VIDEO_HEAD_END (~0u) #define ACPI_VIDEO_HEAD_END (~0u)
#define ACPI_VIDEO_DISPLAY_CRT 1
#define ACPI_VIDEO_DISPLAY_TV 2
#define ACPI_VIDEO_DISPLAY_DVI 3
#define ACPI_VIDEO_DISPLAY_LCD 4
#define _COMPONENT ACPI_VIDEO_COMPONENT #define _COMPONENT ACPI_VIDEO_COMPONENT
ACPI_MODULE_NAME("acpi_video") ACPI_MODULE_NAME("acpi_video")
@ -133,9 +138,10 @@ struct acpi_video_device_flags {
u8 crt:1; u8 crt:1;
u8 lcd:1; u8 lcd:1;
u8 tvout:1; u8 tvout:1;
u8 dvi:1;
u8 bios:1; u8 bios:1;
u8 unknown:1; u8 unknown:1;
u8 reserved:3; u8 reserved:2;
}; };
struct acpi_video_device_cap { struct acpi_video_device_cap {
@ -668,6 +674,8 @@ static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset)
seq_printf(seq, "LCD\n"); seq_printf(seq, "LCD\n");
else if (dev->flags.tvout) else if (dev->flags.tvout)
seq_printf(seq, "TVOUT\n"); seq_printf(seq, "TVOUT\n");
else if (dev->flags.dvi)
seq_printf(seq, "DVI\n");
else else
seq_printf(seq, "UNKNOWN\n"); seq_printf(seq, "UNKNOWN\n");
@ -1242,6 +1250,16 @@ static int acpi_video_bus_remove_fs(struct acpi_device *device)
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
/* device interface */ /* device interface */
static struct acpi_video_device_attrib*
acpi_video_get_device_attr(struct acpi_video_bus *video, unsigned long device_id)
{
int count;
for(count = 0; count < video->attached_count; count++)
if((video->attached_array[count].value.int_val & 0xffff) == device_id)
return &(video->attached_array[count].value.attrib);
return NULL;
}
static int static int
acpi_video_bus_get_one_device(struct acpi_device *device, acpi_video_bus_get_one_device(struct acpi_device *device,
@ -1250,7 +1268,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
unsigned long device_id; unsigned long device_id;
int status; int status;
struct acpi_video_device *data; struct acpi_video_device *data;
struct acpi_video_device_attrib* attribute;
if (!device || !video) if (!device || !video)
return -EINVAL; return -EINVAL;
@ -1271,20 +1289,30 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
data->video = video; data->video = video;
data->dev = device; data->dev = device;
switch (device_id & 0xffff) { attribute = acpi_video_get_device_attr(video, device_id);
case 0x0100:
data->flags.crt = 1; if((attribute != NULL) && attribute->device_id_scheme) {
break; switch (attribute->display_type) {
case 0x0400: case ACPI_VIDEO_DISPLAY_CRT:
data->flags.lcd = 1; data->flags.crt = 1;
break; break;
case 0x0200: case ACPI_VIDEO_DISPLAY_TV:
data->flags.tvout = 1; data->flags.tvout = 1;
break; break;
default: case ACPI_VIDEO_DISPLAY_DVI:
data->flags.dvi = 1;
break;
case ACPI_VIDEO_DISPLAY_LCD:
data->flags.lcd = 1;
break;
default:
data->flags.unknown = 1;
break;
}
if(attribute->bios_can_detect)
data->flags.bios = 1;
} else
data->flags.unknown = 1; data->flags.unknown = 1;
break;
}
acpi_video_device_bind(video, data); acpi_video_device_bind(video, data);
acpi_video_device_find_cap(data); acpi_video_device_find_cap(data);