drm/virtio: various cleanups
Subsystems (4)
Gerd Hoffmann
maintainerPATCH 1/5 drm/virtio: print a single line with device features
In reply to Gerd Hoffmann--- drivers/gpu/drm/virtio/virtgpu_kms.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_kms.c +4 -5
@@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)#ifdef __LITTLE_ENDIANif (virtio_has_feature (vgdev->vdev,VIRTIO_GPU_F_VIRGL )) vgdev->has_virgl_3d = true; -DRM_INFO ("virgl 3d acceleration %s\n" , - vgdev->has_virgl_3d ?"enabled" :"not supported by host" ); -#else -DRM_INFO ("virgl 3d acceleration not supported by guest\n" );#endif if (virtio_has_feature (vgdev->vdev,VIRTIO_GPU_F_EDID )) { vgdev->has_edid = true; -DRM_INFO ("EDID support available.\n" ); } +DRM_INFO ("features: %cvirgl %cedid\n" , + vgdev->has_virgl_3d ?'+' :'-' , + vgdev->has_edid ?'+' :'-' ); + ret =virtio_find_vqs (vgdev->vdev,2 , vqs, callbacks, names,NULL );if (ret) {DRM_ERROR ("failed to find virt queues\n" );
Signature · 1 line
2.18.1
Gerd Hoffmann
maintainerPATCH 1/5 drm/virtio: print a single line with device features
In reply to Gerd Hoffmann--- drivers/gpu/drm/virtio/virtgpu_kms.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/virtio/virtgpu_kms.c +4 -5
@@ -155,16 +155,15 @@ int virtio_gpu_init(struct drm_device *dev)#ifdef __LITTLE_ENDIANif (virtio_has_feature (vgdev->vdev,VIRTIO_GPU_F_VIRGL )) vgdev->has_virgl_3d = true; -DRM_INFO ("virgl 3d acceleration %s\n" , - vgdev->has_virgl_3d ?"enabled" :"not supported by host" ); -#else -DRM_INFO ("virgl 3d acceleration not supported by guest\n" );#endif if (virtio_has_feature (vgdev->vdev,VIRTIO_GPU_F_EDID )) { vgdev->has_edid = true; -DRM_INFO ("EDID support available.\n" ); } +DRM_INFO ("features: %cvirgl %cedid\n" , + vgdev->has_virgl_3d ?'+' :'-' , + vgdev->has_edid ?'+' :'-' ); + ret =virtio_find_vqs (vgdev->vdev,2 , vqs, callbacks, names,NULL );if (ret) {DRM_ERROR ("failed to find virt queues\n" );
Signature · 1 line
2.18.1
Gerd Hoffmann
maintainerPATCH 2/5 drm/virtio: move byteorder handling into virtio_gpu_cmd_transfer_to_host_2d function
In reply to Gerd HoffmannBe consistent with the rest of the code base.
No functional change.
--- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 ++-- drivers/gpu/drm/virtio/virtgpu_plane.c | 12 ++++++------ drivers/gpu/drm/virtio/virtgpu_vq.c | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drv.h +2 -2
@@ -267,8 +267,8 @@ void virtio_gpu_cmd_unref_resource(struct virtio_gpu_device *vgdev, uint32_t resource_id);void virtio_gpu_cmd_transfer_to_host_2d (struct virtio_gpu_device *vgdev,uint64_t offset, -__le32 width,__le32 height, -__le32 x,__le32 y, +uint32_t width,uint32_t height, +uint32_t x,uint32_t y,struct virtio_gpu_object_array *objs,struct virtio_gpu_fence *fence); void virtio_gpu_cmd_resource_flush(struct virtio_gpu_device *vgdev,
drivers/gpu/drm/virtio/virtgpu_plane.c +6 -6
@@ -132,10 +132,10 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane,virtio_gpu_array_add_obj (objs, vgfb->base.obj[0 ]);virtio_gpu_cmd_transfer_to_host_2d (vgdev,0 , -cpu_to_le32 (plane->state->src_w >>16 ), -cpu_to_le32 (plane->state->src_h >>16 ), -cpu_to_le32 (plane->state->src_x >>16 ), -cpu_to_le32 (plane->state->src_y >>16 ), + plane->state->src_w >>16 , + plane->state->src_h >>16 , + plane->state->src_x >>16 , + plane->state->src_y >>16 , objs,NULL ); } }else {
@@ -234,8 +234,8 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,virtio_gpu_array_add_obj (objs, vgfb->base.obj[0 ]);virtio_gpu_cmd_transfer_to_host_2d (vgdev,0 , -cpu_to_le32 (plane->state->crtc_w), -cpu_to_le32 (plane->state->crtc_h), + plane->state->crtc_w, + plane->state->crtc_h,0 ,0 , objs, vgfb->fence);dma_fence_wait (&vgfb->fence->f, true);dma_fence_put (&vgfb->fence->f);
drivers/gpu/drm/virtio/virtgpu_vq.c +6 -6
@@ -549,8 +549,8 @@ void virtio_gpu_cmd_resource_flush(struct virtio_gpu_device *vgdev,void virtio_gpu_cmd_transfer_to_host_2d (struct virtio_gpu_device *vgdev,uint64_t offset, -__le32 width,__le32 height, -__le32 x,__le32 y, +uint32_t width,uint32_t height, +uint32_t x,uint32_t y,struct virtio_gpu_object_array *objs,struct virtio_gpu_fence *fence) {
@@ -571,10 +571,10 @@ void virtio_gpu_cmd_transfer_to_host_2d(struct virtio_gpu_device *vgdev, cmd_p->hdr.type =cpu_to_le32 (VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D ); cmd_p->resource_id =cpu_to_le32 (bo->hw_res_handle); cmd_p->offset =cpu_to_le64 (offset); - cmd_p->r.width = width; - cmd_p->r.height = height; - cmd_p->r.x = x; - cmd_p->r.y = y; + cmd_p->r.width =cpu_to_le32 (width); + cmd_p->r.height =cpu_to_le32 (height); + cmd_p->r.x =cpu_to_le32 (x); + cmd_p->r.y =cpu_to_le32 (y);virtio_gpu_queue_fenced_ctrl_buffer (vgdev, vbuf, &cmd_p->hdr, fence); }
Signature · 1 line
2.18.1
Gerd Hoffmann
maintainerPATCH 3/5 drm/virtio: fix byteorder handling in virtio_gpu_cmd_transfer_{from,to}_host_3d functions
In reply to Gerd HoffmannBe consistent with the rest of the code base.
No functional change.
In theory this change is incompatible on bigendian machines, but in practice 3d acceleration is supported only on little endian machines, so the affected code paths never run on bigendian machines.
--- drivers/gpu/drm/virtio/virtgpu_vq.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/virtio/virtgpu_vq.c +12 -2
@@ -987,7 +987,12 @@ void virtio_gpu_cmd_transfer_to_host_3d(struct virtio_gpu_device *vgdev, cmd_p->hdr.type =cpu_to_le32 (VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D ); cmd_p->hdr.ctx_id =cpu_to_le32 (ctx_id); cmd_p->resource_id =cpu_to_le32 (bo->hw_res_handle); - cmd_p->box = *box; + cmd_p->box.x =cpu_to_le32 (box->x); + cmd_p->box.y =cpu_to_le32 (box->y); + cmd_p->box.z =cpu_to_le32 (box->z); + cmd_p->box.w =cpu_to_le32 (box->w); + cmd_p->box.h =cpu_to_le32 (box->h); + cmd_p->box.d =cpu_to_le32 (box->d); cmd_p->offset =cpu_to_le64 (offset); cmd_p->level =cpu_to_le32 (level);
@@ -1013,7 +1018,12 @@ void virtio_gpu_cmd_transfer_from_host_3d(struct virtio_gpu_device *vgdev, cmd_p->hdr.type =cpu_to_le32 (VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D ); cmd_p->hdr.ctx_id =cpu_to_le32 (ctx_id); cmd_p->resource_id =cpu_to_le32 (bo->hw_res_handle); - cmd_p->box = *box; + cmd_p->box.x =cpu_to_le32 (box->x); + cmd_p->box.y =cpu_to_le32 (box->y); + cmd_p->box.z =cpu_to_le32 (box->z); + cmd_p->box.w =cpu_to_le32 (box->w); + cmd_p->box.h =cpu_to_le32 (box->h); + cmd_p->box.d =cpu_to_le32 (box->d); cmd_p->offset =cpu_to_le64 (offset); cmd_p->level =cpu_to_le32 (level);
Signature · 1 line
2.18.1
Gerd Hoffmann
maintainerPATCH 3/5 drm/virtio: fix byteorder handling in virtio_gpu_cmd_transfer_{from, to}_host_3d functions
In reply to Gerd HoffmannBe consistent with the rest of the code base.
No functional change.
In theory this change is incompatible on bigendian machines, but in practice 3d acceleration is supported only on little endian machines, so the affected code paths never run on bigendian machines.
--- drivers/gpu/drm/virtio/virtgpu_vq.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/virtio/virtgpu_vq.c +12 -2
@@ -987,7 +987,12 @@ void virtio_gpu_cmd_transfer_to_host_3d(struct virtio_gpu_device *vgdev, cmd_p->hdr.type =cpu_to_le32 (VIRTIO_GPU_CMD_TRANSFER_TO_HOST_3D ); cmd_p->hdr.ctx_id =cpu_to_le32 (ctx_id); cmd_p->resource_id =cpu_to_le32 (bo->hw_res_handle); - cmd_p->box = *box; + cmd_p->box.x =cpu_to_le32 (box->x); + cmd_p->box.y =cpu_to_le32 (box->y); + cmd_p->box.z =cpu_to_le32 (box->z); + cmd_p->box.w =cpu_to_le32 (box->w); + cmd_p->box.h =cpu_to_le32 (box->h); + cmd_p->box.d =cpu_to_le32 (box->d); cmd_p->offset =cpu_to_le64 (offset); cmd_p->level =cpu_to_le32 (level);
@@ -1013,7 +1018,12 @@ void virtio_gpu_cmd_transfer_from_host_3d(struct virtio_gpu_device *vgdev, cmd_p->hdr.type =cpu_to_le32 (VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D ); cmd_p->hdr.ctx_id =cpu_to_le32 (ctx_id); cmd_p->resource_id =cpu_to_le32 (bo->hw_res_handle); - cmd_p->box = *box; + cmd_p->box.x =cpu_to_le32 (box->x); + cmd_p->box.y =cpu_to_le32 (box->y); + cmd_p->box.z =cpu_to_le32 (box->z); + cmd_p->box.w =cpu_to_le32 (box->w); + cmd_p->box.h =cpu_to_le32 (box->h); + cmd_p->box.d =cpu_to_le32 (box->d); cmd_p->offset =cpu_to_le64 (offset); cmd_p->level =cpu_to_le32 (level);
Signature · 1 line
2.18.1
Gerd Hoffmann
maintainerPATCH 4/5 drm/virtio: Simplify virtio_gpu_primary_plane_update workflow.
In reply to Gerd HoffmannReturn early for the no framebuffer (or disabled output) case. Results in a simpler code flow for the remaining cases. No functional change.
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 62 ++++++++++++++------------ 1 file changed, 33 insertions(+), 29 deletions(-)
drivers/gpu/drm/virtio/virtgpu_plane.c +33 -29
@@ -110,7 +110,6 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane,struct virtio_gpu_output *output =NULL ;struct virtio_gpu_framebuffer *vgfb;struct virtio_gpu_object *bo; -uint32_t handle;if (plane->state->crtc) output =drm_crtc_to_virtio_gpu_output (plane->state->crtc);
@@ -119,47 +118,52 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane,if (WARN_ON (!output))return ; -if (plane->state->fb && output->enabled) { - vgfb =to_virtio_gpu_framebuffer (plane->state->fb); - bo =gem_to_virtio_gpu_obj (vgfb->base.obj[0 ]); - handle = bo->hw_res_handle; -if (bo->dumb) { -struct virtio_gpu_object_array *objs; +if (!plane->state->fb || !output->enabled) { +DRM_DEBUG ("nofb\n" ); +virtio_gpu_cmd_set_scanout (vgdev, output->index,0 , + plane->state->src_w >>16 , + plane->state->src_h >>16 , +0 ,0 ); +return ; + } + + vgfb =to_virtio_gpu_framebuffer (plane->state->fb); + bo =gem_to_virtio_gpu_obj (vgfb->base.obj[0 ]); +if (bo->dumb) { +struct virtio_gpu_object_array *objs; - objs =virtio_gpu_array_alloc (1 ); -if (!objs) -return ; -virtio_gpu_array_add_obj (objs, vgfb->base.obj[0 ]); -virtio_gpu_cmd_transfer_to_host_2d - (vgdev,0 , - plane->state->src_w >>16 , - plane->state->src_h >>16 , - plane->state->src_x >>16 , - plane->state->src_y >>16 , - objs,NULL ); - } - }else { - handle =0 ; + objs =virtio_gpu_array_alloc (1 ); +if (!objs) +return ; +virtio_gpu_array_add_obj (objs, vgfb->base.obj[0 ]); +virtio_gpu_cmd_transfer_to_host_2d + (vgdev,0 , + plane->state->src_w >>16 , + plane->state->src_h >>16 , + plane->state->src_x >>16 , + plane->state->src_y >>16 , + objs,NULL ); } -DRM_DEBUG ("handle 0x%x, crtc %dx%d+%d+%d, src %dx%d+%d+%d\n" , handle, +DRM_DEBUG ("handle 0x%x, crtc %dx%d+%d+%d, src %dx%d+%d+%d\n" , + bo->hw_res_handle, plane->state->crtc_w, plane->state->crtc_h, plane->state->crtc_x, plane->state->crtc_y, plane->state->src_w >>16 , plane->state->src_h >>16 , plane->state->src_x >>16 , plane->state->src_y >>16 ); -virtio_gpu_cmd_set_scanout (vgdev, output->index, handle, +virtio_gpu_cmd_set_scanout (vgdev, output->index, + bo->hw_res_handle, plane->state->src_w >>16 , plane->state->src_h >>16 , plane->state->src_x >>16 , plane->state->src_y >>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 ); +virtio_gpu_cmd_resource_flush (vgdev, bo->hw_res_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.18.1
Gerd Hoffmann
maintainerPATCH 4/5 drm/virtio: Simplify virtio_gpu_primary_plane_update workflow.
In reply to Gerd HoffmannReturn early for the no framebuffer (or disabled output) case. Results in a simpler code flow for the remaining cases. No functional change.
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 62 ++++++++++++++------------ 1 file changed, 33 insertions(+), 29 deletions(-)
drivers/gpu/drm/virtio/virtgpu_plane.c +33 -29
@@ -110,7 +110,6 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane,struct virtio_gpu_output *output =NULL ;struct virtio_gpu_framebuffer *vgfb;struct virtio_gpu_object *bo; -uint32_t handle;if (plane->state->crtc) output =drm_crtc_to_virtio_gpu_output (plane->state->crtc);
@@ -119,47 +118,52 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane,if (WARN_ON (!output))return ; -if (plane->state->fb && output->enabled) { - vgfb =to_virtio_gpu_framebuffer (plane->state->fb); - bo =gem_to_virtio_gpu_obj (vgfb->base.obj[0 ]); - handle = bo->hw_res_handle; -if (bo->dumb) { -struct virtio_gpu_object_array *objs; +if (!plane->state->fb || !output->enabled) { +DRM_DEBUG ("nofb\n" ); +virtio_gpu_cmd_set_scanout (vgdev, output->index,0 , + plane->state->src_w >>16 , + plane->state->src_h >>16 , +0 ,0 ); +return ; + } + + vgfb =to_virtio_gpu_framebuffer (plane->state->fb); + bo =gem_to_virtio_gpu_obj (vgfb->base.obj[0 ]); +if (bo->dumb) { +struct virtio_gpu_object_array *objs; - objs =virtio_gpu_array_alloc (1 ); -if (!objs) -return ; -virtio_gpu_array_add_obj (objs, vgfb->base.obj[0 ]); -virtio_gpu_cmd_transfer_to_host_2d - (vgdev,0 , - plane->state->src_w >>16 , - plane->state->src_h >>16 , - plane->state->src_x >>16 , - plane->state->src_y >>16 , - objs,NULL ); - } - }else { - handle =0 ; + objs =virtio_gpu_array_alloc (1 ); +if (!objs) +return ; +virtio_gpu_array_add_obj (objs, vgfb->base.obj[0 ]); +virtio_gpu_cmd_transfer_to_host_2d + (vgdev,0 , + plane->state->src_w >>16 , + plane->state->src_h >>16 , + plane->state->src_x >>16 , + plane->state->src_y >>16 , + objs,NULL ); } -DRM_DEBUG ("handle 0x%x, crtc %dx%d+%d+%d, src %dx%d+%d+%d\n" , handle, +DRM_DEBUG ("handle 0x%x, crtc %dx%d+%d+%d, src %dx%d+%d+%d\n" , + bo->hw_res_handle, plane->state->crtc_w, plane->state->crtc_h, plane->state->crtc_x, plane->state->crtc_y, plane->state->src_w >>16 , plane->state->src_h >>16 , plane->state->src_x >>16 , plane->state->src_y >>16 ); -virtio_gpu_cmd_set_scanout (vgdev, output->index, handle, +virtio_gpu_cmd_set_scanout (vgdev, output->index, + bo->hw_res_handle, plane->state->src_w >>16 , plane->state->src_h >>16 , plane->state->src_x >>16 , plane->state->src_y >>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 ); +virtio_gpu_cmd_resource_flush (vgdev, bo->hw_res_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.18.1
Gerd Hoffmann
maintainerPATCH 5/5 drm/virtio: factor out virtio_gpu_update_dumb_bo
In reply to Gerd HoffmannNo functional change.
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 36 +++++++++++++++----------- 1 file changed, 21 insertions(+), 15 deletions(-)
drivers/gpu/drm/virtio/virtgpu_plane.c +21 -15
@@ -102,6 +102,25 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,return ret; } +static void virtio_gpu_update_dumb_bo (struct virtio_gpu_device *vgdev, +struct virtio_gpu_object *bo, +struct drm_plane_state *state) +{ +struct virtio_gpu_object_array *objs; + + objs =virtio_gpu_array_alloc (1 ); +if (!objs) +return ; +virtio_gpu_array_add_obj (objs, &bo->base.base); +virtio_gpu_cmd_transfer_to_host_2d + (vgdev,0 , + state->src_w >>16 , + state->src_h >>16 , + state->src_x >>16 , + state->src_y >>16 , + objs,NULL ); +} +static void virtio_gpu_primary_plane_update (struct drm_plane *plane,struct drm_plane_state *old_state) {
@@ -129,21 +148,8 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, vgfb =to_virtio_gpu_framebuffer (plane->state->fb); bo =gem_to_virtio_gpu_obj (vgfb->base.obj[0 ]); -if (bo->dumb) { -struct virtio_gpu_object_array *objs; - - objs =virtio_gpu_array_alloc (1 ); -if (!objs) -return ; -virtio_gpu_array_add_obj (objs, vgfb->base.obj[0 ]); -virtio_gpu_cmd_transfer_to_host_2d - (vgdev,0 , - plane->state->src_w >>16 , - plane->state->src_h >>16 , - plane->state->src_x >>16 , - plane->state->src_y >>16 , - objs,NULL ); - } +if (bo->dumb) +virtio_gpu_update_dumb_bo (vgdev, bo, plane->state); DRM_DEBUG("handle 0x%x, crtc %dx%d+%d+%d, src %dx%d+%d+%d\n", bo->hw_res_handle,
Signature · 1 line
2.18.1
Gerd Hoffmann
maintainerPATCH 5/5 drm/virtio: factor out virtio_gpu_update_dumb_bo
In reply to Gerd HoffmannNo functional change.
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 36 +++++++++++++++----------- 1 file changed, 21 insertions(+), 15 deletions(-)
drivers/gpu/drm/virtio/virtgpu_plane.c +21 -15
@@ -102,6 +102,25 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,return ret; } +static void virtio_gpu_update_dumb_bo (struct virtio_gpu_device *vgdev, +struct virtio_gpu_object *bo, +struct drm_plane_state *state) +{ +struct virtio_gpu_object_array *objs; + + objs =virtio_gpu_array_alloc (1 ); +if (!objs) +return ; +virtio_gpu_array_add_obj (objs, &bo->base.base); +virtio_gpu_cmd_transfer_to_host_2d + (vgdev,0 , + state->src_w >>16 , + state->src_h >>16 , + state->src_x >>16 , + state->src_y >>16 , + objs,NULL ); +} +static void virtio_gpu_primary_plane_update (struct drm_plane *plane,struct drm_plane_state *old_state) {
@@ -129,21 +148,8 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, vgfb =to_virtio_gpu_framebuffer (plane->state->fb); bo =gem_to_virtio_gpu_obj (vgfb->base.obj[0 ]); -if (bo->dumb) { -struct virtio_gpu_object_array *objs; - - objs =virtio_gpu_array_alloc (1 ); -if (!objs) -return ; -virtio_gpu_array_add_obj (objs, vgfb->base.obj[0 ]); -virtio_gpu_cmd_transfer_to_host_2d - (vgdev,0 , - plane->state->src_w >>16 , - plane->state->src_h >>16 , - plane->state->src_x >>16 , - plane->state->src_y >>16 , - objs,NULL ); - } +if (bo->dumb) +virtio_gpu_update_dumb_bo (vgdev, bo, plane->state); DRM_DEBUG("handle 0x%x, crtc %dx%d+%d+%d, src %dx%d+%d+%d\n", bo->hw_res_handle,
Signature · 1 line
2.18.1
Gerd Hoffmann
maintainercover drm/virtio: various cleanups
Little patch series doing some cleanups in the virtio driver. Patches #1 + #2 have been on the list before as single patches, includes here again for patch dependency reasons.
please review,
Gerd
Gerd Hoffmann (5):
drm/virtio: print a single line with device features drm/virtio: move byteorder handling into
virtio_gpu_cmd_transfer_to_host_2d function
drm/virtio: fix byteorder handling in
virtio_gpu_cmd_transfer_{from,to}_host_3d functions
drm/virtio: Simplify virtio_gpu_primary_plane_update workflow. drm/virtio: factor out virtio_gpu_update_dumb_bo
drivers/gpu/drm/virtio/virtgpu_drv.h | 4 +- drivers/gpu/drm/virtio/virtgpu_kms.c | 9 ++-- drivers/gpu/drm/virtio/virtgpu_plane.c | 74 +++++++++++++++----------- drivers/gpu/drm/virtio/virtgpu_vq.c | 26 ++++++--- 4 files changed, 66 insertions(+), 47 deletions(-)
Signature · 6 lines
2.18.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Gerd Hoffmann
maintainerPATCH 2/5 drm/virtio: move byteorder handling into virtio_gpu_cmd_transfer_to_host_2d function
Be consistent with the rest of the code base.
No functional change.
--- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 ++-- drivers/gpu/drm/virtio/virtgpu_plane.c | 12 ++++++------ drivers/gpu/drm/virtio/virtgpu_vq.c | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-)
drivers/gpu/drm/virtio/virtgpu_drv.h +2 -2
@@ -267,8 +267,8 @@ void virtio_gpu_cmd_unref_resource(struct virtio_gpu_device *vgdev, uint32_t resource_id);void virtio_gpu_cmd_transfer_to_host_2d (struct virtio_gpu_device *vgdev,uint64_t offset, -__le32 width,__le32 height, -__le32 x,__le32 y, +uint32_t width,uint32_t height, +uint32_t x,uint32_t y,struct virtio_gpu_object_array *objs,struct virtio_gpu_fence *fence); void virtio_gpu_cmd_resource_flush(struct virtio_gpu_device *vgdev,
drivers/gpu/drm/virtio/virtgpu_plane.c +6 -6
@@ -132,10 +132,10 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane,virtio_gpu_array_add_obj (objs, vgfb->base.obj[0 ]);virtio_gpu_cmd_transfer_to_host_2d (vgdev,0 , -cpu_to_le32 (plane->state->src_w >>16 ), -cpu_to_le32 (plane->state->src_h >>16 ), -cpu_to_le32 (plane->state->src_x >>16 ), -cpu_to_le32 (plane->state->src_y >>16 ), + plane->state->src_w >>16 , + plane->state->src_h >>16 , + plane->state->src_x >>16 , + plane->state->src_y >>16 , objs,NULL ); } }else {
@@ -234,8 +234,8 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,virtio_gpu_array_add_obj (objs, vgfb->base.obj[0 ]);virtio_gpu_cmd_transfer_to_host_2d (vgdev,0 , -cpu_to_le32 (plane->state->crtc_w), -cpu_to_le32 (plane->state->crtc_h), + plane->state->crtc_w, + plane->state->crtc_h,0 ,0 , objs, vgfb->fence);dma_fence_wait (&vgfb->fence->f, true);dma_fence_put (&vgfb->fence->f);
drivers/gpu/drm/virtio/virtgpu_vq.c +6 -6
@@ -549,8 +549,8 @@ void virtio_gpu_cmd_resource_flush(struct virtio_gpu_device *vgdev,void virtio_gpu_cmd_transfer_to_host_2d (struct virtio_gpu_device *vgdev,uint64_t offset, -__le32 width,__le32 height, -__le32 x,__le32 y, +uint32_t width,uint32_t height, +uint32_t x,uint32_t y,struct virtio_gpu_object_array *objs,struct virtio_gpu_fence *fence) {
@@ -571,10 +571,10 @@ void virtio_gpu_cmd_transfer_to_host_2d(struct virtio_gpu_device *vgdev, cmd_p->hdr.type =cpu_to_le32 (VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D ); cmd_p->resource_id =cpu_to_le32 (bo->hw_res_handle); cmd_p->offset =cpu_to_le64 (offset); - cmd_p->r.width = width; - cmd_p->r.height = height; - cmd_p->r.x = x; - cmd_p->r.y = y; + cmd_p->r.width =cpu_to_le32 (width); + cmd_p->r.height =cpu_to_le32 (height); + cmd_p->r.x =cpu_to_le32 (x); + cmd_p->r.y =cpu_to_le32 (y);virtio_gpu_queue_fenced_ctrl_buffer (vgdev, vbuf, &cmd_p->hdr, fence); }
Signature · 6 lines
2.18.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel