Skip to content
Snippets Groups Projects
Commit 5437a040 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8564071 from 0197c63f to mainline-wifi-release

Change-Id: I6b2c5d7039a76eb28f16384f97b5b2f94df6867c
parents 6157e461 0197c63f
No related branches found
No related tags found
No related merge requests found
...@@ -18,10 +18,13 @@ third_party { ...@@ -18,10 +18,13 @@ third_party {
} }
version: "17.0.4" version: "17.0.4"
last_upgrade_date { year: 2017 month: 5 day: 22 } last_upgrade_date { year: 2017 month: 5 day: 22 }
# would be NOTICE save for: license_note: "would be NOTICE save for:\n"
# include/drm-uapi/etnaviv_drm.h " include/drm-uapi/etnaviv_drm.h\n"
# and RESTRICTED save for: " and RESTRICTED save for:\n"
# docs/README.VCE " docs/README.VCE\n"
# docs/README.UVD " docs/README.UVD"
license_type: BY_EXCEPTION_ONLY license_type: BY_EXCEPTION_ONLY
security {
tag: "NVD-CPE2.3:cpe:/a:mesa3d:mesa:17.0.4"
}
} }
adelva@google.com adelva@google.com
dimitrysh@google.com dimitrysh@google.com
sadmac@google.com
...@@ -88,6 +88,11 @@ ifneq ($(MESA_BUILD_GALLIUM),) ...@@ -88,6 +88,11 @@ ifneq ($(MESA_BUILD_GALLIUM),)
LOCAL_REQUIRED_MODULES += gallium_dri LOCAL_REQUIRED_MODULES += gallium_dri
endif endif
# TODO(b/223646636): Temporary hack for handles with HDR metadata fds
ifeq ($(BOARD_GPU_DRIVERS),virgl)
LOCAL_CFLAGS += -DNUM_FDS_HACK
endif
LOCAL_MODULE := libGLES_mesa LOCAL_MODULE := libGLES_mesa
LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT LOCAL_LICENSE_KINDS := SPDX-license-identifier-ISC SPDX-license-identifier-MIT
LOCAL_LICENSE_CONDITIONS := notice LOCAL_LICENSE_CONDITIONS := notice
......
...@@ -174,7 +174,11 @@ get_native_buffer_fds(struct ANativeWindowBuffer *buf, int fds[3]) ...@@ -174,7 +174,11 @@ get_native_buffer_fds(struct ANativeWindowBuffer *buf, int fds[3])
for (int i = 0; i < handle->numFds; i++) for (int i = 0; i < handle->numFds; i++)
fds[i] = handle->data[i]; fds[i] = handle->data[i];
#ifdef NUM_FDS_HACK
return 1;
#else
return handle->numFds; return handle->numFds;
#endif
} }
#ifdef HAVE_DRM_GRALLOC #ifdef HAVE_DRM_GRALLOC
...@@ -199,24 +203,56 @@ droid_create_image_from_prime_fds_yuv(_EGLDisplay *disp, ...@@ -199,24 +203,56 @@ droid_create_image_from_prime_fds_yuv(_EGLDisplay *disp,
int ret; int ret;
unsigned error; unsigned error;
if (!dri2_dpy->gralloc->lock_ycbcr) {
_eglLog(_EGL_WARNING, "Gralloc does not support lock_ycbcr");
return NULL;
}
memset(&ycbcr, 0, sizeof(ycbcr)); memset(&ycbcr, 0, sizeof(ycbcr));
ret = dri2_dpy->gralloc->lock_ycbcr(dri2_dpy->gralloc, buf->handle, if (dri2_dpy->gralloc->lock_ycbcr) {
0, 0, 0, 0, 0, &ycbcr); ret = dri2_dpy->gralloc->lock_ycbcr(dri2_dpy->gralloc, buf->handle,
if (ret) { 0, 0, 0, 0, 0, &ycbcr);
/* HACK: See droid_create_image_from_prime_fds() and if (ret) {
* https://issuetracker.google.com/32077885.*/ /* HACK: See droid_create_image_from_prime_fds() and
if (buf->format == HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) * https://issuetracker.google.com/32077885.*/
if (buf->format == HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED)
return NULL;
_eglLog(_EGL_WARNING, "gralloc->lock_ycbcr failed: %d", ret);
return NULL; return NULL;
}
_eglLog(_EGL_WARNING, "gralloc->lock_ycbcr failed: %d", ret); dri2_dpy->gralloc->unlock(dri2_dpy->gralloc, buf->handle);
return NULL; } else {
_eglLog(_EGL_WARNING, "Gralloc does not support lock_ycbcr!");
// HACK: Prepare a hardcoded ycrcb struct to prevent crashes while trying
// to create a YVU420_ANDROID or FLEX_YCbCr_420 (NV12) image with gralloc4
// see: b/225392099
if (buf->format == HAL_PIXEL_FORMAT_YV12) {
// HAL_PIXEL_FORMAT_YV12 => DRM_FORMAT_YVU420_ANDROID
// The stride of Android YV12 buffers is required to be aligned to 16 bytes
size_t luma_stride = ALIGN(buf->width, 32);
size_t chroma_stride = ALIGN(buf->width/2, 16);
ycbcr.y = 0;
ycbcr.cr = (void*)(luma_stride*buf->height);
ycbcr.cb = (void*)(luma_stride*buf->height+chroma_stride*buf->height/2);
ycbcr.ystride = luma_stride;
ycbcr.cstride = chroma_stride;
ycbcr.chroma_step = 1;
_eglLog(_EGL_WARNING,
"Using a hardcoded ycbcr struct for DRM_FORMAT_YVU420_ANDROID format.");
} else if (buf->format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
// HAL_PIXEL_FORMAT_YCbCr_420_888 => DRM_FORMAT_FLEX_YCbCr_420_888
size_t luma_stride = buf->width;
size_t chroma_stride = buf->width;
ycbcr.y = 0;
ycbcr.cr = (void*)(luma_stride*buf->height+1);
ycbcr.cb = (void*)(luma_stride*buf->height);
ycbcr.ystride = luma_stride;
ycbcr.cstride = chroma_stride;
ycbcr.chroma_step = 2;
_eglLog(_EGL_WARNING,
"Using a hardcoded ycbcr struct for DRM_FORMAT_FLEX_YCbCr_420_888 format.");
} else {
_eglLog(_EGL_WARNING,
"Unable to create an image for native YUV format %x", buf->format);
return NULL;
}
} }
dri2_dpy->gralloc->unlock(dri2_dpy->gralloc, buf->handle);
/* When lock_ycbcr's usage argument contains no SW_READ/WRITE flags /* When lock_ycbcr's usage argument contains no SW_READ/WRITE flags
* it will return the .y/.cb/.cr pointers based on a NULL pointer, * it will return the .y/.cb/.cr pointers based on a NULL pointer,
......
...@@ -96,8 +96,8 @@ $(intermediates)/ir3/ir3_parser.c: $(ir3_parser_deps) $(BISON) $(BISON_DATA) $(M ...@@ -96,8 +96,8 @@ $(intermediates)/ir3/ir3_parser.c: $(ir3_parser_deps) $(BISON) $(BISON_DATA) $(M
$(intermediates)/ir3/ir3_parser.h: $(ir3_parser_deps) $(BISON) $(BISON_DATA) $(M4) $(intermediates)/ir3/ir3_parser.h: $(ir3_parser_deps) $(BISON) $(BISON_DATA) $(M4)
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
$(hide) $(BISON) $< --name-prefix=ir3_yy --defines=$@ $(hide) $(BISON) $< --name-prefix=ir3_yy --defines=$@ --output=$@.tab.c
$(hide) M4=$(M4) $(BISON) $< --name-prefix=ir3_yy --defines=$@ $(hide) M4=$(M4) $(BISON) $< --name-prefix=ir3_yy --defines=$@ --output=$@.tab.c
include $(MESA_COMMON_MK) include $(MESA_COMMON_MK)
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment