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

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

draft patch: read EDID

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

    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 ;  
    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 4b7575f..18ae1d4 100644
    a b  
    55 */
    66
    77
     8#include <edid.h>
     9
    810#include <boot/stage2.h>
    911#include <boot/platform.h>
    1012#include <boot/platform/generic/video.h>
    1113#include <platform/openfirmware/openfirmware.h>
    1214
    1315
     16//#define TRACE_VIDEO
     17
     18
    1419static int sScreen;
    1520
    1621
    platform_init_video(void)  
    108113{
    109114    gKernelArgs.frame_buffer.enabled = 0;
    110115
     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
    111131    return B_OK;
    112132}
    113133