Skip to contentSkip to conversation

drm/i915/fbdev: Always forward hotplug events

PATCH In review Daniel Vetter 6 participants 12 messages Jul 6, 2017 – Jul 20, 2017

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

PATCH 1/5 drm/i915/fbdev: Always forward hotplug events

With deferred fbdev setup we always need to forward hotplug events, even if fbdev isn't fully set up yet. Otherwise the deferred setup will neer happen.

Originally this check was added in

commit c45eb4fed12d278d3619f1904885bd0d7bcbf036 (tag: drm-intel-next-fixes-2016-08-05)

Author: Chris Wilson <[email protected]>
Date:   Wed Jul 13 18:34:45 2016 +0100

drm/i915/fbdev: Check for the framebuffer before use

But the specific case of the hotplug function blowing up was fixed in

commit 50c3dc970a09b3b60422a58934cc27a413288bab

Author: Daniel Vetter <[email protected]>
Date:   Fri Jun 27 17:19:22 2014 +0200

drm/fb-helper: Fix hpd vs. initial config races

Cc Maarten Lankhorst <[email protected]>
Cc Mika Kuoppala <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/intel_fbdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_fbdev.c +1 -1
index f11ee039ff45..5536591d3da0 100644
@@ -821,7 +821,7 @@ void intel_fbdev_output_poll_changed(struct drm_device *dev)
 {
 	struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
 
-	if (ifbdev && ifbdev->vma)
+	if (ifbdev)
 		drm_fb_helper_hotplug_event(&ifbdev->helper);
 }
 
Signature · 6 lines
2.13.2

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

PATCH 2/5 drm/i915: Protect against deferred fbdev setup

We could probably hit this already with our current async fbdev init, but it's much easier to hit this with the new deferred fbdev setup that I'm working on polishing.

---
 drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_debugfs.c +1 -1
index 643f56b8b87c..9f7e7730bb82 100644
@@ -1931,7 +1931,7 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
 		return ret;
 
 #ifdef CONFIG_DRM_FBDEV_EMULATION
-	if (dev_priv->fbdev) {
+	if (dev_priv->fbdev && dev_priv->fbdev->helper.fb) {
 		fbdev_fb = to_intel_framebuffer(dev_priv->fbdev->helper.fb);
 
 		seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, modifier 0x%llx, refcount %d, obj ",
Signature · 6 lines
2.13.2

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

PATCH 3/5 drm/fb-helper: Support deferred setup

In reply to Daniel Vetter

FB helper code falls back to a 1024x768 mode if no outputs are connected or don't report back any modes upon initialization. This can be annoying because outputs that are added to FB helper later on can't be used with FB helper if they don't support a matching mode.

The fallback is in place because VGA connectors can happen to report an unknown connection status even when they are in fact connected.

Some drivers have custom solutions in place to defer FB helper setup until at least one output is connected. But the logic behind these solutions is always the same and there is nothing driver-specific about it, so a better alterative is to fix the FB helper core and add support for all drivers automatically.

This patch adds support for deferred FB helper setup. It checks all the connectors for their connection status, and if all of them report to be disconnected marks the FB helper as needing deferred setup. Whet setup is deferred, the FB helper core will automatically retry setup after a hotplug event, and it will keep trying until it succeeds.

v2: Rebase onto my entirely reworked fbdev helper locking. One big difference is that this version again drops&reacquires the fbdev lock (which is now fb_helper->lock, but before this patch series it was mode_config->mutex), because register_framebuffer must be able to recurse back into fbdev helper code for the initial screen setup.

v3: __drm_fb_helper_initial_config must hold fb_helper->lock upon return, I've fumbled that in the deferred setup case (Liviu).

v4: I was blind, redo this all. __drm_fb_helper_initial_config shouldn't need to reacquire fb_helper->lock, that just confuses callers. I myself got confused by kernel_fb_helper_lock and somehow thought it's the same as fb_helper->lock. Tsk.

Also simplify the logic a bit (we don't need two functions to probe connectors), we can stick much closer to the existing code. And update some comments I've spotted that are outdated.

v5: Don't pass -EAGAIN to drivers, it's just an internal error code (Liviu).

v6: Add _and_unlock suffix to clarify locking (Maarten)

---
 drivers/gpu/drm/drm_fb_helper.c | 102 ++++++++++++++++++++++++++--------------
 include/drm/drm_fb_helper.h     |  23 +++++++++
 2 files changed, 90 insertions(+), 35 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +67 -35
index 721511da4de6..0c3aaabe7819 100644
@@ -501,6 +501,9 @@ int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)
 	if (!drm_fbdev_emulation)
 		return -ENODEV;
 
+	if (READ_ONCE(fb_helper->deferred_setup))
+		return 0;
+
 	mutex_lock(&fb_helper->lock);
 	ret = restore_fbdev_mode(fb_helper);
 
@@ -1618,8 +1621,7 @@ EXPORT_SYMBOL(drm_fb_helper_pan_display);
 
 /*
  * Allocates the backing storage and sets up the fbdev info structure through
- * the ->fb_probe callback and then registers the fbdev and sets up the panic
- * notifier.
+ * the ->fb_probe callback.
  */
 static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
 					 int preferred_bpp)
@@ -1717,13 +1719,8 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
 	}
 
 	if (crtc_count == 0 || sizes.fb_width == -1 || sizes.fb_height == -1) {
-		/*
-		 * hmm everyone went away - assume VGA cable just fell out
-		 * and will come back later.
-		 */
-		DRM_INFO("Cannot find any crtc or sizes - going 1024x768\n");
-		sizes.fb_width = sizes.surface_width = 1024;
-		sizes.fb_height = sizes.surface_height = 768;
+		DRM_INFO("Cannot find any crtc or sizes\n");
+		return -EAGAIN;
 	}
 
 	/* Handle our overallocation */
@@ -2352,6 +2349,59 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper,
 	kfree(enabled);
 }
 
+/* Note: Drops fb_helper->lock before returning. */
+static int
+__drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper,
+					  int bpp_sel)
+{
+	struct drm_device *dev = fb_helper->dev;
+	struct fb_info *info;
+	unsigned int width, height;
+	int ret;
+
+	width = dev->mode_config.max_width;
+	height = dev->mode_config.max_height;
+
+	drm_setup_crtcs(fb_helper, width, height);
+	ret = drm_fb_helper_single_fb_probe(fb_helper, bpp_sel);
+	if (ret < 0) {
+		if (ret == -EAGAIN) {
+			fb_helper->preferred_bpp = bpp_sel;
+			fb_helper->deferred_setup = true;
+			ret = 0;
+		}
+		mutex_unlock(&fb_helper->lock);
+
+		return ret;
+	}
+
+	fb_helper->deferred_setup = false;
+
+	info = fb_helper->fbdev;
+	info->var.pixclock = 0;
+
+	/* Need to drop locks to avoid recursive deadlock in
+	 * register_framebuffer. This is ok because the only thing left to do is
+	 * register the fbdev emulation instance in kernel_fb_helper_list. */
+	mutex_unlock(&fb_helper->lock);
+
+	ret = register_framebuffer(info);
+	if (ret < 0)
+		return ret;
+
+	dev_info(dev->dev, "fb%d: %s frame buffer device\n",
+		 info->node, info->fix.id);
+
+	mutex_lock(&kernel_fb_helper_lock);
+	if (list_empty(&kernel_fb_helper_list))
+		register_sysrq_key('v', &sysrq_drm_fb_helper_restore_op);
+
+	list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list);
+	mutex_unlock(&kernel_fb_helper_lock);
+
+	return 0;
+}
+
 /**
  * drm_fb_helper_initial_config - setup a sane initial connector configuration
  * @fb_helper: fb_helper device struct
@@ -2396,39 +2446,15 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper,
  */
 int drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel)
 {
-	struct drm_device *dev = fb_helper->dev;
-	struct fb_info *info;
 	int ret;
 
 	if (!drm_fbdev_emulation)
 		return 0;
 
 	mutex_lock(&fb_helper->lock);
-	drm_setup_crtcs(fb_helper,
-			dev->mode_config.max_width,
-			dev->mode_config.max_height);
-	ret = drm_fb_helper_single_fb_probe(fb_helper, bpp_sel);
-	mutex_unlock(&fb_helper->lock);
-	if (ret)
-		return ret;
+	ret = __drm_fb_helper_initial_config_and_unlock(fb_helper, bpp_sel);
 
-	info = fb_helper->fbdev;
-	info->var.pixclock = 0;
-	ret = register_framebuffer(info);
-	if (ret < 0)
-		return ret;
-
-	dev_info(dev->dev, "fb%d: %s frame buffer device\n",
-		 info->node, info->fix.id);
-
-	mutex_lock(&kernel_fb_helper_lock);
-	if (list_empty(&kernel_fb_helper_list))
-		register_sysrq_key('v', &sysrq_drm_fb_helper_restore_op);
-
-	list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list);
-	mutex_unlock(&kernel_fb_helper_lock);
-
-	return 0;
+	return ret;
 }
 EXPORT_SYMBOL(drm_fb_helper_initial_config);
 
@@ -2461,6 +2487,12 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
 		return 0;
 
 	mutex_lock(&fb_helper->lock);
+	if (fb_helper->deferred_setup) {
+		err = __drm_fb_helper_initial_config_and_unlock(fb_helper,
+				fb_helper->preferred_bpp);
+		return err;
+	}
+
 	if (!fb_helper->fb || !drm_fb_helper_is_bound(fb_helper)) {
 		fb_helper->delayed_hotplug = true;
 		mutex_unlock(&fb_helper->lock);
include/drm/drm_fb_helper.h +23 -0
index ea170b96e88d..a5ea6ffdfecc 100644
@@ -232,6 +232,29 @@ struct drm_fb_helper {
 	 * needs to be reprobe when fbdev is in control again.
 	 */
 	bool delayed_hotplug;
+
+	/**
+	 * @deferred_setup:
+	 *
+	 * If no outputs are connected (disconnected or unknown) the FB helper
+	 * code will defer setup until at least one of the outputs shows up.
+	 * This field keeps track of the status so that setup can be retried
+	 * at every hotplug event until it succeeds eventually.
+	 *
+	 * Protected by @lock.
+	 */
+	bool deferred_setup;
+
+	/**
+	 * @preferred_bpp:
+	 *
+	 * Temporary storage for the driver's preferred BPP setting passed to
+	 * FB helper initialization. This needs to be tracked so that deferred
+	 * FB helper setup can pass this on.
+	 *
+	 * See also: @deferred_setup
+	 */
+	int preferred_bpp;
 };
 
 /**
Signature · 6 lines
2.13.2

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

PATCH 4/5 drm/exynos: Remove custom FB helper deferred setup

In reply to Daniel Vetter

From: Thierry Reding <[email protected]>

The FB helper core now supports deferred setup, so the driver's custom implementation can be removed.

v2: Drop NULL check, drm_fb_helper_hotplug_event handles that already.

---
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |  6 ++++--
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 26 +-------------------------
 2 files changed, 5 insertions(+), 27 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +4 -2
index 35a8dfc93836..cab9e12d7846 100644
@@ -395,8 +395,9 @@ static int exynos_drm_bind(struct device *dev)
 	/* init kms poll for handling hpd */
 	drm_kms_helper_poll_init(drm);
 
-	/* force connectors detection */
-	drm_helper_hpd_irq_event(drm);
+	ret = exynos_drm_fbdev_init(drm);
+	if (ret)
+		goto err_cleanup_poll;
 
 	/* register the DRM device */
 	ret = drm_dev_register(drm, 0);
@@ -407,6 +408,7 @@ static int exynos_drm_bind(struct device *dev)
 
 err_cleanup_fbdev:
 	exynos_drm_fbdev_fini(drm);
+err_cleanup_poll:
 	drm_kms_helper_poll_fini(drm);
 	exynos_drm_device_subdrv_remove(drm);
 err_unbind_all:
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +1 -25
index 641531243e04..c3a068409b48 100644
@@ -183,24 +183,6 @@ static const struct drm_fb_helper_funcs exynos_drm_fb_helper_funcs = {
 	.fb_probe =	exynos_drm_fbdev_create,
 };
 
-static bool exynos_drm_fbdev_is_anything_connected(struct drm_device *dev)
-{
-	struct drm_connector *connector;
-	bool ret = false;
-
-	mutex_lock(&dev->mode_config.mutex);
-	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
-		if (connector->status != connector_status_connected)
-			continue;
-
-		ret = true;
-		break;
-	}
-	mutex_unlock(&dev->mode_config.mutex);
-
-	return ret;
-}
-
 int exynos_drm_fbdev_init(struct drm_device *dev)
 {
 	struct exynos_drm_fbdev *fbdev;
@@ -211,9 +193,6 @@ int exynos_drm_fbdev_init(struct drm_device *dev)
 	if (!dev->mode_config.num_crtc || !dev->mode_config.num_connector)
 		return 0;
 
-	if (!exynos_drm_fbdev_is_anything_connected(dev))
-		return 0;
-
 	fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL);
 	if (!fbdev)
 		return -ENOMEM;
@@ -304,8 +283,5 @@ void exynos_drm_output_poll_changed(struct drm_device *dev)
 	struct exynos_drm_private *private = dev->dev_private;
 	struct drm_fb_helper *fb_helper = private->fb_helper;
 
-	if (fb_helper)
-		drm_fb_helper_hotplug_event(fb_helper);
-	else
-		exynos_drm_fbdev_init(dev);
+	drm_fb_helper_hotplug_event(fb_helper);
 }
Signature · 6 lines
2.13.2

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

PATCH 5/5 drm/hisilicon: Remove custom FB helper deferred setup

In reply to Daniel Vetter

From: Thierry Reding <[email protected]>

The FB helper core now supports deferred setup, so the driver's custom implementation can be removed.

v2: Dont' resurrect drm_vblank_cleanup.

---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +10 -10
index 8065d6cb1d7f..1178341c3858 100644
@@ -54,14 +54,7 @@ static void kirin_fbdev_output_poll_changed(struct drm_device *dev)
 {
 	struct kirin_drm_private *priv = dev->dev_private;
 
-	if (priv->fbdev) {
-		drm_fbdev_cma_hotplug_event(priv->fbdev);
-	} else {
-		priv->fbdev = drm_fbdev_cma_init(dev, 32,
-						 dev->mode_config.num_connector);
-		if (IS_ERR(priv->fbdev))
-			priv->fbdev = NULL;
-	}
+	drm_fbdev_cma_hotplug_event(priv->fbdev);
 }
 #endif
 
@@ -128,11 +121,18 @@ static int kirin_drm_kms_init(struct drm_device *dev)
 	/* init kms poll for handling hpd */
 	drm_kms_helper_poll_init(dev);
 
-	/* force detection after connectors init */
-	(void)drm_helper_hpd_irq_event(dev);
+	priv->fbdev = drm_fbdev_cma_init(dev, 32,
+					 dev->mode_config.num_connector);
+	if (IS_ERR(priv->fbdev)) {
+		DRM_ERROR("failed to initialize fbdev.\n");
+		ret = PTR_ERR(priv->fbdev);
+		goto err_cleanup_poll;
+	}
 
 	return 0;
 
+err_cleanup_poll:
+	drm_kms_helper_poll_fini(dev);
 err_unbind_all:
 	component_unbind_all(dev->dev, dev);
 err_dc_cleanup:
Signature · 6 lines
2.13.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 5/5
#5 lore raw

Re: [PATCH 5/5] drm/hisilicon: Remove custom FB helper deferred setup

Quoted 5 lines · Daniel Vetter

From: Thierry Reding <[email protected]>

The FB helper core now supports deferred setup, so the driver's custom implementation can be removed.

Quoted 8 lines

v2: Dont' resurrect drm_vblank_cleanup.

Quoted 48 lines
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +10 -11
index 8065d6cb1d7f..1178341c3858 100644
@@ -54,14 +54,7 @@ static void kirin_fbdev_output_poll_changed(struct drm_device *dev)
 {
        struct kirin_drm_private *priv = dev->dev_private;
 
-       if (priv->fbdev) {
-               drm_fbdev_cma_hotplug_event(priv->fbdev);
-       } else {
-               priv->fbdev = drm_fbdev_cma_init(dev, 32,
-                                                dev->mode_config.num_connector);
-               if (IS_ERR(priv->fbdev))
-                       priv->fbdev = NULL;
-       }
+       drm_fbdev_cma_hotplug_event(priv->fbdev);
 }
 #endif
 
@@ -128,11 +121,18 @@ static int kirin_drm_kms_init(struct drm_device *dev)
        /* init kms poll for handling hpd */
        drm_kms_helper_poll_init(dev);
 
-       /* force detection after connectors init */
-       (void)drm_helper_hpd_irq_event(dev);
+       priv->fbdev = drm_fbdev_cma_init(dev, 32,
+                                        dev->mode_config.num_connector);
+       if (IS_ERR(priv->fbdev)) {
+               DRM_ERROR("failed to initialize fbdev.\n");
+               ret = PTR_ERR(priv->fbdev);
+               goto err_cleanup_poll;
+       }
 
        return 0;
 
+err_cleanup_poll:
+       drm_kms_helper_poll_fini(dev);
 err_unbind_all:
        component_unbind_all(dev->dev, dev);
 err_dc_cleanup:
--

2.13.2

Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

Re: [PATCH 5/5] drm/hisilicon: Remove custom FB helper deferred setup

Quoted 8 lines · Sean Paul
Quoted 7 lines · Daniel Vetter

From: Thierry Reding <[email protected]>

The FB helper core now supports deferred setup, so the driver's custom implementation can be removed.

v2: Dont' resurrect drm_vblank_cleanup.

Quoted 8 lines
Quoted 6 lines

Merged the final patches, thanks for your review.
-Daniel

Quoted 53 lines
Quoted 53 lines
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +10 -11
index 8065d6cb1d7f..1178341c3858 100644
@@ -54,14 +54,7 @@ static void kirin_fbdev_output_poll_changed(struct drm_device *dev)
 {
        struct kirin_drm_private *priv = dev->dev_private;
 
-       if (priv->fbdev) {
-               drm_fbdev_cma_hotplug_event(priv->fbdev);
-       } else {
-               priv->fbdev = drm_fbdev_cma_init(dev, 32,
-                                                dev->mode_config.num_connector);
-               if (IS_ERR(priv->fbdev))
-                       priv->fbdev = NULL;
-       }
+       drm_fbdev_cma_hotplug_event(priv->fbdev);
 }
 #endif
 
@@ -128,11 +121,18 @@ static int kirin_drm_kms_init(struct drm_device *dev)
        /* init kms poll for handling hpd */
        drm_kms_helper_poll_init(dev);
 
-       /* force detection after connectors init */
-       (void)drm_helper_hpd_irq_event(dev);
+       priv->fbdev = drm_fbdev_cma_init(dev, 32,
+                                        dev->mode_config.num_connector);
+       if (IS_ERR(priv->fbdev)) {
+               DRM_ERROR("failed to initialize fbdev.\n");
+               ret = PTR_ERR(priv->fbdev);
+               goto err_cleanup_poll;
+       }
 
        return 0;
 
+err_cleanup_poll:
+       drm_kms_helper_poll_fini(dev);
 err_unbind_all:
        component_unbind_all(dev->dev, dev);
 err_dc_cleanup:
--

2.13.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer Reviewed-by on v1 1/5
#7 lore raw
In reply to Daniel Vetter

Op 06-07-17 om 15:00 schreef Daniel Vetter:

Quoted 33 lines

With deferred fbdev setup we always need to forward hotplug events, even if fbdev isn't fully set up yet. Otherwise the deferred setup will neer happen.

Originally this check was added in

commit c45eb4fed12d278d3619f1904885bd0d7bcbf036 (tag: drm-intel-next-fixes-2016-08-05)

Author: Chris Wilson <[email protected]>
Date:   Wed Jul 13 18:34:45 2016 +0100

drm/i915/fbdev: Check for the framebuffer before use

But the specific case of the hotplug function blowing up was fixed in

commit 50c3dc970a09b3b60422a58934cc27a413288bab

Author: Daniel Vetter <[email protected]>
Date:   Fri Jun 27 17:19:22 2014 +0200

drm/fb-helper: Fix hpd vs. initial config races

Cc Maarten Lankhorst <[email protected]>
Cc Mika Kuoppala <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/intel_fbdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_fbdev.c +0 -0
index f11ee039ff45..5536591d3da0 100644

drivers/gpu/drm/i915/intel_fbdev.c void intel_fbdev_output_poll_changed(struct drm_device *dev) · line 827

Quoted 8 lines
drivers/gpu/drm/i915/intel_fbdev.c +1 -1
@@ -821,7 +821,7 @@ void intel_fbdev_output_poll_changed(struct drm_device *dev)
 {
 	struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
 
-	if (ifbdev && ifbdev->vma)
+	if (ifbdev)
 		drm_fb_helper_hotplug_event(&ifbdev->helper);
 }
 

Could you also change the @intel.com to @linux.intel.com in second patch? :-)

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

#8 lore raw
Quoted 45 lines · Maarten Lankhorst

Op 06-07-17 om 15:00 schreef Daniel Vetter:

Quoted 33 lines

With deferred fbdev setup we always need to forward hotplug events, even if fbdev isn't fully set up yet. Otherwise the deferred setup will neer happen.

Originally this check was added in

commit c45eb4fed12d278d3619f1904885bd0d7bcbf036 (tag: drm-intel-next-fixes-2016-08-05)

Author: Chris Wilson <[email protected]>
Date:   Wed Jul 13 18:34:45 2016 +0100

drm/i915/fbdev: Check for the framebuffer before use

But the specific case of the hotplug function blowing up was fixed in

commit 50c3dc970a09b3b60422a58934cc27a413288bab

Author: Daniel Vetter <[email protected]>
Date:   Fri Jun 27 17:19:22 2014 +0200

drm/fb-helper: Fix hpd vs. initial config races

Cc Maarten Lankhorst <[email protected]>
Cc Mika Kuoppala <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/intel_fbdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_fbdev.c +0 -0
index f11ee039ff45..5536591d3da0 100644

drivers/gpu/drm/i915/intel_fbdev.c void intel_fbdev_output_poll_changed(struct drm_device *dev) · line 827

Quoted 8 lines
drivers/gpu/drm/i915/intel_fbdev.c +1 -1
@@ -821,7 +821,7 @@ void intel_fbdev_output_poll_changed(struct drm_device *dev)
 {
 	struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
 
-	if (ifbdev && ifbdev->vma)
+	if (ifbdev)
 		drm_fb_helper_hotplug_event(&ifbdev->helper);
 }
 
Quoted 1 line

Could you also change the @intel.com to @linux.intel.com in second patch? :-)

Done, thx for your review, first 2 patches merged to drm-intel. I'll apply the others once drm-misc is resynced.
-Daniel

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

✓ Fi.CI.BAT: success for series starting with [1/5] drm/i915/fbdev: Always forward hotplug events

In reply to Daniel Vetter
== Series Details ==

== Series Details ==

Series: series starting with [1/5] drm/i915/fbdev: Always forward hotplug events
URL : https://patchwork.freedesktop.org/series/26912/
State : success

== Summary ==

Series 26912v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/26912/revisions/1/mbox/

Test gem_exec_suspend:

        Subgroup basic-s4-devices:
                dmesg-warn -> PASS       (fi-kbl-7560u) fdo#100125

fdo#100125 https://bugs.freedesktop.org/show_bug.cgi?id=100125

fi-bdw-5557u     total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:438s
fi-bdw-gvtdvm    total:279  pass:265  dwarn:0   dfail:0   fail:0   skip:14  time:433s
fi-blb-e6850     total:279  pass:224  dwarn:1   dfail:0   fail:0   skip:54  time:361s
fi-bsw-n3050     total:279  pass:243  dwarn:0   dfail:0   fail:0   skip:36  time:519s
fi-bxt-j4205     total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:515s
fi-byt-j1900     total:279  pass:254  dwarn:1   dfail:0   fail:0   skip:24  time:496s
fi-byt-n2820     total:279  pass:250  dwarn:1   dfail:0   fail:0   skip:28  time:484s
fi-glk-2a        total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:597s
fi-hsw-4770      total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:435s
fi-hsw-4770r     total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:414s
fi-ilk-650       total:279  pass:229  dwarn:0   dfail:0   fail:0   skip:50  time:416s
fi-ivb-3520m     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:503s
fi-kbl-7500u     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:474s
fi-kbl-7560u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:572s
fi-kbl-r         total:279  pass:260  dwarn:1   dfail:0   fail:0   skip:18  time:586s
fi-pnv-d510      total:279  pass:222  dwarn:2   dfail:0   fail:0   skip:55  time:567s
fi-skl-6260u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:457s
fi-skl-6700hq    total:279  pass:262  dwarn:0   dfail:0   fail:0   skip:17  time:583s
fi-skl-6700k     total:279  pass:257  dwarn:4   dfail:0   fail:0   skip:18  time:469s
fi-skl-6770hq    total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:478s
fi-skl-gvtdvm    total:279  pass:266  dwarn:0   dfail:0   fail:0   skip:13  time:435s
fi-snb-2520m     total:279  pass:251  dwarn:0   dfail:0   fail:0   skip:28  time:545s
fi-snb-2600      total:279  pass:250  dwarn:0   dfail:0   fail:0   skip:29  time:407s

13173bea86ebf8643a32b8373eeadd3fdcd1cc4d drm-tip: 2017y-07m-06d-14h-15m-52s UTC integration manifest a87871a drm/hisilicon: Remove custom FB helper deferred setup
0ec0b41 drm/exynos: Remove custom FB helper deferred setup
3e60ec8 drm/fb-helper: Support deferred setup
4c4891a drm/i915: Protect against deferred fbdev setup
539dd24 drm/i915/fbdev: Always forward hotplug events

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_5125/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#10 lore raw
In reply to Daniel Vetter
Quoted 11 lines · Daniel Vetter

With deferred fbdev setup we always need to forward hotplug events, even if fbdev isn't fully set up yet. Otherwise the deferred setup will neer happen.

Originally this check was added in

commit c45eb4fed12d278d3619f1904885bd0d7bcbf036 (tag: drm-intel-next-fixes-2016-08-05)

Author: Chris Wilson <[email protected]>
Date:   Wed Jul 13 18:34:45 2016 +0100

drm/i915/fbdev: Check for the framebuffer before use

I just pushed

commit 7581d5ca2bb269cfc2ce2d0cb489aac513167f6b

Author: Chris Wilson <[email protected]>
Date:   Thu Jun 22 17:02:11 2017 +0100
    drm/i915/fbdev: Check for existence of ifbdev->vma before operations

which is a backport of 15727ed0d944 ("drm/i915/fbdev: Check for existence of ifbdev->vma before operations") to dinf.

Should this patch be backported too?

BR,
Jani.

Quoted 29 lines

But the specific case of the hotplug function blowing up was fixed in

commit 50c3dc970a09b3b60422a58934cc27a413288bab

Author: Daniel Vetter <[email protected]>
Date:   Fri Jun 27 17:19:22 2014 +0200

drm/fb-helper: Fix hpd vs. initial config races

Cc Maarten Lankhorst <[email protected]>
Cc Mika Kuoppala <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/intel_fbdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_fbdev.c +1 -1
index f11ee039ff45..5536591d3da0 100644
@@ -821,7 +821,7 @@ void intel_fbdev_output_poll_changed(struct drm_device *dev)
 {
 	struct intel_fbdev *ifbdev = to_i915(dev)->fbdev;
 
-	if (ifbdev && ifbdev->vma)
+	if (ifbdev)
 		drm_fb_helper_hotplug_event(&ifbdev->helper);
 }
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#11 lore raw
Quoted 19 lines · Jani Nikula
Quoted 11 lines · Daniel Vetter

With deferred fbdev setup we always need to forward hotplug events, even if fbdev isn't fully set up yet. Otherwise the deferred setup will neer happen.

Originally this check was added in

commit c45eb4fed12d278d3619f1904885bd0d7bcbf036 (tag: drm-intel-next-fixes-2016-08-05)

Author: Chris Wilson <[email protected]>
Date:   Wed Jul 13 18:34:45 2016 +0100

drm/i915/fbdev: Check for the framebuffer before use

I just pushed

commit 7581d5ca2bb269cfc2ce2d0cb489aac513167f6b

Author: Chris Wilson <[email protected]>
Date:   Thu Jun 22 17:02:11 2017 +0100
Quoted 6 lines
    drm/i915/fbdev: Check for existence of ifbdev->vma before operations

which is a backport of 15727ed0d944 ("drm/i915/fbdev: Check for existence of ifbdev->vma before operations") to dinf.

Should this patch be backported too?

No. The one check this removes is harmless in current kernels. It only breaks the deferred fbdev setup logic, which isn't in 4.13. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx