From 54e4fdb230a7125c3be3d6ff91b1a9f7b61a6393 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 d7f9c27..7d07d72 100644
a
|
b
|
|
5 | 5 | */ |
6 | 6 | |
7 | 7 | |
| 8 | #include <edid.h> |
| 9 | |
8 | 10 | #include <platform_arch.h> |
9 | 11 | #include <boot/stage2.h> |
10 | 12 | #include <boot/platform.h> |
… |
… |
|
13 | 15 | #include <arch_mmu.h> |
14 | 16 | |
15 | 17 | |
| 18 | //#define TRACE_VIDEO |
| 19 | |
| 20 | |
16 | 21 | static int sScreen; |
17 | 22 | static addr_t sFrameBuffer; |
18 | 23 | |
… |
… |
platform_init_video(void)
|
131 | 136 | if (sScreen == OF_FAILED) |
132 | 137 | return B_NO_INIT; |
133 | 138 | |
| 139 | int package = of_instance_to_package(sScreen); |
| 140 | if (package == OF_FAILED) |
| 141 | return B_NO_INIT; |
| 142 | edid1_raw edidRaw; |
| 143 | if (of_getprop(package, "EDID", &edidRaw, sizeof(edidRaw)) != OF_FAILED) { |
| 144 | edid1_info info; |
| 145 | edid_decode(&info, &edidRaw); |
| 146 | #ifdef TRACE_VIDEO |
| 147 | edid_dump(&info); |
| 148 | #endif |
| 149 | gKernelArgs.edid_info = kernel_args_malloc(sizeof(edid1_info)); |
| 150 | if (gKernelArgs.edid_info != NULL) |
| 151 | memcpy(gKernelArgs.edid_info, &info, sizeof(edid1_info)); |
| 152 | } |
| 153 | |
134 | 154 | return B_OK; |
135 | 155 | } |
136 | 156 | |