gralloc1: Import ion handle into registering process
Importing the ion handle when retain() is called validates the incoming ion fd and holds the client process accountable for releasing the handle once it's done. CRs-Fixed: 2020175 Change-Id: I3a169983b6d6b201d044e1c777a631aa16f9cb9a
This commit is contained in:
@@ -129,6 +129,13 @@ int Allocator::MapBuffer(void **base, unsigned int size, unsigned int offset, in
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
int Allocator::ImportBuffer(int fd) {
|
||||
if (ion_allocator_) {
|
||||
return ion_allocator_->ImportBuffer(fd);
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
int Allocator::FreeBuffer(void *base, unsigned int size, unsigned int offset, int fd,
|
||||
int handle) {
|
||||
if (ion_allocator_) {
|
||||
@@ -138,9 +145,9 @@ int Allocator::FreeBuffer(void *base, unsigned int size, unsigned int offset, in
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
int Allocator::CleanBuffer(void *base, unsigned int size, unsigned int offset, int fd, int op) {
|
||||
int Allocator::CleanBuffer(void *base, unsigned int size, unsigned int offset, int handle, int op) {
|
||||
if (ion_allocator_) {
|
||||
return ion_allocator_->CleanBuffer(base, size, offset, fd, op);
|
||||
return ion_allocator_->CleanBuffer(base, size, offset, handle, op);
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user