OSDN Git Service

Align goldfish_dma_context to 8 byte boundaries
authorLingfeng Yang <lfy@google.com>
Fri, 17 Feb 2017 22:44:20 +0000 (14:44 -0800)
committerLingfeng Yang <lfy@google.com>
Fri, 17 Feb 2017 22:45:49 +0000 (14:45 -0800)
bug: 35465006

It looks like when Chrome is started, we are in some strange world
where sizeof(goldfish_dma_context) = 16 instead of 24,
and we get in trouble with gralloc_register buffer,
and Chrome fails to boot.

TODO: Note that youtube videos inside chrome still don't seem to work,
for some reason (this doesn't depend on whether or not goldfish_dma is
used).

Change-Id: Ibc66885434b885993025b70d957ea8e1adf524de

system/OpenglSystemCommon/goldfish_dma.h

index b314f8d..5baa510 100644 (file)
@@ -42,9 +42,13 @@ struct goldfish_dma_ioctl_info {
 
 // userspace interface
 struct goldfish_dma_context {
-    int fd;
     void* mapped;
+#if !defined(__x86_64__)
+    int mapped_padding;
+#endif
     uint64_t sz; // size of reservation
+    int fd;
+    int fd_padding;
 };
 
 int goldfish_dma_lock(struct goldfish_dma_context* cxt);