blob: 6002a6d29ecc8abc860b1ca273e633b9a5e49076 [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>
John Reck0ff95c92022-12-08 11:45:29 -050039#include <ui/Gralloc5.h>
Mathias Agopiana9347642017-02-13 16:42:28 -080040#include <ui/GraphicBuffer.h>
Mathias Agopian076b1cc2009-04-10 14:24:30 -070041
Dan Stoza8deb4da2016-06-01 18:21:44 -070042#include <system/graphics.h>
Mathias Agopian8b765b72009-04-10 20:34:46 -070043
Mathias Agopian076b1cc2009-04-10 14:24:30 -070044namespace android {
45// ---------------------------------------------------------------------------
46
Mathias Agopian3330b202009-10-05 17:07:12 -070047ANDROID_SINGLETON_STATIC_INSTANCE( GraphicBufferMapper )
Mathias Agopian4243e662009-04-15 18:34:24 -070048
Jesse Halleeb4ac72017-07-06 14:02:29 -070049void GraphicBufferMapper::preloadHal() {
Marissa Walld380e2c2018-12-29 14:17:29 -080050 Gralloc2Mapper::preload();
Marissa Wall925bf7f2018-12-29 14:27:11 -080051 Gralloc3Mapper::preload();
Marissa Wall87c8ba72019-06-20 14:20:52 -070052 Gralloc4Mapper::preload();
John Reck0ff95c92022-12-08 11:45:29 -050053 Gralloc5Mapper::preload();
Jesse Halleeb4ac72017-07-06 14:02:29 -070054}
55
Marissa Wall925bf7f2018-12-29 14:27:11 -080056GraphicBufferMapper::GraphicBufferMapper() {
John Reck0ff95c92022-12-08 11:45:29 -050057 mMapper = std::make_unique<const Gralloc5Mapper>();
58 if (mMapper->isLoaded()) {
59 mMapperVersion = Version::GRALLOC_5;
60 return;
61 }
Marissa Wall87c8ba72019-06-20 14:20:52 -070062 mMapper = std::make_unique<const Gralloc4Mapper>();
63 if (mMapper->isLoaded()) {
64 mMapperVersion = Version::GRALLOC_4;
65 return;
66 }
Marissa Wall925bf7f2018-12-29 14:27:11 -080067 mMapper = std::make_unique<const Gralloc3Mapper>();
Marissa Wall87c8ba72019-06-20 14:20:52 -070068 if (mMapper->isLoaded()) {
Valerie Haud2f4daf2019-02-15 13:49:00 -080069 mMapperVersion = Version::GRALLOC_3;
Marissa Wall87c8ba72019-06-20 14:20:52 -070070 return;
71 }
72 mMapper = std::make_unique<const Gralloc2Mapper>();
73 if (mMapper->isLoaded()) {
74 mMapperVersion = Version::GRALLOC_2;
75 return;
Marissa Wall925bf7f2018-12-29 14:27:11 -080076 }
77
Marissa Wall87c8ba72019-06-20 14:20:52 -070078 LOG_ALWAYS_FATAL("gralloc-mapper is missing");
Marissa Wall925bf7f2018-12-29 14:27:11 -080079}
Dan Stoza8deb4da2016-06-01 18:21:44 -070080
Marissa Wall22b2de12019-12-02 18:11:43 -080081void GraphicBufferMapper::dumpBuffer(buffer_handle_t bufferHandle, std::string& result,
82 bool less) const {
83 result.append(mMapper->dumpBuffer(bufferHandle, less));
84}
85
86void GraphicBufferMapper::dumpBufferToSystemLog(buffer_handle_t bufferHandle, bool less) {
87 std::string s;
88 GraphicBufferMapper::getInstance().dumpBuffer(bufferHandle, s, less);
89 ALOGD("%s", s.c_str());
90}
91
John Reck0ff95c92022-12-08 11:45:29 -050092status_t GraphicBufferMapper::importBuffer(const native_handle_t* rawHandle, uint32_t width,
93 uint32_t height, uint32_t layerCount, PixelFormat format,
94 uint64_t usage, uint32_t stride,
95 buffer_handle_t* outHandle) {
Mathias Agopiancf563192012-02-29 20:43:29 -080096 ATRACE_CALL();
Mathias Agopian0a757812010-12-08 16:40:01 -080097
Chia-I Wudbbe33b2017-09-27 15:22:21 -070098 buffer_handle_t bufferHandle;
John Reck0ff95c92022-12-08 11:45:29 -050099 status_t error = mMapper->importBuffer(rawHandle, &bufferHandle);
Marissa Wall1e779252018-12-29 12:01:57 -0800100 if (error != NO_ERROR) {
Chia-I Wudbbe33b2017-09-27 15:22:21 -0700101 ALOGW("importBuffer(%p) failed: %d", rawHandle, error);
Marissa Wall1e779252018-12-29 12:01:57 -0800102 return error;
Chia-I Wudbbe33b2017-09-27 15:22:21 -0700103 }
Chia-I Wu5bac7f32017-04-06 12:34:32 -0700104
Marissa Wall1e779252018-12-29 12:01:57 -0800105 error = mMapper->validateBufferSize(bufferHandle, width, height, format, layerCount, usage,
106 stride);
107 if (error != NO_ERROR) {
Chia-I Wudbbe33b2017-09-27 15:22:21 -0700108 ALOGE("validateBufferSize(%p) failed: %d", rawHandle, error);
109 freeBuffer(bufferHandle);
110 return static_cast<status_t>(error);
111 }
Chia-I Wu5bac7f32017-04-06 12:34:32 -0700112
Chia-I Wudbbe33b2017-09-27 15:22:21 -0700113 *outHandle = bufferHandle;
114
115 return NO_ERROR;
116}
117
John Reck0ff95c92022-12-08 11:45:29 -0500118status_t GraphicBufferMapper::importBufferNoValidate(const native_handle_t* rawHandle,
119 buffer_handle_t* outHandle) {
120 return mMapper->importBuffer(rawHandle, outHandle);
121}
122
Chia-I Wudbbe33b2017-09-27 15:22:21 -0700123void GraphicBufferMapper::getTransportSize(buffer_handle_t handle,
124 uint32_t* outTransportNumFds, uint32_t* outTransportNumInts)
125{
126 mMapper->getTransportSize(handle, outTransportNumFds, outTransportNumInts);
Chia-I Wu5bac7f32017-04-06 12:34:32 -0700127}
128
Chia-I Wu5bac7f32017-04-06 12:34:32 -0700129status_t GraphicBufferMapper::freeBuffer(buffer_handle_t handle)
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700130{
Mathias Agopiancf563192012-02-29 20:43:29 -0800131 ATRACE_CALL();
Mathias Agopian0a757812010-12-08 16:40:01 -0800132
Chia-I Wucb8405e2017-04-17 15:20:19 -0700133 mMapper->freeBuffer(handle);
Chia-I Wu9ba189d2016-09-22 17:13:08 +0800134
Chia-I Wucb8405e2017-04-17 15:20:19 -0700135 return NO_ERROR;
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700136}
137
Valerie Hau0c9fc362019-01-22 09:17:19 -0800138status_t GraphicBufferMapper::lock(buffer_handle_t handle, uint32_t usage, const Rect& bounds,
139 void** vaddr, int32_t* outBytesPerPixel,
140 int32_t* outBytesPerStride) {
141 return lockAsync(handle, usage, bounds, vaddr, -1, outBytesPerPixel, outBytesPerStride);
Dan Stoza8deb4da2016-06-01 18:21:44 -0700142}
Eino-Ville Talvalac43946b2013-05-04 18:07:43 -0700143
Dan Stoza8deb4da2016-06-01 18:21:44 -0700144status_t GraphicBufferMapper::lockYCbCr(buffer_handle_t handle, uint32_t usage,
145 const Rect& bounds, android_ycbcr *ycbcr)
146{
147 return lockAsyncYCbCr(handle, usage, bounds, ycbcr, -1);
Eino-Ville Talvalac43946b2013-05-04 18:07:43 -0700148}
149
Mathias Agopian3330b202009-10-05 17:07:12 -0700150status_t GraphicBufferMapper::unlock(buffer_handle_t handle)
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700151{
Dan Stoza8deb4da2016-06-01 18:21:44 -0700152 int32_t fenceFd = -1;
153 status_t error = unlockAsync(handle, &fenceFd);
Daniel Jaraie9147c22017-09-20 11:33:51 +0200154 if (error == NO_ERROR && fenceFd >= 0) {
Dan Stoza8deb4da2016-06-01 18:21:44 -0700155 sync_wait(fenceFd, -1);
156 close(fenceFd);
157 }
158 return error;
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700159}
160
Valerie Hau0c9fc362019-01-22 09:17:19 -0800161status_t GraphicBufferMapper::lockAsync(buffer_handle_t handle, uint32_t usage, const Rect& bounds,
162 void** vaddr, int fenceFd, int32_t* outBytesPerPixel,
163 int32_t* outBytesPerStride) {
164 return lockAsync(handle, usage, usage, bounds, vaddr, fenceFd, outBytesPerPixel,
165 outBytesPerStride);
Craig Donnere96a3252017-02-02 12:13:34 -0800166}
167
Valerie Hau0c9fc362019-01-22 09:17:19 -0800168status_t GraphicBufferMapper::lockAsync(buffer_handle_t handle, uint64_t producerUsage,
169 uint64_t consumerUsage, const Rect& bounds, void** vaddr,
170 int fenceFd, int32_t* outBytesPerPixel,
171 int32_t* outBytesPerStride) {
Francis Hart8f396012014-04-01 15:30:53 +0300172 ATRACE_CALL();
Francis Hart8f396012014-04-01 15:30:53 +0300173
Chia-I Wucb8405e2017-04-17 15:20:19 -0700174 const uint64_t usage = static_cast<uint64_t>(
175 android_convertGralloc1To0Usage(producerUsage, consumerUsage));
Valerie Hau0c9fc362019-01-22 09:17:19 -0800176 return mMapper->lock(handle, usage, bounds, fenceFd, vaddr, outBytesPerPixel,
177 outBytesPerStride);
Dan Stoza8deb4da2016-06-01 18:21:44 -0700178}
179
Francis Hart8f396012014-04-01 15:30:53 +0300180status_t GraphicBufferMapper::lockAsyncYCbCr(buffer_handle_t handle,
Dan Stozad3182402014-11-17 12:03:59 -0800181 uint32_t usage, const Rect& bounds, android_ycbcr *ycbcr, int fenceFd)
Francis Hart8f396012014-04-01 15:30:53 +0300182{
183 ATRACE_CALL();
Francis Hart8f396012014-04-01 15:30:53 +0300184
Marissa Wall1e779252018-12-29 12:01:57 -0800185 return mMapper->lock(handle, usage, bounds, fenceFd, ycbcr);
Francis Hart8f396012014-04-01 15:30:53 +0300186}
187
188status_t GraphicBufferMapper::unlockAsync(buffer_handle_t handle, int *fenceFd)
189{
190 ATRACE_CALL();
Francis Hart8f396012014-04-01 15:30:53 +0300191
Chia-I Wucb8405e2017-04-17 15:20:19 -0700192 *fenceFd = mMapper->unlock(handle);
Francis Hart8f396012014-04-01 15:30:53 +0300193
Chia-I Wucb8405e2017-04-17 15:20:19 -0700194 return NO_ERROR;
Francis Hart8f396012014-04-01 15:30:53 +0300195}
196
Valerie Hauddbfaeb2019-02-01 09:54:20 -0800197status_t GraphicBufferMapper::isSupported(uint32_t width, uint32_t height,
198 android::PixelFormat format, uint32_t layerCount,
199 uint64_t usage, bool* outSupported) {
200 return mMapper->isSupported(width, height, format, layerCount, usage, outSupported);
201}
Marissa Wall22b2de12019-12-02 18:11:43 -0800202
203status_t GraphicBufferMapper::getBufferId(buffer_handle_t bufferHandle, uint64_t* outBufferId) {
204 return mMapper->getBufferId(bufferHandle, outBufferId);
205}
206
207status_t GraphicBufferMapper::getName(buffer_handle_t bufferHandle, std::string* outName) {
208 return mMapper->getName(bufferHandle, outName);
209}
210
211status_t GraphicBufferMapper::getWidth(buffer_handle_t bufferHandle, uint64_t* outWidth) {
212 return mMapper->getWidth(bufferHandle, outWidth);
213}
214
215status_t GraphicBufferMapper::getHeight(buffer_handle_t bufferHandle, uint64_t* outHeight) {
216 return mMapper->getHeight(bufferHandle, outHeight);
217}
218
219status_t GraphicBufferMapper::getLayerCount(buffer_handle_t bufferHandle, uint64_t* outLayerCount) {
220 return mMapper->getLayerCount(bufferHandle, outLayerCount);
221}
222
223status_t GraphicBufferMapper::getPixelFormatRequested(buffer_handle_t bufferHandle,
224 ui::PixelFormat* outPixelFormatRequested) {
225 return mMapper->getPixelFormatRequested(bufferHandle, outPixelFormatRequested);
226}
227
228status_t GraphicBufferMapper::getPixelFormatFourCC(buffer_handle_t bufferHandle,
229 uint32_t* outPixelFormatFourCC) {
230 return mMapper->getPixelFormatFourCC(bufferHandle, outPixelFormatFourCC);
231}
232
233status_t GraphicBufferMapper::getPixelFormatModifier(buffer_handle_t bufferHandle,
234 uint64_t* outPixelFormatModifier) {
235 return mMapper->getPixelFormatModifier(bufferHandle, outPixelFormatModifier);
236}
237
238status_t GraphicBufferMapper::getUsage(buffer_handle_t bufferHandle, uint64_t* outUsage) {
239 return mMapper->getUsage(bufferHandle, outUsage);
240}
241
242status_t GraphicBufferMapper::getAllocationSize(buffer_handle_t bufferHandle,
243 uint64_t* outAllocationSize) {
244 return mMapper->getAllocationSize(bufferHandle, outAllocationSize);
245}
246
247status_t GraphicBufferMapper::getProtectedContent(buffer_handle_t bufferHandle,
248 uint64_t* outProtectedContent) {
249 return mMapper->getProtectedContent(bufferHandle, outProtectedContent);
250}
251
252status_t GraphicBufferMapper::getCompression(
253 buffer_handle_t bufferHandle,
254 aidl::android::hardware::graphics::common::ExtendableType* outCompression) {
255 return mMapper->getCompression(bufferHandle, outCompression);
256}
257
258status_t GraphicBufferMapper::getCompression(buffer_handle_t bufferHandle,
259 ui::Compression* outCompression) {
260 return mMapper->getCompression(bufferHandle, outCompression);
261}
262
263status_t GraphicBufferMapper::getInterlaced(
264 buffer_handle_t bufferHandle,
265 aidl::android::hardware::graphics::common::ExtendableType* outInterlaced) {
266 return mMapper->getInterlaced(bufferHandle, outInterlaced);
267}
268
269status_t GraphicBufferMapper::getInterlaced(buffer_handle_t bufferHandle,
270 ui::Interlaced* outInterlaced) {
271 return mMapper->getInterlaced(bufferHandle, outInterlaced);
272}
273
274status_t GraphicBufferMapper::getChromaSiting(
275 buffer_handle_t bufferHandle,
276 aidl::android::hardware::graphics::common::ExtendableType* outChromaSiting) {
277 return mMapper->getChromaSiting(bufferHandle, outChromaSiting);
278}
279
280status_t GraphicBufferMapper::getChromaSiting(buffer_handle_t bufferHandle,
281 ui::ChromaSiting* outChromaSiting) {
282 return mMapper->getChromaSiting(bufferHandle, outChromaSiting);
283}
284
285status_t GraphicBufferMapper::getPlaneLayouts(buffer_handle_t bufferHandle,
286 std::vector<ui::PlaneLayout>* outPlaneLayouts) {
287 return mMapper->getPlaneLayouts(bufferHandle, outPlaneLayouts);
288}
289
290status_t GraphicBufferMapper::getDataspace(buffer_handle_t bufferHandle,
291 ui::Dataspace* outDataspace) {
292 return mMapper->getDataspace(bufferHandle, outDataspace);
293}
294
Alec Mouri9c604e32022-03-18 22:47:44 +0000295status_t GraphicBufferMapper::setDataspace(buffer_handle_t bufferHandle, ui::Dataspace dataspace) {
296 return mMapper->setDataspace(bufferHandle, dataspace);
297}
298
Marissa Wall22b2de12019-12-02 18:11:43 -0800299status_t GraphicBufferMapper::getBlendMode(buffer_handle_t bufferHandle,
300 ui::BlendMode* outBlendMode) {
301 return mMapper->getBlendMode(bufferHandle, outBlendMode);
302}
303
Marissa Wallef785e12019-12-12 14:26:59 -0800304status_t GraphicBufferMapper::getSmpte2086(buffer_handle_t bufferHandle,
305 std::optional<ui::Smpte2086>* outSmpte2086) {
306 return mMapper->getSmpte2086(bufferHandle, outSmpte2086);
307}
308
Alec Mouri9c604e32022-03-18 22:47:44 +0000309status_t GraphicBufferMapper::setSmpte2086(buffer_handle_t bufferHandle,
310 std::optional<ui::Smpte2086> smpte2086) {
311 return mMapper->setSmpte2086(bufferHandle, smpte2086);
312}
313
Marissa Wallef785e12019-12-12 14:26:59 -0800314status_t GraphicBufferMapper::getCta861_3(buffer_handle_t bufferHandle,
315 std::optional<ui::Cta861_3>* outCta861_3) {
316 return mMapper->getCta861_3(bufferHandle, outCta861_3);
317}
318
Alec Mouri9c604e32022-03-18 22:47:44 +0000319status_t GraphicBufferMapper::setCta861_3(buffer_handle_t bufferHandle,
320 std::optional<ui::Cta861_3> cta861_3) {
321 return mMapper->setCta861_3(bufferHandle, cta861_3);
322}
323
Marissa Wallef785e12019-12-12 14:26:59 -0800324status_t GraphicBufferMapper::getSmpte2094_40(
325 buffer_handle_t bufferHandle, std::optional<std::vector<uint8_t>>* outSmpte2094_40) {
326 return mMapper->getSmpte2094_40(bufferHandle, outSmpte2094_40);
327}
328
Alec Mouri9c604e32022-03-18 22:47:44 +0000329status_t GraphicBufferMapper::setSmpte2094_40(buffer_handle_t bufferHandle,
330 std::optional<std::vector<uint8_t>> smpte2094_40) {
331 return mMapper->setSmpte2094_40(bufferHandle, smpte2094_40);
332}
333
Alec Mouri332765e2021-10-06 16:38:12 -0700334status_t GraphicBufferMapper::getSmpte2094_10(
335 buffer_handle_t bufferHandle, std::optional<std::vector<uint8_t>>* outSmpte2094_10) {
336 return mMapper->getSmpte2094_10(bufferHandle, outSmpte2094_10);
337}
338
Alec Mouri9c604e32022-03-18 22:47:44 +0000339status_t GraphicBufferMapper::setSmpte2094_10(buffer_handle_t bufferHandle,
340 std::optional<std::vector<uint8_t>> smpte2094_10) {
341 return mMapper->setSmpte2094_10(bufferHandle, smpte2094_10);
342}
343
Marissa Wall22b2de12019-12-02 18:11:43 -0800344status_t GraphicBufferMapper::getDefaultPixelFormatFourCC(uint32_t width, uint32_t height,
345 PixelFormat format, uint32_t layerCount,
346 uint64_t usage,
347 uint32_t* outPixelFormatFourCC) {
348 return mMapper->getDefaultPixelFormatFourCC(width, height, format, layerCount, usage,
349 outPixelFormatFourCC);
350}
351
352status_t GraphicBufferMapper::getDefaultPixelFormatModifier(uint32_t width, uint32_t height,
353 PixelFormat format, uint32_t layerCount,
354 uint64_t usage,
355 uint64_t* outPixelFormatModifier) {
356 return mMapper->getDefaultPixelFormatModifier(width, height, format, layerCount, usage,
357 outPixelFormatModifier);
358}
359
360status_t GraphicBufferMapper::getDefaultAllocationSize(uint32_t width, uint32_t height,
361 PixelFormat format, uint32_t layerCount,
362 uint64_t usage,
363 uint64_t* outAllocationSize) {
364 return mMapper->getDefaultAllocationSize(width, height, format, layerCount, usage,
365 outAllocationSize);
366}
367
368status_t GraphicBufferMapper::getDefaultProtectedContent(uint32_t width, uint32_t height,
369 PixelFormat format, uint32_t layerCount,
370 uint64_t usage,
371 uint64_t* outProtectedContent) {
372 return mMapper->getDefaultProtectedContent(width, height, format, layerCount, usage,
373 outProtectedContent);
374}
375
376status_t GraphicBufferMapper::getDefaultCompression(
377 uint32_t width, uint32_t height, PixelFormat format, uint32_t layerCount, uint64_t usage,
378 aidl::android::hardware::graphics::common::ExtendableType* outCompression) {
379 return mMapper->getDefaultCompression(width, height, format, layerCount, usage, outCompression);
380}
381
382status_t GraphicBufferMapper::getDefaultCompression(uint32_t width, uint32_t height,
383 PixelFormat format, uint32_t layerCount,
384 uint64_t usage,
385 ui::Compression* outCompression) {
386 return mMapper->getDefaultCompression(width, height, format, layerCount, usage, outCompression);
387}
388
389status_t GraphicBufferMapper::getDefaultInterlaced(
390 uint32_t width, uint32_t height, PixelFormat format, uint32_t layerCount, uint64_t usage,
391 aidl::android::hardware::graphics::common::ExtendableType* outInterlaced) {
392 return mMapper->getDefaultInterlaced(width, height, format, layerCount, usage, outInterlaced);
393}
394
395status_t GraphicBufferMapper::getDefaultInterlaced(uint32_t width, uint32_t height,
396 PixelFormat format, uint32_t layerCount,
397 uint64_t usage, ui::Interlaced* outInterlaced) {
398 return mMapper->getDefaultInterlaced(width, height, format, layerCount, usage, outInterlaced);
399}
400
401status_t GraphicBufferMapper::getDefaultChromaSiting(
402 uint32_t width, uint32_t height, PixelFormat format, uint32_t layerCount, uint64_t usage,
403 aidl::android::hardware::graphics::common::ExtendableType* outChromaSiting) {
404 return mMapper->getDefaultChromaSiting(width, height, format, layerCount, usage,
405 outChromaSiting);
406}
407
408status_t GraphicBufferMapper::getDefaultChromaSiting(uint32_t width, uint32_t height,
409 PixelFormat format, uint32_t layerCount,
410 uint64_t usage,
411 ui::ChromaSiting* outChromaSiting) {
412 return mMapper->getDefaultChromaSiting(width, height, format, layerCount, usage,
413 outChromaSiting);
414}
415
416status_t GraphicBufferMapper::getDefaultPlaneLayouts(
417 uint32_t width, uint32_t height, PixelFormat format, uint32_t layerCount, uint64_t usage,
418 std::vector<ui::PlaneLayout>* outPlaneLayouts) {
419 return mMapper->getDefaultPlaneLayouts(width, height, format, layerCount, usage,
420 outPlaneLayouts);
421}
422
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700423// ---------------------------------------------------------------------------
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700424}; // namespace android