/* this is the slow path from userspace. they can seek and write to the fb. it's inefficient to do anything less than a full screen draw  */
static ssize_t broadsheetfb_write(struct fb_info *info, const char __user *buf, size_t count, loff_t *ppos)
/* this is the slow path from userspace. they can seek and write to the fb. it's inefficient to do anything less than a full screen draw  */
static ssize_t broadsheetfb_write(struct fb_info *info, const char __user *buf, size_t count, loff_t *ppos)
{
	struct broadsheetfb_par *par = info->par;
	unsigned long p = *ppos;
	void *dst;
	int err = 0;
	unsigned long total_size;
	if (info->state != FBINFO_STATE_RUNNING)
		return -EPERM;
	total_size = info->fix.smem_len;
	if (p > total_size)
		return -EFBIG;
	if (count > total_size) {
		err = -EFBIG;
		count = total_size;
	}
	if (count + p > total_size) {
		if (!err)
			err = -ENOSPC;
		count = total_size - p;
	}
	dst = (void *)(info->screen_base + p);
	if (copy_from_user(dst, buf, count))
		err = -EFAULT;
	if  (!err)
		*ppos += count;
	broadsheetfb_dpy_update(par);
	return (err) ? err : count;
}