drm/virtio: three little bugfixes.
Subsystems (4)
Gerd Hoffmann
maintainerPATCH 1/3 drm/virtio: log error responses
In reply to Gerd HoffmannIf we got an error response code from the host, print it to the log.
--- drivers/gpu/drm/virtio/virtgpu_vq.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/virtio/virtgpu_vq.c +10 -2
@@ -192,8 +192,16 @@ void virtio_gpu_dequeue_ctrl_func(struct work_struct *work)list_for_each_entry_safe (entry, tmp, &reclaim_list, list) { resp = (struct virtio_gpu_ctrl_hdr *)entry->resp_buf; -if (resp->type !=cpu_to_le32 (VIRTIO_GPU_RESP_OK_NODATA )) -DRM_DEBUG ("response 0x%x\n" ,le32_to_cpu (resp->type)); +if (resp->type !=cpu_to_le32 (VIRTIO_GPU_RESP_OK_NODATA )) { +if (resp->type >=cpu_to_le32 (VIRTIO_GPU_RESP_ERR_UNSPEC )) { +struct virtio_gpu_ctrl_hdr *cmd; + cmd = (struct virtio_gpu_ctrl_hdr *)entry->buf; +DRM_ERROR ("response 0x%x (command 0x%x)\n" , +le32_to_cpu (resp->type), +le32_to_cpu (cmd->type)); + }else +DRM_DEBUG ("response 0x%x\n" ,le32_to_cpu (resp->type)); + }if (resp->flags &cpu_to_le32 (VIRTIO_GPU_FLAG_FENCE )) {u64 f =le64_to_cpu (resp->fence_id);
Signature · 1 line
2.9.3
Gerd Hoffmann
maintainerPATCH 1/3 drm/virtio: log error responses
In reply to Gerd HoffmannIf we got an error response code from the host, print it to the log.
--- drivers/gpu/drm/virtio/virtgpu_vq.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/virtio/virtgpu_vq.c +10 -2
@@ -192,8 +192,16 @@ void virtio_gpu_dequeue_ctrl_func(struct work_struct *work)list_for_each_entry_safe (entry, tmp, &reclaim_list, list) { resp = (struct virtio_gpu_ctrl_hdr *)entry->resp_buf; -if (resp->type !=cpu_to_le32 (VIRTIO_GPU_RESP_OK_NODATA )) -DRM_DEBUG ("response 0x%x\n" ,le32_to_cpu (resp->type)); +if (resp->type !=cpu_to_le32 (VIRTIO_GPU_RESP_OK_NODATA )) { +if (resp->type >=cpu_to_le32 (VIRTIO_GPU_RESP_ERR_UNSPEC )) { +struct virtio_gpu_ctrl_hdr *cmd; + cmd = (struct virtio_gpu_ctrl_hdr *)entry->buf; +DRM_ERROR ("response 0x%x (command 0x%x)\n" , +le32_to_cpu (resp->type), +le32_to_cpu (cmd->type)); + }else +DRM_DEBUG ("response 0x%x\n" ,le32_to_cpu (resp->type)); + }if (resp->flags &cpu_to_le32 (VIRTIO_GPU_FLAG_FENCE )) {u64 f =le64_to_cpu (resp->fence_id);
Signature · 1 line
2.9.3
Gerd Hoffmann
maintainerPATCH 2/3 drm/virtio: fix pageflip flush
In reply to Gerd HoffmannSending the flush command only makes sense if we actually have a framebuffer attached to the scanout (handle != 0).
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_plane.c +6 -5
@@ -130,11 +130,12 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, plane->state->src_h >>16 , plane->state->src_x >>16 , plane->state->src_y >> 16); -virtio_gpu_cmd_resource_flush (vgdev, handle, - plane->state->src_x >>16 , - plane->state->src_y >>16 , - plane->state->src_w >>16 , - plane->state->src_h >>16 ); +if (handle) +virtio_gpu_cmd_resource_flush (vgdev, handle, + plane->state->src_x >>16 , + plane->state->src_y >>16 , + plane->state->src_w >>16 , + plane->state->src_h >>16 ); } static int virtio_gpu_cursor_prepare_fb(struct drm_plane *plane,
Signature · 1 line
2.9.3
Gerd Hoffmann
maintainerPATCH 2/3 drm/virtio: fix pageflip flush
In reply to Gerd HoffmannSending the flush command only makes sense if we actually have a framebuffer attached to the scanout (handle != 0).
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_plane.c +6 -5
@@ -130,11 +130,12 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, plane->state->src_h >>16 , plane->state->src_x >>16 , plane->state->src_y >> 16); -virtio_gpu_cmd_resource_flush (vgdev, handle, - plane->state->src_x >>16 , - plane->state->src_y >>16 , - plane->state->src_w >>16 , - plane->state->src_h >>16 ); +if (handle) +virtio_gpu_cmd_resource_flush (vgdev, handle, + plane->state->src_x >>16 , + plane->state->src_y >>16 , + plane->state->src_w >>16 , + plane->state->src_h >>16 ); } static int virtio_gpu_cursor_prepare_fb(struct drm_plane *plane,
Signature · 1 line
2.9.3
Gerd Hoffmann
maintainerPATCH 3/3 drm/virtio: drop virtio_gpu_fence_cleanup()
In reply to Gerd HoffmannJust call drm_fence_put directly instead.
Also set vgfb->fence to NULL after dropping the reference.
--- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 - drivers/gpu/drm/virtio/virtgpu_fence.c | 8 -------- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- drivers/gpu/drm/virtio/virtgpu_plane.c | 6 ++++-- 4 files changed, 5 insertions(+), 12 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drv.h +0 -1
@@ -351,7 +351,6 @@ int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma);/* virtio_gpu_fence.c */ struct virtio_gpu_fence *virtio_gpu_fence_alloc (struct virtio_gpu_device *vgdev); -void virtio_gpu_fence_cleanup (struct virtio_gpu_fence *fence);int virtio_gpu_fence_emit (struct virtio_gpu_device *vgdev,struct virtio_gpu_ctrl_hdr *cmd_hdr,struct virtio_gpu_fence *fence);
drivers/gpu/drm/virtio/virtgpu_fence.c +0 -8
@@ -81,14 +81,6 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev)return fence; } -void virtio_gpu_fence_cleanup (struct virtio_gpu_fence *fence) -{ -if (!fence) -return ; - -dma_fence_put (&fence->f); -} -int virtio_gpu_fence_emit (struct virtio_gpu_device *vgdev,struct virtio_gpu_ctrl_hdr *cmd_hdr,struct virtio_gpu_fence *fence)
drivers/gpu/drm/virtio/virtgpu_ioctl.c +1 -1
@@ -351,7 +351,7 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data,virtio_gpu_cmd_resource_create_3d (vgdev, qobj, &rc_3d); ret =virtio_gpu_object_attach (vgdev, qobj, fence);if (ret) { -virtio_gpu_fence_cleanup (fence); +dma_fence_put (&fence->f); goto fail_backoff; }ttm_eu_fence_buffer_objects (&ticket, &validate_list, &fence->f);
drivers/gpu/drm/virtio/virtgpu_plane.c +4 -2
@@ -169,8 +169,10 @@ static void virtio_gpu_cursor_cleanup_fb(struct drm_plane *plane,return ; vgfb =to_virtio_gpu_framebuffer (plane->state->fb); -if (vgfb->fence) -virtio_gpu_fence_cleanup (vgfb->fence); +if (vgfb->fence) { +dma_fence_put (&vgfb->fence->f); + vgfb->fence =NULL ; + } } static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
Signature · 1 line
2.9.3
Gerd Hoffmann
maintainerPATCH 3/3 drm/virtio: drop virtio_gpu_fence_cleanup()
In reply to Gerd HoffmannJust call drm_fence_put directly instead.
Also set vgfb->fence to NULL after dropping the reference.
--- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 - drivers/gpu/drm/virtio/virtgpu_fence.c | 8 -------- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- drivers/gpu/drm/virtio/virtgpu_plane.c | 6 ++++-- 4 files changed, 5 insertions(+), 12 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drv.h +0 -1
@@ -351,7 +351,6 @@ int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma);/* virtio_gpu_fence.c */ struct virtio_gpu_fence *virtio_gpu_fence_alloc (struct virtio_gpu_device *vgdev); -void virtio_gpu_fence_cleanup (struct virtio_gpu_fence *fence);int virtio_gpu_fence_emit (struct virtio_gpu_device *vgdev,struct virtio_gpu_ctrl_hdr *cmd_hdr,struct virtio_gpu_fence *fence);
drivers/gpu/drm/virtio/virtgpu_fence.c +0 -8
@@ -81,14 +81,6 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev)return fence; } -void virtio_gpu_fence_cleanup (struct virtio_gpu_fence *fence) -{ -if (!fence) -return ; - -dma_fence_put (&fence->f); -} -int virtio_gpu_fence_emit (struct virtio_gpu_device *vgdev,struct virtio_gpu_ctrl_hdr *cmd_hdr,struct virtio_gpu_fence *fence)
drivers/gpu/drm/virtio/virtgpu_ioctl.c +1 -1
@@ -351,7 +351,7 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data,virtio_gpu_cmd_resource_create_3d (vgdev, qobj, &rc_3d); ret =virtio_gpu_object_attach (vgdev, qobj, fence);if (ret) { -virtio_gpu_fence_cleanup (fence); +dma_fence_put (&fence->f); goto fail_backoff; }ttm_eu_fence_buffer_objects (&ticket, &validate_list, &fence->f);
drivers/gpu/drm/virtio/virtgpu_plane.c +4 -2
@@ -169,8 +169,10 @@ static void virtio_gpu_cursor_cleanup_fb(struct drm_plane *plane,return ; vgfb =to_virtio_gpu_framebuffer (plane->state->fb); -if (vgfb->fence) -virtio_gpu_fence_cleanup (vgfb->fence); +if (vgfb->fence) { +dma_fence_put (&vgfb->fence->f); + vgfb->fence =NULL ; + } } static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,
Signature · 1 line
2.9.3
Gerd Hoffmann
maintainercover drm/virtio: three little bugfixes.
Gerd Hoffmann (3):
drm/virtio: log error responses
drm/virtio: fix pageflip flush
drm/virtio: drop virtio_gpu_fence_cleanup()
drivers/gpu/drm/virtio/virtgpu_drv.h | 1 - drivers/gpu/drm/virtio/virtgpu_fence.c | 8 -------- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- drivers/gpu/drm/virtio/virtgpu_plane.c | 17 ++++++++++------- drivers/gpu/drm/virtio/virtgpu_vq.c | 12 ++++++++++-- 5 files changed, 21 insertions(+), 19 deletions(-)
Signature · 6 lines
2.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel