From 77e44ffec31212cd068ebe17bc22f46d01edb012 Mon Sep 17 00:00:00 2001 From: xuyan Date: Thu, 10 Apr 2025 10:38:23 +0800 Subject: [PATCH] modesetting use sw_cursor when match phytium bmc card Signed-off-by: Xu Yan Signed-off-by: Wang Hao --- ...sw_cursor-when-match-phytium-bmc-car.patch | 47 +++++++++++++++++++ xorg-x11-server.spec | 10 +++- 2 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 0001-modesetting-use-sw_cursor-when-match-phytium-bmc-car.patch diff --git a/0001-modesetting-use-sw_cursor-when-match-phytium-bmc-car.patch b/0001-modesetting-use-sw_cursor-when-match-phytium-bmc-car.patch new file mode 100644 index 0000000..7d3d610 --- /dev/null +++ b/0001-modesetting-use-sw_cursor-when-match-phytium-bmc-car.patch @@ -0,0 +1,47 @@ +From 498a7e61b8114b357b590a02dabf4478496838ce Mon Sep 17 00:00:00 2001 +From: xuyan +Date: Wed, 9 Apr 2025 17:46:08 +0800 +Subject: [PATCH] modesetting use sw_cursor when match phytium bmc card + Signed-off-by: Xu Yan Signed-off-by: Wang Hao + + +--- + hw/xfree86/drivers/modesetting/driver.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c +index ef4a314..622dc3b 100644 +--- a/hw/xfree86/drivers/modesetting/driver.c ++++ b/hw/xfree86/drivers/modesetting/driver.c +@@ -888,6 +888,9 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn) + return TRUE; + } + ++#define DRM_PHYTIUM_BMC_DEVICE 0x1 ++#define DRM_IOCTL_PHYTIUM_IS_BMC_DEVICE DRM_IO(DRM_COMMAND_BASE + DRM_PHYTIUM_BMC_DEVICE) ++ + static Bool + PreInit(ScrnInfoPtr pScrn, int flags) + { +@@ -980,10 +983,17 @@ PreInit(ScrnInfoPtr pScrn, int flags) + if (!xf86SetDefaultVisual(pScrn, -1)) + return FALSE; + +- if (xf86ReturnOptValBool(ms->drmmode.Options, OPTION_SW_CURSOR, FALSE)) { ++ if (1 == drmIoctl(ms->fd, DRM_IOCTL_PHYTIUM_IS_BMC_DEVICE, NULL) || pScrn->is_gpu) { + ms->drmmode.sw_cursor = TRUE; ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, ++ "force dev using SWcursor\n"); ++ } else { ++ if (xf86ReturnOptValBool(ms->drmmode.Options, OPTION_SW_CURSOR, FALSE)) { ++ ms->drmmode.sw_cursor = TRUE; ++ } + } + ++ + ms->cursor_width = 64; + ms->cursor_height = 64; + ret = drmGetCap(ms->fd, DRM_CAP_CURSOR_WIDTH, &value); +-- +2.33.0 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 3c45bcb..9fb1eb9 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -16,7 +16,7 @@ Name: xorg-x11-server Version: 1.20.11 -Release: 36 +Release: 38 Summary: X.Org X11 X server License: MIT and GPLv2 URL: https://www.x.org @@ -80,6 +80,7 @@ Patch0028: 0024-xwayland-Remove-unnecessary-xwl_window_is_toplevel-c.patch Patch0100: 0001-Fix-the-crash-in-shadowUpdatePacked-because-of-memcp.patch Patch0101: 0002-present-Crash-in-present_scmd_get_crtc-and-present_flush.patch Patch0102: 0025-phytium-xfree86-Fixed-display-error-for-ps23xx-when-.patch +Patch0103: 0001-modesetting-use-sw_cursor-when-match-phytium-bmc-car.patch Patch0029: xorg-s11-server-CVE-2018-20839.patch Patch6000: backport-CVE-2021-4008.patch @@ -132,7 +133,6 @@ Patch6045: backport-0002-CVE-2023-5574.patch Patch6046: backport-0003-CVE-2023-5574.patch Patch6047: backport-CVE-2024-9632.patch Patch6048: backport-xfree86-fbdevhw-fix-pci-detection-on-recent-Linux.patch - BuildRequires: audit-libs-devel autoconf automake bison dbus-devel flex git gcc BuildRequires: systemtap-sdt-devel libtool pkgconfig BuildRequires: xorg-x11-font-utils systemd-devel @@ -473,6 +473,12 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_mandir}/man*/* %changelog +* Thu Apr 10 2025 xuyan - 1.20.11-38 +- Type:feature +- CVE:NA +- SUG:NA +- DESC:modesetting-use-sw_cursor-when-match-phytium-bmc-car + * Fri Mar 07 2025 mahailiang - 1.20.11-36 - fix sw_64 build error -- Gitee