Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request robherring#14 from johnstultz-work/null-crop-fix
Browse files Browse the repository at this point in the history
gralloc_gbm: Handle null crop values
  • Loading branch information
robherring authored Mar 3, 2020
2 parents db36c00 + 450ddef commit 709726c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gralloc_gbm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,15 @@ int gralloc_gbm_bo_lock(buffer_handle_t handle,

usage |= bo_data->locked_for;

/*
* Some users will lock with an null crop rect.
* Interpret this as no-crop (full buffer WxH).
*/
if (w == 0 && h == 0) {
w = gbm_handle->width;
h = gbm_handle->height;
}

if (usage & (GRALLOC_USAGE_SW_WRITE_MASK |
GRALLOC_USAGE_SW_READ_MASK)) {
/* the driver is supposed to wait for the bo */
Expand Down

0 comments on commit 709726c

Please sign in to comment.