Commit Graph

118 Commits

Author SHA1 Message Date
Jeykumar Sankaran
988d368b64 hwc: Refresh framebuffer when an updating layer is marked for GPU
When MDP cannot handle an updating layer and we marked it for GPU,
make sure framebuffer is refreshed for that frame. In the current design,
only video layers fall into these catches. But we may need
this change for future composition strategies.

Change-Id: I1d6a92da13feef4b353fa5e196d42f91148412e5
CRs-Fixed: 575340
2013-11-15 15:39:14 -08:00
Arun Kumar K.R
91090c7487 hwc: use sourceCropF instead of sourceCrop from hwc_layer_t
- Always use sourceCropF instead of sourceCrop.
- Change it to sourceCropF at places where sourceCrop
  used
Change-Id: Ia64050a41a174f3f038c9b88d527d70c2240f2d9
2013-11-11 16:31:12 -08:00
Naseer Ahmed
e77f80877e hwc: Do not punt secure layers for non integral crops
GPU cannot handle secure layers so a black screen is seen when we
punt secure layers with non integral source crops.

Bug:11156948
Change-Id: Ie19c631aab55dc8e7c1ad5e1f42162e833f49222
2013-11-08 15:23:44 -08:00
Naseer Ahmed
e850a8008c hwc: Punt layers with non integral source crop
The MDP driver cannot handle such layers right now. Investigate
doing this with pixel phase in the future.

Change-Id: Iabbdd0285234160770ae5a799b07a5b912e5fde3
(cherry picked from commit e6aff6414ba478312d9d4af21ab63d586594009f)
2013-11-08 15:23:22 -08:00
Saurabh Shah
62e1d731cd hwc: Bump up version to 1.3
Increment hwc version to 1.3.
Create and use a converter from float source crop to integers.

Change-Id: I5e185195c975b3a9434c5d9dce9ae4757ff98739
(cherry picked from commit 7e5637c850bcdbe21784ca3bfa9668870306adff)
2013-11-08 15:17:33 -08:00
Linux Build Service Account
d199586a7b Merge "hwcomposer : Fix cache redraw logic of MDP composition." 2013-10-30 20:57:47 -07:00
Prabhanjan Kandula
2243aa6dd9 hwcomposer : Fix cache redraw logic of MDP composition.
Redraw the cache if current frame cache/drop  data doesn't
match with cached frame data. Frame buffer z-order, fbcount
and mdp count are not reliable. With same fbz, fbcount and
mdpcount it is possible that layers in previous cached
frame are not part of current frame fb cache.

Change-Id: I858228dc1a3a8ab8673ab8d294e54fdbf43cc1ad
2013-10-29 01:00:20 +05:30
Saurabh Shah
8028e3b853 hwc: Add load based partial mdp comp
Add support for load based partial mdp comp.
This is used on geometry changes where a redraw is unavoidable.
We select a batch of layers, that has minimum pixels for FB comp,
the rest go to MDP.

Conflicts:
	libhwcomposer/hwc_utils.cpp
	libhwcomposer/hwc_utils.h

Change-Id: Ifc5eeb4785c75c37de97a2bb89ca81409d324691
2013-10-24 14:34:56 -07:00
Prabhanjan Kandula
9bd5f64b2b libhwcomposer: Enhance mixed mode composition.
While marking layers for cache, neglect the z-order when
possible, to improve the scope of mixed mode usage.
It is safe to neglect the z-order if a static layer
doesn't have any overlapping region with updating layers
in between static layer & contiguous static layers batch.
- if above layer doesn't have any overlapping with updating
  layer in middle, push it to the batch.
- If above case fails, but layers below(existing batch) does not
  have any overlapping region with the updating layer, bring the
  batch to top and modify fb-zorder accordingly.

Change-Id: I4882a750d0a9a2e11272fcbb146202160673d04f
2013-10-14 23:49:42 +05:30
Ramkumar Radhakrishnan
ba713389c2 hwc: Add support for Secure display
- Identify secure display layer in the hwc_list
- Need to set both SECURE_OVERLAY and SECURE_DISPLAY flags for the secure
  display layer
- Disable idle timeout for secure display usecase, as GPU should not be
  accessing secure display layer

Change-Id: I555910db77c466b5e103b24b4f0ec7f47bb210a5
2013-10-08 16:03:24 -07:00
Jeykumar Sankaran
6a9bb9ebd0 libhwcomposer: MDP partial frame update
This change adds support in HWC for MDP partial update applicable
only for command mode panels. Presence of MDP FB (GRAM) in
command mode panels allows MDP clients to update only the updating region
of the frame as rest of the frame will be cached in the GRAM.

HWC calculates the updating region of a frame (ROI) by deducing
outer bounds of its updating layer destinations. Layers not lying
within the calculated ROI will be dropped from the composition
since its illegal to program MDP pipes for non participating layers.

Change-Id: I890d98ff7960fe888787981803cac62f68471201
2013-10-04 23:34:51 -07:00
Linux Build Service Account
d214b2c843 Merge "hwc: prevent bandwidth calculation in GPU fall-back case" 2013-10-03 12:45:33 -07:00
Tatenda Chipeperekwa
835337abd5 hwc: prevent bandwidth calculation in GPU fall-back case
In prepare, we check if MDP can handle the number of layers
    given to it. If it cannot, we fall-back. Additionally, we must
    not proceed with any MDP bytes calculations otherwise we will
    see out of bounds errors.

Change-Id: Ifae45aefbc8732a7f21f5652758ece3a7639be9a
2013-10-02 15:12:40 -07:00
Saurabh Shah
e9bc60f1b2 hwc: Include more cases in partial MDP composition.
When MDP cannot support a layer, we send the whole list of layers to
GPU. If such layers are not updating they can be cached on FB while
allowing the rest to take the MDP route.

Example # 1: Volume bar on video in 90 rotated mode. Since volume bar
is not h/w accelerated, there is no prerotation and we invoke the GPU
for redraws each round. With this change we won't because of caching.

Example # 2: If prerotation is applied to layers on primary, the
secondary layers would show a transform and the whole list is redrawn
with GPU. Now we could make use of caching.

This change also imposes a 1 layer limit on secondary, but now allows
full and partial MDP comp, thus benefiting secondary-only content.

Change-Id: I7eb43ba817f1081f317fefa99fa0c507344060e8
2013-10-01 17:27:37 -07:00
Saurabh Shah
9078916951 hwc: Use ib instead of ab for bandwidth checks
The ab (average bandwidth) is just the average and there could be
underruns when ib (instantaneous bandwidth) is attempted to be used.
Add additional factor to use ib instead of ab. This means we need to
assume that all the layer contents could be requested together, rather
than one after another.

Also use the trimmed layer dimensions for calculations.

Change-Id: I771f964e1c80b5db564faa01cdfb75d75b54f97a
2013-09-16 13:25:39 -07:00
Saurabh Shah
90b7b9ba27 hwc: Handle multiple videos with priority to secure
In video handling this patch makes sure:
1) Sufficient VG pipes are available, not just any pipes
2) If VG pipes are insufficient in multi-video scenarios
    preference is given to secure videos

Change-Id: I170592463a1c28348108a1b12d60908cf3063d7d
2013-09-16 13:23:01 -07:00
Linux Build Service Account
d74361da20 Merge "hwc: Verify handle is not NULL in bytes read calculation" 2013-09-16 02:21:37 -07:00
Linux Build Service Account
62fcf27d7e Merge "hwc: Add needsScalingWithSplit for high resolution display." 2013-09-13 20:31:41 -07:00
Saurabh Shah
082468e8da hwc: mdpcomp: split: Count total pipes needed per display also
When checking for pipes needed for each mixer, the pipes completely
unused are counted twice.
Add a per display check on top of per mixer check to make sure this
is taken care of.

For example: Each mixer needs 4 pipes, and total completely unused
pipes are 6. Each mixer will get 6 as available pipes, which is ok
at a mixer level, but at a display level 8 pipes are needed and 6
available. Need to account for that

Change-Id: I9811255aab96c7fe47331f8aa125fef2a4a2f704
2013-09-12 17:19:45 -07:00
Linux Build Service Account
ad2b2c5c52 Merge "hwcomposer: Deprecate setupBasePipe" 2013-09-11 11:52:43 -07:00
Terence Hampson
9cd5fa91ef hwc: Verify handle is not NULL in bytes read calculation
When calculating bytes read, avoid dereferencing null pointer.

Change-Id: Ibebc6ad583ceaebf8268266f968beffdb421c958
2013-09-10 18:27:39 -04:00
Sushil Chauhan
15a2ea6e2e hwc: Add needsScalingWithSplit for high resolution display.
- needsScaling does not check for scaling required in left & right
  mixers when the crop values are sanitized. So it leads to issue
  if DMA pipes are picked-up as high resolution layer does not need
  scaling but left or right mixer configuration needs scaling after
  the split.
- needsScalingWithSplit takes care of this with checking for the
  sanitized cropped values.

Change-Id: I1f5b1952a59a84f5ccbaef123251b3c8cd46e4dd
2013-09-10 11:49:53 -07:00
Jeykumar Sankaran
741d13e1fd libhwcomposer: Don't reset cached layer handle on MDP comp
Layer handle values will always be stored irrespective of the
composition type. Layer caching will choose a layer for FB
composition if its handle has not changed.

Change-Id: Ibc41a8cd6232c0c5c04efee01b38513a2431f4e1
2013-09-07 01:01:58 -07:00
Saurabh Shah
c4f1fa691c hwc: Writeback for ad is needed only for split displays.
Writeback for assertive display feature is needed only for
split displays and only if ro.qcom.ad is set to 2 by OEM.
This patch removes the unnecessary code and adds the relevant
conditional checks for split displays and property value

Change-Id: Ic36f28441d1a6e93132316b33fe1cf98a6e1efe4
2013-09-05 09:40:19 -07:00
Saurabh Shah
88e4d277ad hwc: Add API to find if a display is split
A display could be split if its dimensions exceed 2048 or in case
of primary if we make it so via device tree property.

Add an API to find if a display is split. Use this API instead of
going through a set of conditions in various use cases.
Rename the HighRes, LowRes objects to a more appropriate Split and
NonSplit respectively

Change-Id: Id847c2bf36ea9250e1cdbc0259fdec64bd124537
2013-09-05 09:40:14 -07:00
Saurabh Shah
8c5c852c86 hwc: Add support for bandwidth check
Add support for checking whether the current frame's required
bandwidth can be handled by MDP.

The max limit is configurable via a property and the value is
derived from simulation runs and profiling

Conflicts:
	libhwcomposer/hwc_mdpcomp.cpp

Change-Id: I46b46c346973fcb6487a8a656268171470ce69b9
2013-09-03 15:00:55 -07:00
Saurabh Shah
6be7c78da9 hwc: mdpcomp: Make all pipes available if a frame fails
Make all pipes in overlay available, if programming a frame (list)
fails. The failure could be due to commit failure, in which case the
overlay itself will make pipes available.

The failure can also be owing to lack of pipes, since we don't allow
switching pipes across mixers any more. This is particularly a problem
for split-panels. This fix addresses this latter case.

Change-Id: Ieac7ae7d03e5b9a93c7245fa160c8933593c2e09
2013-08-28 15:13:52 -07:00
Linux Build Service Account
bd02a96759 Merge "libhwcomposer: Add check for MDP comp dump" 2013-08-27 18:07:23 -07:00
Amara Venkata Mastan Manoj Kumar
9d373c0b7e hwc: Add check for block mode for rotated video
Do not allow video if it requires pre-rotation and DMA pipe
  is configured in LINE mode. Fall back to GPU in this usecase.
  This is not applicable for wfd on 8x26 since Driver supports
  both multiplexing of DMA pipe in LINE and BLOCK mode as same
  mixer control block is used for rotation and writeback mode.

Change-Id: I5b99b214619134b1bd67f3c441b14f76051e3d3b
2013-08-26 13:54:15 -07:00
Jeykumar Sankaran
3c6bb043bb libhwcomposer: Add check for MDP comp dump
Avoid mdpcomp dump for frames having layers more than
MAX_NUM_APP_LAYERS, since our HAL doesn't support it.

Change-Id: I96365b4cbdeef2c00524eeb53877ee568ba0c172
2013-08-26 13:10:23 -07:00
Linux Build Service Account
dd07a6ffce Merge "hwc: Fix locking." 2013-08-23 17:32:54 -07:00
Saurabh Shah
b39f8151ab hwc: Fix locking.
Remove the unnecessary blank lock, mdp comp lock, secure lock.
Rename the ext lock to a more appropriate draw lock.

The mdp comp lock is at an incorrect place and causes unwanted
objects to show up in dumpsys, since configDone hasnt cleaned
them up yet.

dump(), blank(), draw() should all acquire a common lock.
draw() includes prepare() and set().

Change-Id: I595547dd5a393a8af6cd8c9297d50793b715e658
2013-08-22 13:15:57 -07:00
Naseer Ahmed
dc61a97792 hwc: Handle video with plane alpha properly
An earlier patch disabled plane alpha completely for video.
Instead, do this only when we are in video only mode.

Change-Id: I2edc8c5ff5c90ec205b63175e5f3a4e6ff7eae69
2013-08-20 15:46:55 -07:00
Linux Build Service Account
a1af059bba Merge "hwc: Disable idle invalidation for command mode panels" 2013-08-16 17:12:11 -07:00
Jeykumar Sankaran
d3e13291f1 hwcomposer: Deprecate setupBasePipe
Needed only for A family targets where MDP boots up with
RGB pipe attached to the base.

Change-Id: I5118b8b41e4f864f8c73a115398b13bffa1f3383
2013-08-15 13:51:11 -07:00
Naseer Ahmed
f40f2c88d5 hwc: Disable idle invalidation for command mode panels
Command mode panels have an internal framebuffer with which they
refresh, hence the idle invalidator isn't needed for them.

Change-Id: I6acf0cc1f8c520cbcf706f109a42e47304c534d3
2013-08-14 17:16:00 -04:00
Jeykumar Sankaran
27dee264f7 display: External display refactor
- cleans up external library
- add separate library for virtual display
- process virtual updates in its separate path
  in hwc.
- Acquire blank mutex lock for one complete drawing
  cycle

Change-Id: Ib984c578464a131ecdb27ee48960f58d68b7a5a7
2013-08-14 13:19:37 -07:00
Linux Build Service Account
1e67338868 Merge "hwc: Add assertive display support." 2013-08-14 01:08:09 -07:00
Saurabh Shah
a9da08f5af hwc: Add assertive display support.
Add assertive display support to hwc. This feature takes effect when
node /sys/class/graphics/fb*/ad is present. This signifies that that LM0
is being used with fb* for writeback.

When a video playback begins we write "1" to this node to indicate to
post processing that a writeback will happen. Likewise a "0" is written
to this node when playback stops.

The original contents are worked upon and the modified output is fed
via writeback to either rotator or mdp as appropriate.

The feature doesnt trigger when either:
1) Buffer size exceeds 2048
2) External display is connected
3) Multiple yuv streams are present

When this mode is active, MDP comp is applied only to yuv layer.

Change-Id: If5520f9dc849de3189c9f9ed4e9072c8f8f760e1
2013-08-07 17:57:09 -07:00
Saurabh Shah
07a8ca82c8 hwc: split display: Fix left split default value if not published
If the left split is not published by the driver then the default should
be even split. This was missing from the configuration in utils. This is
already taken care of in framebuffer configuration and mdp composition.

Change-Id: I3db44481fd791809146752ddff56420dcbe89fb4
2013-08-07 10:14:52 -07:00
Saurabh Shah
af5f5971d4 hwc/overlay: Prevent pipes from switching mixers
For split displays, earlier we allowed pipes to switch mixers in
subsequent rounds. This change prevents that and makes sure there
is one composition round where a pipe being transferred to another
mixer of the same display is UNSET

Change-Id: I3c679cc4256363eeb70c5cf8bcaf5047b8a064c2
2013-08-01 11:07:32 -07:00
Saurabh Shah
2a4eb1b965 hwc: Configure framebuffer before other layers.
If framebuffer needs to be configured, configure it before all the
other layers in mdp composition. This helps in cases where we are
out of SMPs and framebuffer configuration fails owing to that.
Framebuffer being the fallback path, should always get highest
priority when reserving SMP blocks

Change-Id: Ie7a6903d1b9fb98b308689c81522571449bf2e8e
2013-07-25 15:17:15 -07:00
Linux Build Service Account
71ffc954f3 Merge "hwc: Add setting to disable idleinvalidator" 2013-07-24 00:04:43 -07:00
Zohaib Alam
d974324e4a hwc: Add setting to disable idleinvalidator
Added the ability to disable idleInvalidator when the
debug.mdpcomp.idletime property is set to "-1". The hwc test app
displays image on the screen with surface flinger turned off.
This causes timeout, so this change is to allow the testapp to
disable the timeout functionality by setting property.

Change-Id: I1adf28eea33ea73f3695644bec95056d16bd85f8
2013-07-19 16:50:28 -04:00
Prabhanjan Kandula
25469a5548 hwcomposer: Fix a deadlock with debug enabled.
If debug property for MDP composition is enabled,
we call dump function from composition thread.
Make sure we are not holding the MDP composition
lock before calling dump function as this also tries
to acquire the same lock and causes a dead lock.

Change-Id: I05e5fd58be096f1ab683d796cc1beb4972c2168f
2013-07-19 17:25:54 +05:30
Prabhanjan Kandula
08222fc6f4 hwcomposer: Fix a crash with MDP composition.
Reset the current frame data before returning from MDP
composition prepare to avoid accessing previous frame data
in MDP composition draw phase. Avoid the number of app layers
going beyond the layer count limit in MDP composition.

Change-Id: I2a3035ad5cb1731060b9359ccdbe9fe0c07e843c
CRs-fixed: 510683
2013-07-15 11:21:16 +05:30
Linux Build Service Account
ca5ff0b7fa Merge "hwc : Fix crash during dumpsys" 2013-07-08 17:21:18 -07:00
Prabhanjan Kandula
088bd89d64 hwc : Fix crash during dumpsys
Dumpsys runs in different thread not in composition thread.
Accessing mdp composition frame info in dumpsys with out
synchronizing could cause crash since frame info can get reset
in composition thread.

CRs-fixed: 503268

Change-Id: If3f7d8cc9fce8b14622e666fa52583ff0cfdedd2
2013-07-03 00:09:38 +05:30
Saurabh Shah
67a38c3565 hwc: Add support for uneven split primary displays
Add support for unevenly split primary displays.
The driver provides info about the split via msm_fb_split sysfs node

For external we assume even split. If driver doesn't specify any split
for primary, we default to even split.

Change-Id: I4d541f41de2d7a5d2b62653fa33cab079a6d5d30
2013-07-01 14:55:06 -07:00
Linux Build Service Account
600db11c58 Merge "hwcomposer: 8x26-1080p: dont allow mdp comp with HFLIP." 2013-06-24 21:23:15 -07:00