Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions drivers/dma-buf/sync_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,21 @@ static void fence_check_cb_func(struct dma_fence *f, struct dma_fence_cb *cb)
struct sync_file *sync_file_create(struct dma_fence *fence)
{
struct sync_file *sync_file;
const char *name = NULL;

sync_file = sync_file_alloc();
if (!sync_file)
return NULL;

sync_file->fence = dma_fence_get(fence);
if (sync_file->fence) {
sync_file->type = 0;
name = sync_file->fence->ops->get_driver_name(fence);
if (strcmp(name, "virtio_gpu") == 0)
sync_file->type = 1;
if (strcmp(name, "drm_sched") == 0)
sync_file->type = 2;
}

return sync_file;
}
Expand Down Expand Up @@ -333,6 +342,7 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
}

no_fences:
printk(KERN_ERR "bosheng sync file name:%d\n", sync_file->type);
sync_file_get_name(sync_file, info.name, sizeof(info.name));
info.num_fences = num_fences;

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ void drm_event_cancel_free(struct drm_device *dev,
{
unsigned long flags;

printk(KERN_ERR "bosheng drm event cancel free\n");
spin_lock_irqsave(&dev->event_lock, flags);
if (p->file_priv) {
p->file_priv->event_space += p->event->length;
Expand Down
6 changes: 4 additions & 2 deletions drivers/gpu/drm/virtio/virtgpu_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,10 @@ virtio_gpu_wait_for_vblanks(struct drm_device *dev,
drm_crtc_vblank_count(crtc)),
msecs_to_jiffies(100));

WARN(!ret, "[CRTC:%d:%s] vblank wait timed out\n",
crtc->base.id, crtc->name);
// WARN(!ret, "[CRTC:%d:%s] vblank wait timed out\n",
// crtc->base.id, crtc->name);
if (ret == 0)
pr_err("bosheng wait vblank timeout\n");

drm_crtc_vblank_put(crtc);
}
Expand Down
7 changes: 5 additions & 2 deletions drivers/gpu/drm/virtio/virtgpu_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ static void virtio_gpu_resource_flush(struct drm_plane *plane,
struct virtio_gpu_framebuffer *vgfb;
struct virtio_gpu_plane_state *vgplane_st;
struct virtio_gpu_object *bo;
int ret = 0;

vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
vgplane_st = to_virtio_gpu_plane_state(plane->state);
Expand All @@ -365,8 +366,10 @@ static void virtio_gpu_resource_flush(struct drm_plane *plane,
width, height, objs,
vgplane_st->fence);
virtio_gpu_notify(vgdev);
dma_fence_wait_timeout(&vgplane_st->fence->f, true,
ret = dma_fence_wait_timeout(&vgplane_st->fence->f, true,
msecs_to_jiffies(50));
if (ret <= 0)
printk("bosheng resource flush timeout ret:%d\n", ret);
} else {
virtio_gpu_cmd_resource_flush(vgdev, bo->hw_res_handle, x, y,
width, height, NULL, NULL);
Expand Down Expand Up @@ -634,7 +637,7 @@ static int virtio_gpu_plane_prepare_fb(struct drm_plane *plane,
if (!bo || (plane->type == DRM_PLANE_TYPE_PRIMARY && !bo->guest_blob))
return 0;

if (bo->dumb) {
if (bo->dumb || vgfb->base.obj[0]->import_attach) {
vgplane_st->fence = virtio_gpu_fence_alloc(vgdev,
vgdev->fence_drv.context,
0);
Expand Down
1 change: 1 addition & 0 deletions include/linux/sync_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct sync_file {

struct dma_fence *fence;
struct dma_fence_cb cb;
int type;
};

#define POLL_ENABLED 0
Expand Down