Commit Graph

51 Commits

Author SHA1 Message Date
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
Saurabh Shah
aa537df10d hwc: Add some debug and warning logs.
Add debug logs for blank, unblank and warning logs for composition on powerdown.

Change-Id: I184a9503a26d401cf70e072815603a47d3972eed
2012-09-12 13:43:51 -07:00
Saurabh Shah
2e2798c71a hwc: Fix fps calculation.
Fps is returned directly by the driver. No need of additional calculations.

Change-Id: I17bed4347f094b71340ca39e37b66fbcf9fdba9c
2012-08-31 15:19:26 -07:00
Saurabh Shah
df727717e8 hwc: Unlock prev. buffers in N+1th draw round.
Unlock previously locked overlay buffers in N+1th draw round, rather than N+2th.
This is now possible because of wait for PAN.
Provides an opportunity to improve genlock behavior.

Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>

Change-Id: I13d9c39e276918c3d3d27b2f07ed486b27b58441
2012-08-27 13:54:37 -07:00
Saurabh Shah
fc2acbe754 hwc/fb/overlay: wait for fbpost and pan display
Draw sequence in hwc_set
--eglSwapBuffers
--wait for fb_post. Its ok to draw to External only at this point.
--draw to external   | Parallel with PAN
--commit to external | Parallel with PAN
--wait for pan (happening in fb_post) to finish.

Call MSMFB_OVERLAY_SET ioctl only when params change.

These thing together ensure a correct sequence and should fix tearing and
stuttering, the latter assuming there are no other display pipeline delays.

Acked-by: Arun Kumar K.R <akumarkr@codeaurora.org>

Change-Id: Ibb0ad8485fa6b30dc6ac07ae8b25a760941c08ce
2012-08-27 13:53:40 -07:00
Jesse Hall
3be78d9816 Update for cleanups in hwc interface
Also store the hwc_procs_t* into a dedicated field instead of one of
the hwc_composer_device_1_t::reserved_procs slots, which are supposed
to be NULL so the structure can be extended without breaking backwards
binary compatibility.

Change-Id: I11e6bc713958d854aba418242caa749cbcb21f1d
2012-08-22 23:17:45 -07:00
Saurabh Shah
83523d8157 hwc: qbuf: Add API to unlock all
Add API to unlock all current and previous buffers.
This is essential in suspend cases.

Change-Id: I61c26db2e0e2b3e5e7f526a62a56424a8632f1d8
2012-08-20 16:38:16 -07:00
Naseer Ahmed
934790c2fc hwc: Call blank ioctls
The blank ioctls were never called, we were relying on
the driver to implicitly do this on suspend/resume.
Fix this by calling blank with the right parameters.

Change-Id: Ib969c4e55d9f460255750f07aecefb04a310bd7a
2012-08-16 18:44:57 -07:00
Naseer Ahmed
c3f033cec4 Revert "hwc: Fallback to GPU for video playback usecase"
This reverts commit e217fbfb09.
2012-08-15 20:22:22 -07:00
Naseer Ahmed
5b6708ac87 hwc: Update to new API
* Updates HWC to use the Jellybean MR1 API
* Remove qcom_ui which was using parts of the old API

Change-Id: I663363547b193d2318aae88f2256a9baed1e3d4b
2012-08-14 14:18:23 -07:00
Naseer Ahmed
b90d091c75 display: Compile for mako, disable copybit route
Change-Id: I147b50dbedd9d52c715982f911be5c9ac0e267f1
2012-08-14 14:18:19 -07:00
Naseer Ahmed
45a9960377 libhwcomposer: Add C2D support to copybit
Change-Id: I2f2c915bb92d5c459428078149a9709356ae83f1
Acked-by:  Neti Ravi Kumar <ravineti@codeaurora.org>
2012-08-14 14:18:18 -07:00
Naseer Ahmed
4c588a200c hwc: Add support for external-only layers
Add support for different types of external-only layers
EXTERNAL_ONLY: General purpose
EXTERNAL_BLOCK: Blocks the display of other ext-only layers
EXTERNAL_CC: Used for closed captions with videos.

Change-Id: I9cc7b9a1dbf1085194725474d6a4d1094e27a0c8
Acked-by: Saurabh Shah <saurshah@codeaurora.org>
2012-08-14 14:18:13 -07:00
Naseer Ahmed
96c4c95d48 display: Get panel type from framebuffer
Change-Id: I3b7cb78d7c6019482ae698b30d553ca782f5022b
2012-08-14 14:18:11 -07:00
Naseer Ahmed
7c958d445f display: Add support for MDP Composition
This change
   1) implements MDP Composition upto 3 layers
   2) adds invalidator support to fall back to FB
      composition during idle screen condition.

Change-Id: I55f27321fd0df096b353d66aaad1cc720cd4b84b
Acked-by: Jeykumar Sankaran <jsanka@codeaurora.org>
2012-08-14 14:18:09 -07:00
Naseer Ahmed
f8ec162999 hwc: enable vsync for external display
- wait for hdmi vsync when connected to hdmi
- add commit to call PANDISPLAY for updating ext display
- add functions to close fb and reset info

Change-Id: I49afbeb85935b111055a872b29a1f65d87ab72c9
Acked-by: Arun Kumar K.R <akumarkr@codeaurora.org>
2012-08-14 14:18:07 -07:00
Naseer Ahmed
72cf9762f8 display: Enable vsync
* Use the vsync uevents from the kernel to start
surfaceflinger composition.
* This patch also does some code cleanup
    - Move copybit specific functions to copybit files.
    - Cleanup verbose logging.

Change-Id: I36936e4b0a082cfb0347d8ee7d2bc936e01808e6
2012-08-14 14:18:03 -07:00
Naseer Ahmed
31da0b1f44 display : Add support for copybit composition
This change add support for copybit composition in display HAL
for MDP3 targets.

Change-Id: I9bc8e40f624b0760f4faa223cb03a13695611bb3
Acked-by: Sravan Kumar D.V.N <sravank1@codeaurora.org>
2012-08-14 14:15:51 -07:00
Ajay Dudani
e217fbfb09 hwc: Fallback to GPU for video playback usecase
Change-Id: I0496f709f184d0420cd976056f74f26bb1bbdba1
2012-07-25 18:37:04 -07:00
Naseer Ahmed
0c8b7b5c84 hwcomposer: Add support for UI mirroring
- Uevent observer as part of Hwcomposer
- HPD, enabling/disabling external display from HWC

Change-Id: I52b4f30c78e98c5b52c86722046389f458c2dbee
2012-07-23 12:38:12 -07:00
Naseer Ahmed
f48aef64b2 liboverlay: Refactor, bug-fixes, upgrade.
* Fix memory leak during copying pipe objects.
* Remove unused / unnecessary code.
* setMemoryId API is merged with queueBuffer.
* setParameter API is setTransform now.
* Rotator upgraded to:
  --Allow different rotator hardware types.
  --Remove dependency on MDP code.
  --Allocate memory only during first playback,
  close when the associated pipe is closed.
* Have single commit implementation.
* Include new format types.
* Remove WAIT and CHANNEL enums and usage. Replace BypassPipe with
  GenericPipe. Client expected to set alignments and parameters.
  Add transform combination enums.
* Allow APIs to be called in any order. Do transform calcs in commit.
  Move ext type setter and getter functions.
* Add calculations for 180 transform.
* Add secure session support in rotator
* Implement all rotations in terms of H flip, V flip and 90 rotation.

Change-Id: I34a9a2a0f1255b3467a0abbaa254d0b584e901ce
2012-07-23 12:36:44 -07:00
Naseer Ahmed
a87da60090 display: Add QC Display utils
* Rename qcomui directory to qdutils
* Avoid inclusion of qcom_ui header
* Add class to get MDP version
* Add namespace for qdutils to prevent collison

Change-Id: I9a3f440e6b0fea1cfcc478ddca90af5df3bbb897
2012-07-13 17:50:32 -07:00