Commit Graph

370 Commits

Author SHA1 Message Date
Linux Build Service Account
87b476742f Merge "hwc: Handle layers marked as PROTECTED flag as secure" 2015-06-13 19:51:06 -07:00
Saurabh Shah
d1d93a285f hwc: Use GPU to compose for smaller updates
Whether or not an update is small (conservatively set to < 5% of
screen) is checked using total dirty areas of layers and GPU is
used to compose. This is because a smaller update also means GPU
had less front end work and the MDP can avoid fetching data from
all layers until idle timeout.

Change-Id: I1ccd8913f2a1c760f570b225fdfb29f6a20b5a8d
2015-06-09 13:13:00 -07:00
Linux Build Service Account
056047432f Merge "hwc: Populate frame rate in rotator set" 2015-06-06 23:38:03 -07:00
Linux Build Service Account
22504ba0c6 Merge "hwc: Reset the refresh rate alone to avoid stack corruption." 2015-06-05 11:31:42 -07:00
radhakrishna
b8e2c95763 hwc: Populate frame rate in rotator set
- Populate frame_rate in rotator set, so that driver
  can vote for honest BW for rotator based on frame rate.
- If metadata contains source fps, frame_rate will be set
  to source fps, else it will be set to primary refresh rate.
- frame_rate will be populated for primary with
  source fps from metada, only when secondary is not active.

Change-Id: Icaacd0ed67ec09591d31868591680d2e86fe54a2
2015-06-05 12:30:33 +05:30
Arun Kumar K.R
7b1f152708 hwc: Handle layers marked as PROTECTED flag as secure
- All secure layers are marked with GRALLOC_USAGE_PROTECTED,
  irrespective of L1/L3, which should not fallback to GPU.
- In HWC, treat this layer as secure so that any fallbacks
  will be avoided.

Change-Id: I399740bfb5910f3fda4c4f395e2f7b49ea8619a9
Crs-fixed: 842071
2015-06-03 15:02:16 -07:00
Linux Build Service Account
144fc26aaf Merge "hwc: Trigger a padding round when DMA state changes" 2015-06-02 22:05:00 -07:00
Praveena Pachipulusu
1c5431e111 hwc: Reset the refresh rate alone to avoid stack corruption.
In early return calls of prepare, reset the refresh rate
irrespective of layer properties to avoid stack corruption.

Change-Id: I5a04e111b1f10a6cb807459c7693d049c454edaa
CRs-Fixed: 838902
2015-05-31 21:47:51 -07:00
Raj Kamal
836054654e hwc: Trigger a padding round when DMA state changes
Earlier, for targets with #pipes less than 8, padding
round was not getting triggered when DMA state
changes from LINE to BLOCK Mode. Fix that now.

Change-Id: I46cb817fcf4e4027d5a7d20a8e887088ef6411b5
2015-05-29 11:32:24 +05:30
Linux Build Service Account
db02aa2acd Merge "hwc: Reset mode tracking in MDPComp constructor" 2015-05-28 03:27:40 -07:00
radhakrishna
036404772f hwc: Handle multiple YUV layer use case in low end targets
In low end targets with one VG pipe, when there are more than one
YUV layer in the layer list, configure one YUV layer (bottom most)
to VG pipe, instead of falling back to GPU completely.

Change-Id: I5c78613573c4ebfbda3a729245092cc635ef8b98
2015-05-27 10:27:37 +05:30
Saurabh Shah
ac279de523 hwc: Reset mode tracking in MDPComp constructor
Short story: This missing initialization fixes a crash in SF during
bootup on video mode panels with idle timeout.

Long story: SF creates HWC which registers a timeout handler. The
driver triggers this without even a composition round happening.
The junk value in mode tracking in MDPComp allows this timeout to
get translated into an invalidate() on SF. At this point SF may
not have fully created its EventThread (timing issue), which causes
a crash during bootup.

Change-Id: Icc91391399b2c0a027957be0689a226b5b1da783
2015-05-22 10:16:55 -07:00
Linux Build Service Account
bc64e1268d Merge "hwc: Avoid MDP comp for RGB downscaled layer" 2015-04-29 08:20:38 -07:00
radhakrishna
35e3307665 hwc: Avoid MDP comp for RGB downscaled layer
- In targets with fewer pipes, composition switch can happen
  continuously for a layer based on whether it is updating or not.
  If that updating layer requires downscaling, because of the
  difference in the downscale filters between MDP and GPU,
  the output of MDP and GPU will differ. This difference could be
  perceived as flicker. To avoid this flicker, mark RGB downscaled layer
  with downscale more than threshold to GPU always.
- property persist.hwc.downscale_threshold defines the threshold value
  for downscale beyond which the layer will be marked for GPU composition.

Change-Id: Ifd26d7eb1eff0096b0391a0552d0fd97386c1a19
2015-04-24 16:54:42 +05:30
Saurabh Shah
19740d0400 hwc: Use one GPU composition round for video transition
When external is active and primary has all ViG pipes, a video
playback may be starved of pipes on external. Use one GPU comp.
round for high-end targets as well.

Change-Id: I7f2e1d4a6a98a04e0fc1ec917ecedbb6ce56d067
2015-04-14 15:35:55 -07:00
Prabhanjan Kandula
fc541b3595 qdutils: Add 8952 mdss version id
Add support for 8952 hardware version check
to handle any hw specific resources or checks.

Change-Id: Idf60187435e7ac8c5918aaca0a5e00e443b22e71
2015-04-13 02:16:08 -07:00
Raj Kamal
b5f0b4aa8e hwc: Avoid fullMDPComp[WithPTOR] on primary when secondary has YUV layer
* On Low end targets which has constraint on the #pipes, avoid
fullMDPComp and fullMDPCompWithPTOR on primary
when secondary is connected and secondary has a YUV layer.

* This helps in secondary have sufficient number of RGB or DMA pipes
to handle sudden increase in #layers.

Change-Id: Ie848300c86f756125146482dc027c1c5872de7a6
2015-04-08 15:10:37 +05:30
Linux Build Service Account
a27b05a8ff Merge "display: Add support for HW Cursor" 2015-04-04 16:58:54 -07:00
Arun Kumar K.R
00b84792b7 display: Add support for HW Cursor
- Retrieve cursor pipe info from driver
- Configure the layer marked with flag HWC_IS_CURSOR_LAYER to the
  HWCursor using the fb_cursor ioctl.
- The config happens only when it satisfies the hw limitions of
  cursor
- HWCursor is supported on primary display
- Since cursor configuration happens first, make use of drop
  layer/count to handle other composition strategies
- Add support for hwc_setCursorPositionAsync as per HWC 1.4

Change-Id: I8663b6da89b0c2dd9b48af96d64a433b2b8a302c
2015-04-01 11:25:36 -07:00
Saurabh Shah
8cc77712c5 hwc: Reserve pipes for video layers first
There could be scenarios where the bottom layers are RGB, which could
take up all ViG pipes as well, leaving no pipes for videos. Using
mixed mode may not help if those RGB layers are updating, since GPU
will be continuously invoked.

This patch reserves pipes for videos instead of serial order.

Change-Id: Ia5e25294ecc18a54dc36923a930cb23914d9475b
2015-03-31 13:44:58 -07:00
Linux Build Service Account
642ce38173 Merge "hwc: Reset PTOR information" 2015-03-29 10:45:15 -07:00
Linux Build Service Account
202e482976 Merge "hwc: Avoid MDPComp in certain conditions." 2015-03-28 09:49:22 -07:00
Sushil Chauhan
17774c23fd hwc: Reset PTOR information
Reset PTOR info in HWC reset to make sure that Copybit does not draw
any Overlap region, even if there is no App layer in HWC layer list.

Change-Id: Ie2fb3408ba0171fd098a6b2627f4b9d59ae94ee6
2015-03-26 12:36:55 -07:00
Linux Build Service Account
ff81e813c0 Merge "hwc: Validate yuv layer dimensions to overcome hw limitation." 2015-03-24 17:02:12 -07:00
Raj Kamal
c0d34241d4 hwc: Avoid MDPComp in certain conditions.
* Until now, it was the assumption that when display animation
is in progress and there is a video rotation involved, the yuv-layer
would be marked as skip till completion of display animation.
But this is not always the case.

* On low-end targets, there is a constraint on #VG-pipes and
during video playback, video on primary is composed using GPU
where as video on secondary is composed using MDP. When display
animation is in progress, in such usecase, ensure that MDP is
is completely avoided so that VG pipe is available to secondary
once display animation is done.

* On high-end targets, video on both primary and secondary are
composed using MDP due to sufficient VG pipes. When display
animation is in progress, in such usecase, ensure to skip
fullMDP and partialMDP composition strategies so that
VG pipe that was supposed to be available for secondary is not
used for RGB layers on primary.

Change-Id: I841de1d902b627dd6e625251bf384c38b2db816e
2015-03-23 22:41:49 -07:00
Linux Build Service Account
a4ccb3fddd Merge "hwc: Avoid redoing GPU comp under certain conditions" 2015-03-23 04:41:24 -07:00
Linux Build Service Account
2ce22c9b76 Merge "hwc: Support for reading FB format from driver" 2015-03-23 00:01:28 -07:00
Ramkumar Radhakrishnan
1a763e9593 hwc: Validate yuv layer dimensions to overcome hw limitation.
Crop width and crop height should be even for yuv layer, so fallback
to GPU composition if the values are less than 2.

Change-Id: I8677dd32bfd88e5509b8890377afd82e83b07e45
2015-03-19 16:53:15 -07:00
radhakrishna
c3198ff918 hwc: Support for reading FB format from driver
- Instead of assuming the default format(RGBA_8888),
  read FB format from driver and pass the info to SF
- For now, this is limited to primary and HDMI only.
  WB FBformat is assumed to be in RGBA_8888
- If FB doesn't have alpha channel, disable mixed mode

Change-Id: Iefc0080819749b541483ea47357bb37ec150c544
2015-03-19 15:27:03 +05:30
Raj Kamal
fdfdddfd1c hwc: Avoid redoing GPU comp under certain conditions
* When the ambient light changes, pp-daemon will invoke multiple
screen-refresh cycles for LUT convergence needed for
PP algorithms.

* When this happens during static screen usecase, there would
be frequent switches from gpu-comp(due to idlescreen-fallback)
to mdpcomp and back. This results in increase in power numbers
due to increased composition cycles.

* To resolve this, do the following:

a) If frame 'n' is composed using GPU and frame 'n+1' is same
as frame 'n' in terms of input layers contents, avoid any
composition needed for frame 'n+1'. Mark the composition type
for all the layers as HWC_OVERLAY and push the GPU composed
content of frame 'n' for 'n+1' too.

b) Donot do (a) if the any of the incoming layers is marked as
skip or HWC_GEOMETRY_CHANGED flag is set in layer list.

c) Limit (a) to only primary and when secondary is not connected
so that display output expectations during secondary pause-resume
can be met.

* This saves ~10ma during static screen usecase when ambient
light is frequently changing.

Change-Id: I6ca4ab3bf194ffe71191cc661086a14d3e2c26b3
2015-03-19 12:45:15 +05:30
Jeykumar Sankaran
14d41a86b2 libqservice: Defer enabling partial update PP turns off
When client prefer to enable PU(partial update) over PP(post
processing), delay enabling PU until PP turns off its
features completely. This change introduces hand shaking flags
between PP and HWC through binder calls. When requested to turn
on PU, we notify PP through the sys_fs node. When PP is done
shutting off it features, it acknowledges back to HWC to actually
turn on PU.

Change-Id: I72008f2313b93497f55c0435367ef62cd772c2c4
2015-03-11 15:43:44 -07:00
Linux Build Service Account
0bb20fc378 Merge "hwc: Partial update support for dual DSI panels with source split." 2015-03-03 08:50:12 -08:00
Linux Build Service Account
09fdc2b36f Merge "display: Support for S3D video" 2015-02-28 13:07:07 -08:00
Jeykumar Sankaran
f7124b919f hwc: Partial update support for dual DSI panels with source
split.

1) When source split is enabled, both the panels are calibrated
   in a single coordinate system. So only one ROI is generated
   for the whole panel extending equally from the midpoint and
   populated for the left side.
2) Fixes a bug in mdpcomp where ROI generated for the frame is
   reset when a strategy fails.

Change-Id: I47fa0e827985dd76d06dcbe464ef832cfc57a671
2015-02-26 12:51:54 -08:00
Arun Kumar K.R
8b9270271f hwc: mdpcomp: Remove the perf lock acquire log message
Perf lock acquire would fail during the boot up as the perfd
service is not up yet.
Its harmless to remove these logs which cause false alarm

Change-Id: Id305f3122a77ebe70819e4b3edfaf405c3a87d70
2015-02-24 12:43:50 -08:00
Naseer Ahmed
6bbd0a14a5 display: Support for S3D video
1. Add support to set HDMI to 3D mode
2. Add binder API to force 3D mode
3. Switch to 3D mode based on metadata
4. Configure pipes appropriately
5. Only side-by-side and top-bottom formats are currently supported

Change-Id: Iae579ecfa45aae088ff543d4143e5025e8c682fa
2015-02-20 16:18:40 -05:00
Linux Build Service Account
ea51be6e5b Merge "hwc: Use 1 pipe if rotator downscale reduces dimensions" 2015-02-09 16:47:07 -08:00
Saurabh Shah
05f4e22484 hwc: Use 1 pipe if rotator downscale reduces dimensions
If rotator downscale is able to reduce output dimensions below
MDP's pipe limits, then use only 1 pipe if possible in source split
cases.

Change-Id: I6739a1fcd32b1047ce266d60c0123961c9daa657
2015-02-05 14:40:56 -08:00
Linux Build Service Account
505947c1c2 Merge "hwc: Partial update support for ping pong split." 2015-02-03 19:38:20 -08:00
Linux Build Service Account
1f595e5c76 Merge "hwc: Try MDP composition eventhough skip layer is present" 2015-02-02 03:33:22 -08:00
Linux Build Service Account
a1cb887cad Merge "liboverlay: Fix pipe priority mismatch on new allocations" 2015-02-01 14:29:41 -08:00
Jeykumar Sankaran
aedd143215 hwc: Partial update support for ping pong split.
ping-pong split needs source split to be enabled to stage two
pipes of a layer in the same Z order. This change adds partial
update support to generate ROI when source split is enabled.
When configured, ping-pong-split splits the layer mixer output equally
across two DSI's. To meet this limitation, the generated ROI is
adjusted to have equal widths from the panel mid point.

Change-Id: Ic307a1d5b902af9e352b0dfc6f5ab474ecd9c8a4
2015-01-30 15:56:08 -08:00
Raj Kamal
1179d9cf95 hwc: Try MDP composition eventhough skip layer is present
* Explore cachebased and loadbased composition strategies
eventhough skip layer is present in the layer list.

* Prioritize loadBasedComp over cacheBasedComp in such case.

* Invoke redraw of FB for every-frame as long as skip-layer
is present to comply with the spec.

Change-Id: If105ae8af4888a1e0b0fb824c526ef5a1adaedd8
2015-01-29 01:14:57 -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
Dileep Kumar Reddi
7399d5ca44 hwc: Reset ROI and avoid dirtyRect for video case
Reset ROI in when we are unable to proceed with full MDP comp.
Do not use dirtyRect for video use-cases to address some
corner cases

Change-Id: Id1ea6c1515f4441f0f35c0d08828e9c361bcbc86
2015-01-27 00:21:47 -08:00
Sushil Chauhan
65e26307e6 display: Add support for UBWC in display hal
1. Add support for UBWC allocation in the Gralloc APIs for aligned
width, aligned height and buffer size. A client can request for UBWC
allocation by sending UBWC specific HAL pixel format or by setting
GRALLOC_USAGE_PRIVATE_ALLOC_UBWC flag in the usage flags.

2. Gralloc allocates UBWC aligned buffer, only if format is supported
by GPU and MDP and no CPU usage flags are set. Otherwise it allocates
linear buffer.

3. If UBWC conditions are met, gralloc sets PRIV_FLAGS_UBWC_ALIGNED
in private handle flags to tell client that allocated buffer has UBWC
alignment. This flag remains unset by default.

4. Add helper functions in gralloc to calculate UBWC meta buffer size
for RGB* formats.

5. Add UBWC HAL pixel format HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC
which has been defined by Video module.

6. Add AdrenoMemInfo api to query, if GPU supports UBWC for a format.

7.MDP driver expects UBWC specific pixel format defined by MDP header.

Change-Id: I5b4344bc90aa498dbdb7bb8100e70ed7728e6ea5
2015-01-16 11:00:01 -08:00
Linux Build Service Account
fc4d923177 Merge "libhwcomposer: Enable padding round for SMP failure" 2015-01-08 13:04:42 -08:00
Linux Build Service Account
3930ecae03 Merge "hwc: Modify MDPOnly composition to allow only secure RGB layers" 2015-01-07 19:37:40 -08:00
Tatenda Chipeperekwa
95675a747f hwc: Modify MDPOnly composition to allow only secure RGB layers
MDPOnly composition needs to cater for the use case when we have
secure RGB layers that require MDP composition. For non-secure RGB
layers we can afford to send them for GPU composition. This is
especially needed for the following use case: full MDP composition
on primary (including YUV layers), followed by external connection.
For the mentioned use case, we need to fall back to Video and then
GPU composition in in order to reclaim pipe resources for external
usage.

Change-Id: I6da3ca48cf6e38e767fecfbfee6b06e82ba00a51
2015-01-06 16:58:45 -08:00
Arun Kumar K.R
299bcda69c hwc: Add support for perf display hint
- Set the perf hint when there is only one updating layer, which helps
  in reducing cpu params and thus reduce power.
- This feature is enabled with the property persist.mdpcomp_perfhint,
  which is set to a positive value, which will be the window of frames
  before the perf hint is set

CRs-fixed: 765460
Change-Id: Ie21e1cd201afab16bedd3c750ea3b0230769969a
2015-01-06 13:50:45 -08:00