1 /*
2 * Copyright (C) 2020 Samsung Electronics Co. Ltd.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include <ui/Gralloc.h>
18 #include "VendorGraphicBuffer.h"
19
20 using namespace android;
21 using namespace vendor::graphics;
22
lock64(buffer_handle_t handle,uint64_t usage,const Rect & bounds,void ** vaddr,int32_t * outBytesPerPixel,int32_t * outBytesPerStride)23 status_t VendorGraphicBufferMapper::lock64(buffer_handle_t handle, uint64_t usage, const Rect& bounds,
24 void** vaddr, int32_t* outBytesPerPixel, int32_t* outBytesPerStride)
25 {
26 return lockAsync(handle, usage, usage, bounds, vaddr,
27 -1, outBytesPerPixel, outBytesPerStride);
28 }
29
lockYCbCr64(buffer_handle_t handle,uint64_t usage,const Rect & bounds,android_ycbcr * ycbcr)30 status_t VendorGraphicBufferMapper::lockYCbCr64(buffer_handle_t handle,
31 uint64_t usage, const Rect& bounds, android_ycbcr *ycbcr)
32 {
33 return getGrallocMapper().lock(handle, usage, bounds, -1, ycbcr);
34 }
35