Commit Graph

35 Commits

Author SHA1 Message Date
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
Manoj Kumar AVM
bffa0695d4 hqd: vds: Use aligned width/height to detect need for MDP scaling
Use aligned width and height to check whether we need mdp scaling
for WFD use-case.

Change-Id: I8bbb0b9fb6ccec9f9798f37f9ea6ca38f69792c0
2015-01-28 12:12:04 -08:00
Naseer Ahmed
73d15795c7 hwc: Add padding round on virtual display
This makes sure pipes are detached from the primary display when
a virtual display comes in so that there is a chance of the
virtual display getting at least one pipe.

Change-Id: I34e11a05385555ca18b7f2d16bd429819f4ca689
2014-11-25 20:07:32 -05:00
Arun Kumar K.R
33888f5b1f display: Add setSecondaryDisplayStatus API
- Clients(SecureUI/WFD FW) will use this API to set status of the
  Secondary display
- Status can be offline/pause/resume
- Secondary display will be hdmi/wfd, HWC will free up pipes for
  these displays

Change-Id: I25d5e070b60c38daeb102349bed14bb6de0a5684
2014-10-23 10:30:02 -07:00
Linux Build Service Account
1192cd2bd6 Merge "hwc: Clean up ExternalDisplay class" 2014-09-27 13:37:06 -07:00
Naseer Ahmed
9eb5e09577 display: Fix warnings
Treat warnings as errors again

Change-Id: Ibd7f484d31ad420b85e82fd5183d70bf7dce4bfa
2014-09-25 16:11:15 -04:00
Tatenda Chipeperekwa
03d5df265c hwc: Clean up ExternalDisplay class
1. Remove hwc_context_t from libexternal since this is a construct
   that should only be used in libhwcomposer.
2. Clean up redundant code by creating utility functions to
   a. open a sysfs node in a given mode
   b. improving EDID mode storage/manipulation
   c. creating/destroying composition objects
3. Add utility functions to
   a. get the connected state of the external display
   b. determine which interface the external display is connected to
      (primary or external)
   c. activate the hdmi interface by setting the resolution via an
      ioctl
   d. update/reset external display information when a device
      connected/disconnected

Change-Id: Iba34c9e43b39ccb9c9436deb726587bd1b26b779
2014-09-25 10:20:11 -07:00
Tatenda Chipeperekwa
cb2a243608 hwc: vd: Add support for Dynamic Resolution Change (DRC)
1. Add support for Dynamic Resolution Change

We add support for DRC on virtual displays. This is achieved
by reading the width and height attributes that are set as
part of the buffer handle metadata.

For the WFD use cases, the WFD  MultiMedia framework will
update the width and height during DRC by using setMetaData
API with UPDATE_BUFFER_GEOMETRY. We then proceed to configure
WB with the new resolution for subsequent frames.

2. Update WB dump with output buffer format and resolution

Update WB dump with output buffer format and resolution. This is
helpful for debugging purposes.

Change-Id: I537277499041bffc7bfc5c6e3d024b67f80fce44
2014-09-15 11:12:35 -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
6e6092c892 Merge "hwc: vd: Dynamic dumping of frames for virtual displays" 2014-08-31 04:40:58 -07:00
Tatenda Chipeperekwa
06af9cb739 hwc: vd: Dynamic dumping of frames for virtual displays
Provides a way to enable/disable dumping of virtual display
frames at runtime via binder. The dumping needs to be enabled
from a priviliged shell.

For example,
$ adb shell service call display.qservice 15 i32 3 i32 1

Here 15 is the integer code for DYNAMIC_DEBUG in IQService.h
The first parameter 3 is for DEBUG_VD
The second parameter 1 is to enable.

Change-Id: Idd62c5d9ffa6e4eb7dec585984d145bc6a421336
2014-08-28 09:08:54 -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
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
Raj Kamal
5ef25b84f0 Revert "Set priority among various display devices"
* This reverts commit 52b4fdbdbd.

* Since DisplayDevices are not created for non-wfd virtual
displays(CTS/SR/SSD) anymore, we can remove these checks.

Change-Id: I9249a70c6d6f6b42f268e6ec8a28c0a86b954c4e
2014-07-16 23:27:01 -07:00
Tatenda Chipeperekwa
523eac5717 hwc: vds: Add support to dump layers, FB and WB output buffer
1. Add hook to dump the layers going to VDS based virtual display.

2. Furthermore, add utility function to dump the frame buffer and
   WB output buffer. This will be enabled via a system property

   debug.hwc.enable_vds_dump

   Once dumping is enabled, the dumps can be extracted from

   /data/vds.fb.FORMAT.XRESxYRES.raw
   /data/vds.wb.FORMAT.XRESxYRES.raw

   e.g. vds.fb.MDP_RGBA_8888.1152x1920.raw

Change-Id: I2435c5507961a52929411206892c005492d5c193
2014-06-10 10:52:44 -07:00
Raj Kamal
df3d1d2a2f hwc: Invalidate at the end of VDS pause
* On Low-end targets, no secure video is displayed on primary
during WFD session due to lack of VG pipes.

* Once the secure video is paused, and WFD session is paused
from sink, paused secure video should be seen on the primary
due to the availability of VG pipes(which are no longer used
by external)

* Call invalidate at the end of VDS pause to make this happen.

Change-Id: Ia735be10e798b6a241a82239e3a136efb54e72f3
2014-06-03 08:24:43 +05:30
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
Saurabh Shah
ef19fe3224 hwc: Clear overlay and layer-rot map from caller
Clear overlay and layer-rot map from the top level caller of
composition, rather than from the place of actual intermediate
failure. This makes sure, even in cases of GPU comp failure,
overlay and layer-rot maps are cleared and eventually pipes unset.

Change-Id: Ibf1152a0e8ca66d87bcc6b87009c4b09e451099d
2014-04-22 15:31:58 -07:00
Raj kamal
59fea567e1 Display and wfd synchronization during teardown
* Provide a binder interface call for wfd module
to inform display about the start/stop/pause/resume
of wfd session.

* This is needed for wfd-hdmi synchronization in
case of v4l2 wfd solution. If hdmi is plugged
in during v4l2 wfd session, display-hal waits in
uevent thread for wfd teardown notification from
wfd module, before going ahead with configuring
external display.

* For VDS WFD solution, display-hal waits in uevent
thread for wfd-teardown to be signalled from
the composition thread.

Change-Id: I9514cb5bc7ff81de0b5dd4cdf66d8286a64ba094
2014-04-15 14:15:59 +05:30
Praveena Pachipulusu
d9443c7e81 hwc: Use proper typecasts
- Remove compiler warnings
- Use proper typecasts

Change-Id: I7391f32ae31283239f5cebb93b02f3ce3a5c99f3
2014-03-28 09:17:43 +05:30
Tatenda Chipeperekwa
8f1b9d719e hwc: Extend pause/resume functionality to VDS displays
Add support to handle pause/resume for virtual displays connected
either using VDS approach.

Change-Id: Iabd01c5597f2399ccc7f83712bda1a2c1103788d
2014-03-24 12:36:56 -07:00
Baldev Sahu
ec852384f2 Rely on list->outbuf rather on mVirtualonExtActive
* Rely on list->outbuf rather on mVirtualonExtActive
to determine a virtual display device

* This helps in cases where SSD/SR is started after
a non-Hybrid WFD session becomes active. We need
to update retireFenceFd of SSD/SR which used to not
happen since mVirtualonExtActive is set becomes of
an active non-Hybrid WFD session

Change-Id: Ib42af62e723b5f62f62a1a8d280f0c9af49683d7
2014-02-14 08:56:07 +05:30
Manoj Kumar AVM
0901c04448 hqd: Fix validate and prepare frame for virtual displays
Extend validate and prepare frame functionality for
virtual displays.

Change-Id: I266f35d8581ac2de04c5ce22e51b267a48955e46
2014-02-11 17:39:35 -08:00
Linux Build Service Account
25154792a5 Merge "hwc: vds: Display HAL changes for VDS based solution" 2014-02-06 06:20:39 -08:00
Linux Build Service Account
2f4752f7f0 Merge "hwc: vds: Configure WB as secure if output buf. handle is secure" 2014-02-06 06:20:38 -08:00
Tatenda Chipeperekwa
d6a8d4b288 hwc: vds: Display HAL changes for VDS based solution
1.  Hard code the vsync for VDS during the first prepare call
    with valid VDS display. We align the vsync period to that
    of the primary display. Effectively, we produce at the at
    the primary refresh rate and do not worry about the consumer.

2.  Do not bail out on the first frame as it leads to showing empty
    buffer. This leads to failures for some test cases such as those
    run in CTS.

3.  We need an FB layer handle check to cater for this usecase:
        i. Video is playing in landscape on Primary
        ii. Launch ScreenRecord app
    In this scenario, the first VDS draw call will have HWC
    composition and VDS does not involve GPU to get eglSwapBuffer
    to get valid fb handle.

Change-Id: Idc7d989e244a83ad28ce730ecb12955bc249dc25
2014-02-03 15:16:15 -08:00
Tatenda Chipeperekwa
92961f88e4 hwc: vds: Configure WB as secure if output buf. handle is secure
When we receive a buffer handle that is secure, we configure WB as
secure; otherwise we continue as normal.

Change-Id: I497e257352c103c5da7ac2dc3fd4d7fe0e0b3953
2014-02-03 15:14:15 -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
Linux Build Service Account
3a61a7c777 Merge "hwc: Drop alpha from writeback" 2014-01-30 07:23:28 -08:00
Linux Build Service Account
90dbb20f26 Merge "Set priority among various display devices" 2014-01-30 07:20:51 -08:00
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
Tatenda Chipeperekwa
a2fdebee45 hwc: Drop alpha from writeback
The alpha in the writeback is unused right now. Force MDP to use
RGBX for composing writeback.

Change-Id: I3d92338ced8bb98fd0515107d84c306992a3c133
2014-01-27 16:12:41 -08:00
Tatenda Chipeperekwa
b0a9f9d7d2 hwc: virtual display: Use outbuf handle width to configure xres
Use outbuf handle width to configure display xres, since that would
have the necessary alignment. The outbuf is guaranteed to be valid
by the framework during hwc_prepare.

We use the framebuffer layer's display frame to obtain the actual
width. For example, the actual width could be 720 but the aligned
width would be 736.

Change-Id: I5afe38001be8116e1ad6a9f46c7ecaa50b5f25a2
2014-01-22 11:49:03 -08:00
Tatenda Chipeperekwa
f19f84dd05 Copy virtual display FB to outbuf even with no app layers
In the current composition strategy we bail out if there are no app
layers present. However, this leads to undesirable behaviour if the
FB contains valid data that is expected as output. In this patch we
copy the FB to the output buffer to satisfy this use case.

Change-Id: If905d8b0652faf73b9aecad1abc760f21967807f
2014-01-22 11:48:54 -08:00
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