Commit Graph

33 Commits

Author SHA1 Message Date
Raj Kamal
bd3bdc6d03 hwc/overlay: Implement rotator caching
* A non-updating layer requiring rotation, can make use of
the older rotator buffer written when the layer got first
updated, rather than invoking a new rotator cycle.

* A rotator play is avoided in cases where incoming layer
buffer fd, offset, whf, src-rect, dst-rect, etc are similar
to that of the previous input layer to the rotator.

* For ex: In a usecase where video layer updates happen at
30fps and all other asynchrous UI updates happen at 60fps,
instead of the traditional 60 calls of rotator play per sec,
we now do only 30 thereby saving rotator bandwidth.

* Property "debug.rotcache.disable" can be used to disable
this feature.

Change-Id: I1d1c352c63007b7e0b4fee40882086ccd2f5a4aa
2014-08-13 01:31:49 -07:00
Saurabh Shah
c46cf9d26b overlay: Add support for rotator downscale
Add support for rotator downscale. This is enabled from 8994 onwards
Constraints:
--Downscale should be a power of 2, max upto 32
--Both directions should have equal downscale
--{src_w, src_h} mod downscale = 0
--No BWC
--No Interlaced video support

The rotator's destination rect is modified to reflect the presence of
downscale. Any downscale calcs should be done only after adjusting
crop to meet rotator's requirements.

Smaller downscale is used if we need to chop off any more than 1
line or pixel.

Change-Id: Id07d62fefa3213035f16cca49497800716484a95
2014-08-08 10:19:18 -07:00
Saurabh Shah
8ec9b5eda4 hwc/overlay: Get rot dest dimensions instead of manipulating source
Currently for Mdss rotator we manipulate the layer buffer dimensions
to be equal to what rotator's destination dimensions would be, so that
these could be fed to MDP. Instead, this patch introduces APIs in
rotator so that hwc can directly query destination crop, width, height,
format from rotator.

This also simplifies the updateSource() and configRotator() helpers.

Change-Id: I501d998f2e0574683c764af9422742b2426ba0c7
2014-07-02 09:58:42 -07:00
Saurabh Shah
4b54c5b386 overlay: Fix BWC buffer size
BWC buffer size was added to address worst case sizes. But it doesn't
take care of RGB formats. Also the YUV CbCr worst case is 32x2 not
64x2. This change fixes those.

Change-Id: I72277bc1858ce704b34c831a73ce8cbcd93925fa
2014-05-06 14:57:01 -07:00
Saurabh Shah
912c94833a overlay: rotator: Remove previous allocation for a session
When ION was not ref counted, we needed to maintain the previous
session memory until the new one was taken by MDP. ION being
ref counted now, it is not necessary to maintain previous memory
allocation.

Change-Id: I102df065bb288a661d509912f4c7b894505df393
2014-02-14 09:50:10 -08:00
Arun Kumar K.R
7e5a1f81c2 liboverlay: remove warnings during compilation
- Remove unused variables
- Use proper typecast

Change-Id: Ia60fc4c3c7ec39a1df4a780de7f5d75d723f7960
2014-01-31 11:40:03 -08: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
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
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
Sushil Chauhan
6dcffbf7bf overlay: Do not carry over the stale rotator flags.
Do not carry over the stale rotator flags from previous draw cycle.

CRs-Fixed: 486749

Change-Id: Ie67ce1714e48381e58c64634d45b6915263efe5d
2013-05-14 12:36:11 -07:00
Sushil Chauhan
bab187a53e liboverlay: Add support for MDSS Bandwidth Compression
- This adds support for Bandwidth Compression.
- If MDSS supports BWC, then we set BWC flags
  to both Rotator(encode) and overlay(decode)

Change-Id: I6f7800716a2ce2ab855f4c0b1a53cd96f7d06d74
2013-04-29 13:51:44 -07:00
Sushil Chauhan
80fc1f95f0 hwc/overlay: Set crop rectangle for MDSS Rotator.
Since MDSS rotator will crop, the crop rectangle for overlay
will always start from (0,0).

CRs-Fixed: 476494
Change-Id: I1ccece8eab7d1a97ccec561a4d0df4558b5e33c4
2013-04-26 13:38:54 -07:00
Saurabh Shah
ae61b2b2c3 hwc: Fix dumpsys crash
In extreme cases, when all pipes are used, the buffer is insufficient.
Reduce logging by striping off unnecessary bytes.

Change-Id: I5a6ffb9ff288e389eea4e9ca4ac850ed59d539ff
2013-04-22 17:46:01 -07:00
Saurabh Shah
d1a2278d97 overlay: Swap flips on 90 only for older mdp version.
Older mdp rotator does 90 first and flip next,
forcing HAL to swap flips, in presence of 90.

Newer mdp does flip first and 90 next, owing to DMA pipe.
(Also similar to GPU flip handling). So we can pass flips as-is.

Change-Id: I379509a07e45966262005666e7727e7923079d3a
2013-04-10 16:41:46 -07:00
Saurabh Shah
78ad495769 overlay: MdssRot: Clear orientation values in setTransform.
We cleared the values after MSMFB_OVERLAY_SET, which could cause dumpsys
to not show them.
Clear the values in setTransfrom, before applying incoming values.

Change-Id: Icf2244a0ea7f2cae5d8f1b8c5e2f4cbecbe3ce3f
2013-04-08 10:16:07 -07:00
Saurabh Shah
acf102021a hwc/overlay: Video on 4k2k external, 4k2k rotation.
-Add support for Video via overlay on 4k2k external panel.
-Add support for rotating videos on 4k2k panels. We use
pre-rotation in hwc to rotate a video into a single buffer,
irrespective of panel size. Then this buffer is fed to MDP.
Rotator objects are managed by the new RotMgr.
-Cleaup mdpcomp and overlay.

Change-Id: Ifb08534747e8e18b6c58dd8a3e1a9947409100f1
2013-03-13 10:24:31 -07:00
Linux Build Service Account
e8224c192d Merge "overlay: Fix rotator output buffer size." 2013-02-21 16:00:06 -08:00
Saurabh Shah
0d0a7cbdd8 overlay: Add support for pipe dumps.
Add support for pipe state dump useful in dumpsys.
Reduce debug log spam when mdp state changes.

Change-Id: Ie27ad00698085e2ffd6166ad2f7503fe16a571f8
2013-02-21 10:19:44 -08:00
Saurabh Shah
fc3652f2c7 overlay: Fix rotator output buffer size.
Fix rotator output buffer size for mdp and mdss rotators.
Output size is based on rotated width & height.
Output format can be different than source format.
It could be same if using mdss rot or using fastyuv mode in mdp rot.
Deprecate the static mapping of rotator input and output formats.
Driver will be responsible for correctly populating the dest format that its
wishes to use.

Change-Id: I17352d6d460cac24eb97083aed38668929c66807
2013-02-19 12:52:05 -08:00
Linux Build Service Account
ef3efafaed Merge "liboverlay: Set mdp src format as rotator output format." 2013-02-13 10:16:53 -08:00
Sushil Chauhan
b4d184f102 liboverlay: Fix stride alignment issue for s/w decoded video.
1. Due to alignment requirements on HAL_PIXEL_FORMAT_YV12 format,
rotator buffer size calculation needs to be performed based on
rotated width and height because buffer size can be different when
width & height are swapped due to 90 degree rotation.

2. Input and output color formats are same for MDSS Rotator.

Change-Id: I0a06ef9bb7bdceb951e7ab5160dac3e92a28bcda
CRs-Fixed: 451871
2013-02-12 18:19:40 -08:00
Raj kamal
23f69b29e4 liboverlay: Set mdp src format as rotator output format.
* Set mdp source format as rotator output format
rather than determine it from a fixed mapping of
input/output formats.

* This is needed since for the same input format
to rotator, fastyuv mode if enabled may result in
a different output format than the one if the mode
is not enabled.

* Do the inline optimization for rotator where possible

CRs-fixed: 451064
Change-Id: If0bb2f3a44df10968383ab3f5c3625257518934d
2013-02-11 18:03:43 -08:00
Ramkumar Radhakrishnan
288f8c7e25 liboverlay: Rotator-assisted MDP downscaling of videos.
Engage the rotator to assist MDP in performing video downscale for
primary and external. This saves bandwidth and avoids causing the
driver to make too many panel mode switches between BLT (writeback)
and non-BLT (direct) modes.

Change-Id: Icfabc2c0f978a23cf96c78a9976cf69cea697b5f
CRs-Fixed: 434852
2013-01-18 12:07:49 -08:00
Sushil Chauhan
95e4c9f9bf overlay: mdssRot: Do not reset non-rotation flags.
Reset only rotation flags to fix stale orientation flag values.
Resetting non-rotation flag breaks secure-playback using rotator.

CRs-Fixed: 440417

Change-Id: Ia35c6258cfd26358b3dfe5cb006e9245d51e3dfc
2013-01-14 23:26:45 -08:00
Sushil Chauhan
bbca62988b overlay: mdssRot: Fix the logic for setting Rotator info flags.
Set the required flags instead of considering SECURE flag only.

CRs-Fixed: 423045

Change-Id: I82699d23de97c5276cac8f3b614b5d0463d7b06a
2013-01-09 17:44:08 -08:00
Saurabh Shah
08c65b3d25 overlay: mdssRot: Fix stale rotation flag values.
When moving from a non-zero to 0 orientation rot flags are not cleared.
This change resets the flag to 0 after every commit.

Change-Id: I2fb9759921c36620c53bf2ac92d9473a42919d8c
2013-01-07 10:33:45 -08:00
Sushil Chauhan
6e3fab8113 liboverlay: Mdss Rotator secure buffer needs to be aligned to 1M.
It is TZ requirement, xpu needs the buffer size to be 1MB aligned
for protection.

Change-Id: Icd9047a54d5706c321445e7970fb0f455d0c130b
2012-12-26 12:05:47 -08:00
Sushil Chauhan
faae042b76 liboverlay: Enable secure content flag in Mdss Rotator.
- Secured contents shared with hardware should be uncached.
- Secure heap needs to be contiguously allocated & aligned to 1MB,
  which is not supported by IOMMU heap.

Change-Id: I6c7c00d5363319f9a6db6e52c1e78e1b16ecd9aa
2012-12-26 12:03:55 -08:00
Sushil Chauhan
fbffad72c8 mdssRotator:For Venus, rotator buffer size depends on rotated w/h
Due to alignment requirements on venus format, rotator buffer size
calculation needs to be performed according to destination buffer
dimensions. Due to these alignments, the buffer can be different
when width and height are swapped due to 90 degree rotation.

Change-Id: I8eb0f1ece22946e6c3b2106623c3457e6871fd9c
2012-12-20 14:46:07 -08:00
Linux Build Service Account
109ab1ee85 Merge "display: Add target specific flag to support Venus color format" 2012-12-15 15:54:08 -08:00
Sushil Chauhan
c6bd6d92c2 display: Add target specific flag to support Venus color format
Venus color format is not supported on older platforms. Add target
specific flag in display hal and define Venus macros to zero for
older platforms.

Change-Id: I38141ae870e255a0e54ce9fde46fe6cc3415f179
2012-12-12 17:00:09 -08:00
Ken Zhang
ba48b01c18 overlay: Do not unset overlay for MSMFB_NEW_REQUEST
Change-Id: I40c21964db91e098f6f445e7860fefd09dcad768
2012-12-12 16:38:00 -05:00
Naseer Ahmed
758bfc5b50 hwc/overlay: Dynamic pipe tracking.
Remove state based pipe handling and make pipes tracked dynamically.
Add the configStart, configDone, nextPipe availablePipes APIs.
Remove setState API.

-configStart marks all pipes available.
-configDone garbage-collects unused pipe objects.
-nextPipe returns the index of next available pipe and create a corresponding
pipe object if not present
-availablePipes returns total of "unallocated" pipes. (Pipes could be allocated
but unused)

Changes in hwc adapt to the new overlay APIs.
Compile out MDP comp.
Remove unused files in overlay and hwc.
Update licenses.

Conflicts:

	libhwcomposer/hwc.cpp
	libhwcomposer/hwc_utils.cpp

Bug: 7626586
Change-Id: Id8e56901d34e5dc0fd088260d05e3e46f68ff090
Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-12-03 15:33:29 -05:00