Hi Ilia, On 8 February 2018 at 04:17, Ilia Mirkin <imir...@alum.mit.edu> wrote: > The GBM surface format has to match the DRM mode. Both are used in a > couple of places, so move the defines to a common place so that they can > be adjusted easily.
Thanks for doing this Ilia! Hopefully people stop copying broken code now. :) Especially as eglChooseConfig will happily ignore a visual ID specification and choose something completely incorrect. > @@ -78,7 +78,7 @@ struct drm_fb * drm_fb_get_from_bo(struct gbm_bo *bo) > } > > ret = drmModeAddFB2WithModifiers(drm_fd, width, height, > - DRM_FORMAT_XRGB8888, handles, strides, offsets, > + DRM_FORMAT, handles, strides, offsets, > modifiers, &fb->fb_id, flags); > #endif > if (ret) { > @@ -88,7 +88,7 @@ struct drm_fb * drm_fb_get_from_bo(struct gbm_bo *bo) > memcpy(handles, (uint32_t > [4]){gbm_bo_get_handle(bo).u32,0,0,0}, 16); > memcpy(strides, (uint32_t [4]){gbm_bo_get_stride(bo),0,0,0}, > 16); > memset(offsets, 0, 16); > - ret = drmModeAddFB2(drm_fd, width, height, > DRM_FORMAT_XRGB8888, > + ret = drmModeAddFB2(drm_fd, width, height, DRM_FORMAT, Nitpick: use gbm_bo_get_format(bo) for both of these. With that: Reviewed-by: Daniel Stone <dani...@collabora.com> Cheers, Daniel _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev