Commit Graph

813 Commits

Author SHA1 Message Date
Naomi Luis
38fa4f72ff libhwcomposer: Close overlay channels in HWC set
Close overlay channels in the next HWC set phase. This allows the
framebuffer to be composed prior to the closing of channels.

CRs-fixed: 305070
Change-Id: I8719381136c20c0febbd4f7bf5b935b92f6508ec
2011-10-18 13:22:41 -07:00
Naomi Luis
376ed9acd9 Enable overlay NOWAIT when there is UI update.
When composing UI along with video, enable the overlay NOWAIT option.
If there is no UI during overlay playback, use the WAIT flag.

Change-Id: Idc538e4412c790fc295a3aff1d1f23a6e4767fce
2011-10-18 13:22:35 -07:00
Naomi Luis
8afdc162ea Upgrades to the updateOverlay functionality.
Update the overlay when we have a channel up. Previously, we did updates
only when the width and height changed. Now, we always update the overlay
when the channel is open, and not close the channel to update parameters
such as orientation change, flags etc.

Change-Id: I0b2ef8b19bd860d5361c391e040ff497f1023ae3
2011-10-18 13:22:31 -07:00
Linux Build Service Account
603a3ad5ae Merge "Set correct parameters in the gralloc handle" into honeycomb_mr2_release 2011-09-27 16:22:37 -07:00
Naomi Luis
f105d784da Set correct parameters in the gralloc handle
Set the aligned width and height in the gralloc handle.

Change-Id: I9cb2d9b681bb022bec2fa7cbe495974865f92a54
CRs-fixed: 306991
2011-09-26 12:59:51 -07:00
Naomi Luis
8da83f0059 liboverlay: Use even crop values
The overlay hardware requires the values to be even. Calculate the ROI
to ensure that the crop rectangle is correct after making the
parameters even.

CRs-fixed: 302916
Change-Id: I7316a65efe2b72c5392a3d2adbb95070662dced9
2011-09-25 17:44:35 -07:00
Linux Build Service Account
3effb52fa7 Merge "Composition Bypass: Bypass composition if we have 2 visible layers." into honeycomb_mr2_release 2011-09-23 23:50:33 -07:00
Saurabh Shah
34aead9cf1 Composition Bypass: Bypass composition if we have 2 visible layers.
Bypass composition if we have 2 visible layers. However, this feature
is not used if:
1) Video playback is on
2) Rotation involved
3) App launch animation
4) HDMI connected

Set property debug.compbypass.enable=1 in build.prop
to enable this feature.

Change-Id: I4c0fa2aa1999c06c51f2b9a58641203316896e53
2011-09-23 19:04:10 -07:00
Omprakash Dhyade
49008be4a3 hardware/msm7k: libgralloc-qsd8k: Remove wait in fb_post and lockBuffer implementation
Since fb_post and dequeueBuffer may be called
from different threads, it might happen
that both wait for available buffer causig
both threads to go in sleep. To solve this
problem we add lockBuffer implementation
and remove waits from fb_post and dequeueBuffer.
This will also be consistent with native window
implementation.

Change-Id: Id5e6e2feac5153156fabd9266b0c1cd5a5681514
2011-09-23 18:37:43 -07:00
Harshad Bhutada
98fc1499db ligralloc-qsd8k: Add debug feature to display FPS
Change-Id: I0fe7e31f6301d5abca3a81dcd4112ffa2ec937df
2011-09-19 19:16:37 -05:00
Naomi Luis
28bb235bc3 libgralloc-qsd8k: Use correct vaddr for clean/invalidate pmem regions
CRs-fixed: 304740
Change-Id: Id72bb9ae874a56be89aec79d23e8d2e79856409d
2011-09-19 19:16:37 -05:00
Kinjal Bhavsar
48f7bb38a7 liboverlay: Add support for 3D panel
Detect and use 3D panel for 3D content. Use the virtual framebuffer
for 3D panel. Set position for overlay channels accordingly. Use
3D ioctl for line interleaving.

Add state machine for Overlay.

Change-Id: I28dc7ed99aed7ca2c53c93722c44279d9c7de9fc

Conflicts:

	liboverlay/overlayLib.cpp
2011-09-19 19:16:37 -05:00
Jeykumar Sankaran
d7add45e8e Fix dynamic composition on framebuffer rotation
This change fixes a bug in detecting fullscreen condition for
dynamic composition.

Change-Id: Ieadaf970061badc1d2f876560c1118fccf3a420a
2011-09-19 19:16:37 -05:00
Chetan Kalyan
4fc65b100d Overlay: Add debug logs to overlay
In case of failure, print out the values of the failed
overlay structure, to allow easy debugging.

Change-Id: I3e480b8eecc66b54f357b29d02064a751c9ebbfa
2011-09-19 19:16:37 -05:00
Arun Kumar K.R
370a5212ce hwcomposer: Inform gralloc about video before prepareOverlay
prepareOverlay will setup the channels for video playback, so
inform gralloc to close UI channels before they are setup.

Change-Id: I757a8fd79661eb66ccbe2ac1475e48740bbf1733
CRs-fixed: 298102
2011-09-19 19:16:37 -05:00
Omprakash Dhyade
6e3e6e0300 liboverlay: Use aligned width/height for source
The source buffers, width/height is aligned. Use
aligned width/height for the source buffer.

CRs-fixed: 285831

Change-Id: I4c367a03fea833674e03fcab5a38217f9f8c5e05
2011-09-19 19:16:37 -05:00
Naomi Luis
e8ded16374 libgralloc-qsd8k: Invalidate the ashmem cache
Invalidate the ashmem cache after allocating an ashmem buffer

Change-Id: Id38a4776a80a9b1d8be7fe6bf00f8b187a3278f6
2011-09-19 19:16:37 -05:00
Jeykumar Sankaran
bfe4f06ee4 libhwcomposer: Add support for dynamic composition switching
This change adds support in HWC to switch between c2d and gpu composition dynamically.

Change-Id: I52effdc3722034cbb0e859e66334ca4769f0d5c6
2011-09-19 19:16:37 -05:00
Arun Kumar K.R
0f0ea07983 liboverlay: Check if the destination values have changed in setPosition
In setPosition, make an ioctl call only when there is a change
in the destination values.

CRs-fixed: 296400
Change-Id: I9b059e226bf6f6cfd04fb563ac765e2583415157
2011-09-19 19:16:37 -05:00
Naomi Luis
61390825ec libhwcomposer: Move the skip composition logic to a separate API
Create a new function to check if we need to skip the composition
during overlay operations.
Reset the previous compCount variable if there is no video layer present.

Change-Id: Ibf570805114440f117f0fb98b5f2d53c1780ec84
CRs-fixed: 298014
2011-09-19 19:16:37 -05:00
Naomi Luis
f75b90721f libgralloc-qsd8k: Check PMEM_ADSP flag
Check the PMEM_ADSP flag during the terminateBuffer and gralloc_unmap
operations.

CRs-fixed: 296807, 298849, 296817
Change-Id: Ia97aca71935ca3c921f53fc88f5b4f918d7434c0
2011-09-19 19:16:37 -05:00
Naseer Ahmed
3de087d0bb gralloc: Clean pmem caches after memset
Change-Id: If403dde70863e0d6ea221f2a105b86bdec134261
2011-09-19 19:16:37 -05:00
Naseer Ahmed
f979fa8589 copybit: Set vertical padding
Change-Id: I86f3fe29c577b06487aedd9f9569075a22c146fc
CRs-fixed: 284384
2011-09-19 19:16:37 -05:00
Laxminath Kasam
47cfb5e50a libaudio-msm8660: FM audio routes to DUT speaker with Alarm sound.
-FM playback with alarm is not behaving as expected as FM Audio
also plays with alarm on speaker.
-With headset,this case working fine.found the tester used
Headphone and the stream mute for FM is not handled in
setoutputdevice function in policy manager.
-Added the Check for headphone also in setoutputdevice
function and mute/unmute happens correctly now for FM
stream when alarm tone comes.

Change-Id: I9e82c3db5fab5c6ccade4f6ec7a49e4d05e0f772
CRs-Fixed: 292948
2011-09-19 19:16:37 -05:00
Naomi Luis
d74d663374 libgralloc-qsd8k: Fallback to ashmem in case of pmem failure
Add a fallback mechanism to allocate memory from ashmem if pmem
allocation fails.
Do not fallback in the following cases:
- MDP composition is being used.
- Client has explicitly requested that the memory be allocated from
pmem.
- Buffer will not be sent to the overlay.

Change-Id: Ic690af48f81914cb4c9a102cb386356797451141
2011-09-19 19:16:36 -05:00
Saurabh Shah
ae67b6bd33 Put HDMI code under compile time flag
Put HDMI code in HWC under compile time flag.
This prevents crashes in use cases like HDMI used as primary.
If not done, non-existing code in gralloc is called in that
use case.

Change-Id: Ic7e792acf0c35eb12f04a74405619385d7288991
2011-09-19 19:16:36 -05:00
Naomi Luis
ea1c22ccde liboverlay: Reset rotation information during updates
When updating the overlay source information, reset the rotation
information as this would be set during the setParameter call.
Also ensure that the HDMI doesn't have any orientation set.

Change-Id: I7a8ae96f27046deeed32f968061cc524d57cbfa3
2011-09-19 19:16:36 -05:00
Chetan Kalyan
a9181ba303 OverlayLib: Set format to non-tiled if rotated
Rotator outputs non-tiled formats. Hence, if there is rotation,
tiled format needs to be set to non-tiled and aligned properly.

Change-Id: I88335ad49c2f7446aa5fa71db80f6051c02bb5ff
CRs-fixed: 290428
2011-09-19 19:16:36 -05:00
Naomi Luis
3ae7f52726 libgralloc-qsd8k: Support for additional gralloc usage flags.
Add support for the GRALLOC_USAGE_EXTERNAL_DISP and the
GRALLOC_USAGE_PROTECTED usage bits. If any of the two usage bits are
set, we need to send the buffers to the overlay.
Since we send the buffers to the overlay, we need to allocate these
buffers from the PMEM region.

(cherry picked from commit 195345cd63f0e19cfee4cf055587d5fffe76d0ef)

Change-Id: I64116b9be07c8ddadbd5a132ef21b19e5326737b
2011-09-19 19:16:36 -05:00
Naomi Luis
7e2db6e3d0 liboverlay: Add YV12 support
Add support in the overlay for the YV12 color format.

(cherry picked from commit 0f9a27cc39b6d4202b54059bc7c64eea9efcf3f1)

Change-Id: I4b57eb383ca8f728243bd7e397696932e26c8889
2011-09-19 19:16:36 -05:00
Naomi Luis
49dbd79cf7 Add overlay_buffer_info structure to hold the buffer geometry
The overlay_buffer_info buffer geometry and size. When calling the
overlay from the gralloc or hardware composer, populate this structure
with the information from the gralloc handle.

(cherry picked from commit 128adc3b8177ef72f2bf21f4022d7ef06ed9281b)

Change-Id: I2f60f691ac01e67f150c753f168be754b14f94e6
2011-09-19 19:16:36 -05:00
Saurabh Shah
cb098e76e8 Handle overlay setup failure
Separate overlay setup and overlay play.
On setup failure, mark the layer to use C2D if enabled.
Else mark the layer to use GPU.

CRs-fixed: 292398
(cherry picked from commit b1459b0b1106ed66810b1c5a09878fae353c123c)

Change-Id: Id4c27384193612ab13e87d18492b0fef662eb8b4
2011-09-19 19:16:36 -05:00
Saurabh Shah
fc966d1448 Remove FPS calculations from userspace.
The FPS is stored in reserved[4] field of fb_var_screeninfo
structure. Read directly from this field.

CRs-fixed: 283750
(cherry picked from commit 0dec3f333db5b58c5ddd9c65fb7fd5c61cc5ef59)

Change-Id: I26632dc489ed8a95502b9071fed5b7527b33e54d
2011-09-19 19:16:36 -05:00
Naomi Luis
1efe8832e9 libgralloc-qsd8k: ashmem changes
- Remove unused GRALLOC_USAGE_PRIVATE_PMEM flag. This flag is no
longer used.
- Flush ashmem region cache instead of Invalidating it.

(cherry picked from commit 12254ff74f5a97dcf5ded90f53e9d6fd0fa47b9c)

Change-Id: I92e4dcd8c89eb9ae0c0484f039d152b7bbb28bbe
2011-09-19 19:16:36 -05:00
Naomi Luis
4066a02c83 libhwcomposer: Honor the HWC_DO_NOT_USE_OVERLAY flag
If SurfaceFlinger marks a layer with the HWC_DO_NOT_USE_OVERLAY
flag, do not use the overlay to draw the layer

(cherry picked from commit 9271a839b6bbbdc7b22bd7f1dca6f4c0c63de965)

Change-Id: Ie44586a1254a2dc2ad41ae902debc5bb442cbfde
2011-09-19 19:16:36 -05:00
Naomi Luis
3a6d435d35 liboverlay: Set the correct FLIP information
Android expects the flip to be done before the rotation. The rotator
however performs the rotate operation first followed by flip operations.
Set the flip information to take this into account.

Change-Id: Ib59a08e72fad522b0cf70c2ac2c434e19683c356
CRs-fixed: 289118
2011-09-19 19:16:36 -05:00
Naomi Luis
07e8ae7fe4 libhwcomposer: Skip composition if there is no UI update
If we have only one overlay layer, and the rest of the layers
are not updating, set the HWC_SKIP_COMPOSITION flag to inform
SurfaceFlinger not to compose anything. Also skip the drawing of
any UI frames and swapping the buffers.

Change-Id: I2f6554c905756a08880cba531c0210a58396179b
CRs-fixed: 289477
2011-09-19 19:16:36 -05:00
Sushil Chauhan
d739bf81ce copybit_c2d.cpp: Return the correct status in open_copybit()
The patch sets the status as COPYBIT_FAILURE in case of an error in
open_copybit() as it needs to return the correct status. It also sets
the copybit device handle as NULL.

Change-Id: I3c35d163049763427ad92030cb1d88d72f7680fb
2011-09-19 19:16:36 -05:00
Omprakash Dhyade
dac6f95b56 liboverlay: comp. bypass changes.
This change addresses following:
1. Add new classes for comp. bypass.
2. Remove comp. bypas specific code from exisiting flow.

Change-Id: Id9424b42a9a113cfbb18ceac8d59bbe07ea8e773
2011-09-19 19:16:36 -05:00
Jeff Boody
9d25efb361 libhwcomposer: return error if Android native buffer is null
Change-Id: I78d35779aa0d15086828ad1cf10ce6ff8b844336
2011-09-19 19:16:36 -05:00
Naomi Luis
42c6d72977 libgralloc-qsd8k: Remove submaps for PmemKernelAllocators
Removing submapping for buffers allocated by the PmemKernelAllocator
This can be done since the restriction on multiple master maps has
been removed from the kernel

Change-Id: Iabe9cdfaa121bbffbfaf6503e037afebf5ac8455
2011-09-19 19:16:36 -05:00
Saurabh Shah
3ce61a332f Set Position for HDMI in setPosition
This is necessary to adjust aspect ratio based on the crop, since
src values are modified in crop.

Change-Id: Icfb20df5b6ac4e93dfa85b73c4f74b738a4d3e59
CRs-fixed: 290069
2011-09-19 19:16:36 -05:00
Saurabh Shah
58c70bc3e5 Fix positioning of small videos.
Small videos (width < 128) have their stride as 128. For HDMI
destination position was set only once, before the actual width was
supplied through crop. Now the position is set during a setPosition
API call.

Change-Id: If49ac23b9294951aaf4ad9d5432653082b4a7802
CRs-fixed: 286953
2011-09-19 19:16:36 -05:00
Naomi Luis
c17c053935 libhwcomposer: Disable alpha if layer blending is disabled
If the layer blending has been disabled, disable copybit alpha so
that copybit does not perform any blend operation.

Change-Id: I9a83fad0f126adaf9540bc72d17e7dcb1c55cd0f
CRs-fixed: 288527
2011-09-19 19:16:36 -05:00
Naomi Luis
371fe1a442 liboverlay: Update overlay and rotator during resolution change
Whenever there is a resolution change, update the overlay, rotator
paramters. Map the rotator memory according to the new size required,
and unmap the previously mapped memory.
Change the size calculation for NV21 formats, since the gralloc
allocates memory which is rounded up to the next 4K.

Change-Id: Idb4037422cbd80083e6ba14f229511a17cb61873
CRs-fixed: 287347
2011-09-19 19:16:36 -05:00
Naomi Luis
c004f71e01 liboverlay: Remove RGB specific checks
liboverlay assumes RGB format comes from UI,
which is incorrect. Remove RGB format checks.

Change-Id: I4d3f69db272b0a229fbd449c9c8863d77e7b0a2f
2011-09-19 19:16:36 -05:00
Naomi Luis
49f32e10cb libhwcomposer: Use layer alpha value
Set the copybit plane alpha equal to the layer alpha value.

Change-Id: Idcb5a23cc5e99061ddd31a3da7bedda2867d579d
CRs-fixed: 288257
2011-09-19 19:16:36 -05:00
Kinjal Bhavsar
1b51063e0d liboverlay: Add TV detection and monoscopic display for S3D
Add the state machine for overlay configuration. When connected,
check whether the TV on HDMI is 3D capable or not using the EDID
info. Show L channel on primary panel; and R channel on 2D TV if
non 3DTV is connected via HDMI, else switch TV to 3D mode.

Change-Id: I3109f8b0b81a8f5ad542db038262fd668e225e96
2011-09-19 19:16:35 -05:00
Naomi Luis
dc7076e724 libgralloc-qsd8k: Modify buffer sizes for NV12, NV21 and YV12 formats
Allocate buffer sizes that are multiples of 4K for the NV21, NV12 and
YV12 formats.

Change-Id: I3febaef9dda2586ef3b35945f30f655e07f5e369
CRs-fixed: 287882
2011-09-19 19:16:35 -05:00
Naomi Luis
7c3d92ed0b libhwcomposer: Handle HDMI disconnect event
- Inform the gralloc of the HDMI status.
- If the HDMI is disconnected, close the overlay and also inform the
gralloc that video mirroring has stopped.

Change-Id: Ie89ffe860c0f9c9142d6c7f5d7a6c555884561ce
CRs-fixed: 286954
2011-09-19 19:16:35 -05:00