gralloc1_device_t *gralloc1_dvc =
reinterpret_cast<gralloc1_device_t *>(device_);
- uint32_t status = lock_(gralloc1_dvc, handle->imported_handle_, GRALLOC_USAGE_SW_READ_RARELY,
- GRALLOC_USAGE_SW_READ_RARELY, &rect, map_data, acquireFence);
+ uint32_t status = lock_(
+ gralloc1_dvc, handle->handle_, GRALLOC1_PRODUCER_USAGE_CPU_WRITE_OFTEN,
+ GRALLOC1_CONSUMER_USAGE_CPU_READ_OFTEN, &rect, map_data, acquireFence);
return (GRALLOC1_ERROR_NONE == status) ? *map_data : NULL;
}
#include <stdint.h>
#include <drm_fourcc.h>
#include <system/graphics.h>
+#include <hardware/gralloc1.h>
#include "platformdefines.h"
handle->meta_data_.gem_handles_[p] = id;
}
- if (gr_handle->usage & GRALLOC_USAGE_PROTECTED) {
+ if (gr_handle->usage & GRALLOC1_PRODUCER_USAGE_PROTECTED) {
handle->meta_data_.usage_ |= hwcomposer::kLayerProtected;
- } else if (gr_handle->usage & GRALLOC_USAGE_CURSOR) {
+ } else if (gr_handle->usage & GRALLOC1_CONSUMER_USAGE_CURSOR) {
handle->meta_data_.usage_ |= hwcomposer::kLayerCursor;
// We support DRM_FORMAT_ARGB8888 for cursor.
handle->meta_data_.format_ = DRM_FORMAT_ARGB8888;