Commit Graph

40 Commits

Author SHA1 Message Date
Tom Marshall 8def73c018 hwc: Validate display ID in hwc interfaces
Validate the display ID before processing any calls from the
client.  This is needed to handle only the displays which are
supported by HWC

Adapted from commit of the same title in CAF msm8974 tree.

Original author: Arun Kumar K.R <akumarkr@codeaurora.org>

Change-Id: Iebeeabf791b5c53e811e1f4bb3d777ab0e4d0f47
2018-09-21 14:50:15 +02:00
Jiyong Park da9d9de59c Move QCOM HALs to vendor partition
In order to build generic system image that is agnostic to SoC or
device, such HALs should be moved from system partition to vendor
partition.

HALs moved: copybit, gralloc, hwcomposer, light, memtrack, hdmi_cec

Bug: 34826389
Bug: 35232083
Test: build & run and check whether the HAL is loaded from
/vendor/lib[64]/hw.
$ su; lsof | grep hwcomposer

Change-Id: I2bb617ac71ab040a5b1ba306c194e8672ac84561
2017-02-24 13:53:21 +00:00
Mathias Agopian 2e3a46c539 fallout of splitting rect.h out of libandroid.
Some makefiles didn’t specify libui but included 
headers from it directly, and they didn’t even
need them.

It works because these headers are on the global
include path. With this change, though, rect.h
is not anymore (albeit exported from libui).

Test: built and booted device
Bug: 35164655
Change-Id: Ib2de5e5a2f86bd857e12861bb6fc5e4739ff185a
2017-02-16 14:31:11 -08:00
Dan Albert 4a797eb2a0 Merge "Fix -Wmacro-redefined werror issues." am: 3d4d976af2 am: 06d4d81212 am: 2e84083ef7
am: 33fc66f8e7

Change-Id: I24da518a22bc0dc4b03adcffbae7d7c7d378c89f
2017-01-31 03:49:45 +00:00
Dan Albert 789f042d3c Fix -Wmacro-redefined werror issues.
The libc++ defines this (wrapped in ifndef, like this should have
been), so including a libc++ header and then defining this results in
a werror failure. Define this in common.mk so we can be sure it does
get defined, but also that it gets defined early enough that anyone
defining this in source wrapped with ifndef doesn't get broken.

Test: mma # on angler
Bug: http://b/34740564
Change-Id: Id7d70a6ad5e530390eb8b37e5e618312d1d7e6dc
2017-01-30 17:54:29 -08:00
Alex Naidis 9fe2840616 Merge "hwcomposer: Fix regression in hwc_sync" am: a0de1d3cc3 am: 9e5907e6b4 am: e93a5f5337
am: 47cec256dd

Change-Id: I5c43ac8f3717c291e33504af5047022c05eedcbf
2017-01-05 04:10:17 +00:00
Alex Naidis 5936d78c2a
hwcomposer: Fix regression in hwc_sync
Hwc_sync is in the hotpath of display
rendering and gets called every ~17ms
during active rerendering.

Reading the property "debug.egl.swapinterval"
on every execution of hwc_sync causes a major
regression where the execution of hwc_sync
is much slower than it can be.

Doing I/O in hotpaths is inacceptable
and can cause an unnecessary constant
I/O load, additionally to the slowdown
in display rendering which was caused
in this case.

As solution, we condition this debugging
feature with "DISPLAY_DEBUG_SWAPINTERVAL",
so it can be enabled when explicitly needed.

Gralloc is not directly affected by the regression,
it was adjusted to match the conditioning
of the swapinterval debugging feature.

The HALs of msm8084,msm8226,msm8909,msm8960 and
msm8994 are affected by the regression and
get patched by this patch. Newer HALs
are not affected.

The stats contained in this patch were
collected using a Nextbit Robin (MSM8992),
which uses the msm8994 HAL.

Test: Manual testing for proper conditioning.
Test: Running full CTS suite without DISPLAY_DEBUG_SWAPINTERVAL set.

Change-Id: If08595d37ac0c1a19edd8d296289a21c9f95512a
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2016-12-27 16:38:36 +01:00
Hal Canary 8e9bbcb6fe SkImageEncoder->SkEncodeImage
Test: none
Change-Id: Idec9438683b4e542dca662b958368190faece7b6
2016-11-24 20:18:33 -05:00
Dan Stoza 381004a927 msm8994: Add HWC2On1Adapter
Adds the HWC2On1Adapter to facilitate exporting the HWC implementation
as HWC2 instead of HWC1.

Test: None needed
Change-Id: Ic4fe02a32818e24121bfc20bc136480a5f453d82
2016-11-14 13:15:48 -08:00
Colin Cross abe67dd75c Fix format warnings in hardware/qcom/display
system/core/include is included in the global include path using
-isystem, which hides log format warnings when built with gcc.
Fix the warnings in preparation for switching from -isystem to -I.

Test: lunch aosp_angler-userdebug && m -j
Bug: 31492149
Change-Id: Ie75967aa30bae2e9bebbd65efe0ff570a80203fd
2016-09-21 20:47:19 -07:00
Dan Austin 34b65632c7 Merge "Perform typecast to disambiguate the call to abs in preparation for libcxx rebase." am: 1994925
am: 011da83

* commit '011da83efdb366d9c1254c2287e7a120376532ea':
  Perform typecast to disambiguate the call to abs in preparation for libcxx rebase.

Change-Id: I77b540571afce11618f3a05f49d0acfe6a4c1d02
2016-04-23 05:57:57 +00:00
Dan Austin 438a86130d Perform typecast to disambiguate the call to abs in preparation for libcxx rebase.
Change-Id: I17f0292a5fc51a3b7aa7d7a290cb2489e52c3c80
2016-03-31 08:17:21 -07:00
Naseer Ahmed 3bbf145177 hwc: get active display mode at boot
The initial mode was not set and incorrectly reported to
surfaceflinger.
Also, fix comparison bug when reading active config

Change-Id: I4fdf1d2ebb56721d044fc6e0c5ef3ea5c3616e5e
2016-01-22 15:18:06 -08:00
Steve Pfetsch 0457a52eef Enable color temperature developer setting am: f1812e0b56
am: 0e87e54c58

* commit '0e87e54c5842ab44bd74636046e941905dc1c3ea':
  Enable color temperature developer setting
2016-01-15 20:52:07 +00:00
Steve Pfetsch 0e87e54c58 Enable color temperature developer setting
am: f1812e0b56

* commit 'f1812e0b56773537760c9ae8ea45cee5ac902118':
  Enable color temperature developer setting
2016-01-15 20:44:34 +00:00
Steve Pfetsch f1812e0b56 Enable color temperature developer setting
Add a switch in Developer Settings to enable "cool" color temperature
mode.

Bug: 26110238
Change-Id: I669ae4ddf58d6654b154692afc7d0689227617b2
2016-01-14 16:19:42 -08:00
Arun Kumar K.R bc094c7aa4 hwc: Fix colorMode setting
- On color mode change, remove redundant setDefaultMode
  call, as the defaultMode was already set from applyModebyID
- destroy the ModeManager on deinit

Bug: 24311008

Change-Id: I4971f513e389adb56d7ed00e2c6a20adfe49f4e2
2015-12-21 11:15:06 -08:00
Chih-Hung Hsieh 58f01f1ae8 Disable clang compiler to unblock angler system build.
See bug description for the many compilation errors.

BUG: 24171136
Change-Id: I965679a9bc2e7fa434dee204597a3198c3bcfb48
(cherry picked from commit 46b905edf5)
2015-12-17 19:03:27 +00:00
Chih-Hung Hsieh 46b905edf5 Disable clang compiler to unblock angler system build.
See bug description for the many compilation errors.

BUG: 24171136
Change-Id: I965679a9bc2e7fa434dee204597a3198c3bcfb48
2015-09-22 14:42:40 -07:00
Naseer Ahmed 831babe597 hwc: Try applying default mode at first frame...
...Before waiting for bootanimation exit

Change-Id: I0c9d643ddddc2d206603a4d10d1be7eb48d975ff
2015-09-09 13:09:33 -07:00
Naseer Ahmed 6109f69d57 hwc: Add support for color mode switching
Add a ColorMode class to HWC to manage color modes and expose
them as display attributes to SurfaceFlinger

Change-Id: I1010096120db6aec61163a84390527f5a0a3645e
2015-09-09 13:09:28 -07:00
Naseer Ahmed 72579d94ed hwc: Silence log for unsupported layers
In some cases, external displays may be driven by the primary
vsync with the primary not having any layers to compose. Do not
log in such cases.

Bug: 23487270
Change-Id: If72cb690692faa26bb4132c0f473b8b413be2bee
2015-09-01 20:11:15 +00:00
Arun Kumar K.R ca8b518ff8 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.

Bug: 23487270
Acked by: Manoj Kumar AVM<manojavm@codeaurora.org>

Change-Id: I8bbb0b9fb6ccec9f9798f37f9ea6ca38f69792c0
2015-09-01 20:07:30 +00:00
Arun Kumar K.R c30c577b53 hwc: Fix ROI sanitize
- In sanitizeROI function do not increase width/height in both
  directions which causes left and right ROI to be unequal for
  a source split enabled panel
- Handle ROI calculation which was beyond the frame boundary
  when the panel had high min width and height values

Change-Id: Iaf9b2a97a55dc3fbab9ea8c41bfd9368eae0950b
2015-08-31 08:42:40 -07:00
Naseer Ahmed a2f8c1e71f hwc: mdpcomp: one full screen update in screen refresh
When screen refresh is triggered, make sure at least one
full screen update when partial update is enabled.
Screen refresh is requested after post processing has been
sent to kernel, full screen update is needed so that the
pp setting applies to the whole screen.

Change-Id: I7885c451a313666c1fcef8c3d55cb86b8479de1c
2015-08-21 16:48:29 -07:00
Naseer Ahmed b4cfc95593 hwc: Allow mode switch
Calls into qdcm lib to switch the display mode to the given ID.

Change-Id: I5d8f2c238ab0426c7593447b79a826c688622f66
2015-08-21 16:48:20 -07:00
Naseer Ahmed cfacc80f23 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
Acked-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
2015-08-21 16:48:13 -07:00
Arun Kumar K.R 41ac35e734 hwc: Start with ROI set to destination
Some layers will not have surfaceDamage information,
like video and CPU rendered, so consider their destination
as the surfaceDamage. For other layers start with destination
will be calculated based on the surfaceDamage

Change-Id: Ic7308bf9dfb7d062596873963c738f644b1c1a84
2015-08-21 16:45:14 -07:00
Arun Kumar K.R 298391fb24 hwc: Fix ROI generation for source split
- When generating ROI for SourceSplit case, check if the display
  is split and accordingly calculate right roi
- Assign correct lRoi and rRoi in hwc_commit

Change-Id: Ie41e1f08e8f039f3548fa12be695c807d77a0b2e
2015-08-21 16:44:57 -07:00
Arun Kumar K.R 8982d8b924 hwc: Fix ROI calculation for panels with high min values
- ROI calculations was beyond the frame boundary when the panel
  had high min width and height values
- Consider the bounds into account when aligning the ROI

Acked by: Dileep Kumar Reddi <dkumarre@codeaurora.org>

Change-Id: Ic28a524435b1ebf0ab6894008f2af1d936d13a13
2015-08-21 16:44:41 -07:00
Arun Kumar K.R de608742bd hwc: mdpcomp: Add surfaceDamage calculation with SrcSplit.
Use surfaceDamage in calculating the final dirtyRect in
case of generating the ROI for SourceSplit

Change-Id: Ibe2347c49e07ec40a3369f6970371437b81874cd
2015-07-27 15:45:35 -07:00
Arun Kumar K.R 72aecbe8c0 hwc: use surfaceDamage to calculate the dirtyrect as per HWC 1.5
Update the HWC version to HWC 1.5

surfaceDamage is passed as part of the layer, use this information
to determine if the layer is changing and handle cache.

The total dirty rectangle for a given layer will be the sum of all
the damageRectangles, use that to calculate the ROI

Change-Id: Iddff278e716099d252e059aae02764f4b8630a6f
2015-07-27 15:45:35 -07:00
Arun Kumar K.R 07bb927c66 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.

Acked-by: Jeykumar Sankaran <jsanka@codeaurora.org>

Change-Id: I47fa0e827985dd76d06dcbe464ef832cfc57a671
2015-07-27 15:45:35 -07:00
Arun Kumar K.R 9f4ab24b0f hwc: Partial update support for ping pong split.
ping-pong split needs source split to be enabled to stage two
pipes of a layer in the same Z order. This change adds partial
update support to generate ROI when source split is enabled.
When configured, ping-pong-split splits the layer mixer output
equally across two DSI's. To meet this limitation, the generated
ROI is adjusted to have equal widths from the panel mid point.

Acked-by: Jeykumar Sankaran <jsanka@codeaurora.org>

Change-Id: Ic307a1d5b902af9e352b0dfc6f5ab474ecd9c8a4
2015-07-27 15:45:35 -07:00
Arun Kumar K.R 4986a66403 hwc: Reset the refresh rate alone to avoid stack corruption.
In early return calls of prepare, reset the refresh rate
irrespective of layer properties to avoid stack corruption.

Acked-by: Praveena Pachipulusu<pveena@codeaurora.org>

Change-Id: I5a04e111b1f10a6cb807459c7693d049c454edaa
CRs-Fixed: 838902
2015-07-27 15:45:35 -07:00
Arun Kumar K.R 3bc091ceb7 hwc: mdpcomp: Remove the perf lock acquire log message
Perf lock acquire would fail during the boot up as the perfd
service is not up yet.
Its harmless to remove these logs which cause false alarm

Change-Id: Id305f3122a77ebe70819e4b3edfaf405c3a87d70
2015-07-27 15:45:35 -07:00
Arun Kumar K.R a670ba4e8a hwc: Limit BWC to content with height within 4092
Limit BWC to content with height within 4092, since this is a MDSS
requirement.

Acked-by: Saurabh Shah <saurshah@codeaurora.org>

Change-Id: I82cd7212fc6c393b8b568abf2734a725a51d3cb0
2015-07-27 15:45:35 -07:00
Arun Kumar K.R fb06969f70 hwc: Use 1 pipe if rotator downscale reduces dimensions
If rotator downscale is able to reduce output dimensions below
MDP's pipe limits, then use only 1 pipe if possible in source split
cases.

Acked-by: Saurabh Shah <saurshah@codeaurora.org>

Change-Id: I6739a1fcd32b1047ce266d60c0123961c9daa657
2015-07-27 15:45:35 -07:00
Arun Kumar K.R a4a71c6d0a 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.

Acked-by: Jeykumar Sankaran <jsanka@codeaurora.org>

Change-Id: I320285aaca7ffc032e3b3b0832380a9c705bc4fc
2015-07-27 15:45:17 -07:00
Patrick Tjin 054df959ae msm8994: import msm8994/msm8992 display code
AU_LINUX_ANDROID_LA.BF64.1.2.1_RB1.05.00.00.019.037

Change-Id: Ie94c9207ea736a114bfdf4f35d372ccc326d7207
Signed-off-by: Patrick Tjin <pattjin@google.com>
2015-03-12 09:30:21 -07:00