Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bochs: ignore device if there isn't enougth memory

The qemu stdvga can be configured with a wide range of video memory,
from 1 MB to 256 MB (default is 16 MB). In case it is configured
with only 1 or 2 MB it isn't really usable with bochsdrm, due to
depths other than 32bpp not being supported so that isn't enough
memory for a reasonable sized framebuffer. So skip the device
and let vgacon or vesafb+fbcon handle the it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

+7
+7
drivers/gpu/drm/bochs/bochs_drv.c
··· 162 162 static int bochs_pci_probe(struct pci_dev *pdev, 163 163 const struct pci_device_id *ent) 164 164 { 165 + unsigned long fbsize; 165 166 int ret; 167 + 168 + fbsize = pci_resource_len(pdev, 0); 169 + if (fbsize < 4 * 1024 * 1024) { 170 + DRM_ERROR("less than 4 MB video memory, ignoring device\n"); 171 + return -ENOMEM; 172 + } 166 173 167 174 ret = bochs_kick_out_firmware_fb(pdev); 168 175 if (ret)