blob: b001bdb0fcc6dafa93e141d7892c36d87f1ce059 [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
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080032#include <GLES/gl.h>
Mathias Agopian076b1cc2009-04-10 14:24:30 -070033#include <EGL/egl.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080034#include <EGL/eglext.h>
35
Mathias Agopian076b1cc2009-04-10 14:24:30 -070036#include <hardware/gralloc.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080037
Jesse Hall99c7dbb2013-03-14 14:29:29 -070038#include "DisplayHardware/DisplaySurface.h"
Mathias Agopian1b031492012-06-20 17:51:20 -070039#include "DisplayHardware/HWComposer.h"
40
Mathias Agopianda8d0a52012-09-04 15:05:38 -070041#include "clz.h"
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -070042#include "DisplayDevice.h"
Mathias Agopian1f7bec62010-06-25 18:02:21 -070043#include "GLExtensions.h"
Mathias Agopianc7d14e22011-08-01 16:32:21 -070044#include "SurfaceFlinger.h"
Mathias Agopian13127d82013-03-05 17:47:11 -080045#include "Layer.h"
Mathias Agopian1f7bec62010-06-25 18:02:21 -070046
Mathias Agopiana4912602012-07-12 14:25:33 -070047// ----------------------------------------------------------------------------
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080048using namespace android;
Mathias Agopiana4912602012-07-12 14:25:33 -070049// ----------------------------------------------------------------------------
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080050
51static __attribute__((noinline))
52void checkGLErrors()
53{
Mathias Agopiancbb288b2009-09-07 16:32:45 -070054 do {
55 // there could be more than one error flag
56 GLenum error = glGetError();
57 if (error == GL_NO_ERROR)
58 break;
Steve Blocke6f43dd2012-01-06 19:20:56 +000059 ALOGE("GL error 0x%04x", int(error));
Mathias Agopiancbb288b2009-09-07 16:32:45 -070060 } while(true);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080061}
62
Mathias Agopiana4912602012-07-12 14:25:33 -070063// ----------------------------------------------------------------------------
64
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080065/*
66 * Initialize the display to the specified values.
67 *
68 */
69
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -070070DisplayDevice::DisplayDevice(
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080071 const sp<SurfaceFlinger>& flinger,
Jamie Gennisdd3cb842012-10-19 18:19:11 -070072 DisplayType type,
Jesse Hallffe1f192013-03-22 15:13:48 -070073 int32_t hwcId,
Jamie Gennisdd3cb842012-10-19 18:19:11 -070074 bool isSecure,
75 const wp<IBinder>& displayToken,
Jesse Hall99c7dbb2013-03-14 14:29:29 -070076 const sp<DisplaySurface>& displaySurface,
Mathias Agopiana4912602012-07-12 14:25:33 -070077 EGLConfig config)
Mathias Agopian92a979a2012-08-02 18:32:23 -070078 : mFlinger(flinger),
Jesse Hallffe1f192013-03-22 15:13:48 -070079 mType(type), mHwcDisplayId(hwcId),
Chih-Wei Huang27e25622013-01-07 17:33:56 +080080 mDisplayToken(displayToken),
Jesse Hall99c7dbb2013-03-14 14:29:29 -070081 mDisplaySurface(displaySurface),
Mathias Agopian92a979a2012-08-02 18:32:23 -070082 mDisplay(EGL_NO_DISPLAY),
83 mSurface(EGL_NO_SURFACE),
84 mContext(EGL_NO_CONTEXT),
Mathias Agopian92a979a2012-08-02 18:32:23 -070085 mDisplayWidth(), mDisplayHeight(), mFormat(),
86 mFlags(),
87 mPageFlipCount(),
Jamie Gennisdd3cb842012-10-19 18:19:11 -070088 mIsSecure(isSecure),
Mathias Agopian92a979a2012-08-02 18:32:23 -070089 mSecureLayerVisible(false),
90 mScreenAcquired(false),
Jesse Hall01e29052013-02-19 16:13:35 -080091 mLayerStack(NO_LAYER_STACK),
Mathias Agopianda8d0a52012-09-04 15:05:38 -070092 mOrientation()
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080093{
Jesse Hall99c7dbb2013-03-14 14:29:29 -070094 mNativeWindow = new Surface(mDisplaySurface->getIGraphicBufferProducer());
Jesse Hallffe1f192013-03-22 15:13:48 -070095 ANativeWindow* const window = mNativeWindow.get();
96
97 int format;
98 window->query(window, NATIVE_WINDOW_FORMAT, &format);
99
100 /*
101 * Create our display's surface
102 */
103
104 EGLSurface surface;
105 EGLint w, h;
106 EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
107 surface = eglCreateWindowSurface(display, config, window, NULL);
108 eglQuerySurface(display, surface, EGL_WIDTH, &mDisplayWidth);
109 eglQuerySurface(display, surface, EGL_HEIGHT, &mDisplayHeight);
110
111 mDisplay = display;
112 mSurface = surface;
113 mFormat = format;
114 mPageFlipCount = 0;
115 mViewport.makeInvalid();
116 mFrame.makeInvalid();
117
118 // virtual displays are always considered enabled
119 mScreenAcquired = (mType >= DisplayDevice::DISPLAY_VIRTUAL);
120
121 // Name the display. The name will be replaced shortly if the display
122 // was created with createDisplay().
123 switch (mType) {
124 case DISPLAY_PRIMARY:
125 mDisplayName = "Built-in Screen";
126 break;
127 case DISPLAY_EXTERNAL:
128 mDisplayName = "HDMI Screen";
129 break;
130 default:
131 mDisplayName = "Virtual Screen"; // e.g. Overlay #n
132 break;
133 }
134
135 // initialize the display orientation transform.
136 setProjection(DisplayState::eOrientationDefault, mViewport, mFrame);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800137}
138
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700139DisplayDevice::~DisplayDevice() {
Mathias Agopian92a979a2012-08-02 18:32:23 -0700140 if (mSurface != EGL_NO_SURFACE) {
141 eglDestroySurface(mDisplay, mSurface);
142 mSurface = EGL_NO_SURFACE;
143 }
144}
145
Jesse Hall02d86562013-03-25 14:43:23 -0700146void DisplayDevice::disconnect(HWComposer& hwc) {
147 if (mHwcDisplayId >= 0) {
148 hwc.disconnectDisplay(mHwcDisplayId);
149 if (mHwcDisplayId >= DISPLAY_VIRTUAL)
150 hwc.freeDisplayId(mHwcDisplayId);
151 mHwcDisplayId = -1;
152 }
153}
154
Mathias Agopian92a979a2012-08-02 18:32:23 -0700155bool DisplayDevice::isValid() const {
156 return mFlinger != NULL;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800157}
158
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700159int DisplayDevice::getWidth() const {
Mathias Agopiana4912602012-07-12 14:25:33 -0700160 return mDisplayWidth;
161}
162
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700163int DisplayDevice::getHeight() const {
Mathias Agopiana4912602012-07-12 14:25:33 -0700164 return mDisplayHeight;
165}
166
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700167PixelFormat DisplayDevice::getFormat() const {
Mathias Agopiana4912602012-07-12 14:25:33 -0700168 return mFormat;
169}
170
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700171EGLSurface DisplayDevice::getEGLSurface() const {
Mathias Agopiana4912602012-07-12 14:25:33 -0700172 return mSurface;
173}
174
Mathias Agopian9e2463e2012-09-21 18:26:16 -0700175void DisplayDevice::setDisplayName(const String8& displayName) {
176 if (!displayName.isEmpty()) {
177 // never override the name with an empty name
178 mDisplayName = displayName;
179 }
180}
181
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700182uint32_t DisplayDevice::getPageFlipCount() const {
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700183 return mPageFlipCount;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800184}
185
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700186status_t DisplayDevice::compositionComplete() const {
Jesse Hall99c7dbb2013-03-14 14:29:29 -0700187 return mDisplaySurface->compositionComplete();
Mathias Agopian74faca22009-09-17 16:18:16 -0700188}
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800189
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700190void DisplayDevice::flip(const Region& dirty) const
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800191{
192 checkGLErrors();
193
194 EGLDisplay dpy = mDisplay;
195 EGLSurface surface = mSurface;
196
Jesse Hall01e29052013-02-19 16:13:35 -0800197#ifdef EGL_ANDROID_swap_rectangle
Mathias Agopiandf3ca302009-05-04 19:29:25 -0700198 if (mFlags & SWAP_RECTANGLE) {
Mathias Agopianb8a55602009-06-26 19:06:36 -0700199 const Region newDirty(dirty.intersect(bounds()));
200 const Rect b(newDirty.getBounds());
Mathias Agopiandf3ca302009-05-04 19:29:25 -0700201 eglSetSwapRectangleANDROID(dpy, surface,
202 b.left, b.top, b.width(), b.height());
Jesse Hall01e29052013-02-19 16:13:35 -0800203 }
Mathias Agopian5e78e092009-06-11 17:19:54 -0700204#endif
Mathias Agopiand8707032012-09-18 01:21:55 -0700205
Mathias Agopian076b1cc2009-04-10 14:24:30 -0700206 mPageFlipCount++;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800207}
208
Mathias Agopianda27af92012-09-13 18:17:13 -0700209void DisplayDevice::swapBuffers(HWComposer& hwc) const {
Jesse Hall99c7dbb2013-03-14 14:29:29 -0700210 // We need to call eglSwapBuffers() unless:
211 // (a) there was no GLES composition this frame, or
212 // (b) we're using a legacy HWC with no framebuffer target support (in
213 // which case HWComposer::commit() handles things).
214 if (hwc.initCheck() != NO_ERROR ||
215 (hwc.hasGlesComposition(mHwcDisplayId) &&
216 hwc.supportsFramebufferTarget())) {
217 EGLBoolean success = eglSwapBuffers(mDisplay, mSurface);
218 if (!success) {
219 EGLint error = eglGetError();
220 if (error == EGL_CONTEXT_LOST ||
221 mType == DisplayDevice::DISPLAY_PRIMARY) {
222 LOG_ALWAYS_FATAL("eglSwapBuffers(%p, %p) failed with 0x%08x",
223 mDisplay, mSurface, error);
224 } else {
225 ALOGE("eglSwapBuffers(%p, %p) failed with 0x%08x",
226 mDisplay, mSurface, error);
Mathias Agopianda27af92012-09-13 18:17:13 -0700227 }
228 }
229 }
Mathias Agopian52e21482012-09-24 18:07:21 -0700230
Jesse Hall99c7dbb2013-03-14 14:29:29 -0700231 status_t result = mDisplaySurface->advanceFrame();
232 if (result != NO_ERROR) {
233 ALOGE("[%s] failed pushing new frame to HWC: %d",
234 mDisplayName.string(), result);
Mathias Agopian32341382012-09-25 19:16:28 -0700235 }
Mathias Agopianda27af92012-09-13 18:17:13 -0700236}
237
238void DisplayDevice::onSwapBuffersCompleted(HWComposer& hwc) const {
239 if (hwc.initCheck() == NO_ERROR) {
Jesse Hall851cfe82013-03-20 13:44:00 -0700240 mDisplaySurface->onFrameCommitted();
Mathias Agopianda27af92012-09-13 18:17:13 -0700241 }
242}
243
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700244uint32_t DisplayDevice::getFlags() const
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800245{
246 return mFlags;
247}
248
Mathias Agopianda8d0a52012-09-04 15:05:38 -0700249EGLBoolean DisplayDevice::makeCurrent(EGLDisplay dpy,
250 const sp<const DisplayDevice>& hw, EGLContext ctx) {
251 EGLBoolean result = EGL_TRUE;
Mathias Agopian52bbb1a2012-07-31 19:01:53 -0700252 EGLSurface sur = eglGetCurrentSurface(EGL_DRAW);
Mathias Agopian42977342012-08-05 00:40:46 -0700253 if (sur != hw->mSurface) {
Mathias Agopianda8d0a52012-09-04 15:05:38 -0700254 result = eglMakeCurrent(dpy, hw->mSurface, hw->mSurface, ctx);
255 if (result == EGL_TRUE) {
Mathias Agopianbae92d02012-09-28 01:00:47 -0700256 setViewportAndProjection(hw);
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 Agopianbae92d02012-09-28 01:00:47 -0700262void DisplayDevice::setViewportAndProjection(const sp<const DisplayDevice>& hw) {
263 GLsizei w = hw->mDisplayWidth;
264 GLsizei h = hw->mDisplayHeight;
265 glViewport(0, 0, w, h);
266 glMatrixMode(GL_PROJECTION);
267 glLoadIdentity();
268 // put the origin in the left-bottom corner
269 glOrthof(0, w, 0, h, 0, 1); // l=0, r=w ; b=0, t=h
Mathias Agopian135e5892012-09-30 16:43:20 -0700270 glMatrixMode(GL_MODELVIEW);
Mathias Agopianbae92d02012-09-28 01:00:47 -0700271}
272
Mathias Agopian1b031492012-06-20 17:51:20 -0700273// ----------------------------------------------------------------------------
274
Mathias Agopian13127d82013-03-05 17:47:11 -0800275void DisplayDevice::setVisibleLayersSortedByZ(const Vector< sp<Layer> >& layers) {
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700276 mVisibleLayersSortedByZ = layers;
Mathias Agopianef7b9c72012-08-10 15:22:19 -0700277 mSecureLayerVisible = false;
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700278 size_t count = layers.size();
279 for (size_t i=0 ; i<count ; i++) {
Mathias Agopian13127d82013-03-05 17:47:11 -0800280 const sp<Layer>& layer(layers[i]);
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800281 if (layer->isSecure()) {
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700282 mSecureLayerVisible = true;
283 }
284 }
285}
286
Mathias Agopian13127d82013-03-05 17:47:11 -0800287const Vector< sp<Layer> >& DisplayDevice::getVisibleLayersSortedByZ() const {
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700288 return mVisibleLayersSortedByZ;
289}
290
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700291bool DisplayDevice::getSecureLayerVisible() const {
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700292 return mSecureLayerVisible;
293}
294
Mathias Agopiancd60f992012-08-16 16:28:27 -0700295Region DisplayDevice::getDirtyRegion(bool repaintEverything) const {
296 Region dirty;
Mathias Agopiancd60f992012-08-16 16:28:27 -0700297 if (repaintEverything) {
298 dirty.set(getBounds());
299 } else {
Mathias Agopianda8d0a52012-09-04 15:05:38 -0700300 const Transform& planeTransform(mGlobalTransform);
Mathias Agopiancd60f992012-08-16 16:28:27 -0700301 dirty = planeTransform.transform(this->dirtyRegion);
302 dirty.andSelf(getBounds());
303 }
304 return dirty;
305}
306
Mathias Agopian3b1d2b62012-07-11 13:48:17 -0700307// ----------------------------------------------------------------------------
308
Mathias Agopiand3ee2312012-08-02 14:01:42 -0700309bool DisplayDevice::canDraw() const {
310 return mScreenAcquired;
311}
312
313void DisplayDevice::releaseScreen() const {
314 mScreenAcquired = false;
315}
316
317void DisplayDevice::acquireScreen() const {
318 mScreenAcquired = true;
319}
320
321bool DisplayDevice::isScreenAcquired() const {
322 return mScreenAcquired;
323}
324
325// ----------------------------------------------------------------------------
326
Mathias Agopian28947d72012-08-08 18:51:15 -0700327void DisplayDevice::setLayerStack(uint32_t stack) {
328 mLayerStack = stack;
329 dirtyRegion.set(bounds());
330}
331
332// ----------------------------------------------------------------------------
333
Mathias Agopian0f2f5ff2012-07-31 23:09:07 -0700334status_t DisplayDevice::orientationToTransfrom(
Mathias Agopian1b031492012-06-20 17:51:20 -0700335 int orientation, int w, int h, Transform* tr)
336{
337 uint32_t flags = 0;
338 switch (orientation) {
Mathias Agopian3165cc22012-08-08 19:42:09 -0700339 case DisplayState::eOrientationDefault:
Mathias Agopian1b031492012-06-20 17:51:20 -0700340 flags = Transform::ROT_0;
341 break;
Mathias Agopian3165cc22012-08-08 19:42:09 -0700342 case DisplayState::eOrientation90:
Mathias Agopian1b031492012-06-20 17:51:20 -0700343 flags = Transform::ROT_90;
344 break;
Mathias Agopian3165cc22012-08-08 19:42:09 -0700345 case DisplayState::eOrientation180:
Mathias Agopian1b031492012-06-20 17:51:20 -0700346 flags = Transform::ROT_180;
347 break;
Mathias Agopian3165cc22012-08-08 19:42:09 -0700348 case DisplayState::eOrientation270:
Mathias Agopian1b031492012-06-20 17:51:20 -0700349 flags = Transform::ROT_270;
350 break;
351 default:
352 return BAD_VALUE;
353 }
354 tr->set(flags, w, h);
355 return NO_ERROR;
356}
357
Mathias Agopian00e8c7a2012-09-04 19:30:46 -0700358void DisplayDevice::setProjection(int orientation,
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800359 const Rect& newViewport, const Rect& newFrame) {
360 Rect viewport(newViewport);
361 Rect frame(newFrame);
362
363 const int w = mDisplayWidth;
364 const int h = mDisplayHeight;
365
366 Transform R;
367 DisplayDevice::orientationToTransfrom(orientation, w, h, &R);
368
369 if (!frame.isValid()) {
370 // the destination frame can be invalid if it has never been set,
371 // in that case we assume the whole display frame.
372 frame = Rect(w, h);
373 }
374
375 if (viewport.isEmpty()) {
376 // viewport can be invalid if it has never been set, in that case
377 // we assume the whole display size.
378 // it's also invalid to have an empty viewport, so we handle that
379 // case in the same way.
380 viewport = Rect(w, h);
381 if (R.getOrientation() & Transform::ROT_90) {
382 // viewport is always specified in the logical orientation
383 // of the display (ie: post-rotation).
384 swap(viewport.right, viewport.bottom);
385 }
386 }
387
388 dirtyRegion.set(getBounds());
389
390 Transform TL, TP, S;
391 float src_width = viewport.width();
392 float src_height = viewport.height();
393 float dst_width = frame.width();
394 float dst_height = frame.height();
395 if (src_width != dst_width || src_height != dst_height) {
396 float sx = dst_width / src_width;
397 float sy = dst_height / src_height;
398 S.set(sx, 0, 0, sy);
399 }
400
401 float src_x = viewport.left;
402 float src_y = viewport.top;
403 float dst_x = frame.left;
404 float dst_y = frame.top;
405 TL.set(-src_x, -src_y);
406 TP.set(dst_x, dst_y);
407
408 // The viewport and frame are both in the logical orientation.
409 // Apply the logical translation, scale to physical size, apply the
410 // physical translation and finally rotate to the physical orientation.
411 mGlobalTransform = R * TP * S * TL;
412
413 const uint8_t type = mGlobalTransform.getType();
414 mNeedsFiltering = (!mGlobalTransform.preserveRects() ||
415 (type >= Transform::SCALE));
416
417 mScissor = mGlobalTransform.transform(viewport);
418 if (mScissor.isEmpty()) {
Mathias Agopian6c7f25a2013-05-09 20:37:10 -0700419 mScissor = getBounds();
Mathias Agopianf5f714a2013-02-26 16:54:05 -0800420 }
421
Mathias Agopianda8d0a52012-09-04 15:05:38 -0700422 mOrientation = orientation;
Mathias Agopian00e8c7a2012-09-04 19:30:46 -0700423 mViewport = viewport;
424 mFrame = frame;
Mathias Agopian1b031492012-06-20 17:51:20 -0700425}
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700426
Mathias Agopian74d211a2013-04-22 16:55:35 +0200427void DisplayDevice::dump(String8& result) const {
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700428 const Transform& tr(mGlobalTransform);
Mathias Agopian74d211a2013-04-22 16:55:35 +0200429 result.appendFormat(
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700430 "+ DisplayDevice: %s\n"
Jesse Hall02d86562013-03-25 14:43:23 -0700431 " type=%x, hwcId=%d, layerStack=%u, (%4dx%4d), ANativeWindow=%p, orient=%2d (type=%08x), "
Jamie Gennisdd3cb842012-10-19 18:19:11 -0700432 "flips=%u, isSecure=%d, secureVis=%d, acquired=%d, numLayers=%u\n"
Mathias Agopian766dc492012-10-30 18:08:06 -0700433 " v:[%d,%d,%d,%d], f:[%d,%d,%d,%d], s:[%d,%d,%d,%d],"
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700434 "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 -0700435 mDisplayName.string(), mType, mHwcDisplayId,
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700436 mLayerStack, mDisplayWidth, mDisplayHeight, mNativeWindow.get(),
437 mOrientation, tr.getType(), getPageFlipCount(),
Jamie Gennisdd3cb842012-10-19 18:19:11 -0700438 mIsSecure, mSecureLayerVisible, mScreenAcquired, mVisibleLayersSortedByZ.size(),
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700439 mViewport.left, mViewport.top, mViewport.right, mViewport.bottom,
440 mFrame.left, mFrame.top, mFrame.right, mFrame.bottom,
Mathias Agopian766dc492012-10-30 18:08:06 -0700441 mScissor.left, mScissor.top, mScissor.right, mScissor.bottom,
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700442 tr[0][0], tr[1][0], tr[2][0],
443 tr[0][1], tr[1][1], tr[2][1],
444 tr[0][2], tr[1][2], tr[2][2]);
445
Jesse Hall99c7dbb2013-03-14 14:29:29 -0700446 String8 surfaceDump;
447 mDisplaySurface->dump(surfaceDump);
448 result.append(surfaceDump);
Mathias Agopian1d12d8a2012-09-18 01:38:00 -0700449}