diff mbox series

[7/7] package/x11r7/xdriver_xf86-video-ati: Guard local variable priv only used with glamor

Message ID 20211230135621.2255847-7-romain.naour@gmail.com
State Accepted
Headers show
Series [1/7] package/supertux: bump to version 0.6.3 | expand

Commit Message

Romain Naour Dec. 30, 2021, 1:56 p.m. UTC
Fixes:
radeon_present.c: In function ‘radeon_present_check_flip’:
radeon_present.c:281:21: error: invalid use of undefined type ‘struct radeon_pixmap’
  281 |     if (priv && priv->fb_failed)
      |                     ^~

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 ...-variable-priv-only-used-with-glamor.patch | 66 +++++++++++++++++++
 1 file changed, 66 insertions(+)
 create mode 100644 package/x11r7/xdriver_xf86-video-ati/0003-Guard-local-variable-priv-only-used-with-glamor.patch

Comments

Peter Korsgaard Jan. 26, 2022, 12:24 p.m. UTC | #1
>>>>> "Romain" == Romain Naour <romain.naour@gmail.com> writes:

 > Fixes:
 > radeon_present.c: In function ‘radeon_present_check_flip’:
 > radeon_present.c:281:21: error: invalid use of undefined type ‘struct radeon_pixmap’
 >   281 |     if (priv && priv->fb_failed)
 >       |                     ^~

 > Signed-off-by: Romain Naour <romain.naour@gmail.com>
 > Cc: Bernd Kuhls <bernd.kuhls@t-online.de>

Is this only needed for xserver 21.x or does it also need to be
backported to 2021.02.x / 2021.11.x?
Romain Naour Jan. 26, 2022, 10:49 p.m. UTC | #2
Peter,

Le 26/01/2022 à 13:24, Peter Korsgaard a écrit :
>>>>>> "Romain" == Romain Naour <romain.naour@gmail.com> writes:
> 
>  > Fixes:
>  > radeon_present.c: In function ‘radeon_present_check_flip’:
>  > radeon_present.c:281:21: error: invalid use of undefined type ‘struct radeon_pixmap’
>  >   281 |     if (priv && priv->fb_failed)
>  >       |                     ^~
> 
>  > Signed-off-by: Romain Naour <romain.naour@gmail.com>
>  > Cc: Bernd Kuhls <bernd.kuhls@t-online.de>
> 
> Is this only needed for xserver 21.x or does it also need to be
> backported to 2021.02.x / 2021.11.x?
> 

I haven't tried with previous xserver release but I don't think it's related to
the xserver version.

The issue has been introduced with xf86-video-ati-19.1.0 [1] which is available
in Buildroot since 2019.11.

[1]
https://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=33803c85f761d343aa7300311b8e9489b1a89495

Best regards,
Romain
diff mbox series

Patch

diff --git a/package/x11r7/xdriver_xf86-video-ati/0003-Guard-local-variable-priv-only-used-with-glamor.patch b/package/x11r7/xdriver_xf86-video-ati/0003-Guard-local-variable-priv-only-used-with-glamor.patch
new file mode 100644
index 0000000000..0a23c54cce
--- /dev/null
+++ b/package/x11r7/xdriver_xf86-video-ati/0003-Guard-local-variable-priv-only-used-with-glamor.patch
@@ -0,0 +1,66 @@ 
+From a78e31b5fffadd73b00483f21e54bd144f1b439a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <mdaenzer@redhat.com>
+Date: Fri, 26 Mar 2021 17:42:10 +0100
+Subject: [PATCH] Guard local variable priv only used with glamor
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes compile errors with glamor disabled:
+
+../../src/radeon_present.c: In function ‘radeon_present_check_flip’:
+../../src/radeon_present.c:281:21: error: invalid use of undefined type ‘struct radeon_pixmap’
+  281 |     if (priv && priv->fb_failed)
+      |                     ^~
+../../src/radeon_present.c:288:19: error: invalid use of undefined type ‘struct radeon_pixmap’
+  288 |  if (priv && !priv->fb_failed) {
+      |                   ^~
+../../src/radeon_present.c:292:10: error: invalid use of undefined type ‘struct radeon_pixmap’
+  292 |      priv->fb_failed = TRUE;
+      |          ^~
+
+(cherry picked from commit 3c7c84ed49564907a148ae99b03200e0be350060)
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ src/radeon_present.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/radeon_present.c b/src/radeon_present.c
+index 494655c9..d010aa19 100644
+--- a/src/radeon_present.c
++++ b/src/radeon_present.c
+@@ -254,7 +254,9 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
+     xf86CrtcPtr xf86_crtc = crtc->devPrivate;
+     ScreenPtr screen = window->drawable.pScreen;
+     ScrnInfoPtr scrn = xf86_crtc->scrn;
++#ifdef USE_GLAMOR
+     struct radeon_pixmap *priv = radeon_get_pixmap_private(pixmap);
++#endif
+     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
+     RADEONInfoPtr info = RADEONPTR(scrn);
+     PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen);
+@@ -278,10 +280,13 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
+ 	return FALSE;
+ #endif
+ 
++#ifdef USE_GLAMOR
+     if (priv && priv->fb_failed)
+ 	return FALSE;
++#endif
+ 
+     if (!radeon_pixmap_get_fb(pixmap)) {
++#ifdef USE_GLAMOR
+ 	if (!priv)
+ 	    priv = radeon_get_pixmap_private(pixmap);
+ 
+@@ -291,6 +296,7 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
+ 		       "normal if using PRIME render offloading)\n");
+ 	    priv->fb_failed = TRUE;
+ 	}
++#endif
+ 
+ 	return FALSE;
+     }
+-- 
+2.31.1
+