diff mbox series

[02/10] drm/virtio: fix pageflip flush

Message ID 20181219122708.4586-3-kraxel@redhat.com (mailing list archive)
State New, archived
Headers show
Series drm/virtio: ttm improvements, minor cleanups. | expand

Commit Message

Gerd Hoffmann Dec. 19, 2018, 12:27 p.m. UTC
Sending the flush command only makes sense if we actually have
a framebuffer attached to the scanout (handle != 0).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/virtio/virtgpu_plane.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Ezequiel Garcia Jan. 2, 2019, 5:09 p.m. UTC | #1
On Wed, 2018-12-19 at 13:27 +0100, Gerd Hoffmann wrote:
> Sending the flush command only makes sense if we actually have
> a framebuffer attached to the scanout (handle != 0).
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  drivers/gpu/drm/virtio/virtgpu_plane.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
> index ead5c53d4e..548265b8e8 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_plane.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
> @@ -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,

Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>

Regards,
Ezequiel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index ead5c53d4e..548265b8e8 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -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,