Commit graph

134 commits

Author SHA1 Message Date
Pirama Arumuga Nainar
5d88cef82b Mark gglMulx and gglMulAddx as always_inline
Bug: http://b/116873221
Bug: http://b/124451159

This is to get them building with O0 (needed for coverage builds).  At
O0, without the always_inline, the compiler is not able to reconcile the
constraints in the inline assembly.

In file included from system/core/libpixelflinger/trap.cpp:27:
In file included from system/core/libpixelflinger/trap.h:22:
In file included from
system/core/libpixelflinger/include/private/pixelflinger/ggl_context.h:27:
system/core/libpixelflinger/include/private/pixelflinger/ggl_fixed.h:113:9:
error: invalid operand for inline asm constraint 'I'
  asm("smull  %[lo], %[hi], %[x], %[y]            \n"
      ^
system/core/libpixelflinger/include/private/pixelflinger/ggl_fixed.h:136:9:
error: invalid operand for inline asm constraint 'I'
  asm("smull  %[lo], %[hi], %[x], %[y]            \n"
      ^
2 errors generated.

Test: m NATIVE_COVERAGE=true COVERAGE_PATHS=system/core/libpixelflinger
Test: m
Change-Id: Ia4516b19b957687b5fa25d2d100679abcec29366
2019-02-14 11:59:48 -08:00
Joel Fernandes
519440468b Add support for memfd
This patch adds support to make libcutils create and use memfd where
possible, instead of ashmem.

The libcutils library is made dynamic, since apps are still sending over
ashmem FDs to processes and we are working on moving those apps away
from ashmem. The best we can do for that is make the library work, and
force apps in the long run to move away from directly using ashmem.

Due to further complications mentioned in the 'NOTE' section of the
patch, memfd is kept disabled for now, so nothing changes yet. To enable
it, set the sys.use_memfd property (check user_debug build).

Bug: 113362644
Change-Id: I491cb7841b664db5b1c26b3e07a440a14810e182
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-02-07 00:40:13 +00:00
Yi Kong
e9ce7aa8ab Ignore null-pointer-arithmetic warning from dlmalloc include
system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:4286:61: error: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Werror,-Wnull-pointer-arithmetic]
        if (!is_inuse(p) && (char*)p + psize >= base + size - TOP_FOOT_SIZE) {
                                                            ^~~~~~~~~~~~~
  system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:2731:17: note: expanded from macro 'TOP_FOOT_SIZE'
    (align_offset(chunk2mem(0))+pad_request(sizeof(struct malloc_segment))+MIN_CHUNK_SIZE)
     ~~~~~~~~~~~~~^~~~~~~~~~~~~
  system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:2218:55: note: expanded from macro 'chunk2mem'
  #define chunk2mem(p)        ((void*)((char*)(p)       + TWO_SIZE_T_SIZES))
                                                      ^
  system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:1622:14: note: expanded from macro 'align_offset'
   ((((size_t)(A) & CHUNK_ALIGN_MASK) == 0)? 0 :\

Test: m checkbuild
Bug: 72331524
Change-Id: Iefc3b4ae6b36ba9f6cb908c03301cbe429ade320
2018-12-11 23:08:32 -08:00
Yi Kong
049cbaa3a0 Ignore expansion-to-defined warning from dlmalloc include
system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:588:22: note: expanded from macro 'USE_LOCKS'
#define USE_LOCKS  ((defined(USE_SPIN_LOCKS) && USE_SPIN_LOCKS != 0) || \
                     ^
system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:2742:5: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
system/core/libpixelflinger/codeflinger/../../../../external/dlmalloc/malloc.c:589:22: note: expanded from macro 'USE_LOCKS'
                    (defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0))

Test: m checkbuild
Bug: 29823425
Change-Id: I3acbcb9c9cab3713041fc130358f7ecdec70a589
2018-12-10 19:18:22 +00:00
Dan Willemsen
596e2217e2 Convert libpixelflinger to Android.bp
See build/soong/README.md for more information.

Test: cd system/core/libpixelflinger; mma
Change-Id: I2354e5bc6b0b8a10d598e3677bc63962f70bf7bc
2018-11-16 19:15:38 -08:00
Elliott Hughes
643268f325 Move system/core/ off NO_ERROR.
It causes trouble for Windows, and OK already exists.

Bug: N/A
Test: builds
Change-Id: Ida22fd658b0ebb259c710ba39049b07c9e495d9c
2018-10-08 11:15:52 -07:00
Chih-Hung Hsieh
502f4864d6 Suppress implicit-fallthrough warnings.
Add FALLTHROUGH_INTENDED for clang compiler.

Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: I40f8bbf94e207c9dd90921e9b762ba51abab5777
2018-09-17 16:50:11 +00:00
Peter Collingbourne
6316be2ed1 Merge "libpixelflinger: Avoid using x18 register in blend implementation." 2018-08-30 01:20:34 +00:00
Peter Collingbourne
60143111ea libpixelflinger: Avoid using x18 register in blend implementation.
Instead, use x15 which is one of the available temporary registers.

Bug: 112907825
Test: test-pixelflinger-arm64-t32cb16blend
Change-Id: Icfcaae1d8163880eddc2862af92e5636a03d8b52
2018-08-29 16:23:21 -07:00
Elliott Hughes
f5ca0f7ad4 Remove unused -I of external/safe-iop.
Bug: http://b/25224572
Test: builds
Change-Id: I90c35a38d69f533b8f60c2f357f0e5e36596d050
2018-08-29 09:49:24 -07:00
Elliott Hughes
a55c033d92 Remove dead gglFastDivx.
Bug: http://b/112155920
Bug: https://www.viva64.com/en/b/0579/
Test: builds
Change-Id: Ia55245ce4484d5376abef16c9863015b0a0ca2b1
2018-08-02 16:18:24 -07:00
Miodrag Dinic
cc599273b4 MIPS[64]: codeflinger: Fix build due to unused variable warnings
Change-Id: Ie31d44ee74a218c83774df855be496ca862af8c5
Signed-off-by: Miodrag Dinic <miodrag.dinic@mips.com>
2017-11-06 16:38:49 +01:00
Chih-Hung Hsieh
c7f344e9a9 Use -Werror in system/core/libpixelflinger
* Remove unused local variables.
* Suppress/fix warning of unused functions, conditionally used variables.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: If92bc79f15a0486364da0389defbb2d43b3bd6ea
2017-11-02 15:16:18 -07:00
Mikhail Lappo
90f5d64848 Va_end should be used with va_start
va_start is used and va_end should
be invoked accordingly

Change-Id: Id7037aa8092438b27e445e5147972836602bfd55
2017-03-23 22:41:42 +01:00
Mark Salyzyn
30f991f251 liblog: use log/log.h when utilizing ALOG macros
Test: compile
Bug: 30465923
Change-Id: Id6d76510819ebd88c3f5003d00d73a0dbe85e943
2017-01-11 09:31:15 -08:00
Mark Salyzyn
cfd5b080af system/core: preparation to pull back interfaces from android/log.h
Point to log/log.h where necessary, define LOG_TAG where necessary.
Accept that private/android_logger.h is suitable replacement for
log/logger.h and android/log.h.

Correct liblog/README

Effectively a cleanup and controlled select revert of
'system/core: drop or replace log/logger.h' and
'system/core: Replace log/log.h with android/log.h'.

Test: compile
Bug: 30465923
Change-Id: Ic2ad157bad6f5efe2c6af293a73bb753300b17a2
2016-10-20 08:11:39 -07:00
Mark Salyzyn
66ce3e08c5 system/core Replace cutils/log.h with android/log.h
Should use android/log.h instead of cutils/log.h as a good example
to all others.  Adjust header order to comply with Android Coding
standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I2c9cbbbd64d8dccf2d44356361d9742e4a9b9031
2016-09-30 12:47:05 -07:00
Hans Boehm
e74dec4a39 Fix reference counting for Assembly
Use correct memory ordering.

Start the reference count at zero instead of one, thus giving us a
chance to actually deallocate something.

Remove remaining (unused) inclusions of cutils/atomic.h from
libpixelflinger.

Bug: 30838047

Change-Id: I3c6fd4a4861b3635cf398ca2aa3e915118100b10
2016-08-16 10:12:43 -07:00
Chih-Hung Hsieh
034c475931 Fix google-explicit-constructor warnings in system/core.
* Declare explicit conversion constructors.
* Add NOLINT for implicit conversion constructors.
* Fix also some misaligned indendations.

Bug: 28341362
Change-Id: Idf911f35923b408d92285cc1a053f382ba08c63e
Test: build with clang-tidy
2016-07-26 11:26:01 -07:00
Elliott Hughes
b3e7495f2c Remove dead rotate90CW_4x4_16v6.S.
Change-Id: I3b7ee192cdbe193878fe9b4d97be972780283ef1
2016-07-13 17:58:34 -07:00
Nikola Veljkovic
1109f115bd Replace .align with .balign to avoid ambiguity
Directive .align is arch-dependent, .balign is not.

Change-Id: Ibf2097da29f743f2c87c79d2a88ce1abd0aa6227
2016-07-13 22:13:02 +02:00
Lazar Trsic
980b632683 [mips] Resolve issue with .align directive, when using clang IAS
Clang IAS does not support .align without args, concrete value is needed.

Change-Id: I50e20c374b8e88966310c0c9e6cc41eea054eb32
2016-07-13 15:37:41 +00:00
David 'Digit' Turner
ecc1972fb0 Remove qemu_tracing dependency.
The feature is not implemented anymore (and has been for a very long time).
Moreover, this will allow us to cleanup hardware/ from any QEMU-specific
items.

BUG=25875346

Change-Id: I71488f4128c737dedf2b28433499fa6ffd29dcb5
2016-06-21 20:24:55 +02:00
Chih-Hung Hsieh
c713bce901 Fix misc-macro-parentheses warnings in init and other core modules.
Bug: 28705665
Change-Id: Ice67cebb8c42538f8fb9cf1756678f41a9d68a31
2016-05-18 18:11:49 -07:00
Elliott Hughes
a1b9bd901f Don't include <machine/cpu-features.h>.
We're not using it.

Change-Id: Ic128cf9297e1627c839c48f1954c19d7070654d7
2016-05-16 17:55:27 -07:00
Chih-Hung Hsieh
75935ef67e Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I0ce541f79feef5c08eac64edc686be3edf9c2aa4
2016-04-25 15:28:36 -07:00
James Hawkins
9336b613ca libpixelflinger: Fix -Woverloaded-virtual warnings.
GGLAssembler inherits a reset method from two parent classes, but it
provides a separate reset method with a different signature, thus hiding
the inherited reset methods.

The fix is to explicitly hide the inherited reset methods as private.

Bug: 27346663
Change-Id: Ic64b00acb6d77fb791cfdeade9ef7e20148817c1
2016-02-25 10:59:30 -08:00
Josh Gao
70bde21ae4 Use dlmalloc from external/dlmalloc instead of bionic/.
Bug: http://b/17207577
Change-Id: Ib9b4cd417091b765402ad217ae0b5a10e3ffbc23
2016-01-22 11:04:35 -08:00
Ljubomir Papuga
e0c9f2bc5a libpixelflinger: MIPS64 assembler test bug fix
Change-Id: I47f77790baabea85ee318976a2c44ab1c0c0b9cb
2015-12-15 15:23:01 +01:00
Chih-Hung Hsieh
2858ba18e7 Add explicit cast to shut off clang warnings.
* The literals are signed negative int and got warnings about
  .... cannot be narrowed to type uint64_t [-Wc++11-narrowing]

Change-Id: I88c2fc328dfe5c7e2f9ade32bcba273e4a74a84c
2015-11-23 09:07:16 -08:00
Chih-Hung Hsieh
caa8810c64 Add explicit cast to shut off clang warnings.
* The literals are signed int type and got warnings about
  .... cannot be narrowed to type int16_t [-Wc++11-narrowing]

Change-Id: I156d8e456c70840953aebb24739f94256248b810
2015-11-20 10:21:55 -08:00
Ljubomir Papuga
4edb4584a6 libpixelflinger: MIPS64r6 bug fix
This commit fixes MIPS64r6 bootanimation crash.

Change-Id: If7ca817ee2beaf92bb8052602cc759bb4a609419
2015-11-10 14:24:11 +01:00
Elliott Hughes
606d4aecfb Revert "Revert "Add MIPS64r6 support for libpixelflinger""
This reverts commit 7fd121788a.

Change-Id: Ic1204a8407c235b07c643764d5f2800631fecd72
2015-11-06 16:02:25 +01:00
Elliott Hughes
c77c1a3f0a Merge "Revert "Add MIPS64r6 support for libpixelflinger"" 2015-11-05 18:55:12 +00:00
Elliott Hughes
7fd121788a Revert "Add MIPS64r6 support for libpixelflinger"
This reverts commit ab5265ebe6.

This broke the mips64 build (which, stupidly, I hadn't tested):

  system/core/libpixelflinger/codeflinger/MIPS64Assembler.h:24:35: fatal error: tinyutils/KeyedVector.h: No such file or directory
   #include "tinyutils/KeyedVector.h"

Change-Id: I4fa1c04e196592fd1ef893a83c75261a55d32290
2015-11-05 18:54:11 +00:00
Elliott Hughes
251f8b69fb Merge "Add MIPS64r6 support for libpixelflinger" 2015-11-05 18:03:18 +00:00
Ljubomir Papuga
ab5265ebe6 Add MIPS64r6 support for libpixelflinger
Added ARMtoMips64Assembler class that translates ARM instructions to MIPS64r6
instructions.
Added MIPS64r6 assembly implementations for col32cb16_blend and t32cb16_blend
functions.
Added MIPS32r2 assembly implementation for col32cb16_blend function.
Added tests for MIPS64r6 (assembler, disassembler and assembly implementation
functions).
Added MIPS32 tests for assembly implementation functions.
Minor bug fixes for MIPS32r2 branch.

Change-Id: I69e49622117be5b8167628e9702db6aafb1849d7
2015-10-29 17:22:17 +01:00
Elliott Hughes
998bd12c3f Merge "Fix some compiler warnings in libpixelflinger."
am: 5643f80947

* commit '5643f8094753e4672cb64ff9b4a7b307d43a80ac':
  Fix some compiler warnings in libpixelflinger.
2015-10-22 22:15:31 +00:00
Elliott Hughes
cd6b53fd83 Fix some compiler warnings in libpixelflinger.
class/struct mismatch and use of 'register'.

Change-Id: I6cfe0f7fdc214c3a009eb01251f5ea9a8fdb895d
2015-10-21 18:52:17 -07:00
Narayan Kamath
51e740f802 resolved conflicts for 32d86587 to mnc-dr-dev-plus-aosp
Change-Id: I381133e7dd93f908bd3d2b42e8af83d954e428af
2015-09-08 13:59:49 +01:00
Narayan Kamath
c609c31fb5 libutils: Fix integer overflows in VectorImpl.
Use external/safe-iop to check for overflows on arithmetic
operations.

Also remove an unnecessary copy of Vector/SharedBuffer from
codeflinger and use the copy from libutils instead.

Note that some of the unit tests are somewhat useless due to
test-runner limitations : gtest's ability to filter on abort message
doesn't work when combined with messages formatted by android's logging
system.

bug: 22953624

Change-Id: I46b1ae8ca1f3a010be13aca36a091e76a97a7b70
2015-09-02 12:37:49 +01:00
Chih-Hung Hsieh
7244cf2aa5 To compile with llvm integrated assembler.
* Explicitly specify default .align 0.
* Use standard ldmfdlo instruction.
* Before and after gas outputs are identical,
  with align 0 sections.
* Objdump showed .text/.data/.bss section alignment
  attributes are 2^0 from gas and 2^2 from llvm
  assembler. These .S files might be working when
  compiled by gas, but llvm assembler's output should
  be more correct or conservative.

Change-Id: I4e578dbc8155c0d06d1bbc1c33ec4cc851a18479
2015-08-21 15:58:26 -07:00
Greg Hackmann
38eb58d2a8 pixelflinger: make self-contained
pixelflinger should not be used for new projects and should be moved out
of system/core at some point.  As the first step, move all its headers
under system/core/libpixelflinger/include and update its Android.mk
files so they're not referring to the absolute system/core path anymore.

Change-Id: Idead273ab2c0450409d770f5402c4dba916192a9
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-03-19 12:34:35 -07:00
Greg Hackmann
92564d6e58 Merge "pixelflinger: don't build static library" 2015-03-17 16:43:21 +00:00
Paul Eastham
cc255b4873 Revert "pixelflinger: make self-contained"
This reverts commit 56350fe387.

Change-Id: I4cda5773f39abd3b24df65d7bd9daaef92314b52
2015-03-16 19:01:38 +00:00
Greg Hackmann
593b592e93 pixelflinger: don't build static library
libagl is now the only remaining pixelflinger client in the Android
tree, and it links with pixelflinger dynamically.

Change-Id: Ic5f8af57a88ceaeb25bf890cd6be8bc5a893fc10
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-03-12 13:07:59 -07:00
Greg Hackmann
56350fe387 pixelflinger: make self-contained
pixelflinger should not be used for new projects and should be moved out
of system/core at some point.  As the first step, move all its headers
under system/core/libpixelflinger/include and update its Android.mk
files so they're not referring to the absolute system/core path anymore.

Change-Id: I7acc3ef5b2e21d8ba6fe939ea8d3ec4c41959591
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-03-12 13:02:38 -07:00
Elliott Hughes
110dd4b24b Remove obsolete BUILD_TINY_ANDROID.
Change-Id: I876bce99efb40cd791256535d8d6c0d046b7aeae
2015-01-24 22:39:10 -08:00
Elliott Hughes
76f0a84f6a Linux always has POSIX clocks available.
pixelflinger doesn't have to run on the Mac, but the Condition
code might.

Change-Id: Ib4e9b4daa6e848ffd5742959427b172d45f08e3c
2015-01-09 16:17:46 -08:00
Elliott Hughes
d05f1d51ad Remove dead code.
Intel accidentally made this dead code in 2010 with commit
2bef93cc20, and no one's ever noticed.

Since no one noticing for so long implies that it doesn't matter,
let's just kill the supposedly optimized code.

Change-Id: Id5b37056cb8884c20bfe2db362e19b46f02e337d
2014-12-03 19:35:16 -08:00