Bug 88252 - build error sna_dri2.c mark_stale
Summary: build error sna_dri2.c mark_stale
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: Other NetBSD
: medium normal
Assignee: Chris Wilson
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-09 19:44 UTC by Patrick Welche
Modified: 2015-01-09 20:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Patrick Welche 2015-01-09 19:44:34 UTC
There is an error in the DRI2INFOREC_VERSION logic:

  CC       sna_dri2.lo
../../../src/sna/sna_dri2.c: In function 'sna_dri2_flip':
../../../src/sna/sna_dri2.c:1518:2: error: implicit declaration of function 'mark_stale' [-Werror=implicit-function-declaration]
  mark_stale(info->back);



mark_stale is defined #if DRI2INFOREC_VERSION >= 6 and is used #if DRI2INFOREC_VERSION >= 4.

I have DRI2INFOREC_VERSION=5, hence the failure.

It seems to me that the #if DRI2INFOREC_VERSION < 6 section before mark_stale should have its #endif before mark_stale, but I tried and that causes other problems...
Comment 1 Chris Wilson 2015-01-09 20:03:07 UTC
Just

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index e5c4d53..06a9ab1 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -247,6 +247,7 @@ inline static void *dri2_window_get_front(WindowPtr win) { return NULL; }
 
 #define xorg_can_triple_buffer() 0
 #define swap_limit(d, l) false
+#define mark_stale(b)
 
 #else
 

should be enough.

What distribution are you using? (Would be useful for me to add that as a build vm.)
Comment 2 Patrick Welche 2015-01-09 20:07:16 UTC
Thanks, that was enough for a successful build!

I'm using NetBSD-current/amd64.
Comment 3 Chris Wilson 2015-01-09 20:10:03 UTC
commit e143ce600af286ed9ad9d47afc22dbfbb66628dc
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jan 9 20:03:14 2015 +0000

    sna/dri2: Fix build with DRI2INFOREC version 5
    
    Reported-by: Patrick Welche <prlw1@cam.ac.uk>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88252
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.