static ssize_t store_refresh(struct device *device,
			  struct device_attribute *attr,
			  const char *buf, size_t count)
{
	struct fb_info *fb = dev_get_drvdata(device);
	struct omap3epfb_par *par = fb->par;
	int index = FIRST_USER_REGION;
	struct omap3epfb_area *area = NULL;
	int clear  = simple_strtoul(buf, NULL, 0);

	if (clear > 2 || clear < 0)
		return -EINVAL;

	omap3epfb_reqq_purge(fb);
	switch (clear)
	{
		case 0: omap3epfb_update_screen(fb, OMAP3EPFB_WVFID_AUTO, false);
			break;

		case 1: omap3epfb_update_screen(fb, OMAP3EPFB_WVFID_GC, false);
			break;

		case 2: area = &par->effect_array[index];
			if (!(area->effect_flags & (EFFECT_ONESHOT | EFFECT_ACTIVE | EFFECT_CLEAR)))
				break;
			omap3epfb_update_area(fb, &area->effect_area);
			break;

		default:
			omap3epfb_update_screen(fb, OMAP3EPFB_WVFID_AUTO, false);
	}

	return count;
}
예제 #2
0
static bool batch_update(struct fb_info *info, struct omap3epfb_update_area *p)
{
	struct omap3epfb_par *par = info->par;

	// If EPD is disabled, do nothing
	if (par->disable_flags > 0)
	{
		DEBUG_REGION(DEBUG_LEVEL3, p,"update DISABLED = ");
		// Tell the caller not to update.
		return false;
	}

	// Check if the delayed full screen updates are enabled.
	if (!par->clear_delay)
	{
		DEBUG_REGION(DEBUG_LEVEL1, p,"   do = ");
		if (fast==1) {
			omap3epfb_update_screen(par->info, OMAP3EPFB_WVFID_VU, false);
		} else {
			omap3epfb_update_area(info, p);
		}
		return false;
	}

	// If this is not a fullscreen GC update, treat it as a normal update.
	if (!(rect_fullscreen(info, p) && p->wvfid == OMAP3EPFB_WVFID_GC))
	{
		// If we have a fullscreen batched, we do not need to update.
		if (!delayed_work_pending(&par->clear_work))
		{
			DEBUG_REGION(DEBUG_LEVEL1, p,"   do = ");
			if (fast==1) {
				omap3epfb_update_screen(par->info, OMAP3EPFB_WVFID_VU, false);
			} else {
				omap3epfb_update_area(info, p);
			}
		}
		else
		{
			DEBUG_REGION(DEBUG_LEVEL1, p,"   skip = ");
		}
		return false;
	}

	// We need to do fullscreen batching.
	if (par->user_debug & DEBUG_LEVEL1)
	{
		if (TIME_DELTA_MS(par->last_clear) < 1000)
			DEBUG_REGION(DEBUG_LEVEL1, p,"   req FULLSCREEN PREV %dms ago AUTO = ", TIME_DELTA_MS(par->last_clear));
		else
			DEBUG_REGION(DEBUG_LEVEL1, p,"   req FULLSCREEN = ");
	}
	omap3epfb_reqq_purge(par->info);
	cancel_delayed_work_sync(&par->clear_work);
	schedule_delayed_work(&par->clear_work, msecs_to_jiffies(par->clear_delay));
	par->last_clear = TIME_STAMP();
	return true;
}
예제 #3
0
static void omap3epfb_clear_work(struct work_struct *work)
{
	struct omap3epfb_par *par = container_of(work,
		struct omap3epfb_par,
		clear_work.work);

	DEBUG_LOG(DEBUG_LEVEL2,"delayed FULLSCREEN Update\n");

	omap3epfb_reqq_purge(par->info);
	if  (fast==0) {
		omap3epfb_update_screen(par->info, OMAP3EPFB_WVFID_GC, false);
		skip=0;
	} else {
		omap3epfb_update_screen(par->info, OMAP3EPFB_WVFID_VU, false);
	}
}
예제 #4
0
static void omap3epfb_disable_work(struct work_struct *work)
{
	struct omap3epfb_par *par = container_of(work,
		struct omap3epfb_par,
		disable_work.work);

	g_disable_time = 0;  // Reset expiration time
	par->disable_flags = 0;

	DEBUG_LOG(DEBUG_LEVEL2,"delayed enable EPD Updates\n");

	omap3epfb_reqq_purge(par->info);
	if  (fast==0)  {
		omap3epfb_update_screen(par->info, OMAP3EPFB_WVFID_GC, false);
		skip=0;
	} else {
		omap3epfb_update_screen(par->info, OMAP3EPFB_WVFID_VU, false);
	}
}
예제 #5
0
static void omap3epfb_lost_update(struct work_struct *work)
{
	struct omap3epfb_par *par = container_of(work,
		struct omap3epfb_par,
		lost_update.work);

		printk("lost_update\n");
//	if (skip==1) {
		cancel_delayed_work_sync(&par->clear_work);
		cancel_delayed_work_sync(&par->disable_work);
	g_disable_time = 0;  // Reset expiration time
	par->disable_flags = 0;
	par->last_clear = TIME_STAMP();

		omap3epfb_reqq_purge(par->info);
		if (fast==0) {
			omap3epfb_update_screen(par->info, OMAP3EPFB_WVFID_GU, false);
		} else {
			omap3epfb_update_screen(par->info, OMAP3EPFB_WVFID_VU, false);
		}
//	}
}
예제 #6
0
static ssize_t change_mode(struct device *device,
			  struct device_attribute *attr,
			  const char *buf, size_t count)
{
	struct fb_info *fb = dev_get_drvdata(device);
	struct omap3epfb_par *par = fb->par;
	int tmp  = simple_strtoul(buf, NULL, 0);

	par->fmode = tmp;
	switch (tmp)
	{
		case 1:	fast=1;
			omap3epfb_update_screen(par->info, OMAP3EPFB_WVFID_VU, true);
			break;
		default: fast=0;
			break;
	}

	return count;
}