]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
drm: Guess device-scale when using simpledrm
authorHans de Goede <hdegoede@redhat.com>
Tue, 15 Aug 2023 17:25:21 +0000 (19:25 +0200)
committerHans de Goede <hdegoede@redhat.com>
Wed, 30 Aug 2023 15:27:20 +0000 (17:27 +0200)
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>
src/plugins/renderers/drm/plugin.c

index 6845795ffa7bc29169ff448b55c3a9af2bfa259c..edf9eb17e2913107bfaf1b0d608fc8b1902c3d46 100644 (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: