From: Hans de Goede Date: Tue, 15 Aug 2023 17:25:21 +0000 (+0200) Subject: drm: Guess device-scale when using simpledrm X-Git-Tag: 23.51.283~22^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01702de71a93d9a0a4ddbed697fb14b9ad6ed4bf;p=thirdparty%2Fplymouth.git 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 --- diff --git a/src/plugins/renderers/drm/plugin.c b/src/plugins/renderers/drm/plugin.c index 6845795f..edf9eb17 100644 --- a/src/plugins/renderers/drm/plugin.c +++ b/src/plugins/renderers/drm/plugin.c @@ -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: