cros_gralloc: Fix gralloc -> gbm usage flag mapping
GRALLOC_USAGE_SW_READ_RARELY was incorrectly mapped to BO_USE_SW_READ_OFTEN since GRALLOC_USAGE_SW_READ_OFTEN (== 3) contains GRALLOC_USAGE_SW_READ_RARELY (== 2) in bit mask. Fix it by making the flag check compare the full bit mask. Same for the WRITE case. BUG=None TEST=CQ Change-Id: I0c1e0e6f07978b6090472b2d470f5880ad231d0d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5907583 Reviewed-by: Jason Macnak <natsu@google.com> Tested-by: Ren-Pei Zeng <kamesan@chromium.org> Commit-Queue: Ren-Pei Zeng <kamesan@chromium.org>
This commit is contained in:
parent
eb0e5fa310
commit
d56aa1353a
1 changed files with 1 additions and 1 deletions
|
|
@ -96,7 +96,7 @@ uint32_t cros_gralloc_convert_format(int format)
|
|||
static inline void handle_usage(uint64_t *gralloc_usage, uint64_t gralloc_mask,
|
||||
uint64_t *bo_use_flags, uint64_t bo_mask)
|
||||
{
|
||||
if ((*gralloc_usage) & gralloc_mask) {
|
||||
if (((*gralloc_usage) & gralloc_mask) == gralloc_mask) {
|
||||
(*gralloc_usage) &= ~gralloc_mask;
|
||||
(*bo_use_flags) |= bo_mask;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue