summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-07-16 07:36:46 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-07-16 07:36:46 +0000
commit35d25a2b3e18d16e7ea92f9689165105e7b3a056 (patch)
treeef1d1849b15597a5a6c918d705c77fe54f1af192
parent3eda20d3eacd65a28ccd2b8d93f60dfeac9ab9fd (diff)
parent60662f40c5491933bcefc17be750e7054462a019 (diff)
downloadhikey-oreo-m2-release.tar.gz
release-request-05263112-375a-4b1f-a657-a14bb2a5c5a3-for-git_oc-mr1-release-4185249 snap-temp-L63000000082739046android-wear-8.1.0_r1android-vts-8.1_r9android-vts-8.1_r8android-vts-8.1_r7android-vts-8.1_r6android-vts-8.1_r5android-vts-8.1_r4android-vts-8.1_r3android-vts-8.1_r14android-vts-8.1_r13android-vts-8.1_r12android-vts-8.1_r11android-vts-8.1_r10android-security-8.1.0_r93android-security-8.1.0_r92android-security-8.1.0_r91android-security-8.1.0_r90android-security-8.1.0_r89android-security-8.1.0_r88android-security-8.1.0_r87android-security-8.1.0_r86android-security-8.1.0_r85android-security-8.1.0_r84android-security-8.1.0_r83android-security-8.1.0_r82android-cts-8.1_r9android-cts-8.1_r8android-cts-8.1_r7android-cts-8.1_r6android-cts-8.1_r5android-cts-8.1_r4android-cts-8.1_r3android-cts-8.1_r25android-cts-8.1_r24android-cts-8.1_r23android-cts-8.1_r22android-cts-8.1_r21android-cts-8.1_r20android-cts-8.1_r2android-cts-8.1_r19android-cts-8.1_r18android-cts-8.1_r17android-cts-8.1_r16android-cts-8.1_r15android-cts-8.1_r14android-cts-8.1_r13android-cts-8.1_r12android-cts-8.1_r11android-cts-8.1_r10android-cts-8.1_r1android-8.1.0_r9android-8.1.0_r81android-8.1.0_r80android-8.1.0_r8android-8.1.0_r79android-8.1.0_r78android-8.1.0_r77android-8.1.0_r76android-8.1.0_r75android-8.1.0_r74android-8.1.0_r73android-8.1.0_r72android-8.1.0_r71android-8.1.0_r70android-8.1.0_r7android-8.1.0_r69android-8.1.0_r68android-8.1.0_r67android-8.1.0_r66android-8.1.0_r65android-8.1.0_r64android-8.1.0_r63android-8.1.0_r62android-8.1.0_r61android-8.1.0_r60android-8.1.0_r6android-8.1.0_r53android-8.1.0_r52android-8.1.0_r51android-8.1.0_r50android-8.1.0_r5android-8.1.0_r48android-8.1.0_r47android-8.1.0_r46android-8.1.0_r45android-8.1.0_r43android-8.1.0_r42android-8.1.0_r41android-8.1.0_r40android-8.1.0_r4android-8.1.0_r39android-8.1.0_r38android-8.1.0_r37android-8.1.0_r36android-8.1.0_r35android-8.1.0_r33android-8.1.0_r32android-8.1.0_r31android-8.1.0_r30android-8.1.0_r3android-8.1.0_r29android-8.1.0_r28android-8.1.0_r27android-8.1.0_r26android-8.1.0_r25android-8.1.0_r23android-8.1.0_r22android-8.1.0_r21android-8.1.0_r20android-8.1.0_r2android-8.1.0_r19android-8.1.0_r18android-8.1.0_r17android-8.1.0_r16android-8.1.0_r15android-8.1.0_r14android-8.1.0_r13android-8.1.0_r12android-8.1.0_r11android-8.1.0_r10android-8.1.0_r1security-oc-mr1-releaseoreo-mr1-wear-releaseoreo-mr1-vts-releaseoreo-mr1-security-releaseoreo-mr1-s1-releaseoreo-mr1-releaseoreo-mr1-cuttlefish-testingoreo-mr1-cts-releaseoreo-m8-releaseoreo-m7-releaseoreo-m6-s4-releaseoreo-m6-s3-releaseoreo-m6-s2-releaseoreo-m5-releaseoreo-m4-s9-releaseoreo-m4-s8-releaseoreo-m4-s7-releaseoreo-m4-s6-releaseoreo-m4-s5-releaseoreo-m4-s4-releaseoreo-m4-s3-releaseoreo-m4-s2-releaseoreo-m4-s12-releaseoreo-m4-s11-releaseoreo-m4-s10-releaseoreo-m4-s1-releaseoreo-m3-releaseoreo-m2-s5-releaseoreo-m2-s4-releaseoreo-m2-s3-releaseoreo-m2-s2-releaseoreo-m2-s1-releaseoreo-m2-release
Change-Id: Ib82365a211e44d2eafae4299e975021efc405186
-rw-r--r--gralloc960/alloc_device.cpp3
-rw-r--r--gralloc960/alloc_ion.cpp15
-rw-r--r--gralloc960/framebuffer_device.cpp13
-rw-r--r--gralloc960/gralloc_module.cpp18
-rw-r--r--gralloc960/gralloc_priv.h15
-rw-r--r--gralloc960/gralloc_vsync_default.cpp2
-rw-r--r--hikey960/device-hikey960.mk4
-rw-r--r--self-extractors_hikey960/arm/staging/device-partial.mk4
-rw-r--r--vendor_owner_info.txt2
9 files changed, 37 insertions, 39 deletions
diff --git a/gralloc960/alloc_device.cpp b/gralloc960/alloc_device.cpp
index 8614ae54..9a3ff8ca 100644
--- a/gralloc960/alloc_device.cpp
+++ b/gralloc960/alloc_device.cpp
@@ -117,7 +117,7 @@ static int gralloc_alloc_framebuffer_locked(alloc_device_t* dev, size_t size, in
// The entire framebuffer memory is already mapped, now create a buffer object for parts of this memory
private_handle_t* hnd = new private_handle_t(private_handle_t::PRIV_FLAGS_FRAMEBUFFER, usage, size,
- (void*)framebufferVaddr, 0, dup(m->framebuffer->fd),
+ (void*)framebufferVaddr, 0, m->framebuffer->shallow_fbdev_fd,
(framebufferVaddr - (uintptr_t)m->framebuffer->base));
/*
@@ -1234,7 +1234,6 @@ static int alloc_device_free(alloc_device_t* dev, buffer_handle_t handle)
const size_t bufferSize = m->finfo.line_length * m->info.yres;
int index = ((uintptr_t)hnd->base - (uintptr_t)m->framebuffer->base) / bufferSize;
m->bufferMask &= ~(1 << index);
- close(hnd->fd);
}
gralloc_buffer_attr_free( (private_handle_t *) hnd );
diff --git a/gralloc960/alloc_ion.cpp b/gralloc960/alloc_ion.cpp
index 2f9efc05..2af9d945 100644
--- a/gralloc960/alloc_ion.cpp
+++ b/gralloc960/alloc_ion.cpp
@@ -248,6 +248,13 @@ int alloc_backend_alloc(alloc_device_t* dev, size_t size, int usage, buffer_hand
return -1;
}
+ // we do not need ion_hnd once we have shared_fd
+ if (0 != ion_free(m->ion_client, ion_hnd))
+ {
+ AWAR("ion_free( %d ) failed", m->ion_client);
+ }
+ ion_hnd = -1;
+
if (!(usage & GRALLOC_USAGE_PROTECTED))
{
cpu_ptr = (unsigned char*)mmap( NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, shared_fd, 0 );
@@ -255,7 +262,6 @@ int alloc_backend_alloc(alloc_device_t* dev, size_t size, int usage, buffer_hand
if ( MAP_FAILED == cpu_ptr )
{
AERR( "ion_map( %d ) failed", m->ion_client );
- if ( 0 != ion_free( m->ion_client, ion_hnd ) ) AERR( "ion_free( %d ) failed", m->ion_client );
close( shared_fd );
return -1;
}
@@ -280,7 +286,6 @@ int alloc_backend_alloc(alloc_device_t* dev, size_t size, int usage, buffer_hand
if ( NULL != hnd )
{
hnd->share_fd = shared_fd;
- hnd->ion_hnd = ion_hnd;
hnd->min_pgsz = min_pgsz;
*pHandle = hnd;
return 0;
@@ -298,8 +303,6 @@ int alloc_backend_alloc(alloc_device_t* dev, size_t size, int usage, buffer_hand
if ( 0 != ret ) AERR( "munmap failed for base:%p size: %zd", cpu_ptr, size );
}
- ret = ion_free( m->ion_client, ion_hnd );
- if ( 0 != ret ) AERR( "ion_free( %d ) failed", m->ion_client );
return -1;
}
@@ -307,7 +310,7 @@ int alloc_backend_alloc_framebuffer(private_module_t* m, private_handle_t* hnd)
{
struct fb_dmabuf_export fb_dma_buf;
int res;
- res = ioctl( m->framebuffer->fd, FBIOGET_DMABUF, &fb_dma_buf );
+ res = ioctl( m->framebuffer->shallow_fbdev_fd, FBIOGET_DMABUF, &fb_dma_buf );
if(res == 0)
{
hnd->share_fd = fb_dma_buf.fd;
@@ -322,6 +325,7 @@ int alloc_backend_alloc_framebuffer(private_module_t* m, private_handle_t* hnd)
void alloc_backend_alloc_free(private_handle_t const* hnd, private_module_t* m)
{
+ (void) m;
if (hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)
{
return;
@@ -334,7 +338,6 @@ void alloc_backend_alloc_free(private_handle_t const* hnd, private_module_t* m)
if ( 0 != munmap( (void*)hnd->base, hnd->size ) ) AERR( "Failed to munmap handle %p", hnd );
}
close( hnd->share_fd );
- if ( 0 != ion_free( m->ion_client, hnd->ion_hnd ) ) AERR( "Failed to ion_free( ion_client: %d ion_hnd: %d )", m->ion_client, hnd->ion_hnd );
memset( (void*)hnd, 0, sizeof( *hnd ) );
}
}
diff --git a/gralloc960/framebuffer_device.cpp b/gralloc960/framebuffer_device.cpp
index 873b5f4c..fa60eb5b 100644
--- a/gralloc960/framebuffer_device.cpp
+++ b/gralloc960/framebuffer_device.cpp
@@ -92,24 +92,25 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
m->info.activate = FB_ACTIVATE_VBL;
m->info.yoffset = offset / m->finfo.line_length;
+ int fbdev_fd = m->framebuffer->shallow_fbdev_fd;
#ifdef STANDARD_LINUX_SCREEN
- if (ioctl(m->framebuffer->fd, FBIOPAN_DISPLAY, &m->info) == -1)
+ if (ioctl(fbdev_fd, FBIOPAN_DISPLAY, &m->info) == -1)
{
- AERR( "FBIOPAN_DISPLAY failed for fd: %d", m->framebuffer->fd );
+ AERR( "FBIOPAN_DISPLAY failed for fd: %d", fbdev_fd );
m->base.unlock(&m->base, buffer);
return -errno;
}
#else /*Standard Android way*/
- if (ioctl(m->framebuffer->fd, FBIOPUT_VSCREENINFO, &m->info) == -1)
+ if (ioctl(fbdev_fd, FBIOPUT_VSCREENINFO, &m->info) == -1)
{
- AERR( "FBIOPUT_VSCREENINFO failed for fd: %d", m->framebuffer->fd );
+ AERR( "FBIOPUT_VSCREENINFO failed for fd: %d", fbdev_fd );
m->base.unlock(&m->base, buffer);
return -errno;
}
#endif
if ( 0 != gralloc_wait_for_vsync(dev) )
{
- AERR( "Gralloc wait for vsync failed for fd: %d", m->framebuffer->fd );
+ AERR( "Gralloc wait for vsync failed for fd: %d", fbdev_fd );
m->base.unlock(&m->base, buffer);
return -errno;
}
@@ -365,7 +366,7 @@ int init_frame_buffer_locked(struct private_module_t* module)
// Create a "fake" buffer object for the entire frame buffer memory, and store it in the module
module->framebuffer = new private_handle_t(private_handle_t::PRIV_FLAGS_FRAMEBUFFER, GRALLOC_USAGE_HW_FB, fbSize, vaddr,
- 0, dup(fd), 0);
+ 0, fd, 0);
module->numBuffers = info.yres_virtual / info.yres;
module->bufferMask = 0;
diff --git a/gralloc960/gralloc_module.cpp b/gralloc960/gralloc_module.cpp
index 232ecc12..df2d82e3 100644
--- a/gralloc960/gralloc_module.cpp
+++ b/gralloc960/gralloc_module.cpp
@@ -66,22 +66,14 @@ static int gralloc_register_buffer(gralloc_module_t const* module, buffer_handle
// if this handle was created in this process, then we keep it as is.
private_handle_t* hnd = (private_handle_t*)handle;
- if (hnd->pid == getpid())
- {
- // If the handle is created and registered in the same process this is valid,
- // but it could also be that application is registering twice which is illegal.
- AWAR("Registering handle %p coming from the same process: %d.", hnd, hnd->pid);
- }
-
int retval = -EINVAL;
pthread_mutex_lock(&s_map_lock);
- hnd->pid = getpid();
-
if (hnd->flags & private_handle_t::PRIV_FLAGS_FRAMEBUFFER)
{
- AERR( "Can't register buffer %p as it is a framebuffer", handle );
+ AINF("Register framebuffer 0x%p is no-op", handle);
+ retval = 0;
}
else if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_ION)
{
@@ -114,7 +106,7 @@ static int gralloc_unregister_buffer(gralloc_module_t const* module, buffer_hand
{
AERR( "Can't unregister buffer %p as it is a framebuffer", handle );
}
- else if (hnd->pid == getpid()) // never unmap buffers that were not created in this process
+ else
{
pthread_mutex_lock(&s_map_lock);
@@ -142,10 +134,6 @@ static int gralloc_unregister_buffer(gralloc_module_t const* module, buffer_hand
pthread_mutex_unlock(&s_map_lock);
}
- else
- {
- AERR( "Trying to unregister buffer %p from process %d that was not created in current process: %d", hnd, hnd->pid, getpid());
- }
return 0;
}
diff --git a/gralloc960/gralloc_priv.h b/gralloc960/gralloc_priv.h
index a9453549..55feb67e 100644
--- a/gralloc960/gralloc_priv.h
+++ b/gralloc960/gralloc_priv.h
@@ -162,7 +162,7 @@ struct private_handle_t
int share_fd;
int share_attr_fd;
- ion_user_handle_t ion_hnd;
+ ion_user_handle_t ion_hnd_UNUSED;
// ints
int magic;
@@ -183,7 +183,7 @@ struct private_handle_t
};
int lockState;
int writeOwner;
- int pid;
+ int pid_UNUSED;
// locally mapped shared attribute area
union {
@@ -194,7 +194,7 @@ struct private_handle_t
mali_gralloc_yuv_info yuv_info;
// Following members is for framebuffer only
- int fd;
+ int shallow_fbdev_fd; // shallow copy, not dup'ed
union {
off_t offset;
uint64_t padding4;
@@ -209,7 +209,8 @@ struct private_handle_t
#ifdef __cplusplus
/*
* We track the number of integers in the structure. There are 16 unconditional
- * integers (magic - pid, yuv_info, fd and offset). Note that the fd element is
+ * integers (magic - pid, yuv_info, shallow_fbdev_fd and offset).
+ * Note that the shallow_fbdev_fd element is
* considered an int not an fd because it is not intended to be used outside the
* surface flinger process. The GRALLOC_ARM_NUM_INTS variable is used to track the
* number of integers that are conditionally included. Similar considerations apply
@@ -221,7 +222,7 @@ struct private_handle_t
private_handle_t(int _flags, int _usage, int _size, void *_base, int lock_state, int fb_file, off_t fb_offset):
share_fd(-1),
share_attr_fd(-1),
- ion_hnd(-1),
+ ion_hnd_UNUSED(-1),
magic(sMagic),
flags(_flags),
usage(_usage),
@@ -232,10 +233,10 @@ struct private_handle_t
base(_base),
lockState(lock_state),
writeOwner(0),
- pid(getpid()),
+ pid_UNUSED(-1),
attr_base(MAP_FAILED),
yuv_info(MALI_YUV_NO_INFO),
- fd(fb_file),
+ shallow_fbdev_fd(fb_file),
offset(fb_offset)
{
version = sizeof(native_handle);
diff --git a/gralloc960/gralloc_vsync_default.cpp b/gralloc960/gralloc_vsync_default.cpp
index 40f66999..3ce7f0e8 100644
--- a/gralloc960/gralloc_vsync_default.cpp
+++ b/gralloc960/gralloc_vsync_default.cpp
@@ -49,7 +49,7 @@ int gralloc_wait_for_vsync(framebuffer_device_t *dev)
{
int crtc = 0;
gralloc_mali_vsync_report(MALI_VSYNC_EVENT_BEGIN_WAIT);
- if(ioctl(m->framebuffer->fd, FBIO_WAITFORVSYNC, &crtc) < 0)
+ if(ioctl(m->framebuffer->shallow_fbdev_fd, FBIO_WAITFORVSYNC, &crtc) < 0)
{
gralloc_mali_vsync_report(MALI_VSYNC_EVENT_END_WAIT);
return -errno;
diff --git a/hikey960/device-hikey960.mk b/hikey960/device-hikey960.mk
index 6098480f..2645e2d6 100644
--- a/hikey960/device-hikey960.mk
+++ b/hikey960/device-hikey960.mk
@@ -22,7 +22,9 @@ PRODUCT_COPY_FILES += $(LOCAL_PATH)/fstab.hikey960:root/fstab.hikey960 \
device/linaro/hikey/init.hikey960.power.rc:root/init.hikey960.power.rc \
device/linaro/hikey/init.common.usb.rc:root/init.hikey960.usb.rc \
device/linaro/hikey/ueventd.common.rc:root/ueventd.hikey960.rc \
- device/linaro/hikey/common.kl:system/usr/keylayout/hikey960.kl
+ device/linaro/hikey/common.kl:system/usr/keylayout/hikey960.kl \
+ frameworks/native/data/etc/android.hardware.vulkan.level-0.xml:system/etc/permissions/android.hardware.vulkan.level.xml \
+ frameworks/native/data/etc/android.hardware.vulkan.version-1_0_3.xml:system/etc/permissions/android.hardware.vulkan.version.xml
# Build HiKey960 HDMI audio HAL. Experimental only may not work. FIXME
PRODUCT_PACKAGES += audio.primary.hikey960
diff --git a/self-extractors_hikey960/arm/staging/device-partial.mk b/self-extractors_hikey960/arm/staging/device-partial.mk
index 8e667d77..8af8e9c9 100644
--- a/self-extractors_hikey960/arm/staging/device-partial.mk
+++ b/self-extractors_hikey960/arm/staging/device-partial.mk
@@ -15,4 +15,6 @@
# Linaro blob(s) necessary for Hikey hardware
PRODUCT_COPY_FILES := \
vendor/linaro/hikey960/arm/proprietary/lib64/libGLES_mali.so:system/lib64/egl/libGLES_mali.so:linaro \
- vendor/linaro/hikey960/arm/proprietary/libGLES_mali.so:system/lib/egl/libGLES_mali.so:linaro
+ vendor/linaro/hikey960/arm/proprietary/libGLES_mali.so:system/lib/egl/libGLES_mali.so:linaro \
+ vendor/linaro/hikey960/arm/proprietary/lib64/libGLES_mali.so:system/vendor/lib64/hw/vulkan.hikey960.so:linaro \
+ vendor/linaro/hikey960/arm/proprietary/libGLES_mali.so:system/vendor/lib/hw/vulkan.hikey960.so:linaro
diff --git a/vendor_owner_info.txt b/vendor_owner_info.txt
index da8d27f8..85519d6d 100644
--- a/vendor_owner_info.txt
+++ b/vendor_owner_info.txt
@@ -1,2 +1,4 @@
system/vendor/lib64/egl/libGLES_mali.so:linaro
system/vendor/lib/egl/libGLES_mali.so:linaro
+system/vendor/lib/hw/vulkan.hikey960.so:linaro
+system/vendor/lib64/hw/vulkan.hikey960.so:linaro