Commit Graph

83 Commits

Author SHA1 Message Date
Manoj Kumar AVM
fac1b844cb sde: fix qservice compilation issue
Fix ambiguous overloading error by proper type casting
to IQClient.

Change-Id: Ibec88935dfe9474e24d6b33294d8defd13f75b98
2015-03-04 15:08:58 -08:00
Ken Zhang
d9408eb428 sde: resource config: rotator downscaling and z_order setting
1.Select the smaller downscaling ratio for both sides as
rotator needs do the same downscaling for both direction.
2. Use rotator to do the minimum downscaling first to get the
best quality. Use decimation when rotator downscaling is
not enough.
3. Assign z_order when doing resource configuration.
4. For non src split case, if two pipes are on one mixer,
need make sure right pipe has the different z_order.

Change-Id: I1b829545053c2b719da8b6b42c1e5341a5040bcc
2015-03-02 20:51:52 -05:00
Linux Build Service Account
e2280aad76 Merge "sde: resource config: rectangle alignment for video and rotator" 2015-03-01 23:09:41 -08:00
Linux Build Service Account
9c038d7894 Merge "sde: Fix klocwork errors" 2015-03-01 23:09:38 -08:00
Sushil Chauhan
0db1b8955f sde: Fix klocwork errors
Klocwork errors are reported when display HALs are enabled with SDE.

Change-Id: Ic3e35096cefbfe716f3a3e44138a2f8af9d77bbf
2015-02-26 18:43:52 -08:00
Ramkumar Radhakrishnan
b327d5982b sde: Add set power mode support for virtual display.
1. Set the power mode for virtual display while setting power mode for
   primary, as surfaceflinger does not invoke SetPowerMode() for
   virtual display.
2. Invoke null commit on each display to release all the pipes connected
   to it on SetPowerMode().

Change-Id: I8992850a7acbfdf8ab0de3216d92cf4f28fbaaeb
2015-02-26 16:25:59 -08:00
Linux Build Service Account
8cbfacc8d3 Merge "sde: Fix for out of memory and invalid output format during rotation." 2015-02-25 22:07:06 -08:00
Ken Zhang
e2605ea20b sde: resource config: rectangle alignment for video and rotator
1. Align rectangle to be even for video format input.
2. Align width and height for rotator downscaling case.
3. Validate scaling again after config is done because scaling ratio
might be changed.
4. Make sure layer count doesn't exceed mixer stage number.
5. Add sde.disable_rotator_downscaling property for disabling
rotator downscaling.
6. Add sde.disable_decimation property for disabling decimation
7. Disable 2 pipes on non-display_split case temporarily as z-order
needs be different

Change-Id: Iec20c292552b23ff1a4135a6be1695fa8fb737de
2015-02-25 13:30:06 -05:00
Ramkumar Radhakrishnan
897f468d67 sde: Fix for out of memory and invalid output format during rotation.
1. Configure the rotator control parameters on every rotator commit
   to avoid concurrency issues with HDMI/virtual displays.
2. Pass the layer transform flag properly to SetOutputFormat() to
   determine the rotator output format.

Change-Id: I2394d7fa137bd5dd0f6a5c37b8b9050418f59c3b
2015-02-18 18:01:46 -08:00
Sushil Chauhan
9dd3831976 sde: Add support for using scalar library
Resource config communicates with scalar library to configure the
Scale data structure. Then HWFrameBuffer populates the Scale data
structure to mdp_scale_data structure of MDP input layer.

Change-Id: Ibdfea2d3ef38ca381b14ceccb65df583407fda02
2015-02-18 10:30:58 -08:00
Tatenda Chipeperekwa
2ba9789b07 sde: Move utility functions to common header file
Move utility functions to common header file accesible from
SDE and HWC modules.

Change-Id: Id5183bb8f41a223273c973960f653f155e3c4c05
2015-02-17 12:26:34 -08:00
Manoj Kumar AVM
b86bc17763 sde: Define rect utility functions.
Define rect helper functions used by SDE.

Change-Id: Ib8e0bc9493a40fa59a3cf90a115352edd4264a92
2015-02-10 18:09:06 -08:00
Ramkumar Radhakrishnan
84fdd2db94 sde: Add support to disable animation on external display.
1. Compose the first animating frame using GPU on external display.
2. Set composition type of subsequent animating frames as SDE
   composition and update cached framebuffer to external display.
3. Close the releasefence fd of framebuffer target during animation.

Change-Id: I674efa1821c8fc2fa0c3f9ccee88e25b70f75f9d
2015-02-10 18:07:56 -08:00
Linux Build Service Account
3c53d380f3 Merge "sde: Implement sequence locker to lock across multiple APIs." 2015-02-09 08:12:44 -08:00
Linux Build Service Account
393678d60f Merge "sde: Add support for input and output layer dump" 2015-02-09 08:12:38 -08:00
Manoj Kumar AVM
0359243f0e sde: Fix for external displays
1. When non-primary displays are registered, set composition mode to
   safe mode until resources for the added display is configured
   properly.

2. Fix HDMI mirroring issue on framework reboot.
   It could be possible that HPD is on during framework reboot.
   HDMI driver needs HPD toggling to send uevent to userspace.
   Disable HPD at start if HDMI is external, it will be enabled later
   when the primary display powers on.

Change-Id: I27f27af3f6d525bd3697f5d5edd838f04003ff61
2015-02-04 20:39:55 -08:00
Ramkumar Radhakrishnan
952081f9ed sde: Add support for input and output layer dump
1. Add support to dump the input layers for all displays or each
   display separately.
2. Add support to dump output layer for virtual display.
3. Add binder support to enable dump on each display, to enable dump
   for input/output layers, and to set number of frames to be dumped.

Syntax:
  adb shell "service call display.qservice 21 i32 <FRAME_COUNT> i32
             <DISPLAY_TYPE> i32 <LAYER_TYPE>"

  FRAME_COUNT  = Number of frames to be dumped.
  DISPLAY_TYPE = 1 -> To enable dump on primary display
                 2 -> To enable dump on hdmi display
                 4 -> To enable dump on virtual display
  LAYER_TYPE   = 1 -> To enable input layer dump
                 2 -> To enable output layer dump

To dump 2 frames of input and output layers on virtual display:
  adb shell "service call display.qservice 21 i32 2 i32 4 i32 3"

Change-Id: Ifb3e6a7554e0012495f6f5858d6e32ff8fee6bec
2015-02-04 15:16:01 -08:00
Ramkumar Radhakrishnan
ef83526f6a sde: Implement sequence locker to lock across multiple APIs.
1. Lock prepare() and set() APIs using sequence entry and sequence
   exit lock respectively to prevent the critical section being
   accessed by other threads.
2. Wait for sequence wait lock on HotPlugEvent thread or any other
   binder threads(Eg. dumpsys), before it accesses the critical region.
3. Prevent deadlock during multiple prepare() calls before a set().

Change-Id: I5443675c870ed2967615ec383dd2d59ded30b52b
2015-02-02 18:07:38 -08:00
Ramkumar Radhakrishnan
94c27a389b sde: Add support for virtual display
1. Create virtual display, if the current virtual display list is
   valid and the output buffer handle is not NULL.
2. Configure input and output layers of writeback for the composition
   using writeback.
3. Propagate the retire fence back to framework, so that the consumer
   will wait for retire fence before it consumes the output buffer.
4. Recreate the virtual display, if the width, height or format of the
   output buffer changes.
5. Destroy virtual display, if the current virtual display list is
   invalid or the output buffer handle is NULL.

Change-Id: I096575381da3db1d0c7b7270bc55c5d936b9f5a8
2015-01-30 08:20:11 -08:00
Ramkumar Radhakrishnan
befbdbe6ff sde: Add Support for UI/Video rotation using SDE rotator
1. Implement Buffer manager to allocate and deallocate output buffers
   for rotator.
2. Assign buffer slot for each layer requires rotation and manage the
   internal state of buffer slot in buffer manager.
3. Get the output buffer for each layer requires rotation from buffer
   manager and associate the information along with that layer.
4. Create/Destroy the rotator session from the hint provided by buffer
   manager. This is required to help driver to calculate the bandwidth
   for the current frame.
5. Validate the rotator configurations and submit the rotation job
   using rotator validate and rotator commit ioctl.

Change-Id: I1bc1de05042f64d5f32e95ac6226890fa4fabd24
2015-01-30 08:19:57 -08:00
Ramkumar Radhakrishnan
7ebf034c5f sde: Add support to systrace.
1. Define an interface between hwcomposer and display engine to collect
   systrace for a module in display engine.
2. Implement the functionality of conditional ATRACE_BEGIN/ATRACE_END
   in hwcomposer.

Change-Id: I441d06397a2618f87f132c8037ca83d5fc13b07c
2015-01-30 08:16:37 -08:00
Ramkumar Radhakrishnan
a35a2735d2 sde: Add support for idle fallback.
1. Set idle timeout value to driver through sysfs interface for
   primary display.
2. Get notification about idle timeout from driver and fallback to GPU
   composition.
3. Avoid idle fallback, if there is only one application layer.
4. Define a binder interface to set the idle timeout value through adb.
   (Eg. adb shell "service call display.qservice 16 i32 70")

Change-Id: If0cfcbea140580803ad8a67ac9425db86c0f75bb
2015-01-28 19:12:12 -08:00
Linux Build Service Account
c56295232f Merge "sde: Add support for flush." 2015-01-28 10:44:03 -08:00
Linux Build Service Account
757a959364 Merge "sde: resource manager: rotator output config" 2015-01-28 10:44:01 -08:00
Linux Build Service Account
0da1c10772 Merge "sde: Add support for UBWC in display engine" 2015-01-25 13:11:26 -08:00
Linux Build Service Account
e8bb45d688 Merge "sde: Add decimation support for downscaling." 2015-01-21 22:42:22 -08:00
Ramkumar Radhakrishnan
e314375fbb sde: Add decimation support for downscaling.
Configure decimation factor to MDP, if a layer requires to be
downscaled more than that of maximum MDP downscaling limit.

Change-Id: Ib36173f2458bf0554b4dd9de18521f6dff65a625
2015-01-21 17:09:14 -08:00
Linux Build Service Account
5945ab4920 Merge "sde: Add support for video playback with SDE." 2015-01-21 15:38:05 -08:00
Dileep Marchya
25927a6b47 sde: Add support for flush.
Add support for flush on a display. This flush shall release pipes,
all pending buffers and associated fences that are currently held
by display engine.

Change-Id: I8a8d7030fb6af031b3760c172fce4f1f8ef3fedc
2015-01-21 13:12:52 -08:00
Sushil Chauhan
cfee3f3d6e sde: Add support for UBWC in display engine
SDE checks for PRIV_FLAGS_UBWC_ALIGNED bit in private handle flags
and sets the corresponding UBWC aligned LayerBufferFormat. Driver
expects UBWC specific pixel formats defined by MDP header.

Change-Id: Iaf86c4d7433dc9628b1cf8d7fb8872ab4f1f0a39
2015-01-20 16:40:57 -08:00
Ramkumar Radhakrishnan
b56c7a9272 sde: Add support for video playback with SDE.
1. Set the video and secure flag of the layer buffer flag properly.
2. Normalize the crop rectangle of the layer to even values.
3. Handle one pixel downscale usecase, as MDP hardware dont support it.
4. Set the hint flag for each layer qualified for SDE compoisition to
   notify surfaceflinger to clear the layers destination region in FB.

Change-Id: I20239e79db3ea90e0d4fdcb6953b8b70d703b4fc
2015-01-16 11:31:11 -08:00
Ken Zhang
d8990c0aec sde: resource manager: rotator output config
Rotator might be used for downscale only. Output
ROI should not swap if there is no rotation.
Do not print out error log when the input is wrong,
Lua test will treat them as failures.
Add some more logging for rotation.
Checking for over width limit should only be greater.

Change-Id: Ib60bee3153e833ae3906169c216305f63f07f14b
2015-01-15 17:12:01 -05:00
Arun Kumar K.R
ecae9b2881 sde: Add support resolution change on HDMI and fix comp_manager
- Provide a debug hook to change resolution on HDMI.
- Config(edid) set by user is validated before setting and this
  overrides the best mode
- Add max_attempts in strategy interface which will be used for
  looping through the strategy selection which removes infinite loop
- Set Max SDE layers on HDMI as 2
- Fix incorrect sde layer index in Dump

Change-Id: I9ae1d0b115a06774470be5c0f9b78c4d930b7065
2015-01-12 14:41:05 -08:00
Linux Build Service Account
bbfaced6b5 Merge "sde: Read simulation flag" 2015-01-09 18:23:47 -08:00
Linux Build Service Account
9aeed64e96 Merge "sde: resource manager: rotator resource allocation" 2015-01-08 16:42:50 -08:00
Manoj Kumar AVM
4746f24733 sde: Read simulation flag
Read simulation flag from "debug.hwc.simulate" property.

Change-Id: Ia0dfe88d5d579985a2c1fcd58e83e0cc5583ef15
2015-01-08 12:10:24 -08:00
Linux Build Service Account
53d094e3dc Merge "sde: Handle suspend on HDMI" 2015-01-07 19:38:04 -08:00
Linux Build Service Account
df55ada919 Merge "sde: Fix the fps value read from HDMI driver" 2015-01-07 19:37:41 -08:00
Linux Build Service Account
9dc4222a5c Merge "sde: Close acquire fence fds, if display commit fails." 2015-01-07 15:52:46 -08:00
Linux Build Service Account
6712d3fffc Merge "sde: Add support for horizontal and vertical flip." 2015-01-07 15:52:45 -08:00
Ken Zhang
a80bdd8d7f sde: resource manager: rotator resource allocation
Only mark dedicate block for rotator allocation. Use
rotate array other than left_rotate and right_rotate.
Use bit mask to indicate rotation usage because rotation
can be shared by multi displays.

Change-Id: I70bd03250080a24dcf7f38c39dbd6391c0bba97c
2015-01-07 14:43:56 -05:00
Arun Kumar K.R
41c33b9c3f sde: Handle suspend on HDMI
On suspend, HDMI interface should not be turned off.
Just unstaging the pipes is enough, so call commit with
0 layers.

Change-Id: Ieb297d8c9660a3e04171b166cc5c8e22069eb6d9
2015-01-06 19:08:16 -08:00
Ramkumar Radhakrishnan
0142f2ce73 sde: Close acquire fence fds, if display commit fails.
Close acquire fence fd of all layers, if display commit fails. This
is required to avoid fd leaks.

Change-Id: I12d44ddc0d1e378374c64a1808e7a19f071209be
2015-01-06 15:42:06 -08:00
Ramkumar Radhakrishnan
1f2d1b9297 sde: Add support for horizontal and vertical flip.
Set flip flags in the driver interface to notify driver to do
horizontal/vertical/both flips using MDP.

Change-Id: Idbbffcc835a4779da5fb497a891ba5b8d9ec66b1
2015-01-06 15:38:37 -08:00
Ken Zhang
8a7f0fd540 sde: resource manager: rotator support
Use rotator when 90 rotation or downscaling is needed.
Configure rotator input/output ROI, acquire source pipe
and writeback block for the rotator.

Change-Id: I4b8348714eade9a57e553f0f23e6b0b62dd32bad
2015-01-06 10:33:24 -08:00
Ken Zhang
7172e07f53 sde: resource manager: add src split support
Handle source split support case, allocate two pipes when the src
width or dst width is over the limit.

Change-Id: If17fb96f82973653caa400157d210e636b2c1725
2015-01-06 10:33:16 -08:00
Ken Zhang
c49f0585c7 sde: resource manager: multi display support
Move some state info into display ctx.
Reorganize layer config for display split config case.
Add macro tile format check for scaling limit difference.

Change-Id: If9c3bed6161343828c14f784f69269c181510223
2015-01-06 10:32:59 -08:00
Sushil Chauhan
794590b407 sde: Fix the fps value read from HDMI driver
As per HDMI driver specs, the refresh rate should be divided by 1000,
to get fps in Hz.

Change-Id: I7de7c3c8f9c6df67dd3ec403625ed58f5e2a0fb7
2015-01-05 17:45:11 -08:00
Linux Build Service Account
6de1a59d65 Merge "sde: strategy interface changes" 2015-01-03 04:23:33 -08:00
Sushil Chauhan
2550def04f sde: Get new metadata values from driver
Get new metadata values: max pipe bandwidth, max sde clock rate and
clock fudge factor. They are needed for bandwidth and clock checks.

Change-Id: I16078c6a707f5a81aa0eb2690b756df732fec218
2014-12-30 21:01:50 -08:00