Commit Graph

1232 Commits

Author SHA1 Message Date
Greg Hackmann 6f57b269f9 am 56f8c6c4: Merge "Error compiling waitforvsync.cpp"
* commit '56f8c6c42dab4c3636edb62162088e5d765fa956':
  Error compiling waitforvsync.cpp
2015-02-26 01:07:03 +00:00
Greg Hackmann 56f8c6c42d Merge "Error compiling waitforvsync.cpp" 2015-02-25 23:42:17 +00:00
Mark Salyzyn 129da2ba07 am 453c6a78: am a455ec21: am d80268ba: Merge "vsync.cpp test is throwing error whe compiled"
* commit '453c6a781de3dc728212d66f1ca7fda2ae984974':
  vsync.cpp test is throwing error whe compiled
2015-02-23 15:30:22 +00:00
Mark Salyzyn a455ec21fa am d80268ba: Merge "vsync.cpp test is throwing error whe compiled"
* commit 'd80268ba19f9217c5459a2952580090ef84a7b78':
  vsync.cpp test is throwing error whe compiled
2015-02-23 15:19:59 +00:00
Nanik Tolaram 5b06dc00ac vsync.cpp test is throwing error whe compiled
frameworks/native/services/surfaceflinger/tests/vsync/vsync.cpp:55:44: error: 'ALOOPER_EVENT_INPUT' was not declared in this scope
     loop->addFd(myDisplayEvent.getFd(), 0, ALOOPER_EVENT_INPUT, receiver,
                                            ^
frameworks/native/services/surfaceflinger/tests/vsync/vsync.cpp:64:18: error: 'ALOOPER_POLL_WAKE' was not declared in this scope
             case ALOOPER_POLL_WAKE:
                  ^
frameworks/native/services/surfaceflinger/tests/vsync/vsync.cpp:67:18: error: 'ALOOPER_POLL_CALLBACK' was not declared in this scope
             case ALOOPER_POLL_CALLBACK:
                  ^
frameworks/native/services/surfaceflinger/tests/vsync/vsync.cpp:70:18: error: 'ALOOPER_POLL_TIMEOUT' was not declared in this scope
             case ALOOPER_POLL_TIMEOUT:
                  ^
frameworks/native/services/surfaceflinger/tests/vsync/vsync.cpp:73:18: error: 'ALOOPER_POLL_ERROR' was not declared in this scope
             case ALOOPER_POLL_ERROR:
                  ^

it is missing one header file

Change-Id: Ie2fb02523a866b13a99edf837f072d101cacb466
Signed-off-by: Nanik Tolaram <nanikjava@gmail.com>
2015-02-23 15:13:56 +00:00
Nanik Tolaram ee9701744a Error compiling waitforvsync.cpp
The waitforvsync.cpp throws error when compiling. Following is the error log

target thumb C++: test-waitforvsync <= frameworks/native/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp
frameworks/native/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp: In function 'int main(int, char**)':
frameworks/native/services/surfaceflinger/tests/waitforvsync/waitforvsync.cpp:43:17: error: 'close' was not declared in this scope
         close(fd);
                 ^
....
....

make: *** [out/target/product/grouper/obj/EXECUTABLES/test-waitforvsync_intermediates/waitforvsync.o] Error 1

the file is missing #include <unistd.h>

Change-Id: I57728dbde65641cd3138625f9a590f9db8648158
Signed-off-by: Nanik Tolaram <nanikjava@gmail.com>
2015-02-14 00:26:59 +11:00
Dan Stoza 3890c83721 am 40b4e23a: Merge "resolved conflicts for merge of 1665c8e1 to lmp-mr1-dev-plus-aosp" into lmp-mr1-dev-plus-aosp
* commit '40b4e23a0396614c841977e932218e3f53089a4a':
  Revert "SurfaceFlinger: Attempt to attribute fds to layers"
2015-01-27 23:42:56 +00:00
Yabin Cui 3d6c569140 am 39d890d9: am 6e32c037: Merge "Kill HAVE_PTHREADS."
* commit '39d890d9aed5cb07b8a166a749299b9d24d8f137':
  Kill HAVE_PTHREADS.
2015-01-27 23:42:55 +00:00
Dan Stoza 40b4e23a03 Merge "resolved conflicts for merge of 1665c8e1 to lmp-mr1-dev-plus-aosp" into lmp-mr1-dev-plus-aosp 2015-01-27 20:06:34 +00:00
Yabin Cui 39d890d9ae am 6e32c037: Merge "Kill HAVE_PTHREADS."
* commit '6e32c0377db89bafa477715b3a02431d651978cf':
  Kill HAVE_PTHREADS.
2015-01-27 19:56:06 +00:00
Dan Stoza 22d0bdf326 resolved conflicts for merge of 1665c8e1 to lmp-mr1-dev-plus-aosp
Change-Id: I0be2ecb8085f2cd9560138460bcc27d71c011608
2015-01-27 11:49:26 -08:00
Dan Stoza 1665c8e101 Revert "SurfaceFlinger: Attempt to attribute fds to layers"
This reverts commit 03eccb6616.

Change-Id: I4f0da7bb62bf77bb3d399aee601beae5e03928fe
2015-01-27 11:03:50 -08:00
Yabin Cui 8fb2d25ff3 Kill HAVE_PTHREADS.
Bug: 19083585
Change-Id: I355491de945590f43c82bdcb7968b01b4bff6e06
2015-01-26 22:36:36 -08:00
Dan Stoza b62767e855 am a5cbb1f1: am ef1c17ae: SurfaceFlinger: Make log message 64-bit compatible
* commit 'a5cbb1f18b6eb4e0db27d98bea0731393b7438d1':
  SurfaceFlinger: Make log message 64-bit compatible
2015-01-17 00:53:36 +00:00
Dan Stoza 3c7eb4fe23 am 3372cc25: resolved conflicts for merge of 03eccb66 to lmp-mr1-dev-plus-aosp
* commit '3372cc25df255b94e4eb75920afaf43ee5edc39f':
  SurfaceFlinger: Attempt to attribute fds to layers
2015-01-17 00:53:35 +00:00
Dan Stoza a5cbb1f18b am ef1c17ae: SurfaceFlinger: Make log message 64-bit compatible
* commit 'ef1c17ae9417abc1e21e49dbc629e448efc947dc':
  SurfaceFlinger: Make log message 64-bit compatible
2015-01-17 00:50:53 +00:00
Dan Stoza 3372cc25df resolved conflicts for merge of 03eccb66 to lmp-mr1-dev-plus-aosp
Change-Id: I1f38cbe7019b2b48b1094dee154ad97c23fd22c2
2015-01-16 16:18:51 -08:00
Dan Stoza ef1c17ae94 SurfaceFlinger: Make log message 64-bit compatible
Fixes the build on 64-bit targets that complain about using a size_t
with a %d in a format string

Change-Id: I7dfcd3a49eb0dbc5dffeb82bb7208de7f7925f08
2015-01-16 15:58:13 -08:00
Dan Stoza 03eccb6616 SurfaceFlinger: Attempt to attribute fds to layers
This tracks fds when layers are created and destroyed in an effort to
determine which specific app (if any) is active when fds are leaked

Bug: 19017008
Change-Id: I1f1d5a9cbc1399e3df3a2d350324f80b3a4e3477
2015-01-16 15:02:22 -08:00
Jesse Hall 8eb8069a2d am 9c22ac77: am 5b730570: Merge "surfaceflinger: use Mutex timedLock instead of tryLock loop"
* commit '9c22ac77e41b8bbddbb64959acabce3f3a07345d':
  surfaceflinger: use Mutex timedLock instead of tryLock loop
2015-01-13 20:32:28 +00:00
Jesse Hall 9c22ac77e4 am 5b730570: Merge "surfaceflinger: use Mutex timedLock instead of tryLock loop"
* commit '5b730570be2bd1f90346a5921d0b70dc11351396':
  surfaceflinger: use Mutex timedLock instead of tryLock loop
2015-01-12 23:41:46 +00:00
Jesse Hall fcd15b478c surfaceflinger: use Mutex timedLock instead of tryLock loop
Rather than trying to acquire the state lock without waiting three
times at 1 second intervals in SurfaceFlinger::dump(), just try to
acquire the lock once with a 1 second timeout. Avoids spurious mutex
acquire failures that lead to flaky
com.android.cts.jank.opengl.CtsHostJankOpenGl results.

Bug: 18842510
Change-Id: I00ce6109647de2aef8831dd2f8fa98652ba7f4e0
2015-01-10 15:41:01 -08:00
Dmitriy Ivanov e9b6f1f7bb Switch to libsigchain.a
Use LOCAL_WHOLE_STATIC_LIBRARIES to instruct static linker
  to export symbols from the static library.

(cherry picked from commit 4340a14fbf)

Bug: 18701723
Change-Id: I70f6fdb64b0d1adbadf96c8de85870a903ec186a
2014-12-10 10:28:50 -08:00
Dan Stoza dd883c0b08 libgui: Enable -Weverything and -Werror
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.

This is a squashed commit based on an initial change with a couple of
fixes to avoid breaking certain targets. The source commits are:
  d723bd7669
  00d504c06e
  429ba89cd2

Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
2014-12-05 14:59:29 -08:00
Dan Stoza d723bd7669 libgui: Enable -Weverything and -Werror
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.

Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
2014-12-05 11:06:44 -08:00
Dan Albert 7530114619 am 5588d900: Merge "Enable clang for libui/libgui/surfaceflinger"
* commit '5588d9000cd1ef217185c9001d6b5ecd84db9741':
  Enable clang for libui/libgui/surfaceflinger
2014-12-05 18:01:48 +00:00
Dan Stoza 01049c8321 Enable clang for libui/libgui/surfaceflinger
Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.

Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
(cherry picked from commit f10c46ef85)
2014-12-04 17:56:17 -08:00
Dan Stoza d6739d5e44 am db5827d3: am 5878444f: SurfaceFlinger: Listen to HWC invalidate
* commit 'db5827d314ddca3d473947b4ef49e811fad70069':
  SurfaceFlinger: Listen to HWC invalidate
2014-12-04 16:15:54 +00:00
Dan Stoza db5827d314 am 5878444f: SurfaceFlinger: Listen to HWC invalidate
* commit '5878444fb8da043021f30d3de739531f15390df5':
  SurfaceFlinger: Listen to HWC invalidate
2014-12-03 20:43:29 +00:00
Dan Stoza 5878444fb8 SurfaceFlinger: Listen to HWC invalidate
"Do less work when using PTS" broke the invalidate path up from HWC
to SurfaceFlinger. When HWC would signal an invalidate, SurfaceFinger
would wake up, see no new buffers, and go back to sleep. This is fine,
except when the invalidate is a result of an HDMI hotplug, in which
case the screen remains blank. This change makes that functionality
work again.

Bug: 18564815
Bug: 18558468
Change-Id: I2e2171d86839945f4e4e6555d66f7e2895bd096a
2014-12-02 16:58:17 -08:00
Michael Lentine 347a2acf7e am 1e611662: am b947f29a: Merge "Add clamp to Layer and update Transform inverse." into lmp-mr1-dev
* commit '1e6116621bc2f7aedfd52a5f1327b530328435b0':
  Add clamp to Layer and update Transform inverse.
2014-11-25 18:56:41 +00:00
Michael Lentine 1e6116621b am b947f29a: Merge "Add clamp to Layer and update Transform inverse." into lmp-mr1-dev
* commit 'b947f29a6af1622cda16d0b7112595082750dd07':
  Add clamp to Layer and update Transform inverse.
2014-11-25 18:44:51 +00:00
Michael Lentine 28ea217ff4 Add clamp to Layer and update Transform inverse.
Ensure that the adjusted transparent region is within
the display bounds by clamping after the transformation
is applied and clean up transform's inverse function.

Bug: 18452546

Change-Id: Ia473e483ee8374177bcb84d8192eb1f0e86f022a
2014-11-21 17:05:18 -08:00
Dan Albert c1ced8bbcd am c894c204: Merge "C++11 compatibility."
* commit 'c894c2045f589571c80af0648e7a9dcd7e97b6a8':
  C++11 compatibility.
2014-11-20 23:00:48 +00:00
Dan Albert 3bdc5b8268 C++11 compatibility.
* Explicit conversion for atomic_uintptr_t initialization.
 * Fix string literal concatenation to not be a UD literal.
 * Use __typeof__ instead of typeof (should become decltype once this
   actually moves to C++11).

Bug: 18466763
Change-Id: I4eedddfb945a2a703ed27317cb6e2b3041b1ebfc
2014-11-20 21:04:35 +00:00
Dan Stoza e8e23c8b79 am 686c5be4: am 6b9454d1: SurfaceFlinger: Do less work when using PTS
* commit '686c5be4722dce02ae8e5580d6677f1eeea22464':
  SurfaceFlinger: Do less work when using PTS
2014-11-18 20:18:27 +00:00
Dan Stoza 686c5be472 am 6b9454d1: SurfaceFlinger: Do less work when using PTS
* commit '6b9454d1fee0347711af1746642aa7820b1ea04d':
  SurfaceFlinger: Do less work when using PTS
2014-11-18 02:07:36 +00:00
Dan Stoza 6b9454d1fe SurfaceFlinger: Do less work when using PTS
Currently, SurfaceFlinger is very dumb about how it handles buffer
updates at less than 60fps. If there is a new frame pending, but its
timestamp says not to present it until later SurfaceFlinger will wake
up every vsync until it is time to present it. Even worse, if
SurfaceFlinger has woken up but nothing has changed, it still goes
through the entire composition process.

This change (mostly) fixes that inefficiency. SurfaceFlinger will
still wake up every refresh period while there is a new frame
pending, but if there is no work to do, it will almost immediately go
back to sleep.

Bug: 18111837
Change-Id: I7825bacd37f40bf26edcc6a5e0f051dce45291fb
2014-11-17 21:32:13 +00:00
Marco Nelissen e12cfc23b2 am 55f71bc0: Merge "Replace IInterface::asBinder() with a static"
* commit '55f71bc0800b9ec7a779c5d30d5a90e074c2526b':
  Replace IInterface::asBinder() with a static
2014-11-17 18:52:56 +00:00
Marco Nelissen 097ca275f4 Replace IInterface::asBinder() with a static
so we can do NULL checks again, and update calls to IInterface::asBinder()
to use the new static version.

Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
2014-11-17 08:47:01 -08:00
Marco Nelissen 2ea926bda2 Replace IInterface::asBinder() with a static
so we can do NULL checks again, and update calls to IInterface::asBinder()
to use the new static version.

Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
2014-11-14 14:01:29 -08:00
Dan Albert 41a0ef3e28 resolved conflicts for merge of 4037c458 to master
Change-Id: I8a2e73b7ba48b790054e0ab99f81b2693244389e
2014-11-14 11:13:20 -08:00
Andreas Gampe 4037c458a7 resolved conflicts for merge of 07dffa18 to lmp-mr1-dev-plus-aosp
Change-Id: I42d8bc291f4f48f3098754b076889159c4b20e41
2014-11-13 15:16:53 -08:00
Andreas Gampe 89fd4f7fa6 Frameworks/native: Wall Werror in surfaceflinger
Turn on -Wall -Werror in services/surfaceflinger. Fix warnings.

Change-Id: Ifef830300d9d4bc657d8f1257c02bfe8c2b4d9c5
2014-11-13 14:18:56 -08:00
Dan Stoza f10c46ef85 Enable clang for libui/libgui/surfaceflinger
Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.

Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
2014-11-11 14:28:22 -08:00
Dan Stoza 8e624d4cad am 98d20f82: Merge "Add a BufferItem parameter to onFrameAvailable" into lmp-mr1-dev
* commit '98d20f82ca8979b30c81df9639f54ab11e1951f9':
  Add a BufferItem parameter to onFrameAvailable
2014-11-07 20:03:42 +00:00
Dan Stoza 98d20f82ca Merge "Add a BufferItem parameter to onFrameAvailable" into lmp-mr1-dev 2014-11-07 19:44:31 +00:00
Dan Stoza 8dc55396fc Add a BufferItem parameter to onFrameAvailable
Passes the BufferItem for the queued buffer to the onFrameAvailable
callback so the consumer can track the BufferQueue's contents. Also
adds an onFrameReplaced callback, which is necessary if the consumer
wants to do anything more than simple queue length tracking.

Bug: 18111837
Change-Id: If9d07229c9b586c668e5f99074e9b63b0468feb0
2014-11-07 10:39:13 -08:00
Naseer Ahmed ff520bb938 am 7aa0c47e: sf: Add a NULL check in getDisplayConfigs
* commit '7aa0c47e4205c6fca136c38f272d911c25c8a8fa':
  sf: Add a NULL check in getDisplayConfigs
2014-11-03 22:31:50 +00:00
Naseer Ahmed 7aa0c47e42 sf: Add a NULL check in getDisplayConfigs
Validate the display binder by adding a NULL check in getDisplayConfigs.
This will prevent a false match if the caller queries the display
configs for an inactive display (whose binder is NULL by default).

Without this change we might end up attempting to index the display
config array, which is unpopulated for inactive displays, and this will
result in a crash. (See getDisplayInfo in SurfaceComposerClient.cpp for
an example of this scenario)

Change-Id: I1a12f43b7c375b9c01998dadd5b658275c733fb2
Acked-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2014-11-03 12:16:18 -08:00
Jesse Hall b43a1c9be2 am affc4d80: Merge "surfaceflinger: fix -Wunused-parameter warning" into lmp-mr1-dev
* commit 'affc4d809edbcb3b0e49e5ccc9821b9695a57d44':
  surfaceflinger: fix -Wunused-parameter warning
2014-10-31 22:57:44 +00:00
Jesse Hall 18b846dda7 am c7636f60: Merge "surfaceflinger: fix -Wsign-compare warnings" into lmp-mr1-dev
* commit 'c7636f606270a4b79d745ec1acf049daedfa0e2f':
  surfaceflinger: fix -Wsign-compare warnings
2014-10-31 22:57:43 +00:00
Jesse Hall 9fc06c5e21 am 6e74e3cc: Merge "surfaceflinger: fix -Woverloaded-virtual warning" into lmp-mr1-dev
* commit '6e74e3ccd972fe90d9998f6b683e25dca38f470d':
  surfaceflinger: fix -Woverloaded-virtual warning
2014-10-31 22:57:42 +00:00
Jesse Hall 7cd85979e8 surfaceflinger: fix -Wunused-parameter warning
warning: unused parameter 'mustRecompose' [-Wunused-parameter]

Change-Id: I6b8c671189639d851bfa5548742de988d6fa2687
(cherry picked from d2e514f717)
2014-10-31 09:52:42 -07:00
Jesse Hall 7844211607 surfaceflinger: fix -Wsign-compare warnings
warning: comparison of integers of different signs: 'int' and 'size_t'
(aka 'unsigned int') [-Wsign-compare]

arning: comparison of integers of different signs: 'int32_t' (aka
'int') and 'const uint32_t' (aka 'const unsigned int')
[-Wsign-compare]

Change-Id: I823257aa7218c5fd492a3277853210db539bb2e2
(cherry picked from f9bfdc6c94)
2014-10-31 09:52:23 -07:00
Jesse Hall 9b901805ed surfaceflinger: fix -Woverloaded-virtual warning
warning: 'android::LayerDim::isOpaque' hides overloaded virtual function
[-Woverloaded-virtual]

Change-Id: Ie27a6c943f485bc89ce11e424a4e7d99805d4dd0
(cherry picked from commit 382574d116)
2014-10-31 09:52:08 -07:00
Jesse Hall 1495ceb885 surfaceflinger: fix -Wmismatched-tags warnings
warning: struct 'HWComposer' was previously declared as a class
[-Wmismatched-tags]

warning: class 'DisplayInfo' was previously declared as a struct
[-Wmismatched-tags]

Change-Id: I13db9f8aab3a957ce8ff8d64598dae1807d6fe7e
(cherry picked from commit 646f541050)
2014-10-31 09:51:10 -07:00
Dan Stoza d77021637e am 1f3efb11: Don\'t run large virtual displays through HWC
* commit '1f3efb11ff8c884a254f4272f0d1ee0b77ceff2f':
  Don't run large virtual displays through HWC
2014-10-30 20:58:42 +00:00
Dan Stoza 1f3efb11ff Don't run large virtual displays through HWC
This change watches for a MAX_VIRTUAL_DISPLAY_DIMENSION value, which
will be set (if necessary) in BoardConfig.mk. If the value is set,
any virtual displays that have a width or a height greater than that
dimension will bypass the hardware composer HAL and be handled only
by SurfaceFlinger.

Bug: 17701816
Change-Id: Ia6ca44dfd6a7a9bc0f054493d3f13006bc32fa14
2014-10-28 16:01:47 -07:00
Riley Andrews 0b91d7e277 am 131866e1: Merge "Add glFlush in surfaceflinger screenshot code." into lmp-mr1-dev
* commit '131866e1a4cb3c592f923e95a8c1a66291e2057a':
  Add glFlush in surfaceflinger screenshot code.
2014-10-24 18:39:16 +00:00
Riley Andrews 131866e1a4 Merge "Add glFlush in surfaceflinger screenshot code." into lmp-mr1-dev 2014-10-24 18:30:07 +00:00
Riley Andrews 9707f4df64 Add glFlush in surfaceflinger screenshot code.
After creating a syncKHR object with type EGL_SYNC_NATIVE_FENCE_ANDROID,
glFlush must be called before the EGL_SYNC_NATIVE_FENCE_FD_ANDROID attribute
is populated with a sync fd. We currently call eglDupNativeFenceFDANDROID
before issuing the flush.

Bug 18052459
Taken verbatim from matthew.k.gumbel@intel.com.

Change-Id: I3781d14f92862076e2bca7d27341a6dc6e7e3775
2014-10-23 16:25:17 -07:00
Jesse Hall 11f2e08a66 am 8ad8c0a7: am afe2b1fa: surfaceflinger: don\'t close fence fds after passing to queueBuffer
* commit '8ad8c0a775a1d4592479731973238b82480f76b2':
  surfaceflinger: don't close fence fds after passing to queueBuffer
2014-10-22 21:27:11 +00:00
Jesse Hall 8ad8c0a775 am afe2b1fa: surfaceflinger: don\'t close fence fds after passing to queueBuffer
* commit 'afe2b1fadd29149ceed639357e44e06e97c3a5ca':
  surfaceflinger: don't close fence fds after passing to queueBuffer
2014-10-22 20:45:35 +00:00
Jesse Hall afe2b1fadd surfaceflinger: don't close fence fds after passing to queueBuffer
ANativeWindow::queueBuffer takes ownership of the fence fd passed to
it, and will close it before returning. SurfaceFlinger's screenshot
code was also closing the syncFd it passed to queueBuffer. Most of the
time this meant the second close() silently failed, but in a rare race
condition the file descriptor could be reused between the two
close()s.

Bug: 17946343
Change-Id: Ib74fcb1dce52cc21328059c99b7c4c76f41aa3a5
2014-10-21 11:11:53 -07:00
Dmitriy Ivanov 8b81ce563f am cb8a9fcc: Merge "Switch to libsigchain.a"
* commit 'cb8a9fcc56288378d05d80c55396db7981e3828d':
  Switch to libsigchain.a
2014-10-21 03:30:55 +00:00
Dmitriy Ivanov 5cf92d4a85 am cb8a9fcc: Merge "Switch to libsigchain.a"
* commit 'cb8a9fcc56288378d05d80c55396db7981e3828d':
  Switch to libsigchain.a
2014-10-21 03:30:18 +00:00
Dmitriy Ivanov 4340a14fbf Switch to libsigchain.a
Use LOCAL_WHOLE_STATIC_LIBRARIES to instruct static linker
  to export symbols from the static library.

Change-Id: I0e41cf173be96c52cdad72b1ef4a1bf819e65dd2
2014-10-20 14:17:26 -07:00
Dmitriy Ivanov 2b1f2dac93 Link sigchain to surfaceflinger main executable
And export necessary symbols to preempt calls from libart.so

Bug: 15345057
Bug: 15426766

(cherry picked from commit f3da24d8cf)

Change-Id: I03b632e0bf2cbaf4a0e68cd0af4e991f7f6b08e4
2014-10-16 11:43:19 -07:00
Dan Albert 27b780b517 am 9cc84950: Merge "Don\'t check if this == NULL."
* commit '9cc849500df0bba42d3ed19b90c38ff1dffd2262':
  Don't check if this == NULL.
2014-10-15 22:52:51 +00:00
Dan Albert 759115cd6d am 9cc84950: Merge "Don\'t check if this == NULL."
* commit '9cc849500df0bba42d3ed19b90c38ff1dffd2262':
  Don't check if this == NULL.
2014-10-15 22:52:43 +00:00
Dan Albert 9cc849500d Merge "Don't check if this == NULL." 2014-10-15 22:45:07 +00:00
Dmitriy Ivanov 9b9d1a4ee5 am 26a28149: Merge "Link sigchain to surfaceflinger main executable"
* commit '26a2814963de75f14dfbe7cf3d45e993727891cf':
  Link sigchain to surfaceflinger main executable
2014-10-14 18:21:44 +00:00
Dmitriy Ivanov 88e5118f07 am 26a28149: Merge "Link sigchain to surfaceflinger main executable"
* commit '26a2814963de75f14dfbe7cf3d45e993727891cf':
  Link sigchain to surfaceflinger main executable
2014-10-14 18:21:24 +00:00
Dmitriy Ivanov f3da24d8cf Link sigchain to surfaceflinger main executable
And export necessary symbols to preempt calls from libart.so

Bug: 15345057
Bug: 15426766
Change-Id: If0b7f59a59824e30aa0c33dad76c7a44932180de
2014-10-09 15:20:25 -07:00
Michael Lentine fb992b7753 am 6c925ede: Fixed discrepancy between crop and frame transparencies.
* commit '6c925ede620f4080227bb1fe8a41e4b4502348f8':
  Fixed discrepancy between crop and frame transparencies.
2014-10-03 21:03:11 +00:00
Michael Lentine 6c925ede62 Fixed discrepancy between crop and frame transparencies.
Bug: 17662777
Change-Id: I0d65d9b912a37a60e4c1d2e2e198f7709460917c
2014-10-03 19:02:30 +00:00
Riley Andrews 8dcdf7961b am 6747be9f: Generate the SurfaceFlinger shader cache on initialization
* commit '6747be9fab9981ec24729cede5e0fe779e8b8914':
  Generate the SurfaceFlinger shader cache on initialization
2014-10-03 17:26:52 +00:00
Riley Andrews 6747be9fab Generate the SurfaceFlinger shader cache on initialization
Blobcache is not yet enabled for surfaceflinger (as it should be).
As a temporary workaround, generate all needed shaders during
surfaceflinger initialization instead of doing the compilation
on-demand during ui transitions.

Change-Id: I14455b20a3f85f177d85c9c8b76d8ccc35379b39
2014-10-03 17:21:15 +00:00
Riley Andrews 36a4d17104 am 6c833986: Merge "Generate the SurfaceFlinger shader cache on initialization" into lmp-mr1-dev
* commit '6c8339867438c27e468a03995b98481e9e49b274':
  Generate the SurfaceFlinger shader cache on initialization
2014-10-02 20:26:21 +00:00
Michael Lentine 6bddbeaeb0 am db57cfbd: Merge "When eglMakeCurrent fails we need to fix the egl state." into lmp-dev
* commit 'db57cfbd6f9d5795846ef237fd297cb81e429679':
  When eglMakeCurrent fails we need to fix the egl state.
2014-10-02 12:41:27 +00:00
Jesse Hall c868c78b51 am 5bf786d8: surfaceflinger: recompute visibility after sideband stream change
* commit '5bf786d8f00ff8eee64ebf330dac55e33a0f97b1':
  surfaceflinger: recompute visibility after sideband stream change
2014-10-02 12:40:05 +00:00
Riley Andrews a51fafc4d8 Generate the SurfaceFlinger shader cache on initialization
Blobcache is not yet enabled for surfaceflinger (as it should be).
As a temporary workaround, generate all needed shaders during
surfaceflinger initialization instead of doing the compilation
on-demand during ui transitions.

Change-Id: I14455b20a3f85f177d85c9c8b76d8ccc35379b39
2014-10-02 01:30:28 +00:00
Jesse Hall 17290d483b am bacc28ef: surfaceflinger: Use landscape resolution for default dpi
* commit 'bacc28ef1df329f4dc21bae44b09a6c5018af908':
  surfaceflinger: Use landscape resolution for default dpi
2014-10-02 00:57:47 +00:00
Michael Lentine 20daf003aa am db57cfbd: Merge "When eglMakeCurrent fails we need to fix the egl state." into lmp-dev
* commit 'db57cfbd6f9d5795846ef237fd297cb81e429679':
  When eglMakeCurrent fails we need to fix the egl state.
2014-10-01 22:50:32 +00:00
Michael Lentine db57cfbd6f Merge "When eglMakeCurrent fails we need to fix the egl state." into lmp-dev 2014-10-01 22:44:46 +00:00
Jesse Hall e245cdcc00 am 5bf786d8: surfaceflinger: recompute visibility after sideband stream change
* commit '5bf786d8f00ff8eee64ebf330dac55e33a0f97b1':
  surfaceflinger: recompute visibility after sideband stream change
2014-10-01 22:38:18 +00:00
Michael Lentine 3f121fc650 When eglMakeCurrent fails we need to fix the egl state.
Bug: 16676660

Change-Id: Ie7bee9c78378b9e9206060444319e6ee35e1ab74
2014-10-01 14:50:58 -07:00
Jesse Hall 5bf786d8f0 surfaceflinger: recompute visibility after sideband stream change
We normally recompute layer visibility when a layer gets its first
buffer; before then it's treated as invisible. Sideband layers never
get a buffer (as far as SurfaceFlinger knows), so never became
visible. Now we also recompute visibility when a layer gets a new
sideband stream.

Bug: 17752511
Change-Id: I84e150f196eb2eb7bcd2616248e5e3fa73624809
2014-10-01 09:00:34 -07:00
Jesse Hall 2a8ae4ef70 am bacc28ef: surfaceflinger: Use landscape resolution for default dpi
* commit 'bacc28ef1df329f4dc21bae44b09a6c5018af908':
  surfaceflinger: Use landscape resolution for default dpi
2014-09-29 00:56:04 +00:00
Jesse Hall bacc28ef1d surfaceflinger: Use landscape resolution for default dpi
When HWC doesn't provide DPI values for a display, we pick a default
DPI based on resolution. The intent was that 1080p and higher displays
would get XHIGH density, and lower resolutions would get TV density.
In KK (and possibly forever) we had a bug that we'd always use TV
density. That was fixed in L, but that fix exposed a pre-existing bug
that we always used the display's height in its native orientation,
rather than in landscape orientation. So an 800x1280 tablet like N7v1
started getting XHIGH density instead of the intended TV density.

Bug: 17461633
Change-Id: Ia57fa49e61f36bdda63ce283ef62c9953297222c
2014-09-28 22:26:28 +00:00
Jesse Hall 53e6b95d05 am 728a8da1: Merge "surfaceflinger: Check sideband stream changed to trigger sideband Layer update." into lmp-dev
* commit '728a8da14638e718ede11a7a894705524fc9d171':
  surfaceflinger: Check sideband stream changed to trigger sideband Layer update.
2014-09-26 05:10:07 +00:00
Jesse Hall 1b5c8839f7 am 728a8da1: Merge "surfaceflinger: Check sideband stream changed to trigger sideband Layer update." into lmp-dev
* commit '728a8da14638e718ede11a7a894705524fc9d171':
  surfaceflinger: Check sideband stream changed to trigger sideband Layer update.
2014-09-26 01:47:00 +00:00
chenhg 0ea1cb9195 surfaceflinger: Check sideband stream changed to trigger sideband Layer update.
BUG: 17382907
Change-Id: I65fd037bd25238ae68a3976468ae7fd7ce49c562
2014-09-23 17:26:00 -07:00
Lajos Molnar 147372fdf9 resolved conflicts for merge of 67d8bd66 to lmp-mr1-dev-plus-aosp
Change-Id: I5e7e6fdf0d2afe6c3e4a0ed6ef96afb4713a72bc
2014-09-19 06:23:46 -07:00
Lajos Molnar 435d9cde27 resolved conflicts for merge of 67d8bd66 to lmp-dev-plus-aosp
Change-Id: I2e9aab90ac53bb32630598f50cc26f6e46acf6d6
2014-09-18 20:09:39 -07:00
Lajos Molnar 67d8bd66aa surfaceflinger: add getDisplayStats() method
This is used by media service to schedule video frames at the
proper time, based on precise vsync timings.

Bug: 14659809
Change-Id: I1a90603f3dc09dca9aa4f90a3aa845fab56e0a5e
2014-09-18 17:03:20 -07:00
Dan Albert 1474f8864f Don't check if this == NULL.
Entering a method with this == NULL is undefined behavior. Clang whines
about this.

Change-Id: Ibde628395ca10dfef0d2f59e81280576f104b83c
2014-09-16 17:52:06 -07:00
Dan Albert 4355c0c986 am e1e3d278: Merge "Clean cruft out of makefiles."
* commit 'e1e3d278549eb6389eb0b5fa3f13a4ac079a55a2':
  Clean cruft out of makefiles.
2014-09-12 16:22:03 +00:00
Dan Albert b79dfe6721 Clean cruft out of makefiles.
Cleans up manual uses of stlport and bionic (and removes uses of private
bionic headers).

Change-Id: I157309d702e59152adfa3450939082248ae4c043
2014-09-11 18:49:47 -07:00
Dan Albert 7d587c31d5 Merge "Silence warnings about unused parameters." 2014-09-11 02:32:24 +00:00
Dan Albert 5746f14978 am fb017a4c: Merge "Fix clang warnings about struct vs. class."
* commit 'fb017a4c3b23741f737093c3fcb78087bbe5e73c':
  Fix clang warnings about struct vs. class.
2014-09-10 01:43:11 +00:00
Dan Albert 9e0e103b65 Silence warnings about unused parameters.
Change-Id: I503aafbdeaec3f53241872dc52af9f8b73a1416c
2014-09-09 16:53:59 -07:00
Dan Albert aeb8ab8c34 Fix clang warnings about struct vs. class.
Change-Id: I9f26cd01ac3153efa6d77a4133686842e2d63203
2014-09-09 15:22:48 -07:00
Riley Andrews c3ebe66b49 Add rotation to surfaceflingers screen cap.
+ This is needed so that activity manager does not
  have to do cpu side rotations when capturing recents
  thumbnails.

Change-Id: If998008e675ad01305db8399fd643cf4608b7025
2014-09-09 03:51:16 +00:00
Jesse Hall 4d407a0f05 surfaceflinger: Trace HW vsync enable
This makes it possible to tell whether two HW vsync signals are too
far apart because one was late, or because we turned HW vsync off
briefly between them.

Bug: 17259382
Change-Id: If4fba2a8a6013568349949ce87c5c36f0468d2a2
2014-08-25 16:05:01 -07:00
Michael Lentine eb21986df0 Merge "Update currentConfig variable when active display is changed." into lmp-dev 2014-08-22 16:34:14 +00:00
Michael Lentine d3e6914cea Update currentConfig variable when active display is changed.
Bug: 17182607
Change-Id: I8631c105a9e0fa402a7d9670717becc9857af935
2014-08-21 14:43:13 -07:00
Jesse Hall d4548dd027 am 514e30a9: am c3d1889e: Merge "surfaceflinger: skip composition for empty frames" into klp-modular-dev
* commit '514e30a96cefad109509ce01622fa7f82f3f318c':
  surfaceflinger: skip composition for empty frames
2014-08-20 20:02:02 +00:00
Jesse Hall 514e30a96c am c3d1889e: Merge "surfaceflinger: skip composition for empty frames" into klp-modular-dev
* commit 'c3d1889e508038efe240ed1974ed377a2e12835c':
  surfaceflinger: skip composition for empty frames
2014-08-20 19:52:40 +00:00
Naseer Ahmed 949ea0868d sf: Clear display configs when hot pluggable display is disconnected
Display configs for external displays are stored in the framework
everytime we receive a hot plug to connect. However, since the
configs are not cleared on disconnect, framework will just assume
that the configs are valid. This does not work for use cases when
you connect/disconnect external displays with different resolutions.

e.g. 1080p to 4K and vice-versa

With this change we clear the display configs and repopulate when
we receive a hot plug to connect.

Change-Id: I2eeab186a8d8668a53390a2413b2ce5e044a1845
Acked-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2014-08-20 15:10:14 -07:00
Michael Lentine 4d7c41008d Merge "Destroy eglSurface before recreating." into lmp-dev 2014-08-19 22:53:25 +00:00
Michael Lentine f2568dea41 Destroy eglSurface before recreating.
Bug: 16856208

Change-Id: Ifb5c8997afab4bc922356a3542d1f899a2546855
2014-08-20 10:56:34 -07:00
Michael Lentine 7b90258c7b Fix inverse orientation when original is not applied first.
Change-Id: I6f1a11950c77c99800acbf08a672bc1b2310b0b5
2014-08-19 18:16:01 -07:00
Michael Lentine 1440963470 Fix camera orientation by swapping horizontal and vertical flips when needed.
Bug: 16637957

Change-Id: I66de597546fdc19e0af9e6150ca20460ab36bf8b
2014-08-19 16:16:35 -07:00
Jesse Hall b7a0549c98 surfaceflinger: skip composition for empty frames
By not committing the results of composition for empty frames, we
avoid spitting out series of black frames for virtual displays that
don't have visible layers. We still draw one black frame when going
from having layers to not having any. In particular, this avoids
having a series of empty frames due to re-compositing the primary
display in the period between creating the virtual display and adding
layers to it.

Bug: 16786752
Change-Id: I7e9b2ed2e407d8d49c7af736b447d4c6181b0ad8
2014-08-19 22:15:43 -07:00
Michael Lentine f755140794 Incorporate TransformToDisplayInverse into the crop calculation.
Change-Id: Ia9757b3a43d3b8f99df9fef2ed4d11c43b5abdd2
2014-08-18 16:35:43 -07:00
Michael Lentine 2cfbef255b Merge "Fix inverse orientation when original is not applied first." into lmp-dev 2014-08-19 22:53:25 +00:00
Michael Lentine 62205596b9 Merge "Fix camera orientation by swapping horizontal and vertical flips when needed." into lmp-dev 2014-08-19 02:43:23 +00:00
Michael Lentine b3abe7c06a Merge "Incorporate TransformToDisplayInverse into the crop calculation." into lmp-dev 2014-08-19 15:47:37 +00:00
Riley Andrews 866399093f Take advantage of sync points during screen cap.
Do not wait for the screen capture to complete within surface flinger,
instead pass a sync point back with the captured gralloc buffer.

Change-Id: I7137c0e0fc710688d1d61f189159418fb27ea263
2014-08-19 19:27:14 +00:00
Michael Lentine b54ee7704e Change output format to not throw warning on volantis.
Change-Id: Id66eb61bdb1ceccfb7aefa0aa70793dac807c257
2014-08-07 14:54:23 -07:00
Michael Lentine 5af281f4ab Fix HWComposer Surface Crop when surface is rotated
Bug: 15091149

Change-Id: I97ecd8af9636da9403fafdb3f9b846f95053ebb7
2014-08-07 13:44:14 -07:00
Eric Penner a02e9484be Merge "SurfaceFlinger: Prevent deadlock by updating an atomic layer set." into lmp-dev 2014-07-29 21:36:00 +00:00
Eric Penner 51c59cd1e7 SurfaceFlinger: Prevent deadlock by updating an atomic layer set.
Bug: 12934849

Change-Id: I9dede7316f1e967de4140bd731ac810115ea302f
2014-07-30 19:05:38 -07:00
Michael Lentine 9ae79d869a Build fix for size_t on 64bit.
Change-Id: Ic16895b30d78ba8a635b709adbae31a590501b20
2014-07-30 16:42:12 -07:00
Michael Lentine 258ee43fbc Build fix for printf with int64 and size_t
Change-Id: I642584cce7dd43e6d491a49228b0bce047d53354
2014-07-30 16:24:48 -07:00
Michael Lentine fd9d183cd8 Build fix to use the correct source.
Change-Id: If36710be600dd0e15c31682e0343f281baa55627
2014-07-30 15:39:17 -07:00
Michael Lentine 7306c670eb Add error for format and make sure setActiveConfig fails with an invalid mode.
Change-Id: Iacdb5cbad125787f96c64c88d432fc541c4cad1a
2014-07-30 14:36:25 -07:00
Michael Lentine 47e45405d1 Allow for resizing of Virtual Displays.
Modify SurfaceFlinger to use VirtualDisplaySurface in all cases when a virtual
display is used. Add functionality in VirtualDisplaySurface to resize the
buffers aquired in the QueueBufferOutput. Add transaction support in
SurfaceFlinger for resize. Add the modification of the size in DisplayDevice.

Change-Id: Iae7e3556dc06fd18d470adbbd76f7255f6e6dd6b
Tested: None
2014-07-30 14:36:25 -07:00
Michael Wright 1f6078aef7 Have VirtualDisplays send SF resize messages when resizing
Change-Id: I76d15b22099a659450ec875836c9bf2b6584838f
2014-07-30 11:23:44 -07:00
Michael Lentine 6c9e34a98a Modified SurfaceFlinger to implment setActiveConfig and getActiveConfig.
This can be used to change the current display mode of the device.

Change-Id: Icdc3fb58389b861dc77b68102083da6f7a96eccb
Tested: None
(cherry picked from commit 2651fa9463)
2014-07-29 16:56:30 +00:00
Riley Andrews 03414a1cfe Turn on support for async cursor update in surfaceflinger.
If available, surfaceflinger will use the hwc setCursorPositionAsync()
api to change the position of supported cursor layers outside of
the usual prepare/set loop.

Change-Id: Ib3fc5c0c390b3489ddbba202379840a1d2748917
2014-07-28 22:07:41 +00:00
Ruben Brunk 2ad9d8a6e7 Merge "Add sticky transform to surfaceflinger." into lmp-dev 2014-07-14 18:37:51 +00:00
Ruben Brunk 1681d95989 Add sticky transform to surfaceflinger.
Bug: 15116722

- Adds a sticky transform field that can be set from a
  SurfaceFlinger client Surface.  This transform is
  added to any transform applied to the Surface.

Change-Id: Idaa4311dfd027b2d2b8ea5e2c6cba2da5779d753
2014-07-14 22:14:32 +00:00
Jesse Hall b154c42c39 Improve memory coherence management in screenshot code [DO NOT MERGE]
The existing code worked in practice, but wasn't quite correct in
theory and relied on implementation details of other code. It's still
somewhat unusual and subtle, but now is correct-in-theory (I believe)
and a little better documented.

Bug: 16044767
Change-Id: I22b01d6640f0b7beca7cbfc74981795a3218b064
(cherry picked from commit c61576794e)
2014-07-14 19:29:09 +00:00
Jesse Hall 24cd98eef8 Compile libsurfaceflinger with Clang and -std=c++11 [DO NOT MERGE]
This is necessary to use C11/C++11 stdlib atomics, which the next
change will do. This change also fixes a couple bits of syntax that
both GCC and Clang refuse to compile in -std=c++11 mode.

Change-Id: Ia14d9d6b537a3bb106c23e19a277e48be180754c
2014-07-14 12:18:00 -07:00
Jesse Hall e9b23b6588 surfaceflinger: Make all sources depend on Android.mk
This forces all SurfaceFlinger sources to be recompiled when the
Makefile changes; that's overkill sometimes but makes sure everything
gets recompiled when compile options (or similar) changes.

Change-Id: I2b3c3090fc1c35078e13c77fbb1a78d447c39158
2014-07-14 15:32:59 -07:00
Dan Stoza dc56bf721a Merge "BufferQueue: Add allocateBuffers method" 2014-06-27 15:56:14 +00:00
Dan Stoza e49ba8e2ed GLConsumer: Stop using default constructor params
Removes the dependency on default constructor parameters for
GLConsumer so that a different constructor prototype can safely be
added.

Change-Id: I0da924bbd4c141edbf305598c1be8bc575654680
2014-06-24 13:09:19 -07:00
Dan Stoza 29a3e90879 BufferQueue: Add allocateBuffers method
This adds an allocateBuffers method to BufferQueue, which instructs
it to allocate up to the maximum number of buffers allowed by the
current configuration. The goal is that this method can be called
ahead of render time, which will prevent dequeueBuffers from blocking
in allocation and inducing jank.

This interface is also plumbed up to the native Surface (and, in
another change, up to the Java Surface and ThreadedRenderer).

Bug: 11792166
Change-Id: I4aa96b4351ea1c95ed5db228ca3ef98303229c74
2014-06-20 13:13:57 -07:00
Ruchi Kandoi cd13f9da99 Merge "SurfaceFlinger: send VSYNC power hints to IPowerManager" 2014-06-20 02:15:46 +00:00
Ruchi Kandoi ef472ec40a SurfaceFlinger: send VSYNC power hints to IPowerManager
VSYNC power hints are now sent via binder to IPowerManager.
SurfaceFlinger no longer loads a second copy of the PowerHAL.
VSYNC power hints are sent in batches and not on per frame basis.

Change-Id: Ia5a839ab3c857cffae7089f810b4315d4ed23fcf
2014-06-18 18:51:24 -07:00
Dan Stoza eac96b9bfd Merge "SurfaceFlinger: Fix rect out-of-bounds checks" 2014-06-17 21:43:29 +00:00
Andy McFadden 91b2ca8562 Add two new display info fields
This adds SurfaceFlinger's app VSYNC offset and buffer deadline
values to DisplayInfo.

Bug 14612039

Change-Id: Ie0ab21d388fe2764f2b6f71bd1cefa33dc861a73
2014-06-17 10:41:46 -07:00
Dan Stoza be31f44798 SurfaceFlinger: Fix rect out-of-bounds checks
Rects' right and bottom edges are treated as exclusive, so when
checking against maximum width and height, we should use > instead
of >=.

Change-Id: Ifcdf6813c13fcab1a55f16c21064e765e93d49f0
2014-06-11 11:20:54 -07:00
Wengang Wu 20071e5028 am e3d37a7b: Enable support RGBX_8888 for omap3
* commit 'e3d37a7b55f86f5d005dd67f828dcf51fe60c0f6':
  Enable support RGBX_8888 for omap3
2014-06-11 18:17:19 +00:00
Wengang Wu e3d37a7b55 Enable support RGBX_8888 for omap3
Bug: 14995811
Change-Id: Iaeb5a5ad0e3bcf215613f24f2570ae0d8267c016
2014-06-11 11:13:40 -07:00
Prashant Malani 7227b96a73 Merge "surfaceflinger: Replace blank/unblank with setPowerMode" 2014-06-12 03:30:50 +00:00
Wengang Wu 1210f2ab82 am 20071e50: am e3d37a7b: Enable support RGBX_8888 for omap3
* commit '20071e5028adb6d7ced81843d33e4d0baa0768ed':
  Enable support RGBX_8888 for omap3
2014-06-11 21:38:55 +00:00