Skip to contentSkip to conversation

build fixes to make fbdev optional

PATCH In review Daniel Vetter 3 participants 8 messages Aug 10, 2016 – Aug 12, 2016

Subsystems (19)
lore
Share & tools
lore
#0 lore raw

cover build fixes to make fbdev optional

0-day has been annoying me lately with a constant trickle of build failures with a few drivers when DRM_FBDEV_EMULATION is not set. This series here should fix them all I hope.
-Daniel

Daniel Vetter (5):
drm/fb-helper: Add a dummy remove_conflicting_framebuffers
drm: Remove superflous linux/fb.h includes drm/vmwgfx: select CONFIG_FB
drm/radeon|amgpu: Make fbdev emulation optional
drm: Protect fb_defio in drivers with CONFIG_KMS_FBDEV_EMULATION

 drivers/gpu/drm/Kconfig                                    |  8 --------
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c                    |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c                     |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c           |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c      |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c           |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c          |  1 -
 .../gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c    |  1 -
 drivers/gpu/drm/armada/armada_fbdev.c                      |  1 -
 drivers/gpu/drm/ast/ast_fb.c                               |  1 -
 drivers/gpu/drm/bochs/bochs.h                              |  1 -
 drivers/gpu/drm/bochs/bochs_drv.c                          |  3 ++-
 drivers/gpu/drm/bridge/parade-ps8622.c                     |  1 -
 drivers/gpu/drm/cirrus/cirrus_drv.c                        |  2 +-
 drivers/gpu/drm/cirrus/cirrus_fbdev.c                      |  2 --
 drivers/gpu/drm/drm_fb_helper.c                            |  1 -
 drivers/gpu/drm/gma500/accel_2d.c                          |  1 -
 drivers/gpu/drm/gma500/framebuffer.c                       |  1 -
 drivers/gpu/drm/gma500/psb_intel_modes.c                   |  1 -
 drivers/gpu/drm/i915/i915_drv.c                            |  2 +-
 drivers/gpu/drm/i915/intel_fbdev.c                         |  1 -
 drivers/gpu/drm/i915/intel_modes.c                         |  1 -
 drivers/gpu/drm/imx/imx-drm-core.c                         |  1 -
 drivers/gpu/drm/imx/ipuv3-crtc.c                           |  1 -
 drivers/gpu/drm/mgag200/mgag200_drv.c                      |  2 +-
 drivers/gpu/drm/mgag200/mgag200_fb.c                       |  2 --
 drivers/gpu/drm/mgag200/mgag200_main.c                     |  2 +-
 drivers/gpu/drm/nouveau/nouveau_drm.c                      |  2 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c                    |  1 -
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c            |  1 -
 drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c    |  1 -
 drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c    |  1 -
 drivers/gpu/drm/qxl/qxl_fb.c                               |  5 ++++-
 drivers/gpu/drm/radeon/radeon_drv.c                        |  3 ++-
 drivers/gpu/drm/radeon/radeon_fb.c                         |  3 +--
 drivers/gpu/drm/sun4i/sun4i_drv.c                          |  3 ++-
 drivers/gpu/drm/udl/udl_fb.c                               |  4 ++++
 drivers/gpu/drm/vc4/vc4_drv.c                              |  3 ++-
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c                   |  3 ++-
 drivers/gpu/drm/vmwgfx/Kconfig                             |  1 +
 include/drm/drm_fb_helper.h                                | 14 ++++++++++++++
 41 files changed, 40 insertions(+), 48 deletions(-)
Signature · 6 lines
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 1/5 drm/fb-helper: Add a dummy remove_conflicting_framebuffers

Lots of drivers don't properly compile without this when CONFIG_FB=n. It's kinda a hack, but since CONFIG_FB doesn't stub any fucntions when it's disabled I think it makes sense to add it to drm_fb_helper.h.

Long term we probably need to rethink all the logic to unload firmware framebuffer drivers, at least if we want to be able to move away from CONFIG_FB and fbcon.

v2: Unfortunately just stubbing out remove_conflicting_framebuffers in drm_fb_helper.h upset gcc about static vs. non-static declarations, so a new wrapper it needs to be. Means more churn :(

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c  |  2 +-
 drivers/gpu/drm/bochs/bochs_drv.c        |  3 ++-
 drivers/gpu/drm/cirrus/cirrus_drv.c      |  2 +-
 drivers/gpu/drm/i915/i915_drv.c          |  2 +-
 drivers/gpu/drm/mgag200/mgag200_drv.c    |  2 +-
 drivers/gpu/drm/mgag200/mgag200_main.c   |  2 +-
 drivers/gpu/drm/nouveau/nouveau_drm.c    |  2 +-
 drivers/gpu/drm/radeon/radeon_drv.c      |  3 ++-
 drivers/gpu/drm/sun4i/sun4i_drv.c        |  3 ++-
 drivers/gpu/drm/vc4/vc4_drv.c            |  3 ++-
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c |  3 ++-
 include/drm/drm_fb_helper.h              | 14 ++++++++++++++
 12 files changed, 30 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 -1
index 9aa533cf4ad1..11263c5b9967 100644
@@ -341,7 +341,7 @@ static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev)
 #ifdef CONFIG_X86
 	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
 #endif
-	remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary);
+	drm_fb_helper_remove_conflicting_framebuffers(ap, "amdgpudrmfb", primary);
 	kfree(ap);
 
 	return 0;
drivers/gpu/drm/bochs/bochs_drv.c +2 -1
index abace82de6ea..277654abe0f7 100644
@@ -8,6 +8,7 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <drm/drm_fb_helper.h>
 
 #include "bochs.h"
 
@@ -153,7 +154,7 @@ static int bochs_kick_out_firmware_fb(struct pci_dev *pdev)
 
 	ap->ranges[0].base = pci_resource_start(pdev, 0);
 	ap->ranges[0].size = pci_resource_len(pdev, 0);
-	remove_conflicting_framebuffers(ap, "bochsdrmfb", false);
+	drm_fb_helper_remove_conflicting_framebuffers(ap, "bochsdrmfb", false);
 	kfree(ap);
 
 	return 0;
drivers/gpu/drm/cirrus/cirrus_drv.c +1 -1
index b05f7eae32ce..6c76d125995b 100644
@@ -57,7 +57,7 @@ static int cirrus_kick_out_firmware_fb(struct pci_dev *pdev)
 #ifdef CONFIG_X86
 	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
 #endif
-	remove_conflicting_framebuffers(ap, "cirrusdrmfb", primary);
+	drm_fb_helper_remove_conflicting_framebuffers(ap, "cirrusdrmfb", primary);
 	kfree(ap);
 
 	return 0;
drivers/gpu/drm/i915/i915_drv.c +1 -1
index 0fcd1c0f67bb..d82f96b2a47e 100644
@@ -685,7 +685,7 @@ static int i915_kick_out_firmware_fb(struct drm_i915_private *dev_priv)
 	primary =
 		pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
 
-	ret = remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
+	ret = drm_fb_helper_remove_conflicting_framebuffers(ap, "inteldrmfb", primary);
 
 	kfree(ap);
 
drivers/gpu/drm/mgag200/mgag200_drv.c +1 -1
index 2b4b125eebc3..1443b3a34775 100644
@@ -56,7 +56,7 @@ static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev)
 #ifdef CONFIG_X86
 	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
 #endif
-	remove_conflicting_framebuffers(ap, "mgag200drmfb", primary);
+	drm_fb_helper_remove_conflicting_framebuffers(ap, "mgag200drmfb", primary);
 	kfree(ap);
 }
 
drivers/gpu/drm/mgag200/mgag200_main.c +1 -1
index 13798b3e6beb..e79cbc25ae3c 100644
@@ -135,7 +135,7 @@ static int mga_vram_init(struct mga_device *mdev)
 	aper->ranges[0].base = mdev->mc.vram_base;
 	aper->ranges[0].size = mdev->mc.vram_window;
 
-	remove_conflicting_framebuffers(aper, "mgafb", true);
+	drm_fb_helper_remove_conflicting_framebuffers(aper, "mgafb", true);
 	kfree(aper);
 
 	if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window,
drivers/gpu/drm/nouveau/nouveau_drm.c +1 -1
index 66c1280c0f1f..652ab111dd74 100644
@@ -351,7 +351,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
 	boot = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
 #endif
 	if (nouveau_modeset != 2)
-		remove_conflicting_framebuffers(aper, "nouveaufb", boot);
+		drm_fb_helper_remove_conflicting_framebuffers(aper, "nouveaufb", boot);
 	kfree(aper);
 
 	ret = nvkm_device_pci_new(pdev, nouveau_config, nouveau_debug,
drivers/gpu/drm/radeon/radeon_drv.c +2 -1
index c01a7c6abb49..90f2ff217b31 100644
@@ -39,6 +39,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/vga_switcheroo.h>
 #include <drm/drm_gem.h>
+#include <drm/drm_fb_helper.h>
 
 #include "drm_crtc_helper.h"
 #include "radeon_kfd.h"
@@ -324,7 +325,7 @@ static int radeon_kick_out_firmware_fb(struct pci_dev *pdev)
 #ifdef CONFIG_X86
 	primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
 #endif
-	remove_conflicting_framebuffers(ap, "radeondrmfb", primary);
+	drm_fb_helper_remove_conflicting_framebuffers(ap, "radeondrmfb", primary);
 	kfree(ap);
 
 	return 0;
drivers/gpu/drm/sun4i/sun4i_drv.c +2 -1
index 7092daaf6c43..8913c151b37f 100644
@@ -17,6 +17,7 @@
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_fb_helper.h>
 
 #include "sun4i_crtc.h"
 #include "sun4i_drv.h"
@@ -109,7 +110,7 @@ static void sun4i_remove_framebuffers(void)
 	ap->ranges[0].base = 0;
 	ap->ranges[0].size = ~0;
 
-	remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false);
+	drm_fb_helper_remove_conflicting_framebuffers(ap, "sun4i-drm-fb", false);
 	kfree(ap);
 }
 
drivers/gpu/drm/vc4/vc4_drv.c +2 -1
index 8b42d31a7f0e..deec53545bea 100644
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include "drm_fb_cma_helper.h"
+#include <drm/drm_fb_helper.h>
 
 #include "uapi/drm/vc4_drm.h"
 #include "vc4_drv.h"
@@ -214,7 +215,7 @@ static void vc4_kick_out_firmware_fb(void)
 	ap->ranges[0].base = 0;
 	ap->ranges[0].size = ~0;
 
-	remove_conflicting_framebuffers(ap, "vc4drmfb", false);
+	drm_fb_helper_remove_conflicting_framebuffers(ap, "vc4drmfb", false);
 	kfree(ap);
 }
 
drivers/gpu/drm/virtio/virtgpu_drm_bus.c +2 -1
index 7f0e93f87a55..a59d0e309bfc 100644
@@ -24,6 +24,7 @@
  */
 
 #include <linux/pci.h>
+#include <drm/drm_fb_helper.h>
 
 #include "virtgpu_drv.h"
 
@@ -42,7 +43,7 @@ static void virtio_pci_kick_out_firmware_fb(struct pci_dev *pci_dev)
 	primary = pci_dev->resource[PCI_ROM_RESOURCE].flags
 		& IORESOURCE_ROM_SHADOW;
 
-	remove_conflicting_framebuffers(ap, "virtiodrmfb", primary);
+	drm_fb_helper_remove_conflicting_framebuffers(ap, "virtiodrmfb", primary);
 
 	kfree(ap);
 }
include/drm/drm_fb_helper.h +14 -0
index 504124363088..97889a90ff23 100644
@@ -32,6 +32,7 @@
 
 struct drm_fb_helper;
 
+#include <drm/drm_crtc.h>
 #include <linux/kgdb.h>
 
 enum mode_set_atomic {
@@ -281,6 +282,12 @@ drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn,
 int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_connector *connector);
 int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
 				       struct drm_connector *connector);
+static inline int
+drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
+					      const char *name, bool primary)
+{
+	return remove_conflicting_framebuffers(a, name, primary);
+}
 #else
 static inline int drm_fb_helper_modinit(void)
 {
@@ -474,5 +481,12 @@ drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
 {
 	return 0;
 }
+
+static inline int
+drm_fb_helper_remove_conflicting_framebuffers(struct apertures_struct *a,
+					      const char *name, bool primary)
+{
+	return 0;
+}
 #endif
 #endif
Signature · 6 lines
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH 2/5 drm: Remove superflous linux/fb.h includes

In reply to Daniel Vetter

Everyone who uses the fbdev emulation helpers doesn't need to include fb.h directly. Remove it.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c                      | 1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c            | 1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c       | 1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c            | 1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c           | 1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c | 1 -
 drivers/gpu/drm/armada/armada_fbdev.c                       | 1 -
 drivers/gpu/drm/ast/ast_fb.c                                | 1 -
 drivers/gpu/drm/bochs/bochs.h                               | 1 -
 drivers/gpu/drm/bridge/parade-ps8622.c                      | 1 -
 drivers/gpu/drm/cirrus/cirrus_fbdev.c                       | 2 --
 drivers/gpu/drm/drm_fb_helper.c                             | 1 -
 drivers/gpu/drm/gma500/accel_2d.c                           | 1 -
 drivers/gpu/drm/gma500/framebuffer.c                        | 1 -
 drivers/gpu/drm/gma500/psb_intel_modes.c                    | 1 -
 drivers/gpu/drm/i915/intel_fbdev.c                          | 1 -
 drivers/gpu/drm/i915/intel_modes.c                          | 1 -
 drivers/gpu/drm/imx/imx-drm-core.c                          | 1 -
 drivers/gpu/drm/imx/ipuv3-crtc.c                            | 1 -
 drivers/gpu/drm/mgag200/mgag200_fb.c                        | 2 --
 drivers/gpu/drm/nouveau/nouveau_fbcon.c                     | 1 -
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c             | 1 -
 drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c     | 1 -
 drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c     | 1 -
 drivers/gpu/drm/qxl/qxl_fb.c                                | 1 -
 drivers/gpu/drm/radeon/radeon_fb.c                          | 1 -
 26 files changed, 28 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -1
index 919146780a15..bf033b58056c 100644
@@ -25,7 +25,6 @@
  */
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/fb.h>
 
 #include <drm/drmP.h>
 #include <drm/drm_crtc.h>
drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c +0 -1
index 120a9e2c3152..6483d680bbc8 100644
@@ -22,7 +22,6 @@
  */
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/fb.h>
 #include "linux/delay.h"
 
 #include "hwmgr.h"
drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c +0 -1
index 769636a0c5b5..783dcc3384f1 100644
@@ -22,7 +22,6 @@
  */
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/fb.h>
 #include <asm/div64.h>
 #include "linux/delay.h"
 #include "pp_acpi.h"
drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c +0 -1
index 26f3e30d0fef..1126bd4f74dc 100644
@@ -22,7 +22,6 @@
  */
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/fb.h>
 
 #include "ppatomctrl.h"
 #include "atombios.h"
drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c +0 -1
index c7dc111221c2..7dc4afd19d26 100644
@@ -22,7 +22,6 @@
  */
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/fb.h>
 #include "linux/delay.h"
 #include "pp_acpi.h"
 #include "hwmgr.h"
drivers/gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c +0 -1
index cfb647f76cbe..a0ffd4a73d8c 100644
@@ -22,7 +22,6 @@
  */
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/fb.h>
 
 #include "tonga_processpptables.h"
 #include "ppatomctrl.h"
drivers/gpu/drm/armada/armada_fbdev.c +0 -1
index 7d03c51abcb9..ca73ad8614fe 100644
@@ -7,7 +7,6 @@
  * published by the Free Software Foundation.
  */
 #include <linux/errno.h>
-#include <linux/fb.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 
drivers/gpu/drm/ast/ast_fb.c +0 -1
index c017a9330a18..7a86e24e2687 100644
@@ -33,7 +33,6 @@
 #include <linux/tty.h>
 #include <linux/sysrq.h>
 #include <linux/delay.h>
-#include <linux/fb.h>
 #include <linux/init.h>
 
 
drivers/gpu/drm/bochs/bochs.h +0 -1
index 19b5adaebe24..32dfe418cc98 100644
@@ -1,5 +1,4 @@
 #include <linux/io.h>
-#include <linux/fb.h>
 #include <linux/console.h>
 
 #include <drm/drmP.h>
drivers/gpu/drm/bridge/parade-ps8622.c +0 -1
index 583b8ce614e3..f1b39a2645cc 100644
@@ -16,7 +16,6 @@
 #include <linux/backlight.h>
 #include <linux/delay.h>
 #include <linux/err.h>
-#include <linux/fb.h>
 #include <linux/gpio.h>
 #include <linux/gpio/consumer.h>
 #include <linux/i2c.h>
drivers/gpu/drm/cirrus/cirrus_fbdev.c +0 -2
index 3b5be7272357..daecf1ad76a4 100644
@@ -13,8 +13,6 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_crtc_helper.h>
 
-#include <linux/fb.h>
-
 #include "cirrus_drv.h"
 
 static void cirrus_dirty_update(struct cirrus_fbdev *afbdev,
drivers/gpu/drm/drm_fb_helper.c +0 -1
index 822821c355ab..c0d1066ea419 100644
@@ -32,7 +32,6 @@
 #include <linux/kernel.h>
 #include <linux/sysrq.h>
 #include <linux/slab.h>
-#include <linux/fb.h>
 #include <linux/module.h>
 #include <drm/drmP.h>
 #include <drm/drm_crtc.h>
drivers/gpu/drm/gma500/accel_2d.c +0 -1
index db9f7d011832..0d2bb1682508 100644
@@ -28,7 +28,6 @@
 #include <linux/tty.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
-#include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/console.h>
 
drivers/gpu/drm/gma500/framebuffer.c +0 -1
index 0fcdce0817de..3a44e705db53 100644
@@ -26,7 +26,6 @@
 #include <linux/tty.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
-#include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/console.h>
 
drivers/gpu/drm/gma500/psb_intel_modes.c +0 -1
index 4fca0d6feebe..e5360726d80b 100644
@@ -18,7 +18,6 @@
  */
 
 #include <linux/i2c.h>
-#include <linux/fb.h>
 #include <drm/drmP.h>
 #include "psb_intel_drv.h"
 
drivers/gpu/drm/i915/intel_fbdev.c +0 -1
index 82bf282a4ff4..2c14dfc5e4f0 100644
@@ -34,7 +34,6 @@
 #include <linux/tty.h>
 #include <linux/sysrq.h>
 #include <linux/delay.h>
-#include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/vga_switcheroo.h>
 
drivers/gpu/drm/i915/intel_modes.c +0 -1
index f2584d0a01ab..951e834dd274 100644
@@ -25,7 +25,6 @@
 
 #include <linux/slab.h>
 #include <linux/i2c.h>
-#include <linux/fb.h>
 #include <drm/drm_edid.h>
 #include <drm/drmP.h>
 #include "intel_drv.h"
drivers/gpu/drm/imx/imx-drm-core.c +0 -1
index 9f7dafce3a4c..0f579206489a 100644
@@ -16,7 +16,6 @@
 #include <linux/component.h>
 #include <linux/device.h>
 #include <linux/dma-buf.h>
-#include <linux/fb.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/reservation.h>
drivers/gpu/drm/imx/ipuv3-crtc.c +0 -1
index 08e188bc10fc..0e85fb04596b 100644
@@ -21,7 +21,6 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc_helper.h>
-#include <linux/fb.h>
 #include <linux/clk.h>
 #include <linux/errno.h>
 #include <drm/drm_gem_cma_helper.h>
drivers/gpu/drm/mgag200/mgag200_fb.c +0 -2
index d9b04b008feb..81325f64134f 100644
@@ -15,8 +15,6 @@
 #include <drm/drm_fb_helper.h>
 #include <drm/drm_crtc_helper.h>
 
-#include <linux/fb.h>
-
 #include "mgag200_drv.h"
 
 static void mga_dirty_update(struct mga_fbdev *mfbdev,
drivers/gpu/drm/nouveau/nouveau_fbcon.c +0 -1
index d1f248fd3506..9f5692726c16 100644
@@ -32,7 +32,6 @@
 #include <linux/tty.h>
 #include <linux/sysrq.h>
 #include <linux/delay.h>
-#include <linux/fb.h>
 #include <linux/init.h>
 #include <linux/screen_info.h>
 #include <linux/vga_switcheroo.h>
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +0 -1
index 0eae8afaed90..b1f3b818edf4 100644
@@ -13,7 +13,6 @@
 
 #include <linux/backlight.h>
 #include <linux/delay.h>
-#include <linux/fb.h>
 #include <linux/gpio/consumer.h>
 #include <linux/interrupt.h>
 #include <linux/jiffies.h>
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +0 -1
index fc4c238c9583..9f3d6f48f3e1 100644
@@ -14,7 +14,6 @@
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/spi/spi.h>
-#include <linux/fb.h>
 #include <linux/gpio/consumer.h>
 #include <linux/of_gpio.h>
 
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +0 -1
index 157c512205d1..3557a4c7dd7b 100644
@@ -28,7 +28,6 @@
 #include <linux/jiffies.h>
 #include <linux/sched.h>
 #include <linux/backlight.h>
-#include <linux/fb.h>
 #include <linux/gpio/consumer.h>
 #include <linux/of.h>
 #include <linux/of_gpio.h>
drivers/gpu/drm/qxl/qxl_fb.c +0 -1
index df2657051afd..a0831c42c073 100644
@@ -24,7 +24,6 @@
  *     David Airlie
  */
 #include <linux/module.h>
-#include <linux/fb.h>
 
 #include "drmP.h"
 #include "drm/drm.h"
drivers/gpu/drm/radeon/radeon_fb.c +0 -1
index 0e3143acb565..51284e882e94 100644
@@ -25,7 +25,6 @@
  */
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/fb.h>
 
 #include <drm/drmP.h>
 #include <drm/drm_crtc.h>
Signature · 6 lines
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

PATCH 3/5 drm/vmwgfx: select CONFIG_FB

In reply to Daniel Vetter

vmwgfx doesn't actually build without that.

It would be great if vmwgfx could switch over to the fbdev emulation helpers, since those will take care of all this already. I guess one reason to not do that was lack of defio support in the helpers, but that's fixed now. If there's any other hold-up, we should figure out what it is and whether it makes sense to address it.

Cc Sinclair Yeh <[email protected]>
Cc Thomas Hellstrom <[email protected]>
---
 drivers/gpu/drm/vmwgfx/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/vmwgfx/Kconfig +1 -0
index b49445df8a7e..fb7b82aad763 100644
@@ -6,6 +6,7 @@ config DRM_VMWGFX
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	select DRM_TTM
+	select FB
 	# Only needed for the transitional use of drm_crtc_init - can be removed
 	# again once vmwgfx sets up the primary plane itself.
 	select DRM_KMS_HELPER
Signature · 6 lines
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 4/5 drm/radeon|amgpu: Make fbdev emulation optional

In reply to Daniel Vetter

Seems to at least compile fine, only change needed was to use the fb_set_suspend helper.

---
 drivers/gpu/drm/Kconfig            | 8 --------
 drivers/gpu/drm/radeon/radeon_fb.c | 2 +-
 2 files changed, 1 insertion(+), 9 deletions(-)
drivers/gpu/drm/Kconfig +0 -8
index fc357319de35..fe1e86ea6d27 100644
@@ -129,12 +129,8 @@ config DRM_R128
 config DRM_RADEON
 	tristate "ATI Radeon"
 	depends on DRM && PCI
-	select FB_CFB_FILLRECT
-	select FB_CFB_COPYAREA
-	select FB_CFB_IMAGEBLIT
 	select FW_LOADER
         select DRM_KMS_HELPER
-	select DRM_KMS_FB_HELPER
         select DRM_TTM
 	select POWER_SUPPLY
 	select HWMON
@@ -153,12 +149,8 @@ source "drivers/gpu/drm/radeon/Kconfig"
 config DRM_AMDGPU
 	tristate "AMD GPU"
 	depends on DRM && PCI
-	select FB_CFB_FILLRECT
-	select FB_CFB_COPYAREA
-	select FB_CFB_IMAGEBLIT
 	select FW_LOADER
         select DRM_KMS_HELPER
-	select DRM_KMS_FB_HELPER
         select DRM_TTM
 	select POWER_SUPPLY
 	select HWMON
drivers/gpu/drm/radeon/radeon_fb.c +1 -1
index 51284e882e94..568e036d547e 100644
@@ -382,7 +382,7 @@ void radeon_fbdev_fini(struct radeon_device *rdev)
 void radeon_fbdev_set_suspend(struct radeon_device *rdev, int state)
 {
 	if (rdev->mode_info.rfbdev)
-		fb_set_suspend(rdev->mode_info.rfbdev->helper.fbdev, state);
+		drm_fb_helper_set_suspend(&rdev->mode_info.rfbdev->helper, state);
 }
 
 bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo *robj)
Signature · 6 lines
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

PATCH 5/5 drm: Protect fb_defio in drivers with CONFIG_KMS_FBDEV_EMULATION

In reply to Daniel Vetter

For reasons that entirely elude me fb.h exposes all the structures, even when it is not enabled. Except for special stuff like fb_defio.

Which means all the drivers which haven't yet switched over to the defio support in the helpers and still roll their own, will fail to compile when fbdev emulation is disabled. Protect just those bits, as a gnarly reminder that conversion to the core defio helpers would be good.

---
 drivers/gpu/drm/qxl/qxl_fb.c | 4 ++++
 drivers/gpu/drm/udl/udl_fb.c | 4 ++++
 2 files changed, 8 insertions(+)
drivers/gpu/drm/qxl/qxl_fb.c +4 -0
index a0831c42c073..2cd879a4ae15 100644
@@ -72,10 +72,12 @@ static void qxl_fb_image_init(struct qxl_fb_image *qxl_fb_image,
 	}
 }
 
+#ifdef CONFIG_DRM_FBDEV_EMULATION
 static struct fb_deferred_io qxl_defio = {
 	.delay		= QXL_DIRTY_DELAY,
 	.deferred_io	= drm_fb_helper_deferred_io,
 };
+#endif
 
 static struct fb_ops qxlfb_ops = {
 	.owner = THIS_MODULE,
@@ -312,8 +314,10 @@ static int qxlfb_create(struct qxl_fbdev *qfbdev,
 		goto out_destroy_fbi;
 	}
 
+#ifdef CONFIG_DRM_FBDEV_EMULATION
 	info->fbdefio = &qxl_defio;
 	fb_deferred_io_init(info);
+#endif
 
 	qdev->fbdev_info = info;
 	qdev->fbdev_qfb = &qfbdev->qfb;
drivers/gpu/drm/udl/udl_fb.c +4 -0
index d5df555aeba0..9688bfa92ccd 100644
@@ -203,6 +203,7 @@ static int udl_fb_open(struct fb_info *info, int user)
 
 	ufbdev->fb_count++;
 
+#ifdef CONFIG_DRM_FBDEV_EMULATION
 	if (fb_defio && (info->fbdefio == NULL)) {
 		/* enable defio at last moment if not disabled by client */
 
@@ -218,6 +219,7 @@ static int udl_fb_open(struct fb_info *info, int user)
 		info->fbdefio = fbdefio;
 		fb_deferred_io_init(info);
 	}
+#endif
 
 	pr_notice("open /dev/fb%d user=%d fb_info=%p count=%d\n",
 		  info->node, user, info, ufbdev->fb_count);
@@ -235,12 +237,14 @@ static int udl_fb_release(struct fb_info *info, int user)
 
 	ufbdev->fb_count--;
 
+#ifdef CONFIG_DRM_FBDEV_EMULATION
 	if ((ufbdev->fb_count == 0) && (info->fbdefio)) {
 		fb_deferred_io_cleanup(info);
 		kfree(info->fbdefio);
 		info->fbdefio = NULL;
 		info->fbops->fb_mmap = udl_fb_mmap;
 	}
+#endif
 
 	pr_warn("released /dev/fb%d user=%d count=%d\n",
 		info->node, user, ufbdev->fb_count);
Signature · 6 lines
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on the v1 series
#6 lore raw
In reply to Daniel Vetter
Quoted 11 lines · Daniel Vetter

0-day has been annoying me lately with a constant trickle of build failures with a few drivers when DRM_FBDEV_EMULATION is not set. This series here should fix them all I hope.
-Daniel

Daniel Vetter (5):
drm/fb-helper: Add a dummy remove_conflicting_framebuffers
drm: Remove superflous linux/fb.h includes drm/vmwgfx: select CONFIG_FB
drm/radeon|amgpu: Make fbdev emulation optional
drm: Protect fb_defio in drivers with CONFIG_KMS_FBDEV_EMULATION

For the series:

Quoted 44 lines
 drivers/gpu/drm/Kconfig                                    |  8 --------
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c                    |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c                     |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c           |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c      |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c           |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c          |  1 -
 .../gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c    |  1 -
 drivers/gpu/drm/armada/armada_fbdev.c                      |  1 -
 drivers/gpu/drm/ast/ast_fb.c                               |  1 -
 drivers/gpu/drm/bochs/bochs.h                              |  1 -
 drivers/gpu/drm/bochs/bochs_drv.c                          |  3 ++-
 drivers/gpu/drm/bridge/parade-ps8622.c                     |  1 -
 drivers/gpu/drm/cirrus/cirrus_drv.c                        |  2 +-
 drivers/gpu/drm/cirrus/cirrus_fbdev.c                      |  2 --
 drivers/gpu/drm/drm_fb_helper.c                            |  1 -
 drivers/gpu/drm/gma500/accel_2d.c                          |  1 -
 drivers/gpu/drm/gma500/framebuffer.c                       |  1 -
 drivers/gpu/drm/gma500/psb_intel_modes.c                   |  1 -
 drivers/gpu/drm/i915/i915_drv.c                            |  2 +-
 drivers/gpu/drm/i915/intel_fbdev.c                         |  1 -
 drivers/gpu/drm/i915/intel_modes.c                         |  1 -
 drivers/gpu/drm/imx/imx-drm-core.c                         |  1 -
 drivers/gpu/drm/imx/ipuv3-crtc.c                           |  1 -
 drivers/gpu/drm/mgag200/mgag200_drv.c                      |  2 +-
 drivers/gpu/drm/mgag200/mgag200_fb.c                       |  2 --
 drivers/gpu/drm/mgag200/mgag200_main.c                     |  2 +-
 drivers/gpu/drm/nouveau/nouveau_drm.c                      |  2 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c                    |  1 -
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c            |  1 -
 drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c    |  1 -
 drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c    |  1 -
 drivers/gpu/drm/qxl/qxl_fb.c                               |  5 ++++-
 drivers/gpu/drm/radeon/radeon_drv.c                        |  3 ++-
 drivers/gpu/drm/radeon/radeon_fb.c                         |  3 +--
 drivers/gpu/drm/sun4i/sun4i_drv.c                          |  3 ++-
 drivers/gpu/drm/udl/udl_fb.c                               |  4 ++++
 drivers/gpu/drm/vc4/vc4_drv.c                              |  3 ++-
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c                   |  3 ++-
 drivers/gpu/drm/vmwgfx/Kconfig                             |  1 +
 include/drm/drm_fb_helper.h                                | 14 ++++++++++++++
 41 files changed, 40 insertions(+), 48 deletions(-)
Quoted 7 lines

--
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
Quoted 13 lines · Alex Deucher
Quoted 11 lines · Daniel Vetter

0-day has been annoying me lately with a constant trickle of build failures with a few drivers when DRM_FBDEV_EMULATION is not set. This series here should fix them all I hope.
-Daniel

Daniel Vetter (5):
drm/fb-helper: Add a dummy remove_conflicting_framebuffers
drm: Remove superflous linux/fb.h includes drm/vmwgfx: select CONFIG_FB
drm/radeon|amgpu: Make fbdev emulation optional
drm: Protect fb_defio in drivers with CONFIG_KMS_FBDEV_EMULATION

Quoted 2 lines

For the series:

Thanks for the review, all applied to drm-misc.
-Daniel

Quoted 52 lines
Quoted 52 lines

 drivers/gpu/drm/Kconfig                                    |  8 --------
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c                    |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c                     |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c           |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c      |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/ppatomctrl.c           |  1 -
 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c          |  1 -
 .../gpu/drm/amd/powerplay/hwmgr/tonga_processpptables.c    |  1 -
 drivers/gpu/drm/armada/armada_fbdev.c                      |  1 -
 drivers/gpu/drm/ast/ast_fb.c                               |  1 -
 drivers/gpu/drm/bochs/bochs.h                              |  1 -
 drivers/gpu/drm/bochs/bochs_drv.c                          |  3 ++-
 drivers/gpu/drm/bridge/parade-ps8622.c                     |  1 -
 drivers/gpu/drm/cirrus/cirrus_drv.c                        |  2 +-
 drivers/gpu/drm/cirrus/cirrus_fbdev.c                      |  2 --
 drivers/gpu/drm/drm_fb_helper.c                            |  1 -
 drivers/gpu/drm/gma500/accel_2d.c                          |  1 -
 drivers/gpu/drm/gma500/framebuffer.c                       |  1 -
 drivers/gpu/drm/gma500/psb_intel_modes.c                   |  1 -
 drivers/gpu/drm/i915/i915_drv.c                            |  2 +-
 drivers/gpu/drm/i915/intel_fbdev.c                         |  1 -
 drivers/gpu/drm/i915/intel_modes.c                         |  1 -
 drivers/gpu/drm/imx/imx-drm-core.c                         |  1 -
 drivers/gpu/drm/imx/ipuv3-crtc.c                           |  1 -
 drivers/gpu/drm/mgag200/mgag200_drv.c                      |  2 +-
 drivers/gpu/drm/mgag200/mgag200_fb.c                       |  2 --
 drivers/gpu/drm/mgag200/mgag200_main.c                     |  2 +-
 drivers/gpu/drm/nouveau/nouveau_drm.c                      |  2 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c                    |  1 -
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c            |  1 -
 drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c    |  1 -
 drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c    |  1 -
 drivers/gpu/drm/qxl/qxl_fb.c                               |  5 ++++-
 drivers/gpu/drm/radeon/radeon_drv.c                        |  3 ++-
 drivers/gpu/drm/radeon/radeon_fb.c                         |  3 +--
 drivers/gpu/drm/sun4i/sun4i_drv.c                          |  3 ++-
 drivers/gpu/drm/udl/udl_fb.c                               |  4 ++++
 drivers/gpu/drm/vc4/vc4_drv.c                              |  3 ++-
 drivers/gpu/drm/virtio/virtgpu_drm_bus.c                   |  3 ++-
 drivers/gpu/drm/vmwgfx/Kconfig                             |  1 +
 include/drm/drm_fb_helper.h                                | 14 ++++++++++++++
 41 files changed, 40 insertions(+), 48 deletions(-)

--
2.8.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel