On 1/19/22 16:50, Thomas Zimmermann wrote:
[snip]
IMHO the best solution is to drop IORESOURCE_BUSY from sysfb and have drivers register/release the range with _BUSY. That would signal the memory belongs to the sysfb device but is not busy unless a driver has been bound. After simplefb released the range, it should be 'non- busy' again and available for vmwgfx. Simpledrm does a hot-unplug of the sysfb device, so the memory range gets released entirely. If you want, I'll prepare some patches for this scenario.
Attached is a patch that implements this. Doing
cat /proc/iomem ... e0000000-efffffff : 0000:00:02.0
e0000000-e07e8fff : BOOTFB
e0000000-e07e8fff : simplefb
...
shows the memory. 'BOOTFB' is the simple-framebuffer device and 'simplefb' is the driver. Only the latter uses _BUSY. Same for and the memory canbe acquired by vmwgfx.
Zack, please test this patch. If it works, I'll send out the real patchset.
Hmm, the patch looks good but it doesn't work. After boot: /proc/iomem 50000000-7fffffff : pcie@0x40000000 78000000-7fffffff : 0000:00:0f.0 78000000-782fffff : BOOTFB
and vmwgfx fails on pci_request_regions:
kernel: fb0: switching to vmwgfx from simple kernel: Console: switching to colour dummy device 80x25 kernel: vmwgfx 0000:00:0f.0: BAR 2: can't reserve [mem 0x78000000- 0x7fffffff 64bit pref] kernel: vmwgfx: probe of 0000:00:0f.0 failed with error -16
leaving the system without a fb driver.
OK, I suspect that it would work if you use simpledrm instead of simplefb. Could you try please? You'd have to build DRM and simpledrm into the kernel binary.
Yes, I believe that should work. Zack, could you please try if just the following [0] make it works ?
That is, dropping the IORESOURCE_BUSY but not doing the memory region request / release in simplefb and keeping it in the vmwgfx driver.
[0]: From da6de1430b9dc252eccf2d6fee0446d33375fa6d Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas javierm@redhat.com Date: Wed, 19 Jan 2022 14:41:25 +0100 Subject: [PATCH] drivers/firmware: Don't mark as busy the simple-framebuffer IO resource
The sysfb_create_simplefb() function requests a IO memory resource for the simple-framebuffer platform device, but it also marks it as busy which led to drivers requesting the same memory resource to fail.
Let's drop the IORESOURCE_BUSY flag and let drivers to request it as busy instead.
Signed-off-by: Javier Martinez Canillas javierm@redhat.com --- drivers/firmware/sysfb_simplefb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/sysfb_simplefb.c b/drivers/firmware/sysfb_simplefb.c index 303a491e520d..76c4abc42a30 100644 --- a/drivers/firmware/sysfb_simplefb.c +++ b/drivers/firmware/sysfb_simplefb.c @@ -99,7 +99,7 @@ __init int sysfb_create_simplefb(const struct screen_info *si,
/* setup IORESOURCE_MEM as framebuffer memory */ memset(&res, 0, sizeof(res)); - res.flags = IORESOURCE_MEM | IORESOURCE_BUSY; + res.flags = IORESOURCE_MEM; res.name = simplefb_resname; res.start = base; res.end = res.start + length - 1;