Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5d2afa2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "gralloc: stub out IMapper@4.0::lockYCbCr in C2Allocator"

parents 4a9c5780 469b90ac
Loading
Loading
Loading
Loading
+10 −29
Original line number Diff line number Diff line
@@ -605,14 +605,11 @@ c2_status_t C2AllocationGralloc::map(
                          (int32_t)rect.width, (int32_t)rect.height },
                        // TODO: fence
                        hidl_handle(),
                        [&err, &pointer](const auto &maperr, const auto &mapPointer,
                                         int32_t bytesPerPixel, int32_t bytesPerStride) {
                        [&err, &pointer](const auto &maperr, const auto &mapPointer) {
                            err = maperr2error(maperr);
                            if (err == C2_OK) {
                                pointer = mapPointer;
                            }
                            (void)bytesPerPixel;
                            (void)bytesPerStride;
                        }).isOk()) {
                    ALOGE("failed transaction: lock(RGBA_1010102) (@4.0)");
                    return C2_CORRUPTED;
@@ -743,14 +740,11 @@ c2_status_t C2AllocationGralloc::map(
                          (int32_t)rect.width, (int32_t)rect.height },
                        // TODO: fence
                        hidl_handle(),
                        [&err, &pointer](const auto &maperr, const auto &mapPointer,
                                         int32_t bytesPerPixel, int32_t bytesPerStride) {
                        [&err, &pointer](const auto &maperr, const auto &mapPointer) {
                            err = maperr2error(maperr);
                            if (err == C2_OK) {
                                pointer = mapPointer;
                            }
                            (void)bytesPerPixel;
                            (void)bytesPerStride;
                        }).isOk()) {
                    ALOGE("failed transaction: lock(RGBA_8888) (@4.0)");
                    return C2_CORRUPTED;
@@ -875,28 +869,15 @@ c2_status_t C2AllocationGralloc::map(
                    return C2_CORRUPTED;
                }
            } else {
                if (!mMapper4->lockYCbCr(
                        const_cast<native_handle_t *>(mBuffer), grallocUsage,
                        { (int32_t)rect.left, (int32_t)rect.top,
                          (int32_t)rect.width, (int32_t)rect.height },
                        // TODO: fence
                        hidl_handle(),
                        [&err, &ycbcrLayout](const auto &maperr, const auto &mapLayout) {
                            err = maperr2error(maperr);
                            if (err == C2_OK) {
                                ycbcrLayout = YCbCrLayout{
                                        mapLayout.y,
                                        mapLayout.cb,
                                        mapLayout.cr,
                                        mapLayout.yStride,
                                        mapLayout.cStride,
                                        mapLayout.chromaStep};
                            }
                        }).isOk()) {
                // No device currently supports IMapper 4.0 so it is safe to just return an error
                // code here.
                //
                // This will be supported by a combination of lock and BufferMetadata getters.
                // We are going to refactor all the IAllocator/IMapper versioning code into a
                // shared library. We will then add the IMapper 4.0 lockYCbCr support then.
                ALOGE("failed transaction: lockYCbCr (@4.0)");
                return C2_CORRUPTED;
            }
            }
            if (err != C2_OK) {
                ALOGD("lockYCbCr failed: %d", err);
                return err;