Loading include/ui/DisplayInfo.h +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <stdint.h> #include <sys/types.h> #include <utils/Timers.h> #include <ui/PixelFormat.h> Loading @@ -33,6 +34,8 @@ struct DisplayInfo { float density; uint8_t orientation; bool secure; nsecs_t appVsyncOffset; nsecs_t presentationDeadline; }; /* Display orientations as defined in Surface.java and ISurfaceComposer.h. */ Loading services/surfaceflinger/SurfaceFlinger.cpp +18 −2 Original line number Diff line number Diff line Loading @@ -576,6 +576,22 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display, info.xdpi = xdpi; info.ydpi = ydpi; info.fps = float(1e9 / hwConfig.refresh); info.appVsyncOffset = VSYNC_EVENT_PHASE_OFFSET_NS; // This is how far in advance a buffer must be queued for // presentation at a given time. If you want a buffer to appear // on the screen at time N, you must submit the buffer before // (N - presentationDeadline). // // Normally it's one full refresh period (to give SF a chance to // latch the buffer), but this can be reduced by configuring a // DispSync offset. Any additional delays introduced by the hardware // composer or panel must be accounted for here. // // We add an additional 1ms to allow for processing time and // differences between the ideal and actual refresh rate. info.presentationDeadline = hwConfig.refresh - SF_VSYNC_EVENT_PHASE_OFFSET_NS + 1000000; // All non-virtual displays are currently considered secure. info.secure = true; Loading @@ -586,11 +602,11 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display, return NO_ERROR; } int SurfaceFlinger::getActiveConfig(const sp<IBinder>& display) { int SurfaceFlinger::getActiveConfig(const sp<IBinder>&) { return 0; } status_t SurfaceFlinger::setActiveConfig(const sp<IBinder>& display, int id) { status_t SurfaceFlinger::setActiveConfig(const sp<IBinder>&, int) { return NO_ERROR; } Loading Loading
include/ui/DisplayInfo.h +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <stdint.h> #include <sys/types.h> #include <utils/Timers.h> #include <ui/PixelFormat.h> Loading @@ -33,6 +34,8 @@ struct DisplayInfo { float density; uint8_t orientation; bool secure; nsecs_t appVsyncOffset; nsecs_t presentationDeadline; }; /* Display orientations as defined in Surface.java and ISurfaceComposer.h. */ Loading
services/surfaceflinger/SurfaceFlinger.cpp +18 −2 Original line number Diff line number Diff line Loading @@ -576,6 +576,22 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display, info.xdpi = xdpi; info.ydpi = ydpi; info.fps = float(1e9 / hwConfig.refresh); info.appVsyncOffset = VSYNC_EVENT_PHASE_OFFSET_NS; // This is how far in advance a buffer must be queued for // presentation at a given time. If you want a buffer to appear // on the screen at time N, you must submit the buffer before // (N - presentationDeadline). // // Normally it's one full refresh period (to give SF a chance to // latch the buffer), but this can be reduced by configuring a // DispSync offset. Any additional delays introduced by the hardware // composer or panel must be accounted for here. // // We add an additional 1ms to allow for processing time and // differences between the ideal and actual refresh rate. info.presentationDeadline = hwConfig.refresh - SF_VSYNC_EVENT_PHASE_OFFSET_NS + 1000000; // All non-virtual displays are currently considered secure. info.secure = true; Loading @@ -586,11 +602,11 @@ status_t SurfaceFlinger::getDisplayConfigs(const sp<IBinder>& display, return NO_ERROR; } int SurfaceFlinger::getActiveConfig(const sp<IBinder>& display) { int SurfaceFlinger::getActiveConfig(const sp<IBinder>&) { return 0; } status_t SurfaceFlinger::setActiveConfig(const sp<IBinder>& display, int id) { status_t SurfaceFlinger::setActiveConfig(const sp<IBinder>&, int) { return NO_ERROR; } Loading