1 #ifndef ANDROID_DVR_CONFIG_H 2 #define ANDROID_DVR_CONFIG_H 3 4 // This header is shared by VrCore and Android and must be kept in sync. 5 6 #include <stdint.h> 7 #include <sys/cdefs.h> 8 9 __BEGIN_DECLS 10 11 // This is a shared memory buffer for passing config data from VrCore to 12 // libvrflinger in SurfaceFlinger. 13 struct __attribute__((packed, aligned(16))) DvrConfig { 14 // Offset before vsync to submit frames to hardware composer. 15 int32_t frame_post_offset_ns{4000000}; 16 17 // If the number of pending fences goes over this count at the point when we 18 // are about to submit a new frame to HWC, we will drop the frame. This 19 // should be a signal that the display driver has begun queuing frames. Note 20 // that with smart displays (with RAM), the fence is signaled earlier than 21 // the next vsync, at the point when the DMA to the display completes. 22 // Currently we use a smart display and the EDS timing coincides with zero 23 // pending fences, so this is 0. 24 int32_t allowed_pending_fence_count{0}; 25 26 // New fields should always be added to the end for backwards compat. 27 28 // Reserved padding to 16 bytes. 29 uint8_t pad[8]; 30 }; 31 32 __END_DECLS 33 34 #endif // ANDROID_DVR_CONFIG_H 35