Skip to content

Commit

Permalink
drm-atomic: check for valid GBM BO
Browse files Browse the repository at this point in the history
With the modifier support it is possible to force a modifier which isn't
compatible with any of the GPU targets. In that case the EGL platform will
be unable to allocate the back buffers.

Provide an error message in that case, instead of crashing.

Signed-off-by: Lucas Stach <[email protected]>
Reviewed-by: Daniel Stone <[email protected]>
  • Loading branch information
lynxeye-dev authored and fooishbar committed May 2, 2017
1 parent 83d3394 commit ac7e6c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drm-atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ static int atomic_run(const struct gbm *gbm, const struct egl *egl)
assert(drm.kms_in_fence_fd != -1);

next_bo = gbm_surface_lock_front_buffer(gbm->surface);
if (!next_bo) {
printf("Failed to lock frontbuffer\n");
return -1;
}
fb = drm_fb_get_from_bo(next_bo);
if (!fb) {
printf("Failed to get a new framebuffer BO\n");
Expand Down

0 comments on commit ac7e6c7

Please sign in to comment.