All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events
@ 2017-07-06 13:00 Daniel Vetter
  2017-07-06 13:00 ` [PATCH 2/5] drm/i915: Protect against deferred fbdev setup Daniel Vetter
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-07-06 13:00 UTC (permalink / raw)
  To: DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter,
	Mika Kuoppala

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 <chris@chris-wilson.co.uk>
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 <daniel.vetter@ffwll.ch>
Date:   Fri Jun 27 17:19:22 2014 +0200

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

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/intel_fbdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index f11ee039ff45..5536591d3da0 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -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);
 }
 
-- 
2.13.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/5] drm/i915: Protect against deferred fbdev setup
  2017-07-06 13:00 [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Daniel Vetter
@ 2017-07-06 13:00 ` Daniel Vetter
  2017-07-06 13:00 ` [PATCH 3/5] drm/fb-helper: Support deferred setup Daniel Vetter
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-07-06 13:00 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

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.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 643f56b8b87c..9f7e7730bb82 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -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 ",
-- 
2.13.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/5] drm/fb-helper: Support deferred setup
  2017-07-06 13:00 [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Daniel Vetter
  2017-07-06 13:00 ` [PATCH 2/5] drm/i915: Protect against deferred fbdev setup Daniel Vetter
@ 2017-07-06 13:00 ` Daniel Vetter
  2017-07-06 13:00 ` [PATCH 4/5] drm/exynos: Remove custom FB helper " Daniel Vetter
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-07-06 13:00 UTC (permalink / raw)
  To: DRI Development
  Cc: Liviu Dudau, Daniel Vetter, Intel Graphics Development,
	John Stultz, Thierry Reding

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)

Cc: Liviu Dudau <liviu@dudau.co.uk>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com> (v1)
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@intel.com>
Reviewed-by: Liviu Dudau <liviu@dudau.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_fb_helper.c | 102 ++++++++++++++++++++++++++--------------
 include/drm/drm_fb_helper.h     |  23 +++++++++
 2 files changed, 90 insertions(+), 35 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 721511da4de6..0c3aaabe7819 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -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);
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index ea170b96e88d..a5ea6ffdfecc 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -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;
 };
 
 /**
-- 
2.13.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/5] drm/exynos: Remove custom FB helper deferred setup
  2017-07-06 13:00 [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Daniel Vetter
  2017-07-06 13:00 ` [PATCH 2/5] drm/i915: Protect against deferred fbdev setup Daniel Vetter
  2017-07-06 13:00 ` [PATCH 3/5] drm/fb-helper: Support deferred setup Daniel Vetter
@ 2017-07-06 13:00 ` Daniel Vetter
  2017-07-06 13:00 ` [PATCH 5/5] drm/hisilicon: " Daniel Vetter
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-07-06 13:00 UTC (permalink / raw)
  To: DRI Development
  Cc: Joonyoung Shim, Daniel Vetter, Intel Graphics Development,
	Seung-Woo Kim, Inki Dae, Kyungmin Park, Thierry Reding

From: Thierry Reding <treding@nvidia.com>

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.

Cc: Inki Dae <inki.dae@samsung.com>
Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Thierry Reding <treding@nvidia.com> (v1)
Reviewed-by: Inki Dae <inki.dae@samsung.com>
Tested-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 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(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 35a8dfc93836..cab9e12d7846 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -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:
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index 641531243e04..c3a068409b48 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -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);
 }
-- 
2.13.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/5] drm/hisilicon: Remove custom FB helper deferred setup
  2017-07-06 13:00 [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Daniel Vetter
                   ` (2 preceding siblings ...)
  2017-07-06 13:00 ` [PATCH 4/5] drm/exynos: Remove custom FB helper " Daniel Vetter
@ 2017-07-06 13:00 ` Daniel Vetter
  2017-07-07 13:28   ` Sean Paul
  2017-07-06 13:05 ` [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Maarten Lankhorst
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Daniel Vetter @ 2017-07-06 13:00 UTC (permalink / raw)
  To: DRI Development
  Cc: Chen Feng, Intel Graphics Development, Xinliang Liu, Xinwei Kong,
	Daniel Vetter, Rongrong Zou, Thierry Reding

From: Thierry Reding <treding@nvidia.com>

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

v2: Dont' resurrect drm_vblank_cleanup.

Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
Cc: Rongrong Zou <zourongrong@gmail.com>
Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
Cc: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Thierry Reding <treding@nvidia.com> (v1)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index 8065d6cb1d7f..1178341c3858 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events
  2017-07-06 13:00 [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Daniel Vetter
                   ` (3 preceding siblings ...)
  2017-07-06 13:00 ` [PATCH 5/5] drm/hisilicon: " Daniel Vetter
@ 2017-07-06 13:05 ` Maarten Lankhorst
  2017-07-14 13:15   ` Daniel Vetter
  2017-07-06 15:35 ` ✓ Fi.CI.BAT: success for series starting with [1/5] " Patchwork
  2017-07-10 12:15 ` [Intel-gfx] [PATCH 1/5] " Jani Nikula
  6 siblings, 1 reply; 12+ messages in thread
From: Maarten Lankhorst @ 2017-07-06 13:05 UTC (permalink / raw)
  To: Daniel Vetter, DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, Mika Kuoppala

Op 06-07-17 om 15:00 schreef 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 <chris@chris-wilson.co.uk>
> 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 <daniel.vetter@ffwll.ch>
> Date:   Fri Jun 27 17:19:22 2014 +0200
>
>     drm/fb-helper: Fix hpd vs. initial config races
>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_fbdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> index f11ee039ff45..5536591d3da0 100644
> --- a/drivers/gpu/drm/i915/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> @@ -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);
>  }
>  

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [1/5] drm/i915/fbdev: Always forward hotplug events
  2017-07-06 13:00 [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Daniel Vetter
                   ` (4 preceding siblings ...)
  2017-07-06 13:05 ` [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Maarten Lankhorst
@ 2017-07-06 15:35 ` Patchwork
  2017-07-10 12:15 ` [Intel-gfx] [PATCH 1/5] " Jani Nikula
  6 siblings, 0 replies; 12+ messages in thread
From: Patchwork @ 2017-07-06 15:35 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/5] drm/hisilicon: Remove custom FB helper deferred setup
  2017-07-06 13:00 ` [PATCH 5/5] drm/hisilicon: " Daniel Vetter
@ 2017-07-07 13:28   ` Sean Paul
  2017-07-20 17:59     ` Daniel Vetter
  0 siblings, 1 reply; 12+ messages in thread
From: Sean Paul @ 2017-07-07 13:28 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Chen Feng, Intel Graphics Development, DRI Development,
	Xinliang Liu, Xinwei Kong, Rongrong Zou, Thierry Reding

On Thu, Jul 6, 2017 at 9:00 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> The FB helper core now supports deferred setup, so the driver's custom
> implementation can be removed.
>
> v2: Dont' resurrect drm_vblank_cleanup.
>
> Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
> Cc: Rongrong Zou <zourongrong@gmail.com>
> Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
> Cc: Chen Feng <puck.chen@hisilicon.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com> (v1)
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Sean Paul <seanpaul@chromium.org>

> ---
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index 8065d6cb1d7f..1178341c3858 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -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
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Intel-gfx] [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events
  2017-07-06 13:00 [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Daniel Vetter
                   ` (5 preceding siblings ...)
  2017-07-06 15:35 ` ✓ Fi.CI.BAT: success for series starting with [1/5] " Patchwork
@ 2017-07-10 12:15 ` Jani Nikula
  2017-07-10 15:02   ` Daniel Vetter
  6 siblings, 1 reply; 12+ messages in thread
From: Jani Nikula @ 2017-07-10 12:15 UTC (permalink / raw)
  To: DRI Development
  Cc: Daniel Vetter, Intel Graphics Development, Mika Kuoppala,
	Daniel Vetter

On Thu, 06 Jul 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> 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 <chris@chris-wilson.co.uk>
> 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 <chris@chris-wilson.co.uk>
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.


>
> But the specific case of the hotplug function blowing up was fixed in
>
> commit 50c3dc970a09b3b60422a58934cc27a413288bab
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Fri Jun 27 17:19:22 2014 +0200
>
>     drm/fb-helper: Fix hpd vs. initial config races
>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_fbdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> index f11ee039ff45..5536591d3da0 100644
> --- a/drivers/gpu/drm/i915/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> @@ -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);
>  }

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events
  2017-07-10 12:15 ` [Intel-gfx] [PATCH 1/5] " Jani Nikula
@ 2017-07-10 15:02   ` Daniel Vetter
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-07-10 15:02 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Daniel Vetter, Intel Graphics Development, DRI Development,
	Mika Kuoppala

On Mon, Jul 10, 2017 at 2:15 PM, Jani Nikula
<jani.nikula@linux.intel.com> wrote:
> On Thu, 06 Jul 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>> 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 <chris@chris-wilson.co.uk>
>> 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 <chris@chris-wilson.co.uk>
> 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?

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
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events
  2017-07-06 13:05 ` [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Maarten Lankhorst
@ 2017-07-14 13:15   ` Daniel Vetter
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-07-14 13:15 UTC (permalink / raw)
  To: Maarten Lankhorst
  Cc: Daniel Vetter, Intel Graphics Development, Mika Kuoppala,
	DRI Development, Daniel Vetter

On Thu, Jul 06, 2017 at 03:05:19PM +0200, Maarten Lankhorst wrote:
> Op 06-07-17 om 15:00 schreef 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 <chris@chris-wilson.co.uk>
> > 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 <daniel.vetter@ffwll.ch>
> > Date:   Fri Jun 27 17:19:22 2014 +0200
> >
> >     drm/fb-helper: Fix hpd vs. initial config races
> >
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_fbdev.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> > index f11ee039ff45..5536591d3da0 100644
> > --- a/drivers/gpu/drm/i915/intel_fbdev.c
> > +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> > @@ -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);
> >  }
> >  
> 
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> 
> 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
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 5/5] drm/hisilicon: Remove custom FB helper deferred setup
  2017-07-07 13:28   ` Sean Paul
@ 2017-07-20 17:59     ` Daniel Vetter
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Vetter @ 2017-07-20 17:59 UTC (permalink / raw)
  To: Sean Paul
  Cc: Daniel Vetter, Intel Graphics Development, DRI Development,
	Xinliang Liu, Xinwei Kong, Chen Feng, Rongrong Zou,
	Thierry Reding

On Fri, Jul 07, 2017 at 09:28:11AM -0400, Sean Paul wrote:
> On Thu, Jul 6, 2017 at 9:00 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > From: Thierry Reding <treding@nvidia.com>
> >
> > The FB helper core now supports deferred setup, so the driver's custom
> > implementation can be removed.
> >
> > v2: Dont' resurrect drm_vblank_cleanup.
> >
> > Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
> > Cc: Rongrong Zou <zourongrong@gmail.com>
> > Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
> > Cc: Chen Feng <puck.chen@hisilicon.com>
> > Signed-off-by: Thierry Reding <treding@nvidia.com> (v1)
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Reviewed-by: Sean Paul <seanpaul@chromium.org>

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

> 
> > ---
> >  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 20 ++++++++++----------
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> > index 8065d6cb1d7f..1178341c3858 100644
> > --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> > +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> > @@ -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
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-07-20 17:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-06 13:00 [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Daniel Vetter
2017-07-06 13:00 ` [PATCH 2/5] drm/i915: Protect against deferred fbdev setup Daniel Vetter
2017-07-06 13:00 ` [PATCH 3/5] drm/fb-helper: Support deferred setup Daniel Vetter
2017-07-06 13:00 ` [PATCH 4/5] drm/exynos: Remove custom FB helper " Daniel Vetter
2017-07-06 13:00 ` [PATCH 5/5] drm/hisilicon: " Daniel Vetter
2017-07-07 13:28   ` Sean Paul
2017-07-20 17:59     ` Daniel Vetter
2017-07-06 13:05 ` [PATCH 1/5] drm/i915/fbdev: Always forward hotplug events Maarten Lankhorst
2017-07-14 13:15   ` Daniel Vetter
2017-07-06 15:35 ` ✓ Fi.CI.BAT: success for series starting with [1/5] " Patchwork
2017-07-10 12:15 ` [Intel-gfx] [PATCH 1/5] " Jani Nikula
2017-07-10 15:02   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.