Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1669931

[PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

From Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb
Date 2017-06-19 22:40 +0200
Message-ID <tUbCO-7vX-27@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Teddy Wang <teddy.wang@siliconmotion.com>

If vesafb is enabled in the config then /dev/fb0 is created by vesa
and this sm750 driver gets fb1, fb2. But we need to be fb0 and fb1 to
effectively work with xorg.
So if it has been alloted fb1, then try to remove the other fb0.

Signed-off-by: Teddy Wang <teddy.wang@siliconmotion.com>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index d5934f3..8199dbe 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1053,6 +1053,26 @@ static int sm750fb_frambuffer_alloc(struct sm750_dev *sm750_dev, int fbidx)
 	return err;
 }
 
+static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev)
+{
+	struct apertures_struct *ap;
+	bool primary = false;
+
+	ap = alloc_apertures(1);
+	if (!ap)
+		return -ENOMEM;
+
+	ap->ranges[0].base = pci_resource_start(pdev, 0);
+	ap->ranges[0].size = pci_resource_len(pdev, 0);
+#ifdef CONFIG_X86
+	primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+					IORESOURCE_ROM_SHADOW;
+#endif
+	remove_conflicting_framebuffers(ap, "sm750_fb1", primary);
+	kfree(ap);
+	return 0;
+}
+
 static int lynxfb_pci_probe(struct pci_dev *pdev,
 			    const struct pci_device_id *ent)
 {
@@ -1061,6 +1081,10 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
 	int fbidx;
 	int err;
 
+	err = lynxfb_kick_out_firmware_fb(pdev);
+	if (err)
+		return err;
+
 	/* enable device */
 	err = pcim_enable_device(pdev);
 	if (err)
-- 
1.9.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2017-06-19 22:40 +0200
  Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-19 22:50 +0200
    Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2017-06-20 22:10 +0200
      Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Dan Carpenter <dan.carpenter@oracle.com> - 2017-06-20 22:30 +0200
        Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2017-06-20 22:50 +0200
        Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-20 22:50 +0200
        Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2017-06-20 22:50 +0200
  Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2017-06-25 14:50 +0200
    Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-25 15:00 +0200
      Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2017-06-25 16:00 +0200
        Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-25 16:30 +0200
          Re: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2017-06-25 17:10 +0200
            Re: 答复: [PATCH 1/2] staging:  sm750fb: avoid conflicting vesafb Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-29 15:00 +0200

csiph-web