Ticket #6105: 0003-OpenFirmware-Prepare-frame-buffer-support.patch

File 0003-OpenFirmware-Prepare-frame-buffer-support.patch, 2.0 KB (added by andreasf, 10 years ago)

proposed patch: prepare frame buffer support

  • src/system/boot/platform/openfirmware/console.cpp

    From 9b70622dca130614da8fb8bab971928a15af6322 Mon Sep 17 00:00:00 2001
    From: Andreas Faerber <andreas.faerber@web.de>
    Date: Tue, 1 Jun 2010 18:37:46 +0200
    Subject: [PATCH 3/4] OpenFirmware: Prepare frame buffer support
    
    ---
     src/system/boot/platform/openfirmware/console.cpp |    4 ++++
     src/system/boot/platform/openfirmware/video.cpp   |   12 +++++++++++-
     2 files changed, 15 insertions(+), 1 deletions(-)
    
    diff --git a/src/system/boot/platform/openfirmware/console.cpp b/src/system/boot/platform/openfirmware/console.cpp
    index a639fea..9a9b5ac 100644
    a b  
    88#include <string.h>
    99#include <platform/openfirmware/openfirmware.h>
    1010#include <util/kernel_cpp.h>
     11#include <boot/stage2.h>
    1112
    1213#include "Handle.h"
    1314#include "console.h"
    ConsoleHandle::WriteAt(void */*cookie*/, off_t /*pos*/, const void *buffer,  
    6970{
    7071    const char *string = (const char *)buffer;
    7172
     73    if (gKernelArgs.frame_buffer.enabled)
     74        return bufferSize;
     75
    7276    // be nice to our audience and replace single "\n" with "\r\n"
    7377
    7478    while (bufferSize > 0) {
  • 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 6dbe494..a2ff181 100644
    a b  
    44 */
    55
    66
     7#include <boot/stage2.h>
    78#include <boot/platform.h>
    89
    910
    1011extern "C" void
    1112platform_switch_to_logo(void)
    1213{
     14    // in debug mode, we'll never show the logo
     15    if ((platform_boot_options() & BOOT_OPTION_DEBUG_OUTPUT) != 0)
     16        return;
     17
    1318    // ToDo: implement me
    1419}
    1520
    platform_switch_to_logo(void)  
    1722extern "C" void
    1823platform_switch_to_text_mode(void)
    1924{
    20     // ToDo: implement me
     25    if (!gKernelArgs.frame_buffer.enabled)
     26        return;
     27
     28    gKernelArgs.frame_buffer.enabled = 0;
    2129}
    2230
    2331
    2432extern "C" status_t
    2533platform_init_video(void)
    2634{
     35    gKernelArgs.frame_buffer.enabled = 0;
     36
    2737    // ToDo: implement me
    2838    return B_OK;
    2939}