Commit Graph

249 Commits

Author SHA1 Message Date
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
Linux Build Service Account
642ce38173 Merge "hwc: Reset PTOR information" 2015-03-29 10:45:15 -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
Saurabh Shah
bec338cede hwc: Check for display connection before calling commit
In some transition scenarios for external display, it can be
disconnected just before the power mode setting's display commit
goes through. This will cause the display commit to fail, which is
harmless in this context, but it causes false-negatives in test
scripts.

This patch checks if the external display is still connected
(and thus implicitly if the fd is valid) before calling a commit.

Change-Id: I386f0a951344c2aba2f8944e712df40e203d10ae
2015-03-23 18:28:55 -07:00
Linux Build Service Account
2ce22c9b76 Merge "hwc: Support for reading FB format from driver" 2015-03-23 00:01:28 -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
Linux Build Service Account
314fa53035 Merge "hwc: Handle DOZE_SUSPEND properly" 2015-03-14 12:40:45 -07:00
Linux Build Service Account
5b4a18f358 Merge "hwc: Add support for panel resolution switch" 2015-03-14 08:49:40 -07:00
Naseer Ahmed
6dd8398911 hwc: Handle DOZE_SUSPEND properly
DOZE_SUSPEND is the lowest power state with the display still on.
With DOZE, we can still have updates. With DOZE_SUSPEND, MDP
clocks are off and no update can happen. This is applicable only for
wearables and doesn't happen in doze in handhelds/tablets.

Change-Id: I10fe467a099ead3b0b56a01fec0fb18e1ad78580
2015-03-10 16:41:12 -04:00
Linux Build Service Account
801e76c3b3 Merge "hwc: Return failure from hwc_device_open when fb open fails" 2015-03-09 17:15:58 -07:00
Saurabh Shah
90c55cfcf8 hwc: Add support for panel resolution switch
Add support for panel resolution switch. This feature makes use of
the Linux modedb feature that lists available modes in
/sys/class/graphics/fb0/modes and accepts a mode change when written
to /sys/class/graphics/fb0/mode

Clients can link to APIs exposed in display_config.h, these
internally resolve to binder calls into HWC. For debugging, mode
changes can be made over binder using shell commands.
adb shell service call display.qservice CODE ARGS
ARGS can include config index and display (only primary supported)

setActiveConfig():
adb shell service call display.qservice 25 i32 INDEX i32 0
getActiveConfig():
adb shell service call display.qservice 26 i32 0
getConfigCount():
adb shell service call display.qservice 27 i32 0
getDisplayAttributes():
adb shell service call display.qservice 28 i32 INDEX i32 0

Change-Id: I97d34cc9c0e521a3bd5c948eeea6d1e07db7b7ff
2015-03-09 14:50:01 -07:00
Linux Build Service Account
2aac39b610 Merge "hwc: Add app buffer composition(ABC) flags in dumpsys" 2015-03-06 06:46:32 -08:00
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
Ramakant Singh
16f751065e hwc: Add app buffer composition(ABC) flags in dumpsys
We can check ABC status for each usecase in sf dumpsys.

Change-Id: I154fc908e19128b618feedf6d8093c7d85b97043
2014-11-17 05:55:21 -08: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