merge in jb-mr2-release history after reset to jb-mr2-dev
diff --git a/debuggerd/tombstone.c b/debuggerd/tombstone.c
index 7146120..77f6ef1 100644
--- a/debuggerd/tombstone.c
+++ b/debuggerd/tombstone.c
@@ -357,23 +357,24 @@
}
}
-static void dump_map(log_t* log, map_info_t* m, const char* what) {
+static void dump_map(log_t* log, map_info_t* m, const char* what, int scopeFlags) {
if (m != NULL) {
- _LOG(log, SCOPE_SENSITIVE, " %08x-%08x %c%c%c %s\n", m->start, m->end,
+ _LOG(log, scopeFlags, " %08x-%08x %c%c%c %s\n", m->start, m->end,
m->is_readable ? 'r' : '-',
m->is_writable ? 'w' : '-',
m->is_executable ? 'x' : '-',
m->name);
} else {
- _LOG(log, SCOPE_SENSITIVE, " (no %s)\n", what);
+ _LOG(log, scopeFlags, " (no %s)\n", what);
}
}
-static void dump_nearby_maps(const ptrace_context_t* context, log_t* log, pid_t tid) {
+static void dump_nearby_maps(const ptrace_context_t* context, log_t* log, pid_t tid, bool at_fault) {
+ int scopeFlags = SCOPE_SENSITIVE | (at_fault ? SCOPE_AT_FAULT : 0);
siginfo_t si;
memset(&si, 0, sizeof(si));
if (ptrace(PTRACE_GETSIGINFO, tid, 0, &si)) {
- _LOG(log, SCOPE_SENSITIVE, "cannot get siginfo for %d: %s\n",
+ _LOG(log, scopeFlags, "cannot get siginfo for %d: %s\n",
tid, strerror(errno));
return;
}
@@ -387,7 +388,7 @@
return;
}
- _LOG(log, SCOPE_SENSITIVE, "\nmemory map around fault addr %08x:\n", (int)si.si_addr);
+ _LOG(log, scopeFlags, "\nmemory map around fault addr %08x:\n", (int)si.si_addr);
/*
* Search for a match, or for a hole where the match would be. The list
@@ -415,9 +416,9 @@
* Show "next" then "match" then "prev" so that the addresses appear in
* ascending order (like /proc/pid/maps).
*/
- dump_map(log, next, "map below");
- dump_map(log, map, "map for address");
- dump_map(log, prev, "map above");
+ dump_map(log, next, "map below", scopeFlags);
+ dump_map(log, map, "map for address", scopeFlags);
+ dump_map(log, prev, "map above", scopeFlags);
}
static void dump_thread(const ptrace_context_t* context, log_t* log, pid_t tid, bool at_fault,
@@ -428,7 +429,7 @@
dump_backtrace_and_stack(context, log, tid, at_fault);
if (at_fault) {
dump_memory_and_code(context, log, tid, at_fault);
- dump_nearby_maps(context, log, tid);
+ dump_nearby_maps(context, log, tid, at_fault);
}
}
diff --git a/include/system/graphics.h b/include/system/graphics.h
index ab064db..ed493f5 100644
--- a/include/system/graphics.h
+++ b/include/system/graphics.h
@@ -17,6 +17,8 @@
#ifndef SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H
#define SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -188,12 +190,64 @@
*/
HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED = 0x22,
+ /*
+ * Android flexible YCbCr formats
+ *
+ * This format allows platforms to use an efficient YCbCr/YCrCb buffer
+ * layout, while still describing the buffer layout in a way accessible to
+ * the CPU in a device-independent manner. While called YCbCr, it can be
+ * used to describe formats with either chromatic ordering, as well as
+ * whole planar or semiplanar layouts.
+ *
+ * struct android_ycbcr (below) is the the struct used to describe it.
+ *
+ * This format must be accepted by the gralloc module when
+ * USAGE_HW_CAMERA_WRITE and USAGE_SW_READ_* are set.
+ *
+ * This format is locked for use by gralloc's (*lock_ycbcr) method, and
+ * locking with the (*lock) method will return an error.
+ */
+ HAL_PIXEL_FORMAT_YCbCr_420_888 = 0x23,
+
/* Legacy formats (deprecated), used by ImageFormat.java */
HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, // NV16
HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11, // NV21
HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14, // YUY2
};
+/*
+ * Structure for describing YCbCr formats for consumption by applications.
+ * This is used with HAL_PIXEL_FORMAT_YCbCr_*_888.
+ *
+ * Buffer chroma subsampling is defined in the format.
+ * e.g. HAL_PIXEL_FORMAT_YCbCr_420_888 has subsampling 4:2:0.
+ *
+ * Buffers must have a 8 bit depth.
+ *
+ * @y, @cb, and @cr point to the first byte of their respective planes.
+ *
+ * Stride describes the distance in bytes from the first value of one row of
+ * the image to the first value of the next row. It includes the width of the
+ * image plus padding.
+ * @ystride is the stride of the luma plane.
+ * @cstride is the stride of the chroma planes.
+ *
+ * @chroma_step is the distance in bytes from one chroma pixel value to the
+ * next. This is 2 bytes for semiplanar (because chroma values are interleaved
+ * and each chroma value is one byte) and 1 for planar.
+ */
+
+struct android_ycbcr {
+ void *y;
+ void *cb;
+ void *cr;
+ size_t ystride;
+ size_t cstride;
+ size_t chroma_step;
+
+ /** reserved for future use, set to 0 by gralloc's (*lock_ycbcr)() */
+ uint32_t reserved[8];
+};
/**
* Transformation definitions