Commit Graph

171 Commits

Author SHA1 Message Date
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
Jeykumar Sankaran
6a58579603 libhwcomposer: Make Rect utils generic.
Changes rect utility functions more generic.
Adds more sanity checks.

Change-Id: Ie935302592ac8eb5f7cfaffe03ac49da077a290d
2013-10-04 14:20:15 -07:00
Prabhanjan Kandula
a5dc8e95fa libhwcomposer: Optimize layer crops when possible.
With in hwc list of layers if a layer above is opaque,
deduct the opaque layers crops from all the layers below
in z-order if deduction is possible with out creating
any hole.

Change-Id: I6391a13b0501cb972b134f72b58514cb807c7613
2013-09-27 01:17:37 +05:30
Linux Build Service Account
62fcf27d7e Merge "hwc: Add needsScalingWithSplit for high resolution display." 2013-09-13 20:31:41 -07:00
Naseer Ahmed
58780b987b hwc: Add vpu client
Stub implementation of VPU in HWC.
This commit passes through binder calls from HWC
to the VPU library. It also has stub prepare/draw calls
in the VPU client object which can be used to configure
VPU in the composition cycle.

Change-Id: I2606f2884e870448d29ef26e02faac92e157e2c6
2013-09-12 09:15:44 -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
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
Naseer Ahmed
099a693939 hwc: Add additional trace points
Require HAL tag for tracing HWC and add additional trace points
for systrace.

Change-Id: If0abb438da96d3507fb3e2a42bcb8d8b4734fb8f
2013-09-09 14:25:20 -04: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
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
Ramkumar Radhakrishnan
66f856c188 hwc: Cleanup patch for SideSync and WFD/HDMI downscale feature
Move block of code corresponds to SideSync and WFD/HDMI downscale
    feature to a seperate function.

Change-Id: Ib07cec61abf3a7226bc4dd2ebb9f313519114fd4
2013-08-29 10:55:08 -07:00
Linux Build Service Account
5383b360a4 Merge "display: Add BufferMirrorMode support for External" 2013-08-29 04:40:10 -07:00
Linux Build Service Account
c82dcafc53 Merge "hwc: Perform MDP downscaling for WFD/HDMI Scenario" 2013-08-29 04:40:10 -07:00
Linux Build Service Account
6b44bf5002 Merge "libhwcomposer: align rotator source buffers for tile format." 2013-08-29 01:45:39 -07:00
Prabhanjan Kandula
a1d8301faa libhwcomposer: align rotator source buffers for tile format.
for tile format make the rotator source buffers aligned to 64 X 32.
This avoids rotator hang during source fetch.

Change-Id: I9e42788cc6f538b155c073028ce41bf48e1d9349
CRs-fixed: 473297
2013-08-27 11:32:32 +05:30
Amara Venkata Mastan Manoj Kumar
5cbac94cb2 hwc: Fix Pause/Resume issues
1. During PAUSE event, trigger an invalidate frame
     which will unset the pipes (in draw call) and invoke
     display commit as part of hwc_event thread.
     This is required to avoid iommu page faults arising when
     WFD encoder is in the middle of configuring buffers
     and providing to Writeback as part of RESUME event and
     Display HAL tries to invoke display commit as part of PAUSE.

  2. Allow usage of rotator for Primary when WFD is in Pause
     state.

The above changes are required to support secure/non-secure
video playback on HDCP WFD session and Pause/Resume.

Change-Id: I7391ae4cc7cd8b968873996a1a00fee5fbe6039c
2013-08-26 18:35:11 -07:00
Amara Venkata Mastan Manoj Kumar
9d373c0b7e hwc: Add check for block mode for rotated video
Do not allow video if it requires pre-rotation and DMA pipe
  is configured in LINE mode. Fall back to GPU in this usecase.
  This is not applicable for wfd on 8x26 since Driver supports
  both multiplexing of DMA pipe in LINE and BLOCK mode as same
  mixer control block is used for rotation and writeback mode.

Change-Id: I5b99b214619134b1bd67f3c441b14f76051e3d3b
2013-08-26 13:54:15 -07:00
Linux Build Service Account
61f5bc100e Merge "Revert "hwc: Perform MDP downscaling for WFD/HDMI Scenario"" 2013-08-23 17:33:06 -07:00
Linux Build Service Account
1d784e592f Merge "Revert "display: Add BufferMirrorMode support for External"" 2013-08-23 17:33:05 -07:00
Arun Kumar K.R
fb5bfa6ff1 display: Add BufferMirrorMode support for External
- In Buffer mirror mode, the output on the external should be rotated
  based on the primary orientation.
- this is used for the side sync feature.
- buffermirrormode has higher precedence over external orientation
- Add binder interface to enable/disable buffermirror mode

Change-Id: Ibea0af9627d69b4d42453adc868b113d82613437
2013-08-22 15:38:25 -07:00
Amara Venkata Mastan Manoj Kumar
376d8a8c01 hwc: Perform MDP downscaling for WFD/HDMI Scenario
On WFD/HDMI connection, if the configured resolution is less than
  Primary Resolution, Display HAL does the following:

  1. sends hpd notification to SF with primary resolution.
  2. configures MDP pipes with configured Resolution.

  This is done to improve UI quality as MDP has better downscale
  filter options compared to GPU.

Change-Id: I33570c13016a35ed6c5d22d4c34dfe75b2c605a1
2013-08-22 15:34:29 -07:00
Ramkumar Radhakrishnan
31f4c4e7b9 Revert "hwc: Perform MDP downscaling for WFD/HDMI Scenario"
This reverts commit 1291675ee4.
2013-08-22 13:32:18 -07:00
Ramkumar Radhakrishnan
dc4aeb53da Revert "display: Add BufferMirrorMode support for External"
This reverts commit 027d96511c.
2013-08-22 13:31:33 -07:00
Linux Build Service Account
16af3fd8a0 Merge "hwc: Add support for plane alpha" 2013-08-21 16:28:52 -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
Arun Kumar K.R
027d96511c display: Add BufferMirrorMode support for External
- In Buffer mirror mode, the output on the external should be rotated
  based on the primary orientation.
- this is used for the side sync feature.
- buffermirrormode has higher precedence over external orientation
- Add binder interface to enable/disable buffermirror mode

Change-Id: I1768dbfac239ae663927358ca9b8e5510b683385
2013-08-16 21:06:04 -07:00
Amara Venkata Mastan Manoj Kumar
1291675ee4 hwc: Perform MDP downscaling for WFD/HDMI Scenario
On WFD/HDMI connection, if the configured resolution is less than
  Primary Resolution, Display HAL does the following:

  1. sends hpd notification to SF with primary resolution.
  2. configures MDP pipes with configured Resolution.

  This is done to improve UI quality as MDP has better downscale
  filter options compared to GPU.
  This works only for QCOM WFD proprietary solution.

Change-Id: Ic20e837bf02c0f7b6718946e70b936f3a469fa7c
2013-08-16 20:56:05 -07:00
Arun Kumar K.R
5898c65aab hwc: fix aspect ratio calculations
- Make aspectratio calculations independent of ext dpy w/h
- pass hwc_rect_t to getAspectRatioPosition function instead of
  x, y, w, h
- overload getAspectRatioPosition func to return the upscaled
  or transformed position for a particular display based on the
  values set by SurfaceFlinger

Change-Id: I0be9b2b4b030bdd8e69dc1493dc8cbac31918c27
2013-08-16 12:33:34 -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
Linux Build Service Account
1e67338868 Merge "hwc: Add assertive display support." 2013-08-14 01:08:09 -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
Saurabh Shah
07a8ca82c8 hwc: split display: Fix left split default value if not published
If the left split is not published by the driver then the default should
be even split. This was missing from the configuration in utils. This is
already taken care of in framebuffer configuration and mdp composition.

Change-Id: I3db44481fd791809146752ddff56420dcbe89fb4
2013-08-07 10:14:52 -07:00
Linux Build Service Account
1f27f3fb3c Merge "hwc: Refactor of allowing virtual displays to HWC" 2013-07-23 09:05:05 -07:00
Amara Venkata Mastan Manoj Kumar
7fb132789d hwc: Refactor of allowing virtual displays to HWC
1. Since SF doesnt invoke blank for virtual display,
     handle pipe clean up as part of Primary display
     blank.
  2. Support virtual display to query display attributes.

This refactor is done to address Framework reboot issue.

Change-Id: I266a87228193fd85252a22242b66dd4af5f3033f
2013-07-12 12:14:08 -07:00
Saurabh Shah
6810742452 hwc: Increase precision in triming
Increase precision from float to double in triming calcs.
This improves the output. We need this since ultimately
we assign to int which would truncate excesses. With float
due to lower precision, we end up slightly lower than an
integral value.

Change-Id: I5d781b609be1761b746edf6503340f34a985b9e2
2013-07-09 15:17:17 -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
Linux Build Service Account
6e8a57ef3a Merge "hwc: split display: Fix flip on which to do crop swap" 2013-07-03 17:06:20 -07:00
Saurabh Shah
94d6236990 hwc: split display: Fix flip on which to do crop swap
Crop swapping is being done on V flip, rather it should be done
on H-flip in case of split displays.

Change-Id: If6136ad36731f4ac4847e94d8dfa851182f25c83
2013-07-02 11:02:25 -07:00
Saurabh Shah
67a38c3565 hwc: Add support for uneven split primary displays
Add support for unevenly split primary displays.
The driver provides info about the split via msm_fb_split sysfs node

For external we assume even split. If driver doesn't specify any split
for primary, we default to even split.

Change-Id: I4d541f41de2d7a5d2b62653fa33cab079a6d5d30
2013-07-01 14:55:06 -07:00
Linux Build Service Account
a1c443c063 Merge "hwc: Initialize yuvIndices properly." 2013-06-25 16:39:05 -07:00
Linux Build Service Account
3692044216 Merge "hwc: 8x26: Composition policy when WFD connected" 2013-06-24 14:19:39 -07:00
Saurabh Shah
d4e6585258 hwc: 8x26: Composition policy when WFD connected
When WFD is connected to 8x26
1) On Video transition, have 1 padding round if external connected.
Required to shift pipes across mixers.
2) Request DMA pipe always for FB on WFD.
Necessary for rotation + writeback
3) Disable non-worm-hole calcs on external (because of 2)
4) Disable action-safe calcs on external (because of 2)

Change-Id: I63b50b2477db443f9ea1d3fa610b59295c9359b7
2013-06-20 19:33:49 -07:00
Ramkumar Radhakrishnan
26bdee916c hwc: Initialize yuvIndices properly.
memset initializes first 32 bytes of yuvIndices array, so remove
memset initialization and initialize yuvIndices whenever it is required.

Change-Id: I2f01a5c3d07cfbc325f4ca06e3c019616b8a7588
2013-06-20 17:32:39 -07:00
Arun Kumar K.R
1830d50573 hwc: consider landscape panels for calculating aspect ratio
Need to consider the primary panel native orientation(portrait or
landscape) while calculating the aspect ratio for external display

Change-Id: Ic37c719fe736b6957d975ebefa9972b1ba3ccf7f
CRs-fixed: 497272
2013-06-19 15:12:17 -07:00
Linux Build Service Account
1f1db52302 Merge "hwc: Fix Bwc policy's decimation check." 2013-06-07 03:30:02 -07:00
Linux Build Service Account
7b3c8b1b7b Merge "hwc: Fix to avoid heap corruption" 2013-06-06 07:58:11 -07:00
Ramkumar Radhakrishnan
e661f9677d hwc: Fix to avoid heap corruption
- Check for MAX_NUM_APP_LAYERS before updating yuv indices array.
- Fall back to GPU composition when number of app layers exceeds
  MAX_NUM_APP_LAYERS to avoid heap corruption.

Change-Id: Ieb91b705a0a5f50ce2f8829d1f1ee048d44b7d2e
2013-06-05 18:41:47 -07:00