summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2020-03-06 11:07:15 +0000
committerPekka Paalanen <pq@iki.fi>2020-03-20 15:25:24 +0000
commitf9a6162595a3324cdf412efeba17e3a0015e87d2 (patch)
tree1b8064ab578f1c67259008227e10bf238498d201
parent98d75e1b238bbf5da406ea53d42392749fc84dd3 (diff)
downloadweston-f9a6162595a3324cdf412efeba17e3a0015e87d2.tar.gz
drm: Get renderer buffer size from drm_fb
The renderer buffer size is usually the same size as the current mode, so we were taking the dimensions from the currently-set mode. However, using current_mode is quite confusing in places when it comes to scale, and it also hampers our ability to do mode switches, as well as to introduce a future option which will let the renderer use a smaller buffer than the output and display scaled. Simply take the dimensions of the renderer's output buffer from the buffer itself. Signed-off-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--libweston/backend-drm/drm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
index 94729d89..11936115 100644
--- a/libweston/backend-drm/drm.c
+++ b/libweston/backend-drm/drm.c
@@ -391,13 +391,13 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage)
scanout_state->src_x = 0;
scanout_state->src_y = 0;
- scanout_state->src_w = output->base.current_mode->width << 16;
- scanout_state->src_h = output->base.current_mode->height << 16;
+ scanout_state->src_w = fb->width << 16;
+ scanout_state->src_h = fb->height << 16;
scanout_state->dest_x = 0;
scanout_state->dest_y = 0;
- scanout_state->dest_w = scanout_state->src_w >> 16;
- scanout_state->dest_h = scanout_state->src_h >> 16;
+ scanout_state->dest_w = output->base.current_mode->width;
+ scanout_state->dest_h = output->base.current_mode->height;
pixman_region32_copy(&scanout_state->damage, damage);
if (output->base.zoom.active) {