external/gbm_gralloc
リビジョン | 709726cad68d89f468e8bbf359ac004ed28d842f (tree) |
---|---|
日時 | 2020-03-03 22:51:41 |
作者 | Rob Herring <robh@kern...> |
コミッター | GitHub |
Merge pull request #14 from johnstultz-work/null-crop-fix
gralloc_gbm: Handle null crop values
@@ -428,6 +428,15 @@ int gralloc_gbm_bo_lock(buffer_handle_t handle, | ||
428 | 428 | |
429 | 429 | usage |= bo_data->locked_for; |
430 | 430 | |
431 | + /* | |
432 | + * Some users will lock with an null crop rect. | |
433 | + * Interpret this as no-crop (full buffer WxH). | |
434 | + */ | |
435 | + if (w == 0 && h == 0) { | |
436 | + w = gbm_handle->width; | |
437 | + h = gbm_handle->height; | |
438 | + } | |
439 | + | |
431 | 440 | if (usage & (GRALLOC_USAGE_SW_WRITE_MASK | |
432 | 441 | GRALLOC_USAGE_SW_READ_MASK)) { |
433 | 442 | /* the driver is supposed to wait for the bo */ |