Commit Graph

99 Commits

Author SHA1 Message Date
Linux Build Service Account
07be7a4e80 Merge "hwc: Implement idle-fallback for videos" 2013-05-17 06:43:50 -07:00
Linux Build Service Account
9659a6a7ad Merge "hwc: Simplify vsync code" 2013-05-17 06:43:42 -07:00
Saurabh Shah
2d998a9658 hwc: Implement idle-fallback for videos
In case of videos, do a fallback using 2 pipes per mixer at most.
This redraw will happen only once to reduce pipes from at most 4
to at most 2 and never draw again until there is an update.

Change-Id: I78c0dc2af4e3bd7e9128994e507e777187b4e247
2013-05-14 18:18:37 -07:00
Linux Build Service Account
8f148a46f5 Merge "hwc: Do not show animation on External display." 2013-05-13 15:38:00 -07:00
Linux Build Service Account
4bfc6a98fa Merge "hwc: Add support for EXT_ONLY Layers" 2013-05-13 15:37:48 -07:00
Naseer Ahmed
8bb8f9de3b hwc: Simplify vsync code
Handle the wait properly in the kernel and remove unnecessary
thread signaling.

Change-Id: Iff05825a7a85d0353f3feb64e7f9a06cedab7869
2013-05-13 17:38:26 -04:00
Ramkumar Radhakrishnan
68a51923d2 display: Fix acquireFenceFd memory leak
Remove return statement from display commit failure and assign
the return value as -1 to avoid memory leak during error scenario.

Change-Id: I87dd73e997e016f89944bb1603b517847bbc555c
2013-05-11 23:18:15 -07:00
Ramkumar Radhakrishnan
59a110773c hwc: Do not show animation on External display.
- When primary is animating, the animation should not be
  shown on the external display.
- Mark all app layers as HWC_OVERLAY on external during
  animation so that SF wont compose it on FB.

Change-Id: Ic557cabfd9f2518614777c0e993541e36e090850
2013-05-11 18:37:37 -07:00
Arun Kumar K.R
a2978452bd hwc: Add support for EXT_ONLY Layers
If there are any EXTERNAL_ONLY layers present in the list, mark
them as HWC_OVERLAY such that SF does not compose and in hwc_set
post that layer to Ext display, ignore other layers

Change-Id: Ic5db3bfa88295167d23d1fb2be7640c9fc772054
2013-05-11 18:05:40 -07:00
Linux Build Service Account
6f6e598abe Merge "Fix crash issue arising out of multiple hdmi connect/disconnects" 2013-05-08 22:20:29 -07:00
Saurabh Shah
98acd09dde hwc: Fix Idle fall back when external connected.
Reset idle fall back at the end of prepare, so that irrespective of
whether primary or external is configured first, both will fall back.

Change-Id: I6206f7cf0cccf71d1b33153044546515029f4e08
2013-05-03 10:48:24 -07:00
Raj kamal
e3e68ae41f Fix crash issue arising out of multiple hdmi connect/disconnects
Acquire mExtLock before proceeding further in
hwc_prepare_external to prevent crashes arising out
of updating ctx variables from two different
threads(composition and uevent threads)

Change-Id: I0f18c41b117f18aeb25572b53ef6eba3638bb826
2013-05-02 10:14:23 -07:00
Ramkumar Radhakrishnan
b32a0bc134 display: Enable more Debug logs.
- Dump more info for BUFFER_SYNC ioctl failure case.
   - Enable debug logs for blank/unblank display.

Change-Id: I289ed8ad39a0181ff4a404644b90cb02a8144b9a
2013-04-29 11:02:04 -07:00
Saurabh Shah
ae61b2b2c3 hwc: Fix dumpsys crash
In extreme cases, when all pipes are used, the buffer is insufficient.
Reduce logging by striping off unnecessary bytes.

Change-Id: I5a6ffb9ff288e389eea4e9ca4ac850ed59d539ff
2013-04-22 17:46:01 -07:00
Saurabh Shah
85234ec2ec hwc/overlay: Fix dma mode design and issues.
Add support for tracking the mode in which DMA is being used in overlay.
Remove unnecessary tracking variables, and their set,reset inconsistency.

With such varibles in hwc, it still leads to overlay giving out DMA pipes.
Make overlay as the single tracking place.

Change-Id: Ib949f3d0ef5918ef323c81cb1768b68a68c83da4
2013-04-15 10:10:43 -07:00
Ramkumar Radhakrishnan
d224a1a2db libhwcomposer: Log and dump app layers of screen frames
Log a frame-by-frame succession of HWComposer layers' data and write
their buffers, if any, into raw or png files based on system property
values.

Change-Id: Icceccf5fff5ab4d78dbc6c28c11210b8837ddfd9
2013-04-11 14:47:14 -07:00
Jeykumar Sankaran
85977e3abe hwc: Implement mixed mode composition.
With this change we are moving  MDP composition from all-or-nothing
implementation to mixed mode implementation where layers can
partially be composited through MDP and while rest of the layers are
composed / cached in framebuffer.

        - Mixed mode design is based on layer caching
        - Mixed mode path is configured only when non-bypassing
          layers are cached.
        - Never allow mixed mode when FB needs to be  udpated.
        - If we cannot bypass all MDP comp marked layers, bail
          out completely.

Change-Id: Ie08f39db07e032b537f042d0d2bfe772ebfed049
2013-04-08 11:36:03 -04:00
Naseer Ahmed
e0205b6cfa hwc: Reduce blank/unblank logspam
This is logged in the kernel and if there are excessive delays,
logged in the PowerManager.

Bug:8485194
Change-Id: Ia83b186ccae1fb6de59f200faf28346f84d832b6
2013-04-04 13:24:39 -04:00
Linux Build Service Account
023e61bb20 Merge "hwc: clean up overlay on external display blank" 2013-04-03 10:56:43 -07:00
Arun Kumar K.R
e7408371cd hwc: clean up overlay on external display blank
- On suspend, SurfaceFlinger calls hwc_blank on primary and
  external separately, inbetween these calls there might be a
  update, which leads to acquiring overlay pipes for external
  which will not be cleared and results in showing up stale
  frame on external display
- This change clears all the overlay pipes used on every blank

Change-Id: I44d62b7d0fcd992cf8a26bb0c21df77952bc1381
CRs-fixed: 464070
2013-03-29 10:15:53 -07:00
Naseer Ahmed
0d05d4fae1 hwc: Add debug logging for fps
This is indicative of how many frames are posted to the display
by SurfaceFlinger. Set debug.gr.calcfps to 1 and restart the
framework to enable.

Change-Id: Ic503c14380fd7d8a5b062aa5da0d61bfc3991cb2
CRs-Fixed: 462010
2013-03-28 11:58:58 -07:00
Saurabh Shah
2b0333955c hwc: Configure pipe for FB even if we exceed max layers
Even if we exceed max supported layers, configure pipe for FB
Because FB contents are always displayed using hwc

Also some minor code fixes

Change-Id: I740ab7e908c916373b1d87facd831e09098ce753
2013-03-26 12:58:37 -07:00
Jeykumar Sankaran
a37fdbf2ab hwc: Add DMA pipe support in MDP composition.
This change adds support to MDP composition to use DMA pipes when
layer scaling is not needed. Also makes sure not to invoke
MDP rotator when DMA pipes are configured since MDP rotator will
expect both the DMA pipes to available for performing rotation.
In such cases, we let the first frame of rotated video frame to
fall back to FB.

Change-Id: I3c3697dd2713ce9b86ba1e23192ec5841abd25ec
2013-03-22 10:54:22 -07:00
Jeykumar Sankaran
c1f8682f7b display: Remove framebuffer HAL usage
This patch removes the usage of the framebuffer HAL which is
deprecated in JB MR1 onwards. The code is left for compatibility
such as conformance tests but it is unused for normal display
usage.

Change-Id: If98133bdaa759cdc41d4503ff695b225ee43cb6f

Conflicts:

	libhwcomposer/hwc_utils.cpp
2013-03-18 16:38:54 -04:00
Saurabh Shah
acf102021a hwc/overlay: Video on 4k2k external, 4k2k rotation.
-Add support for Video via overlay on 4k2k external panel.
-Add support for rotating videos on 4k2k panels. We use
pre-rotation in hwc to rotate a video into a single buffer,
irrespective of panel size. Then this buffer is fed to MDP.
Rotator objects are managed by the new RotMgr.
-Cleaup mdpcomp and overlay.

Change-Id: Ifb08534747e8e18b6c58dd8a3e1a9947409100f1
2013-03-13 10:24:31 -07:00
Naseer Ahmed
56601cd508 hwc: Check for correct screen state before enabling vsync
Sometimes vsync would not be disabled before the display is
blanked.
This was due to the vsync disable ioctl being kicked off in a
thread different from the event control which surfaceflinger
called. So, while the calls from surfaceflinger are in order, the
order of execution wasn't always the same. Hence, making sure
ioctls are called in the same context to ensure order.

Also
- Make blanking/unblanking logs show the operation as a string.
- Add a debug property to dump vsync timestamps (needs framework
reboot)
- Remove a log which showed delay in reading vsync. This log was
unreliable when vsync is disabled and we're still reading from
the sysfs node.

Change-Id: Ibec04e9ffebd0ac6e1d32b7031e3668abd9390ff
CRs-fixed: 443113
2013-03-11 15:45:33 -07:00
Linux Build Service Account
fe7c61431a Merge "hwc: handle blank/unblank for virtual display explicitly." 2013-03-07 11:36:16 -08:00
Linux Build Service Account
b93d04266e Merge "hwc: Use intermediate buffers for copybit" 2013-03-07 11:35:14 -08:00
Saurabh Shah
bf1e02a6d9 hwc: Process only MAX_NUM_LAYERS
If the incoming layer count exceeds MAX_NUM_LAYERS,
let surfaceflinger handle the list.

CRs-fixed: 456906
Change-Id: I53159104e5e714ba313d0196ca959f55c82e18ae
2013-03-07 08:21:37 -08:00
Ramkumar Radhakrishnan
893d6eeb16 hwc: handle blank/unblank for virtual display explicitly.
Surfaceflinger does not send Blank/unblank event to hwc for virtual
display, handle it explicitly when blank for primary is invoked, so
that any pipes unset gets committed.

Change-Id: Iec7a1611a8963408f65c8a73a1c15e47cd7faab6
CRs-Fixed: 456810
2013-03-07 08:21:27 -08:00
Naseer Ahmed
64b8121562 hwc: Use intermediate buffers for copybit
The earlier copybit solution involved blitting directly into
the SurfaceFlinger's framebuffer target. That solution involved
unnecessary framework changes and caused issues when the
framebuffer was being written to both by GL and copybit.
Update hwc_copybit to use our own buffers for this purpose.
We also make sure we display only the region we're interested in
so that unnecessary artifacts from previous blits do not show up
on the display. This way, we can avoid clearing the intermediate
buffers every frame.

Change-Id: I713b3fc606e0768444c621af76853ece41964da1
2013-03-01 10:55:23 -05:00
Saurabh Shah
747af1e9e1 hwc: Close acquireFenceFds always.
Close acquireFenceFds always even in case of failures if a layer is either
OVERLAY or FRAMEBUFFER_TARGET to prevent leaks in case of failures.
The framework is *not* responsible for closing acquire fds, for layers
marked as above two.

Change-Id: Ia6c751d3ec25f196f5503120894fc6cc692b9d25
2013-02-26 16:06:07 -08:00
Amara Venkata Mastan Manoj Kumar
11a380df08 hwc: Allow HWC to support Virtual Display
This change allows virtual display to be composed
  by HWC for supporting Google WFD App + QCOM WFD stack.

Change-Id: If8892230256e72fa34e3fb5ae715c3ad8cbd5b64
2013-02-22 17:55:39 -08:00
Saurabh Shah
0d0a7cbdd8 overlay: Add support for pipe dumps.
Add support for pipe state dump useful in dumpsys.
Reduce debug log spam when mdp state changes.

Change-Id: Ie27ad00698085e2ffd6166ad2f7503fe16a571f8
2013-02-21 10:19:44 -08:00
Saurabh Shah
4333330e11 hwc: Call MSMFB_DISPLAY_COMMIT even if FB handle is null.
Call MSMFB_DISPLAY_COMMIT for primary FB even if FB handle is null.
This is already done for external FB.

Change-Id: I5c405f933ce0fd99df6813acea45169802c54226
2013-02-06 14:01:16 -08:00
Jeykumar Sankaran
cf53700d9f libhwcomposer: Allow 2 YUV layer frames to use MDP composition
This change introduces the following changes:
- Frames having 2 yuv layer can be bypassed
- if not handled by MDP comp, video path will not
  handle any such frames and will be FB rendered

Change-Id: Id211dbc185608c482badbca00a2708fa6138a8e5
2013-01-29 13:37:55 -08:00
Amara Venkata Mastan Manoj Kumar
57e3c819bb hwc: Invoke commit ioctl even if there are no app layers
Android has scenarios where it calls HWC::prepare and HWC::set
  without any application layers. In such cases, for power
  optimization, user space avoids  calling PLAY
  (on FB - since there is no new content drawn) and COMMIT ioctls.
  But we might have called UNSET on mdp pipes used for the previous
  frame. As per the current MDP design, these freed pipes will not
  be unstaged unless atleast a COMMIT ioctl is called on that mixer.

Change-Id: I7f7574b2e589e80c4926533066e35784bb29b4a5
CRs-Fixed: 437736
2013-01-16 10:08:10 -08:00
Arun Kumar K.R
361da4fde0 hwc: Add support for copybit(C2D) composition
- Add CopybitEngine to hwc_context
- draw the layer on the HWC_FRAMEBUFFER_TARGET using
  copybit(c2d) if it qualifies for C2D composition.
- use fence returned from the copybit during c2d
  composition

Change-Id: I052da015cd031f7abd6411d83d7944c335caeff7
2013-01-10 12:29:10 -08:00
Arun Kumar K.R
ba9eed5653 hwc: commit changes for ext display on blank
- When the device is suspended, the overlay pipes will be unset,
  but they wont be unstaged as there is no DISPLAY_COMMIT ioctl
  called for ext display, as a result the fence wont be signalled
  by the MDP.
- This is needed as we dont turn off the External display(HDMI)

Change-Id: I9794ad2ae7c9d7b4ce3f9787f50ea9da87966e41
CRs-fixed: 425483
2013-01-04 14:24:15 -08:00
Linux Build Service Account
a41a79d598 Merge "hwc: Delay HDMI/WFD connection request by one frame" 2013-01-04 03:16:43 -08:00
Amara Venkata Mastan Manoj Kumar
75526f5941 hwc: Delay HDMI/WFD connection request by one frame
This change introduces hdmi pending state, where we allow
  frames to fall back to FB, closing all MDP pipes.

  Pipes could be used by primary (mixer 0) in which case moving
  them to external (mixer 1) involves unsetting them and setting
  them in the same round which is not recommended by the driver.
  It will fall back to GPU till HDMI is configured on a connect
  event.

  CRs-Fixed: 430057

Change-Id: I4b6677883c499f6d15656c3578190be1115ee6b4
2013-01-02 23:22:36 -08:00
Saurabh Shah
cbf7ccc4b6 hwc: mdpcomp: Restructure for 4kx2k displays
Restructure MDPComp class for 4kx2k displays.
Cleanup MDPComp class to remove unused stuff and formatting.
Add a MDPCompLowRes class for current functionality.
Add a hollow MDPCompHighRes class for future.

Change-Id: I343540e712d31ca907257a73b49567578f49d5f7
2012-12-28 17:59:19 -08:00
Saurabh Shah
cf053c6eda hwc: Support 4kx2k FB for Primary and External.
Add support for 4kx2k FB for primary and external panels.
Change class design to create appropriate version of FBUpdate on boot up based
on the panel resolution.

Change-Id: I216d815d9b81c610aa39e351f7b55736dfa48b43
2012-12-20 15:15:41 -08:00
Naseer Ahmed
8df2ebf6e9 hwc: Fix issue with Layercache
When MDP comp is done the layer cache
is not reset. Calling the layer cache updated
after MDP comp is configured ensures that the
cache is reset correctly.

Change-Id: I9fc3ddd713ceac4be708e33782c3661e758dfcb9
2012-12-13 15:46:37 -08:00
Naseer Ahmed
e78f052ce5 hwc: User Layercache for external display
Change-Id: Ibca92e1470ef72dc02d16d4ef8c05f1a1d2d485c
2012-12-12 23:01:59 -05:00
Linux Build Service Account
f2341e34a7 Merge "hwc: Implement dump function" 2012-12-09 00:33:44 -08:00
Arun Kumar K.R
f6f49a11d5 hwc: changes for hdmi hotplug and hpd
This commit has the following changes:
1. Use hdmi switch node for hdmi hotplug
   - uses /devices/virtual/switch/hdmi switch_state to determine
     the hdmi connect/disconnect
   - this switch will be set to 1 on connect and 0 on disconnect
   - on connect, open framebuffer device, will trigger the hdcp
     authentication.
   - the driver will set the hdmi_audio switch to indicate that
     the HDMI sink supports audio
2. Enable HDP on unblank
   - this will resolve the device freeze during the bootup with hdmi
     connected

Change-Id: Id7a656d548a31178e31dcb9aea8acf38a56c9e0c
(cherry picked from commit 953b04b3cbba2f91d25795e5b0560c13d47844b0)
2012-12-05 16:55:09 -08:00
Naseer Ahmed
1d183f59f5 hwc: Implement dump function
Does a basic implementation of the dump function
called by SurfaceFlinger in dumpsys.
Further logs in different areas can be added later on
using the dumpsys_log utility.

Change-Id: I2194b4ed7f10947272b7b824ef802ce2ee3c8a48
2012-12-05 14:25:42 -05:00
Naseer Ahmed
76e313c901 hwc: Disable mixed mode composition for secure videos
Also make sure layer cache is used correctly when
we're not using MDP composition

Bug: 7643563
Change-Id: I4dcd70c2da128b2dcbe0b72dc14031983649719d
Signed-off-by: Iliyan Malchev <malchev@google.com>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
2012-12-03 15:35:44 -05:00
Naseer Ahmed
54821fe3a2 libhwcomposer: Add support for 4 layer MDP Comp
This change extends MDP composition to support
upto 4 layers by making border fill as base pipe and
using all MDP h/w pipes in overlay mode.

Conflicts:

	libhwcomposer/hwc.cpp
	libhwcomposer/hwc_utils.cpp
	libhwcomposer/hwc_utils.h

Bug: 7626586
Change-Id: I01a0e53ddfbcf3ed46734f6f3bb0ef7d912ceac6
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-12-03 15:34:07 -05:00