Snap for 4942340 from d7859b1cb0d18b5c8ea44e4168177a06545409ab to qt-release
Change-Id: Ia68855fa554f55a60839f4c56b1c0ad5a5ec0743
diff --git a/minui/Android.bp b/minui/Android.bp
index 19d28be..31022e1 100644
--- a/minui/Android.bp
+++ b/minui/Android.bp
@@ -35,7 +35,7 @@
whole_static_libs: [
"libadf",
"libdrm",
- "libsync_recovery",
+ "libsync",
],
shared_libs: [
diff --git a/minui/graphics_drm.cpp b/minui/graphics_drm.cpp
index 9336a1e..630b801 100644
--- a/minui/graphics_drm.cpp
+++ b/minui/graphics_drm.cpp
@@ -117,12 +117,16 @@
uint32_t format;
PixelFormat pixel_format = gr_pixel_format();
+ // PixelFormat comes in byte order, whereas DRM_FORMAT_* uses little-endian
+ // (external/libdrm/include/drm/drm_fourcc.h). Note that although drm_fourcc.h also defines a
+ // macro of DRM_FORMAT_BIG_ENDIAN, it doesn't seem to be actually supported (see the discussion
+ // in https://lists.freedesktop.org/archives/amd-gfx/2017-May/008560.html).
if (pixel_format == PixelFormat::ABGR) {
- format = DRM_FORMAT_ABGR8888;
+ format = DRM_FORMAT_RGBA8888;
} else if (pixel_format == PixelFormat::BGRA) {
- format = DRM_FORMAT_BGRA8888;
+ format = DRM_FORMAT_ARGB8888;
} else if (pixel_format == PixelFormat::RGBX) {
- format = DRM_FORMAT_RGBX8888;
+ format = DRM_FORMAT_XBGR8888;
} else {
format = DRM_FORMAT_RGB565;
}