-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdfv_drm.c
More file actions
79 lines (66 loc) · 1.74 KB
/
dfv_drm.c
File metadata and controls
79 lines (66 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Device File-based I/O Virtualization (DFV)
* File: dfv_drm.c
*
* Copyright (c) 2014 Rice University, Houston, TX, USA
* All rights reserved.
*
* Authors: Ardalan Amiri Sani <arrdalan@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <linux/module.h>
#include <linux/slab.h>
#include "dfv_common.h"
#include "dfv_server.h"
#include "dfv_drm.h"
static struct guest_struct *fg_guest = NULL;
struct guest_struct *get_fg_guest(void)
{
return fg_guest;
}
EXPORT_SYMBOL(get_fg_guest);
bool __dfv_is_fg(void)
{
if (fg_guest)
return true;
return false;
}
int __dfv_drm_setcrtc(bool is_dfv)
{
if (is_dfv)
fg_guest = (struct guest_struct *) current->dfvguest;
else
fg_guest = NULL;
return 0;
}
int __dfv_drm_rmfb(void)
{
return 0;
}
static int __init dfv_drm_init(void)
{
dfv_drm_setcrtc = __dfv_drm_setcrtc;
dfv_drm_rmfb = __dfv_drm_rmfb;
dfv_is_fg = __dfv_is_fg;
return 0;
}
static void __exit dfv_drm_exit(void)
{
}
module_init(dfv_drm_init);
module_exit(dfv_drm_exit);
MODULE_AUTHOR("Ardalan Amiri Sani <arrdalan@gmail.com>");
MODULE_DESCRIPTION("Module for keeping track of foreground/background VMs "
"graphics for Device File-based I/O Virtualization");
MODULE_LICENSE("GPL");