Landfall

Annotated pkg/devices/fb/src/lcd/fb-lcd-run.cc

153:929b5f0a63e4
16 months ago Paul Boddie Converted the remaining code to use libipc and generated IPC components. idl4re-libipc-libsystypes
paul@153 1
/*
paul@153 2
 * Export the framebuffer as a data space accessible via the "fb" capability.
paul@153 3
 *
paul@153 4
 * Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk>
paul@153 5
 *
paul@153 6
 * This program is free software; you can redistribute it and/or
paul@153 7
 * modify it under the terms of the GNU General Public License as
paul@153 8
 * published by the Free Software Foundation; either version 2 of
paul@153 9
 * the License, or (at your option) any later version.
paul@153 10
 *
paul@153 11
 * This program is distributed in the hope that it will be useful,
paul@153 12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
paul@153 13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
paul@153 14
 * GNU General Public License for more details.
paul@153 15
 *
paul@153 16
 * You should have received a copy of the GNU General Public License
paul@153 17
 * along with this program; if not, write to the Free Software
paul@153 18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
paul@153 19
 * Boston, MA  02110-1301, USA
paul@153 20
 */
paul@153 21
paul@153 22
#include "fb-lcd.h"
paul@153 23
#include "fb-lcd-run.h"
paul@153 24
#include "fb-run.h"
paul@153 25
paul@153 26
paul@153 27
paul@153 28
int fb_lcd_run()
paul@153 29
{
paul@153 30
  /* Obtain the LCD device. */
paul@153 31
paul@153 32
  Lcd_device *lcd_device = Lcd_device::get_device();
paul@153 33
paul@153 34
  /* Memory allocation capability for the framebuffer data. */
paul@153 35
paul@153 36
  l4re_ds_t mem = lcd_device->get_framebuffer_cap();
paul@153 37
paul@153 38
  if (l4_is_invalid_cap(mem))
paul@153 39
    return 1;
paul@153 40
paul@153 41
  /* Enable the LCD device. */
paul@153 42
paul@153 43
  lcd_device->enable();
paul@153 44
paul@153 45
  /* Initialise and register a server object. */
paul@153 46
paul@153 47
  Framebuffer_lcd_server obj(mem, lcd_device);
paul@153 48
paul@153 49
  return run(&obj);
paul@153 50
}