drm: Guess device-scale when using simpledrm

When displaying on a simpledrm kms device the physical dimensions
of the screen are unknown. Use the heuristics from ply_get_device_scale ()
to guess the device scale to avoid rendering things too small
on 4K screens.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Hans de Goede 2023-08-15 19:25:21 +02:00
parent f5eb3e57c2
commit 01702de71a

View file

@ -1230,9 +1230,13 @@ get_output_info (ply_renderer_backend_t *backend,
mode = &connector->modes[0];
}
output->mode = *mode;
output->device_scale = ply_get_device_scale (mode->hdisplay, mode->vdisplay,
(!has_90_rotation) ? connector->mmWidth : connector->mmHeight,
(!has_90_rotation) ? connector->mmHeight : connector->mmWidth);
if (backend->simpledrm)
output->device_scale = ply_guess_device_scale (mode->hdisplay, mode->vdisplay);
else
output->device_scale = ply_get_device_scale (mode->hdisplay, mode->vdisplay,
(!has_90_rotation) ? connector->mmWidth : connector->mmHeight,
(!has_90_rotation) ? connector->mmHeight : connector->mmWidth);
output->connector_type = connector->connector_type;
output->connected = true;
out: