blob: c67f4d8f83d72629bc29c7ea54d315009a64f646 [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001/*
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
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080017#include <stdlib.h>
18#include <stdio.h>
19#include <string.h>
20#include <math.h>
21
22#include <cutils/properties.h>
23
Mathias Agopian076b1cc2009-04-10 14:24:30 -070024#include <utils/RefBase.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080025#include <utils/Log.h>
26
Mathias Agopianc666cae2012-07-25 18:56:13 -070027#include <ui/DisplayInfo.h>
Mathias Agopian076b1cc2009-04-10 14:24:30 -070028#include <ui/PixelFormat.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080029
Mathias Agopiane3c697f2013-02-14 17:11:02 -080030#include <gui/Surface.h>
Jamie Gennis1a4d8832012-08-02 20:11:05 -070031
Mathias Agopian076b1cc2009-04-10 14:24:30 -070032#include <hardware/gralloc.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080033
Jesse Hall99c7dbb2013-03-14 14:29:29 -070034#include "DisplayHardware/DisplaySurface.h"
Mathias Agopian1b031492012-06-20 17:51:20 -070035#include "DisplayHardware/HWComposer.h"
Mathias Agopian875d8e12013-06-07 15:35:48 -070036#include "RenderEngine/RenderEngine.h"
Mathias Agopian1b031492012-06-20 17:51:20 -070037
Mathias Agopianda8d0a52012-09-04 15:05:38 -070038#include "clz.h"
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -070039#include "DisplayDevice.h"
Mathias Agopianc7d14e22011-08-01 16:32:21 -070040#include "SurfaceFlinger.h"
Mathias Agopian13127d82013-03-05 17:47:11 -080041#include "Layer.h"
Mathias Agopian1f7bec62010-06-25 18:02:21 -070042
Mathias Agopiana4912602012-07-12 14:25:33 -070043// ----------------------------------------------------------------------------
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080044using namespace android;
Mathias Agopiana4912602012-07-12 14:25:33 -070045// ----------------------------------------------------------------------------
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080046
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080047/*
48 * Initialize the display to the specified values.
49 *
50 */
51
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -070052DisplayDevice::DisplayDevice(
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080053 const sp<SurfaceFlinger>& flinger,
Jamie Gennisdd3cb842012-10-19 18:19:11 -070054 DisplayType type,
Jesse Hallffe1f192013-03-22 15:13:48 -070055 int32_t hwcId,
Jamie Gennisdd3cb842012-10-19 18:19:11 -070056 bool isSecure,
57 const wp<IBinder>& displayToken,
Jesse Hall99c7dbb2013-03-14 14:29:29 -070058 const sp<DisplaySurface>& displaySurface,
Mathias Agopiana4912602012-07-12 14:25:33 -070059 EGLConfig config)
Mathias Agopian92a979a2012-08-02 18:32:23 -070060 : mFlinger(flinger),
Jesse Hallffe1f192013-03-22 15:13:48 -070061 mType(type), mHwcDisplayId(hwcId),
Chih-Wei Huang27e25622013-01-07 17:33:56 +080062 mDisplayToken(displayToken),
Jesse Hall99c7dbb2013-03-14 14:29:29 -070063 mDisplaySurface(displaySurface),
Mathias Agopian92a979a2012-08-02 18:32:23 -070064 mDisplay(EGL_NO_DISPLAY),
65 mSurface(EGL_NO_SURFACE),
66 mContext(EGL_NO_CONTEXT),
Mathias Agopian92a979a2012-08-02 18:32:23 -070067 mDisplayWidth(), mDisplayHeight(), mFormat(),
68 mFlags(),
69 mPageFlipCount(),
Jamie Gennisdd3cb842012-10-19 18:19:11 -070070 mIsSecure(isSecure),
Mathias Agopian92a979a2012-08-02 18:32:23 -070071 mSecureLayerVisible(false),
72 mScreenAcquired(false),
Jesse Hall01e29052013-02-19 16:13:35 -080073 mLayerStack(NO_LAYER_STACK),
Mathias Agopianda8d0a52012-09-04 15:05:38 -070074 mOrientation()
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080075{
Jesse Hall99c7dbb2013-03-14 14:29:29 -070076 mNativeWindow = new Surface(mDisplaySurface->getIGraphicBufferProducer());
Jesse Hallffe1f192013-03-22 15:13:48 -070077 ANativeWindow* const window = mNativeWindow.get();
78
79 int format;
80 window->query(window, NATIVE_WINDOW_FORMAT, &format);
81
82 /*
83 * Create our display's surface
84 */
85
86 EGLSurface surface;
87 EGLint w, h;
88 EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
89 surface = eglCreateWindowSurface(display, config, window, NULL);
90 eglQuerySurface(display, surface, EGL_WIDTH, &mDisplayWidth);
91 eglQuerySurface(display, surface, EGL_HEIGHT, &mDisplayHeight);
92
93 mDisplay = display;
94 mSurface = surface;
95 mFormat = format;
96 mPageFlipCount = 0;
97 mViewport.makeInvalid();
98 mFrame.makeInvalid();
99
100 // virtual displays are always considered enabled
101 mScreenAcquired = (mType >= DisplayDevice::DISPLAY_VIRTUAL);
102
103 // Name the display. The name will be replaced shortly if the display
104 // was created with createDisplay().
105 switch (mType) {
106 case DISPLAY_PRIMARY:
107 mDisplayName = "Built-in Screen";
108 break;
109 case DISPLAY_EXTERNAL:
110 mDisplayName = "HDMI Screen";
111 break;
112 default:
113 mDisplayName = "Virtual Screen"; // e.g. Overlay #n
114 break;
115 }
116
117 // initialize the display orientation transform.
118 setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800119}
120
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700121DisplayDevice::~DisplayDevice() {
Mathias Agopian92a979a2012-08-02 18:32:23 -0700122 if (mSurface != EGL_NO_SURFACE) {
123 eglDestroySurface(mDisplay, mSurface);
124 mSurface = EGL_NO_SURFACE;
125 }
126}
127
Jesse Hall02d86562013-03-25 14:43:23 -0700128void DisplayDevice::disconnect(HWComposer& hwc) {
129 if (mHwcDisplayId >= 0) {
130 hwc.disconnectDisplay(mHwcDisplayId);
131 if (mHwcDisplayId >= DISPLAY_VIRTUAL)
132 hwc.freeDisplayId(mHwcDisplayId);
133 mHwcDisplayId = -1;
134 }
135}
136
Mathias Agopian92a979a2012-08-02 18:32:23 -0700137bool DisplayDevice::isValid() const {
138 return mFlinger != NULL;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800139}
140
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700141int DisplayDevice::getWidth() const {
Mathias Agopiana4912602012-07-12 14:25:33 -0700142 return mDisplayWidth;
143}
144
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700145int DisplayDevice::getHeight() const {
Mathias Agopiana4912602012-07-12 14:25:33 -0700146 return mDisplayHeight;
147}
148
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700149PixelFormat DisplayDevice::getFormat() const {
Mathias Agopiana4912602012-07-12 14:25:33 -0700150 return mFormat;
151}
152
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700153EGLSurface DisplayDevice::getEGLSurface() const {
Mathias Agopiana4912602012-07-12 14:25:33 -0700154 return mSurface;
155}
156
Mathias Agopian9e2463e2012-09-21 18:26:16 -0700157void DisplayDevice::setDisplayName(const String8& displayName) {
158 if (!displayName.isEmpty()) {
159 // never override the name with an empty name
160 mDisplayName = displayName;
161 }
162}
163
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700164uint32_t DisplayDevice::getPageFlipCount() const {
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700165 return mPageFlipCount;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800166}
167
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700168status_t DisplayDevice::compositionComplete() const {
Jesse Hall99c7dbb2013-03-14 14:29:29 -0700169 return mDisplaySurface->compositionComplete();
Mathias Agopian74faca22009-09-17 16:18:16 -0700170}
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800171
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700172void DisplayDevice::flip(const Region& dirty) const
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800173{
Mathias Agopian875d8e12013-06-07 15:35:48 -0700174 mFlinger->getRenderEngine().checkErrors();
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800175
176 EGLDisplay dpy = mDisplay;
177 EGLSurface surface = mSurface;
178
Jesse Hall01e29052013-02-19 16:13:35 -0800179#ifdef EGL_ANDROID_swap_rectangle
Mathias Agopiandf3ca302009-05-04 19:29:25 -0700180 if (mFlags & SWAP_RECTANGLE) {
Mathias Agopianb8a55602009-06-26 19:06:36 -0700181 const Region newDirty(dirty.intersect(bounds()));
182 const Rect b(newDirty.getBounds());
Mathias Agopiandf3ca302009-05-04 19:29:25 -0700183 eglSetSwapRectangleANDROID(dpy, surface,
184 b.left, b.top, b.width(), b.height());
Jesse Hall01e29052013-02-19 16:13:35 -0800185 }
Mathias Agopian5e78e092009-06-11 17:19:54 -0700186#endif
Mathias Agopiand8707032012-09-18 01:21:55 -0700187
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700188 mPageFlipCount++;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800189}
190
Jesse Hall38efe862013-04-06 23:12:29 -0700191status_t DisplayDevice::prepareFrame(const HWComposer& hwc) const {
192 DisplaySurface::CompositionType compositionType;
193 bool haveGles = hwc.hasGlesComposition(mHwcDisplayId);
194 bool haveHwc = hwc.hasHwcComposition(mHwcDisplayId);
195 if (haveGles && haveHwc) {
196 compositionType = DisplaySurface::COMPOSITION_MIXED;
197 } else if (haveGles) {
198 compositionType = DisplaySurface::COMPOSITION_GLES;
199 } else if (haveHwc) {
200 compositionType = DisplaySurface::COMPOSITION_HWC;
201 } else {
202 // Nothing to do -- when turning the screen off we get a frame like
203 // this. Call it a HWC frame since we won't be doing any GLES work but
204 // will do a prepare/set cycle.
205 compositionType = DisplaySurface::COMPOSITION_HWC;
206 }
207 return mDisplaySurface->prepareFrame(compositionType);
208}
209
Mathias Agopianda27af92012-09-13 18:17:13 -0700210void DisplayDevice::swapBuffers(HWComposer& hwc) const {
Jesse Hall99c7dbb2013-03-14 14:29:29 -0700211 // We need to call eglSwapBuffers() unless:
212 // (a) there was no GLES composition this frame, or
213 // (b) we're using a legacy HWC with no framebuffer target support (in
214 // which case HWComposer::commit() handles things).
215 if (hwc.initCheck() != NO_ERROR ||
216 (hwc.hasGlesComposition(mHwcDisplayId) &&
217 hwc.supportsFramebufferTarget())) {
218 EGLBoolean success = eglSwapBuffers(mDisplay, mSurface);
219 if (!success) {
220 EGLint error = eglGetError();
221 if (error == EGL_CONTEXT_LOST ||
222 mType == DisplayDevice::DISPLAY_PRIMARY) {
223 LOG_ALWAYS_FATAL("eglSwapBuffers(%p, %p) failed with 0x%08x",
224 mDisplay, mSurface, error);
225 } else {
226 ALOGE("eglSwapBuffers(%p, %p) failed with 0x%08x",
227 mDisplay, mSurface, error);
Mathias Agopianda27af92012-09-13 18:17:13 -0700228 }
229 }
230 }
Mathias Agopian52e21482012-09-24 18:07:21 -0700231
Jesse Hall99c7dbb2013-03-14 14:29:29 -0700232 status_t result = mDisplaySurface->advanceFrame();
233 if (result != NO_ERROR) {
234 ALOGE("[%s] failed pushing new frame to HWC: %d",
235 mDisplayName.string(), result);
Mathias Agopian32341382012-09-25 19:16:28 -0700236 }
Mathias Agopianda27af92012-09-13 18:17:13 -0700237}
238
239void DisplayDevice::onSwapBuffersCompleted(HWComposer& hwc) const {
240 if (hwc.initCheck() == NO_ERROR) {
Jesse Hall851cfe82013-03-20 13:44:00 -0700241 mDisplaySurface->onFrameCommitted();
Mathias Agopianda27af92012-09-13 18:17:13 -0700242 }
243}
244
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700245uint32_t DisplayDevice::getFlags() const
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800246{
247 return mFlags;
248}
249
Mathias Agopian875d8e12013-06-07 15:35:48 -0700250EGLBoolean DisplayDevice::makeCurrent(EGLDisplay dpy, EGLContext ctx) const {
Mathias Agopianda8d0a52012-09-04 15:05:38 -0700251 EGLBoolean result = EGL_TRUE;
Mathias Agopian52bbb1a2012-07-31 19:01:53 -0700252 EGLSurface sur = eglGetCurrentSurface(EGL_DRAW);
Mathias Agopian875d8e12013-06-07 15:35:48 -0700253 if (sur != mSurface) {
254 result = eglMakeCurrent(dpy, mSurface, mSurface, ctx);
Mathias Agopianda8d0a52012-09-04 15:05:38 -0700255 if (result == EGL_TRUE) {
Mathias Agopian875d8e12013-06-07 15:35:48 -0700256 setViewportAndProjection();
Mathias Agopianda8d0a52012-09-04 15:05:38 -0700257 }
Mathias Agopian52bbb1a2012-07-31 19:01:53 -0700258 }
Mathias Agopianda8d0a52012-09-04 15:05:38 -0700259 return result;
Mathias Agopian52bbb1a2012-07-31 19:01:53 -0700260}
261
Mathias Agopian875d8e12013-06-07 15:35:48 -0700262void DisplayDevice::setViewportAndProjection() const {
263 size_t w = mDisplayWidth;
264 size_t h = mDisplayHeight;
265 mFlinger->getRenderEngine().setViewportAndProjection(w, h);
Mathias Agopianbae92d02012-09-28 01:00:47 -0700266}
267
Mathias Agopian1b031492012-06-20 17:51:20 -0700268// ----------------------------------------------------------------------------
269
Mathias Agopian13127d82013-03-05 17:47:11 -0800270void DisplayDevice::setVisibleLayersSortedByZ(const Vector< sp<Layer> >& layers) {
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700271 mVisibleLayersSortedByZ = layers;
Mathias Agopianef7b9c72012-08-10 15:22:19 -0700272 mSecureLayerVisible = false;
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700273 size_t count = layers.size();
274 for (size_t i=0 ; i<count ; i++) {
Mathias Agopian13127d82013-03-05 17:47:11 -0800275 const sp<Layer>& layer(layers[i]);
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800276 if (layer->isSecure()) {
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700277 mSecureLayerVisible = true;
278 }
279 }
280}
281
Mathias Agopian13127d82013-03-05 17:47:11 -0800282const Vector< sp<Layer> >& DisplayDevice::getVisibleLayersSortedByZ() const {
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700283 return mVisibleLayersSortedByZ;
284}
285
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700286bool DisplayDevice::getSecureLayerVisible() const {
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700287 return mSecureLayerVisible;
288}
289
Mathias Agopiancd60f992012-08-16 16:28:27 -0700290Region DisplayDevice::getDirtyRegion(bool repaintEverything) const {
291 Region dirty;
Mathias Agopiancd60f992012-08-16 16:28:27 -0700292 if (repaintEverything) {
293 dirty.set(getBounds());
294 } else {
Mathias Agopianda8d0a52012-09-04 15:05:38 -0700295 const Transform& planeTransform(mGlobalTransform);
Mathias Agopiancd60f992012-08-16 16:28:27 -0700296 dirty = planeTransform.transform(this->dirtyRegion);
297 dirty.andSelf(getBounds());
298 }
299 return dirty;
300}
301
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700302// ----------------------------------------------------------------------------
303
Mathias Agopiand3ee2312012-08-02 14:01:42 -0700304bool DisplayDevice::canDraw() const {
305 return mScreenAcquired;
306}
307
308void DisplayDevice::releaseScreen() const {
309 mScreenAcquired = false;
310}
311
312void DisplayDevice::acquireScreen() const {
313 mScreenAcquired = true;
314}
315
316bool DisplayDevice::isScreenAcquired() const {
317 return mScreenAcquired;
318}
319
320// ----------------------------------------------------------------------------
321
Mathias Agopian28947d72012-08-08 18:51:15 -0700322void DisplayDevice::setLayerStack(uint32_t stack) {
323 mLayerStack = stack;
324 dirtyRegion.set(bounds());
325}
326
327// ----------------------------------------------------------------------------
328
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700329status_t DisplayDevice::orientationToTransfrom(
Mathias Agopian1b031492012-06-20 17:51:20 -0700330 int orientation, int w, int h, Transform* tr)
331{
332 uint32_t flags = 0;
333 switch (orientation) {
Mathias Agopian3165cc22012-08-08 19:42:09 -0700334 case DisplayState::eOrientationDefault:
Mathias Agopian1b031492012-06-20 17:51:20 -0700335 flags = Transform::ROT_0;
336 break;
Mathias Agopian3165cc22012-08-08 19:42:09 -0700337 case DisplayState::eOrientation90:
Mathias Agopian1b031492012-06-20 17:51:20 -0700338 flags = Transform::ROT_90;
339 break;
Mathias Agopian3165cc22012-08-08 19:42:09 -0700340 case DisplayState::eOrientation180:
Mathias Agopian1b031492012-06-20 17:51:20 -0700341 flags = Transform::ROT_180;
342 break;
Mathias Agopian3165cc22012-08-08 19:42:09 -0700343 case DisplayState::eOrientation270:
Mathias Agopian1b031492012-06-20 17:51:20 -0700344 flags = Transform::ROT_270;
345 break;
346 default:
347 return BAD_VALUE;
348 }
349 tr->set(flags, w, h);
350 return NO_ERROR;
351}
352
Mathias Agopian00e8c7a2012-09-04 19:30:46 -0700353void DisplayDevice::setProjection(int orientation,
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800354 const Rect& newViewport, const Rect& newFrame) {
355 Rect viewport(newViewport);
356 Rect frame(newFrame);
357
358 const int w = mDisplayWidth;
359 const int h = mDisplayHeight;
360
361 Transform R;
362 DisplayDevice::orientationToTransfrom(orientation, w, h, &R);
363
364 if (!frame.isValid()) {
365 // the destination frame can be invalid if it has never been set,
366 // in that case we assume the whole display frame.
367 frame = Rect(w, h);
368 }
369
370 if (viewport.isEmpty()) {
371 // viewport can be invalid if it has never been set, in that case
372 // we assume the whole display size.
373 // it's also invalid to have an empty viewport, so we handle that
374 // case in the same way.
375 viewport = Rect(w, h);
376 if (R.getOrientation() & Transform::ROT_90) {
377 // viewport is always specified in the logical orientation
378 // of the display (ie: post-rotation).
379 swap(viewport.right, viewport.bottom);
380 }
381 }
382
383 dirtyRegion.set(getBounds());
384
385 Transform TL, TP, S;
386 float src_width = viewport.width();
387 float src_height = viewport.height();
388 float dst_width = frame.width();
389 float dst_height = frame.height();
390 if (src_width != dst_width || src_height != dst_height) {
391 float sx = dst_width / src_width;
392 float sy = dst_height / src_height;
393 S.set(sx, 0, 0, sy);
394 }
395
396 float src_x = viewport.left;
397 float src_y = viewport.top;
398 float dst_x = frame.left;
399 float dst_y = frame.top;
400 TL.set(-src_x, -src_y);
401 TP.set(dst_x, dst_y);
402
403 // The viewport and frame are both in the logical orientation.
404 // Apply the logical translation, scale to physical size, apply the
405 // physical translation and finally rotate to the physical orientation.
406 mGlobalTransform = R * TP * S * TL;
407
408 const uint8_t type = mGlobalTransform.getType();
409 mNeedsFiltering = (!mGlobalTransform.preserveRects() ||
410 (type >= Transform::SCALE));
411
412 mScissor = mGlobalTransform.transform(viewport);
413 if (mScissor.isEmpty()) {
Mathias Agopian6c7f25a2013-05-09 20:37:10 -0700414 mScissor = getBounds();
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800415 }
416
Mathias Agopianda8d0a52012-09-04 15:05:38 -0700417 mOrientation = orientation;
Mathias Agopian00e8c7a2012-09-04 19:30:46 -0700418 mViewport = viewport;
419 mFrame = frame;
Mathias Agopian1b031492012-06-20 17:51:20 -0700420}
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700421
Mathias Agopian74d211a2013-04-22 16:55:35 +0200422void DisplayDevice::dump(String8& result) const {
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700423 const Transform& tr(mGlobalTransform);
Mathias Agopian74d211a2013-04-22 16:55:35 +0200424 result.appendFormat(
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700425 "+ DisplayDevice: %s\n"
Jesse Hall02d86562013-03-25 14:43:23 -0700426 " type=%x, hwcId=%d, layerStack=%u, (%4dx%4d), ANativeWindow=%p, orient=%2d (type=%08x), "
Jamie Gennisdd3cb842012-10-19 18:19:11 -0700427 "flips=%u, isSecure=%d, secureVis=%d, acquired=%d, numLayers=%u\n"
Mathias Agopian766dc492012-10-30 18:08:06 -0700428 " v:[%d,%d,%d,%d], f:[%d,%d,%d,%d], s:[%d,%d,%d,%d],"
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700429 "transform:[[%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f][%0.3f,%0.3f,%0.3f]]\n",
Jesse Hall02d86562013-03-25 14:43:23 -0700430 mDisplayName.string(), mType, mHwcDisplayId,
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700431 mLayerStack, mDisplayWidth, mDisplayHeight, mNativeWindow.get(),
432 mOrientation, tr.getType(), getPageFlipCount(),
Jamie Gennisdd3cb842012-10-19 18:19:11 -0700433 mIsSecure, mSecureLayerVisible, mScreenAcquired, mVisibleLayersSortedByZ.size(),
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700434 mViewport.left, mViewport.top, mViewport.right, mViewport.bottom,
435 mFrame.left, mFrame.top, mFrame.right, mFrame.bottom,
Mathias Agopian766dc492012-10-30 18:08:06 -0700436 mScissor.left, mScissor.top, mScissor.right, mScissor.bottom,
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700437 tr[0][0], tr[1][0], tr[2][0],
438 tr[0][1], tr[1][1], tr[2][1],
439 tr[0][2], tr[1][2], tr[2][2]);
440
Jesse Hall99c7dbb2013-03-14 14:29:29 -0700441 String8 surfaceDump;
442 mDisplaySurface->dump(surfaceDump);
443 result.append(surfaceDump);
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700444}