1 Star 0 Fork 10

yaokai13/xorg-x11-drv-vesa

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-Disable-shadow-by-default-on-known-virtual-GPUs.patch 1.88 KB
一键复制 编辑 原始数据 按行查看 历史
algorithmofdish 提交于 5年前 . package init
From 57301015f16e26f12caf6f6cb4d730e7793cb2c3 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 30 May 2018 11:46:46 -0400
Subject: [PATCH xf86-video-vesa] Disable shadow by default on known-virtual
GPUs
Device memory is the same domain as host memory, in this case, so the
shadow just introduces more memcpy.
Signed-off-by: Adam Jackson <ajax@redhat.com>
---
src/vesa.c | 35 ++++++++++++++++++++++++++++++++---
1 file changed, 32 insertions(+), 3 deletions(-)
diff --git a/src/vesa.c b/src/vesa.c
index 2300f4e..7d2bf94 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -844,9 +844,38 @@ VESAPreInit(ScrnInfoPtr pScrn, int flags)
memcpy(pVesa->Options, VESAOptions, sizeof(VESAOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pVesa->Options);
- /* Use shadow by default */
- pVesa->shadowFB = xf86ReturnOptValBool(pVesa->Options, OPTION_SHADOW_FB,
- TRUE);
+ /* Use shadow by default, for non-virt hardware */
+ if (!xf86GetOptValBool(pVesa->Options, OPTION_SHADOW_FB, &pVesa->shadowFB))
+ {
+ switch (pVesa->pciInfo->vendor_id) {
+ case 0x1234: /* bochs vga (not in pci.ids) */
+ case 0x15ad: /* vmware */
+ case 0x1b36: /* qemu qxl */
+ case 0x80ee: /* virtualbox */
+ case 0xaaaa: /* parallels (not in pci.ids) */
+ pVesa->shadowFB = FALSE;
+ break;
+
+ case 0x1013: /* qemu's cirrus emulation */
+ if (pVesa->pciInfo->subvendor_id == 0x1af4)
+ pVesa->shadowFB = FALSE;
+ else
+ pVesa->shadowFB = TRUE;
+ break;
+
+ case 0x1414: /* microsoft hyper-v */
+ if (pVesa->pciInfo->device_id == 0x5353)
+ pVesa->shadowFB = FALSE;
+ else
+ pVesa->shadowFB = TRUE;
+ break;
+
+ default:
+ pVesa->shadowFB = TRUE;
+ break;
+ }
+ }
+
/* Use default refresh by default. Too many VBE 3.0
* BIOSes are incorrectly implemented.
*/
--
2.17.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yaokai13/xorg-x11-drv-vesa.git
git@gitee.com:yaokai13/xorg-x11-drv-vesa.git
yaokai13
xorg-x11-drv-vesa
xorg-x11-drv-vesa
master

搜索帮助