From 6749c2245251a97aedc2deb4d23673a91be6b33510e46fa4d7e2301c9685b015 Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Mon, 23 Jan 2023 11:19:52 +0000 Subject: [PATCH] - U_Use-DRM_CAP_CURSOR_WIDTH-HEIGHT-if-possible.patch * There's no need to hardcode the cursor size if the kernel can report the value it wants. Fixes invisible cursor issue on RDNA3 cards like Navi31/RX 7900 Series cards. (boo#1207388) OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xf86-video-amdgpu?expand=0&rev=70 --- ..._CAP_CURSOR_WIDTH-HEIGHT-if-possible.patch | 59 +++++++++++++++++++ xf86-video-amdgpu.changes | 8 +++ xf86-video-amdgpu.spec | 4 +- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 U_Use-DRM_CAP_CURSOR_WIDTH-HEIGHT-if-possible.patch diff --git a/U_Use-DRM_CAP_CURSOR_WIDTH-HEIGHT-if-possible.patch b/U_Use-DRM_CAP_CURSOR_WIDTH-HEIGHT-if-possible.patch new file mode 100644 index 0000000..77fde35 --- /dev/null +++ b/U_Use-DRM_CAP_CURSOR_WIDTH-HEIGHT-if-possible.patch @@ -0,0 +1,59 @@ +From 9c959fac3af28d191105f63236096ad456dca614 Mon Sep 17 00:00:00 2001 +From: Pierre-Eric Pelloux-Prayer +Date: Thu, 29 Sep 2022 16:42:09 +0200 +Subject: [PATCH] Use DRM_CAP_CURSOR_WIDTH/HEIGHT if possible + +There's no need to hardcode the cursor size if the kernel can +report the value it wants. +--- + src/amdgpu_kms.c | 27 ++++++++++++++++++++------- + 1 file changed, 20 insertions(+), 7 deletions(-) + +diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c +index 9364d17..1f049c9 100644 +--- a/src/amdgpu_kms.c ++++ b/src/amdgpu_kms.c +@@ -1501,6 +1501,25 @@ static Bool AMDGPUCreateWindow_oneshot(WindowPtr pWin) + return ret; + } + ++static void amdgpu_determine_cursor_size(int fd, AMDGPUInfoPtr info) ++{ ++ uint64_t value; ++ ++ if (drmGetCap(fd, DRM_CAP_CURSOR_WIDTH, &value) == 0) ++ info->cursor_w = value; ++ else if (info->family < AMDGPU_FAMILY_CI) ++ info->cursor_w = CURSOR_WIDTH; ++ else ++ info->cursor_w = CURSOR_WIDTH_CIK; ++ ++ if (drmGetCap(fd, DRM_CAP_CURSOR_HEIGHT, &value) == 0) ++ info->cursor_h = value; ++ else if (info->family < AMDGPU_FAMILY_CI) ++ info->cursor_h = CURSOR_HEIGHT; ++ else ++ info->cursor_h = CURSOR_HEIGHT_CIK; ++} ++ + /* When the root window is mapped, set the initial modes */ + void AMDGPUWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion + #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0) +@@ -1684,13 +1703,7 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags) + else + pAMDGPUEnt->HasCRTC2 = TRUE; + +- if (info->family < AMDGPU_FAMILY_CI) { +- info->cursor_w = CURSOR_WIDTH; +- info->cursor_h = CURSOR_HEIGHT; +- } else { +- info->cursor_w = CURSOR_WIDTH_CIK; +- info->cursor_h = CURSOR_HEIGHT_CIK; +- } ++ amdgpu_determine_cursor_size(pAMDGPUEnt->fd, info); + + amdgpu_query_heap_size(pAMDGPUEnt->pDev, AMDGPU_GEM_DOMAIN_GTT, + &heap_size, &max_allocation); +-- +2.35.3 + diff --git a/xf86-video-amdgpu.changes b/xf86-video-amdgpu.changes index 2d2af2e..f2daa6d 100644 --- a/xf86-video-amdgpu.changes +++ b/xf86-video-amdgpu.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Jan 23 11:12:08 UTC 2023 - Stefan Dirsch + +- U_Use-DRM_CAP_CURSOR_WIDTH-HEIGHT-if-possible.patch + * There's no need to hardcode the cursor size if the kernel can + report the value it wants. Fixes invisible cursor issue on + RDNA3 cards like Navi31/RX 7900 Series cards. (boo#1207388) + ------------------------------------------------------------------- Sat May 14 20:59:19 UTC 2022 - Stefan Dirsch diff --git a/xf86-video-amdgpu.spec b/xf86-video-amdgpu.spec index 127ada7..2b18ac1 100644 --- a/xf86-video-amdgpu.spec +++ b/xf86-video-amdgpu.spec @@ -1,7 +1,7 @@ # # spec file for package xf86-video-amdgpu # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -32,6 +32,7 @@ Source1: https://xorg.freedesktop.org/releases/individual/driver/%{name}- Source2: %{name}.keyring Source3: amdgpu.ids Patch1: N_amdgpu-present-Check-tiling-for-newer-versions-too.patch +Patch2: U_Use-DRM_CAP_CURSOR_WIDTH-HEIGHT-if-possible.patch BuildRequires: autoconf >= 2.6.0 BuildRequires: automake BuildRequires: libtool @@ -64,6 +65,7 @@ Its autodetects whether your hardware has a CI or newer AMD Graphics Card %prep %setup -q %patch1 -p1 +%patch2 -p1 %build # We have some -z now related errors during X default startup (boo#1197994):