Commit 3954ff10 authored by Gerd Hoffmann's avatar Gerd Hoffmann

drm/virtio: skip set_scanout if framebuffer didn't change

v2: also check src rect (Chia-I Wu).
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: default avatarChia-I Wu <olvaffe@gmail.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20191212125346.8334-2-kraxel@redhat.com
parent 4ad7056a
...@@ -151,20 +151,27 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, ...@@ -151,20 +151,27 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane,
if (bo->dumb) if (bo->dumb)
virtio_gpu_update_dumb_bo(vgdev, bo, plane->state); 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", if (plane->state->fb != old_state->fb ||
bo->hw_res_handle, plane->state->src_w != old_state->src_w ||
plane->state->crtc_w, plane->state->crtc_h, plane->state->src_h != old_state->src_h ||
plane->state->crtc_x, plane->state->crtc_y, plane->state->src_x != old_state->src_x ||
plane->state->src_w >> 16, plane->state->src_y != old_state->src_y) {
plane->state->src_h >> 16, DRM_DEBUG("handle 0x%x, crtc %dx%d+%d+%d, src %dx%d+%d+%d\n",
plane->state->src_x >> 16, bo->hw_res_handle,
plane->state->src_y >> 16); plane->state->crtc_w, plane->state->crtc_h,
virtio_gpu_cmd_set_scanout(vgdev, output->index, plane->state->crtc_x, plane->state->crtc_y,
bo->hw_res_handle, plane->state->src_w >> 16,
plane->state->src_w >> 16, plane->state->src_h >> 16,
plane->state->src_h >> 16, plane->state->src_x >> 16,
plane->state->src_x >> 16, plane->state->src_y >> 16);
plane->state->src_y >> 16); 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);
}
virtio_gpu_cmd_resource_flush(vgdev, bo->hw_res_handle, virtio_gpu_cmd_resource_flush(vgdev, bo->hw_res_handle,
plane->state->src_x >> 16, plane->state->src_x >> 16,
plane->state->src_y >> 16, plane->state->src_y >> 16,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment