acrn-hypervisor/devicemodel/include/vdisplay.h
Sun Peng e89ca5361a dm: vdisplay: terminate acrn-dm process when SDL init failed
Virtual display is component which based on native window system.
This feature depended phisical monitor connected and graphic driver in
SOS running correctly. If these dependencies fail, it is a fatal error
for virtual display. We have to terminate the device model to let user
fix runtime environment issue for graphics.

Tracked-On: #7672
Signed-off-by: Sun Peng <peng.p.sun@linux.intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-06-02 18:02:32 +08:00

100 lines
2.0 KiB
C

/*
* Copyright (C) 2022 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*
* Vistual Display for VMs
*
*/
#ifndef _VDISPLAY_H_
#define _VDISPLAY_H_
#include <sys/queue.h>
#include <pixman.h>
#include "dm.h"
typedef void (*bh_task_func)(void *data);
/* bh task is still pending */
#define ACRN_BH_PENDING (1 << 0)
/* bh task is done */
#define ACRN_BH_DONE (1 << 1)
/* free vdpy_display_bh after executing bh_cb */
#define ACRN_BH_FREE (1 << 2)
struct vdpy_display_bh {
TAILQ_ENTRY(vdpy_display_bh) link;
bh_task_func task_cb;
void *data;
uint32_t bh_flag;
};
struct edid_info {
char *vendor;
char *name;
char *sn;
uint32_t prefx;
uint32_t prefy;
uint32_t maxx;
uint32_t maxy;
uint32_t refresh_rate;
};
struct display_info {
/* geometry */
int xoff;
int yoff;
uint32_t width;
uint32_t height;
};
enum surface_type {
SURFACE_PIXMAN = 1,
SURFACE_DMABUF,
};
struct surface {
enum surface_type surf_type;
/* use pixman_format as the intermediate-format */
pixman_format_code_t surf_format;
uint32_t x;
uint32_t y;
uint32_t width;
uint32_t height;
uint32_t bpp;
uint32_t stride;
void *pixel;
struct {
int dmabuf_fd;
uint32_t surf_fourcc;
} dma_info;
};
struct cursor {
enum surface_type surf_type;
/* use pixman_format as the intermediate-format */
pixman_format_code_t surf_format;
uint32_t x;
uint32_t y;
uint32_t hot_x;
uint32_t hot_y;
uint32_t width;
uint32_t height;
void *data;
};
int vdpy_parse_cmd_option(const char *opts);
int gfx_ui_init();
int vdpy_init();
void vdpy_get_display_info(int handle, struct display_info *info);
void vdpy_surface_set(int handle, struct surface *surf);
void vdpy_surface_update(int handle, struct surface *surf);
bool vdpy_submit_bh(int handle, struct vdpy_display_bh *bh);
void vdpy_get_edid(int handle, uint8_t *edid, size_t size);
void vdpy_cursor_define(int handle, struct cursor *cur);
void vdpy_cursor_move(int handle, uint32_t x, uint32_t y);
int vdpy_deinit(int handle);
void gfx_ui_deinit();
#endif /* _VDISPLAY_H_ */