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>
This commit is contained in:
parent
98d75e1b23
commit
f9a6162595
|
@ -391,13 +391,13 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage)
|
||||||
|
|
||||||
scanout_state->src_x = 0;
|
scanout_state->src_x = 0;
|
||||||
scanout_state->src_y = 0;
|
scanout_state->src_y = 0;
|
||||||
scanout_state->src_w = output->base.current_mode->width << 16;
|
scanout_state->src_w = fb->width << 16;
|
||||||
scanout_state->src_h = output->base.current_mode->height << 16;
|
scanout_state->src_h = fb->height << 16;
|
||||||
|
|
||||||
scanout_state->dest_x = 0;
|
scanout_state->dest_x = 0;
|
||||||
scanout_state->dest_y = 0;
|
scanout_state->dest_y = 0;
|
||||||
scanout_state->dest_w = scanout_state->src_w >> 16;
|
scanout_state->dest_w = output->base.current_mode->width;
|
||||||
scanout_state->dest_h = scanout_state->src_h >> 16;
|
scanout_state->dest_h = output->base.current_mode->height;
|
||||||
|
|
||||||
pixman_region32_copy(&scanout_state->damage, damage);
|
pixman_region32_copy(&scanout_state->damage, damage);
|
||||||
if (output->base.zoom.active) {
|
if (output->base.zoom.active) {
|
||||||
|
|
Loading…
Reference in New Issue