static void fb_tui_unprotection(void)
{
	struct device *fbdev = NULL;
	struct fb_info *fb_info;
	struct decon_win *win;
	struct decon_device *decon;

	fbdev = get_fb_dev();
	if (!fbdev) {
		pr_debug("get_fb_dev failed\n");
		return;
	}

	fb_info = get_fb_info(fbdev);
	if (!fb_info) {
		printk("get_fb_info failed\n");
		return;
	}

	win = fb_info->par;
	decon = win->decon;

	if (decon->pdata->trig_mode == DECON_HW_TRIG)
		decon_reg_set_trigger(decon->id, decon->pdata->dsi_mode,
					decon->pdata->trig_mode, DECON_TRIG_ENABLE);

#ifdef CONFIG_PM_RUNTIME
	pm_runtime_put_sync(decon->dev);
#endif

	decon_tui_protection(decon, false);
}
Ejemplo n.º 2
0
int vmm_fb_open(struct vmm_fb_info *info)
{
	int res = 0;
	struct vmm_fb_event event;

	if (!info) {
		return VMM_EFAIL;
	}

	vmm_mutex_lock(&info->lock);
	event.info = info;
	vmm_fb_notifier_call_chain(FB_EVENT_OPENED, &event);
	vmm_mutex_unlock(&info->lock);

	get_fb_info(info);

	vmm_mutex_lock(&info->lock);
	if (info->fbops->fb_open) {
		/* Note: we don't have userspace so, 
		 * always call fb_open with user=0
		 */
		res = info->fbops->fb_open(info, 0);
	}
	vmm_mutex_unlock(&info->lock);

	if (res) {
		put_fb_info(info);
	}

	return res;
}
static void blank_framebuffer(int getref)
{
	struct device *fbdev = NULL;
	struct fb_info *fb_info;
	struct s3c_fb_win *win;
	struct s3c_fb *sfb;
	struct s3c_fb_platdata *pd;

	fbdev = get_fb_dev();
	if (!fbdev)
		return;

	fb_info = get_fb_info(fbdev);
	if (!fb_info)
		return;

	/*
	 * hold a reference to the dsim device, to prevent it from going into
	 * power management during tui session
	 */
	win = fb_info->par;
	sfb = win->parent;
	pd = sfb->pdata;

	/* Re-enable the clocks */
	//enable_clocks(fbdev->parent,
		//	disp_clock_name, ARRAY_SIZE(disp_clock_name), 1);
	//enable_clocks(NULL, other_clock_name, ARRAY_SIZE(other_clock_name), 1);

#if defined(CONFIG_SOC_EXYNOS5420)
	pm_runtime_get_sync(pd->dsim1_device);
#endif
	if (getref)
		pm_runtime_get_sync(sfb->dev);

	/* blank the framebuffer */
	lock_fb_info(fb_info);
	console_lock();
	fb_info->flags |= FBINFO_MISC_USEREVENT;
	fb_blank(fb_info, FB_BLANK_POWERDOWN);
	fb_info->flags &= ~FBINFO_MISC_USEREVENT;
	console_unlock();
	unlock_fb_info(fb_info);

#if defined(CONFIG_SOC_EXYNOS5420)
	/*
	 * part of the init of dsim device is not done in the TEE.  So do it
	 * here
	 */
	gpio_request_one(EXYNOS5420_GPF1(6),
			GPIOF_OUT_INIT_HIGH, "GPIO_MIPI_18V_EN");
	usleep_range(5000, 6000);
	gpio_free(EXYNOS5420_GPF1(6));
#endif

}
Ejemplo n.º 4
0
int touch_cmd_parser(char *cmdline, TP_POINT points[], int *point_num)
{
    int ret = 0;
    int num = 0;
    int valid_para = 0;
    char legency_cmd[200] = {0};
    char *pcmd = cmdline;

    get_fb_info();
    
    while(1)
    {
        if(num == 0)
            valid_para = sscanf(pcmd, "%d,%d,%d%199s", &points[num].action, &points[num].x, &points[num].y, legency_cmd);
        else
            valid_para = sscanf(legency_cmd, "%*[^=]=%d,%d,%d%199s", &points[num].action, &points[num].x, &points[num].y, legency_cmd);


        ALOGD("[Point%d]:%d,%d,%d,(%s); para_num=%d\n", num, points[num].action, points[num].x, points[num].y, legency_cmd, valid_para);

        // (0,0) is fixed at left-up
        // rotate_relative_to_lcm(&points[num].x, &points[num].y);      
        num++;

        if (valid_para < 3) // parameter is wrong
        {
            ret = -1;
            break;
        }
        else if (valid_para == 3) // parser end
        {
            break;
        }
        else if (valid_para > 3) // parser continue
        {
            continue;
        }
    }
    *point_num = num;

    return ret;

}
static void unblank_framebuffer(int releaseref)
{
	struct device *fbdev = NULL;
	struct fb_info *fb_info;
	struct s3c_fb_win *win;
	struct s3c_fb *sfb;
	struct s3c_fb_platdata *pd;

	fbdev = get_fb_dev();
	if (!fbdev)
		return;

	fb_info = get_fb_info(fbdev);
	if (!fb_info)
		return;

	/*
	 * Release the reference we took at the beginning of the TUI session
	 */
	win = fb_info->par;
	sfb = win->parent;
	pd = sfb->pdata;

	/*
	 * Unblank the framebuffer
	 */
	console_lock();
	fb_info->flags |= FBINFO_MISC_USEREVENT;
	fb_blank(fb_info, FB_BLANK_UNBLANK);
	fb_info->flags &= ~FBINFO_MISC_USEREVENT;
	console_unlock();

	if (releaseref)
		pm_runtime_put_sync(sfb->dev);
#if defined(CONFIG_SOC_EXYNOS5420)
	pm_runtime_put_sync(pd->dsim1_device);
#endif
	/* We longer need the clock to be up */
	//enable_clocks(NULL, other_clock_name, ARRAY_SIZE(other_clock_name), 0);
	//enable_clocks(fbdev->parent,
			//disp_clock_name, ARRAY_SIZE(disp_clock_name), 0);
}
static void fb_tui_protection(void)
{
	struct device *fbdev = NULL;
	struct fb_info *fb_info;
	struct decon_win *win;
	struct decon_device *decon;

	fbdev = get_fb_dev();
	if (!fbdev) {
		pr_debug("get_fb_dev failed\n");
		return;
	}

	fb_info = get_fb_info(fbdev);
	if (!fb_info) {
		pr_debug("get_fb_info failed\n");
		return;
	}

	win = fb_info->par;
	decon = win->decon;

#ifdef CONFIG_PM_RUNTIME
	pm_runtime_get_sync(decon->dev);
#endif

#if 0 // time check
	ktime_t start, end;
	long long ns;

	start = ktime_get();            /* get time stamp before execution */
#endif
	decon_tui_protection(decon, true);
#if 0 // time check
	end = ktime_get();              /* get time stamp after execution */

	ns = ktime_to_ns( ktime_sub(end, start) ); /* get the elapsed time in nano-seconds */
	printk(KERN_INFO "[TIME_CHECK] blank -> Elapsed time %lld ns\n", ns); /* print it on the console */
#endif
}
Ejemplo n.º 7
0
static void blank_framebuffer(int getref)
{
	struct device *fbdev = NULL;
	struct fb_info *fb_info;
	struct s3c_fb_win *win;
	struct s3c_fb *sfb;

	fbdev = get_fb_dev();
	if (!fbdev)
		return;

	fb_info = get_fb_info(fbdev);
	if (!fb_info)
		return;

	/*
	 * hold a reference to the dsim device, to prevent it from going into
	 * power management during tui session
	 */
	win = fb_info->par;
	sfb = win->parent;

	if (getref)
		pm_runtime_get_sync(sfb->dev);

	/* blank the framebuffer */
	lock_fb_info(fb_info);
	console_lock();
	fb_info->flags |= FBINFO_MISC_USEREVENT;
	pr_info("%s call fb_blank\n", __func__);
	fb_blank(fb_info, FB_BLANK_POWERDOWN);
	fb_info->flags &= ~FBINFO_MISC_USEREVENT;
	console_unlock();
	unlock_fb_info(fb_info);
	pr_info("%s call s3c_fb_deactivate_vsync\n", __func__);
	s3c_fb_deactivate_vsync(sfb);

}
Ejemplo n.º 8
0
static void unblank_framebuffer(int releaseref)
{
	struct device *fbdev = NULL;
	struct fb_info *fb_info;
	struct s3c_fb_win *win;
	struct s3c_fb *sfb;

	fbdev = get_fb_dev();
	if (!fbdev)
		return;

	fb_info = get_fb_info(fbdev);
	if (!fb_info)
		return;

	/*
	 * Release the reference we took at the beginning of the TUI session
	 */
	win = fb_info->par;
	sfb = win->parent;

	pr_info("%s call s3c_fb_activate_vsync\n", __func__);
	s3c_fb_activate_vsync(sfb);

	/*
	 * Unblank the framebuffer
	 */
	console_lock();
	fb_info->flags |= FBINFO_MISC_USEREVENT;
	fb_blank(fb_info, FB_BLANK_UNBLANK);
	fb_info->flags &= ~FBINFO_MISC_USEREVENT;
	console_unlock();

	if (releaseref)
		pm_runtime_put_sync(sfb->dev);

}