Commit Graph

141 Commits

Author SHA1 Message Date
Prabhanjan Kandula
21918db5d1 hwc : Add hw limitation checks for MDP compposition.
Add hw limitation checks for MDP composition once
we identify actual layers for MDP. This should be generic
way for all basic hw limitations of underlying MDP/MDSS.
Current limitations:
- a-family : MDP can not handle alpha scaling.
- 8226 & 8974 : Can not handle if multiple layers need
  downscaling and blending

Change-Id: Ia944802d798f2d0e9cd4515d7e9854c7314cac78
CRs-fixed: 538803
2013-12-11 15:41:38 +05:30
Saurabh Shah
c7e4f1d37c hwc: mdpcomp: Remove redundant function to program MDP
The programYUV used for video-only cases is the same as programMDP
function. Remove the redundant function

Change-Id: I1d891404a77b2a47f90c236d4d6dcbbd02143d93
2013-12-09 11:00:21 -08:00
Linux Build Service Account
813d679c84 Merge "hwc: Use GPU Composition for 8x26 virtual dpy scaling case" 2013-12-06 16:32:30 -08:00
Yang Xu
9c1eb2be21 hwc: Use GPU Composition for 8x26 virtual dpy scaling case
For 8x26, if there is only one layer which needs scale for
secondary display, while no scale for primary display, DMA
pipe is occupied by primary. If layer changed and need to
fall back to GLES composition, virtual display lacks DMA
pipe and error is reported.

To avoid this case, use GPU composition for virtual display
scaling case on 8x26.

Change-Id: I42297a18006517532e30d1a01c67ff8ca187482a
2013-12-05 13:55:19 +08:00
Linux Build Service Account
c258d31430 Merge "HWC: Use 2 VG pipes for YUV layer with width > 2048" 2013-12-04 19:31:07 -08:00
Linux Build Service Account
361de1d037 Merge "hwc: Bandwidth check upgrade." 2013-12-04 16:11:49 -08:00
Linux Build Service Account
bff954800a Merge "hwc: Check for downscale support only when needed" 2013-12-02 02:44:04 -08:00
Linux Build Service Account
3b689fb79c Merge "hwc/overlay: Add Color layer support in MDP Composition." 2013-12-02 02:43:48 -08:00
Saurabh Shah
f5f2b137bc hwc: Bandwidth check upgrade.
Use the low and high bandwidth values exported from driver per target
Use the low bandwidth value when the system has at least 1 video
mode panel, else use the high bandwidth value.
Newer targets could have bandwidth exceeding what an uint32 could
hold, so change the bytes read to be in gigs.
Do not use the framebuffer handle to get size, since the handle may
be null.

Change-Id: If3124ddc33334eba80d34ab7d8fc64d1b46697ce
2013-12-01 18:43:58 -08:00
Jeykumar Sankaran
1706a77364 hwc: Check for downscale support only when needed
Check for downscale support only for layers which needs to
be downscaled. Fixes issue where we bail out for all layers having
width more than MAX_LAYER_WIDTH even when they don't need scaling.

Change-Id: I19ee4d69e986390ed3df122b8ca9c0e102f3f916
2013-11-27 12:55:19 -08:00
radhakrishna
c9a6741e15 HWC: Use 2 VG pipes for YUV layer with width > 2048
To minimize usage of decimation when 4K x 2K video is played
on primary, split the yuv layer into 2 halves and configure
each layer to individual VG pipes. With this approach,
decimation can be avoided in some 4K x 2K video use cases,
thereby improving performance.

Change-Id: I7cddfab787c50f6ff132eaa7f5a3d9cfd636c282
2013-11-27 18:35:24 +05:30
Saurabh Shah
b772ae381d hwc: Add GPU-preferred and MDP-preferred modes to load based comp.
GPU's perf is proportional to the number of pixels it processes, so
the load based strategy that prefers GPU, attempts to load it less
in terms of pixels, and at the same time makes sure the MDP has
enough pipes and mixer stages.

MDP's perf is real time and proportional to the instantaneous b/w
which is a function of overlaps. So the load based strategy that
prefers MDP would look at sending only as many full-screen layers
that MDP could support.
This mode is used when the GPU-preferred mode fails.

Change-Id: I3221a94bb01c43112370c248cd4ab217f2bd8ed1
2013-11-22 13:50:45 -08:00
Saurabh Shah
3c1a6b0a16 hwc: Replace bytes claimed with bandwidth claimed.
Bytes claimed doesn't reflect the panel refresh rate.
So use the bandwidth claimed instead which factors this in.

This is important when 2 displays are running at different
refresh rates.

Change-Id: I3ab9573e43b8c25c31e01888fb2b181469b9e91b
2013-11-22 11:10:20 -08:00
Linux Build Service Account
7f2d2e9673 Merge "hwc: Move resource checks to a common function." 2013-11-21 13:55:53 -08:00
Sushil Chauhan
897a9c3ff9 hwc/overlay: Add Color layer support in MDP Composition.
1. Color layer has a destination rectangle, RGBA color and plane
   alpha. There is no gralloc buffer. Layer flag "HWC_COLOR_FILL"
   denotes a Color layer.
2. There is no color member in HWC layer, so RGBA color value
   is passed via the "tranform" member from framework to HAL.

Change-Id: I8769fd3f5febcaf952a1456de0a4262679c9a0e4
2013-11-20 17:04:29 -08:00
Linux Build Service Account
15eeacdcd6 Merge "hwc: Refresh framebuffer when an updating layer is marked for GPU" 2013-11-20 15:29:52 -08:00
Saurabh Shah
173f424d32 hwc: Move resource checks to a common function.
Move resource checks, pipes, stages of mixer, bandwidth to a common
function and use it from all strategies.

Change-Id: I161fc957e2793d543b5943fbd23ae3607a4cfc87
2013-11-20 10:11:12 -08:00
Saurabh Shah
d9ff30b3a5 hwc: Trim out of screen layers once only
Instead of trimming out of screen layer dimensions for various
operations repetitively, trim and store.
Will also prevent accidentally missing out on trimming.

Change-Id: I8800586070ec433aa1fcbb3aad73ec29c9c9111e
2013-11-20 09:27:49 -08:00
Linux Build Service Account
1c8bdc9009 Merge "hwc: Optimize layer drops based on ROI" 2013-11-20 01:01:05 -08:00
Linux Build Service Account
2f1421fb07 Merge "hwc: Change error messages to informative messages in HWC" 2013-11-19 22:04:32 -08:00
Arpita Banerjee
d8965989ec hwc: Change error messages to informative messages in HWC
Few error messages in HWComposer change to as informative
messages.

Change-Id: Iecd2d6c129713363d338ca7aeefbcbc422df893d
2013-11-15 18:49:08 -08:00
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
Jeykumar Sankaran
862d87c4e6 hwc: Optimize layer drops based on ROI
- Iterate layer list to drop layers from composition that
are not going to be visible inside the updating ROI.
 - No ROI when skip layers are present.
 - Reset dropped layer info on full GPU fallback.

Change-Id: Ib544526a8c28ffdd16b5be12f73d57d10d207c39
2013-11-14 15:03:58 -08:00
Jeykumar Sankaran
f42f0d80a4 hwc: Add error check for secure layer handling
When we try MDP composition only for secure layers, bail out if
secure layers are not present. Otherwise partial MDP composition
succeeds with all layers marked for FRAMEBUFFER.

Change-Id: I3f968835951320bb6c5873ba77fedef8a359b7bf
2013-11-14 15:03:55 -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