diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2014-12-16 12:29:59 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-09-20 14:25:35 +0200 |
commit | de59576293f82ee285ef5edb31f7169c84403368 (patch) | |
tree | a9fa400090460d9862ee85438812d201c555894c /drivers/gpu/drm/bochs | |
parent | 3be7988674ab33565700a37b210f502563d932e6 (diff) | |
download | linux-de59576293f82ee285ef5edb31f7169c84403368.tar.bz2 |
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>
Diffstat (limited to 'drivers/gpu/drm/bochs')
-rw-r--r-- | drivers/gpu/drm/bochs/bochs_drv.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index abace82de6ea..aaae5e50d7c8 100644 --- a/drivers/gpu/drm/bochs/bochs_drv.c +++ b/drivers/gpu/drm/bochs/bochs_drv.c @@ -162,8 +162,15 @@ static int bochs_kick_out_firmware_fb(struct pci_dev *pdev) static int bochs_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { + unsigned long fbsize; int ret; + fbsize = pci_resource_len(pdev, 0); + if (fbsize < 4 * 1024 * 1024) { + DRM_ERROR("less than 4 MB video memory, ignoring device\n"); + return -ENOMEM; + } + ret = bochs_kick_out_firmware_fb(pdev); if (ret) return ret; |