Commit Graph

149 Commits

Author SHA1 Message Date
Tatenda Chipeperekwa
8b1920d85b overlay: Add API for WB clients to set secure flag for a session
Add API to set the secure flag on the WB interface, making the WB session
seccure. This is required for use cases such as secure playback when
AD is enabled.

Change-Id: Ifd6cb16f257e8eb27541e524905456c04cf06c3b
2013-11-08 12:42:49 -08:00
Linux Build Service Account
bc8bee68dc Merge "overlay: maintain client requested size and aligned buffer size" 2013-11-06 10:41:33 -08:00
Linux Build Service Account
6706b36560 Merge "overlay: writeback: Do not create writeback instance on dumpsys" 2013-11-05 10:29:03 -08:00
Saurabh Shah
2b6e51951f hwc: Set DMA mode to LINE after UNSET, commit of BLOCK session
Set DMA mode to LINE only after we UNSET and commit the sessions
in BLOCK mode from previous rounds.
Currently, it is incorrectly set to LINE always at the beginning
of a draw cycle.
Now we set it to LINE only at the end of a draw cycle if no rotator
sessions are active.

Change-Id: I6e2351d214d01764eced0673b639f709fbd193c3
2013-11-04 10:10:06 -08:00
Tatenda Chipeperekwa
59e467ea77 overlay: maintain client requested size and aligned buffer size
When a client makes a request for memory to overlay we need to
keep track of the size distinctly. This is required for secure
playback use cases in which we internally calculate the aligned
buffer size. The decision to reallocate memory should always be
based on the original size requested by the client and not our
internally calculated aligned buffer size.

Change-Id: I731560be7dba27264d00fdcb1a12622d604ce0fb
2013-11-01 10:24:56 -07:00
Saurabh Shah
7c8d34fbcc overlay: writeback: Do not create writeback instance on dumpsys
Do not create a writeback instance during dumpsys.
Instead use the dumpsys to return empty if no instance exists.
This fixes the issue where
a) Unnecessary instance is created.
b) Dumpsys has garbage, if a valid instance didn't exist

Change-Id: Ic8ea5ddd8d05203234da7c7dfccd2c2b497e62f7
2013-10-31 10:17:36 -07:00
Saurabh Shah
7ef9ec9011 overlay: writeback: Add dumpsys info
Add dumpsys information from writeback data structure.
Remove some unused fields, formatting to save space.

Change-Id: I808ce67aae16e27c3aa6d6db45983929b1386b69
2013-10-29 10:59:32 -07:00
Tatenda Chipeperekwa
1c41212071 liboverlay: explicitly set alignment to 1M for secure buffers
On systems that do not have a Contiguous Memory Allocator (CMA) it is
the responsibily of the client to specify the required address alignment.

Additionally, we centralize size alignment to so that overlay clients
do not need to take of this.

Change-Id: Id6cec19bf59826fca2617c856bb62968790bf71c
2013-10-24 12:20:32 -07:00
Sushil Chauhan
1f6d68fce6 hwc/copybit: Handle "R/B swap" for RGBA and RGBX color formats.
1.Framework notifies HAL with "HWC_FORMAT_RB_SWAP" layer flag to handle
a limitation where R and B components were swapped in Rendering phase.
2.Add "R/B swap" in hwc query to enable framework to query for support
in display HAL, at run-time.

Change-Id: I3b44d15b51b4f24939048fee9d1bac2b9009c97c
2013-10-18 13:58:16 -07:00
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
d55992da01 Merge "display: Add support for interleaved YUY2 and YUYV format." 2013-09-27 15:17:38 -07:00
Ramkumar Radhakrishnan
b52399cfa0 display: Add support for interleaved YUY2 and YUYV format.
Adding support for interleaved HAL_PIXEL_FORMAT_YCbCr_422_I and
HAL_PIXEL_FORMAT_YCrCb_422_I format in display HAL.

Change-Id: Ib87d9bf481c20bf6a92293dd04746719b1d928c1
2013-09-19 11:10:45 -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
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
74371685ed Merge "hwc: Enable sync-pt for rotator on B-family" 2013-09-11 18:53:52 -07:00
Saurabh Shah
c97e7bc08a overlay: writeback: Add API to set output format, get writeback FB fd
Add support for setting writeback output format.
Modify the getter to query the driver for output format
if not already done.
Add API to retrieve writeback fb node's fd.

Change-Id: I4a3681b6501c41a094e4cd840591b707b4d7ed66
2013-09-06 09:55:44 -07:00
Saurabh Shah
885e144dbd overlay: writeback: Align secure allocations to 1M
In the writeback path, when memory is allocated and managed by
writeback, make sure the input size is aligned to 1M if the
request is for a secure allocation

Change-Id: Ia10f1b6811b81f075b221e0fa025447a77a1e02c
2013-09-06 09:55:33 -07:00
Saurabh Shah
d9e426d694 hwc: Split display: Correct source crops split, enable overfetch
For split source crop of YUV ensure that Left and Width
(thus Right) of each crop is even.

For split source crop of RGB and YUV ensure that Crops have
no gaps (i.e right of left-crop = left of right-crop)

Enable overfetch of pixels in the center, for split layers,
to get a smooth upscale

Change-Id: I8e4a91b637c840f75742580645c6468b5769432d
2013-09-05 09:40:09 -07:00
Saurabh Shah
e9b5a8f04d hwc: Enable sync-pt for rotator on B-family
Enable sync-pt for rotator on B-family. The already existing
MSMFB_BUF_SYNC ioctl is used, with an extra member for session_id
from rotator.

Change-Id: Ib0ef6b1bc5cf1e6437090a217d7f731a3440f84b
2013-09-03 10:07:43 -07:00
Linux Build Service Account
397ef2c86c Merge "overlay: Remove optimization that prevents garbage collection" 2013-08-27 12:58:36 -07:00
Linux Build Service Account
ca1df94a02 Merge "overlay: Map NV12 encodeable to venus format" 2013-08-27 06:55:02 -07:00
Saurabh Shah
3a23a9d09e overlay: Remove optimization that prevents garbage collection
There is an optimization to not do garbage collection (and thus UNSET)
if pipe usage hasn't change, added during older chip time frames.
It worked then because, continuous overlay failures were not normal,
and on failure userspace didn't UNSET remaining pipes.

On newer chips, owing to bandwidth limitations, continuous overlay
failures could happen, plus now we UNSET all other pipes. Thus each
round if GPU gets used, the optimization infers that pipe usage hasn't
changed and does not UNSET pipes.

Also the optimization doesn't do anything useful than saving a few
loops, but is suicidal in current situations, so can safely be done
away with.

Change-Id: I33bd64a599d8ade337707301188c94cf8e6aac81
2013-08-23 17:30:47 -07:00
Naseer Ahmed
8f8cb8a35e overlay: Map NV12 encodeable to venus format
The NV12 encodeable format is set for wifi displays but isn't
mapped to any MDP format. On B-Family targets the format is
equivalent to the venus yuv format.

Change-Id: I75e20c079e4b2e21decc39c29d9ed25953276df9
2013-08-22 15:34:30 -04:00
Saurabh Shah
784e98575f hwc/overlay: Force pipe config if list geometry changes
Force pipes of a display, whose geometry has changed, to pass
configuration arguments using MSMFB_SET_IOCTL. This helps the driver
make additive bandwidth calculations and reject the frame if the
requirements go beyond what the hardware can support.

This change still preserves the optmization to avoid ioctl calls, in
cases where pipe params are the same but makes an exception when
list geometry changes.

Change-Id: I909d35b2a8c33059b34b65943ccbbc08650461db
2013-08-22 02:24:13 -07:00
Naseer Ahmed
522ce66a3e hwc: Add support for plane alpha
HWC 1.2 API passes down the plane alpha and the blending
operation to apply. Pass this information to the MDP.

Change-Id: I7fbd17345d9157aa654e4b1031ac3e26adf87f37
2013-08-20 15:40:42 -07: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
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
Linux Build Service Account
20216bd11c Merge "hwc/overlay: Prevent pipes from switching mixers" 2013-08-02 15:19:02 -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
Sushil Chauhan
466766faed overlay: Fix compressed output buffer size for MDSS Rotator.
Compressed output buffer size calculation for MDSS Rotator needs to
be performed according to destination rectangle (rotated src rect)
due to alignment requirements (like non-BWC calculation).

Change-Id: I6a232d77ca5fce42a1cc3e7f406c9cc4d46553ed
2013-07-31 16:40:54 -07:00
Linux Build Service Account
3ed90c29e4 Merge "overlay: Fix crash due to small debug buffer size" 2013-07-18 21:52:16 -07:00
Linux Build Service Account
b92cdfe40e Merge "overlay: Add writeback support" 2013-07-18 04:47:58 -07:00
Saurabh Shah
9dc88fc5f0 overlay: Fix crash due to small debug buffer size
The debug buffer size is insufficient for newer targets with multiple
pipes. The code causing crash is enabled only if the PIPE_DEBUG macro
is enabled during local debugging.

We now increase the buffer size and also put some string operations under
the macro check for efficiency.

Change-Id: I4ad418d314fd8c7d374ccfdb0943dde44d968922
2013-07-15 16:02:30 -07:00
Linux Build Service Account
5c851b5e42 Merge "liboverlay: Allocate cached rotator buffers" 2013-07-12 17:20:18 -07:00
Linux Build Service Account
9e068d1afe Merge "overlay: Update rotator buffer size calculation for BWC." 2013-07-12 11:57:32 -07:00
Saurabh Shah
c8118acd59 overlay: Add writeback support
Add explicit writeback display type, writeback ioctls, memory mgmt,
writeback class, writeback obj manager class to overlay.

Change-Id: I171e60cea5ed8f6649859e3eb189df37b39962f1
2013-07-11 17:57:53 -07:00
Sushil Chauhan
3bdf9e5e09 overlay: Update rotator buffer size calculation for BWC.
For BWC, update the rotator buffer size calculation in display HAL
as MDSS driver needs to allocate for both chroma (U & V) planes.

Change-Id: I140be2b0a38d6cd66e2ee1b3c9a8bb06efd96bfe
2013-07-08 18:34:35 -07:00
Linux Build Service Account
86743b9ab8 Merge "liboverlay: remove the unused rotator object" 2013-07-08 17:22:40 -07:00
Saurabh Shah
23a813c1ab hwc: Sync for rotator
Implement sync for rotator.
If a buffer is rotated, it can be used by producer soon after
rotation (and it wont have to wait until vsync).

Mdp waits for the rotator buffer's release fence to signal
to start display.

Hwc waits for previous access to rotator buffer by MDP to finish
before using it

Change-Id: I5664806a17c44d58af62a2825ce454089fcd31cf
2013-07-03 19:54:22 -07:00
Xiaoming Zhou
912842ae42 liboverlay: remove the unused rotator object
The rotator object in the generic pipe is never used.
Remove this unused object along with other rotator
related member variables.

Change-Id: I66d60e14565cab730228c3116e67e5c619296284
2013-07-03 14:45:15 -04:00
Arun Kumar K.R
524f0f5cb9 liboverlay: Allocate cached rotator buffers
- gralloc does not invalidate and clean the cached buffers.
- Using cached buffers for rotator does not add any benefit as
  rotator doesn't touch the L2 cache. Since no one accesses the
  memory but the rotator and mdp, so make rotator buffers uncached

Change-Id: I3dc3c91afb2fc07b7473662323339aac1cea3d73
2013-07-02 12:59:53 -07:00
Sushil Chauhan
35fc68bb08 overlay: MDSS cannot handle 1-pixel downscaling for UI layer.
As MDSS cannot handle 1-pixel downscaling for UI layer, decrease
src crop by 1 pixel in such cases.

Change-Id: Ifc1f3a8e416c48db4b09d2ab0838927952e263ed
2013-06-19 16:28:48 -07:00
Arun Kumar K.R
e1ffd3e0db liboverlay: define log2f only for jb_mr1
We only need this defined for JB MR1 as other builds may have it
defined in math.h

Change-Id: I6fbf3338bad63baa9dba3c7e135853bdce909930
2013-06-18 15:07:36 -07:00
Linux Build Service Account
88cd5ed8e6 Merge "hwc: Add BWC policy manager" 2013-06-01 06:06:56 -07:00
Linux Build Service Account
b2a40a4ce3 Merge "hwc/overlay: MDSS driver requires 4-aligned crop.h for interlaced" 2013-05-30 12:07:27 -07:00
Saurabh Shah
1a03d484e0 hwc: Add BWC policy manager
Add a BWC policy manager that decides if BWC needs to be disabled on
certain conditions.
These conditions are statically determined. BWC might get used and
still fail (or cause failure of subsequent pipe requests) if SMP
blocks are not sufficient.

Change-Id: I805738911a8da7dfc6232c133c74ef844c3af5b1
2013-05-29 13:44:20 -07:00
Sushil Chauhan
5491c8ade9 hwc/overlay: MDSS driver requires 4-aligned crop.h for interlaced
MDSS driver requires the crop height to be multiple of 4 to
de-interlace the interlaced Yuv content.

CRs-Fixed: 491488
Change-Id: I9a95392a71cca217e2890c9736f1450fd8aa4a59
2013-05-24 10:23:55 -07:00
Saurabh Shah
df0be75f63 overlay: Reset pipes on config failure
There can be frequent failures in pipe config on certain targets
owing to scare SMP blocks. In such cases, reset usage of all pipes;
forcibly configure them next time, even if params haven't changed;

Change-Id: I769513fc3513e292d9d9b7f126735841a7a8f493
2013-05-23 16:46:53 -07:00
Linux Build Service Account
b27da8ff97 Merge "hwc/overlay: If configRotator fails, mark all pipes as available." 2013-05-17 04:15:21 -07:00