History

fbdev: drop res_id parameter from remove_conflicting_pci_framebuffers

Since commit b0e999c95581 ("fbdev: list all pci memory bars as conflicting apertures") the parameter was used for some sanity checks only, to make sure we detect any issues with the new approach to just list all memory bars as apertures. No issues turned up so far, so continue to cleanup: Drop the res_id parameter, drop the sanity checks. Also downgrade the logging from "info" level to "debug" level and update documentation.

Gerd Hoffmann committed 7 years ago

Commit 0a845961 parent e26ae7c3 files · +7 −14Browse files

Unified · Split

3 files
  1. drivers/video/fbdev/core/fbmem.c +5 −12
  2. include/drm/drm_fb_helper.h +1 −1
  3. include/linux/fb.h +1 −1
drivers/video/fbdev/core/fbmem.c+5−12
@@ -1758,21 +1758,19 @@ EXPORT_SYMBOL(remove_conflicting_framebuffers); · 1757 unmodified lines
1758/**1758/**
1759 * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices1759 * remove_conflicting_pci_framebuffers - remove firmware-configured framebuffers for PCI devices
1760 * @pdev: PCI device1760 * @pdev: PCI device
1761 * @res_id: index of PCI BAR configuring framebuffer memory
1762 * @name: requesting driver name1761 * @name: requesting driver name
1763 *1762 *
1764 * This function removes framebuffer devices (eg. initialized by firmware)1763 * This function removes framebuffer devices (eg. initialized by firmware)
1765 * using memory range configured for @pdev's BAR @res_id.1764 * using memory range configured for any of @pdev's memory bars.
1766 *1765 *
1767 * The function assumes that PCI device with shadowed ROM drives a primary1766 * The function assumes that PCI device with shadowed ROM drives a primary
1768 * display and so kicks out vga16fb.1767 * display and so kicks out vga16fb.
1769 */1768 */
1770int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const char *name)1769int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, const char *name)
1771{1770{
1772 struct apertures_struct *ap;1771 struct apertures_struct *ap;
1773 bool primary = false;1772 bool primary = false;
1774 int err, idx, bar;1773 int err, idx, bar;
1775 bool res_id_found = false;
1776 1774
1777 for (idx = 0, bar = 0; bar < PCI_ROM_RESOURCE; bar++) {1775 for (idx = 0, bar = 0; bar < PCI_ROM_RESOURCE; bar++) {
1778 if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))1776 if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM))
@@ -1789,16 +1787,11 @@ int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id, const · 10 unmodified lines
1789 continue;1787 continue;
1790 ap->ranges[idx].base = pci_resource_start(pdev, bar);1788 ap->ranges[idx].base = pci_resource_start(pdev, bar);
1791 ap->ranges[idx].size = pci_resource_len(pdev, bar);1789 ap->ranges[idx].size = pci_resource_len(pdev, bar);
1792 pci_info(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,1790 pci_dbg(pdev, "%s: bar %d: 0x%lx -> 0x%lx\n", __func__, bar,
1793 (unsigned long)pci_resource_start(pdev, bar),1791 (unsigned long)pci_resource_start(pdev, bar),
1794 (unsigned long)pci_resource_end(pdev, bar));1792 (unsigned long)pci_resource_end(pdev, bar));
1795 idx++;1793 idx++;
1796 if (res_id == bar)
1797 res_id_found = true;
1798 }1794 }
1799 if (!res_id_found)
1800 pci_warn(pdev, "%s: passed res_id (%d) is not a memory bar\n",
1801 __func__, res_id);
1802 1795
1803#ifdef CONFIG_X861796#ifdef CONFIG_X86
1804 primary = pdev->resource[PCI_ROM_RESOURCE].flags &1797 primary = pdev->resource[PCI_ROM_RESOURCE].flags &
include/drm/drm_fb_helper.h+1−1
@@ -560,7 +560,7 @@ drm_fb_helper_remove_conflicting_pci_framebuffers(struct pci_dev *pdev, · 559 unmodified lines
560 * otherwise the vga fbdev driver falls over.560 * otherwise the vga fbdev driver falls over.
561 */561 */
562#if IS_REACHABLE(CONFIG_FB)562#if IS_REACHABLE(CONFIG_FB)
563 ret = remove_conflicting_pci_framebuffers(pdev, resource_id, name);563 ret = remove_conflicting_pci_framebuffers(pdev, name);
564#endif564#endif
565 if (ret == 0)565 if (ret == 0)
566 ret = vga_remove_vgacon(pdev);566 ret = vga_remove_vgacon(pdev);
include/linux/fb.h+1−1
@@ -607,7 +607,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf, · 606 unmodified lines
607extern int register_framebuffer(struct fb_info *fb_info);607extern int register_framebuffer(struct fb_info *fb_info);
608extern void unregister_framebuffer(struct fb_info *fb_info);608extern void unregister_framebuffer(struct fb_info *fb_info);
609extern void unlink_framebuffer(struct fb_info *fb_info);609extern void unlink_framebuffer(struct fb_info *fb_info);
610extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev, int res_id,610extern int remove_conflicting_pci_framebuffers(struct pci_dev *pdev,
611 const char *name);611 const char *name);
612extern int remove_conflicting_framebuffers(struct apertures_struct *a,612extern int remove_conflicting_framebuffers(struct apertures_struct *a,
613 const char *name, bool primary);613 const char *name, bool primary);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t