Calling gbm_bo_create() with format == GBM_BO_FORMAT_ARGB8888 completes successfully. However reading back the format via gbm_bo_get_format() returns GBM_BO_FORMAT_XRGB8888.
The problem seems to be that the bo internal structure is initialized to zero by calloc, but the format field is never set by gbm_dri_bo_create, so it stays zero (GBM_BO_FORMAT_XRGB8888) even when the real image format is something different.
Should be a simple fix in gbm_dri_bo_create(). Just add:
bo->base.base.format = gbm_dri_to_gbm_format(dri_format);
Or even simpler fix...
bo->base.base.format = format;
Created attachment 74279 [details] [review]
gbm_dri_bo_create: Remember to initialize format
(In reply to comment #2)
> Created attachment 74279 [details] [review] [review]
> gbm_dri_bo_create: Remember to initialize format
That looks good, but please also fix create_dumb() and attach output of git format-patch -1 so I can git am it. Thanks!
Created attachment 74319 [details] [review]
[PATCH] gbm: Remember to init format on gbm_dri_bo_create
Pushed to master.
on Oct 24, 2016 at 05:11:16.
(provided by the Example extension).