From patchwork Thu Jan 15 21:24:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 5642421 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1D8D3C058D for ; Thu, 15 Jan 2015 21:25:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 492C9201BC for ; Thu, 15 Jan 2015 21:25:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 586A020172 for ; Thu, 15 Jan 2015 21:25:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 90FD86E254; Thu, 15 Jan 2015 13:25:33 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id 470826E254 for ; Thu, 15 Jan 2015 13:25:32 -0800 (PST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0FLPRId030485 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 15 Jan 2015 16:25:28 -0500 Received: from nilsson.home.kraxel.org (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0FLPQjJ027592; Thu, 15 Jan 2015 16:25:27 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 1E93680776; Thu, 15 Jan 2015 22:25:26 +0100 (CET) From: Gerd Hoffmann To: airlied@gmail.com, dri-devel@lists.freedesktop.org Subject: [RESEND PATCH] bochs: ignore device if there isn't enougth memory Date: Thu, 15 Jan 2015 22:24:54 +0100 Message-Id: <1421357094-6517-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Cc: open list X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/gpu/drm/bochs/bochs_drv.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index 98837bd..9874d4a 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;