Skip to content

Commit

Permalink
gralloc: Default flexible YUV format to NV21_ZSL
Browse files Browse the repository at this point in the history
There could be buffers allocated in flexible YUV format without any
camera usage flags. Default the format for such buffers to NV21_ZSL.

Bug: 24197991
Change-Id: I25814aed652bfcddb19b411499bc8d64e76e081b
  • Loading branch information
Prashant Malani committed Sep 22, 2015
1 parent 243476d commit 4c9a29a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions msm8226/libgralloc/gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ int gpu_context_t::alloc_impl(int w, int h, int format, int usage,
else if(usage & GRALLOC_USAGE_HW_COMPOSER)
//XXX: If we still haven't set a format, default to RGBA8888
grallocFormat = HAL_PIXEL_FORMAT_RGBA_8888;
else if(format == HAL_PIXEL_FORMAT_YCbCr_420_888)
// If no other usage flags are detected, default the flexible YUV
// format to NV21_ZSL.
grallocFormat = HAL_PIXEL_FORMAT_NV21_ZSL;
}

getGrallocInformationFromFormat(grallocFormat, &bufferType);
Expand Down

0 comments on commit 4c9a29a

Please sign in to comment.