From 58f393c9f97b6709d08cdfb740667708caf0e28b Mon Sep 17 00:00:00 2001
From: Andreas Faerber <andreas.faerber@web.de>
Date: Wed, 2 Jun 2010 19:12:00 +0200
Subject: [PATCH 7/7] Retrieve EDID info
---
src/system/boot/platform/openfirmware/Jamfile | 9 +++++++++
src/system/boot/platform/openfirmware/video.cpp | 20 ++++++++++++++++++++
2 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/src/system/boot/platform/openfirmware/Jamfile b/src/system/boot/platform/openfirmware/Jamfile
index bf3785c..188779b 100644
a
|
b
|
SubDir HAIKU_TOP src system boot platform openfirmware ;
|
2 | 2 | |
3 | 3 | SubDirC++Flags -D_BOOT_MODE -fno-rtti ; |
4 | 4 | |
| 5 | UsePrivateHeaders [ FDirName graphics common ] ; |
| 6 | |
| 7 | SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ; |
| 8 | |
5 | 9 | local genericPlatformSources = |
6 | 10 | text_menu.cpp |
7 | 11 | video_blit.cpp |
… |
… |
KernelMergeObject boot_platform_openfirmware.o :
|
27 | 31 | openfirmware_devices.cpp |
28 | 32 | |
29 | 33 | $(genericPlatformSources) |
| 34 | |
| 35 | # VESA/DDC EDID |
| 36 | decode_edid.c |
| 37 | dump_edid.c |
| 38 | |
30 | 39 | : |
31 | 40 | : boot_platform_openfirmware_$(TARGET_ARCH).a |
32 | 41 | ; |
diff --git a/src/system/boot/platform/openfirmware/video.cpp b/src/system/boot/platform/openfirmware/video.cpp
index 4b7575f..18ae1d4 100644
a
|
b
|
|
5 | 5 | */ |
6 | 6 | |
7 | 7 | |
| 8 | #include <edid.h> |
| 9 | |
8 | 10 | #include <boot/stage2.h> |
9 | 11 | #include <boot/platform.h> |
10 | 12 | #include <boot/platform/generic/video.h> |
11 | 13 | #include <platform/openfirmware/openfirmware.h> |
12 | 14 | |
13 | 15 | |
| 16 | //#define TRACE_VIDEO |
| 17 | |
| 18 | |
14 | 19 | static int sScreen; |
15 | 20 | |
16 | 21 | |
… |
… |
platform_init_video(void)
|
108 | 113 | { |
109 | 114 | gKernelArgs.frame_buffer.enabled = 0; |
110 | 115 | |
| 116 | int screen = of_finddevice("screen"); |
| 117 | if (screen == OF_FAILED) |
| 118 | return B_NO_INIT; |
| 119 | edid1_raw edidRaw; |
| 120 | if (of_getprop(screen, "EDID", &edidRaw, sizeof(edidRaw)) != OF_FAILED) { |
| 121 | edid1_info info; |
| 122 | edid_decode(&info, &edidRaw); |
| 123 | #ifdef TRACE_VIDEO |
| 124 | edid_dump(&info); |
| 125 | #endif |
| 126 | gKernelArgs.edid_info = kernel_args_malloc(sizeof(edid1_info)); |
| 127 | if (gKernelArgs.edid_info != NULL) |
| 128 | memcpy(gKernelArgs.edid_info, &info, sizeof(edid1_info)); |
| 129 | } |
| 130 | |
111 | 131 | return B_OK; |
112 | 132 | } |
113 | 133 | |