All of lore.kernel.org
 help / color / mirror / Atom feed
* make fbdev/fbcon switchable per driver?
@ 2017-01-27 10:00 Gerd Hoffmann
  2017-01-27 14:02 ` Daniel Vetter
  2017-01-27 18:30 ` Alex Williamson
  0 siblings, 2 replies; 8+ messages in thread
From: Gerd Hoffmann @ 2017-01-27 10:00 UTC (permalink / raw)
  To: dri-devel; +Cc: alex.williamson

[-- Attachment #1: Type: text/plain, Size: 548 bytes --]

  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


[-- Attachment #2: 0001-drm-i915-add-fbdev-option.patch --]
[-- Type: text/x-patch, Size: 1363 bytes --]

From 19236e412a6f0e9390c1ce77d8702bbdb5511174 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri, 27 Jan 2017 08:05:40 +0100
Subject: [PATCH] drm i915: add fbdev option

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 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 <drm/i915_drm.h>
 #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


[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-01-31 10:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-27 10:00 make fbdev/fbcon switchable per driver? Gerd Hoffmann
2017-01-27 14:02 ` Daniel Vetter
2017-01-27 14:41   ` Liviu Dudau
2017-01-27 18:30 ` Alex Williamson
2017-01-30  8:15   ` Gerd Hoffmann
2017-01-30 17:45     ` Alex Williamson
2017-01-31  8:00       ` Daniel Vetter
2017-01-31 10:06         ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.