Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
50cb941a
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
50cb941a
编写于
3月 26, 2015
作者:
G
Gerd Hoffmann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add virtio-vga bits.
上级
284b2884
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
24 addition
and
20 deletion
+24
-20
drivers/gpu/drm/virtio/virtgpu_drm_bus.c
drivers/gpu/drm/virtio/virtgpu_drm_bus.c
+24
-20
未找到文件。
drivers/gpu/drm/virtio/virtgpu_drm_bus.c
浏览文件 @
50cb941a
...
...
@@ -37,6 +37,26 @@ int drm_virtio_set_busid(struct drm_device *dev, struct drm_master *master)
return
0
;
}
static
void
virtio_pci_kick_out_firmware_fb
(
struct
pci_dev
*
pci_dev
)
{
struct
apertures_struct
*
ap
;
bool
primary
;
ap
=
alloc_apertures
(
1
);
if
(
!
ap
)
return
;
ap
->
ranges
[
0
].
base
=
pci_resource_start
(
pci_dev
,
0
);
ap
->
ranges
[
0
].
size
=
pci_resource_len
(
pci_dev
,
0
);
primary
=
pci_dev
->
resource
[
PCI_ROM_RESOURCE
].
flags
&
IORESOURCE_ROM_SHADOW
;
remove_conflicting_framebuffers
(
ap
,
"virtiodrmfb"
,
primary
);
kfree
(
ap
);
}
int
drm_virtio_init
(
struct
drm_driver
*
driver
,
struct
virtio_device
*
vdev
)
{
struct
drm_device
*
dev
;
...
...
@@ -52,27 +72,11 @@ int drm_virtio_init(struct drm_driver *driver, struct virtio_device *vdev)
struct
pci_dev
*
pdev
=
to_pci_dev
(
vdev
->
dev
.
parent
);
bool
vga
=
(
pdev
->
class
>>
8
)
==
PCI_CLASS_DISPLAY_VGA
;
if
(
vga
)
{
/*
* Need to make sure we don't have two drivers
* for the same hardware here. Some day we
* will simply kick out the firmware
* (vesa/efi) framebuffer.
*
* Virtual hardware specs for virtio-vga are
* not finalized yet, therefore we can't add
* code for that yet.
*
* So ignore the device for the time being,
* and suggest to the user use the device
* variant without vga compatibility mode.
*/
DRM_ERROR
(
"virtio-vga not (yet) supported
\n
"
);
DRM_ERROR
(
"please use virtio-gpu-pci instead
\n
"
);
ret
=
-
ENODEV
;
goto
err_free
;
}
DRM_INFO
(
"pci: %s detected
\n
"
,
vga
?
"virtio-vga"
:
"virtio-gpu-pci"
);
dev
->
pdev
=
pdev
;
if
(
vga
)
virtio_pci_kick_out_firmware_fb
(
pdev
);
}
ret
=
drm_dev_register
(
dev
,
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录