summaryrefslogtreecommitdiff
path: root/drivers/video/console/sticore.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2022-06-02 13:50:44 +0200
committerHelge Deller <deller@gmx.de>2022-06-04 15:47:03 +0200
commitcf936af790a3ef5f41ff687ec91bfbffee141278 (patch)
tree68e2577f3687ecdaf51f39b79f4405e4cd4cfb4c /drivers/video/console/sticore.c
parent6ba688364856ad083be537f08e86ba97f433d405 (diff)
parisc/stifb: Implement fb_is_primary_device()
Implement fb_is_primary_device() function, so that fbcon detects if this framebuffer belongs to the default graphics card which was used to start the system. Signed-off-by: Helge Deller <deller@gmx.de> Cc: stable@vger.kernel.org # v5.10+
Diffstat (limited to 'drivers/video/console/sticore.c')
-rw-r--r--drivers/video/console/sticore.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index f869b723494f..62005064911b 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -30,6 +30,7 @@
#include <asm/pdc.h>
#include <asm/cacheflush.h>
#include <asm/grfioctl.h>
+#include <asm/fb.h>
#include "../fbdev/sticore.h"
@@ -1127,6 +1128,22 @@ int sti_call(const struct sti_struct *sti, unsigned long func,
return ret;
}
+/* check if given fb_info is the primary device */
+int fb_is_primary_device(struct fb_info *info)
+{
+ struct sti_struct *sti;
+
+ sti = sti_get_rom(0);
+
+ /* if no built-in graphics card found, allow any fb driver as default */
+ if (!sti)
+ return true;
+
+ /* return true if it's the default built-in framebuffer driver */
+ return (sti->info == info);
+}
+EXPORT_SYMBOL(fb_is_primary_device);
+
MODULE_AUTHOR("Philipp Rumpf, Helge Deller, Thomas Bogendoerfer");
MODULE_DESCRIPTION("Core STI driver for HP's NGLE series graphics cards in HP PARISC machines");
MODULE_LICENSE("GPL v2");