summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Diaz Prado <x0083741@ti.com>2011-05-31 09:25:05 +0100
committerAndy Green <andy.green@linaro.org>2011-05-31 11:06:37 +0100
commitfa786151f951044d352dacb6c374e92114f12989 (patch)
treecc2afe78549014ed63c16502ec0d040f0bbd9d02
parent06eac788a455158c045087e6881ce59f93611386 (diff)
SGX: UDD: Correct update and sync sequence for DPI and HDMI panels
Prevents tearing on DPI and HDMI panel by following the correct update and sync sequence for those panels. Code is generic for DSI and DPI panels. Change-Id: Ided7bf4e9795d8bd389c63007a7b83834833f720 Signed-off-by: Gustavo Diaz Prado <x0083741@ti.com>
-rw-r--r--drivers/gpu/pvr/omaplfb/omaplfb.h3
-rw-r--r--drivers/gpu/pvr/omaplfb/omaplfb_displayclass.c8
-rw-r--r--drivers/gpu/pvr/omaplfb/omaplfb_linux.c23
3 files changed, 21 insertions, 13 deletions
diff --git a/drivers/gpu/pvr/omaplfb/omaplfb.h b/drivers/gpu/pvr/omaplfb/omaplfb.h
index f16e8e04098..7e46c9063ab 100644
--- a/drivers/gpu/pvr/omaplfb/omaplfb.h
+++ b/drivers/gpu/pvr/omaplfb/omaplfb.h
@@ -153,7 +153,8 @@ OMAP_ERROR OMAPLFBInit(void);
OMAP_ERROR OMAPLFBDeinit(void);
void *OMAPLFBAllocKernelMem(unsigned long ulSize);
void OMAPLFBFreeKernelMem(void *pvMem);
-void OMAPLFBWaitForSync(OMAPLFB_DEVINFO *psDevInfo);
+void OMAPLFBPresentSync(OMAPLFB_DEVINFO *psDevInfo,
+ OMAPLFB_FLIP_ITEM *psFlipItem);
OMAP_ERROR OMAPLFBGetLibFuncAddr(char *szFunctionName,
PFN_DC_GET_PVRJTABLE *ppfnFuncTable);
void OMAPLFBFlip(OMAPLFB_SWAPCHAIN *psSwapChain, unsigned long aPhyAddr);
diff --git a/drivers/gpu/pvr/omaplfb/omaplfb_displayclass.c b/drivers/gpu/pvr/omaplfb/omaplfb_displayclass.c
index 082e2d13f91..c5b0f79b15c 100644
--- a/drivers/gpu/pvr/omaplfb/omaplfb_displayclass.c
+++ b/drivers/gpu/pvr/omaplfb/omaplfb_displayclass.c
@@ -1039,13 +1039,9 @@ static void OMAPLFBSyncIHandler(struct work_struct *work)
ulMaxIndex = psSwapChain->ulBufferCount - 1;
/* Iterate through the flip items and flip them if necessary */
- while(psFlipItem->bValid)
- {
- /* Synchronize with the display */
- OMAPLFBWaitForSync(psDevInfo);
+ while (psFlipItem->bValid) {
/* Update display */
- OMAPLFBFlip(psSwapChain,
- (unsigned long)psFlipItem->sSysAddr->uiAddr);
+ OMAPLFBPresentSync(psDevInfo, psFlipItem);
psFlipItem->ulSwapInterval--;
psFlipItem->bFlipped = OMAP_TRUE;
diff --git a/drivers/gpu/pvr/omaplfb/omaplfb_linux.c b/drivers/gpu/pvr/omaplfb/omaplfb_linux.c
index 90951f4f439..c8172532d6f 100644
--- a/drivers/gpu/pvr/omaplfb/omaplfb_linux.c
+++ b/drivers/gpu/pvr/omaplfb/omaplfb_linux.c
@@ -229,12 +229,13 @@ void OMAPLFBFlip(OMAPLFB_SWAPCHAIN *psSwapChain, unsigned long aPhyAddr)
#endif
/*
- * 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
+ * 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 OMAPLFBWaitForSync(OMAPLFB_DEVINFO *psDevInfo)
+void OMAPLFBPresentSync(OMAPLFB_DEVINFO *psDevInfo,
+ OMAPLFB_FLIP_ITEM *psFlipItem)
{
struct fb_info * framebuffer = psDevInfo->psLINFBInfo;
struct omap_dss_device *display = fb2display(framebuffer);
@@ -250,10 +251,20 @@ void OMAPLFBWaitForSync(OMAPLFB_DEVINFO *psDevInfo)
manager = display->manager;
if (driver && driver->sync &&
- driver->get_update_mode(display) == OMAP_DSS_UPDATE_MANUAL)
+ driver->get_update_mode(display) == OMAP_DSS_UPDATE_MANUAL) {
+ /* Wait first for the DSI bus to be released then update */
err = driver->sync(display);
- else if (manager && manager->wait_for_vsync)
+ OMAPLFBFlip(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
+ */
+ OMAPLFBFlip(psDevInfo->psSwapChain,
+ (unsigned long)psFlipItem->sSysAddr->uiAddr);
err = manager->wait_for_vsync(manager);
+ }
if (err)
WARNING_PRINTK("Unable to sync with display %u!",