Ejemplo n.º 1
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;
}
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;
}
int omap3epfb_fill_region(struct fb_info *info, struct omap3epfb_area *p)
{
	struct omap3epfb_par *par = info->par;

	if ((p->effect_area.threshold != OMAP3EPFB_THRESHOLD_BLACK) &&
	    (p->effect_area.threshold != OMAP3EPFB_THRESHOLD_WHITE))
		return -EINVAL;

	omap3epfb_reqq_purge(info);
	omap3epfb_update_area(info, &p->effect_area);

	DEBUG_REGION(DEBUG_LEVEL4, &p->effect_area,"  do fill = ");

	return 0;
}