GVM User Suite
User tools for the GVM open source project.
mdev.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 2666680 Ontario Inc.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  */
19 #ifndef GPU_MDEV_H
20 #define GPU_MDEV_H
21 
22 #include <stdint.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
33 struct Gpu {
34  uint32_t domain;
35  uint32_t bus;
36  uint32_t slot;
37  uint32_t function;
38  uint32_t vendor_id;
39  uint32_t device_id;
40  uint32_t sub_vendor_id;
41  uint32_t sub_device_id;
42  uint32_t identifier;
43 };
44 
49 struct VirtDisplay {
50  uint32_t num_heads;
51  uint32_t max_res_x;
52  uint32_t max_res_y;
53  uint32_t frl_config;
54  uint32_t frl_enable;
55 };
56 
62 struct MDevRequest {
63  uint32_t num;
64  uint64_t v_dev_id;
65  uint64_t p_dev_id;
66  const char* name;
67  const char* gpu_class;
68  uint32_t max_inst;
69  struct VirtDisplay* disp;
70  uint8_t ecc_support;
71  uint8_t multi_mdev;
72  uint32_t fb_len;
73  uint32_t fb_res;
74  uint32_t map_vid_size;
75  uint32_t enc_cap;
77  uint32_t bar1_len;
78 };
79 
80 #ifdef __cplusplus
81 };
82 #endif
83 
84 #endif
GPU Base Structure.
Definition: mdev.h:33
uint32_t identifier
Identifier for the GPU.
Definition: mdev.h:42
uint32_t device_id
Device id for the PCI device.
Definition: mdev.h:39
uint32_t slot
Slot for the PCI device.
Definition: mdev.h:36
uint32_t sub_vendor_id
Sub vendor id for the PCI device.
Definition: mdev.h:40
uint32_t bus
Bus for the PCI device.
Definition: mdev.h:35
uint32_t sub_device_id
Sub device id for the PCI device.
Definition: mdev.h:41
uint32_t vendor_id
Vendor id for the PCI device.
Definition: mdev.h:38
uint32_t domain
Domain for the PCI device.
Definition: mdev.h:34
Mediated Device Request Structure.
Definition: mdev.h:62
uint32_t map_vid_size
Mappable video size (IN MEGABYTES).
Definition: mdev.h:74
const char * name
Name of the GPU.
Definition: mdev.h:66
uint8_t ecc_support
If the Mediated GPU has ECC supported.
Definition: mdev.h:70
uint32_t bar1_len
Bar 1 Length.
Definition: mdev.h:77
uint8_t multi_mdev
If multiple mdevs supported.
Definition: mdev.h:71
uint32_t max_inst
Max number of mediated GPUs.
Definition: mdev.h:68
uint64_t v_dev_id
Virtual device id.
Definition: mdev.h:64
uint32_t fb_res
Frame buffer reserved (IN MEGABYTES).
Definition: mdev.h:73
uint64_t p_dev_id
Physical device id.
Definition: mdev.h:65
uint32_t fb_len
Frame buffer length (IN MEGABYTES).
Definition: mdev.h:72
uint32_t num
Number of the mdev.
Definition: mdev.h:63
uint32_t enc_cap
Definition: mdev.h:75
const char * gpu_class
GPU Class structure.
Definition: mdev.h:67
struct VirtDisplay * disp
Virtual display structure.
Definition: mdev.h:69
Virtual Display.
Definition: mdev.h:49
uint32_t frl_config
Frame rate limiter.
Definition: mdev.h:53
uint32_t max_res_y
Max resolution Y.
Definition: mdev.h:52
uint32_t frl_enable
If we use the frame rate limiter.
Definition: mdev.h:54
uint32_t max_res_x
Max resolution X.
Definition: mdev.h:51
uint32_t num_heads
Number of monitor heads.
Definition: mdev.h:50