[Bug 110855] gbm_bo_map fails on i915 when *map_data is not NULL before call

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jun 7 15:09:25 UTC 2019


https://bugs.freedesktop.org/show_bug.cgi?id=110855

            Bug ID: 110855
           Summary: gbm_bo_map fails on i915 when *map_data is not NULL
                    before call
           Product: Mesa
           Version: 19.0
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: NEW
          Severity: trivial
          Priority: lowest
         Component: Drivers/DRI/i965
          Assignee: intel-3d-bugs at lists.freedesktop.org
          Reporter: freebugs at mstoeckl.com
        QA Contact: intel-3d-bugs at lists.freedesktop.org

Created attachment 144477
  --> https://bugs.freedesktop.org/attachment.cgi?id=144477&action=edit
Test case, compile with gcc -lgbm

The documentation for the function gbm_bo_map in src/gbm/main/gbm.c states that
the argument void** map_data is a "Returned opaque ptr for the mapped region".
Contrary to convention for a return value, if *map_data is not NULL, and the
DRI i965 driver is used, then gbm_bo_map fails. 

The value of *map_data is checked by intel_map_image in
src/mesa/drivers/dri/i965/intel_screen.c (line 823 in today's git master).

Debugging this (see attached test program) was made slightly more complicated
by the fact that errno was set to ENODEV, after the syscall
DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed on the first call to gbm_bo_map .
Reading kernel sources implies that this probably only happens for <gen6 intel
GPUs.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20190607/8b8ceafa/attachment.html>


More information about the intel-3d-bugs mailing list