intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/fbdev: Preserve visible size when reusing BIOS fb
@ 2026-11-07 23:06 Zheyu Shen
  0 siblings, 0 replies; 4+ messages in thread
From: Zheyu Shen @ 2026-11-07 23:06 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, rodrigo.vivi, dri-devel

When reusing the BIOS framebuffer, intel_fbdev_driver_fbdev_probe()
overwrites sizes->fb_width and sizes->fb_height with the framebuffer's
dimensions. These become the visible fbdev resolution.

If the BIOS framebuffer is larger than the mode selected by the fbdev
client, fbcon consequently uses more rows and columns than are visible,
leaving console output outside the scanned-out area.

This occurs on a Broxton ZimaBlade 7700 with an MPI5001 panel connected
through DP-2 via PCON. The firmware provides a 1280x1024 framebuffer,
while i915 selects the panel's preferred 800x480 mode.

Keep the visible size requested by the fb helper. The larger BIOS
framebuffer is still reused, with its dimensions exposed through
xres_virtual and yres_virtual. This matches the fresh-allocation path,
which also preserves the requested visible size.

Boot-tested on the affected hardware: console output now displays
correctly while the virtual framebuffer remains 1280x1024.

Claude (claude-opus-5-5) assisted with patch preparation. Copilot assisted
with commit-message preparation, building, deployment, and validation.

Fixes: d978ef14456a ("drm/i915: Wrap the preallocated BIOS framebuffer and preserve for KMS fbcon v12")
Cc: stable@vger.kernel.org

Signed-off-by: Zheyu Shen <arsdragonfly@gmail.com>
---
 drivers/gpu/drm/i915/display/intel_fbdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index 219ee17de3f6..5c043172a35c 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -324,8 +324,6 @@ int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
 	} else {
 		drm_dbg_kms(display->drm, "re-using BIOS fb\n");
 		prealloc = true;
-		sizes->fb_width = fb->base.width;
-		sizes->fb_height = fb->base.height;
 	}
 
 	obj = intel_fb_bo(&fb->base);
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] drm/i915/fbdev: Preserve visible size when reusing BIOS fb
@ 2026-11-08 18:59 Zheyu Shen
  2026-11-08 19:03 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
  2026-11-08 19:18 ` [PATCH] " sashiko-bot
  0 siblings, 2 replies; 4+ messages in thread
From: Zheyu Shen @ 2026-11-08 18:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula, rodrigo.vivi, dri-devel

When reusing the BIOS framebuffer, intel_fbdev_driver_fbdev_probe()
overwrites sizes->fb_width and sizes->fb_height with the framebuffer's
dimensions. These become the visible fbdev resolution.

If the BIOS framebuffer is larger than the mode selected by the fbdev
client, fbcon consequently uses more rows and columns than are visible,
leaving console output outside the scanned-out area.

This occurs on a Broxton ZimaBlade 7700 with an MPI5001 panel connected
through DP-2 via PCON. The firmware provides a 1280x1024 framebuffer,
while i915 selects the panel's preferred 800x480 mode.

Keep the visible size requested by the fb helper. The larger BIOS
framebuffer is still reused, with its dimensions exposed through
xres_virtual and yres_virtual. This matches the fresh-allocation path,
which also preserves the requested visible size.

Boot-tested on the affected hardware: console output now displays
correctly while the virtual framebuffer remains 1280x1024.

Claude (claude-opus-5-5) assisted with patch preparation. Copilot assisted
with commit-message preparation, building, deployment, and validation.

Fixes: d978ef14456a ("drm/i915: Wrap the preallocated BIOS framebuffer and preserve for KMS fbcon v12")
Cc: stable@vger.kernel.org

Signed-off-by: Zheyu Shen <arsdragonfly@gmail.com>
---
 drivers/gpu/drm/i915/display/intel_fbdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
index 219ee17de3f6..5c043172a35c 100644
--- a/drivers/gpu/drm/i915/display/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
@@ -324,8 +324,6 @@ int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
 	} else {
 		drm_dbg_kms(display->drm, "re-using BIOS fb\n");
 		prealloc = true;
-		sizes->fb_width = fb->base.width;
-		sizes->fb_height = fb->base.height;
 	}
 
 	obj = intel_fb_bo(&fb->base);
-- 
2.56.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✗ LGCI.VerificationFailed: failure for drm/i915/fbdev: Preserve visible size when reusing BIOS fb
  2026-11-08 18:59 [PATCH] drm/i915/fbdev: Preserve visible size when reusing BIOS fb Zheyu Shen
@ 2026-11-08 19:03 ` Patchwork
  2026-11-08 19:18 ` [PATCH] " sashiko-bot
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2026-11-08 19:03 UTC (permalink / raw)
  To: Zheyu Shen; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/fbdev: Preserve visible size when reusing BIOS fb
URL   : https://patchwork.freedesktop.org/series/178064/
State : failure

== Summary ==

Series author address 'arsdragonfly@gmail.com' is not on the allowlist, which prevents CI from being automatically triggered.
If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork.
Exception occurred during validation, bailing out!
Build URL: http://gfx-ci.igk.intel.com:8080/job/CI_PW_kernel/192604/ (on built-in)



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915/fbdev: Preserve visible size when reusing BIOS fb
  2026-11-08 18:59 [PATCH] drm/i915/fbdev: Preserve visible size when reusing BIOS fb Zheyu Shen
  2026-11-08 19:03 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
@ 2026-11-08 19:18 ` sashiko-bot
  1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-11-08 19:18 UTC (permalink / raw)
  To: Zheyu Shen, intel-gfx; +Cc: dri-devel

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] drm/i915/fbdev: framebuffer leak on error in
  intel_fbdev_driver_fbdev_probe() [1]
--

commit 89c135a5c0c574b132cf58f5439280c84473a688
Author: Zheyu Shen <arsdragonfly@gmail.com>

drm/i915/fbdev: Preserve visible size when reusing BIOS fb

This commit stops intel_fbdev_driver_fbdev_probe() from overwriting the
requested fb_width and fb_height with the BIOS framebuffer's dimensions
when reusing a preallocated BIOS framebuffer.

> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index 219ee17de3f68..5c043172a35c7 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -324,8 +324,6 @@ int intel_fbdev_driver_fbdev_probe(struct drm_fb_helper *helper,
>  	} else {
>  		drm_dbg_kms(display->drm, "re-using BIOS fb\n");
>  		prealloc = true;
> -		sizes->fb_width = fb->base.width;
> -		sizes->fb_height = fb->base.height;
>  	}
>  
>  	obj = intel_fb_bo(&fb->base);

[Severity: Medium]
This problem wasn't introduced by this patch, but does
intel_fbdev_driver_fbdev_probe() leak &fb->base [1] if pinning or
filling the fbdev info fails right after this block?

drivers/gpu/drm/i915/display/intel_fbdev.c:intel_fbdev_driver_fbdev_probe() {
	...
	ifbdev->fb = NULL;
	...
	ret = intel_parent_fb_pin_ggtt_pin(display, obj, &pin_params,
					   &vma, &offset, NULL);
	if (ret)
		goto out_unlock;

	helper->funcs = &intel_fb_helper_funcs;
	helper->fb = &fb->base;

	info->fbops = &intelfb_ops;

	ret = intel_bo_fbdev_fill_info(obj, info, vma);
	if (ret)
		goto out_unpin;
	...
out_unpin:
	intel_parent_fb_pin_ggtt_unpin(display, vma, -1);
out_unlock:
	intel_display_rpm_put(display, wakeref);

	return ret;
}

ifbdev->fb is cleared at the start of the function, so the local fb holds
the only reference to the reused BIOS framebuffer (or the newly allocated
one).  If intel_parent_fb_pin_ggtt_pin() or intel_bo_fbdev_fill_info()
fails, drm_fb_helper_single_fb_probe() aborts before
register_framebuffer(), so intelfb_ops.fb_destroy is never called and the
drm_framebuffer and its backing GEM object are leaked, triggering a
WARN_ON(!list_empty(&dev->mode_config.fb_list)) in
drm_mode_config_cleanup() on driver teardown.

[1] https://sashiko.dev/#/bug/linux-c63f5649-e8ad-40e0-abcd-b5a3b7668026

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/e1823bda-ff83-4e9e-8e81-b2d0ea5c05ac@gmail.com?part=1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-09 13:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-08 18:59 [PATCH] drm/i915/fbdev: Preserve visible size when reusing BIOS fb Zheyu Shen
2026-11-08 19:03 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
2026-11-08 19:18 ` [PATCH] " sashiko-bot
  -- strict thread matches above, loose matches on Subject: below --
2026-11-07 23:06 Zheyu Shen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).