Daniel Vetter
2017-Nov-27 10:27 UTC
[PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()
On Fri, Nov 24, 2017 at 06:53:31PM +0100, Micha? Miros?aw wrote:> Almost all drivers using remove_conflicting_framebuffers() wrap it with > the same code. Extract common part from PCI drivers into separate > remove_conflicting_pci_framebuffers(). > > Signed-off-by: Micha? Miros?aw <mirq-linux at rere.qmqm.pl>Since the only driver that seems to use this is the staging one, which imo is a DOA project, not sure it's worth to bother with this here. -Daniel> --- > drivers/video/fbdev/core/fbmem.c | 22 ++++++++++++++++++++++ > include/drm/drm_fb_helper.h | 12 ++++++++++++ > include/linux/fb.h | 2 ++ > 3 files changed, 36 insertions(+) > > diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c > index 30a18d4c9de4..5ea980e5d3b7 100644 > --- a/drivers/video/fbdev/core/fbmem.c > +++ b/drivers/video/fbdev/core/fbmem.c > @@ -34,6 +34,7 @@ > #include <linux/fb.h> > #include <linux/fbcon.h> > #include <linux/mem_encrypt.h> > +#include <linux/pci.h> > > #include <asm/fb.h> > > @@ -1788,6 +1789,27 @@ int remove_conflicting_framebuffers(struct apertures_struct *a, > } > EXPORT_SYMBOL(remove_conflicting_framebuffers); > > +int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name) > +{ > + struct apertures_struct *ap; > + bool primary = false; > + > + ap = alloc_apertures(1); > + if (!ap) > + return -ENOMEM; > + > + ap->ranges[0].base = pci_resource_start(pdev, res_id); > + ap->ranges[0].size = pci_resource_len(pdev, res_id); > +#ifdef CONFIG_X86 > + primary = pdev->resource[PCI_ROM_RESOURCE].flags & > + IORESOURCE_ROM_SHADOW; > +#endif > + remove_conflicting_framebuffers(ap, name, primary); > + kfree(ap); > + return 0; > +} > +EXPORT_SYMBOL(remove_conflicting_pci_framebuffers); > + > /** > * register_framebuffer - registers a frame buffer device > * @fb_info: frame buffer info structure > diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h > index 33fe95927742..ac3412290289 100644 > --- a/include/drm/drm_fb_helper.h > +++ b/include/drm/drm_fb_helper.h > @@ -520,4 +520,16 @@ drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a, > #endif > } > > +static inline int > +drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev, > + int resource_id, > + const char *name) > +{ > +#if IS_REACHABLE(CONFIG_FB) > + return remove_conflicting_pci_framebuffers(pdev, resource_id, name); > +#else > + return 0; > +#endif > +} > + > #endif > diff --git a/include/linux/fb.h b/include/linux/fb.h > index f4386b0ccf40..4196cb09e58e 100644 > --- a/include/linux/fb.h > +++ b/include/linux/fb.h > @@ -624,6 +624,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, > extern int register_framebuffer(struct fb_info *fb_info); > extern int unregister_framebuffer(struct fb_info *fb_info); > extern int unlink_framebuffer(struct fb_info *fb_info); > +extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, > + const char *name); > extern int remove_conflicting_framebuffers(struct apertures_struct *a, > const char *name, bool primary); > extern int fb_prepare_logo(struct fb_info *fb_info, int rotate); > -- > 2.11.0 > > _______________________________________________ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel-- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Sudip Mukherjee
2017-Nov-27 20:52 UTC
[PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()
On Mon, Nov 27, 2017 at 11:27:59AM +0100, Daniel Vetter wrote:> On Fri, Nov 24, 2017 at 06:53:31PM +0100, Micha? Miros?aw wrote: > > Almost all drivers using remove_conflicting_framebuffers() wrap it with > > the same code. Extract common part from PCI drivers into separate > > remove_conflicting_pci_framebuffers(). > > > > Signed-off-by: Micha? Miros?aw <mirq-linux at rere.qmqm.pl> > > Since the only driver that seems to use this is the staging one, which imo > is a DOA project, not sure it's worth to bother with this here.afaik, this device is used in production by few manufacturers and it is usefull for them to have it in the tree and the only reason it is still in staging is because Tomi announced he will not take any new drivers in fbdev. And, so I have not taken the initiative to properly move it out of staging. I think Bartlomiej will also not accept new drivers in fbdev. -- Regards Sudip
Daniel Vetter
2017-Nov-28 10:22 UTC
[PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()
On Mon, Nov 27, 2017 at 08:52:19PM +0000, Sudip Mukherjee wrote:> On Mon, Nov 27, 2017 at 11:27:59AM +0100, Daniel Vetter wrote: > > On Fri, Nov 24, 2017 at 06:53:31PM +0100, Micha? Miros?aw wrote: > > > Almost all drivers using remove_conflicting_framebuffers() wrap it with > > > the same code. Extract common part from PCI drivers into separate > > > remove_conflicting_pci_framebuffers(). > > > > > > Signed-off-by: Micha? Miros?aw <mirq-linux at rere.qmqm.pl> > > > > Since the only driver that seems to use this is the staging one, which imo > > is a DOA project, not sure it's worth to bother with this here. > > afaik, this device is used in production by few manufacturers and it is > usefull for them to have it in the tree and the only reason it is still > in staging is because Tomi announced he will not take any new drivers in > fbdev. And, so I have not taken the initiative to properly move it out > of staging. I think Bartlomiej will also not accept new drivers in fbdev.Imo, if no one cares about porting it to kms (which will give you an fbdev driver for free), then we should throw it out. At least I thought staging was only for stuff that had a reasonable chance to get mainlined. Not as a dumping ground for drivers that people use, but don't bother to get ready for mainline. Greg? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Possibly Parallel Threads
- [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()
- [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()
- [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()
- [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()
- [PATCH 02/13] fbdev: add remove_conflicting_pci_framebuffers()