Ejemplo n.º 1
0
static void virtio_gpu_3d_copyarea(struct fb_info *info,
                                   const struct fb_copyarea *area)
{
    struct virtio_gpu_fbdev *vfbdev = info->par;
    drm_fb_helper_sys_copyarea(info, area);
    virtio_gpu_dirty_update(&vfbdev->vgfb, true, area->dx, area->dy,
                            area->width, area->height);
    schedule_delayed_work(&vfbdev->work, VIRTIO_GPU_FBCON_POLL_PERIOD);
}
Ejemplo n.º 2
0
static void virtio_gpu_3d_imageblit(struct fb_info *info,
                                    const struct fb_image *image)
{
    struct virtio_gpu_fbdev *vfbdev = info->par;
    drm_fb_helper_sys_imageblit(info, image);
    virtio_gpu_dirty_update(&vfbdev->vgfb, true, image->dx, image->dy,
                            image->width, image->height);
    schedule_delayed_work(&vfbdev->work, VIRTIO_GPU_FBCON_POLL_PERIOD);
}
Ejemplo n.º 3
0
static void virtio_gpu_3d_fillrect(struct fb_info *info,
                                   const struct fb_fillrect *rect)
{
    struct virtio_gpu_fbdev *vfbdev = info->par;
    drm_fb_helper_sys_fillrect(info, rect);
    virtio_gpu_dirty_update(&vfbdev->vgfb, true, rect->dx, rect->dy,
                            rect->width, rect->height);
    schedule_delayed_work(&vfbdev->work, VIRTIO_GPU_FBCON_POLL_PERIOD);
}
Ejemplo n.º 4
0
static void virtio_gpu_fb_dirty_work(struct work_struct *work)
{
	struct delayed_work *delayed_work = to_delayed_work(work);
	struct virtio_gpu_fbdev *vfbdev =
		container_of(delayed_work, struct virtio_gpu_fbdev, work);
	struct virtio_gpu_framebuffer *vgfb = &vfbdev->vgfb;

	virtio_gpu_dirty_update(&vfbdev->vgfb, false, vgfb->x1, vgfb->y1,
				vgfb->x2 - vgfb->x1, vgfb->y2 - vgfb->y1);
}
Ejemplo n.º 5
0
int virtio_gpu_surface_dirty(struct virtio_gpu_framebuffer *vgfb,
			     struct drm_clip_rect *clips,
			     unsigned int num_clips)
{
	struct virtio_gpu_device *vgdev = vgfb->base.dev->dev_private;
	struct virtio_gpu_object *obj = gem_to_virtio_gpu_obj(vgfb->base.obj[0]);
	struct drm_clip_rect norect;
	struct drm_clip_rect *clips_ptr;
	int left, right, top, bottom;
	int i;
	int inc = 1;

	if (!num_clips) {
		num_clips = 1;
		clips = &norect;
		norect.x1 = norect.y1 = 0;
		norect.x2 = vgfb->base.width;
		norect.y2 = vgfb->base.height;
	}
	left = clips->x1;
	right = clips->x2;
	top = clips->y1;
	bottom = clips->y2;

	/* skip the first clip rect */
	for (i = 1, clips_ptr = clips + inc;
	     i < num_clips; i++, clips_ptr += inc) {
		left = min_t(int, left, (int)clips_ptr->x1);
		right = max_t(int, right, (int)clips_ptr->x2);
		top = min_t(int, top, (int)clips_ptr->y1);
		bottom = max_t(int, bottom, (int)clips_ptr->y2);
	}

	if (obj->dumb)
		return virtio_gpu_dirty_update(vgfb, false, left, top,
					       right - left, bottom - top);

	virtio_gpu_cmd_resource_flush(vgdev, obj->hw_res_handle,
				      left, top, right - left, bottom - top);
	return 0;
}