Commit Graph

35 Commits

Author SHA1 Message Date
Theodore Dubois
46fd7e6077 Support HAL_PIXEL_FORMAT_BLOB in default gralloc
Test: manual, ran scrcpy with codec2's blob allocator
Change-Id: I647ed5b0e9df4920e4a02686185956aa71ee806e
2022-12-12 10:50:28 -08:00
Peter Collingbourne
f2ed293b9b gralloc: Configure framebuffer mode according to requested image format.
Previously we were ignoring the requested image format when mapping a graphics
device via gralloc_alloc, and using the mode that the framebuffer started up
in. This meant that on devices whose framebuffer starts up in a mode other
than RGBA8888, we would map the framebuffer in the other mode and attempt to
use it as an RGBA8888 framebuffer, which would lead to crashes or incorrecet
rendering. This is the case in the ARM FVP, whose framebuffer starts up in
RGB565 mode.

Unfortunately there is no preferred image format passed in to fb_device_open,
and we presumably cannot start passing one in for backwards compatibility
reasons. Therefore, we set the image format to RGBA8888, which appears to
be the only format that the platform ends up using.

Bug: 142352330
Change-Id: I24000fd36910b4044ce7659605efc423e36cba00
2019-10-15 17:50:25 -07:00
Mark Salyzyn
1ae7379baa resolve merge conflicts of 7c451a93 to oc-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Bug: 34250038
Change-Id: I4196a6d5a1365106643ac6c1548fd86faffead6f
2017-04-12 09:11:38 -07:00
Mark Salyzyn
d88dfe8607 libhardware: deprecate cutils/log.h
Replace cutils/log.h with log/log.h. Sort headers. Minimize conflicts.
Add missing required headers.

Test: compile
Bug: 34250038
Change-Id: I5c0f231cbfed90b73e0538c9d32ad3226c7cc5e4
2017-04-11 10:50:06 -07:00
Romain Guy
d0eb44c6da Add support for *_FP16 pixel formats
Bug: 32984164
Test: compile
Change-Id: I0851c62f140801c6784fdb597b3d947402aa5876
2016-12-16 09:53:20 -08:00
Nicolas Capens
bd9860160a Adjust gralloc to SwiftShader's requirements.
SwiftShader processes 2x2 tiles of pixels simultaneously.
4 bytes of padding are required for reading 4-byte pixels in 8-byte chunks.

Change-Id: Ieb73df07859251cd0e5a649f9f3f16a318276e28
2015-10-05 17:12:46 -04:00
Eino-Ville Talvala
e69efbbabf Replace/rename old HAL graphics formats
- Replace RAW_SENSOR with RAW16
 - Remove sRGB formats

Change-Id: Ic5c44878c638c3d3559495ea5685e10fcc2c39e1
2015-03-06 13:19:36 -08:00
Colin Cross
febaaa937f gralloc: fix warnings
Fix LP64 pointer casting warnings, unused parameters, and
turn off missing initializer warnings.

Change-Id: Idb70f4534282fed64ae81cb1e154d3f5b93091b0
2014-02-05 18:21:09 -08:00
The Android Open Source Project
bae5cf92cf Merge commit 'c9940a2bfe94dbe2ef3bfe5e8692bf4e3cea5ba0' into HEAD 2013-11-22 10:35:26 -08:00
synergy dev
6abbed5093 gralloc: do not use GNU old-style field designators
Avoiding the use of gnu extensions improves code portability

Change-Id: Icf8e3d4813bcddff40548bb5e65e615f8697b75c
2013-11-06 17:29:22 -08:00
Mathias Agopian
ba9c8badb7 get rid of HAL pixelformats 5551 and 4444
Change-Id: I196ee30ed57707ed4cc46fb3a9c5c07c5bac6fff
2013-07-26 16:23:33 -07:00
Eino-Ville Talvala
984272d92e Add RAW_SENSOR to gralloc sample
Change-Id: I0621bd70896385c3d522d283a1be714f5f29df3b
2012-05-07 11:01:17 -07:00
Steve Block
60d056bf29 Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: I0cbe865d464a37365fa3be84948b07e5a0d181d0
2012-01-08 11:03:25 +00:00
Mathias Agopian
9da751bbf7 fix [2444483] gralloc size for YUV formats 2010-02-16 14:04:00 -08:00
Mathias Agopian
f96b2064d7 remove all references to pmem and simplify the lock/unlock hooks
this gralloc module is only used on the emulator or without a h/w
renderer. therefore there is no synchronization to do in lock/unlock
and pmem buffers are not relevant.

hopefully this will remove some of the confusion about how gralloc
should be implemented and make it more obvious that this implementation
is not intended to be used by h/w renderers.
2009-12-15 15:00:57 -08:00
Mathias Agopian
ed04f7871b don't memset ashmem region, especially before they're mmapped 2009-08-08 17:01:18 -07:00
Mathias Agopian
7d512e3dc3 add support for RGBX_8888 2009-08-07 20:55:37 -07:00
Mathias Agopian
e83629abb9 make sure to clear surface's buffers when they are allocated 2009-08-07 18:13:47 -07:00
Marco Nelissen
15c9d3af0d Fix the simulator build. 2009-07-17 11:15:18 -07:00
Mathias Agopian
3e1f89bcca fix [1980202] Surfaceflinger crash with transparent rollo on firestone
we now automatically size the pmem region isntead of using hardcoded values
2009-07-16 18:06:19 -07:00
Mathias Agopian
bd80b38f29 more fixes for [1965730]. We now free (unmap) both ashmem and pmem regions. 2009-07-07 17:53:43 -07:00
Mathias Agopian
440d4e4741 for [1965730], give a better name to gralloc buffers 2009-07-07 16:36:31 -07:00
Mathias Agopian
85ce19a4d3 fix [1965730] Device always give force close screen and completely unusable in Éclair build ERC07,rebooted automatically 2009-07-07 16:30:42 -07:00
Mathias Agopian
bfc010a750 better fix for gralloc on sim 2009-07-07 12:43:35 -07:00
Marco Nelissen
a4b587cb06 Simulator build fixes for the new GL stuff. The simulator still doesn't run, but at least it builds. 2009-07-07 09:29:00 -07:00
Mathias Agopian
3d6ddfe771 fix [1964228] emulator crash with the new GL
gralloc didn't keep the error state properly, so after the first pmem allocation failure, it would systematically fail without reverting to ashmem.
2009-07-06 20:54:51 -07:00
Mathias Agopian
14784235ab make sure to UNSLAP pmem buffers when they're destroyed/freed, as the client could still have them mmapped 2009-07-02 17:32:15 -07:00
Mathias Agopian
8bf1f75268 add support for YUV formats 2009-06-25 17:38:50 -07:00
Mathias Agopian
31802ca9c0 fallback to ashmem when pmem is not availlable 2009-06-19 16:14:09 -07:00
Mathias Agopian
ed93e8b392 suppress debug log 2009-06-16 18:26:17 -07:00
Mathias Agopian
8c4ab1fa14 pmem allocator in gralloc. enabled for all surfaces. currently it uses a lot more address space than needed. 2009-06-16 18:16:38 -07:00
Mathias Agopian
72c8508db9 add an offset field to gralloc handles so the framebuffer can work with copybit 2009-06-10 16:06:28 -07:00
Mathias Agopian
988b8bd553 lock will now return the vaddr of the buffer. map/umap are gone.
- make sure to return an error if a buffer is locked twice or unlocked while not locked.
- added registerBuffer() and unregisterBuffer() to the gralloc module so that we can do some cleanup when a buffer is no longer needed. this became necessary after we removed map/unmap so we have a place to unmap buffers without the need of a kernel module.
- change the constants for GRALLOC_USAGE_SW_{READ|WRITE}_NEVER to 0, so that NOT specifying them means "NEVER".
2009-05-04 14:26:56 -07:00
Mathias Agopian
c3ce41d319 don't automatically unmap buffers when they're freed
this is in preparation to an api change wrt gralloc map/unmap
2009-04-14 18:24:09 -07:00
Mathias Agopian
a8a75166a2 Integrate from //sandbox/mathias/donut/...@145728
SurfaceFlinger rework for new EGL driver model support.
2009-04-10 14:24:31 -07:00