From: Daniel Stone Date: Fri, 6 Mar 2020 11:07:15 +0000 (+0000) Subject: drm: Get renderer buffer size from drm_fb X-Git-Tag: upstream/9.0.0~67 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9a6162595a3324cdf412efeba17e3a0015e87d2;p=platform%2Fupstream%2Fweston.git 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 --- 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) {