blob: f5824233e92656b584fdaca839202958828734fb [file] [log] [blame]
Mathias Agopian076b1cc2009-04-10 14:24:30 -07001/*
2 * Copyright (C) 2007 The Android Open Source Project
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
Mathias Agopian3330b202009-10-05 17:07:12 -070017#define LOG_TAG "GraphicBufferMapper"
Mathias Agopiancf563192012-02-29 20:43:29 -080018#define ATRACE_TAG ATRACE_TAG_GRAPHICS
Dan Stoza8deb4da2016-06-01 18:21:44 -070019//#define LOG_NDEBUG 0
Mathias Agopian076b1cc2009-04-10 14:24:30 -070020
Mathias Agopianfe2f54f2017-02-15 19:48:58 -080021#include <ui/GraphicBufferMapper.h>
Mathias Agopian076b1cc2009-04-10 14:24:30 -070022
Chia-I Wu5bac7f32017-04-06 12:34:32 -070023#include <grallocusage/GrallocUsageConversion.h>
24
Dan Stozad3182402014-11-17 12:03:59 -080025// We would eliminate the non-conforming zero-length array, but we can't since
26// this is effectively included from the Linux kernel
27#pragma clang diagnostic push
28#pragma clang diagnostic ignored "-Wzero-length-array"
Francis Hart8f396012014-04-01 15:30:53 +030029#include <sync/sync.h>
Dan Stozad3182402014-11-17 12:03:59 -080030#pragma clang diagnostic pop
Francis Hart8f396012014-04-01 15:30:53 +030031
Mathias Agopian076b1cc2009-04-10 14:24:30 -070032#include <utils/Log.h>
Mathias Agopiancf563192012-02-29 20:43:29 -080033#include <utils/Trace.h>
Mathias Agopian076b1cc2009-04-10 14:24:30 -070034
Marissa Walld380e2c2018-12-29 14:17:29 -080035#include <ui/Gralloc.h>
Chia-I Wu5bac7f32017-04-06 12:34:32 -070036#include <ui/Gralloc2.h>
Marissa Wall925bf7f2018-12-29 14:27:11 -080037#include <ui/Gralloc3.h>
Marissa Wall87c8ba72019-06-20 14:20:52 -070038#include <ui/Gralloc4.h>
Mathias Agopiana9347642017-02-13 16:42:28 -080039#include <ui/GraphicBuffer.h>
Mathias Agopian076b1cc2009-04-10 14:24:30 -070040
Dan Stoza8deb4da2016-06-01 18:21:44 -070041#include <system/graphics.h>
Mathias Agopian8b765b72009-04-10 20:34:46 -070042
Mathias Agopian076b1cc2009-04-10 14:24:30 -070043namespace android {
44// ---------------------------------------------------------------------------
45
Mathias Agopian3330b202009-10-05 17:07:12 -070046ANDROID_SINGLETON_STATIC_INSTANCE( GraphicBufferMapper )
Mathias Agopian4243e662009-04-15 18:34:24 -070047
Jesse Halleeb4ac72017-07-06 14:02:29 -070048void GraphicBufferMapper::preloadHal() {
Marissa Walld380e2c2018-12-29 14:17:29 -080049 Gralloc2Mapper::preload();
Marissa Wall925bf7f2018-12-29 14:27:11 -080050 Gralloc3Mapper::preload();
Marissa Wall87c8ba72019-06-20 14:20:52 -070051 Gralloc4Mapper::preload();
Jesse Halleeb4ac72017-07-06 14:02:29 -070052}
53
Marissa Wall925bf7f2018-12-29 14:27:11 -080054GraphicBufferMapper::GraphicBufferMapper() {
Marissa Wall87c8ba72019-06-20 14:20:52 -070055 mMapper = std::make_unique<const Gralloc4Mapper>();
56 if (mMapper->isLoaded()) {
57 mMapperVersion = Version::GRALLOC_4;
58 return;
59 }
Marissa Wall925bf7f2018-12-29 14:27:11 -080060 mMapper = std::make_unique<const Gralloc3Mapper>();
Marissa Wall87c8ba72019-06-20 14:20:52 -070061 if (mMapper->isLoaded()) {
Valerie Haud2f4daf2019-02-15 13:49:00 -080062 mMapperVersion = Version::GRALLOC_3;
Marissa Wall87c8ba72019-06-20 14:20:52 -070063 return;
64 }
65 mMapper = std::make_unique<const Gralloc2Mapper>();
66 if (mMapper->isLoaded()) {
67 mMapperVersion = Version::GRALLOC_2;
68 return;
Marissa Wall925bf7f2018-12-29 14:27:11 -080069 }
70
Marissa Wall87c8ba72019-06-20 14:20:52 -070071 LOG_ALWAYS_FATAL("gralloc-mapper is missing");
Marissa Wall925bf7f2018-12-29 14:27:11 -080072}
Dan Stoza8deb4da2016-06-01 18:21:44 -070073
Marissa Wall22b2de12019-12-02 18:11:43 -080074void GraphicBufferMapper::dumpBuffer(buffer_handle_t bufferHandle, std::string& result,
75 bool less) const {
76 result.append(mMapper->dumpBuffer(bufferHandle, less));
77}
78
79void GraphicBufferMapper::dumpBufferToSystemLog(buffer_handle_t bufferHandle, bool less) {
80 std::string s;
81 GraphicBufferMapper::getInstance().dumpBuffer(bufferHandle, s, less);
82 ALOGD("%s", s.c_str());
83}
84
Chia-I Wu5bac7f32017-04-06 12:34:32 -070085status_t GraphicBufferMapper::importBuffer(buffer_handle_t rawHandle,
Chia-I Wudbbe33b2017-09-27 15:22:21 -070086 uint32_t width, uint32_t height, uint32_t layerCount,
87 PixelFormat format, uint64_t usage, uint32_t stride,
Chia-I Wu5bac7f32017-04-06 12:34:32 -070088 buffer_handle_t* outHandle)
Mathias Agopian076b1cc2009-04-10 14:24:30 -070089{
Mathias Agopiancf563192012-02-29 20:43:29 -080090 ATRACE_CALL();
Mathias Agopian0a757812010-12-08 16:40:01 -080091
Chia-I Wudbbe33b2017-09-27 15:22:21 -070092 buffer_handle_t bufferHandle;
Marissa Wall1e779252018-12-29 12:01:57 -080093 status_t error = mMapper->importBuffer(hardware::hidl_handle(rawHandle), &bufferHandle);
94 if (error != NO_ERROR) {
Chia-I Wudbbe33b2017-09-27 15:22:21 -070095 ALOGW("importBuffer(%p) failed: %d", rawHandle, error);
Marissa Wall1e779252018-12-29 12:01:57 -080096 return error;
Chia-I Wudbbe33b2017-09-27 15:22:21 -070097 }
Chia-I Wu5bac7f32017-04-06 12:34:32 -070098
Marissa Wall1e779252018-12-29 12:01:57 -080099 error = mMapper->validateBufferSize(bufferHandle, width, height, format, layerCount, usage,
100 stride);
101 if (error != NO_ERROR) {
Chia-I Wudbbe33b2017-09-27 15:22:21 -0700102 ALOGE("validateBufferSize(%p) failed: %d", rawHandle, error);
103 freeBuffer(bufferHandle);
104 return static_cast<status_t>(error);
105 }
Chia-I Wu5bac7f32017-04-06 12:34:32 -0700106
Chia-I Wudbbe33b2017-09-27 15:22:21 -0700107 *outHandle = bufferHandle;
108
109 return NO_ERROR;
110}
111
Roman Kiryanov004e7cb2023-01-23 15:34:46 -0800112status_t GraphicBufferMapper::importBufferNoValidate(const native_handle_t* rawHandle,
113 buffer_handle_t* outHandle) {
114 return mMapper->importBuffer(rawHandle, outHandle);
115}
116
Chia-I Wudbbe33b2017-09-27 15:22:21 -0700117void GraphicBufferMapper::getTransportSize(buffer_handle_t handle,
118 uint32_t* outTransportNumFds, uint32_t* outTransportNumInts)
119{
120 mMapper->getTransportSize(handle, outTransportNumFds, outTransportNumInts);
Chia-I Wu5bac7f32017-04-06 12:34:32 -0700121}
122
Chia-I Wu5bac7f32017-04-06 12:34:32 -0700123status_t GraphicBufferMapper::freeBuffer(buffer_handle_t handle)
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700124{
Mathias Agopiancf563192012-02-29 20:43:29 -0800125 ATRACE_CALL();
Mathias Agopian0a757812010-12-08 16:40:01 -0800126
Chia-I Wucb8405e2017-04-17 15:20:19 -0700127 mMapper->freeBuffer(handle);
Chia-I Wu9ba189d2016-09-22 17:13:08 +0800128
Chia-I Wucb8405e2017-04-17 15:20:19 -0700129 return NO_ERROR;
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700130}
131
Valerie Hau0c9fc362019-01-22 09:17:19 -0800132status_t GraphicBufferMapper::lock(buffer_handle_t handle, uint32_t usage, const Rect& bounds,
133 void** vaddr, int32_t* outBytesPerPixel,
134 int32_t* outBytesPerStride) {
135 return lockAsync(handle, usage, bounds, vaddr, -1, outBytesPerPixel, outBytesPerStride);
Dan Stoza8deb4da2016-06-01 18:21:44 -0700136}
Eino-Ville Talvalac43946b2013-05-04 18:07:43 -0700137
Dan Stoza8deb4da2016-06-01 18:21:44 -0700138status_t GraphicBufferMapper::lockYCbCr(buffer_handle_t handle, uint32_t usage,
139 const Rect& bounds, android_ycbcr *ycbcr)
140{
141 return lockAsyncYCbCr(handle, usage, bounds, ycbcr, -1);
Eino-Ville Talvalac43946b2013-05-04 18:07:43 -0700142}
143
Mathias Agopian3330b202009-10-05 17:07:12 -0700144status_t GraphicBufferMapper::unlock(buffer_handle_t handle)
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700145{
Dan Stoza8deb4da2016-06-01 18:21:44 -0700146 int32_t fenceFd = -1;
147 status_t error = unlockAsync(handle, &fenceFd);
Daniel Jaraie9147c22017-09-20 11:33:51 +0200148 if (error == NO_ERROR && fenceFd >= 0) {
Dan Stoza8deb4da2016-06-01 18:21:44 -0700149 sync_wait(fenceFd, -1);
150 close(fenceFd);
151 }
152 return error;
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700153}
154
Valerie Hau0c9fc362019-01-22 09:17:19 -0800155status_t GraphicBufferMapper::lockAsync(buffer_handle_t handle, uint32_t usage, const Rect& bounds,
156 void** vaddr, int fenceFd, int32_t* outBytesPerPixel,
157 int32_t* outBytesPerStride) {
158 return lockAsync(handle, usage, usage, bounds, vaddr, fenceFd, outBytesPerPixel,
159 outBytesPerStride);
Craig Donnere96a3252017-02-02 12:13:34 -0800160}
161
Valerie Hau0c9fc362019-01-22 09:17:19 -0800162status_t GraphicBufferMapper::lockAsync(buffer_handle_t handle, uint64_t producerUsage,
163 uint64_t consumerUsage, const Rect& bounds, void** vaddr,
164 int fenceFd, int32_t* outBytesPerPixel,
165 int32_t* outBytesPerStride) {
Francis Hart8f396012014-04-01 15:30:53 +0300166 ATRACE_CALL();
Francis Hart8f396012014-04-01 15:30:53 +0300167
Chia-I Wucb8405e2017-04-17 15:20:19 -0700168 const uint64_t usage = static_cast<uint64_t>(
169 android_convertGralloc1To0Usage(producerUsage, consumerUsage));
Valerie Hau0c9fc362019-01-22 09:17:19 -0800170 return mMapper->lock(handle, usage, bounds, fenceFd, vaddr, outBytesPerPixel,
171 outBytesPerStride);
Dan Stoza8deb4da2016-06-01 18:21:44 -0700172}
173
Francis Hart8f396012014-04-01 15:30:53 +0300174status_t GraphicBufferMapper::lockAsyncYCbCr(buffer_handle_t handle,
Dan Stozad3182402014-11-17 12:03:59 -0800175 uint32_t usage, const Rect& bounds, android_ycbcr *ycbcr, int fenceFd)
Francis Hart8f396012014-04-01 15:30:53 +0300176{
177 ATRACE_CALL();
Francis Hart8f396012014-04-01 15:30:53 +0300178
Marissa Wall1e779252018-12-29 12:01:57 -0800179 return mMapper->lock(handle, usage, bounds, fenceFd, ycbcr);
Francis Hart8f396012014-04-01 15:30:53 +0300180}
181
182status_t GraphicBufferMapper::unlockAsync(buffer_handle_t handle, int *fenceFd)
183{
184 ATRACE_CALL();
Francis Hart8f396012014-04-01 15:30:53 +0300185
Chia-I Wucb8405e2017-04-17 15:20:19 -0700186 *fenceFd = mMapper->unlock(handle);
Francis Hart8f396012014-04-01 15:30:53 +0300187
Chia-I Wucb8405e2017-04-17 15:20:19 -0700188 return NO_ERROR;
Francis Hart8f396012014-04-01 15:30:53 +0300189}
190
Valerie Hauddbfaeb2019-02-01 09:54:20 -0800191status_t GraphicBufferMapper::isSupported(uint32_t width, uint32_t height,
192 android::PixelFormat format, uint32_t layerCount,
193 uint64_t usage, bool* outSupported) {
194 return mMapper->isSupported(width, height, format, layerCount, usage, outSupported);
195}
Marissa Wall22b2de12019-12-02 18:11:43 -0800196
197status_t GraphicBufferMapper::getBufferId(buffer_handle_t bufferHandle, uint64_t* outBufferId) {
198 return mMapper->getBufferId(bufferHandle, outBufferId);
199}
200
201status_t GraphicBufferMapper::getName(buffer_handle_t bufferHandle, std::string* outName) {
202 return mMapper->getName(bufferHandle, outName);
203}
204
205status_t GraphicBufferMapper::getWidth(buffer_handle_t bufferHandle, uint64_t* outWidth) {
206 return mMapper->getWidth(bufferHandle, outWidth);
207}
208
209status_t GraphicBufferMapper::getHeight(buffer_handle_t bufferHandle, uint64_t* outHeight) {
210 return mMapper->getHeight(bufferHandle, outHeight);
211}
212
213status_t GraphicBufferMapper::getLayerCount(buffer_handle_t bufferHandle, uint64_t* outLayerCount) {
214 return mMapper->getLayerCount(bufferHandle, outLayerCount);
215}
216
217status_t GraphicBufferMapper::getPixelFormatRequested(buffer_handle_t bufferHandle,
218 ui::PixelFormat* outPixelFormatRequested) {
219 return mMapper->getPixelFormatRequested(bufferHandle, outPixelFormatRequested);
220}
221
222status_t GraphicBufferMapper::getPixelFormatFourCC(buffer_handle_t bufferHandle,
223 uint32_t* outPixelFormatFourCC) {
224 return mMapper->getPixelFormatFourCC(bufferHandle, outPixelFormatFourCC);
225}
226
227status_t GraphicBufferMapper::getPixelFormatModifier(buffer_handle_t bufferHandle,
228 uint64_t* outPixelFormatModifier) {
229 return mMapper->getPixelFormatModifier(bufferHandle, outPixelFormatModifier);
230}
231
232status_t GraphicBufferMapper::getUsage(buffer_handle_t bufferHandle, uint64_t* outUsage) {
233 return mMapper->getUsage(bufferHandle, outUsage);
234}
235
236status_t GraphicBufferMapper::getAllocationSize(buffer_handle_t bufferHandle,
237 uint64_t* outAllocationSize) {
238 return mMapper->getAllocationSize(bufferHandle, outAllocationSize);
239}
240
241status_t GraphicBufferMapper::getProtectedContent(buffer_handle_t bufferHandle,
242 uint64_t* outProtectedContent) {
243 return mMapper->getProtectedContent(bufferHandle, outProtectedContent);
244}
245
246status_t GraphicBufferMapper::getCompression(
247 buffer_handle_t bufferHandle,
248 aidl::android::hardware::graphics::common::ExtendableType* outCompression) {
249 return mMapper->getCompression(bufferHandle, outCompression);
250}
251
252status_t GraphicBufferMapper::getCompression(buffer_handle_t bufferHandle,
253 ui::Compression* outCompression) {
254 return mMapper->getCompression(bufferHandle, outCompression);
255}
256
257status_t GraphicBufferMapper::getInterlaced(
258 buffer_handle_t bufferHandle,
259 aidl::android::hardware::graphics::common::ExtendableType* outInterlaced) {
260 return mMapper->getInterlaced(bufferHandle, outInterlaced);
261}
262
263status_t GraphicBufferMapper::getInterlaced(buffer_handle_t bufferHandle,
264 ui::Interlaced* outInterlaced) {
265 return mMapper->getInterlaced(bufferHandle, outInterlaced);
266}
267
268status_t GraphicBufferMapper::getChromaSiting(
269 buffer_handle_t bufferHandle,
270 aidl::android::hardware::graphics::common::ExtendableType* outChromaSiting) {
271 return mMapper->getChromaSiting(bufferHandle, outChromaSiting);
272}
273
274status_t GraphicBufferMapper::getChromaSiting(buffer_handle_t bufferHandle,
275 ui::ChromaSiting* outChromaSiting) {
276 return mMapper->getChromaSiting(bufferHandle, outChromaSiting);
277}
278
279status_t GraphicBufferMapper::getPlaneLayouts(buffer_handle_t bufferHandle,
280 std::vector<ui::PlaneLayout>* outPlaneLayouts) {
281 return mMapper->getPlaneLayouts(bufferHandle, outPlaneLayouts);
282}
283
284status_t GraphicBufferMapper::getDataspace(buffer_handle_t bufferHandle,
285 ui::Dataspace* outDataspace) {
286 return mMapper->getDataspace(bufferHandle, outDataspace);
287}
288
Alec Mouri9c604e32022-03-18 22:47:44 +0000289status_t GraphicBufferMapper::setDataspace(buffer_handle_t bufferHandle, ui::Dataspace dataspace) {
290 return mMapper->setDataspace(bufferHandle, dataspace);
291}
292
Marissa Wall22b2de12019-12-02 18:11:43 -0800293status_t GraphicBufferMapper::getBlendMode(buffer_handle_t bufferHandle,
294 ui::BlendMode* outBlendMode) {
295 return mMapper->getBlendMode(bufferHandle, outBlendMode);
296}
297
Marissa Wallef785e12019-12-12 14:26:59 -0800298status_t GraphicBufferMapper::getSmpte2086(buffer_handle_t bufferHandle,
299 std::optional<ui::Smpte2086>* outSmpte2086) {
300 return mMapper->getSmpte2086(bufferHandle, outSmpte2086);
301}
302
Alec Mouri9c604e32022-03-18 22:47:44 +0000303status_t GraphicBufferMapper::setSmpte2086(buffer_handle_t bufferHandle,
304 std::optional<ui::Smpte2086> smpte2086) {
305 return mMapper->setSmpte2086(bufferHandle, smpte2086);
306}
307
Marissa Wallef785e12019-12-12 14:26:59 -0800308status_t GraphicBufferMapper::getCta861_3(buffer_handle_t bufferHandle,
309 std::optional<ui::Cta861_3>* outCta861_3) {
310 return mMapper->getCta861_3(bufferHandle, outCta861_3);
311}
312
Alec Mouri9c604e32022-03-18 22:47:44 +0000313status_t GraphicBufferMapper::setCta861_3(buffer_handle_t bufferHandle,
314 std::optional<ui::Cta861_3> cta861_3) {
315 return mMapper->setCta861_3(bufferHandle, cta861_3);
316}
317
Marissa Wallef785e12019-12-12 14:26:59 -0800318status_t GraphicBufferMapper::getSmpte2094_40(
319 buffer_handle_t bufferHandle, std::optional<std::vector<uint8_t>>* outSmpte2094_40) {
320 return mMapper->getSmpte2094_40(bufferHandle, outSmpte2094_40);
321}
322
Alec Mouri9c604e32022-03-18 22:47:44 +0000323status_t GraphicBufferMapper::setSmpte2094_40(buffer_handle_t bufferHandle,
324 std::optional<std::vector<uint8_t>> smpte2094_40) {
325 return mMapper->setSmpte2094_40(bufferHandle, smpte2094_40);
326}
327
Alec Mouri332765e2021-10-06 16:38:12 -0700328status_t GraphicBufferMapper::getSmpte2094_10(
329 buffer_handle_t bufferHandle, std::optional<std::vector<uint8_t>>* outSmpte2094_10) {
330 return mMapper->getSmpte2094_10(bufferHandle, outSmpte2094_10);
331}
332
Alec Mouri9c604e32022-03-18 22:47:44 +0000333status_t GraphicBufferMapper::setSmpte2094_10(buffer_handle_t bufferHandle,
334 std::optional<std::vector<uint8_t>> smpte2094_10) {
335 return mMapper->setSmpte2094_10(bufferHandle, smpte2094_10);
336}
337
Marissa Wall22b2de12019-12-02 18:11:43 -0800338status_t GraphicBufferMapper::getDefaultPixelFormatFourCC(uint32_t width, uint32_t height,
339 PixelFormat format, uint32_t layerCount,
340 uint64_t usage,
341 uint32_t* outPixelFormatFourCC) {
342 return mMapper->getDefaultPixelFormatFourCC(width, height, format, layerCount, usage,
343 outPixelFormatFourCC);
344}
345
346status_t GraphicBufferMapper::getDefaultPixelFormatModifier(uint32_t width, uint32_t height,
347 PixelFormat format, uint32_t layerCount,
348 uint64_t usage,
349 uint64_t* outPixelFormatModifier) {
350 return mMapper->getDefaultPixelFormatModifier(width, height, format, layerCount, usage,
351 outPixelFormatModifier);
352}
353
354status_t GraphicBufferMapper::getDefaultAllocationSize(uint32_t width, uint32_t height,
355 PixelFormat format, uint32_t layerCount,
356 uint64_t usage,
357 uint64_t* outAllocationSize) {
358 return mMapper->getDefaultAllocationSize(width, height, format, layerCount, usage,
359 outAllocationSize);
360}
361
362status_t GraphicBufferMapper::getDefaultProtectedContent(uint32_t width, uint32_t height,
363 PixelFormat format, uint32_t layerCount,
364 uint64_t usage,
365 uint64_t* outProtectedContent) {
366 return mMapper->getDefaultProtectedContent(width, height, format, layerCount, usage,
367 outProtectedContent);
368}
369
370status_t GraphicBufferMapper::getDefaultCompression(
371 uint32_t width, uint32_t height, PixelFormat format, uint32_t layerCount, uint64_t usage,
372 aidl::android::hardware::graphics::common::ExtendableType* outCompression) {
373 return mMapper->getDefaultCompression(width, height, format, layerCount, usage, outCompression);
374}
375
376status_t GraphicBufferMapper::getDefaultCompression(uint32_t width, uint32_t height,
377 PixelFormat format, uint32_t layerCount,
378 uint64_t usage,
379 ui::Compression* outCompression) {
380 return mMapper->getDefaultCompression(width, height, format, layerCount, usage, outCompression);
381}
382
383status_t GraphicBufferMapper::getDefaultInterlaced(
384 uint32_t width, uint32_t height, PixelFormat format, uint32_t layerCount, uint64_t usage,
385 aidl::android::hardware::graphics::common::ExtendableType* outInterlaced) {
386 return mMapper->getDefaultInterlaced(width, height, format, layerCount, usage, outInterlaced);
387}
388
389status_t GraphicBufferMapper::getDefaultInterlaced(uint32_t width, uint32_t height,
390 PixelFormat format, uint32_t layerCount,
391 uint64_t usage, ui::Interlaced* outInterlaced) {
392 return mMapper->getDefaultInterlaced(width, height, format, layerCount, usage, outInterlaced);
393}
394
395status_t GraphicBufferMapper::getDefaultChromaSiting(
396 uint32_t width, uint32_t height, PixelFormat format, uint32_t layerCount, uint64_t usage,
397 aidl::android::hardware::graphics::common::ExtendableType* outChromaSiting) {
398 return mMapper->getDefaultChromaSiting(width, height, format, layerCount, usage,
399 outChromaSiting);
400}
401
402status_t GraphicBufferMapper::getDefaultChromaSiting(uint32_t width, uint32_t height,
403 PixelFormat format, uint32_t layerCount,
404 uint64_t usage,
405 ui::ChromaSiting* outChromaSiting) {
406 return mMapper->getDefaultChromaSiting(width, height, format, layerCount, usage,
407 outChromaSiting);
408}
409
410status_t GraphicBufferMapper::getDefaultPlaneLayouts(
411 uint32_t width, uint32_t height, PixelFormat format, uint32_t layerCount, uint64_t usage,
412 std::vector<ui::PlaneLayout>* outPlaneLayouts) {
413 return mMapper->getDefaultPlaneLayouts(width, height, format, layerCount, usage,
414 outPlaneLayouts);
415}
416
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700417// ---------------------------------------------------------------------------
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700418}; // namespace android