OSDN Git Service

Revert "use 64-bits usage bits almost everywhere"
[android-x86/frameworks-native.git] / libs / gui / bufferqueue / 1.0 / H2BGraphicBufferProducer.cpp
index 7c0552e..fda5b94 100644 (file)
@@ -125,7 +125,7 @@ inline void wrapAs(AnwBuffer* t, GraphicBuffer const& l) {
     t->attr.stride = l.getStride();
     t->attr.format = static_cast<PixelFormat>(l.getPixelFormat());
     t->attr.layerCount = l.getLayerCount();
-    t->attr.usage = uint32_t(l.getUsage());     // FIXME: need 64-bits usage version
+    t->attr.usage = l.getUsage();
     t->attr.id = l.getId();
     t->attr.generationNumber = l.getGenerationNumber();
     t->nativeHandle = hidl_handle(l.handle);
@@ -988,15 +988,14 @@ status_t H2BGraphicBufferProducer::setAsyncMode(bool async) {
     return toStatusT(mBase->setAsyncMode(async));
 }
 
-// FIXME: usage bits truncated -- needs a 64-bits usage version
 status_t H2BGraphicBufferProducer::dequeueBuffer(
         int* slot, sp<Fence>* fence,
         uint32_t w, uint32_t h, ::android::PixelFormat format,
-        uint64_t usage, FrameEventHistoryDelta* outTimestamps) {
+        uint32_t usage, FrameEventHistoryDelta* outTimestamps) {
     *fence = new Fence();
     status_t fnStatus;
     status_t transStatus = toStatusT(mBase->dequeueBuffer(
-            w, h, static_cast<PixelFormat>(format), uint32_t(usage),
+            w, h, static_cast<PixelFormat>(format), usage,
             outTimestamps != nullptr,
             [&fnStatus, slot, fence, outTimestamps] (
                     Status status,
@@ -1145,11 +1144,10 @@ status_t H2BGraphicBufferProducer::setSidebandStream(
     return toStatusT(mBase->setSidebandStream(stream == nullptr ? nullptr : stream->handle()));
 }
 
-// FIXME: usage bits truncated -- needs a 64-bits usage version
 void H2BGraphicBufferProducer::allocateBuffers(uint32_t width, uint32_t height,
-        ::android::PixelFormat format, uint64_t usage) {
+        ::android::PixelFormat format, uint32_t usage) {
     mBase->allocateBuffers(
-            width, height, static_cast<PixelFormat>(format), uint32_t(usage));
+            width, height, static_cast<PixelFormat>(format), usage);
 }
 
 status_t H2BGraphicBufferProducer::allowAllocation(bool allow) {