[PATCH xf86-video-amdgpu 3/3] Move scrn/info declaration inside USE_GLAMOR in amdgpu_dri3_fd_from_pixmap

Michel Dänzer michel at daenzer.net
Mon Nov 2 01:30:41 PST 2015


From: Michel Dänzer <michel.daenzer at amd.com>

Fixes warning when building with --disable-glamor:

../../src/amdgpu_dri3.c: In function 'amdgpu_dri3_fd_from_pixmap':
../../src/amdgpu_dri3.c:135:16: warning: unused variable 'info' [-Wunused-variable]
  AMDGPUInfoPtr info = AMDGPUPTR(scrn);
                ^

Reported-by: Jammy Zhou <Jammy.Zhou at amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/amdgpu_dri3.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/amdgpu_dri3.c b/src/amdgpu_dri3.c
index 53871be..73a79ac 100644
--- a/src/amdgpu_dri3.c
+++ b/src/amdgpu_dri3.c
@@ -131,13 +131,13 @@ static int amdgpu_dri3_fd_from_pixmap(ScreenPtr screen,
 				      CARD16 *stride,
 				      CARD32 *size)
 {
-	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
-	AMDGPUInfoPtr info = AMDGPUPTR(scrn);
 	struct amdgpu_buffer *bo;
 	struct amdgpu_bo_info bo_info;
 	uint32_t fd;
-
 #ifdef USE_GLAMOR
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+	AMDGPUInfoPtr info = AMDGPUPTR(scrn);
+
 	if (info->use_glamor)
 		return glamor_fd_from_pixmap(screen, pixmap, stride, size);
 #endif
-- 
2.6.2



More information about the xorg-driver-ati mailing list