Commit Graph

69 Commits

Author SHA1 Message Date
Ramkumar Radhakrishnan
87a1cd1c88 hwc: Reset pipebook format to avoid pipe allocation failures.
Reset format type to FORMAT_NONE to select the pipe irrespective of
the format specifed by the client. This is required for the device
where SMP starvation is unlikely, we need not keep track of formats
programmed in the pipes to avoid potential pipe crunching.

Change-Id: Ifc00549802ca66936e171d00020124d3bcb60e0a
2015-02-26 21:38:24 -08:00
Saurabh Shah
218a61a7d2 overlay: Fix pipe type related priority checks
In case of one pipe having a new request and pipe types being
different, a condition check for comparison was missing. This
change adds that.

Change-Id: Ie58e297405a5ba911485d3f1e2e34cfbf538d2d7
2015-02-03 18:06:53 -08:00
Jeykumar Sankaran
89e23ab4cb liboverlay: Fix pipe priority mismatch on new allocations
With source split enabled:
1) When both LEFT and RIGHT pipes gets reused pipes, we use their
   pipe id's to compare their priority and swap them as needed.
2) When both LEFT and RIGHT pipes needs to be newly allocated, we
   let driver take care of the priority as long as both pipes are
   of same type. If different, we swap them according to the pipe
   type priority.
3) When LEFT is reused and RIGHT needs new allocation, we swap
   them only when they need same pipe type and LEFT has the
   pipe with lowest priority.
4) When RIGHT is reused and LEFT needs new allocation, we swap
   them only when they need same pipe type and RIGHT has the
   pipe with highest priority.

Change-Id: I320285aaca7ffc032e3b3b0832380a9c705bc4fc
2015-01-28 21:22:56 -08:00
Praveena Pachipulusu
734118adc9 hwc: Enable PP flag for metadata support
Enable POST_PROC flag to update PP features (HSIC/IGC/QSEED2)
info from metadata. Dynamically link ABL library.

Change-Id: Id5d8cf17eccb3ad8f1a671d0f3b5a96a7dbf7c00
2014-12-08 14:36:20 +05:30
Linux Build Service Account
0e38751be7 Merge "hwc: remove deprecated ioctl usage from overlay library" 2014-11-19 11:55:13 -08:00
Linux Build Service Account
69e569d003 Merge "hwc: Avoid changing VG pipe color format dynamically" 2014-11-19 09:39:12 -08:00
Baldev Sahu
979e8f097d hwc: Avoid changing VG pipe color format dynamically
VG pipe can be allocated for both YUV as well as RGB layer.
Switching this color format dynamically can cause overlay set
failure due to smp allocation change. Avoid this condition by
storing the color format it is allocated for.

Change-Id: I84df03883bd050c80d49e2ab63a37905535fb670
2014-11-17 20:35:47 -08:00
Dhaval Patel
e7eb5db117 hwc: remove deprecated ioctl usage from overlay library
mixer_info ioctl is deprecated and driver does not support
it. Remove unused code from overlay library to avoid
unnecessary version check during init.

Change-Id: I8099b66c398902b4a99f8e04cff53724254d6768
2014-11-17 15:51:22 -08:00
Saurabh Shah
7cd6778200 overlay: Reset display and mixer tags for unallocated pipes
When clients request pipes and unused pipe-slots are returned (the
ones having DPY_UNUSED, MIXER_UNUSED), they are tagged with requested
display and mixer ids.

If the client releases such pipes without using them (i.e without a
successful driver commit) we need to reset display and mixer tags to
UNUSED, so subsequent requests for a different display/mixer succeed.

Change-Id: I26e9fc4da3c3919ee23b65e2053c762df6c4cf8c
2014-11-14 16:33:59 -08:00
Saurabh Shah
ea3cf3029c overlay: Handle new request cases in comparing pipe priorities
In source split, when both the left and right requests are new,
the comparison should be made of pipe types, which could be different
even if it is for the same layer.

Change-Id: I66784ddac80c84d4520af5d195c7ce4ab5a27dc3
2014-11-07 12:10:46 -08:00
Ramakant Singh
b4106a121c hwc: Add msm8x09 version checks in HAL.
Add version checks for msm8x09 in hwc,copybit
and overlay.

Change-Id: Ia8b00f0ccd5f0495ab120b4c3e188caa5dbfa79c
2014-10-08 12:20:54 +05:30
Linux Build Service Account
bacfa10a61 Merge "overlay: Add pipe life-cycle logging" 2014-09-03 18:52:20 -07:00
Linux Build Service Account
b676dc16ca Merge "hwc: Clean up scattered definitions of commonly used constants/values" 2014-08-30 22:37:38 -07:00
Saurabh Shah
24eec8a5bb overlay: Add pipe life-cycle logging
Add pipe life-cycle logging including set, unset, commit.
Remove the older unused logging mechanism.
This is enabled via binder as:
$adb shell service call display.qservice 15 i32 4 i32 1
where 15 is DYNAMIC_DEBUG, 4 is for pipe lifecycle debugging and
1 is to enable

Change-Id: I6c02e24aa91135d4a6c67870b4c103546947da48
2014-08-28 11:09:53 -07:00
Tatenda Chipeperekwa
ce8d5c4930 hwc: Clean up scattered definitions of commonly used constants/values
Clean up scattered definitions of commonly used constants/values.
There is no need in re-defining these in several places.

Change-Id: I22c082b56646cb02d5ae4733d110afc81aaff50a
2014-08-13 12:09:36 -07:00
Saurabh Shah
5978857615 overlay: 8994: De-prioritize DMA pipe in line mode
De-prioritize DMA pipes in line mode on 8994. If DMA pipes need to be
used in block mode for downscale, there could be cases where
consecutive rounds need separate modes, which cannot be supported
since we at least need 1 round in between where the DMA is unused

Change-Id: I9cdcb5c699ddb34b6730ff32ff5e17c457c0fa12
2014-08-08 13:40:34 -07:00
radhakrishna
8ccb908a84 overlay: Request specific pipe type
Request driver for a specific pipe type instead of
notifying the type request using mdp flags.

Change-Id: I83fffc7c0e1f24d903b7dd6d52a58b87c70f3d4f
2014-05-22 15:22:35 +05:30
Linux Build Service Account
f4b63d9d0c Merge "hwc: Fix klockwork errors" 2014-05-19 03:23:53 -07:00
Linux Build Service Account
3cc3fa5dff Merge "hwc: Extend partial frame update for split displays" 2014-05-19 01:02:05 -07:00
Linux Build Service Account
c1171fc67b Merge "overlay: Remove usage of scale header" 2014-05-16 16:35:17 -07:00
Praveena Pachipulusu
2005e8f612 hwc: Fix klockwork errors
Resolving klockwork errors to avoid memory leaks,
improper assignments in liboverlay.

Change-Id: I82ac6ae782c7b783e89999b832bbd1d361376b9f
2014-05-16 08:45:03 +05:30
Jeykumar Sankaran
6c7eeac178 hwc: Extend partial frame update for split displays
Extends partial frame update support for split displays by calculating
changing region(ROI) independently for each half of the screen. In case of
only one half updating, display driver shuts down the DSI/MDP mixer control
of the non updating half.

Maintains two ROI's for each display. In case of Non-split
displays, only left ROI is updated.

Change-Id: I8a67fe40aac665a48b6f8a46beffb9f8027851b2
2014-05-14 17:45:24 -07:00
Saurabh Shah
eac146bf71 overlay: Remove usage of scale header
Remove usage of scale header and do not create or destroy objects.
the programScale() function exported out of libscale.so will
internally manage objects.

This frees up overlay from relying on scale.h which may not be
exported by libscale.so to a known location if only binaries are
shipped.

Change-Id: If6970541e2eb0ee2bdb907c73ed3534fc22e9dd1
2014-05-13 14:17:13 -07:00
Prabhanjan Kandula
958ffa9693 overlay : Rely on 8x16 pipe strategy for 8x39.
Since both has same number of pipes with similar
features like scaling capabilities, for now rely on 8x16.

Change-Id: Ief51bb5c70d8aef7dca3d791f8b4d62a4c5392ff
2014-05-13 18:08:38 +05:30
Linux Build Service Account
ac7a7dd410 Merge "hwc: [8x26]Never allow primary get DMA pipe when external connect" 2014-04-28 22:26:58 -07:00
radhakrishna
8929846249 overlay: Pipe preference for 8x16.
Do not differentiate between app layers and FB layer.
As 8x16 doesn't support DMA multiplexing, the pipe preference
order will be RGB, DMA then VG for both primary and external.

Change-Id: I844b12b0eb452b50b64426cff965c0be120d5ee9
2014-04-24 16:14:30 +05:30
Xu Yang
1e686f6607 hwc: [8x26]Never allow primary get DMA pipe when external connect
For 8x26, if external display is connected, DMA pipe should never
be occupied by primary display. Otherwise, external display would
lack DMA pipe if switch to GPU composition.

This patch refines former commit: 9c1eb2be21

CRs-Fixed: 640934
Change-Id: Idc64b724cfacf9e8e22ca73e4e443e8d989e1212
2014-04-23 09:33:47 +08:00
Linux Build Service Account
bd171474f6 Merge "hwc/overlay: Correct pipe priority comparison" 2014-04-18 13:42:44 -07:00
Tatenda Chipeperekwa
657afa250d hwc/overlay: Correct pipe priority comparison
MDP driver assigns pipe priority in inverse order. Lower the
number, higher the priority. HWC shall swap pipes if right
pipe is assigned lower number than left pipe.

Change-Id: I328623d9f53ad3ae79f7e73b10116231a7c50582
2014-04-15 16:52:32 -07:00
Saurabh Shah
c62f39861a overlay: Support for returning pipe based on capability
Add support for returning pipes based on capabilities.
getPipe() API takes in pipe specifications like format class,
scaling, display, mixer, fb and decides what pipe to return.
The nextPipe() API is now just a private helper.

Change-Id: I0ab809662c0ad6297e19a44f39264ee929944d13
2014-04-14 10:17:11 -07:00
Saurabh Shah
dd8237acd1 hwc/overlay: Add support for pipe priorities, 1 pipe config for FB
If using source split to stage 2 pipes on the same mixer stage,
the left pipe needs to be a higher priority than the right.

Add API in overlay to compare pipe priorities and use this in
source split config to stage pipes accordingly.

Add support for 1 pipe config for FB if updating rect is within 2048
pixels.

Change-Id: I8b33d5ebd0f8765ee842bab128d8abd67a110145
2014-04-02 13:22:53 -07:00
Ramkumar Radhakrishnan
36bd527bc8 display: Remove klockwork warnings and errors.
Remove all klockwork warnings and errors for libgralloc,
libhwcomposer, liboverlay, libqdutils, libqservice, libvirtual,
libexternal libraries to avoid buffer overflow and memory leaks.

Change-Id: I078143bcbcf5e4b342156bd8305a644566f7cc4b
2014-02-18 12:39:21 -08:00
Saurabh Shah
a36be92d30 hwc/overlay: validate and prepare frame
Send the entire frame (array of overlays) to driver, so that it would
check pipes params and the whole frame wrt bandwidth and SMP.

Now, the overlay's commit API just prepares an overlay object but
makes no ioctl calls.

If the driver finds the frame, as a whole, to be not ok, the
validation fails and overlay/hwc return silently.

If a certain overlay object is mis-configured or pipes are
unavailable, the driver sets the number of objects it processed.
Overlay uses this to dump the incorrect config.

Change-Id: Ifb2b7fadc6bd6d9d94a35ba3908fbd832f41447f
2014-02-03 12:58:46 -08:00
Saurabh Shah
7445d4b04c overlay: Remove support for forced pipe configs
Forced pipe configs were used during geometry changes to track bandwidth
in driver, which is no longer the case

Change-Id: I49fb1ca1b7173da2e17ccfc8ce9b447152b9b7b6
2013-12-09 11:00:16 -08:00
Linux Build Service Account
9f1f44a743 Merge "hwc: allow DMA pipe in BLOCK mode for virtual dpy" 2013-12-05 22:28:54 -08:00
Raj Kamal
a8c065f55d hwc: allow DMA pipe in BLOCK mode for virtual dpy
For portrait videos case on WFD, driver supports multiplexing
of DMA pipe in LINE and BLOCK mode.
Loosen the requirements to allow DMA pipe in block mode for
portrait case of virtual display.

Change-Id: I5821501f89b17bb2d29c425aee0a6c16b2a4783b
2013-12-03 09:54:06 +05:30
Linux Build Service Account
23c2140420 Merge "overlay: pipe reservation mechanism for overlay" 2013-12-02 02:43:53 -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
Zohaib Alam
4b0a924ff4 overlay: pipe reservation mechanism for overlay
This change provides APIs for this mechanism. In a case where
pipeid corresponding to the layer needs to be reserved, then pipe
session could be initiated for that pipe. This will ensure that
the pipe is not garbage collected, and is manually destroyed when
the session (or pipe requirement) has been ended. This change
also provides the api to locally allocate the dest for the given
reserved overlay pipeid.

Change-Id: I3fec3e26f69305c280395b7a92edf9e457398052
2013-11-28 12:16:06 -05: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
Saurabh Shah
b8f58e2cf2 overlay: Add support for using scalar calculations
Add support for using scalar calculations from custom library.
The calculation will override pipe configurations if required on
basis of format, scaling, split display etc.

Change-Id: I53c73431b70b5b339ad09c19ac8792f0fc96aaaa
2013-11-19 12:55:03 -08: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
397ef2c86c Merge "overlay: Remove optimization that prevents garbage collection" 2013-08-27 12:58:36 -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
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
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
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
Linux Build Service Account
3ed90c29e4 Merge "overlay: Fix crash due to small debug buffer size" 2013-07-18 21:52:16 -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
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