Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1669931 > unrolled thread
| Started by | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| First post | 2017-06-19 22:40 +0200 |
| Last post | 2017-06-29 15:00 +0200 |
| Articles | 13 — 4 participants |
Back to article view | Back to linux.kernel
[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
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2017-06-19 22:40 +0200 |
| Subject | [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb |
| Message-ID | <tUbCO-7vX-27@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Date | 2017-06-19 22:50 +0200 |
| Message-ID | <tUbMt-7Ag-3@gated-at.bofh.it> |
| In reply to | #1669931 |
On Mon, Jun 19, 2017 at 11:32 PM, Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote: > +#ifdef CONFIG_X86 > + primary = pdev->resource[PCI_ROM_RESOURCE].flags & > + IORESOURCE_ROM_SHADOW; > +#endif Why do we need #ifdef? In any case you may introduce a temporary variable to have pointer to resource struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; -- With Best Regards, Andy Shevchenko
[toc] | [prev] | [next] | [standalone]
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2017-06-20 22:10 +0200 |
| Message-ID | <tUxDj-4LL-1@gated-at.bofh.it> |
| In reply to | #1669932 |
On Mon, Jun 19, 2017 at 11:47:20PM +0300, Andy Shevchenko wrote: > On Mon, Jun 19, 2017 at 11:32 PM, Sudip Mukherjee > <sudipm.mukherjee@gmail.com> wrote: > > > > +#ifdef CONFIG_X86 > > + primary = pdev->resource[PCI_ROM_RESOURCE].flags & > > + IORESOURCE_ROM_SHADOW; > > +#endif > > Why do we need #ifdef? It has been done in exactly the same way it is done in drm drivers. All the drm drivers I have checked uses #ifdef. See for example: http://elixir.free-electrons.com/linux/v4.12-rc6/source/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c#L470 If you think #ifdef is not required, please send patch for the drm drivers, and we follow that change here also. > > In any case you may introduce a temporary variable to have pointer to resource > > struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; No, we will not want to do it in a different way than the way it is done by drm drivers. -- Regards Sudip
[toc] | [prev] | [next] | [standalone]
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Date | 2017-06-20 22:30 +0200 |
| Message-ID | <tUxWG-4Sn-15@gated-at.bofh.it> |
| In reply to | #1671061 |
That's totally bogus. Just say you don't know. It's never a reguirement that people fix AMD drivers before they can review code... regards, dan carpenter
[toc] | [prev] | [next] | [standalone]
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2017-06-20 22:50 +0200 |
| Message-ID | <tUyg1-4YJ-1@gated-at.bofh.it> |
| In reply to | #1671081 |
On Tue, Jun 20, 2017 at 11:40:59PM +0300, Andy Shevchenko wrote: > On Tue, Jun 20, 2017 at 11:20 PM, Dan Carpenter > <dan.carpenter@oracle.com> wrote: > > That's totally bogus. Just say you don't know. It's never a > > reguirement that people fix AMD drivers before they can review code... > > Agree. It's not a cargo cult. > If there any real thing behind that #ifdef I would like to hear. I dont know the real thing behind that. You can hear the real thing if you send that patch to drm. And that is the only reason I mentioned that. -- Regards Sudip
[toc] | [prev] | [next] | [standalone]
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Date | 2017-06-20 22:50 +0200 |
| Message-ID | <tUyg1-4YJ-3@gated-at.bofh.it> |
| In reply to | #1671081 |
On Tue, Jun 20, 2017 at 11:20 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote: > That's totally bogus. Just say you don't know. It's never a > reguirement that people fix AMD drivers before they can review code... Agree. It's not a cargo cult. If there any real thing behind that #ifdef I would like to hear. -- With Best Regards, Andy Shevchenko
[toc] | [prev] | [next] | [standalone]
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2017-06-20 22:50 +0200 |
| Message-ID | <tUyg1-4YJ-21@gated-at.bofh.it> |
| In reply to | #1671081 |
Hi Dan, On Tue, Jun 20, 2017 at 11:20:55PM +0300, Dan Carpenter wrote: > That's totally bogus. Just say you don't know. It's never a > reguirement that people fix AMD drivers before they can review code... Yes, I don't know how drm drivers work, so I blindly follow what has been done there. And since sm750 ultimately has to be converted to a drm driver to be taken out of staging, so I will prefer to have similar changes here. -- Regards Sudip
[toc] | [prev] | [next] | [standalone]
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2017-06-25 14:50 +0200 |
| Message-ID | <tWf9f-58S-5@gated-at.bofh.it> |
| In reply to | #1669931 |
On Mon, Jun 19, 2017 at 09:32:57PM +0100, Sudip Mukherjee wrote: > 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> > --- Hi Greg, You applied the second patch but not this one. Did I miss any review comments from you about this one? -- Regards Sudip
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-06-25 15:00 +0200 |
| Message-ID | <tWfiW-5cl-5@gated-at.bofh.it> |
| In reply to | #1674206 |
On Sun, Jun 25, 2017 at 01:43:34PM +0100, Sudip Mukherjee wrote: > On Mon, Jun 19, 2017 at 09:32:57PM +0100, Sudip Mukherjee wrote: > > 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> > > --- > > Hi Greg, > You applied the second patch but not this one. Did I miss any review > comments from you about this one? All of the other complaints about this patch were not sufficient for me to justify ignoring it? Why would I not listen to them? Please fix and resend if you want it applied. thanks, greg k-h
[toc] | [prev] | [next] | [standalone]
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2017-06-25 16:00 +0200 |
| Message-ID | <tWgeZ-5Mx-5@gated-at.bofh.it> |
| In reply to | #1674208 |
On Sun, Jun 25, 2017 at 02:54:51PM +0200, Greg Kroah-Hartman wrote: > On Sun, Jun 25, 2017 at 01:43:34PM +0100, Sudip Mukherjee wrote: > > On Mon, Jun 19, 2017 at 09:32:57PM +0100, Sudip Mukherjee wrote: > > > 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> > > > --- > > > > Hi Greg, > > You applied the second patch but not this one. Did I miss any review > > comments from you about this one? > > All of the other complaints about this patch were not sufficient for me > to justify ignoring it? Why would I not listen to them? This patch is doing what all the drm drivers are doing. So you want us to do something completely new rather than following the established practice of a drm driver? -- Regards Sudip
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-06-25 16:30 +0200 |
| Message-ID | <tWgI1-6aZ-5@gated-at.bofh.it> |
| In reply to | #1674222 |
On Sun, Jun 25, 2017 at 02:54:29PM +0100, Sudip Mukherjee wrote: > On Sun, Jun 25, 2017 at 02:54:51PM +0200, Greg Kroah-Hartman wrote: > > On Sun, Jun 25, 2017 at 01:43:34PM +0100, Sudip Mukherjee wrote: > > > On Mon, Jun 19, 2017 at 09:32:57PM +0100, Sudip Mukherjee wrote: > > > > 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> > > > > --- > > > > > > Hi Greg, > > > You applied the second patch but not this one. Did I miss any review > > > comments from you about this one? > > > > All of the other complaints about this patch were not sufficient for me > > to justify ignoring it? Why would I not listen to them? > > This patch is doing what all the drm drivers are doing. So you want > us to do something completely new rather than following the established > practice of a drm driver? I despise cargo-cult programming. You could not answer the "why", so why would I accept such a patch? greg k-h
[toc] | [prev] | [next] | [standalone]
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2017-06-25 17:10 +0200 |
| Message-ID | <tWhkK-6F0-17@gated-at.bofh.it> |
| In reply to | #1674225 |
On Sun, Jun 25, 2017 at 04:27:23PM +0200, Greg Kroah-Hartman wrote:
> On Sun, Jun 25, 2017 at 02:54:29PM +0100, Sudip Mukherjee wrote:
> > On Sun, Jun 25, 2017 at 02:54:51PM +0200, Greg Kroah-Hartman wrote:
> > > On Sun, Jun 25, 2017 at 01:43:34PM +0100, Sudip Mukherjee wrote:
> > > > On Mon, Jun 19, 2017 at 09:32:57PM +0100, Sudip Mukherjee wrote:
> > > > > 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>
> > > > > ---
> > > >
> > > > Hi Greg,
> > > > You applied the second patch but not this one. Did I miss any review
> > > > comments from you about this one?
> > >
> > > All of the other complaints about this patch were not sufficient for me
> > > to justify ignoring it? Why would I not listen to them?
> >
> > This patch is doing what all the drm drivers are doing. So you want
> > us to do something completely new rather than following the established
> > practice of a drm driver?
>
> I despise cargo-cult programming. You could not answer the "why", so
> why would I accept such a patch?
Did a quick research into "why".
The patch d8801e4df91e ("x86/PCI: Set IORESOURCE_ROM_SHADOW only for the
default VGA device") has started setting IORESOURCE_ROM_SHADOW in flags
for a default VGA device and that is being done only for x86.
And so, we will need that #ifdef to check IORESOURCE_ROM_SHADOW as that
needs to be checked only for a x86 and not for other arch.
--
Regards
Sudip
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-06-29 15:00 +0200 |
| Subject | Re: 答复: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb |
| Message-ID | <tXHd8-7Io-25@gated-at.bofh.it> |
| In reply to | #1674236 |
A: Top-posting. Q: What is the most annoying thing in e-mail? A: No. Q: Should I include quotations after my reply? http://daringfireball.net/2007/07/on_top On Wed, Jun 28, 2017 at 06:18:57AM +0000, Teddy Wang 王力强 wrote: > Hi Greg, > > Is the reason Sudip gave you for the question of "why" sufficient ? > This patch is very important for the driver running in the X86 platform. Without this patch, many SM750 graphic chip customers complain the Ubuntu OS can't run well. When they install the OS, the screen will be full of garbage in xorg. > Ubuntu 16.04.2 LTS and above will enable sm750 staging driver by default. We need this patch. Thanks. This patch is long-gone from my queue, it needs to be resent with the added information for me to be able to accept it. thanks, greg k-h
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web