HWComposer.cpp revision 31d2843b45ebdb69ec3355111b7567363fd2a6b7
1a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian/*
2a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian * Copyright (C) 2010 The Android Open Source Project
3a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian *
4a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian * Licensed under the Apache License, Version 2.0 (the "License");
5a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian * you may not use this file except in compliance with the License.
6a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian * You may obtain a copy of the License at
7a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian *
8a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian *      http://www.apache.org/licenses/LICENSE-2.0
9a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian *
10a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian * Unless required by applicable law or agreed to in writing, software
11a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian * distributed under the License is distributed on an "AS IS" BASIS,
12a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian * See the License for the specific language governing permissions and
14a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian * limitations under the License.
15a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian */
16a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
17a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian#include <stdint.h>
18f1352df47fe20aed23c216a78923c7d248f2bb91Mathias Agopian#include <stdio.h>
19f1352df47fe20aed23c216a78923c7d248f2bb91Mathias Agopian#include <stdlib.h>
20f1352df47fe20aed23c216a78923c7d248f2bb91Mathias Agopian#include <string.h>
21a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian#include <sys/types.h>
22a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
23a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian#include <utils/Errors.h>
248372785879d329f592f6883620b5a32d80d74691Mathias Agopian#include <utils/String8.h>
2522da60c3e64cd57535cbba063c07127814a2b52fMathias Agopian#include <utils/Vector.h>
26a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
27a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian#include <hardware/hardware.h>
28a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
29a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian#include <cutils/log.h>
30a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
31a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian#include <EGL/egl.h>
32a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
3322da60c3e64cd57535cbba063c07127814a2b52fMathias Agopian#include "LayerBase.h"
34a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian#include "HWComposer.h"
35c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian#include "SurfaceFlinger.h"
36a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
37a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopiannamespace android {
38a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian// ---------------------------------------------------------------------------
39a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
40c7d14e247117392fbd44aa454622778a25c076aeMathias AgopianHWComposer::HWComposer(const sp<SurfaceFlinger>& flinger)
41c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian    : mFlinger(flinger),
42c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian      mModule(0), mHwc(0), mList(0), mCapacity(0),
439c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian      mNumOVLayers(0), mNumFBLayers(0),
44a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian      mDpy(EGL_NO_DISPLAY), mSur(EGL_NO_SURFACE)
45a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian{
46a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    int err = hw_get_module(HWC_HARDWARE_MODULE_ID, &mModule);
4732397c1cd3327905173b36baa6fd1c579bc328ffSteve Block    ALOGW_IF(err, "%s module not found", HWC_HARDWARE_MODULE_ID);
48a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    if (err == 0) {
49a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian        err = hwc_open(mModule, &mHwc);
50e6f43ddce78d6846af12550ff9193c5c6fe5844bSteve Block        ALOGE_IF(err, "%s device failed to initialize (%s)",
51a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian                HWC_HARDWARE_COMPOSER, strerror(-err));
52c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian        if (err == 0) {
53c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian            if (mHwc->registerProcs) {
54c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian                mCBContext.hwc = this;
55c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian                mCBContext.procs.invalidate = &hook_invalidate;
5631d2843b45ebdb69ec3355111b7567363fd2a6b7Mathias Agopian                mCBContext.procs.vsync = &hook_vsync;
57c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian                mHwc->registerProcs(mHwc, &mCBContext.procs);
5831d2843b45ebdb69ec3355111b7567363fd2a6b7Mathias Agopian                memset(mCBContext.procs.zero, 0, sizeof(mCBContext.procs.zero));
59c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian            }
60c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian        }
61a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    }
62a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian}
63a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
64a350ff98692b3a50cad5cc93f9f83221242ca86aMathias AgopianHWComposer::~HWComposer() {
65a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    free(mList);
66a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    if (mHwc) {
67a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian        hwc_close(mHwc);
68a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    }
69a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian}
70a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
71a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopianstatus_t HWComposer::initCheck() const {
72a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    return mHwc ? NO_ERROR : NO_INIT;
73a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian}
74a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
75c7d14e247117392fbd44aa454622778a25c076aeMathias Agopianvoid HWComposer::hook_invalidate(struct hwc_procs* procs) {
76c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian    reinterpret_cast<cb_context *>(procs)->hwc->invalidate();
77c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian}
78c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian
7931d2843b45ebdb69ec3355111b7567363fd2a6b7Mathias Agopianvoid HWComposer::hook_vsync(struct hwc_procs* procs, int dpy, int64_t timestamp) {
8031d2843b45ebdb69ec3355111b7567363fd2a6b7Mathias Agopian    reinterpret_cast<cb_context *>(procs)->hwc->vsync(dpy, timestamp);
8131d2843b45ebdb69ec3355111b7567363fd2a6b7Mathias Agopian}
8231d2843b45ebdb69ec3355111b7567363fd2a6b7Mathias Agopian
83c7d14e247117392fbd44aa454622778a25c076aeMathias Agopianvoid HWComposer::invalidate() {
84e2c2f9213f936f98db604dc9c126ff22f725a824Mathias Agopian    mFlinger->repaintEverything();
85c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian}
86c7d14e247117392fbd44aa454622778a25c076aeMathias Agopian
8731d2843b45ebdb69ec3355111b7567363fd2a6b7Mathias Agopianvoid HWComposer::vsync(int dpy, int64_t timestamp) {
8831d2843b45ebdb69ec3355111b7567363fd2a6b7Mathias Agopian}
8931d2843b45ebdb69ec3355111b7567363fd2a6b7Mathias Agopian
90a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopianvoid HWComposer::setFrameBuffer(EGLDisplay dpy, EGLSurface sur) {
91a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    mDpy = (hwc_display_t)dpy;
92a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    mSur = (hwc_surface_t)sur;
93a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian}
94a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
95a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopianstatus_t HWComposer::createWorkList(size_t numLayers) {
9645721773e1a68e96da4b6cc04cef276bae7ca3e9Mathias Agopian    if (mHwc) {
9745721773e1a68e96da4b6cc04cef276bae7ca3e9Mathias Agopian        if (!mList || mCapacity < numLayers) {
9845721773e1a68e96da4b6cc04cef276bae7ca3e9Mathias Agopian            free(mList);
9945721773e1a68e96da4b6cc04cef276bae7ca3e9Mathias Agopian            size_t size = sizeof(hwc_layer_list) + numLayers*sizeof(hwc_layer_t);
10045721773e1a68e96da4b6cc04cef276bae7ca3e9Mathias Agopian            mList = (hwc_layer_list_t*)malloc(size);
10145721773e1a68e96da4b6cc04cef276bae7ca3e9Mathias Agopian            mCapacity = numLayers;
10245721773e1a68e96da4b6cc04cef276bae7ca3e9Mathias Agopian        }
103a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian        mList->flags = HWC_GEOMETRY_CHANGED;
104a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian        mList->numHwLayers = numLayers;
105a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    }
106a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    return NO_ERROR;
107a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian}
108a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
109a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopianstatus_t HWComposer::prepare() const {
110a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    int err = mHwc->prepare(mHwc, mList);
1119c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian    if (err == NO_ERROR) {
1129c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian        size_t numOVLayers = 0;
1139c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian        size_t numFBLayers = 0;
1149c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian        size_t count = mList->numHwLayers;
1159c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian        for (size_t i=0 ; i<count ; i++) {
1169c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian            hwc_layer& l(mList->hwLayers[i]);
1179c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian            if (l.flags & HWC_SKIP_LAYER) {
1189c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian                l.compositionType = HWC_FRAMEBUFFER;
1199c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian            }
1209c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian            switch (l.compositionType) {
1219c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian                case HWC_OVERLAY:
1229c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian                    numOVLayers++;
1239c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian                    break;
1249c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian                case HWC_FRAMEBUFFER:
1259c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian                    numFBLayers++;
1269c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian                    break;
1279c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian            }
1289c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian        }
1299c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian        mNumOVLayers = numOVLayers;
1309c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian        mNumFBLayers = numFBLayers;
1319c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian    }
132a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    return (status_t)err;
133a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian}
134a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
1359c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopiansize_t HWComposer::getLayerCount(int type) const {
1369c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian    switch (type) {
1379c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian        case HWC_OVERLAY:
1389c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian            return mNumOVLayers;
1399c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian        case HWC_FRAMEBUFFER:
1409c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian            return mNumFBLayers;
1419c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian    }
1429c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian    return 0;
1439c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian}
1449c6e297271ec9af9d974242d89cfa08cb6ceaa0aMathias Agopian
145a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopianstatus_t HWComposer::commit() const {
146a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    int err = mHwc->set(mHwc, mDpy, mSur, mList);
14758959343dbdb6157fa5f5463262d4842b8954353Mathias Agopian    if (mList) {
14858959343dbdb6157fa5f5463262d4842b8954353Mathias Agopian        mList->flags &= ~HWC_GEOMETRY_CHANGED;
14958959343dbdb6157fa5f5463262d4842b8954353Mathias Agopian    }
150a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian    return (status_t)err;
151a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian}
152a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
153f5f2712854599b4970643c6000fe6ae950a08ba9Antti Hatalastatus_t HWComposer::release() const {
1547ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian    if (mHwc) {
1557ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian        int err = mHwc->set(mHwc, NULL, NULL, NULL);
1567ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian        return (status_t)err;
1577ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian    }
1587ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian    return NO_ERROR;
1597ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian}
1607ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian
1617ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopianstatus_t HWComposer::disable() {
1627ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian    if (mHwc) {
1637ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian        free(mList);
1647ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian        mList = NULL;
1657ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian        int err = mHwc->prepare(mHwc, NULL);
1667ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian        return (status_t)err;
1677ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian    }
1687ee4cd5556cef1878e1d4729f1b389f186311027Mathias Agopian    return NO_ERROR;
169f5f2712854599b4970643c6000fe6ae950a08ba9Antti Hatala}
170f5f2712854599b4970643c6000fe6ae950a08ba9Antti Hatala
17145721773e1a68e96da4b6cc04cef276bae7ca3e9Mathias Agopiansize_t HWComposer::getNumLayers() const {
17245721773e1a68e96da4b6cc04cef276bae7ca3e9Mathias Agopian    return mList ? mList->numHwLayers : 0;
173a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian}
174a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
17545721773e1a68e96da4b6cc04cef276bae7ca3e9Mathias Agopianhwc_layer_t* HWComposer::getLayers() const {
17645721773e1a68e96da4b6cc04cef276bae7ca3e9Mathias Agopian    return mList ? mList->hwLayers : 0;
177a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian}
178a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian
17922da60c3e64cd57535cbba063c07127814a2b52fMathias Agopianvoid HWComposer::dump(String8& result, char* buffer, size_t SIZE,
18022da60c3e64cd57535cbba063c07127814a2b52fMathias Agopian        const Vector< sp<LayerBase> >& visibleLayersSortedByZ) const {
1818372785879d329f592f6883620b5a32d80d74691Mathias Agopian    if (mHwc && mList) {
1828372785879d329f592f6883620b5a32d80d74691Mathias Agopian        result.append("Hardware Composer state:\n");
1838372785879d329f592f6883620b5a32d80d74691Mathias Agopian
1848372785879d329f592f6883620b5a32d80d74691Mathias Agopian        snprintf(buffer, SIZE, "  numHwLayers=%u, flags=%08x\n",
1858372785879d329f592f6883620b5a32d80d74691Mathias Agopian                mList->numHwLayers, mList->flags);
1868372785879d329f592f6883620b5a32d80d74691Mathias Agopian        result.append(buffer);
187fb4d5d5726c172adbe62341d99a2148685a98379Mathias Agopian        result.append(
188aebac5f34a098f733f887c993bd617a393e10db8Mathias Agopian                "   type   |  handle  |   hints  |   flags  | tr | blend |  format  |       source crop         |           frame           name \n"
189aebac5f34a098f733f887c993bd617a393e10db8Mathias Agopian                "----------+----------+----------+----------+----+-------+----------+---------------------------+--------------------------------\n");
190aebac5f34a098f733f887c993bd617a393e10db8Mathias Agopian        //      " ________ | ________ | ________ | ________ | __ | _____ | ________ | [_____,_____,_____,_____] | [_____,_____,_____,_____]
1918372785879d329f592f6883620b5a32d80d74691Mathias Agopian        for (size_t i=0 ; i<mList->numHwLayers ; i++) {
1928372785879d329f592f6883620b5a32d80d74691Mathias Agopian            const hwc_layer_t& l(mList->hwLayers[i]);
193fb4d5d5726c172adbe62341d99a2148685a98379Mathias Agopian            const sp<LayerBase> layer(visibleLayersSortedByZ[i]);
194fb4d5d5726c172adbe62341d99a2148685a98379Mathias Agopian            int32_t format = -1;
195fb4d5d5726c172adbe62341d99a2148685a98379Mathias Agopian            if (layer->getLayer() != NULL) {
196fb4d5d5726c172adbe62341d99a2148685a98379Mathias Agopian                const sp<GraphicBuffer>& buffer(layer->getLayer()->getActiveBuffer());
197fb4d5d5726c172adbe62341d99a2148685a98379Mathias Agopian                if (buffer != NULL) {
198fb4d5d5726c172adbe62341d99a2148685a98379Mathias Agopian                    format = buffer->getPixelFormat();
199fb4d5d5726c172adbe62341d99a2148685a98379Mathias Agopian                }
200fb4d5d5726c172adbe62341d99a2148685a98379Mathias Agopian            }
201fb4d5d5726c172adbe62341d99a2148685a98379Mathias Agopian            snprintf(buffer, SIZE,
202aebac5f34a098f733f887c993bd617a393e10db8Mathias Agopian                    " %8s | %08x | %08x | %08x | %02x | %05x | %08x | [%5d,%5d,%5d,%5d] | [%5d,%5d,%5d,%5d] %s\n",
2038372785879d329f592f6883620b5a32d80d74691Mathias Agopian                    l.compositionType ? "OVERLAY" : "FB",
204aebac5f34a098f733f887c993bd617a393e10db8Mathias Agopian                    intptr_t(l.handle), l.hints, l.flags, l.transform, l.blending, format,
2058372785879d329f592f6883620b5a32d80d74691Mathias Agopian                    l.sourceCrop.left, l.sourceCrop.top, l.sourceCrop.right, l.sourceCrop.bottom,
20622da60c3e64cd57535cbba063c07127814a2b52fMathias Agopian                    l.displayFrame.left, l.displayFrame.top, l.displayFrame.right, l.displayFrame.bottom,
207fb4d5d5726c172adbe62341d99a2148685a98379Mathias Agopian                    layer->getName().string());
2088372785879d329f592f6883620b5a32d80d74691Mathias Agopian            result.append(buffer);
2098372785879d329f592f6883620b5a32d80d74691Mathias Agopian        }
2101d21a9cafc534c34a2f28c985c4c7aa176d0e67bErik Gilling    }
2111d21a9cafc534c34a2f28c985c4c7aa176d0e67bErik Gilling    if (mHwc && mHwc->common.version >= 1 && mHwc->dump) {
2121d21a9cafc534c34a2f28c985c4c7aa176d0e67bErik Gilling        mHwc->dump(mHwc, buffer, SIZE);
2131d21a9cafc534c34a2f28c985c4c7aa176d0e67bErik Gilling        result.append(buffer);
2148372785879d329f592f6883620b5a32d80d74691Mathias Agopian    }
2158372785879d329f592f6883620b5a32d80d74691Mathias Agopian}
2168372785879d329f592f6883620b5a32d80d74691Mathias Agopian
217a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian// ---------------------------------------------------------------------------
218a350ff98692b3a50cad5cc93f9f83221242ca86aMathias Agopian}; // namespace android
219