Commit Graph

53 Commits

Author SHA1 Message Date
Jeykumar Sankaran
5312f7f48e Display: Add support in libqcomui to check FB update
This change adds support in libqcomui to check if FB is updated
by a composition type

Change-Id: Ic23f24d95166cb9b1a03614f1c0fd562f321a1fd
2011-12-22 21:44:07 -05:00
toastcfh
b67994677f Merge git://codeaurora.org/platform/hardware/qcom/display.git ics into ics and resolve conflicts
Change-Id: I3acb5e963763821d2b547cf3c9390754dc42c12f
2011-12-18 19:45:23 -05:00
Mathew Karimpanal
d120c0dfac libhwcomposer: Mark layers below skip-layers for GPU composition
If module composition type is MDP or C2D and we have a skipped layer
(usually layers without backing buffers, layers with "invalid"
orientations or debug layers), mark every HWC layer below this layer
for GPU composition.
This logic is needed because ICS SF composes a bunch of z-ordered
HWC_FRAMEBUFFER (GPU) layers first and then the remaining bunch of
z-ordered HWC_OVERLAY layers last which breaks the overall z-ordered
layer rendering requirement. This logic also holds valid for 2-layer
bypass in ICS.

Change-Id: I5082affac8affd6b19d78be827d149901945a163
2011-12-15 14:23:41 -07:00
Naomi Luis
8287f5bbcb libhwcomposer: Validate the previous overlay and bypass handles.
Validate the previous overlay and bypass handles before unlocking
the buffers. The reason for doing this, is that in certain use cases,
after the previous handles are stored, the buffer gets destroyed and the
handle is now invalid. The HWC however doesn't know that the handle is
invalid and tries to unlock the handle, resulting in a failure.

CRs-fixed: 323614
Change-Id: I0f0c8506e7e22f9fc01eb28af0270f9c4587c787
2011-12-15 04:35:31 -07:00
Naseer Ahmed
75e2a92af4 hwc: Initialize padding for copybit
Change-Id: I053431caa114fdc9a09584933b10b4d27d34ec74
CRs-fixed: 324785
2011-12-14 16:55:42 +05:30
Naomi Luis
0afa0e42a6 libhwcomposer: Use the HWC private flags from libQcomUI.
Qcom specific private flags have been moved to libQcomUI. Use these
flags flags in the hwcomposer.

Change-Id: I9898dd11a7fff72678fa1f744454fcf310507a63
2011-12-13 11:23:32 -08:00
Naomi Luis
27774b1a66 libhwcomposer: Set the Framebuffer info for copybit composition.
Invoke copybit's set parameter call to set the framebuffer width and
height.

Change-Id: I735772e21b9fead48686fac3371b6b93156ece8a
2011-12-10 16:44:33 -07:00
Naseer Ahmed
c2e6b1f62e display: Use bypass only for contiguous memory
Since composition bypass uses MDP overlays, which
need physically contiguous memory, we cannot use
bypass in cases where the buffers are using ashmem
or other virtual memory. Hence, avoid bypass in
such cases.

Change-Id: I5c6d20e68e15719295373a1b0f3b930536336c43
2011-12-09 14:47:10 -07:00
freexperia
b151a85950 msm: cleanup to compile msm7x30
Change-Id: Ie1ca24c4f08de56a07c8e299ffbb00fc4af85a8a
2011-12-06 07:03:30 +02:00
Sushil Chauhan
f2dbabe786 Bypass: Turn off only after FB content is displayed.
Synchronize turning off of composition bypass with display,
so that close happens only after FB content is displayed.
This fixes blinks observed when bypass needs to be turned off,
for reasons other than video content.

Change-Id: Id98bddd0cb2a89ea8729a188934ae1cd947cf305
2011-12-05 16:52:39 -08:00
Naomi Luis
599d9a41bc libhwcomposer: Unlock buffers if the input params are invalid.
If the input parameters in the prepare and set functions are invalid, unlock
any previously locked buffers.

Change-Id: Ifd3b02c3ae6d2095970d5e15b98196d7fa7dee4e
CRs-fixed: 322054
2011-12-05 14:02:34 -07:00
Naomi Luis
b0e7470e4f libhwcomposer: Lock/unlock bypass buffers using genlock
Use genlock to lock the bypass buffers before they are queued to the
overlay. After all the bypass buffers are queued, use genlock to
unlock the previously locked bypass buffers.

Change-Id: Ifdd7921f0c9f5d5744c899a0257a4b954274334b
2011-12-01 18:25:44 -08:00
Diogo Ferreira
36bbca99c8 display: Set optional module tags instead of eng
Change-Id: I813779637488b11f0f3c1279f0ee3dcb2357b837
2011-11-29 01:52:56 +00:00
Naomi Luis
e2de425bc4 Display: Set WAIT on primary and NO_WAIT on HDMI
When queuing buffers using the overlay:
- Set the NO_WAIT flag for the HDMI channel.
- Set the WAIT flag for the primary channel.
- Queue the buffer on the HDMI first.
- Queue the buffer on the primary.
- Wait for the HDMI Vsync.

Change-Id: Id24e9551230b7a7134bd21a7b3a9e8658f7de222
2011-11-28 16:10:51 -08:00
Naomi Luis
be1b5f3d66 libhwcomposer: Use genlock to lock/unlock buffers for composition.
For copybit composition, aquire a read lock on the buffer, before
the blit operation and release the lock after the blit operation.

For overlay, aquire a read lock on buffer N that is sent to the
overlay. After the play call for buffer N returns, unlock the lock
held by buffer (N-1).

Change-Id: I3ff178d8ed8e3a289c199237dbec501afdb7e717
2011-11-25 16:27:59 +05:30
Naseer Ahmed
229856bedf HWC: Fix for non-overlay targets
Do not call prepareOverlay, instead
use copybit to compose video frames

Change-Id: I5e85b0b65009de37ab792e59d259d8f1879fb0c4
2011-11-23 17:22:36 -07:00
Sushil Chauhan
ef62685ddd Enable Composition Bypass.
1. Enable composition bypass for 1 or 2 non-overlapping layers.
2. Open bypass only if video playback status is CLOSED.
3. Close bypass immediately if Video or Camera needs VG pipe.

Change-Id: I1bef030b32ff2721d00b61f7717027d4d9219d04
2011-11-21 11:36:58 -08:00
Jeykumar Sankaran
4d5323cc6d libhwcomposer: Enable c2d composition in HWC
This change enables c2d composition in HWC by removing the temporary
flag added in the following commit:

    commit 7b814382ad

Change-Id: Ia6705c369090b14f3a00678c4e82078bd6e58847
2011-11-20 21:43:22 -08:00
Prabhanjan Kandula
96dd6a36b9 Display: Overlay HAL changes needed for HDMI
-Add overlay defines needed by framebuffer
-enable compile time flag for HDMI

Change-Id: I5b9a8412c579a3a8cd0e0283dc5fd7e26266c170
2011-11-20 21:42:53 -08:00
Jeykumar Sankaran
7b814382ad libhwcomposer: HWC change to accomodate HAL changes
-- Enable HWC
-- handle overlay as lib rather than HAL
-- move copybit changes under COPYBIT_ENABLE flag (temporary)

Change-Id: I36d8f9688cd7cbd838e288e5f482d8ee5c9b2df6
2011-11-18 02:04:19 -08:00
Naseer Ahmed
dd6a62c9dd hwc: Change Android.mk to point to new display gralloc
Change-Id: Ie7c08fb55339c2c7b7bf2c28576291a5a1e1d809
2011-11-16 12:46:41 -08:00
Saurabh Shah
e62cceadf6 Multi layer composition bypass
Allow 1 or 2 non overlapping layers to use composition bypass.
This is an enhancement to the previous approach which uses
bypass strictly for 2 layers.

Change-Id: I879903db44cb1fddbe3e428ffa77eb67e95e0886
2011-11-04 18:47:51 -07:00
Kinjal Bhavsar
6eb041de80 msm7k: Detect display type and mark layers
Mark layers for convert to S3D when playing S3D content on a 3DTV.

Change-Id: I355a73753682134b8ec5544a03d55ae40793e897
2011-10-25 12:23:11 -07:00
Saurabh Shah
f3353ad328 Bypass: Fix source dimensions
Since the RGB buffer could be 32 aligned, use actual source dimensions.

Change-Id: Ice615e34a304c864cbe8fef044e14e9f835f9359
2011-10-18 13:22:45 -07:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Naomi Luis
c99d13825e libhwcomposer: Enable COPYBIT_PREMULTIPLIED_ALPHA if the layer blending is premutliplied
Change-Id: Iefe0ddeaa20b4411074079bc77ac17cc0e38c27e
2011-09-19 19:16:35 -05:00
Naomi Luis
9c2ba115fd Add support for dynamic resolution change with overlays
Whenever there is a change in the buffer geometry, set a flag in the
gralloc handle stating that the buffer geometry has changed.
In the HWC, whenever we encounter an update in the geometry, if the
channel is already open, we just call the necessary ioctls to update
the overlay information and not unnecessarily open/close channels.

Change-Id: I27db8fc497ebc514e262d6b7854739f312644714
2011-09-19 19:16:35 -05:00
Naomi Luis
56a78ad233 libhwcomposer: Add support for maintaining original resolution
When the layer flags are marked to maintain the original surface
resolution, draw the layer using the overlay.
Store the HDMI status in the overlay object instead of the HWC
context.
2011-09-19 19:16:35 -05:00
Naomi Luis
8818296680 libhwcomposer: Use sanitized kernel headers
(cherry picked from commit 68e70474c2acaf35e42c4656e19d5f35012d0d70)

Change-Id: I8f77453d64f1c2c1e974b96c0727616bf0a8bf87
2011-09-19 19:16:34 -05:00
Naomi Luis
cd8f8d8e84 libhwcomposer: Close the overlay channel after video/camera playback.
Change-Id: I321acdb5ff00d7d70399d044473ef9b5ad9f547e
2011-09-19 19:16:33 -05:00
Naomi Luis
7b7b48531e libhwcomposer: Set the correct copybit parameters
Set the correct parameters for the source and destination rectangles
when drawing the layer using copybit.

Change-Id: I6ab7e2b5ba7b457a5bc604fd3a0031e6bada82cb
2011-09-19 19:16:33 -05:00
Sridhar Parasuram
2a50a0a894 Fix copyright markings
Change-Id: I2170d0dbd9270bcfd38ea2f8c7052ac387b9e0c9
2011-09-19 19:16:33 -05:00
Naomi Luis
ac47ade639 hwcomposer: Add support for C2D/MDP composition
Add support in the HWC to use C2D and MDP composition via the copybit HAL

Change-Id: I19a98d9821600fdfbadcab53329027ef17aa8f1f
2011-09-19 19:16:33 -05:00
Naomi Luis
f59c70eab4 libhwcomposer: Add null checks
SurfaceFlinger calls a hwc_set with a NULL context and
list when it is releasing the HWC. Check the validity
of the pointers before using it.

Change-Id: I5b61cc50a85b9b660646789b2cf9a0f4ee6e4a5c
2011-09-19 19:16:33 -05:00