Skip to content

Commit

Permalink
Raise ycbcr offsets alignment to 128 bytes.
Browse files Browse the repository at this point in the history
Without this Lima can't import video buffers,
which causes most of the you-tube video to stall.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
  • Loading branch information
rsglobal committed Aug 8, 2020
1 parent fee464f commit 73b4d00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gralloc_gbm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ int gralloc_gbm_bo_lock_ycbcr(buffer_handle_t handle,

switch (hnd->format) {
case HAL_PIXEL_FORMAT_YCrCb_420_SP:
ystride = cstride = GRALLOC_ALIGN(hnd->width, 16);
ystride = cstride = GRALLOC_ALIGN(hnd->width, 128);
ycbcr->y = addr;
ycbcr->cr = (unsigned char *)addr + ystride * hnd->height;
ycbcr->cb = (unsigned char *)addr + ystride * hnd->height + 1;
Expand All @@ -529,7 +529,7 @@ int gralloc_gbm_bo_lock_ycbcr(buffer_handle_t handle,
break;
case HAL_PIXEL_FORMAT_YV12:
ystride = hnd->width;
cstride = GRALLOC_ALIGN(ystride / 2, 16);
cstride = GRALLOC_ALIGN(ystride / 2, 128);
ycbcr->y = addr;
ycbcr->cr = (unsigned char *)addr + ystride * hnd->height;
ycbcr->cb = (unsigned char *)addr + ystride * hnd->height + cstride * hnd->height / 2;
Expand Down

0 comments on commit 73b4d00

Please sign in to comment.