Ticket #6105: 0007-Retrieve-EDID-info.patch

File 0007-Retrieve-EDID-info.patch, 2.2 KB (added by andreasf, 10 years ago)

draft patch: read EDID

  • src/system/boot/platform/openfirmware/Jamfile

    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 ;  
    22
    33SubDirC++Flags -D_BOOT_MODE -fno-rtti ;
    44
     5UsePrivateHeaders [ FDirName graphics common ] ;
     6
     7SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ;
     8
    59local genericPlatformSources =
    610    text_menu.cpp
    711    video_blit.cpp
    KernelMergeObject boot_platform_openfirmware.o :  
    2731    openfirmware_devices.cpp
    2832
    2933    $(genericPlatformSources)
     34
     35    # VESA/DDC EDID
     36    decode_edid.c
     37    dump_edid.c
     38
    3039    :
    3140    : boot_platform_openfirmware_$(TARGET_ARCH).a
    3241;
  • src/system/boot/platform/openfirmware/video.cpp

    diff --git a/src/system/boot/platform/openfirmware/video.cpp b/src/system/boot/platform/openfirmware/video.cpp
    index d7f9c27..7d07d72 100644
    a b  
    55 */
    66
    77
     8#include <edid.h>
     9
    810#include <platform_arch.h>
    911#include <boot/stage2.h>
    1012#include <boot/platform.h>
     
    1315#include <arch_mmu.h>
    1416
    1517
     18//#define TRACE_VIDEO
     19
     20
    1621static int sScreen;
    1722static addr_t sFrameBuffer;
    1823
    platform_init_video(void)  
    131136    if (sScreen == OF_FAILED)
    132137        return B_NO_INIT;
    133138
     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
    134154    return B_OK;
    135155}
    136156