/* * Present frame and synchronize with the display to prevent tearing * On DSI panels the sync function is used to handle FRAMEDONE IRQ * On DPI panels the wait_for_vsync is used to handle VSYNC IRQ * in: psDevInfo */ void OMAPLFBPresentSync(OMAPLFB_DEVINFO *psDevInfo, OMAPLFB_FLIP_ITEM *psFlipItem) { struct fb_info *framebuffer = psDevInfo->psLINFBInfo; struct omapfb_info *ofbi = FB2OFB(framebuffer); struct omap_dss_device *display; struct omapfb2_device *fbdev = ofbi->fbdev; struct omap_dss_driver *driver; struct omap_overlay_manager *manager; int err = 1; omapfb_lock(fbdev); // [email protected] Backup the Display device for using later [START] #if defined(CONFIG_MACH_LGE_OMAP3) Prev_disp = display = fb2display(framebuffer); #else display = fb2display(framebuffer); #endif // [email protected] Backup the Display device for using later [END] /* The framebuffer doesn't have a display attached, just bail out */ if (!display) { omapfb_unlock(fbdev); return; } driver = display->driver; manager = display->manager; if (driver && driver->sync && driver->get_update_mode(display) == OMAP_DSS_UPDATE_MANUAL) { /* Wait first for the DSI bus to be released then update */ err = driver->sync(display); OMAPLFBFlipNoLock(psDevInfo->psSwapChain, (unsigned long)psFlipItem->sSysAddr->uiAddr); } else if (manager && manager->wait_for_vsync) { /* * Update the video pipelines registers then wait until the * frame is shown with a VSYNC */ OMAPLFBFlipNoLock(psDevInfo->psSwapChain, (unsigned long)psFlipItem->sSysAddr->uiAddr); err = manager->wait_for_vsync(manager); } if (err) WARNING_PRINTK("Unable to sync with display %u!", psDevInfo->uDeviceID); omapfb_unlock(fbdev); }
void OMAPLFBFlip(OMAPLFB_SWAPCHAIN *psSwapChain, unsigned long aPhyAddr) { OMAPLFB_DEVINFO *psDevInfo = (OMAPLFB_DEVINFO *)psSwapChain->pvDevInfo; struct fb_info *framebuffer = psDevInfo->psLINFBInfo; struct omapfb_info *ofbi = FB2OFB(framebuffer); struct omapfb2_device *fbdev = ofbi->fbdev; omapfb_lock(fbdev); OMAPLFBFlipNoLock(psSwapChain, aPhyAddr); omapfb_unlock(fbdev); }
/* * Synchronize with the display to prevent tearing * On DSI panels the display->sync function is used to handle FRAMEDONE IRQ * On DPI panels the display->wait_vsync is used to handle VSYNC IRQ * in: psDevInfo */ void OMAPLFBPresentSync(OMAPLFB_DEVINFO *psDevInfo, OMAPLFB_FLIP_ITEM *psFlipItem) { struct fb_info * framebuffer = psDevInfo->psLINFBInfo; struct omapfb_info *ofbi = FB2OFB(framebuffer); struct omapfb2_device *fbdev = ofbi->fbdev; struct omap_dss_device *display; int err = 1; omapfb_lock(fbdev); display = fb2display(framebuffer); /* The framebuffer doesn't have a display attached, just bail out */ if (!display) { omapfb_unlock(fbdev); return; } if (display->sync && display->get_update_mode(display) == OMAP_DSS_UPDATE_MANUAL) { /* Wait first for the DSI bus to be released then update */ err = display->sync(display); OMAPLFBFlipNoLock(psDevInfo->psSwapChain, (unsigned long)psFlipItem->sSysAddr->uiAddr); } else if (display->wait_vsync) { /* * Update the video pipelines registers then wait until the * frame is shown with a VSYNC */ OMAPLFBFlipNoLock(psDevInfo->psSwapChain, (unsigned long)psFlipItem->sSysAddr->uiAddr); err = display->wait_vsync(display); } if (err) WARNING_PRINTK("Unable to sync with display %u!", psDevInfo->uDeviceID); omapfb_unlock(fbdev); }