Commit Graph

122 Commits

Author SHA1 Message Date
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
Naseer Ahmed
758bfc5b50 hwc/overlay: Dynamic pipe tracking.
Remove state based pipe handling and make pipes tracked dynamically.
Add the configStart, configDone, nextPipe availablePipes APIs.
Remove setState API.

-configStart marks all pipes available.
-configDone garbage-collects unused pipe objects.
-nextPipe returns the index of next available pipe and create a corresponding
pipe object if not present
-availablePipes returns total of "unallocated" pipes. (Pipes could be allocated
but unused)

Changes in hwc adapt to the new overlay APIs.
Compile out MDP comp.
Remove unused files in overlay and hwc.
Update licenses.

Conflicts:

	libhwcomposer/hwc.cpp
	libhwcomposer/hwc_utils.cpp

Bug: 7626586
Change-Id: Id8e56901d34e5dc0fd088260d05e3e46f68ff090
Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-12-03 15:33:29 -05:00
Naseer Ahmed
b1c7632ec5 hwc: cache layers on framebuffer
In the cases where all the layers that are marked as HWC_FRAMEBUFFER did not
change, we can mark them as HWC_OVERLAY since their contents are already on the
framebuffer and do not need any additional processing.

This optimization shows power improvement for video playback.

Bug: 7623741
Change-Id: Ia178a926e6f56a3ec9291250a22a66f212c30b14
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-12-03 15:32:29 -05:00
Saurabh Shah
eaf679142b hwc: Return failure code if hwc_set fails to draw
Check for errors while drawing the layers in hwc_set.

Return -1 in the error case so that framework doesn't wait on fences.

Bug: 7284105
Change-Id: I024f9ca07faf64d6b90d4f483164dc15c0d7992c
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-15 16:47:08 -07:00
Saurabh Shah
1a8cda0b2c hwc: clean up overlay for external from the draw thread only
Cleanup overlay for external from the draw thread. If done from the uevent
thread, its possible that the object being used by draw thread is deleted by
uevent thread.

This also removes unnecessary side-effects where libexternal sets states in
hwc, whereas, it could be set from hwc itself. There should be no need for
libexternal to modify states in hwc.

Bug: 7335863 (partial fix)
Change-Id: If07483e640abae2ced2418e0d5c8f278f8c6ec33
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-15 12:02:33 -07:00
Kinjal Bhavsar
f83d4480f2 HWC: Protect hwc_set from async events
Wait for hwc_set completion if already in progress before processing
the async events.

Bug: 7288769
Change-Id: Ibdd0ee82f079df566b899c94df19f6bb1031d686
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-12 16:15:31 -07:00
Iliyan Malchev
0f9c397181 hwc: add some logging
We are seeing errors where a device's hwcVsyncThread is not present for some
reason.  The surface flinger has not crashed, so either the thread never got
created, or it exited withouth throwing an error.  This patch adds some more
verbose on-error logging to the HWC as an attempt to verify the theory that the
thread does not get created, or fails in pthread_create.  While we're at it, we
add the same logging at pthread_create() for hwcUeventThread, as well.

Also, replace the lseek()+read() with a pread() combo in the vsync thread.

Change-Id: I555d786a7d66ff4ef1dbfd95947a7d9341e56f11
related-to-bug: 7305728
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-11 15:45:38 -07:00
Saurabh Shah
150806ae0e hwc: fix for not ignoring framebuffer
If the FB is not used, because all the app layers are overlays, then set the
flag to have the driver not fetch from the FB pipe.

Bug: 7183992
Change-Id: I96ecc1610ac052e8512158d189b0614ecf82d139
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-09 18:22:04 -07:00
Saurabh Shah
ae823e7735 hwc: more error checks
-- numHwLayers==1 means that there is only the FB_TARGET which HWC shouldn't
   draw. Also check for blank in set.  Checking for this in prepare prevents us
   from acquiring pipes.
-- add null check for private handle
-- print out vsync timestamp data on error

bug: 7274417
related-to-bug: 7288769
Change-Id: I8dae0d0748c5226fdc33ed8f5cc5259835dec2de
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-07 17:20:17 -07:00
Saurabh Shah
6d9d168b0a hwc: Remove call to glFinish
It had a glFinish which is not needed anymore on HWC 1.1

Bug: 7274951
Change-Id: I1389802a0ed3f0199d7d7ba0110a343b2f571106
Acked-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-07 17:20:17 -07:00
Naseer Ahmed
c7faa70f4a hwc: move enable disable ioctls to vsync thread
This patch stabilized the vsync signal.

Bug: 7274951
Change-Id: Ieb6396c67d4dfb20cfde39a63a45ab6742d9ec5b
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-04 14:03:41 -07:00
Iliyan Malchev
eac8965bf4 hwc: fix some race conditions
Fix some race conditions between hwc_eventControl and the hwcVsyncThread.

Bug: 7274951
Change-Id: Ic71d65918303b4cef6a379ff5397702b2b578373
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-04 14:03:23 -07:00
Omprakash Dhyade
1ef881ceed don't call vsync-ctrl ioctl for same enable value
Bug: 7274951
Change-Id: Ib21f1ddd623b36a20f195483236ba6cd4bc87c8d
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-03 10:29:12 -07:00
Saurabh Shah
c4d034f4b8 hwc: enable dual display on hwc 1.1
Enable dual display on HWC 1.1; video uses overlay.

Bug: 7124159
Change-Id: I8333e46cfc74072f6259fba2b82368f0dd52b6df
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-02 23:46:58 -07:00
Naseer Ahmed
ff4f0254be hwcomposer : Use sysfs to read vysnc information
* Read sysfs entries to get vsync timestamp from kernel.
* External display continues to use uevents for hotplug events
* A new thread, vsyncThread is created to read and send vsync
  timestamps to HAL.
* Disable H/W VSYNC for MDP 5.x targets until kernel changes are
  complete.
* Synchronization is needed to make sure read() is not called
by hwcVsyncThread when VSYNC is disabled.

Change-Id: Iab0a94a3cfce9142b8867859f2a7d9bcaecb0996
Acked-by:  Neti Ravi Kumar <ravineti@codeaurora.org>
2012-10-02 16:54:14 -07:00
Naseer Ahmed
32ff225e6d hwc: Make blank wait for set to complete
Bug: 7217641
Change-Id: Ie25c9caa7a4c6a256c0f35fc40cbae2ef4572f5d
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-01 22:24:41 -07:00
Naseer Ahmed
aee5e6ecca hwc: Close unused pipes before PAN
If the pipes are closed after PAN a blank screen is
seen when when we transition from MDP composition
to GLES composition.
We close the unused pipes at the beginning of the set
since the decision has already been made in prepare.

Bug: 7188473
Change-Id: I6f946fa3d02f1c84fb2bb8d3b8e5c823c1151fd5
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-09-27 14:29:53 -07:00
Saurabh Shah
8c8bfd2f82 hwc: Call sync before draw.
Call sync before draw since draw could use rotator which reads out of the
buffer.  For that to happen cleanly, the buffer should not be in use.  Calling
sync before draw makes sure, the buffer is free to be used.

[TEMP]
Enable rotator for external video, since sync-pt is not used for external yet.

Bug: 7227220
Change-Id: I25fec8ecc158e28801f238d2829af4d635f3e2c9
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-09-27 14:22:52 -07:00
Saurabh Shah
3d2a790a1f hwc: Fix tearing on HDMI. Call glFinish()
When rotator is rotating GPU writes into it causing tearing.  With hwc1.1,
framework doesnt use fbDev, which had a call to glFinish().  Consequently, this
was missed out. Adding this missing code to hwc1.1

Related-to-Bug: 7227220
Change-Id: I7287d3d73b839fef818e31c1c8a783f1fb96d9f1
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-09-27 14:20:39 -07:00
Naseer Ahmed
6282c95645 hwc: Check for the validity of the fb layer
Need to check if this is valid before doing anything
Extra NULL checks all around to prevent any invalid
lists from SurfaceFlinger

Change-Id: I57ca97167e469910bcaaa68672ae70b41a061ded
2012-09-26 18:18:44 -07:00
Naseer Ahmed
7b80d9c8cb hwc: Fix dpi values reported
HWC 1.1 expects DPI multiplied by 1000

Bug 7241591

Change-Id: I680da8769f53f8a18d942a3b292d96a16885ebfa
2012-09-26 17:43:38 -07:00
Saurabh Shah
86623d7d51 (TEMP) hwc: external: Enable default mirroring on hwc1.1
Related to bug: 7124159

UI Mirror works with tearing because sync operates at primary vsync.  Need
kernel patch to wait on external post.

Change-Id: I77116ef40ae25a2207feb5ca3cd9065ef0da6e4a
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-09-25 22:55:14 -07:00
Saurabh Shah
3e858ebde3 hwc: hwc 1.1 implementation
Bug: 7124159

--External disabled
--MDP comp coded but disabled.
--Videos via overlay, so that secure videos can work.

Change-Id: Ie48b264143d5e4237ab9724e28930e3f68ba49ee
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-09-25 22:51:14 -07:00
Kinjal Bhavsar
2dd04a873b hwc: sync-point implementation.
Add sync pt implementation.
Add genlock and sync pt under conditional compilation flags.

Change-Id: I32fb7f6051ccc706662152e90ac15b6b6743f897
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-09-21 17:18:44 -07:00
Saurabh Shah
649cda6710 hwc: Minor bug fixes.
Some minor bug fixes.

Change-Id: Ie8c2f58b9c6db6e77739e4693da503f6f963827d
2012-09-18 10:26:51 -07:00
Saurabh Shah
56f610dd23 display: Create QService binder interface.
Add QService binder interface to enable communication
to display by the mediaserver for Securing/Unsecuring start and end
notifications.

Create separate lib for external.
Clear reserved field before applying format.

Change-Id: I463c9c6deac7587bd0c4e0b84513b5d0b5dd7e98
2012-09-18 10:21:14 -07:00
Iliyan Malchev
80692ef564 hwc: add more debug print
- when UNBLANK completes
- when POWERDOWN completes

Change-Id: Ife7b4b40309de0f58052184ca3e4584b50c69bb1
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-09-17 23:16:53 -07:00
Saurabh Shah
9171ec698c hwc: Add non-zero checks. Move warning log.
Add check for presence of non-zero number of layers.
Move the "composition after powerdown" log under that check.
Move the caching of dpy under list non-null check.

Change-Id: I99b9293e671a15ba1fb31692e30413d2bbd97867
2012-09-13 09:40:02 -07:00