Commit Graph

109 Commits

Author SHA1 Message Date
radhakrishna
b8e2c95763 hwc: Populate frame rate in rotator set
- Populate frame_rate in rotator set, so that driver
  can vote for honest BW for rotator based on frame rate.
- If metadata contains source fps, frame_rate will be set
  to source fps, else it will be set to primary refresh rate.
- frame_rate will be populated for primary with
  source fps from metada, only when secondary is not active.

Change-Id: Icaacd0ed67ec09591d31868591680d2e86fe54a2
2015-06-05 12:30:33 +05:30
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
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
Naseer Ahmed
6bbd0a14a5 display: Support for S3D video
1. Add support to set HDMI to 3D mode
2. Add binder API to force 3D mode
3. Switch to 3D mode based on metadata
4. Configure pipes appropriately
5. Only side-by-side and top-bottom formats are currently supported

Change-Id: Iae579ecfa45aae088ff543d4143e5025e8c682fa
2015-02-20 16:18:40 -05:00
Jeykumar Sankaran
89e23ab4cb liboverlay: Fix pipe priority mismatch on new allocations
With source split enabled:
1) When both LEFT and RIGHT pipes gets reused pipes, we use their
   pipe id's to compare their priority and swap them as needed.
2) When both LEFT and RIGHT pipes needs to be newly allocated, we
   let driver take care of the priority as long as both pipes are
   of same type. If different, we swap them according to the pipe
   type priority.
3) When LEFT is reused and RIGHT needs new allocation, we swap
   them only when they need same pipe type and LEFT has the
   pipe with lowest priority.
4) When RIGHT is reused and LEFT needs new allocation, we swap
   them only when they need same pipe type and RIGHT has the
   pipe with highest priority.

Change-Id: I320285aaca7ffc032e3b3b0832380a9c705bc4fc
2015-01-28 21:22:56 -08:00
Sushil Chauhan
65e26307e6 display: Add support for UBWC in display hal
1. Add support for UBWC allocation in the Gralloc APIs for aligned
width, aligned height and buffer size. A client can request for UBWC
allocation by sending UBWC specific HAL pixel format or by setting
GRALLOC_USAGE_PRIVATE_ALLOC_UBWC flag in the usage flags.

2. Gralloc allocates UBWC aligned buffer, only if format is supported
by GPU and MDP and no CPU usage flags are set. Otherwise it allocates
linear buffer.

3. If UBWC conditions are met, gralloc sets PRIV_FLAGS_UBWC_ALIGNED
in private handle flags to tell client that allocated buffer has UBWC
alignment. This flag remains unset by default.

4. Add helper functions in gralloc to calculate UBWC meta buffer size
for RGB* formats.

5. Add UBWC HAL pixel format HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC
which has been defined by Video module.

6. Add AdrenoMemInfo api to query, if GPU supports UBWC for a format.

7.MDP driver expects UBWC specific pixel format defined by MDP header.

Change-Id: I5b4344bc90aa498dbdb7bb8100e70ed7728e6ea5
2015-01-16 11:00:01 -08:00
Jeykumar Sankaran
3930580bb3 hwc: Use max pipe width instead of max mixer width for splitting
Not necessarily the max width supported by the MDP pipe and mixer
need to be same. HWC has to make the decision for using one OR
two pipes per layer only based on the max width supported by the
pipe not the mixer.

Change-Id: I5a2495d07de1b6f54ef64d9140c909f0f4cef914
2014-12-18 12:03:11 -08:00
Saurabh Shah
514759db1d hwc: always_split: Use pipe clock comparison to mixer to split
The layer clock is dependent on vertical downscaling and horizontal
dest width (pixels). When comparing to mixer's requirements,
line-time can be ignored since it is common to both pipe and mixer.
Also since mixer's scale is 1, layer's downscale * dest width needs
to be compared to mixer's width.

Change-Id: I6d28abc33f8a57a15101bf012b7706e163e2dc69
2014-11-12 16:28:01 -08:00
Justin Philip
d616660fe6 libhwcomposer: libgralloc Set MDP_SMP_FORCE_ALLOC flag
For PROTECTED but NON SECURE layers set MDP_SMP_FORCE_ALLOC flag
to allow SMP allocation and prevent GPU fallback
In Such cases if video resolution changes dynamically
it fails to display layer due to GPU fallback.
Use this flag for FB layer composition and depricate
MDP_BACKEND_COMPOSITION flag.

Change-Id: I9ab7cbdd2e12b56dfa67d5b4b3ff6b2dcd0096be
2014-10-21 21:34:30 -07:00
Linux Build Service Account
6df359bc75 Merge "hwc: Fix src split bugs" 2014-10-02 15:59:52 -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
Saurabh Shah
189f23d621 hwc: Fix src split bugs
--In "always_split" mode, split FB only if the updated portion of
FB's width is less than mixer width

--While deciding whether or not to allocate the 2nd pipe, account
for 90 transform in crop width

--Crop minimum width limitation of at least 5 pixels does not apply
to targets after 8974 v2.

Change-Id: I83b4690216a75c0d57e7e4e7b18b4531bb22df05
2014-09-29 14:50:33 -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
87c95944b3 Merge "hwc: Manipulate external display position for split and src split" 2014-08-31 11:36:10 -07:00
Linux Build Service Account
e182c7ee8d Merge "hwc: Remove getNonWormHoleRegion optimization for primary" 2014-08-23 07:59:06 -07:00
Linux Build Service Account
fa90e1e422 Merge "hwc\overlay: Remove support for foreground override" 2014-08-23 07:58:50 -07:00
Ramkumar Radhakrishnan
3b0d972786 hwc: Remove getNonWormHoleRegion optimization for primary
Remove getNonwormHoleRegion optimization for primary because.
1. This overrides fbUpdatingRect optimization for primary.
2. sourceCrop and displayframe are always full screen for primary.

Change-Id: Ic6867c23ace40fcf36657cbbf1293cb4eb171a67
2014-08-19 16:48:15 -07:00
Ramkumar Radhakrishnan
e1f433aa91 hwc: Manipulate external display position for split and src split
1. Query the actual dimensions of external display and manipulate
   the external display position, if MDP downscale is enabled
2. Manipulate the external display position if Actionsafe dimensions
   are set for external display
3. Manipulate the external display position if external orientation
   is set for external display.

Change-Id: I954b13950d61f4c38745d86e0c2d6090a5698ff0
2014-08-19 16:41:18 -07:00
Saurabh Shah
2c8ad05dcf hwc\overlay: Remove support for foreground override
Remove support for overriding a layer's z to set it up for foreground.
This is unused and can be achieved using pipes staged at required
z-orders.

Change-Id: Ia4688beed770c44c20d201a2dc5687252e002981
2014-08-15 13:27:46 -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
Prabhanjan Kandula
5bae9f5d35 qdutils : Read max mixer width from drivers.
Read the maximum width mixer can output from drivers
and consider this in identifying if dual pipes are required
to support a layer. So far above 2K dimensions we are using dual
pipes, but 8x39 mixer output can be upto 2560. So there is no
need of dual pipes as long as pipe data is less than this limit.
Compare layer/panel resolutions against this limit to deduce
if there is a need for dual pipes or split.

Change-Id: I52e1d28e381327d4f0b00f5ea8547c1e6157313c
2014-07-23 23:16:28 -07:00
Saurabh Shah
8ec9b5eda4 hwc/overlay: Get rot dest dimensions instead of manipulating source
Currently for Mdss rotator we manipulate the layer buffer dimensions
to be equal to what rotator's destination dimensions would be, so that
these could be fed to MDP. Instead, this patch introduces APIs in
rotator so that hwc can directly query destination crop, width, height,
format from rotator.

This also simplifies the updateSource() and configRotator() helpers.

Change-Id: I501d998f2e0574683c764af9422742b2426ba0c7
2014-07-02 09:58:42 -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
Linux Build Service Account
1e0e5cde58 Merge "hwc: Source Split layers always if indicated by driver" 2014-06-14 23:03:54 -07:00
Saurabh Shah
ea7a01d1cd hwc: Source Split layers always if indicated by driver
Source Split layers always if the driver indicates so by setting
the src_split_always in the capabilities sysfs node.
This is applicable to layers whose width > mixer's width, since
MDP clk rate is dependent on max(mixer_width, layer_width).

This feature can be enabled if the panel height is more than a
certain empirically derived value. Splitting always in those
cases can help with a lower voltage.

Change-Id: If9b33f11ca4132eb77416c26819f7473c65d3b08
2014-06-10 13:41:01 -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
Saurabh Shah
8f0ea6ff81 gralloc: Remove opaque types
Remove opaque types like size_t, uintptr_t, intptr_t to support
32bit and 64bit processes together.

When a 64bit process creates a handle and a 32bit process validates
the incoming ints against expected ints, opaque types lead to
different and mismatching values.

Always use unit64_t for base address for 32bit and 64bit SF.
Use unsigned int for offset and size, since ION uses that.

Change-Id: I7db5544556a8924f98010b965f837592e9f0b4ca
2014-05-22 12:14:30 -07:00
Linux Build Service Account
98619d8897 Merge "hwc: Enable source split for targets with single dsi" 2014-05-08 12:23:50 -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
Saurabh Shah
60e8bdebae hwc: Enable source split for targets with single dsi
Enable source split for targets with single dsi. This has the
benefit of using 2 pipes for layers whose width (crop) is higher
than line width.

Change-Id: I147136a3eb786e1af7b63508d65c010e88e358ed
2014-04-30 14:46:03 -07:00
Linux Build Service Account
64e1ce83b7 Merge "hwc: Add target specific checks in hwcomposer" 2014-04-28 22:26:59 -07:00
Dileep Kumar Reddi
e351d84ca0 HWC: Update DisplayFrame of all layers properly in Dynamic FB
Use change in HWC_GEOMETRY_CHANGED flag appropriately to avoid
redundant and unintentional overwrites of DisplayFrame values,
which may result fall back to GPU.

Change-Id: Ifb0f8dc5d356c965b6e80644f32392c460fb1ae7
2014-04-25 17:48:51 +05:30
Raj Kamal
068f4575f6 hwc: Add target specific checks in hwcomposer
* Mdss driver supports DMA-Multiplexing on wb interface
for certain targets. Add overlay get function to query
this info during pipe allocation for wb.

* UI Scaling on external is not supported on certain
targets due to the lack of availability of pipes with
scalars. Add overlay get function to query this info
to disable action-safe calcs, DRC and others which
require downscaling.

Change-Id: I1726caa4634f72d781561e797078648524ea2eef
2014-04-25 14:18:32 +05:30
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
Saurabh Shah
c62f39861a overlay: Support for returning pipe based on capability
Add support for returning pipes based on capabilities.
getPipe() API takes in pipe specifications like format class,
scaling, display, mixer, fb and decides what pipe to return.
The nextPipe() API is now just a private helper.

Change-Id: I0ab809662c0ad6297e19a44f39264ee929944d13
2014-04-14 10:17:11 -07:00
Linux Build Service Account
c4f9b0b623 Merge "hwc: Add rotator obj to layer-rot-map if acquired" 2014-04-04 17:33:33 -07:00
Linux Build Service Account
7ed66cf0ac Merge "hwc: set mModeOn flag for fbupdate properly" 2014-04-02 21:45:42 -07:00
Saurabh Shah
dd8237acd1 hwc/overlay: Add support for pipe priorities, 1 pipe config for FB
If using source split to stage 2 pipes on the same mixer stage,
the left pipe needs to be a higher priority than the right.

Add API in overlay to compare pipe priorities and use this in
source split config to stage pipes accordingly.

Add support for 1 pipe config for FB if updating rect is within 2048
pixels.

Change-Id: I8b33d5ebd0f8765ee842bab128d8abd67a110145
2014-04-02 13:22:53 -07:00
Saurabh Shah
39240c9124 hwc: Add rotator obj to layer-rot-map if acquired
Add rotator obj to the layer-rot-map soon after its successfully
acquired. This makes sure that any object allocated is accounted
for, irrespective of whether rotator configuration succeeds or not.

Change-Id: I94102d9c607cf61b2eccdf7f2445bb07d309d35c
2014-03-31 10:31:42 -07:00
Praveena Pachipulusu
d9443c7e81 hwc: Use proper typecasts
- Remove compiler warnings
- Use proper typecasts

Change-Id: I7391f32ae31283239f5cebb93b02f3ce3a5c99f3
2014-03-28 09:17:43 +05:30
Ramkumar Radhakrishnan
3686b7edf4 hwc: set mModeOn flag for fbupdate properly
Set mModeOn flag for fbupdate to false if validateAndSet function
fails, so that queueBuffer can be avoided for prepare failure.

Change-Id: Ifcc7a16caf8779f13411ae2a9eeeec6e6c846f4c
2014-03-25 12:13:40 -07:00
radhakrishna
2e792f9884 h/q/d: Add utility function for 8x16 and read RGB scalar capability
- Add utility function for 8x16
 - Add internal function to identify if RGB doesn't
   support scaling that is read from capabilities node.
 - If UI layer needs scaling and RGB pipe doesn't
   support scalar, request a VG pipe
 - On 8x16, request DMA pipe for WFD

Change-Id: I94e8e0371bb10fcad53fddd2b7c45bc9b2594a4d
2014-03-17 12:56:16 +05:30
Linux Build Service Account
33aa8e7395 Merge "h/q/d: Add support to update framebuffer partially" 2014-03-08 23:37:15 -08:00
Jeykumar Sankaran
c28eb0b3b8 h/q/d: Add support to update framebuffer partially
For dual DSI panels, when enabled partial update AND framebuffer rect
optimization, it is not necessary to update both the halves of
the framebuffer every frame. This channge adds support to update
framebuffer based on the updating region generated.

Change-Id: Ia63a8b9ac0e915c04e06122a16471ee18b5a8272
2014-03-06 14:25:46 -08:00
Saurabh Shah
ab47c69049 hwc: Add support for SourceSplit
Add support for SourceSplit. The mixers are abstracted from hwc.
There would be no translations to mixer understood destinations.

1) If a layer's crop and position are < 2048, only 1 pipe can be used
irrespective of position.
2) Else 2 pipes can be used with the layer equally split, without
regard to position.

Change-Id: I501a53838d147887c1e2299366663e05320d5096
2014-03-03 09:57:12 -08:00
Jeykumar Sankaran
c2d78d8f2c h/q/d: Optimize framebuffer layer update
While doing mixed mode composition, update only the region of the
framebuffer where layer contents are cached or updated. Avoids
MDP fetch for non-visible contents of FB.

Change-Id: I20997d79e02a6bac60d7333c28c6dde134263197
2014-02-20 10:19:53 -08:00
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
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