diff options
author | Chia-I Wu <[email protected]> | 2011-08-04 17:50:51 +0900 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2011-08-21 02:01:49 +0800 |
commit | f496d8b86da63f43239457a2f44920401d872bd6 (patch) | |
tree | 11d1246df1003fc68c2c48d03391f7b37a0af511 /src/gallium/winsys/sw/android | |
parent | 327de226ae0b8b7a5ec4d327c21cc85d84ce09cb (diff) |
winsys/sw/android: set bo usage correctly
Since this is the software path, set GRALLOC_USAGE_SW_WRITE_OFTEN when
PIPE_BIND_RENDER_TARGET, and set GRALLOC_USAGE_SW_READ_OFTEN when
PIPE_BIND_SAMPLER_VIEW.
Diffstat (limited to 'src/gallium/winsys/sw/android')
-rw-r--r-- | src/gallium/winsys/sw/android/android_sw_winsys.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/gallium/winsys/sw/android/android_sw_winsys.cpp b/src/gallium/winsys/sw/android/android_sw_winsys.cpp index 49d8aa9e19f..6ea48b25c39 100644 --- a/src/gallium/winsys/sw/android/android_sw_winsys.cpp +++ b/src/gallium/winsys/sw/android/android_sw_winsys.cpp @@ -158,17 +158,10 @@ android_displaytarget_from_handle(struct sw_winsys *ws, adt->width = templ->width0; adt->height = templ->height0; - if (templ->usage & PIPE_BIND_RENDER_TARGET) - adt->usage |= GRALLOC_USAGE_HW_RENDER; - if (templ->usage & PIPE_BIND_SAMPLER_VIEW) - adt->usage |= GRALLOC_USAGE_HW_TEXTURE; - if (templ->usage & PIPE_BIND_SCANOUT) - adt->usage |= GRALLOC_USAGE_HW_FB; - - if (templ->usage & PIPE_BIND_TRANSFER_READ) - adt->usage |= GRALLOC_USAGE_SW_READ_OFTEN; - if (templ->usage & PIPE_BIND_TRANSFER_WRITE) + if (templ->bind & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_TRANSFER_WRITE)) adt->usage |= GRALLOC_USAGE_SW_WRITE_OFTEN; + if (templ->bind & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_TRANSFER_READ)) + adt->usage |= GRALLOC_USAGE_SW_READ_OFTEN; if (stride) *stride = adt->stride; |