diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-05-31 08:20:22 -0400 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-06-07 04:37:14 -0400 |
commit | 0062795e30697b825387a795b9c1791cc28a0a72 (patch) | |
tree | 2f0953bd3efb6c44771d8639e829e5b473aad51d | |
parent | 86f752d2cc6b5b4c7bb3db354361588767393453 (diff) |
virtio-gpu: use src not crtc
Pick up the correct source rectangle from framebuffer.
Without this multihead setups are not working correctly.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_plane.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index b7778a78db4b..925ca25209df 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c | |||
@@ -85,27 +85,32 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane, | |||
85 | if (bo->dumb) { | 85 | if (bo->dumb) { |
86 | virtio_gpu_cmd_transfer_to_host_2d | 86 | virtio_gpu_cmd_transfer_to_host_2d |
87 | (vgdev, handle, 0, | 87 | (vgdev, handle, 0, |
88 | cpu_to_le32(plane->state->crtc_w), | 88 | cpu_to_le32(plane->state->src_w >> 16), |
89 | cpu_to_le32(plane->state->crtc_h), | 89 | cpu_to_le32(plane->state->src_h >> 16), |
90 | plane->state->crtc_x, plane->state->crtc_y, NULL); | 90 | plane->state->src_x >> 16, |
91 | plane->state->src_y >> 16, NULL); | ||
91 | } | 92 | } |
92 | } else { | 93 | } else { |
93 | handle = 0; | 94 | handle = 0; |
94 | } | 95 | } |
95 | 96 | ||
96 | DRM_DEBUG("handle 0x%x, crtc %dx%d+%d+%d\n", handle, | 97 | DRM_DEBUG("handle 0x%x, crtc %dx%d+%d+%d, src %dx%d+%d+%d\n", handle, |
97 | plane->state->crtc_w, plane->state->crtc_h, | 98 | plane->state->crtc_w, plane->state->crtc_h, |
98 | plane->state->crtc_x, plane->state->crtc_y); | 99 | plane->state->crtc_x, plane->state->crtc_y, |
100 | plane->state->src_w >> 16, | ||
101 | plane->state->src_h >> 16, | ||
102 | plane->state->src_x >> 16, | ||
103 | plane->state->src_y >> 16); | ||
99 | virtio_gpu_cmd_set_scanout(vgdev, output->index, handle, | 104 | virtio_gpu_cmd_set_scanout(vgdev, output->index, handle, |
100 | plane->state->crtc_w, | 105 | plane->state->src_w >> 16, |
101 | plane->state->crtc_h, | 106 | plane->state->src_h >> 16, |
102 | plane->state->crtc_x, | 107 | plane->state->src_x >> 16, |
103 | plane->state->crtc_y); | 108 | plane->state->src_y >> 16); |
104 | virtio_gpu_cmd_resource_flush(vgdev, handle, | 109 | virtio_gpu_cmd_resource_flush(vgdev, handle, |
105 | plane->state->crtc_x, | 110 | plane->state->src_x >> 16, |
106 | plane->state->crtc_y, | 111 | plane->state->src_y >> 16, |
107 | plane->state->crtc_w, | 112 | plane->state->src_w >> 16, |
108 | plane->state->crtc_h); | 113 | plane->state->src_h >> 16); |
109 | } | 114 | } |
110 | 115 | ||
111 | static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, | 116 | static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, |