Commit Graph

168 Commits

Author SHA1 Message Date
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
Linux Build Service Account
f7ddf674fc Merge "hwc: Add support to query max. supported WriteBack width" 2014-02-11 05:19:09 -08:00
Linux Build Service Account
325d49b658 Merge "hwc: vds: Add support for black frame generation on PWR suspend" 2014-02-06 06:20:37 -08:00
Linux Build Service Account
67b60bee6d Merge "hwc/overlay: validate and prepare frame" 2014-02-05 14:02:39 -08:00
Tatenda Chipeperekwa
744cc693f9 hwc: Add support to query max. supported WriteBack width
Adds a query to provide maximum supported WriteBack width.

Change-Id: I2f3f2ca1f7783394bd05e860e846dab504dbe071
2014-02-03 15:16:15 -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
Tatenda Chipeperekwa
9f33f6f7c3 hwc: vds: Add support for black frame generation on PWR suspend
If VDS is connected, do not clear WB object as it will end up
detaching IOMMU. We need to keep the WB session active in order
to send a black frame to WFD sink on power suspend.

For AD use case, we will keep the WB object active.

Change-Id: Ic6db255676ca0baafd468887fc3f88eafc581cea
2014-02-03 12:50:56 -08:00
Arun Kumar K.R
2aa44c66fa hwc: resolve compiler warnings
- remove unused variables.
- fix incorrect castings.

Change-Id: I7661edb4539a3ffc7d4aedbb9f633bc5ba1dc149
2014-02-03 09:20:36 -08:00
Zohaib Alam
1bb656178e hwc: vpuclient: vpuClient implementation
Vpuclient is the client side for VFM in hwc. It follows the
similar pattern of prepare and draw. It has 2 step prepare
including: setVpuSession and prepare. The setVpuSession function
passes all the layers from the SF list to VFM, which marks
the layers that it can support. After this, the layer
allocation/configuration is done, and finally in prepare the
allocated pipes are passed down to VFM. The draw function
passes the handle to the VFM to draw the video layer.

Change-Id: I5d8795de35ed98716f7fa4cd48506b488cb3cb5d
2014-01-31 14:59:19 -05:00
Linux Build Service Account
ac06730570 Merge "hwc: Dynamic Resolution support on Primary" 2014-01-31 05:11:59 -08:00
Dileep Kumar Reddi
bf2678bf8a hwc: Dynamic Resolution support on Primary
* Useful to estimate GPU/MDP performance for different resolutions.
    * MDP:
      Every layer is downscaled/upscaled to primary panel resolution.
    * GPU:
      All layers will be composed in required resolution to FB.
      FB is downscaled/upscaled to primary panel resolution.
    * Steps to follow:
          step 1: adb root
          step 2: adb shell setprop debug.hwc.fbsize XRESxYRES
          step 3: adb shell stop
          step 4: adb shell start

Change-Id: I82a032df87c91549c49a9cdbd981ff02f105ff2e
2014-01-29 16:39:03 +05:30
Raj Kamal
52b4fdbdbd Set priority among various display devices
* When a non-WFD virtual display device (SSD/
screenrecord) is active along with
non-hybrid WFD solution(WFD faked on
external), give preference to non-hybrid WFD
device over non-WFD virtual display device.

* This is needed only in cases when WFD is
enabled via v4l2 rather than using VDS api's.

Change-Id: I63e53baa214bdcdac19430ca30b939cdd7416cbb
2014-01-28 16:26:23 +05:30
Ramkumar Radhakrishnan
8bb48d3314 hwc: Common Display HAL to support VDS & V4L2 WFD solutions
1. Define classes for VDS and V4L2 based WFD solutions.
2. Overload the functionalities for VDS and V4L2 WFD solutions.
3. Instantiate VDS object or V4L2 object during hwc init based on the
   property persist.hwc.enable_vds set by the user.
4. VDS solution is not verified as it requires some dependent changes.

Change-Id: I74bf944d532da138c850d4ec0c20b4a881489efa
2014-01-21 18:41:04 -08:00
Linux Build Service Account
412fbbe323 Merge "hwc: Remove need for intermediate for mdp3 composition" 2013-12-20 09:44:20 -08:00
Linux Build Service Account
c25d39f9e9 Merge "hwc: Refactor disable animation on external" 2013-12-17 18:25:23 -08:00
Terence Hampson
c67b03798c hwc: Remove need for intermediate for mdp3 composition
8x10 has a product line that is suppose to use 256MB. The
intermediate buffers allocated are not needed when we can
compose onto fb frame.

Change-Id: I13fd2deb328a3ef4b6738cfe7030fe67ea7bd6c6
2013-12-17 14:55:47 -05:00
Ramkumar Radhakrishnan
a70981abfa hwc: Refactor disable animation on external
Fall back to GPU for one cycle at the start of animation and display
the frame buffer for the subsequent cycle till animation ends.

Change-Id: I6c651cebaf4694f326d6e32ae485e014f391577c
2013-12-12 14:42:14 -08:00
Raj Kamal
ed5a13a268 Donot compose layers if external is in pause state
* Donot compose external/virtual layer-list when
when external/virtual is in pause state.
* Marking the layers for GPU composition when external/virtual
is in pause state would update FB_TARGET layer which inturn would
affect partial mdpcomp after resume.

Change-Id: Id2806bd7156085c00158a31dff3c3dc4c2b61146
2013-12-11 09:40:03 +05:30
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
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