1 Star 0 Fork 44

baiguo/xorg-x11-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0009-xwayland-Add-xwlRRModeToDisplayMode-helper-function.patch 3.24 KB
一键复制 编辑 原始数据 按行查看 历史
yangcheng1203 提交于 2021-12-27 15:04 . provide xwayland
From 62e8b2ff7471f1a48b8bac9f41cceecea4931c03 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 8 Jul 2019 14:00:27 +0200
Subject: [PATCH xserver 09/24] xwayland: Add xwlRRModeToDisplayMode() helper
function
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This is a preparation patch for adding emulated mode/resolution change
support to Xwayland's XF86 vidmode extension emulation, using the
Wayland viewport extension.
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit 43c80078126f6f33c6ab7d3cf4668733bde03366)
---
hw/xwayland/xwayland-vidmode.c | 51 +++++++++++++++++++---------------
1 file changed, 28 insertions(+), 23 deletions(-)
diff --git a/hw/xwayland/xwayland-vidmode.c b/hw/xwayland/xwayland-vidmode.c
index 0bcd11401..a59c9f6a9 100644
--- a/hw/xwayland/xwayland-vidmode.c
+++ b/hw/xwayland/xwayland-vidmode.c
@@ -78,13 +78,37 @@ mode_refresh(const xRRModeInfo *mode_info)
return rate;
}
+static void
+xwlRRModeToDisplayMode(RRModePtr rrmode, DisplayModePtr mode)
+{
+ const xRRModeInfo *mode_info = &rrmode->mode;
+
+ mode->next = mode;
+ mode->prev = mode;
+ mode->name = "";
+ mode->VScan = 1;
+ mode->Private = NULL;
+ mode->HDisplay = mode_info->width;
+ mode->HSyncStart = mode_info->hSyncStart;
+ mode->HSyncEnd = mode_info->hSyncEnd;
+ mode->HTotal = mode_info->hTotal;
+ mode->HSkew = mode_info->hSkew;
+ mode->VDisplay = mode_info->height;
+ mode->VSyncStart = mode_info->vSyncStart;
+ mode->VSyncEnd = mode_info->vSyncEnd;
+ mode->VTotal = mode_info->vTotal;
+ mode->Flags = mode_info->modeFlags;
+ mode->Clock = mode_info->dotClock / 1000.0;
+ mode->VRefresh = mode_refresh(mode_info); /* Or RRVerticalRefresh() */
+ mode->HSync = mode_hsync(mode_info);
+}
+
static Bool
xwlVidModeGetCurrentModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotClock)
{
DisplayModePtr pMod;
RROutputPtr output;
RRCrtcPtr crtc;
- xRRModeInfo rrmode;
pMod = dixLookupPrivate(&pScreen->devPrivates, xwlVidModePrivateKey);
if (pMod == NULL)
@@ -98,30 +122,11 @@ xwlVidModeGetCurrentModeline(ScreenPtr pScreen, DisplayModePtr *mode, int *dotCl
if (crtc == NULL)
return FALSE;
- rrmode = crtc->mode->mode;
-
- pMod->next = pMod;
- pMod->prev = pMod;
- pMod->name = "";
- pMod->VScan = 1;
- pMod->Private = NULL;
- pMod->HDisplay = rrmode.width;
- pMod->HSyncStart = rrmode.hSyncStart;
- pMod->HSyncEnd = rrmode.hSyncEnd;
- pMod->HTotal = rrmode.hTotal;
- pMod->HSkew = rrmode.hSkew;
- pMod->VDisplay = rrmode.height;
- pMod->VSyncStart = rrmode.vSyncStart;
- pMod->VSyncEnd = rrmode.vSyncEnd;
- pMod->VTotal = rrmode.vTotal;
- pMod->Flags = rrmode.modeFlags;
- pMod->Clock = rrmode.dotClock / 1000.0;
- pMod->VRefresh = mode_refresh(&rrmode); /* Or RRVerticalRefresh() */
- pMod->HSync = mode_hsync(&rrmode);
- *mode = pMod;
+ xwlRRModeToDisplayMode(crtc->mode, pMod);
+ *mode = pMod;
if (dotClock != NULL)
- *dotClock = rrmode.dotClock / 1000.0;
+ *dotClock = pMod->Clock;
return TRUE;
}
--
2.25.2
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/baiguoguo/xorg-x11-server.git
git@gitee.com:baiguoguo/xorg-x11-server.git
baiguoguo
xorg-x11-server
xorg-x11-server
master

搜索帮助