From 44c23ca4728cba634580f10a62aafbf732bed8e1 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Fri, 25 Oct 2024 13:54:45 +0200 Subject: [PATCH] intel/display: adjust width_mm/height_mm usage On capture creation for discrete usage, use the connector values if display mode does not provide values. For mirror capture ever report no width_mm/height_mm. --- repos/pc/src/driver/framebuffer/intel/pc/lx_user.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/repos/pc/src/driver/framebuffer/intel/pc/lx_user.c b/repos/pc/src/driver/framebuffer/intel/pc/lx_user.c index 8442cbf72a..f6a05feab3 100644 --- a/repos/pc/src/driver/framebuffer/intel/pc/lx_user.c +++ b/repos/pc/src/driver/framebuffer/intel/pc/lx_user.c @@ -742,8 +742,8 @@ static bool reconfigure(struct drm_client_dev * const dev) if (!err && conf_mode.enabled && conf_mode.mirror && !mirror.report) { /* use fb_info of first mirrored screen */ mirror.report = true; - mirror.width_mm = mode->width_mm; - mirror.height_mm = mode->height_mm; + mirror.width_mm = 0; + mirror.height_mm = 0; mirror.info = fb_info; mirror.info.node = CONNECTOR_ID_MIRROR; } @@ -767,9 +767,12 @@ static bool reconfigure(struct drm_client_dev * const dev) if (err) printk(" - failed, error=%d\n", err); - if (!err && !conf_mode.mirror && conf_mode.enabled) - user_register_fb(dev, &fb_info, &fb_cmd, - mode->width_mm, mode->height_mm); + if (!err && !conf_mode.mirror && conf_mode.enabled) { + unsigned width_mm = mode->width_mm ? : connector->display_info.width_mm; + unsigned height_mm = mode->height_mm ? : connector->display_info.height_mm; + + user_register_fb(dev, &fb_info, &fb_cmd, width_mm, height_mm); + } break; }