Commit Graph

149 Commits

Author SHA1 Message Date
Saurabh Shah
220a30c282 hwc: Do not use fb handle in hwc_prepare
Do not use fb handle in prepare. Use displayFrame for dimensions,
align them and hardcode format

Change-Id: I5c494a74a807d3a52a1c88257494b58c583700f5
2013-12-06 16:04:17 -08:00
Sushil Chauhan
943797c361 hwc/copybit: Add Color layer support in MDP Copybit composition.
1. Color layer has a destination rectangle, RGBA color and plane
   alpha. There is no gralloc buffer. Layer flag HWC_COLOR_FILL
   denotes color layer. MDP BLIT happens via MDP_SOLID_FILL mode.
2. There is no color member in HWC layer, so RGBA color value is
   passed via "tranform" member from framework to HAL.
3. Update HWC query to enable framework to query for Color layer
   support in HAL, at run-time.

Change-Id: I2c698007c1689779fe86d549093bb5285432dc5f
2013-11-13 10:13:19 -08:00
Saurabh Shah
62e1d731cd hwc: Bump up version to 1.3
Increment hwc version to 1.3.
Create and use a converter from float source crop to integers.

Change-Id: I5e185195c975b3a9434c5d9dce9ae4757ff98739
(cherry picked from commit 7e5637c850bcdbe21784ca3bfa9668870306adff)
2013-11-08 15:17:33 -08:00
Linux Build Service Account
4b437f699f Merge "hwc: Listen fb0 event for panel status" 2013-11-05 10:29: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
Linux Build Service Account
62abe02f12 Merge "hwc: Ignore force overlay_set on mdp3 targets" 2013-11-01 18:12:19 -07:00
Veera Sankaran
0dadfb3798 hwc: Listen fb0 event for panel status
Listen fb0 status change event for panel status. fb0 will receive
"PANEL_ALIVE=0" when panel is not responding to status call.
Call blank and unblank to reset the panel in next hwc_prepare
call.

Change-Id: I941a501a82d9f3b725660ad09631c1d8602b7325
2013-10-31 13:30:57 -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
Terence Hampson
65fe4522cb hwc: Ignore force overlay_set on mdp3 targets
Since mdp3 only has one dma pipe for overlay, which in the driver
is just a sw overlay, there is no need to force a overlay_set call
when HWC_GEOMETRY_CHANGED is set.
Also we are moving the wait for distination buffer fence to
wait inside the blit call for mdp3.

Change-Id: Id0aed8732dc49b1041d8174a5ff38703c8023abf
2013-10-24 13:55:11 -04: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
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
0003a16858 Merge "hwc: Set display as active only after unblanking it" 2013-09-15 22:36:36 -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
edc46aab6f Merge "hwc: Add additional trace points" 2013-09-10 16:32:54 -07:00
Linux Build Service Account
7e2cc28e2d Merge "hwc:Donot invoke commit when wfd is in pause state" 2013-09-10 16:32:15 -07:00
Raj Kamal
2464cce7cd hwc: Set display as active only after unblanking it
* For HDMI and non-Hybrid WFD solution, on receiving
online event, display hal sends hotplug connect to SF.
* In case of such displays, set them as active only
after receiving an unblank call.
* For Hybrid WFD solution, since display hal will not
be receiving unblank call from SF, set it as active
as part of processing online event itself.

Change-Id: I319f1576cba954da2024680568c37fedb1eb5d43
2013-09-11 00:12:43 +05:30
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
Dileep Kumar Reddi
90a8d72bd6 hwc:Donot invoke commit when wfd is in pause state
Donot invoke commit when wfd is in pause state
in hwc_set_virtual

Change-Id: I7202237e33b1b5de11f3bb1fdece4a897d3e6434
2013-09-04 04:17:52 -07:00
Saurabh Shah
8c5c852c86 hwc: Add support for bandwidth check
Add support for checking whether the current frame's required
bandwidth can be handled by MDP.

The max limit is configurable via a property and the value is
derived from simulation runs and profiling

Conflicts:
	libhwcomposer/hwc_mdpcomp.cpp

Change-Id: I46b46c346973fcb6487a8a656268171470ce69b9
2013-09-03 15:00:55 -07:00
Dileep Kumar Reddi
52eab82231 hwc: Do not overwrite retireFenceFd if already set
* Do not overwrite retireFenceFd of displaylist in
hwc_set_virtual if it is already set

Change-Id: I785618bf3b266dc6fa8e881677df6e0849870ae7
2013-08-27 11:16:03 -07:00
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
95e8bc67db hwc: Replace redundant display_commit with Overlay displayCommit
1. As part of Writeback class implementation, display commit is
     implemented in Overlay class.
     Replace display_commit function with Overlay::displayCommit
     function.
  2. Fix return value of hwc_blank function

Change-Id: Ie54fa9876495608a60216025e57cf4de7f6cb03c
2013-08-26 17:55:50 -07:00
Linux Build Service Account
dd07a6ffce Merge "hwc: Fix locking." 2013-08-23 17:32:54 -07:00
Saurabh Shah
b39f8151ab hwc: Fix locking.
Remove the unnecessary blank lock, mdp comp lock, secure lock.
Rename the ext lock to a more appropriate draw lock.

The mdp comp lock is at an incorrect place and causes unwanted
objects to show up in dumpsys, since configDone hasnt cleaned
them up yet.

dump(), blank(), draw() should all acquire a common lock.
draw() includes prepare() and set().

Change-Id: I595547dd5a393a8af6cd8c9297d50793b715e658
2013-08-22 13:15:57 -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
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
Raj kamal
a67027089c hwc: Define and Use mSecureLock
Define and Use mSecureLock in composition and binder
thread. This is to ensure both variables mSecureMode
and mSecuring are updated in binder thread without
any context switch to composition thread

Change-Id: Ibd701bd3363515e2f7e8a9711bbc5b66053cfa03
2013-08-19 12:23:11 +05:30
Linux Build Service Account
dec392e864 Merge "hwc: Reset state of layer which needs rotation" 2013-08-15 01:29:18 -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
Amara Venkata Mastan Manoj Kumar
310d04f3ce hwc: Reset state of layer which needs rotation
This change was removed during re base
  ( original commit id: I266a87228193fd85252a22242b66dd4af5f3033f).

  Bringing it back.

Change-Id: I625add1996ca98c47cedecbe8c9f27d298c5f079
2013-08-13 12:42:34 -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
188e433606 hwc: Fix locking in external connect and composition.
The external configuring flag should be set after holding locks.
Before opening FB for HDMI/WFD, composition should give up any
open external FB resources.

Locks should be held by composition for the entire duration.

Change-Id: I703f69f156c665bf422613567c00aae340f3ee12
2013-08-05 15:08:49 -07:00
Saurabh Shah
2a4eb1b965 hwc: Configure framebuffer before other layers.
If framebuffer needs to be configured, configure it before all the
other layers in mdp composition. This helps in cases where we are
out of SMPs and framebuffer configuration fails owing to that.
Framebuffer being the fallback path, should always get highest
priority when reserving SMP blocks

Change-Id: Ie7a6903d1b9fb98b308689c81522571449bf2e8e
2013-07-25 15:17:15 -07:00
Ramkumar Radhakrishnan
1829d2820d hwc: move fbzorder initialization code to hwc_fbupdate.cpp
move fbzorder initialization for external during display animation
from landscape to portrait from hwc.cpp to hwc_fbupdate.cpp.

Change-Id: I4dbac87fe56f8262356043865b61a982244cd72a
2013-07-25 15:16:46 -07:00
Linux Build Service Account
1f27f3fb3c Merge "hwc: Refactor of allowing virtual displays to HWC" 2013-07-23 09:05:05 -07:00
Linux Build Service Account
8a97d984e1 Merge "hwc: Don't lock eventControl for vsync events" 2013-07-18 21:52:10 -07:00
Linux Build Service Account
b92cdfe40e Merge "overlay: Add writeback support" 2013-07-18 04:47:58 -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
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
Saurabh Shah
567788bfa7 hwc: wfd: Fix locking on pause resume events
Fix locking on wfd pause, resume events. Some variables are updated
without proper locks being held.

Fix external related lock in hwc to include complete prepare and draw
Mdp comp for primary, otherwise, ends up reading some flags without
locks.

Change-Id: I0f2f0953a7ab322128d044ca3458e359da4e575e
2013-07-11 10:19:52 -07:00
Naseer Ahmed
20585702e8 hwc: Don't lock eventControl for vsync events
Locking here can lead to a delay in vsync disable/enable
where prepare/set is not yet completed. The HWC spec says that
eventControl needs to take effect immediately.
This lock was earlier present when we waited for SF to unblank
primary at startup and the vsync control ioctls could fail.
This is no longer necessary as we unblank primary on startup now.

Change-Id: I2bf18ae9235f8dd428a495a9a23af7f00f34ff1d
2013-07-11 11:22:41 -04: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
ea6f7144fb Merge "hwc: wfd: Call commit even if in pause" 2013-07-03 17:05:30 -07:00
Saurabh Shah
ad0f0d0a1f hwc: wfd: Call commit even if in pause
We need to call commit on wfd even if in paused state so that pipes
which are unset are actually unstaged from driver

Change-Id: Id71de8b80c44a632989de154a2387380d8fa66f0
2013-06-24 16:07:48 -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
Naseer Ahmed
edbe51811c hwc: Featurize framework changes
These flags were added to the core HWC header and break pure AOSP
builds.

Change-Id: I0d2f2071ce3fd6a9a0dc848b08098895b669c94e
2013-05-28 19:56:11 -04:00
Linux Build Service Account
4cf4354f41 Merge "display: Enable copybit on msm8610" 2013-05-21 09:29:00 -07:00
Linux Build Service Account
07be7a4e80 Merge "hwc: Implement idle-fallback for videos" 2013-05-17 06:43:50 -07:00