On Fri, Aug 5, 2016 at 11:44 AM, Noralf TrÃnnes <noralf@xxxxxxxxxxx> wrote:
Create a simple fbdev device during SimpleDRM setup so legacy user-space
and fbcon can use it.
Original work by David Herrmann.
Cc: dh.herrmann@xxxxxxxxx
Signed-off-by: Noralf TrÃnnes <noralf@xxxxxxxxxxx>
---
Changes from version 1:
No changes
Changes from previous version:
- Remove the DRM_SIMPLEDRM_FBDEV kconfig option and use DRM_FBDEV_EMULATION
- Suspend fbcon/fbdev when the pipeline is enabled, resume in lastclose
- Add FBINFO_CAN_FORCE_OUTPUT flag so we get oops'es on the console
diff --git a/drivers/gpu/drm/simpledrm/simpledrm_fbdev.c b/drivers/gpu/drm/simpledrm/simpledrm_fbdev.cYou should not need module.h here since this file is not doing the
new file mode 100644
index 0000000..b83646b
--- /dev/null
+++ b/drivers/gpu/drm/simpledrm/simpledrm_fbdev.c
@@ -0,0 +1,160 @@
+/*
+ * SimpleDRM firmware framebuffer driver
+ * Copyright (c) 2012-2014 David Herrmann <dh.herrmann@xxxxxxxxx>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+/*
+ * fbdev compatibility layer
+ * We provide a basic fbdev device for the same framebuffer that is used for
+ * the pseudo CRTC.
+ */
+
+#include <linux/console.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/module.h>
module_init or module_exit or MODULE_ALIAS etc etc.
An empty file with just module.h in it outputs about 750k of goo
from cpp, so it is best avoided wherever not strictly needed.
Thanks,
Paul.
--
+#include <linux/string.h>
+#include <linux/fb.h>
+#include "simpledrm.h"
+