XenevaOS
Loading...
Searching...
No Matches
Macros | Functions
virtscreen.cpp File Reference
#include "virtiogpu.h"
#include <stdint.h>
#include <Drivers/virtio.h>
#include <Mm/vmmngr.h>
#include <Mm/pmmngr.h>
#include <Drivers/uart.h>
#include <aucon.h>
#include <aurora.h>
Include dependency graph for virtscreen.cpp:

Macros

#define GPU_FB_BUFFER   0xFFFFD00000700000
 

Functions

int virt_gpu_screen_init (VirtioCommonCfg *cfg, uint32_t width, uint32_t height)
 virt_gpu_screen_init – initialize screen
 
void virt_gpu_alloc_fb (VirtioCommonCfg *cfg, int resource_id)
 virt_gpu_alloc_fb – allocate framebuffer for scanout
 
void virt_gpu_set_scanout (VirtioCommonCfg *cfg, int resource_id, int scanout_id)
 virt_gpu_set_scanout – initialize the scanout to the given screen
 
void virt_gpu_transfer_to_host2d (VirtioCommonCfg *cfg, int resource_id, int x, int y, int w, int h)
 virt_gpu_transfer_to_host2d – transfer buffers from guest to host
 
void virt_gpu_flush (VirtioCommonCfg *cfg, int resource_id)
 virt_gpu_flush – flush graphics from guest to host
 
void virt_gpu_flush_rect (VirtioCommonCfg *cfg, int resource_id, int x, int y, int w, int h)
 virt_gpu_flush_rect – flush graphics from guest to host only with given rect area
 
void virt_gpu_fill_screen (uint32_t width, uint32_t height, uint32_t color)
 virt_gpu_fill_screen – fill the screen with specific color
 

Detailed Description

BSD 2-Clause License

Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ GPU_FB_BUFFER

#define GPU_FB_BUFFER   0xFFFFD00000700000

Function Documentation

◆ virt_gpu_alloc_fb()

void virt_gpu_alloc_fb ( VirtioCommonCfg cfg,
int  resource_id 
)

virt_gpu_alloc_fb – allocate framebuffer for scanout

Parameters
cfg– pointer to virtio common config
resource_id– resource id number

◆ virt_gpu_fill_screen()

void virt_gpu_fill_screen ( uint32_t  width,
uint32_t  height,
uint32_t  color 
)

virt_gpu_fill_screen – fill the screen with specific color

Parameters
width– width of the screen
height– height of the screen
color– color to fill with

◆ virt_gpu_flush()

void virt_gpu_flush ( VirtioCommonCfg cfg,
int  resource_id 
)

virt_gpu_flush – flush graphics from guest to host

Parameters
cfg– pointer to virtio common config
resource_id– screen resource id

◆ virt_gpu_flush_rect()

void virt_gpu_flush_rect ( VirtioCommonCfg cfg,
int  resource_id,
int  x,
int  y,
int  w,
int  h 
)

virt_gpu_flush_rect – flush graphics from guest to host only with given rect area

Parameters
cfg– pointer to virtio common config
resource_id– screen resource id

◆ virt_gpu_screen_init()

int virt_gpu_screen_init ( VirtioCommonCfg cfg,
uint32_t  width,
uint32_t  height 
)

virt_gpu_screen_init – initialize screen

Parameters
cfg– pointer to virtio common config
width– width of the screen
height– height of the screen
Returns
resource id allocated for this screen

◆ virt_gpu_set_scanout()

void virt_gpu_set_scanout ( VirtioCommonCfg cfg,
int  resource_id,
int  scanout_id 
)

virt_gpu_set_scanout – initialize the scanout to the given screen

Parameters
cfg– Pointer to virtio common config
resource_id– screen resource id

◆ virt_gpu_transfer_to_host2d()

void virt_gpu_transfer_to_host2d ( VirtioCommonCfg cfg,
int  resource_id,
int  x,
int  y,
int  w,
int  h 
)

virt_gpu_transfer_to_host2d – transfer buffers from guest to host

Parameters
cfg– Pointer to virtio common config
resource_id– screen resource id
x– X coord of the rect
y– Y coord of the rect
w– Width of the rect
h– Height of the rect