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)
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)
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
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
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
Use LOCAL_WHOLE_STATIC_LIBRARIES to instruct static linker
to export symbols from the static library.
Change-Id: I0e41cf173be96c52cdad72b1ef4a1bf819e65dd2
And export necessary symbols to preempt calls from libart.so
Bug: 15345057
Bug: 15426766
(cherry picked from commit f3da24d8cf)
Change-Id: I03b632e0bf2cbaf4a0e68cd0af4e991f7f6b08e4
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
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
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
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
This is used by media service to schedule video frames at the
proper time, based on precise vsync timings.
Bug: 14659809
Change-Id: I1a90603f3dc09dca9aa4f90a3aa845fab56e0a5e
+ This is needed so that activity manager does not
have to do cpu side rotations when capturing recents
thumbnails.
Change-Id: If998008e675ad01305db8399fd643cf4608b7025
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
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>
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
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
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
This can be used to change the current display mode of the device.
Change-Id: Icdc3fb58389b861dc77b68102083da6f7a96eccb
Tested: None
(cherry picked from commit 2651fa9463)
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
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
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)
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
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
Removes the dependency on default constructor parameters for
GLConsumer so that a different constructor prototype can safely be
added.
Change-Id: I0da924bbd4c141edbf305598c1be8bc575654680
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
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
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
This replaces the previous low-power mode experiment, which
discarded refresh events, with a new experiment that alters
the refresh period.
(see also I2849e5ea335c0d2509fea1c315392bce7f20451d )
The feature is enabled by specifying a nonzero value for the
"refresh skip count", which indicates the number of periods
to skip. For example, the command:
adb shell service call SurfaceFlinger 1016 i32 1
sets a skip count of '1', yielding a 30Hz refresh rate on a device
with a 60Hz display. Changing the last value to '2' would set the
refresh to 20Hz. '0' returns to the default behavior.
Bug 15523257
Change-Id: I00039c22a55750e74035644c63800e4bee1c774a
If app and SF events aren't using phase offsets, we don't need
to maintain the DispSync model. We just turn hardware VSYNC on
whenever something wants to draw. This avoids some edge cases
where we were doing too much resync work.
Also, updated the systrace output. The "VsyncOn" line was a
combination of SF and app event threads, and would occasionally
be very weird. Removed VsyncOn, renamed VSYNC to VSYNC-app,
and added VSYNC-sf.
Also, added more details to the --dispsync dumpsys output.
Also, renamed global constants to not look like local variables.
Bug 15516453
Change-Id: I0da10b72f0d9a7b7eb5202d87cc18967f698adbd
We replace the blank/unblank calls in surfaceFlinger with a more generic
setPowerMode() routine.
Some displays support different power modes (for example, with reduced
color palettes). Depending on the use case we should be able to toggle
these modes, so as to achieve incremental power savings.
Initially, three power modes will be supported:
- HWC_POWER_MODE_OFF
- HWC_POWER_MODE_DOZE
- HWC_POWER_MODE_NORMAL
HWC_POWER_MODE_OFF will correspond to blanking the display, while
HWC_POWER_MODE_NORMAL will correspond to unblanking. HWC_POWER_MODE_DOZE
will put the display into a low power setting, if it is supported in
hardware.
If such a low power mode is not supported, it should be treated as a
call to set the mode to HWC_POWER_MODE_NORMAL.
As a consequence of adding the mPowerMode field, the mScreenAcquired is
no longer required, and thus references to it are removed and replaced
equivalent references to mPowerMode.
We also add the glue code to connect the services invocation of setting
a power mode and the HAL implementation in HWComposer.
Bug: 13472578
Change-Id: I431595ecf16d2f2c94259272db3dd42f29636204
Signed-off-by: Prashant Malani <pmalani@google.com>