@@ -9,7 +9,7 @@
#include "loongson_module.h"
-static int loongson_modeset = -1;
+int loongson_modeset = -1;
MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
module_param_named(modeset, loongson_modeset, int, 0400);
@@ -6,6 +6,7 @@
#ifndef __LOONGSON_MODULE_H__
#define __LOONGSON_MODULE_H__
+extern int loongson_modeset;
extern int loongson_vblank;
extern struct pci_driver lsdc_pci_driver;
@@ -257,6 +257,14 @@ static unsigned int lsdc_vga_set_decode(struct pci_dev *pdev, bool state)
return VGA_RSRC_NORMAL_IO | VGA_RSRC_NORMAL_MEM;
}
+static bool lsdc_want_to_be_primary(struct pci_dev *pdev)
+{
+ if (loongson_modeset == 10)
+ return true;
+
+ return false;
+}
+
static int lsdc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
const struct lsdc_desc *descp;
@@ -289,7 +297,7 @@ static int lsdc_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_drvdata(pdev, ddev);
- vga_client_register(pdev, lsdc_vga_set_decode, NULL);
+ vga_client_register(pdev, lsdc_vga_set_decode, lsdc_want_to_be_primary);
drm_kms_helper_poll_init(ddev);