Bug 101358 - piglit_drm_dma_buf.c:265:12: error: ‘GBM_FORMAT_R8’ undeclared
Summary: piglit_drm_dma_buf.c:265:12: error: ‘GBM_FORMAT_R8’ undeclared
Status: RESOLVED FIXED
Alias: None
Product: piglit
Classification: Unclassified
Component: tests (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Piglit Mailing List
QA Contact: Piglit Mailing List
URL:
Whiteboard:
Keywords: bisected, regression
Depends on:
Blocks:
 
Reported: 2017-06-08 21:21 UTC by Vinson Lee
Modified: 2017-06-17 00:29 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Include gbm even without gbm_bo_map (953 bytes, patch)
2017-06-09 11:31 UTC, Jan Vesely
Details | Splinter Review
cmake: Reintroduce version check to gbm_bo_map check (1.19 KB, patch)
2017-06-10 12:41 UTC, Jan Vesely
Details | Splinter Review

Description Vinson Lee 2017-06-08 21:21:02 UTC
piglit: bc6ef16dfa432c181e3c0e44223a651e3ea50f76 (master)
libgbm-dev: 12.0.6-0ubuntu0.16.10.1

[  0%] Building C object target_api/gl/tests/util/CMakeFiles/piglitutil_gl.dir/piglit-framework-gl/piglit_drm_dma_buf.c.o
piglit/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c: In function ‘piglit_gbm_buf_create’:
piglit/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c:265:12: error: ‘GBM_FORMAT_R8’ undeclared (first use in this function)
   format = GBM_FORMAT_R8;
            ^~~~~~~~~~~~~
piglit/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c:265:12: note: each undeclared identifier is reported only once for each function it appears in
piglit/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c:271:12: error: ‘GBM_FORMAT_GR88’ undeclared (first use in this function)
   format = GBM_FORMAT_GR88;
            ^~~~~~~~~~~~~~~


Build error introduced with this commit.

commit 2217871ac93765a0722c77427d5880154ae91ef9
Author: Daniel Diaz <daniel.diaz@linaro.org>
Date:   Tue May 16 19:06:40 2017 -0500

    CMake: define GBM_BO_MAP only when symbol is found
    
    gbm_bo_map() and _unmap() have been added recently to Mesa,
    and this update may not have reached all implementations of
    GBM, such as the one provided by Mali r6, where said
    definitions can be found in the header file but not in the
    library itself. This leads to errors like the following when
    linking:
      ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_unmap'
      ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_map'
      collect2: error: ld returned 1 exit status
      make[2]: *** [bin/point-sprite] Error 1
    
    Instead of relying on the header file, actually try to link
    using that symbol to determine if PIGLIT_HAS_GBM_BO_MAP
    should be defined.
    
    Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
    Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
    Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Comment 1 Jan Vesely 2017-06-09 11:31:26 UTC
Created attachment 131826 [details] [review]
Include gbm even without gbm_bo_map

Does this patch help?
Comment 2 Vinson Lee 2017-06-09 23:14:15 UTC
(In reply to Jan Vesely from comment #1)
> Created attachment 131826 [details] [review] [review]
> Include gbm even without gbm_bo_map
> 
> Does this patch help?

No.
Comment 3 Jan Vesely 2017-06-10 12:41:08 UTC
Created attachment 131841 [details] [review]
cmake: Reintroduce version check to gbm_bo_map check

new patch. it reintroduces the old check so PIGLIT_HAS_GBM_BO_MAP is only defined if both vesion >= 12.1 AND the function is available
Comment 4 Vinson Lee 2017-06-12 18:57:06 UTC
(In reply to Jan Vesely from comment #3)
> Created attachment 131841 [details] [review] [review]
> cmake: Reintroduce version check to gbm_bo_map check
> 
> new patch. it reintroduces the old check so PIGLIT_HAS_GBM_BO_MAP is only
> defined if both vesion >= 12.1 AND the function is available

This patch fixes the build for me.

Tested-by: Vinson Lee <vlee@freedesktop.org>
Comment 5 Vinson Lee 2017-06-17 00:29:38 UTC
commit ae373e3d56159a3f371deed6c6796bb1ba887364
Author: Jan Vesely <jano.vesely@gmail.com>
Date:   Sat Jun 10 14:31:55 2017 +0200

    cmake: Reintroduce version check to gbm_bo_map check
    
    Fixes: 2217871ac937 ("CMake: define GBM_BO_MAP only when symbol is found")
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101358
    Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
    Tested-by: Vinson Lee <vlee@freedesktop.org>


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.