Created attachment 144477 [details] 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.
(In reply to M Stoeckl from comment #0) > Created attachment 144477 [details] > 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). Notably this happens with gallium drivers as well as the same check is done in dri2_map_image (src/gallium/state_trackers/dri/dri2.c) so the bug is against all drivers. I'm not sure why the check is there, AFAICT dri interface does not document anything special on such case.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1817.
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.