From 1a8f090d78004b1275cf97d2ecceefdc26467b27 Mon Sep 17 00:00:00 2001 From: sayen mohanty Date: Tue, 31 May 2011 09:25:15 +0100 Subject: SGX: UDD: Avoid sending a black frame at initialization This patch removes the fb_set_var used when the flipping is being done with the DSS APIs. When the UDD initializes it asks the framebuffer if it can hold certain number of buffers, that call makes a transfer to the display of whatever contents are in the framebuffer (black at init time).This patch avoids such transfer. Change-Id: I04972ce1f9ac8b9b0f1a1232da01e1d68664dc53 Signed-off-by: sayen mohanty Signed-off-by: Gustavo Diaz Prado --- drivers/gpu/pvr/omaplfb/omaplfb_displayclass.c | 36 +++++++++++++++++++------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/pvr/omaplfb/omaplfb_displayclass.c b/drivers/gpu/pvr/omaplfb/omaplfb_displayclass.c index 425059c29a4..88f23656f02 100644 --- a/drivers/gpu/pvr/omaplfb/omaplfb_displayclass.c +++ b/drivers/gpu/pvr/omaplfb/omaplfb_displayclass.c @@ -1386,11 +1386,34 @@ static OMAP_ERROR InitDev(OMAPLFB_DEVINFO *psDevInfo, int fb_idx) DESIRED_BPP); } acquire_console_sem(); + + FBSize = (psLINFBInfo->screen_size) != 0 ? + psLINFBInfo->screen_size : psLINFBInfo->fix.smem_len; + psPVRFBInfo->sSysAddr.uiAddr = psLINFBInfo->fix.smem_start; + psPVRFBInfo->sCPUVAddr = psLINFBInfo->screen_base; + psPVRFBInfo->ulWidth = psLINFBInfo->var.xres; + psPVRFBInfo->ulHeight = psLINFBInfo->var.yres; + psPVRFBInfo->ulByteStride = psLINFBInfo->fix.line_length; + psPVRFBInfo->ulFBSize = FBSize; + psPVRFBInfo->ulBufferSize = + psPVRFBInfo->ulHeight * psPVRFBInfo->ulByteStride; + + /* Calculate the buffers according to the flipping technique */ +#if defined(FLIP_TECHNIQUE_FRAMEBUFFER) psLINFBInfo->var.activate = FB_ACTIVATE_FORCE; fb_set_var(psLINFBInfo, &psLINFBInfo->var); buffers_available = psLINFBInfo->var.yres_virtual / psLINFBInfo->var.yres; +#elif defined(FLIP_TECHNIQUE_OVERLAY) + buffers_available = + psPVRFBInfo->ulFBSize / psPVRFBInfo->ulBufferSize; + +#else +#error No flipping technique selected, please define \ + FLIP_TECHNIQUE_FRAMEBUFFER or FLIP_TECHNIQUE_OVERLAY +#endif + if(buffers_available <= 1) { /* @@ -1442,13 +1465,6 @@ static OMAP_ERROR InitDev(OMAPLFB_DEVINFO *psDevInfo, int fb_idx) DEBUG_PRINTK("*Stride (bytes): %u", (unsigned int)psLINFBInfo->fix.line_length); - psPVRFBInfo->sSysAddr.uiAddr = psLINFBInfo->fix.smem_start; - psPVRFBInfo->sCPUVAddr = psLINFBInfo->screen_base; - psPVRFBInfo->ulWidth = psLINFBInfo->var.xres; - psPVRFBInfo->ulHeight = psLINFBInfo->var.yres; - psPVRFBInfo->ulByteStride = psLINFBInfo->fix.line_length; - psPVRFBInfo->ulFBSize = FBSize; - #ifdef CONFIG_TILER_OMAP /* If TILER is being used, use correct physical stride and FB size */ if ((psPVRFBInfo->sSysAddr.uiAddr >= TILER_MIN_PADDR) && @@ -1463,10 +1479,12 @@ static OMAP_ERROR InitDev(OMAPLFB_DEVINFO *psDevInfo, int fb_idx) psPVRFBInfo->ulByteStride = tiler_stride(tiler_naddr); /* Calculate the whole TILER region to map in bytes */ psPVRFBInfo->ulFBSize = max_rows * psPVRFBInfo->ulByteStride; + /* Re-calculate buffer size with previous stride */ + psPVRFBInfo->ulBufferSize = + psPVRFBInfo->ulHeight * psPVRFBInfo->ulByteStride; } #endif - psPVRFBInfo->ulBufferSize = - psPVRFBInfo->ulHeight * psPVRFBInfo->ulByteStride; + /* Get physical display size for DPI calculation */ if (psLINFBInfo->var.width < 0 || psLINFBInfo->var.height < 0) { psDevInfo->sDisplayInfo.ui32PhysicalWidthmm = 0; -- cgit v1.2.3