Commit Graph

99 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
Treehugger Robot c24cbf3829 Merge "Include what we use." 2018-01-18 22:20:19 +00:00
Dan Albert cd4a5d0fb6 Include what we use.
Bug: None
Test: mm
Change-Id: I664f436e233e284339fbab86701ac7279e8e8aa1
Exempt-From-Owner-Approval: Janitorial
2018-01-18 12:00:30 -08:00
Andreas Gampe ac49d76787 Libgralloc: Fix missing include
strerror requires string.h.

Test: m
Change-Id: Ic28fa20a43c3bdee9a3f9d3678b95f6a4a5a9d2e
2018-01-17 21:34:06 -08:00
Chih-Hung Hsieh 6fd2d4bb57 Add -Wno-error to compile with global -Werror.
Bug: 66996870
Test: normal builds.
Change-Id: Iee4ac5f95a2013c5eeac1c061889a593caf0ec36
2018-01-04 12:09:30 -08:00
Xin Li 43e07f20da Merge commit 'e458e16debbc9068c839ce918b2e039d7efefaed' into HEAD
Change-Id: If5aaf83103dc48a2efa6c242e55e78da18bec6d2
2017-11-13 14:35:40 -08:00
Dan Albert 436ab10d3c Add missing includes.
Change-Id: I8bc852db7396baa5367a4fc5d013dd9852353a4f
Exempt-From-Owner-Approval: trivial cleanup
Test: mma
Bug: None
2017-10-20 11:38:51 -07:00
Steve Pfetsch 1008e23395 [DO NOT MERGE] msm8994: libgralloc: Fix adding offset to the mapped base address
Bug: 63662821
Change-Id: I722ed2560efd66e2e61a3054d7db7f6241e8e911
2017-10-11 18:07:23 -07:00
Naseer Ahmed 529b7d1cc4 msm8994: Use gralloc1 adapter flag
This is needed to distinguish from implementations that have a
real gralloc1.

Bug: 36551945
Change-Id: I482421ae661d1d4dbf4ff5ace2987262a6fe7144
2017-03-31 13:17:29 -07:00
TreeHugger Robot bc5cdd5a3c Merge "Move QCOM HALs to vendor partition" 2017-02-28 11:54:41 +00:00
Chia-I Wu 6228228cfc gralloc: backport 1010102 and FP16 support to 8994
Bug: 35677008
Test: cts -m CtsHardwareTestCases -t
      android.hardware.cts.HardwareBufferTest#testCreate
Change-Id: I9fd0344c0f90e0f82191b21248f9f1542f135748
2017-02-24 09:03:54 -08: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
Vijay Venkatraman 1e0db43d25 Merge "Revert "Replacing LOCAL_COPY_HEADERS with LOCAL_EXPORT_C_INCLUDE_DIRS, for VNDK"" am: 95fb9b8c60 am: b791175501 am: b0726a71b0
am: b4ccc17fb9

Change-Id: I3111a66c4034d1dbe46e12677b3cabfd07147529
2017-02-07 18:54:01 +00:00
Vijay Venkatraman 95fb9b8c60 Merge "Revert "Replacing LOCAL_COPY_HEADERS with LOCAL_EXPORT_C_INCLUDE_DIRS, for VNDK"" 2017-02-07 18:44:43 +00:00
Vijay Venkatraman 30cbd906e0 Revert "Replacing LOCAL_COPY_HEADERS with LOCAL_EXPORT_C_INCLUDE_DIRS, for VNDK"
This reverts commit 4795a80c3a.

Change-Id: Ic591b6e0f04914f52e682b4742dac371af4818eb
2017-02-07 18:43:54 +00:00
Vijay Venkatraman f0b1c671ad Merge "Replacing LOCAL_COPY_HEADERS with LOCAL_EXPORT_C_INCLUDE_DIRS, for VNDK" am: 8773e79ce6 am: 781030d51b am: aca21aa0ec
am: 2663df19ef

Change-Id: Ia4d24f0907e047f7da224956f85ed761ee28b6d2
2017-02-03 23:51:37 +00:00
Vijay Venkatraman 8773e79ce6 Merge "Replacing LOCAL_COPY_HEADERS with LOCAL_EXPORT_C_INCLUDE_DIRS, for VNDK" 2017-02-03 23:38:52 +00: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
Chia-I Wu 115226b0dd gralloc: fix check for TARGET_USES_GRALLOC1
Advertise gralloc1 only when TARGET_USES_GRALLOC1 is set to true.

Test: builds and boots
Change-Id: Ie7063281b114a3562d5d943cf67b3c25007b787e
2017-01-26 04:46:07 +08:00
Chia-I Wu 86384cfc3e gralloc: use libgralloc1-adapter in MSM8994
This adds some new data members to private_handle_t.  The new data members
are needed to support GRALLOC1_ADAPTER_PERFORM_GET_DIMENSIONS, etc.  All
HALs that include gralloc_priv.h need to be recompiled.

When TARGET_USES_GRALLOC1 is true, the gralloc HALs advertise gralloc 1.0
support (see ADVERTISE_GRALLOC1).

Test: builds and boots
Bug: 33398719
Change-Id: I61e9addfd11dd65e6843163c3ba667e0f95bac16
2017-01-25 17:13:07 +08:00
Vijay Venkatraman 4795a80c3a Replacing LOCAL_COPY_HEADERS with LOCAL_EXPORT_C_INCLUDE_DIRS, for VNDK
Test: Add lib to LOCAL_EXPORT_SHARED_LIBRARIES
Change-Id: I7e773566261d73daf2893b459cf57092a81ce75a
2017-01-12 14:54:30 -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
Ruchi Kandoi 25f9dc2c5e memtrack: Make memtrack HAL compatible for HIDL passthrough mode.
Bug: 31180823
Change-Id: I0605d041f061fc3290140609fcc26c10db42fe15
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2016-10-10 10:57:52 -07:00
Colin Cross 2187f56aeb Merge "Fix format warnings in hardware/qcom/display" am: ce3c060962 am: e160c256ba
am: 7ff6e1a2e2

Change-Id: I3edf5df7a427849a9098cf539ea69264e925cb3d
2016-09-22 23:15:09 +00: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
Naseer Ahmed d7b1d9a1f4 gralloc: Fix "Return an error if the buffer was not mapped" am: 51b4299f42
am: e1dde0c00d

Change-Id: I526867d14feb350f96a18b7a112ac65dc00c610c
2016-09-13 23:05:49 +00:00
Naseer Ahmed 51b4299f42 gralloc: Fix "Return an error if the buffer was not mapped"
Let graphics map the buffer in registerBuffer, except secure
buffers. Avoid map in register (and at allocation time) can be
done when retain/release is implemented in gralloc 1.0

Bug: 28526999
Bug: 30404840
Change-Id: I208316b89edffc7486fe74deb1b9e3352d230223
CRs-fixed: 1010697
2016-09-09 09:35:01 -07:00
Jeff Boody 074d76b860 libmemtrack: Update parsing of kgsl mem file am: 76b25b6985
am: d3da682c40

Change-Id: I6f6c65ea1aaa911abf4c5856ef8f400255ab1bea
2016-08-23 23:19:16 +00:00
Jeff Boody 76b25b6985 libmemtrack: Update parsing of kgsl mem file
The mem file now has additional field, the mapsize. This
represents the size in bytes mapped to userspace. Use this
value and total size of an object to derive the unaccounted
size.

Bug: 30635019
CRs-Fixed: 982589
Change-Id: I9400e7ddacf185ebf93d0dd09e33a61685bea4dd
2016-08-23 19:34:10 +00:00
Naseer Ahmed f881bb5247 gralloc: Return an error if the buffer was not mapped
am: b7d1a389b0

Change-Id: If24c42f3359099d2eb68129c507a64238272a81a
2016-06-14 06:31:46 +00:00
Steve Pfetsch d2f349c8ad Revert \"gralloc: Return an error if the buffer was not mapped\"
am: f026d04dde

Change-Id: Ie5c237deb9a8d146b3bed11dd28a1994f5c1fa21
2016-06-14 06:31:45 +00:00
Naseer Ahmed b7d1a389b0 gralloc: Return an error if the buffer was not mapped
In some cases, the framework attempts to lock a secure buffer.
Since it does not get an error code from the lock, it proceeds to
dereference the base address (which is invalid). Return an error
code when a secure buffer is attempted to be locked, while still
ensuring that the metadata is mapped.

Since we return a proper error in lock(), register buffer fails.
Since a map should not be done in registerBuffer per the gralloc
spec, only map the metadata here. Clients that need to access
memory in CPU after registerBuffer should do a lock().

Note, this is a resubmission of a previous change whose Change-Id
was I74204931fa61524f1601dd99ab266219d4be2c82. Patch set 4 was
initially submitted instead of patch set 6.

Change-Id: I68124902d0b614702622dc948e13270fc86e16a6
CRs-fixed: 1010697
Bug: 28526999
2016-06-13 23:57:26 +00:00
Steve Pfetsch f026d04dde Revert "gralloc: Return an error if the buffer was not mapped"
This reverts commit 3261eb2236.

Bug: 28526999
Change-Id: I755627af7567c49e7500e92de1124587b1086b38
2016-06-13 23:55:19 +00:00
Naseer Ahmed 476157b937 Merge changes from topic \'merge_adreno_n13\' into nyc-dev
am: c571e04757

Change-Id: I2f562cdc124c8ec338f6e64688a60ca5f16936d2
2016-06-11 02:15:27 +00:00
Naseer Ahmed 3261eb2236 gralloc: Return an error if the buffer was not mapped
In some cases, the framework attempts to lock a secure buffer.
Since it does not get an error code from the lock, it proceeds to
dereference the base address (which is invalid). Return an error
code when a secure buffer is attempted to be locked, while still
ensuring that the metadata is mapped.

Since we return a proper error in lock(), register buffer fails.
Since a map should not be done in registerBuffer per the gralloc
spec, only map the metadata here. Clients that need to access
memory in CPU after registerBuffer should do a lock().

Bug: 28887585
Bug: 28791974
Bug: 28526999
Bug: 29034950

Change-Id: I74204931fa61524f1601dd99ab266219d4be2c82
CRs-fixed: 1010697
2016-06-11 02:11:48 +00:00
Naseer Ahmed 05d37027d2 gralloc: Fix a missed unmap.
Change I86300a1b4e3008f9d0884940420e9036c47a016f introduces a
regression by mapping metadata part of secure buffers, but not
unmapping that. This change fixes the map/unmap asymmetry.

Bug: 28887585
Bug: 28791974
Bug: 28526999
Bug: 29034950

Change-Id: I078eef1139642bd6d8a01145ab1c81060621fb8d
Acked-by: Saurabh Shah <saurshah@codeaurora.org>
2016-06-05 06:21:59 +00:00
Naseer Ahmed b477231f4d gralloc: Use GRALLOC_USAGE_PROTECTED for L1 protection
am: 4f6feb11ed

* commit '4f6feb11ede2708eac46d8c96d9ca2fc10b96a44':
  gralloc: Use GRALLOC_USAGE_PROTECTED for L1 protection

Change-Id: I9d854ee574f7367a82060d3021647bee62622736
2016-04-30 00:29:19 +00:00
Naseer Ahmed 4f6feb11ed gralloc: Use GRALLOC_USAGE_PROTECTED for L1 protection
Do not require the MM_HEAP flag for TZ protection. This is in
line with the gralloc spec.

Bug: 27536318

Change-Id: I0bc7346b0a40061600707d8c1881a9d405995b4f
2016-04-27 23:44:21 +00: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
Dan Willemsen 3b1d6059ba Merge "Fix duplicate copy file rules" am: f5ef45b92e
am: 41031c9406

* commit '41031c9406df7031a8dd6c5980463fa9c5198a67':
  Fix duplicate copy file rules
2016-02-24 00:19:56 +00:00
Dan Willemsen f7b40858db Fix duplicate copy file rules
If these libraries are built, both BUILD_COPY_FILES and
BUILD_SHARED_LIBRARY would copy the headers. This would create a warning
because multiple rules would define the same target header file.

Bug: 27302058
Change-Id: If91bd70d2320aaaee9679642ff9ea48b99739cbd
(cherry picked from commit b360857e92)
2016-02-23 16:17:09 -08:00
Dan Willemsen 41031c9406 Merge "Fix duplicate copy file rules"
am: f5ef45b92e

* commit 'f5ef45b92e8564586c1fec5390db8133fcb0c078':
  Fix duplicate copy file rules
2016-02-24 00:04:48 +00:00
Dan Willemsen b360857e92 Fix duplicate copy file rules
If these libraries are built, both BUILD_COPY_FILES and
BUILD_SHARED_LIBRARY would copy the headers. This would create a warning
because multiple rules would define the same target header file.

Bug: 27302058
Change-Id: If91bd70d2320aaaee9679642ff9ea48b99739cbd
2016-02-23 14:19:52 -08:00
Jeff Tinker 1b9b5a150a Fix protected video playback on bullhead
bug:26833122
Change-Id: I955e2ee0e514fa06841983002a71b6dd69b64201
2016-01-29 10:13:31 -08:00