コード例 #1
0
DAL_STATUS DAL_Clean(void)
{
    const UINT32 BG_COLOR = MAKE_TWO_RGB565_COLOR(DAL_BG_COLOR, DAL_BG_COLOR);

    UINT32 i, *ptr;

    if (NULL == mfc_handle)
        return DAL_STATUS_NOT_READY;

    DAL_LOCK();

    MFC_CHECK_RET(MFC_ResetCursor(mfc_handle));

    LCD_CHECK_RET(LCD_LayerEnable(ASSERT_LAYER, FALSE));

    ptr = (UINT32 *)dal_fb_addr;
    for(i = 0; i < DAL_GetLayerSize() / sizeof(UINT32); ++ i) {
        *ptr ++ = BG_COLOR;
    }

    dal_shown = FALSE;

    DAL_UNLOCK();

    return DAL_STATUS_OK;
}
コード例 #2
0
DAL_STATUS DAL_SetScreenColor(DAL_COLOR color)
{
    UINT32 i;
    UINT32 size;
    UINT32 BG_COLOR;
    MFC_CONTEXT *ctxt =NULL;
    UINT32 offset;
    UINT32 *addr;
    color=RGB888_To_RGB565(color);
    BG_COLOR = MAKE_TWO_RGB565_COLOR(color, color);

    ctxt = (MFC_CONTEXT *)mfc_handle;
    if(!ctxt)
        return DAL_STATUS_FATAL_ERROR;
    if(ctxt->screen_color==color)
        return DAL_STATUS_OK;
    offset =  MFC_Get_Cursor_Offset(mfc_handle);
    addr=(UINT32 *)(ctxt->fb_addr+offset);

    size= DAL_GetLayerSize()-offset - DAL_address_burst_align();
    for(i = 0; i < size/ sizeof(UINT32); ++ i)
    {
        *addr ++ = BG_COLOR;
    }
    ctxt->screen_color=color;

    return DAL_STATUS_OK;
}
コード例 #3
0
DISP_STATUS DISP_ConfigAssertLayerMva()
{
    unsigned int mva;
	ASSERT(DAL_layerPA);
    LCD_CHECK_RET(LCD_AllocUIMva(DAL_layerPA, &mva, DAL_GetLayerSize())); 
	DISP_LOG("DAL Layer PA = DAL_layerPA = 0x%x, MVA = 0x%x\n", DAL_layerPA, mva);
	LCD_CHECK_RET(LCD_LayerSetAddress(ASSERT_LAYER, mva));
	return DISP_STATUS_OK;
}
コード例 #4
0
static DAL_STATUS DAL_SetRedScreen(UINT32 *addr)
{
    UINT32 i;
    const UINT32 BG_COLOR = MAKE_TWO_RGB565_COLOR(DAL_BG_COLOR, DAL_BG_COLOR);

    for(i = 0; i < DAL_GetLayerSize() / sizeof(UINT32); ++ i) {
        *addr ++ = BG_COLOR;
    }

}
コード例 #5
0
DAL_STATUS DAL_Clean(void)
{
    const UINT32 BG_COLOR = MAKE_TWO_RGB565_COLOR(DAL_BG_COLOR, DAL_BG_COLOR);
	DAL_STATUS ret = DAL_STATUS_OK;
    UINT32 i, *ptr;
    
    if (NULL == mfc_handle) 
        return DAL_STATUS_NOT_READY;

//    if (LCD_STATE_POWER_OFF == LCD_GetState())
//        return DAL_STATUS_LCD_IN_SUSPEND;

    DAL_LOCK();

    DAL_CHECK_MFC_RET(MFC_ResetCursor(mfc_handle));
 
    ptr = (UINT32 *)dal_fb_addr;
   	for(i = 0; i < DAL_GetLayerSize() / sizeof(UINT32); ++ i) {
       	*ptr ++ = BG_COLOR;
   	}

    if (LCD_STATE_POWER_OFF == LCD_GetState()) {
	    DISP_LOG_PRINT(ANDROID_LOG_INFO, "DAL", "dal_clean in power off\n");
        dal_disable_when_resume = TRUE;
		ret = DAL_STATUS_LCD_IN_SUSPEND;
        goto End;
    }

	DAL_CHECK_LCD_RET(LCD_LayerEnable(ASSERT_LAYER, FALSE));
    dal_shown = FALSE;
#ifdef DAL_LOWMEMORY_ASSERT
   	if (dal_lowMemory_shown) {//only need show lowmemory assert
		UINT32 LOWMEMORY_FG_COLOR = MAKE_TWO_RGB565_COLOR(DAL_LOWMEMORY_FG_COLOR, DAL_LOWMEMORY_FG_COLOR);
		UINT32 LOWMEMORY_BG_COLOR = MAKE_TWO_RGB565_COLOR(DAL_LOWMEMORY_BG_COLOR, DAL_LOWMEMORY_BG_COLOR);

		DAL_CHECK_MFC_RET(MFC_LowMemory_Printf(mfc_handle, low_memory_msg, LOWMEMORY_FG_COLOR, LOWMEMORY_BG_COLOR));
		Show_LowMemory();
   	}
	dal_enable_when_resume_lowmemory = FALSE;
	dal_disable_when_resume_lowmemory = FALSE;
#endif
	dal_disable_when_resume = FALSE;
End:
	DAL_UNLOCK();
    return ret;
}
コード例 #6
0
DAL_STATUS DAL_Clean(void)
{
    const UINT32 BG_COLOR = MAKE_TWO_RGB565_COLOR(DAL_BG_COLOR, DAL_BG_COLOR);
    DAL_STATUS ret = DAL_STATUS_OK;
    UINT32 i, *ptr;
    static int dal_clean_cnt = 0;
    
    printk("[MTKFB_DAL] DAL_Clean\n");
    if (NULL == mfc_handle) 
        return DAL_STATUS_NOT_READY;

//    if (LCD_STATE_POWER_OFF == LCD_GetState())
//        return DAL_STATUS_LCD_IN_SUSPEND;

    DAL_LOCK();

    DAL_CHECK_MFC_RET(MFC_ResetCursor(mfc_handle));
 
    ptr = (UINT32 *)dal_fb_addr;
   	for(i = 0; i < DAL_GetLayerSize() / sizeof(UINT32); ++ i) {
       	*ptr ++ = BG_COLOR;
   	}
/*
    if (LCD_STATE_POWER_OFF == LCD_GetState()) {
	    DISP_LOG_PRINT(ANDROID_LOG_INFO, "DAL", "dal_clean in power off\n");
        dal_disable_when_resume = TRUE;
        ret = DAL_STATUS_LCD_IN_SUSPEND;
        goto End;
    }
    */
    if (down_interruptible(&sem_early_suspend)) {
        DISP_LOG_PRINT(ANDROID_LOG_INFO, "DAL", "can't get semaphore in DAL_Clean()\n");
        goto End;
    }
		//xuecheng, for debug
#if 0
	if(is_early_suspended){
		up(&sem_early_suspend);
		DISP_LOG_PRINT(ANDROID_LOG_INFO, "DAL", "dal_clean in power off\n");
		goto End;
	}
	#endif
    up(&sem_early_suspend);

    mutex_lock(&OverlaySettingMutex);

    //TODO: if dal_shown=false, and 3D enabled, mtkfb may disable UI layer, please modify 3D driver
    if(isAEEEnabled==1)
    {
        DAL_CHECK_LCD_RET(LCD_LayerEnable(ASSERT_LAYER, FALSE));
        
        // DAL disable, switch UI layer to default layer 3
        printk("[DDP]* isAEEEnabled from 1 to 0, %d \n", dal_clean_cnt++);
        isAEEEnabled = 0;
        DAL_CHECK_LCD_RET(LCD_Dynamic_Change_FB_Layer(isAEEEnabled));  // restore UI layer to DEFAULT_UI_LAYER
    }
    
    dal_shown = FALSE;
#ifdef DAL_LOWMEMORY_ASSERT
   	if (dal_lowMemory_shown) {//only need show lowmemory assert
		UINT32 LOWMEMORY_FG_COLOR = MAKE_TWO_RGB565_COLOR(DAL_LOWMEMORY_FG_COLOR, DAL_LOWMEMORY_FG_COLOR);
		UINT32 LOWMEMORY_BG_COLOR = MAKE_TWO_RGB565_COLOR(DAL_LOWMEMORY_BG_COLOR, DAL_LOWMEMORY_BG_COLOR);

		DAL_CHECK_MFC_RET(MFC_LowMemory_Printf(mfc_handle, low_memory_msg, LOWMEMORY_FG_COLOR, LOWMEMORY_BG_COLOR));
		Show_LowMemory();
   	}
	dal_enable_when_resume_lowmemory = FALSE;
	dal_disable_when_resume_lowmemory = FALSE;
#endif
	dal_disable_when_resume = FALSE;
    atomic_set(&OverlaySettingDirtyFlag, 1);
    atomic_set(&OverlaySettingApplied, 0);
    mutex_unlock(&OverlaySettingMutex);

    
    DAL_CHECK_DISP_RET(DISP_UpdateScreen(0, 0, 
                                         DAL_WIDTH,
                                         DAL_HEIGHT));
                                         
	
End:
	DAL_UNLOCK();
    return ret;
}