From patchwork Fri Jan 27 10:00:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9540911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 503BD60429 for ; Fri, 27 Jan 2017 10:00:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40A3827FBB for ; Fri, 27 Jan 2017 10:00:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 358892824F; Fri, 27 Jan 2017 10:00:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C9F5327FBB for ; Fri, 27 Jan 2017 10:00:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BA28B6E315; Fri, 27 Jan 2017 10:00:42 +0000 (UTC) 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 ESMTPS id 4B0A76E315 for ; Fri, 27 Jan 2017 10:00:41 +0000 (UTC) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B89E59D0FC for ; Fri, 27 Jan 2017 10:00:41 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-48.ams2.redhat.com [10.36.116.48]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0RA0eiQ026793; Fri, 27 Jan 2017 05:00:41 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id EE67E80E6D; Fri, 27 Jan 2017 11:00:38 +0100 (CET) Message-ID: <1485511238.19754.58.camel@redhat.com> Subject: make fbdev/fbcon switchable per driver? From: Gerd Hoffmann To: dri-devel Date: Fri, 27 Jan 2017 11:00:38 +0100 Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 27 Jan 2017 10:00:41 +0000 (UTC) Cc: "alex.williamson" 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi folks, Problem at hand: A virtual machine, equipped with two display devices, one virtual, one physical (using pci pass-through, or kvmgt-based vgpu). There is no easy way for the user to configure which of the two display devices fbcon should run on. i915 happens to win over bochs-drm or qxl, so you can't use the emulated gfx device as text console. One way out would be to add a module option to each driver, to turn off fbdev emulation. Attached patch does that for i915. Comments? Better ideas? cheers, Gerd From 19236e412a6f0e9390c1ce77d8702bbdb5511174 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 27 Jan 2017 08:05:40 +0100 Subject: [PATCH] drm i915: add fbdev option Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/i915/intel_fbdev.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c index 3e3632c..cc0ba3e 100644 --- a/drivers/gpu/drm/i915/intel_fbdev.c +++ b/drivers/gpu/drm/i915/intel_fbdev.c @@ -45,6 +45,11 @@ #include #include "i915_drv.h" +static bool enable_fbdev = true; +module_param_named(fbdev, enable_fbdev, bool, 0600); +MODULE_PARM_DESC(fbdev, + "Enable legacy fbdev emulation [default=true]"); + static int intel_fbdev_set_par(struct fb_info *info) { struct drm_fb_helper *fb_helper = info->par; @@ -706,6 +711,9 @@ int intel_fbdev_init(struct drm_device *dev) struct drm_i915_private *dev_priv = to_i915(dev); int ret; + if (!enable_fbdev) + return 0; + if (WARN_ON(INTEL_INFO(dev)->num_pipes == 0)) return -ENODEV; @@ -747,6 +755,8 @@ void intel_fbdev_initial_config_async(struct drm_device *dev) { struct intel_fbdev *ifbdev = to_i915(dev)->fbdev; + if (!ifbdev) + return; ifbdev->cookie = async_schedule(intel_fbdev_initial_config, ifbdev); } -- 1.8.3.1