コード例 #1
0
// protected by sem_early_suspend
DISP_STATUS dsi_capture_framebuffer(UINT32 pvbuf, UINT32 bpp)
{
    DSI_CHECK_RET(DSI_WaitForNotBusy());
    
    DDMS_capturing=1;
    
    if(lcm_params->dsi.mode == CMD_MODE)
    {
        LCD_CHECK_RET(LCD_EnableDCtoDsi(FALSE));
        #ifndef MT65XX_NEW_DISP
            LCD_CHECK_RET(LCD_Capture_Framebuffer(pvbuf, bpp));
        #else
            DSI_CHECK_RET(DSI_Capture_Framebuffer(pvbuf, bpp, true));//cmd mode
        #endif
    }
    else
    {
        #ifndef MT65XX_NEW_DISP
            DPI_CHECK_RET(DPI_Capture_Framebuffer(pvbuf, bpp));
        #else
            DSI_CHECK_RET(DSI_Capture_Framebuffer(pvbuf, bpp, false));//video mode
        #endif
    }
    
    
    if(lcm_params->dsi.mode == CMD_MODE)
    {
        LCD_CHECK_RET(LCD_EnableDCtoDsi(TRUE));
    }
    
    DDMS_capturing=0;
    
    return DISP_STATUS_OK;	
}
コード例 #2
0
// protected by sem_early_suspend
DISP_STATUS dsi_capture_framebuffer(UINT32 pvbuf, UINT32 bpp)
{
    DSI_CHECK_RET(DSI_WaitForNotBusy());

    DDMS_capturing=1;

    if(lcm_params->dsi.mode == CMD_MODE)
    {
        LCD_CHECK_RET(LCD_EnableDCtoDsi(FALSE));

        LCD_CHECK_RET(LCD_Capture_Framebuffer(pvbuf, bpp));
    }
    else
    {
        DPI_CHECK_RET(DPI_Capture_Framebuffer(pvbuf, bpp));
    }


    if(lcm_params->dsi.mode == CMD_MODE)
    {
        LCD_CHECK_RET(LCD_EnableDCtoDsi(TRUE));
    }

    DDMS_capturing=0;

    return DISP_STATUS_OK;
}
コード例 #3
0
ファイル: debug.c プロジェクト: Banjo0917/mt6577_kernel3.4
static ssize_t layer_debug_read(struct file *file,
                          char __user *ubuf, size_t count, loff_t *ppos)
{
    int ret;
    MTKFB_LAYER_DBG_OPTIONS *dbgopt = (MTKFB_LAYER_DBG_OPTIONS *)file->private_data;
    UINT32 aligned_buffer;

    if(dbgopt->working_buf == 0)
    {
        DISP_LOG_PRINT(ANDROID_LOG_INFO, "DBG", "No working buffer is available \n");
        return 0;
    }
    
    ///if LCD layer is enabled 
    if(!LCD_IsLayerEnable(dbgopt->layer_index))
    {
        DISP_LOG_PRINT(ANDROID_LOG_INFO, "DBG", "The layer %d is not enabled \n", dbgopt->layer_index);
        return 0;
    }

    aligned_buffer = (dbgopt->working_buf + 32) & 0xFFFFFFC0;
    if(*ppos == 0)
    {
        extern struct semaphore sem_flipping;
        extern struct semaphore sem_early_suspend;
        extern struct semaphore sem_update_screen;
        extern BOOL is_early_suspended;
        
        ret = down_interruptible(&sem_flipping);
        ret = down_interruptible(&sem_early_suspend);
        if (is_early_suspended) {
              up(&sem_early_suspend);
              up(&sem_flipping);
              return 0;
        }
        ret = down_interruptible(&sem_update_screen);

        DISP_LOG_PRINT(ANDROID_LOG_INFO, "DBG", "This is layer %d capturing \n", dbgopt->layer_index);
        DISP_LOG_PRINT(ANDROID_LOG_INFO, "DBG", "This layer width:%d , height:%d\n", LCD_REG->LAYER[dbgopt->layer_index].SIZE.WIDTH, LCD_REG->LAYER[dbgopt->layer_index].SIZE.HEIGHT);

        if(lcm_params->type == LCM_TYPE_DSI && lcm_params->dsi.mode == CMD_MODE)
        {
            DSI_CHECK_RET(DSI_WaitForNotBusy());
            LCD_CHECK_RET(LCD_EnableDCtoDsi(FALSE));
        }

        LCD_Capture_Layerbuffer(dbgopt->layer_index,aligned_buffer,16);
        
        if(lcm_params->type == LCM_TYPE_DSI && lcm_params->dsi.mode == CMD_MODE)
        {
            LCD_CHECK_RET(LCD_EnableDCtoDsi(TRUE));
        }

        up(&sem_update_screen);
        up(&sem_early_suspend);
        up(&sem_flipping);    
    }
    
    return simple_read_from_buffer(ubuf, count, ppos, (void *)aligned_buffer, DISP_GetScreenWidth()*DISP_GetScreenHeight()*2);
}