Commit Graph

236 Commits

Author SHA1 Message Date
Arun Kumar K.R
205df77ece hwc: Return failure from hwc_device_open when fb open fails
- When fb open fails during hwc initialization, it should be
  flagged as a fatal error and HAL should return error.
- Without this, the SF would make calls to HWC that would fail,
  and display being blank.

Change-Id: I20f08bdcb283d4805449c74a8214b871c2f1c80b
2015-03-04 15:56:25 -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
Linux Build Service Account
81778e77cf Merge "hwc: Program default mode upon boot anim completion" 2015-02-09 16:47:08 -08:00
Linux Build Service Account
98fceffb45 Merge "hwc/overlay/hdmi: Fix / enable some error messages." 2015-02-01 14:29:39 -08:00
Saurabh Shah
15455aa610 hwc/overlay/hdmi: Fix / enable some error messages.
Fix cases where some errors are really warnings/info.
Print one-time events like HDMI connect disconnect as info logs.
Print the error string and type on MSMFB_OVERLAY_PREPARE failure.

An ENODEV from driver corresponds to a pipe not available and should
be treated as a warning. This could happen if a previous UNSET is
pending due to a missed vsync. ENODEV should be treated as fatal
only if it is seen continuously representing a book-keeping
blunder.

Change-Id: I730d4ac7db84c287f47805b9c74792c90cfadc6c
2015-01-29 15:22:18 -08:00
Krishna Chaitanya Parimi
db992fd320 hwc: Program default mode upon boot anim completion
Default display mode needs to applied exactly on boot
completion. Hence we check for the exact instance of
boot completion by checking the property of boot
animation exit. We keep on checking till the property
is found to be set and program the default mode over
a dynamic link to libmm-qdcm.so

Change-Id: Ic68667a12e4058f29bc2203382baf59ef34ab038
2015-01-29 15:11:04 +05:30
Tatenda Chipeperekwa
16301190e7 hwc: hdmi: Use res_info sysfs node to get HDMI timing info
This change removes the use of static declarations in the HDMI library
that were used to configure the HDMI class with the best mode.

We now rely on the res_info sysfs node to provide timing information
on request for supported modes. Furthermore, we now dynamically compare
HDMI modes in order of height, width, refresh rate and aspect ratio, when
we want to determine the best configuration.

Note: SurfaceFlinger currently has a limit of 128 modes but HDMI can
potentially provide more that 128 modes. In use cases when HDMI provides
more than 128 modes, the HAL needs to sort and provide the best 128 modes.

Change-Id: If4ed8845fb77024771dde15fe23dfcee515d93d2
2015-01-22 11:28:56 -08:00
Tatenda Chipeperekwa
cbe1dfe7f0 hwc: Fixes for HDMI primary/external use cases
1. Do not process the display list when the display is not connected.

   This is applicable mainly in the HDMI as primary use case since we
   want to activate the display only when the cable is connected.

2. Do not write to HPD when HDMI is primary

   HPD is always enabled when HDMI is primary, and so we rely on the
   connected state (read from sysfs) to determine if the cable is
   connected or not.

3. Initialize the down scale feature switch

   Initialize down scale feature switch when HDMI is connected but
   before we make the call to modify display attributes.

Change-Id: If2a7c8d7af105a9bbd1b6aeef030ac22b51bd3ef
2015-01-15 11:59:12 -08:00
Linux Build Service Account
69574c0ce8 Merge "hwc: Add binder API to disable screen updates" 2014-12-16 01:42:58 -08:00
Arun Kumar K.R
2225eaab7c hwc: Set HPD once at boot up
- HPD has to be set only once during boot up.
- This also helps in use case where HPD is turned off
  (on purpose)through by adb shell for power testing
  and on suspend/resume, it gets re-enabled.

Change-Id: I7bf6fdd08e719432029c5d6e5756685d36cdca43
2014-12-12 10:18:41 -08:00
Naseer Ahmed
78951b2ae6 hwc: Add binder API to disable screen updates
When the display is put in calibration mode by postprocessing
tools such as QDCM, the pipes are taken over and updates need to
be blocked.

Change-Id: I413caf40ad0a7ccdd43a3167bd7e3415e8bc8b55
2014-12-11 16:56:20 -05:00
Arun Kumar K.R
074c9cfdaf hwc: Add secure display attribute
- External displays can be secure or non-secure based on HDCP
- Propogate this to the SF with the getDisplayConfig
- Non-virtual displays(pri and hdmi) are considered to be secure
- For WFD using V4L2 archiecture, read the HDCP status from the
  sysfs and update accordingly

Change-Id: I4aaf303f0770201b8ca4f8a1c578bed61054bcfb
2014-11-13 04:32:14 -08:00
Tatenda Chipeperekwa
dc8d708c35 hwc: Add a new check for DMA state change
Add a check to bail out of MDP composition in cases when we need
to switch the DMA state.

Change-Id: Iab3978df77d7f0e7cee28603189292504706c463
2014-11-05 20:59:37 -08:00
Tatenda Chipeperekwa
319eec11d9 hwc: Add support for frame rate change on HDMI devices
When an HDMI display is connected, we report all the available
configurations to the framework by translating the EDID data.

This information can be queried, and subsequently used to change
the frame rate of the HDMI display.

Note: this change does not provide support for changing the resolution
of the HDMI display.

Change-Id: I4b8b07e2886efe2a01480aed9d82d36075bb342c
2014-10-29 10:39:04 -07:00
Tatenda Chipeperekwa
d80b6173b3 hwc: Add support for HDMI as Primary display
We are adding support for HDMI as Primary to the display HAL.
The HAL must be able to support boot-up use cases and cable
connect/disconnect events as follows:

1. Boot up with HDMI cable connected

   For this scenario we read the best mode supported by the
   HDMI TV and set that as the current and default mode for
   subsequent boot up.

2. Boot up without HDMI cable connected

   We read a default resolution from the driver by reading vscreen
   and reporting this as the display resolution to SF.

3. Switch the display to active state when we receive first frame

   When HDMI is primary we should rely on the first valid
   draw call in order to activate the display

4. Update handling of uevents when HDMI is primary

   a) Do not send hot plug when the cable is connected/disconnected.
   b) Use the correct display ID in uevents when HDMI is primary

5. Handle display timeout when HDMI is Primary

   When HDMI is connected as primary we clean up resources
   and call commit to generate a black frame on the interface.
   However, we do not call blank since we need the timing
   generator and HDMI core to remain turned on.

6. Clear pipe resource when HDMI is disconnected

   When HDMI is primary, we need to make sure that SF/HWC does
   not have any open fd's when the cable is disconnected.

   We clear all pipe resources and call a display commit to ensure
   that all the fd's are closed. This will ensure that the HDMI
   core turns off and that we receive an event the next time the
   cable is connected.

Change-Id: Ice70add583a3859f99bfa2e384fbbb6df4df92e1
2014-10-16 16:21:14 -07:00
Tatenda Chipeperekwa
af2c004c44 hwc: Rename libexternal to serve HDMI as primary or external
This change will make is easier to build new functionality
applicable to both HDMI scenarios.

Change-Id: I417184568cb65a49c2ccb4199aff313ae2ee9b24
2014-09-29 15:39:58 -07:00
Linux Build Service Account
b8173300fa Merge "display: Add support for dynamic refresh rate" 2014-09-20 13:38:37 -07:00
Linux Build Service Account
eec6c637cd Merge "hwc: Fix Line to Block switch on primary for targets with DMA Multiplexing" 2014-09-18 18:37:02 -07:00
Arun Kumar K.R
a727a888ba display: Add support for dynamic refresh rate
- The primary panels refresh rate can be change by clients
- Required refresh rate will be set by client using metadata
- If there are multiple clients requesting, it will be used only
  when the refresh rates are equal, else it resets to default
- Set the new refresh rate only when there are only YUV layers
  updating or when the list has only one RGB layer updating
- MdpVersion gets the dyn fps capabilities from panelInfo

Change-Id: If3e7e6b2f028eb301399c4d32c748eed8a97c41f
2014-09-17 13:48:26 -07:00
Saurabh Shah
da3dfc9ce6 hwc: Bump up version to 1.4
Add support for setPowerMode HWC_POWER_MODE_DOZE and
HWC_POWER_MODE_DOZE_SUSPEND are treated equally.

getActiveConfig and setActiveConfig only support the default 0th
config for now.

Change-Id: I0303ed077409a66d9666c840cad8d917d7aad600
2014-09-15 10:01:45 -07:00
Justin Philip
535a1bdb2a hwc: Fix Line to Block switch on primary for targets with DMA Multiplexing
DMA multiplexing is supported on WB mode only.
For primary the DMA multiplexing should be avoided
as it can lead to hung rotator.
This can happen when the DMA is being unset from overlay,
while at the same time rotator gets configured.

Change-Id: I0c2cb8a5a1ebad8a8e4ed8107d5585836bc42451
2014-09-14 23:04:16 -07:00
Manoj Kumar AVM
9591a5e8cd hqd: virtual display code clean up
Remove V4L2 based virtual display functions as it is
no longer used.

Change-Id: Ibd7685791de6baa1bbf12ffe343443fcd7725269
2014-09-02 19:50:23 -07:00
Linux Build Service Account
f381384919 Merge "hwc: Reset ROI for all the prepare calls." 2014-08-31 11:35:33 -07:00
Manoj Kumar AVM
fb472b0553 hqd: Do not process WFD teardown as part of HDMI connection
WFD teardown was required when HDMI is connected on V4L2
architecture. This is because WFD connection is using HDMI
piggyback connection. Since SurfaceFlinger can honour only
one active external display, we have to teardown WFD
connection to process HDMI connection.

This is no longer applicable on VDS architecture. WFD connection
is established using Virtual Display adapter.
WFD Stack listen to HDMI broadcast event and initiate wfd teardown.

Change-Id: Iaca249f4f45193f02d32ac0ab56d68ce85e8c9a3
2014-08-27 13:45:14 -07:00
Jeykumar Sankaran
f53022a2ca hwc: Reset ROI for all the prepare calls.
Partial update ROI needs to be reset at the beginning of every
frame even when we don't have any application layers.

Change-Id: Ib4b604dfa9b589e59150ecc66f48a396f0b37af5
2014-08-22 17:08:52 -07:00
Ramkumar Radhakrishnan
3d863777c5 hwc: Remove external only feature related code
External only feature is completely handled in surfaceflinger, remove
unwanted code churn related to external only feature from display HAL.

Change-Id: If4f4f3fa8e91a5b8387e426b9e190abd2b06d793
2014-08-13 15:13:50 -07:00
Saurabh Shah
c46cf9d26b overlay: Add support for rotator downscale
Add support for rotator downscale. This is enabled from 8994 onwards
Constraints:
--Downscale should be a power of 2, max upto 32
--Both directions should have equal downscale
--{src_w, src_h} mod downscale = 0
--No BWC
--No Interlaced video support

The rotator's destination rect is modified to reflect the presence of
downscale. Any downscale calcs should be done only after adjusting
crop to meet rotator's requirements.

Smaller downscale is used if we need to chop off any more than 1
line or pixel.

Change-Id: Id07d62fefa3213035f16cca49497800716484a95
2014-08-08 10:19:18 -07:00
Linux Build Service Account
995d0a8ac9 Merge "display: remove compiler warnings" 2014-06-20 18:39:25 -07:00
Shalaj Jain
a70b435d10 display: remove compiler warnings
Use correct typecasts and format specifiers and resolve
compiler warnings

Change-Id: I51b12ecb78a9a496cf1f76c3d32892a203f70c43
2014-06-19 15:44:51 -07:00
Ramkumar Radhakrishnan
9d20b39e4a hwc: Rotate RGB layer using MDP Rotator
1. Use MDP rotator to rotate RGB layers which are rendered by software
2. Restrict total number of rotator sessions to 4 for all displays
3. Disable RGB layer rotation for all MDP versions < MDP5

Change-Id: Ie93111082dff9a16b614e9768df5d8ce83ff9e25
2014-06-16 12:10:40 -07:00
Raj Kamal
4393eaa6d3 hwc: Avoid MDP draw if prepare is not successful.
If #AppLayers are 0 or exceed MAX_NUM_APP_LAYERS
return early from MDP draw.

Change-Id: I834c7b04a295fbd9b98374cade880992d995ad1f
2014-06-06 14:42:45 +05:30
Linux Build Service Account
8a81e76fa2 Merge "hwc: Full MDP Composition mode with overlap region removal" 2014-06-02 16:52:47 -07:00
Linux Build Service Account
a3041b1762 Merge "hwc: Allow WB to be active during VDS pause state." 2014-06-02 00:55:05 -07:00
Linux Build Service Account
3da907e6fa Merge "hwc: Add display ROI in HWC dumpsys" 2014-06-01 18:10:19 -07:00
Sushil Chauhan
defd352e10 hwc: Full MDP Composition mode with overlap region removal
MDP bandwidth limitations can be avoided, if the overlapping region
covered by the smallest layer at a higher z-order, can be composed
on a render buffer using Copybit, and then it can be queued to MDP
along with other layers. It helps to improve performace by avoiding
GPU Composition in use cases like Home Screen pan. To enable this
feature, set system prop "persist.hwc.ptor.enable" to "true" or '1'
and enable Copybit HAL compilation.

Change-Id: Ib719d3dd42477837519518cc427f1b95356c28f7
2014-05-30 13:59:16 -07:00
Raj Kamal
e012e0e3cd hwc: Allow WB to be active during VDS pause state.
* Revert commit 7a495b3caa
"hwc: Call blank IOCTL on virtual as well if it is connected."

* On issuing suspend when WFD is connected, display-hal
receives both pause and blank calls. Calling StopTerminate
ioctls on WB(WB is not active on VDS pause) once blank
is issued on Primay(i.e when iommu is detached) doesn't free
up the buffer nodes resulting in orphaned memory blocks.

* To avoid this, allow WB to be active even during
VDS pause state so that when StopTerminate calls are made as
part of VDS teardown, display will be in unblanked state and
iommu would have been reattached, thus freeing up the buffer
nodes.

* Doing this doesn't clear all references to WB fb node during
VDS pause. Call display commit to unset the pipes rather than
relying on the refcount

Change-Id: I6f89c2ca56ea8a0133e66f3928f6e35ca94d9b52
2014-05-29 04:56:18 -07:00
Jeykumar Sankaran
6850ac64c5 hwc: Add display ROI in HWC dumpsys
Add ROI generated for each display in their dumpsys data.

Change-Id: I41fb79af9d42abc11ff147d18a600fd4ad60ab6c
2014-05-27 10:50:37 -07:00
Ramakant Singh
0def28c653 hwc : Add support for single layer Bypass in MDP3
If the display list contains single layer and that layer
has same properties as Frame Buffer, avoid BLIT on Frame buffer
and pass it directly to display.

Change-Id: I24decaca4788432a55b550caa2a1354a670cd6fa
2014-05-26 13:56:36 +05:30
Linux Build Service Account
b0f6b4cc49 Merge "hwc: Fix compiler warning" 2014-05-25 05:44:47 -07:00
Linux Build Service Account
386f201efd Merge "hwc: Call blank IOCTL on virtual as well if it is connected." 2014-05-21 00:13:19 -07:00
Jeykumar Sankaran
54a8018c6f hwc: Fix compiler warning
Fix compiler warning messages due to narrowed conversions.

Change-Id: Ifa770683fa9af7d5280c9117520276e04100302c
2014-05-20 10:05:46 -07:00
radhakrishna
7a495b3caa hwc: Call blank IOCTL on virtual as well if it is connected.
- If virtual display is connected, call blank IOCTL on it as well
- Clear writeback object on blank, as pause/resume functionality
implemented in VDS takes care of sending black frame on suspend.

Change-Id: Ibce682beaf6e58200fc963202aa5b1905fcf1257
CRs-Fixed: 661438
2014-05-19 16:35:00 +05:30
Linux Build Service Account
3cc3fa5dff Merge "hwc: Extend partial frame update for split displays" 2014-05-19 01:02:05 -07:00
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
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
Ramkumar Radhakrishnan
2b9b245107 hwc: Use layerIndex while populating hw layers
Use layerIndex instead of dpy while populating layers from the layer
list of each display.

Change-Id: I6bb4401482afc859447b58fcb6c5daa11a23fcd8
2014-05-01 12:05:28 -07:00
Linux Build Service Account
e4eae8c893 Merge "Revert "hwc: Do not re-program H/W, if the frame geometry has not changed"" 2014-05-01 00:16:04 -07:00
Linux Build Service Account
fc7340b821 Merge "HWC: Update DisplayFrame of all layers properly in Dynamic FB" 2014-04-30 22:03:41 -07:00
Jeykumar Sankaran
1e15611ed4 Revert "hwc: Do not re-program H/W, if the frame geometry has not changed"
This reverts commit 5e268fcf56.

Reason: Breaking cache based composition strategy and partial
update feature.

Change-Id: I0c881c8e2bc6be2a0b3dc0d5e7d22a388179f8d8
2014-04-30 12:18:23 -07:00
Linux Build Service Account
64e1ce83b7 Merge "hwc: Add target specific checks in hwcomposer" 2014-04-28 22:26:59 -07:00