Commit graph

22 commits

Author SHA1 Message Date
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
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
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
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
Dan Albert
949aa23898 Fix some clang compilation issues.
Use expected inline behavior with clang.

GCC defaults to -std=gnu90, giving C89 inline semantics with GNU
extensions. Clang defaults to C99. Explicitly use gnu90.

Mark an unused parameter as __unused.

Fix some incorrect casts.

Change-Id: I05b95585d5e3688eda71769b63b6b8a9237bcaf4
2014-09-11 17:17:32 +00:00
Ashok Bhat
410ae2fe8e pixelflinger: Use pointer arithmetic to determine cache flush parameters
CodeCache casts base address to long and then adds size (of type
ssize_t) to get end address. This can cause sign-extension problems.
This patch instead uses simple pointer arithmetic.

Change-Id: Ib71d515a6fd6a7f4762cf974d6cf4eba9a601fa8
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-06-19 12:29:19 +01:00
Hurri Lu
473a729937 Judge mmap failed by MAP_FAILED instead of NULL
Change-Id: I74422cfdba341fcd1a6235044700cf3986e853d0
Signed-off-by: Hurri Lu <jlu32@marvell.com>
2014-05-22 12:51:39 +08:00
Colin Cross
32ea4a895c pixelflinger: use __builtin___clear_cache instead of cacheflush
cacheflush doesn't exist on LP64 any more, and gcc's
__builtin___clear_cache is better in every way.  Use it instead.

Change-Id: Ibbf6facbdefc15b6dda51d014e1c44fb7aa2b17d
2014-02-11 13:32:44 -08:00
Ashok Bhat
658f89dc5c Pixelflinger: Add AArch64 support to pixelflinger JIT.
See the comment-block at the top of Aarch64Assembler.cpp
for overview on how AArch64 support has been implemented

In addition, this commit contains
[x] AArch64 inline asm versions of gglmul series of
    functions and a new unit test bench to test the
    functions

[x] Assembly implementations of scanline_col32cb16blend
    and scanline_t32cb16blend for AArch64, with unit
    test bench

Change-Id: I915cded9e1d39d9a2a70bf8a0394b8a0064d1eb4
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2013-12-12 17:30:13 +00:00
Mathias Agopian
9857d99eec move tinyutils into its own namespace
I was fed-up with the constant conflicts in Eclipse
with the "libutils" version.

Also fix a few copyright notices.

Change-Id: I8ffcb845af4b5d0d178f5565f64dfcfbfa27fcd6
2013-04-01 16:50:43 -07:00
Ian Rogers
04b5ac36a5 Remove unnecessary compiler pragma.
With dlmalloc 2.8.6 the compiler pragmas to suppress warnings are not
necessary.
Also fix compiler warning about redefinition of LOG_TAG.

Depends upon: https://android-review.googlesource.com/42351

Change-Id: I50f70be31f4bd994b09083e722759464476c70b3
2012-08-29 18:13:14 -07:00
Jean-Baptiste Queru
c3c5358b94 Merge "Add MIPS support to pixelflinger." 2012-08-27 14:22:22 -07:00
Ian Rogers
2d13791ce7 Upgrade to dlmalloc 2.8.5.
Remove mspace functionality from cutils.
Directly declare mspace from dlmalloc in code flinger's code cache, and
manage without using morecore.

Depends upon: https://android-review.googlesource.com/41717

Change-Id: If927254febd4414212c690f16509ef2ee1b44b44
2012-08-20 15:30:35 -07:00
Paul Lind
2bc2b79278 Add MIPS support to pixelflinger.
See the comment-block at the top of MIPSAssembler.cpp for
implementation overview.

Change-Id: Id492c10610574af8c89c38d19e12fafc3652c28a
2012-08-13 11:41:15 -07:00
Steve Block
01dda204cd Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: Ibcffdcf620ebae1c389446ce8e9d908f11ac039c
2012-01-08 11:03:26 +00:00
Jean-Baptiste Queru
8e0e372a38 Set PROT_EXEC on the whole pixelflinger code cache.
The pointer difference between word pointers is a number
of words, and it needs to be multiplied by the size of a word
to get a proper byte size.

Without this, we tend to see crashes when the code crosses
a page boundary.

Bug: 3026204
Bug: 3097482
Change-Id: I37776d26d5afcdb1da71680de02fbb95e6548371
2010-10-14 14:29:00 -07:00
Nick Kralevich
beeeee705b Allow pixelflinger to work when NX (No Execute) is enabled.
Instead of allocating memory from the (non executable) heap,
allocate memory using mspace and ensure that we use mprotect
to mark it as PROT_EXEC.  This allows pixelflinger to
continue to work even when NX protections are enabled.

Testing: Using the ApiDemos market app, verify that
Apidemos -> Graphics -> OpenGL ES -> GLSurfaceView
works when "adb shell setprop debug.egl.hw 0" is set.

Change-Id: Ib569cd2543c6fa25688ee76325a712bc2347450b
2010-05-07 16:35:52 -07:00
The Android Open Source Project
dd7bc3319d auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
The Android Open Source Project
e54eebbf1a auto import from //depot/cupcake/@135843 2009-03-03 18:29:04 -08:00
The Android Open Source Project
4f6e8d7a00 Initial Contribution 2008-10-21 07:00:00 -07:00