Commit graph

18 commits

Author SHA1 Message Date
Laura Abbott
30313f8bc0 libion: Adapt to new ION interface
4.12+ kernels have substantially different ION interface. Adapt
libion to the new one.

In doing so, for sake of clarity, rename ION_IOC_ALLOC to
ION_IOC_NEW_ALLOC the to denote new mechanism.

An ion_is_legacy() is provided to check whether the kernel supports old
ION interface or new. Userspace has the responsibility to use it
accordingly.

Devices using kernels without the 4.12 ION updates, can continue to use libion
as before, and will have no impact.

Only devices using libion with 4.12+ kernels (or kernels with backported ION
updates) will need to update their users of libion, including gralloc.

Test: validated with hikey gralloc, with both old and new kernels

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
  [sumits: keep old abi compatibility]

Change-Id: I7899af9e812d0cf5e73b443a3f0248118b42a382
2017-08-10 09:30:38 +05:30
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
Nick Kralevich
6b694a76f5 ion.c: add O_CLOEXEC to /dev/ion open
Test: device boots and no obvious problems.
Change-Id: I0845b79de49b77878adaf6cd14cc506f7586cccb
2016-11-29 15:20:33 -08:00
Jeff Vander Stoep
1ba4e981db libion: open /dev/ion read-only
/dev/ion driver does not recognize the write operation [1] so open it
read-only.

[1] http://lxr.free-electrons.com/source/drivers/staging/android/ion/ion.c?v=4.5#L1369

Test: Angler builds and boots
Bug: 32120194
Change-Id: I9b26d43ea32cb24426404668701df1f1648d336c
2016-10-21 14:29:22 -07: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
Elliott Hughes
d2ac374909 am 2e14f617: am 06b4e982: Merge "Add missing <malloc.h> and <string.h> includes."
* commit '2e14f61731adbb1f0d0d54bab82bc2f0ecee6a11':
  Add missing <malloc.h> and <string.h> includes.
2015-01-28 22:08:15 +00:00
Elliott Hughes
a744b05984 Add missing <malloc.h> and <string.h> includes.
Change-Id: Ia41756e607663d056e7d2fdd7ecbec7e5841a913
2015-01-28 11:37:57 -08:00
Andreas Gampe
58b80be811 am fcb2f0ab: am 0b7e6516: Merge "Libion: Remove unused variables"
* commit 'fcb2f0abe07ffd1c7a87bdcd7878a556ce0049fb':
  Libion: Remove unused variables
2014-11-25 20:03:45 +00:00
Andreas Gampe
f0a54c17d8 Libion: Remove unused variables
For build-system CFLAGS clean-up, fix unused variables.

Fix missing close of file descriptors. Explicitly exit after a fork.

Change-Id: I76affbc8647c3a760ed3cacc7f3ada3f59e283b1
2014-11-25 10:16:06 -08:00
Rom Lemarchand
5cdcdce50e libion: only modify parameters on success
Wait until a call is successful before modifying the value of pointers
passed

Change-Id: Iaeb2517c8cefeca2f60ebf610d38f264b48e59a0
2014-10-28 15:50:19 +00:00
Colin Cross
aab47b293f libion: return -errno from ion_close
Return -errno from ion_close instead of -1 on error.

Change-Id: Idb828aa4b4d1a660b79d2dba8be32f306eac959d
2013-12-18 18:27:57 -08:00
Colin Cross
7496318486 libion: add NULL checks
Check for NULL in any library function that takes a pointer.

Change-Id: I9ae8887b5ae0f231583173ee6a9dfd2f8c4611ec
2013-12-18 18:27:57 -08:00
Colin Cross
92d7ca6af3 libion: clean up whitespace
Convert everything to 4 space indents, no tabs.

Change-Id: I376fad866864f0579b91ffad406e872fcce566ad
2013-12-18 18:27:54 -08:00
Rom Lemarchand
969eac8161 ion: update struct and type definitions to match kernel header
- Replacing struct ion_handle * with ion_user_handle_t
- Replacing heap_mask field name with heap_id_mask

Change-Id: Iaba1ccc62b9398a7b37c5a734bc21a9ecbbc8277
2013-12-18 18:24:50 -08:00
Rebecca Schultz Zavin
3cfcc30005 Add explicit sync call to ion library
Bug: 6854979
Change-Id: I535d55af897eeb4ed707b5da54f3fbf36afa452c
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2012-09-20 09:46:19 -07:00
Rebecca Schultz Zavin
a50fd5568e Modify ion to use new definition of ALLOC ioctl argument
Also add ion_alloc_fd helper for when you only want a filedescriptor
and know you won't need to access this handle again by its ion_handle

Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

Change-Id: Ia4bae22946b0078084b62f5447fecbf261dfaa83
2012-06-28 13:43:53 -07:00
Rebecca Schultz Zavin
afd9123946 Add ion helper library
This library contains helper functions for using ion

Change-Id: I7d7f76d6d3f36cd94d67797a38099a94214392b1
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2012-02-23 12:18:31 -08:00