All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers
@ 2017-12-05 18:24 Noralf Trønnes
  2017-12-05 18:24 ` [PATCH v3 01/11] drm/amd/display: Use drm_fb_helper_poll_changed() Noralf Trønnes
                   ` (13 more replies)
  0 siblings, 14 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:24 UTC (permalink / raw)
  To: dri-devel
  Cc: daniel.vetter, tomi.valkeinen, sw0312.kim, linux, hdegoede,
	kyungmin.park, thierry.reding, bskeggs, alexander.deucher,
	intel-gfx, christian.koenig, mark.yao

The helpers are applied and have reached airlied/drm-next.

amd has gained another .poll_changed user since last.

i915 doesn't really need the .poll_changed helper since it now does a
sync and has to open code it after:
drm/i915/fbdev: Serialise early hotplug events with async fbdev config

vboxvideo will be re-sent when the helper functions have landed in
Greg's staging tree.

Noralf.

Changes since version 2:
- Helper functions have been applied
- Add drm/amd/display: Use drm_fb_helper_poll_changed()
- Rebase drm/amdgpu patch
- Rebase drm/msm patch
- Drop i915 patch, not applicable after:
  drm/i915/fbdev: Serialise early hotplug events with async fbdev config
- Drop vboxvideo patch, it will be re-sent when the helper functions
  have reached Greg's staging tree.

Changes since version 1:
- drm_device.drm_fb_helper_private -> drm_device.fb_helper (Ville)

Noralf Trønnes (11):
  drm/amd/display: Use drm_fb_helper_poll_changed()
  drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed()
  drm/armada: Use drm_fb_helper_lastclose() and _poll_changed()
  drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()
  drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed()
  drm/msm: Use drm_fb_helper_lastclose() and _poll_changed()
  drm/nouveau: Use drm_fb_helper_output_poll_changed()
  drm/omap: Use drm_fb_helper_lastclose() and _poll_changed()
  drm/radeon: Use drm_fb_helper_lastclose() and _poll_changed()
  drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed()
  drm/tegra: Use drm_fb_helper_lastclose() and _poll_changed()

 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c       |  9 ++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.h       |  2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c            | 27 ------------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c           |  4 +--
 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h          |  4 ---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
 drivers/gpu/drm/armada/armada_drm.h               |  1 -
 drivers/gpu/drm/armada/armada_drv.c               |  8 ++----
 drivers/gpu/drm/armada/armada_fb.c                | 11 +-------
 drivers/gpu/drm/armada/armada_fbdev.c             |  8 ------
 drivers/gpu/drm/exynos/exynos_drm_drv.c           |  8 ++----
 drivers/gpu/drm/exynos/exynos_drm_fb.c            |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c         | 18 ------------
 drivers/gpu/drm/exynos/exynos_drm_fbdev.h         |  2 --
 drivers/gpu/drm/gma500/framebuffer.c              |  9 +-----
 drivers/gpu/drm/gma500/psb_drv.c                  | 15 +---------
 drivers/gpu/drm/msm/msm_drv.c                     | 18 ++----------
 drivers/gpu/drm/nouveau/nouveau_display.c         |  3 +-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c           |  8 ------
 drivers/gpu/drm/nouveau/nouveau_fbcon.h           |  2 --
 drivers/gpu/drm/nouveau/nouveau_vga.c             |  3 +-
 drivers/gpu/drm/nouveau/nv50_display.c            |  2 +-
 drivers/gpu/drm/omapdrm/omap_drv.c                | 34 ++---------------------
 drivers/gpu/drm/radeon/radeon_display.c           |  9 ++----
 drivers/gpu/drm/radeon/radeon_fb.c                | 22 ---------------
 drivers/gpu/drm/radeon/radeon_kms.c               |  5 ++--
 drivers/gpu/drm/radeon/radeon_mode.h              |  3 --
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c       |  9 +-----
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c        |  9 +-----
 drivers/gpu/drm/tegra/drm.c                       | 13 ++-------
 drivers/gpu/drm/tegra/drm.h                       |  4 ---
 drivers/gpu/drm/tegra/fb.c                        | 14 ----------
 32 files changed, 29 insertions(+), 259 deletions(-)

-- 
2.14.2

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

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

* [PATCH v3 01/11] drm/amd/display: Use drm_fb_helper_poll_changed()
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
@ 2017-12-05 18:24 ` Noralf Trønnes
  2017-12-05 18:24 ` [PATCH v3 02/11] drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed() Noralf Trønnes
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:24 UTC (permalink / raw)
  To: dri-devel
  Cc: daniel.vetter, tomi.valkeinen, sw0312.kim, linux, hdegoede,
	kyungmin.park, thierry.reding, bskeggs, alexander.deucher,
	intel-gfx, christian.koenig, mark.yao

This driver can use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index c324c3b76fac..124229d0af42 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -792,7 +792,7 @@ dm_atomic_state_alloc_free(struct drm_atomic_state *state)
 
 static const struct drm_mode_config_funcs amdgpu_dm_mode_funcs = {
 	.fb_create = amdgpu_user_framebuffer_create,
-	.output_poll_changed = amdgpu_output_poll_changed,
+	.output_poll_changed = drm_fb_helper_output_poll_changed,
 	.atomic_check = amdgpu_dm_atomic_check,
 	.atomic_commit = amdgpu_dm_atomic_commit,
 	.atomic_state_alloc = dm_atomic_state_alloc,
-- 
2.14.2

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

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

* [PATCH v3 02/11] drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed()
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
  2017-12-05 18:24 ` [PATCH v3 01/11] drm/amd/display: Use drm_fb_helper_poll_changed() Noralf Trønnes
@ 2017-12-05 18:24 ` Noralf Trønnes
  2017-12-05 18:24 ` [PATCH v3 03/11] drm/armada: " Noralf Trønnes
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:24 UTC (permalink / raw)
  To: dri-devel
  Cc: daniel.vetter, tomi.valkeinen, sw0312.kim, linux, hdegoede,
	kyungmin.park, thierry.reding, bskeggs, alexander.deucher,
	intel-gfx, christian.koenig, mark.yao

This driver can use drm_fb_helper_lastclose() in its .lastclose function.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.
Remove the unused driver implementations.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c |  9 ++-------
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.h |  2 --
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c      | 27 ---------------------------
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c     |  4 +---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h    |  4 ----
 5 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index 138beb550a58..38d47559f098 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -34,6 +34,7 @@
 #include <linux/pm_runtime.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_edid.h>
+#include <drm/drm_fb_helper.h>
 
 static void amdgpu_flip_callback(struct dma_fence *f, struct dma_fence_cb *cb)
 {
@@ -556,15 +557,9 @@ amdgpu_user_framebuffer_create(struct drm_device *dev,
 	return &amdgpu_fb->base;
 }
 
-void amdgpu_output_poll_changed(struct drm_device *dev)
-{
-	struct amdgpu_device *adev = dev->dev_private;
-	amdgpu_fb_output_poll_changed(adev);
-}
-
 const struct drm_mode_config_funcs amdgpu_mode_funcs = {
 	.fb_create = amdgpu_user_framebuffer_create,
-	.output_poll_changed = amdgpu_output_poll_changed
+	.output_poll_changed = drm_fb_helper_output_poll_changed,
 };
 
 static const struct drm_prop_enum_list amdgpu_underscan_enum_list[] =
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.h
index 3cc0ef0c055e..7e03002395ff 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.h
@@ -28,6 +28,4 @@ amdgpu_user_framebuffer_create(struct drm_device *dev,
 						       struct drm_file *file_priv,
 							   const struct drm_mode_fb_cmd2 *mode_cmd);
 
-void amdgpu_output_poll_changed(struct drm_device *dev);
-
 #endif
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
index 90fa8e8bc6fb..ff3e9beb7d19 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
@@ -283,12 +283,6 @@ static int amdgpufb_create(struct drm_fb_helper *helper,
 	return ret;
 }
 
-void amdgpu_fb_output_poll_changed(struct amdgpu_device *adev)
-{
-	if (adev->mode_info.rfbdev)
-		drm_fb_helper_hotplug_event(&adev->mode_info.rfbdev->helper);
-}
-
 static int amdgpu_fbdev_destroy(struct drm_device *dev, struct amdgpu_fbdev *rfbdev)
 {
 	struct amdgpu_framebuffer *rfb = &rfbdev->rfb;
@@ -393,24 +387,3 @@ bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj)
 		return true;
 	return false;
 }
-
-void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev)
-{
-	struct amdgpu_fbdev *afbdev;
-	struct drm_fb_helper *fb_helper;
-	int ret;
-
-	if (!adev)
-		return;
-
-	afbdev = adev->mode_info.rfbdev;
-
-	if (!afbdev)
-		return;
-
-	fb_helper = &afbdev->helper;
-
-	ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
-	if (ret)
-		DRM_DEBUG("failed to restore crtc mode\n");
-}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 720139e182a3..c947c2cc813a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -786,9 +786,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
  */
 void amdgpu_driver_lastclose_kms(struct drm_device *dev)
 {
-	struct amdgpu_device *adev = dev->dev_private;
-
-	amdgpu_fbdev_restore_mode(adev);
+	drm_fb_helper_lastclose(dev);
 	vga_switcheroo_process_delayed_switch();
 }
 
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
index ffde1e9666e8..a5ef204e17cb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h
@@ -661,10 +661,6 @@ void amdgpu_fbdev_fini(struct amdgpu_device *adev);
 void amdgpu_fbdev_set_suspend(struct amdgpu_device *adev, int state);
 int amdgpu_fbdev_total_size(struct amdgpu_device *adev);
 bool amdgpu_fbdev_robj_is_fb(struct amdgpu_device *adev, struct amdgpu_bo *robj);
-void amdgpu_fbdev_restore_mode(struct amdgpu_device *adev);
-
-void amdgpu_fb_output_poll_changed(struct amdgpu_device *adev);
-
 
 int amdgpu_align_pitch(struct amdgpu_device *adev, int width, int bpp, bool tiled);
 
-- 
2.14.2

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

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

* [PATCH v3 03/11] drm/armada: Use drm_fb_helper_lastclose() and _poll_changed()
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
  2017-12-05 18:24 ` [PATCH v3 01/11] drm/amd/display: Use drm_fb_helper_poll_changed() Noralf Trønnes
  2017-12-05 18:24 ` [PATCH v3 02/11] drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed() Noralf Trønnes
@ 2017-12-05 18:24 ` Noralf Trønnes
  2017-12-05 18:24 ` [PATCH v3 04/11] drm/exynos: " Noralf Trønnes
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:24 UTC (permalink / raw)
  To: dri-devel
  Cc: daniel.vetter, tomi.valkeinen, sw0312.kim, linux, hdegoede,
	kyungmin.park, thierry.reding, bskeggs, alexander.deucher,
	intel-gfx, christian.koenig, mark.yao

This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/armada/armada_drm.h   |  1 -
 drivers/gpu/drm/armada/armada_drv.c   |  8 ++------
 drivers/gpu/drm/armada/armada_fb.c    | 11 +----------
 drivers/gpu/drm/armada/armada_fbdev.c |  8 --------
 4 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_drm.h b/drivers/gpu/drm/armada/armada_drm.h
index b064879ecdbd..cc4c557c9f66 100644
--- a/drivers/gpu/drm/armada/armada_drm.h
+++ b/drivers/gpu/drm/armada/armada_drm.h
@@ -84,7 +84,6 @@ void armada_drm_queue_unref_work(struct drm_device *,
 extern const struct drm_mode_config_funcs armada_drm_mode_config_funcs;
 
 int armada_fbdev_init(struct drm_device *);
-void armada_fbdev_lastclose(struct drm_device *);
 void armada_fbdev_fini(struct drm_device *);
 
 int armada_overlay_plane_create(struct drm_device *, unsigned long);
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index e857b88a9799..4b11b6b52f1d 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/of_graph.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
 #include <drm/drm_of.h>
 #include "armada_crtc.h"
 #include "armada_drm.h"
@@ -54,15 +55,10 @@ static struct drm_ioctl_desc armada_ioctls[] = {
 	DRM_IOCTL_DEF_DRV(ARMADA_GEM_PWRITE, armada_gem_pwrite_ioctl, 0),
 };
 
-static void armada_drm_lastclose(struct drm_device *dev)
-{
-	armada_fbdev_lastclose(dev);
-}
-
 DEFINE_DRM_GEM_FOPS(armada_drm_fops);
 
 static struct drm_driver armada_drm_driver = {
-	.lastclose		= armada_drm_lastclose,
+	.lastclose		= drm_fb_helper_lastclose,
 	.gem_free_object_unlocked = armada_gem_free_object,
 	.prime_handle_to_fd	= drm_gem_prime_handle_to_fd,
 	.prime_fd_to_handle	= drm_gem_prime_fd_to_handle,
diff --git a/drivers/gpu/drm/armada/armada_fb.c b/drivers/gpu/drm/armada/armada_fb.c
index a38d5a0892a9..ac92bce07ecd 100644
--- a/drivers/gpu/drm/armada/armada_fb.c
+++ b/drivers/gpu/drm/armada/armada_fb.c
@@ -154,16 +154,7 @@ static struct drm_framebuffer *armada_fb_create(struct drm_device *dev,
 	return ERR_PTR(ret);
 }
 
-static void armada_output_poll_changed(struct drm_device *dev)
-{
-	struct armada_private *priv = dev->dev_private;
-	struct drm_fb_helper *fbh = priv->fbdev;
-
-	if (fbh)
-		drm_fb_helper_hotplug_event(fbh);
-}
-
 const struct drm_mode_config_funcs armada_drm_mode_config_funcs = {
 	.fb_create		= armada_fb_create,
-	.output_poll_changed	= armada_output_poll_changed,
+	.output_poll_changed	= drm_fb_helper_output_poll_changed,
 };
diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c
index a2ce83f84800..2a59db0994b2 100644
--- a/drivers/gpu/drm/armada/armada_fbdev.c
+++ b/drivers/gpu/drm/armada/armada_fbdev.c
@@ -159,14 +159,6 @@ int armada_fbdev_init(struct drm_device *dev)
 	return ret;
 }
 
-void armada_fbdev_lastclose(struct drm_device *dev)
-{
-	struct armada_private *priv = dev->dev_private;
-
-	if (priv->fbdev)
-		drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev);
-}
-
 void armada_fbdev_fini(struct drm_device *dev)
 {
 	struct armada_private *priv = dev->dev_private;
-- 
2.14.2

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

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

* [PATCH v3 04/11] drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
                   ` (2 preceding siblings ...)
  2017-12-05 18:24 ` [PATCH v3 03/11] drm/armada: " Noralf Trønnes
@ 2017-12-05 18:24 ` Noralf Trønnes
  2017-12-07  0:50   ` Inki Dae
  2017-12-05 18:24 ` [PATCH v3 05/11] drm/gma500: " Noralf Trønnes
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:24 UTC (permalink / raw)
  To: dri-devel
  Cc: Noralf Trønnes, jy0922.shim, daniel.vetter, tomi.valkeinen,
	sw0312.kim, linux, inki.dae, hdegoede, kyungmin.park, bskeggs,
	alexander.deucher, intel-gfx, christian.koenig, mark.yao

This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

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: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |  8 ++------
 drivers/gpu/drm/exynos/exynos_drm_fb.c    |  2 +-
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 18 ------------------
 drivers/gpu/drm/exynos/exynos_drm_fbdev.h |  2 --
 4 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index 82b72425a42f..2f2bd6e37e62 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -16,6 +16,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
 
 #include <linux/component.h>
 
@@ -89,11 +90,6 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
 	file->driver_priv = NULL;
 }
 
-static void exynos_drm_lastclose(struct drm_device *dev)
-{
-	exynos_drm_fbdev_restore_mode(dev);
-}
-
 static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
 	.fault = exynos_drm_gem_fault,
 	.open = drm_gem_vm_open,
@@ -140,7 +136,7 @@ static struct drm_driver exynos_drm_driver = {
 	.driver_features	= DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME
 				  | DRIVER_ATOMIC | DRIVER_RENDER,
 	.open			= exynos_drm_open,
-	.lastclose		= exynos_drm_lastclose,
+	.lastclose		= drm_fb_helper_lastclose,
 	.postclose		= exynos_drm_postclose,
 	.gem_free_object_unlocked = exynos_drm_gem_free_object,
 	.gem_vm_ops		= &exynos_drm_gem_vm_ops,
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c
index 8208df56a88f..0faaf829f5bf 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
@@ -205,7 +205,7 @@ static struct drm_mode_config_helper_funcs exynos_drm_mode_config_helpers = {
 
 static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = {
 	.fb_create = exynos_user_fb_create,
-	.output_poll_changed = exynos_drm_output_poll_changed,
+	.output_poll_changed = drm_fb_helper_output_poll_changed,
 	.atomic_check = exynos_atomic_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index dfb66ecf417b..132dd52d0ac7 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -270,24 +270,6 @@ void exynos_drm_fbdev_fini(struct drm_device *dev)
 	private->fb_helper = NULL;
 }
 
-void exynos_drm_fbdev_restore_mode(struct drm_device *dev)
-{
-	struct exynos_drm_private *private = dev->dev_private;
-
-	if (!private || !private->fb_helper)
-		return;
-
-	drm_fb_helper_restore_fbdev_mode_unlocked(private->fb_helper);
-}
-
-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;
-
-	drm_fb_helper_hotplug_event(fb_helper);
-}
-
 void exynos_drm_fbdev_suspend(struct drm_device *dev)
 {
 	struct exynos_drm_private *private = dev->dev_private;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
index 645d1bb7f665..b33847223a85 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
@@ -19,8 +19,6 @@
 
 int exynos_drm_fbdev_init(struct drm_device *dev);
 void exynos_drm_fbdev_fini(struct drm_device *dev);
-void exynos_drm_fbdev_restore_mode(struct drm_device *dev);
-void exynos_drm_output_poll_changed(struct drm_device *dev);
 void exynos_drm_fbdev_suspend(struct drm_device *drm);
 void exynos_drm_fbdev_resume(struct drm_device *drm);
 
-- 
2.14.2

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

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

* [PATCH v3 05/11] drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed()
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
                   ` (3 preceding siblings ...)
  2017-12-05 18:24 ` [PATCH v3 04/11] drm/exynos: " Noralf Trønnes
@ 2017-12-05 18:24 ` Noralf Trønnes
  2017-12-05 18:24 ` [PATCH v3 06/11] drm/msm: " Noralf Trønnes
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:24 UTC (permalink / raw)
  To: dri-devel
  Cc: daniel.vetter, tomi.valkeinen, sw0312.kim, linux, hdegoede,
	kyungmin.park, thierry.reding, bskeggs, alexander.deucher,
	intel-gfx, christian.koenig, mark.yao

This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/gma500/framebuffer.c |  9 +--------
 drivers/gpu/drm/gma500/psb_drv.c     | 15 +--------------
 2 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index 2570c7f647a6..cb0a2ae916e0 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -576,13 +576,6 @@ static void psb_fbdev_fini(struct drm_device *dev)
 	dev_priv->fbdev = NULL;
 }
 
-static void psbfb_output_poll_changed(struct drm_device *dev)
-{
-	struct drm_psb_private *dev_priv = dev->dev_private;
-	struct psb_fbdev *fbdev = (struct psb_fbdev *)dev_priv->fbdev;
-	drm_fb_helper_hotplug_event(&fbdev->psb_fb_helper);
-}
-
 /**
  *	psb_user_framebuffer_create_handle - add hamdle to a framebuffer
  *	@fb: framebuffer
@@ -623,7 +616,7 @@ static void psb_user_framebuffer_destroy(struct drm_framebuffer *fb)
 
 static const struct drm_mode_config_funcs psb_mode_funcs = {
 	.fb_create = psb_user_framebuffer_create,
-	.output_poll_changed = psbfb_output_poll_changed,
+	.output_poll_changed = drm_fb_helper_output_poll_changed,
 };
 
 static void psb_setup_outputs(struct drm_device *dev)
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 8f5cc1f471cd..38d09d4b3ed5 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -107,19 +107,6 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
 static const struct drm_ioctl_desc psb_ioctls[] = {
 };
 
-static void psb_driver_lastclose(struct drm_device *dev)
-{
-	int ret;
-	struct drm_psb_private *dev_priv = dev->dev_private;
-	struct psb_fbdev *fbdev = dev_priv->fbdev;
-
-	ret = drm_fb_helper_restore_fbdev_mode_unlocked(&fbdev->psb_fb_helper);
-	if (ret)
-		DRM_DEBUG("failed to restore crtc mode\n");
-
-	return;
-}
-
 static int psb_do_init(struct drm_device *dev)
 {
 	struct drm_psb_private *dev_priv = dev->dev_private;
@@ -479,7 +466,7 @@ static struct drm_driver driver = {
 			   DRIVER_MODESET | DRIVER_GEM,
 	.load = psb_driver_load,
 	.unload = psb_driver_unload,
-	.lastclose = psb_driver_lastclose,
+	.lastclose = drm_fb_helper_lastclose,
 
 	.num_ioctls = ARRAY_SIZE(psb_ioctls),
 	.irq_preinstall = psb_irq_preinstall,
-- 
2.14.2

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

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

* [PATCH v3 06/11] drm/msm: Use drm_fb_helper_lastclose() and _poll_changed()
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
                   ` (4 preceding siblings ...)
  2017-12-05 18:24 ` [PATCH v3 05/11] drm/gma500: " Noralf Trønnes
@ 2017-12-05 18:24 ` Noralf Trønnes
  2017-12-05 18:25 ` [PATCH v3 07/11] drm/nouveau: Use drm_fb_helper_output_poll_changed() Noralf Trønnes
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:24 UTC (permalink / raw)
  To: dri-devel
  Cc: Noralf Trønnes, jy0922.shim, daniel.vetter, tomi.valkeinen,
	sw0312.kim, linux, inki.dae, hdegoede, kyungmin.park, bskeggs,
	alexander.deucher, intel-gfx, christian.koenig, mark.yao

This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/msm/msm_drv.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 0a3ea3034e39..d90ef1d78a1b 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -37,16 +37,9 @@
 #define MSM_VERSION_MINOR	3
 #define MSM_VERSION_PATCHLEVEL	0
 
-static void msm_fb_output_poll_changed(struct drm_device *dev)
-{
-	struct msm_drm_private *priv = dev->dev_private;
-	if (priv->fbdev)
-		drm_fb_helper_hotplug_event(priv->fbdev);
-}
-
 static const struct drm_mode_config_funcs mode_config_funcs = {
 	.fb_create = msm_framebuffer_create,
-	.output_poll_changed = msm_fb_output_poll_changed,
+	.output_poll_changed = drm_fb_helper_output_poll_changed,
 	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = msm_atomic_commit,
 	.atomic_state_alloc = msm_atomic_state_alloc,
@@ -551,13 +544,6 @@ static void msm_postclose(struct drm_device *dev, struct drm_file *file)
 	context_close(ctx);
 }
 
-static void msm_lastclose(struct drm_device *dev)
-{
-	struct msm_drm_private *priv = dev->dev_private;
-	if (priv->fbdev)
-		drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev);
-}
-
 static irqreturn_t msm_irq(int irq, void *arg)
 {
 	struct drm_device *dev = arg;
@@ -866,7 +852,7 @@ static struct drm_driver msm_driver = {
 				DRIVER_MODESET,
 	.open               = msm_open,
 	.postclose           = msm_postclose,
-	.lastclose          = msm_lastclose,
+	.lastclose          = drm_fb_helper_lastclose,
 	.irq_handler        = msm_irq,
 	.irq_preinstall     = msm_irq_preinstall,
 	.irq_postinstall    = msm_irq_postinstall,
-- 
2.14.2

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

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

* [PATCH v3 07/11] drm/nouveau: Use drm_fb_helper_output_poll_changed()
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
                   ` (5 preceding siblings ...)
  2017-12-05 18:24 ` [PATCH v3 06/11] drm/msm: " Noralf Trønnes
@ 2017-12-05 18:25 ` Noralf Trønnes
  2017-12-05 18:25 ` [PATCH v3 08/11] drm/omap: Use drm_fb_helper_lastclose() and _poll_changed() Noralf Trønnes
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:25 UTC (permalink / raw)
  To: dri-devel
  Cc: daniel.vetter, tomi.valkeinen, sw0312.kim, linux, hdegoede,
	kyungmin.park, thierry.reding, bskeggs, alexander.deucher,
	intel-gfx, christian.koenig, mark.yao

This driver can use drm_fb_helper_output_poll_changed() instead of
its own nouveau_fbcon_output_poll_changed().

Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/nouveau/nouveau_display.c | 3 ++-
 drivers/gpu/drm/nouveau/nouveau_fbcon.c   | 8 --------
 drivers/gpu/drm/nouveau/nouveau_fbcon.h   | 2 --
 drivers/gpu/drm/nouveau/nouveau_vga.c     | 3 ++-
 drivers/gpu/drm/nouveau/nv50_display.c    | 2 +-
 5 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index 2e7785f49e6d..009713404cc4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -29,6 +29,7 @@
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
 
 #include <nvif/class.h>
 
@@ -292,7 +293,7 @@ nouveau_user_framebuffer_create(struct drm_device *dev,
 
 static const struct drm_mode_config_funcs nouveau_mode_config_funcs = {
 	.fb_create = nouveau_user_framebuffer_create,
-	.output_poll_changed = nouveau_fbcon_output_poll_changed,
+	.output_poll_changed = drm_fb_helper_output_poll_changed,
 };
 
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index c533d8e04afc..45a4572cd2fb 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -413,14 +413,6 @@ nouveau_fbcon_create(struct drm_fb_helper *helper,
 	return ret;
 }
 
-void
-nouveau_fbcon_output_poll_changed(struct drm_device *dev)
-{
-	struct nouveau_drm *drm = nouveau_drm(dev);
-	if (drm->fbcon)
-		drm_fb_helper_hotplug_event(&drm->fbcon->helper);
-}
-
 static int
 nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *fbcon)
 {
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.h b/drivers/gpu/drm/nouveau/nouveau_fbcon.h
index e2bca729721e..a6f192ea3fa6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.h
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.h
@@ -68,8 +68,6 @@ void nouveau_fbcon_set_suspend(struct drm_device *dev, int state);
 void nouveau_fbcon_accel_save_disable(struct drm_device *dev);
 void nouveau_fbcon_accel_restore(struct drm_device *dev);
 
-void nouveau_fbcon_output_poll_changed(struct drm_device *dev);
-
 extern int nouveau_nofbaccel;
 
 #endif /* __NV50_FBCON_H__ */
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
index 52e52a360fb1..3da5a4305aa4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
@@ -4,6 +4,7 @@
 
 #include <drm/drmP.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
 
 #include "nouveau_drv.h"
 #include "nouveau_acpi.h"
@@ -61,7 +62,7 @@ static void
 nouveau_switcheroo_reprobe(struct pci_dev *pdev)
 {
 	struct drm_device *dev = pci_get_drvdata(pdev);
-	nouveau_fbcon_output_poll_changed(dev);
+	drm_fb_helper_output_poll_changed(dev);
 }
 
 static bool
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index 65336948e807..b22c37bde13f 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -4311,7 +4311,7 @@ nv50_disp_atomic_state_alloc(struct drm_device *dev)
 static const struct drm_mode_config_funcs
 nv50_disp_func = {
 	.fb_create = nouveau_user_framebuffer_create,
-	.output_poll_changed = nouveau_fbcon_output_poll_changed,
+	.output_poll_changed = drm_fb_helper_output_poll_changed,
 	.atomic_check = nv50_disp_atomic_check,
 	.atomic_commit = nv50_disp_atomic_commit,
 	.atomic_state_alloc = nv50_disp_atomic_state_alloc,
-- 
2.14.2

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

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

* [PATCH v3 08/11] drm/omap: Use drm_fb_helper_lastclose() and _poll_changed()
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
                   ` (6 preceding siblings ...)
  2017-12-05 18:25 ` [PATCH v3 07/11] drm/nouveau: Use drm_fb_helper_output_poll_changed() Noralf Trønnes
@ 2017-12-05 18:25 ` Noralf Trønnes
  2017-12-05 18:25 ` [PATCH v3 09/11] drm/radeon: " Noralf Trønnes
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:25 UTC (permalink / raw)
  To: dri-devel
  Cc: Noralf Trønnes, jy0922.shim, daniel.vetter, tomi.valkeinen,
	sw0312.kim, linux, inki.dae, hdegoede, kyungmin.park, bskeggs,
	alexander.deucher, intel-gfx, christian.koenig, mark.yao

This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index cdf5b0601eba..96857c508ee0 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -46,14 +46,6 @@
  *                 devices
  */
 
-static void omap_fb_output_poll_changed(struct drm_device *dev)
-{
-	struct omap_drm_private *priv = dev->dev_private;
-	DBG("dev=%p", dev);
-	if (priv->fbdev)
-		drm_fb_helper_hotplug_event(priv->fbdev);
-}
-
 static void omap_atomic_wait_for_completion(struct drm_device *dev,
 					    struct drm_atomic_state *old_state)
 {
@@ -132,7 +124,7 @@ static const struct drm_mode_config_helper_funcs omap_mode_config_helper_funcs =
 
 static const struct drm_mode_config_funcs omap_mode_config_funcs = {
 	.fb_create = omap_framebuffer_create,
-	.output_poll_changed = omap_fb_output_poll_changed,
+	.output_poll_changed = drm_fb_helper_output_poll_changed,
 	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
@@ -467,28 +459,6 @@ static int dev_open(struct drm_device *dev, struct drm_file *file)
 	return 0;
 }
 
-/**
- * lastclose - clean up after all DRM clients have exited
- * @dev: DRM device
- *
- * Take care of cleaning up after all DRM clients have exited.  In the
- * mode setting case, we want to restore the kernel's initial mode (just
- * in case the last client left us in a bad state).
- */
-static void dev_lastclose(struct drm_device *dev)
-{
-	struct omap_drm_private *priv = dev->dev_private;
-	int ret;
-
-	DBG("lastclose: dev=%p", dev);
-
-	if (priv->fbdev) {
-		ret = drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev);
-		if (ret)
-			DBG("failed to restore crtc mode");
-	}
-}
-
 static const struct vm_operations_struct omap_gem_vm_ops = {
 	.fault = omap_gem_fault,
 	.open = drm_gem_vm_open,
@@ -511,7 +481,7 @@ static struct drm_driver omap_drm_driver = {
 	.driver_features = DRIVER_MODESET | DRIVER_GEM  | DRIVER_PRIME |
 		DRIVER_ATOMIC | DRIVER_RENDER,
 	.open = dev_open,
-	.lastclose = dev_lastclose,
+	.lastclose = drm_fb_helper_lastclose,
 #ifdef CONFIG_DEBUG_FS
 	.debugfs_init = omap_debugfs_init,
 #endif
-- 
2.14.2

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

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

* [PATCH v3 09/11] drm/radeon: Use drm_fb_helper_lastclose() and _poll_changed()
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
                   ` (7 preceding siblings ...)
  2017-12-05 18:25 ` [PATCH v3 08/11] drm/omap: Use drm_fb_helper_lastclose() and _poll_changed() Noralf Trønnes
@ 2017-12-05 18:25 ` Noralf Trønnes
  2017-12-05 18:25 ` [PATCH v3 10/11] drm/rockchip: " Noralf Trønnes
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:25 UTC (permalink / raw)
  To: dri-devel
  Cc: Noralf Trønnes, jy0922.shim, daniel.vetter, tomi.valkeinen,
	sw0312.kim, linux, inki.dae, hdegoede, kyungmin.park, bskeggs,
	alexander.deucher, intel-gfx, christian.koenig, mark.yao

This driver can use drm_fb_helper_lastclose() in its .lastclose function.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/radeon/radeon_display.c |  9 ++-------
 drivers/gpu/drm/radeon/radeon_fb.c      | 22 ----------------------
 drivers/gpu/drm/radeon/radeon_kms.c     |  5 ++---
 drivers/gpu/drm/radeon/radeon_mode.h    |  3 ---
 4 files changed, 4 insertions(+), 35 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index ddfe91efa61e..dfda5e0ed166 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -32,6 +32,7 @@
 
 #include <linux/pm_runtime.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_fb_helper.h>
 #include <drm/drm_plane_helper.h>
 #include <drm/drm_edid.h>
 
@@ -1362,15 +1363,9 @@ radeon_user_framebuffer_create(struct drm_device *dev,
 	return &radeon_fb->base;
 }
 
-static void radeon_output_poll_changed(struct drm_device *dev)
-{
-	struct radeon_device *rdev = dev->dev_private;
-	radeon_fb_output_poll_changed(rdev);
-}
-
 static const struct drm_mode_config_funcs radeon_mode_funcs = {
 	.fb_create = radeon_user_framebuffer_create,
-	.output_poll_changed = radeon_output_poll_changed
+	.output_poll_changed = drm_fb_helper_output_poll_changed,
 };
 
 static const struct drm_prop_enum_list radeon_tmds_pll_enum_list[] =
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index 33b821d6d018..57c5404a1654 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -306,12 +306,6 @@ static int radeonfb_create(struct drm_fb_helper *helper,
 	return ret;
 }
 
-void radeon_fb_output_poll_changed(struct radeon_device *rdev)
-{
-	if (rdev->mode_info.rfbdev)
-		drm_fb_helper_hotplug_event(&rdev->mode_info.rfbdev->helper);
-}
-
 static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfbdev)
 {
 	struct radeon_framebuffer *rfb = &rfbdev->rfb;
@@ -422,19 +416,3 @@ void radeon_fb_remove_connector(struct radeon_device *rdev, struct drm_connector
 	if (rdev->mode_info.rfbdev)
 		drm_fb_helper_remove_one_connector(&rdev->mode_info.rfbdev->helper, connector);
 }
-
-void radeon_fbdev_restore_mode(struct radeon_device *rdev)
-{
-	struct radeon_fbdev *rfbdev = rdev->mode_info.rfbdev;
-	struct drm_fb_helper *fb_helper;
-	int ret;
-
-	if (!rfbdev)
-		return;
-
-	fb_helper = &rfbdev->helper;
-
-	ret = drm_fb_helper_restore_fbdev_mode_unlocked(fb_helper);
-	if (ret)
-		DRM_DEBUG("failed to restore crtc mode\n");
-}
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index cde037f213d7..dec1e081f529 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -26,6 +26,7 @@
  *          Jerome Glisse
  */
 #include <drm/drmP.h>
+#include <drm/drm_fb_helper.h>
 #include "radeon.h"
 #include <drm/radeon_drm.h>
 #include "radeon_asic.h"
@@ -629,9 +630,7 @@ static int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file
  */
 void radeon_driver_lastclose_kms(struct drm_device *dev)
 {
-	struct radeon_device *rdev = dev->dev_private;
-
-	radeon_fbdev_restore_mode(rdev);
+	drm_fb_helper_lastclose(dev);
 	vga_switcheroo_process_delayed_switch();
 }
 
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
index ca0a7ed28c9b..3243e5e01432 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -984,9 +984,6 @@ int radeon_fbdev_init(struct radeon_device *rdev);
 void radeon_fbdev_fini(struct radeon_device *rdev);
 void radeon_fbdev_set_suspend(struct radeon_device *rdev, int state);
 bool radeon_fbdev_robj_is_fb(struct radeon_device *rdev, struct radeon_bo *robj);
-void radeon_fbdev_restore_mode(struct radeon_device *rdev);
-
-void radeon_fb_output_poll_changed(struct radeon_device *rdev);
 
 void radeon_crtc_handle_vblank(struct radeon_device *rdev, int crtc_id);
 
-- 
2.14.2

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

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

* [PATCH v3 10/11] drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed()
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
                   ` (8 preceding siblings ...)
  2017-12-05 18:25 ` [PATCH v3 09/11] drm/radeon: " Noralf Trønnes
@ 2017-12-05 18:25 ` Noralf Trønnes
  2017-12-05 18:25 ` [PATCH v3 11/11] drm/tegra: " Noralf Trønnes
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:25 UTC (permalink / raw)
  To: dri-devel
  Cc: Noralf Trønnes, jy0922.shim, daniel.vetter, tomi.valkeinen,
	sw0312.kim, linux, inki.dae, hdegoede, kyungmin.park, bskeggs,
	alexander.deucher, intel-gfx, christian.koenig, mark.yao

This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

Cc: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 9 +--------
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c  | 9 +--------
 2 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index 76d63de5921d..d85431400a0d 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -207,13 +207,6 @@ static void rockchip_drm_unbind(struct device *dev)
 	drm_dev_unref(drm_dev);
 }
 
-static void rockchip_drm_lastclose(struct drm_device *dev)
-{
-	struct rockchip_drm_private *priv = dev->dev_private;
-
-	drm_fb_helper_restore_fbdev_mode_unlocked(&priv->fbdev_helper);
-}
-
 static const struct file_operations rockchip_drm_driver_fops = {
 	.owner = THIS_MODULE,
 	.open = drm_open,
@@ -228,7 +221,7 @@ static const struct file_operations rockchip_drm_driver_fops = {
 static struct drm_driver rockchip_drm_driver = {
 	.driver_features	= DRIVER_MODESET | DRIVER_GEM |
 				  DRIVER_PRIME | DRIVER_ATOMIC,
-	.lastclose		= rockchip_drm_lastclose,
+	.lastclose		= drm_fb_helper_lastclose,
 	.gem_vm_ops		= &drm_gem_cma_vm_ops,
 	.gem_free_object_unlocked = rockchip_gem_free_object,
 	.dumb_create		= rockchip_gem_dumb_create,
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
index cd2ace0c3caa..e266539e04e5 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
@@ -167,20 +167,13 @@ rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
 	return ERR_PTR(ret);
 }
 
-static void rockchip_drm_output_poll_changed(struct drm_device *dev)
-{
-	struct rockchip_drm_private *private = dev->dev_private;
-
-	drm_fb_helper_hotplug_event(&private->fbdev_helper);
-}
-
 static const struct drm_mode_config_helper_funcs rockchip_mode_config_helpers = {
 	.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
 };
 
 static const struct drm_mode_config_funcs rockchip_drm_mode_config_funcs = {
 	.fb_create = rockchip_user_fb_create,
-	.output_poll_changed = rockchip_drm_output_poll_changed,
+	.output_poll_changed = drm_fb_helper_output_poll_changed,
 	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
-- 
2.14.2

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

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

* [PATCH v3 11/11] drm/tegra: Use drm_fb_helper_lastclose() and _poll_changed()
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
                   ` (9 preceding siblings ...)
  2017-12-05 18:25 ` [PATCH v3 10/11] drm/rockchip: " Noralf Trønnes
@ 2017-12-05 18:25 ` Noralf Trønnes
  2017-12-05 19:11 ` ✓ Fi.CI.BAT: success for drm/fb-helper: Add .last_close and .output_poll_changed helpers (rev3) Patchwork
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-05 18:25 UTC (permalink / raw)
  To: dri-devel
  Cc: Noralf Trønnes, jy0922.shim, daniel.vetter, tomi.valkeinen,
	sw0312.kim, linux, inki.dae, hdegoede, kyungmin.park, bskeggs,
	alexander.deucher, intel-gfx, christian.koenig, mark.yao

This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
It can also use drm_fb_helper_output_poll_changed() as its
.output_poll_changed callback.

Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/tegra/drm.c | 13 ++-----------
 drivers/gpu/drm/tegra/drm.h |  4 ----
 drivers/gpu/drm/tegra/fb.c  | 14 --------------
 3 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 52552b9b89ef..f157bc675269 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -120,7 +120,7 @@ static int tegra_atomic_commit(struct drm_device *drm,
 static const struct drm_mode_config_funcs tegra_drm_mode_funcs = {
 	.fb_create = tegra_fb_create,
 #ifdef CONFIG_DRM_FBDEV_EMULATION
-	.output_poll_changed = tegra_fb_output_poll_changed,
+	.output_poll_changed = drm_fb_helper_output_poll_changed,
 #endif
 	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = tegra_atomic_commit,
@@ -286,15 +286,6 @@ static void tegra_drm_context_free(struct tegra_drm_context *context)
 	kfree(context);
 }
 
-static void tegra_drm_lastclose(struct drm_device *drm)
-{
-#ifdef CONFIG_DRM_FBDEV_EMULATION
-	struct tegra_drm *tegra = drm->dev_private;
-
-	tegra_fbdev_restore_mode(tegra->fbdev);
-#endif
-}
-
 static struct host1x_bo *
 host1x_bo_lookup(struct drm_file *file, u32 handle)
 {
@@ -1100,7 +1091,7 @@ static struct drm_driver tegra_drm_driver = {
 	.unload = tegra_drm_unload,
 	.open = tegra_drm_open,
 	.postclose = tegra_drm_postclose,
-	.lastclose = tegra_drm_lastclose,
+	.lastclose = drm_fb_helper_lastclose,
 
 #if defined(CONFIG_DEBUG_FS)
 	.debugfs_init = tegra_debugfs_init,
diff --git a/drivers/gpu/drm/tegra/drm.h b/drivers/gpu/drm/tegra/drm.h
index ddae331ad8b6..0009f6ea21b6 100644
--- a/drivers/gpu/drm/tegra/drm.h
+++ b/drivers/gpu/drm/tegra/drm.h
@@ -188,10 +188,6 @@ int tegra_drm_fb_init(struct drm_device *drm);
 void tegra_drm_fb_exit(struct drm_device *drm);
 void tegra_drm_fb_suspend(struct drm_device *drm);
 void tegra_drm_fb_resume(struct drm_device *drm);
-#ifdef CONFIG_DRM_FBDEV_EMULATION
-void tegra_fbdev_restore_mode(struct tegra_fbdev *fbdev);
-void tegra_fb_output_poll_changed(struct drm_device *drm);
-#endif
 
 extern struct platform_driver tegra_dc_driver;
 extern struct platform_driver tegra_hdmi_driver;
diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
index 80540c1c66dc..8dfe3c6c217e 100644
--- a/drivers/gpu/drm/tegra/fb.c
+++ b/drivers/gpu/drm/tegra/fb.c
@@ -361,20 +361,6 @@ static void tegra_fbdev_exit(struct tegra_fbdev *fbdev)
 	drm_fb_helper_fini(&fbdev->base);
 	tegra_fbdev_free(fbdev);
 }
-
-void tegra_fbdev_restore_mode(struct tegra_fbdev *fbdev)
-{
-	if (fbdev)
-		drm_fb_helper_restore_fbdev_mode_unlocked(&fbdev->base);
-}
-
-void tegra_fb_output_poll_changed(struct drm_device *drm)
-{
-	struct tegra_drm *tegra = drm->dev_private;
-
-	if (tegra->fbdev)
-		drm_fb_helper_hotplug_event(&tegra->fbdev->base);
-}
 #endif
 
 int tegra_drm_fb_prepare(struct drm_device *drm)
-- 
2.14.2

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

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

* ✓ Fi.CI.BAT: success for drm/fb-helper: Add .last_close and .output_poll_changed helpers (rev3)
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
                   ` (10 preceding siblings ...)
  2017-12-05 18:25 ` [PATCH v3 11/11] drm/tegra: " Noralf Trønnes
@ 2017-12-05 19:11 ` Patchwork
  2017-12-05 21:11 ` [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Alex Deucher
  2017-12-05 21:18 ` ✗ Fi.CI.IGT: warning for drm/fb-helper: Add .last_close and .output_poll_changed helpers (rev3) Patchwork
  13 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2017-12-05 19:11 UTC (permalink / raw)
  To: Noralf Trønnes; +Cc: intel-gfx

== Series Details ==

Series: drm/fb-helper: Add .last_close and .output_poll_changed helpers (rev3)
URL   : https://patchwork.freedesktop.org/series/32332/
State : success

== Summary ==

Series 32332v3 drm/fb-helper: Add .last_close and .output_poll_changed helpers
https://patchwork.freedesktop.org/api/1.0/series/32332/revisions/3/mbox/

Test debugfs_test:
        Subgroup read_all_entries:
                dmesg-warn -> DMESG-FAIL (fi-elk-e7500) fdo#103989
Test gem_exec_reloc:
        Subgroup basic-cpu-active:
                pass       -> FAIL       (fi-gdg-551) fdo#102582

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

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:439s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:386s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:512s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:281s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:500s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:507s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:485s
fi-elk-e7500     total:224  pass:163  dwarn:14  dfail:1   fail:0   skip:45 
fi-gdg-551       total:288  pass:177  dwarn:1   dfail:0   fail:2   skip:108 time:271s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:542s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:358s
fi-hsw-4770r     total:288  pass:224  dwarn:0   dfail:0   fail:0   skip:64  time:261s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:482s
fi-ivb-3770      total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:448s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:526s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:475s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:537s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:588s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:464s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:541s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:559s
fi-skl-6700k     total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:515s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:503s
fi-snb-2520m     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:547s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:414s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:617s
fi-cnl-y         total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:626s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:492s
fi-byt-n2820 failed to collect. IGT log at Patchwork_7418/fi-byt-n2820/igt.log

0d0fe916f52ad8f05dddab384ae7c90bb62ebac4 drm-tip: 2017y-12m-05d-14h-52m-17s UTC integration manifest
55265d6c7050 drm/tegra: Use drm_fb_helper_lastclose() and _poll_changed()
9fafdf63c834 drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed()
df3bbded40da drm/radeon: Use drm_fb_helper_lastclose() and _poll_changed()
333f1890023d drm/omap: Use drm_fb_helper_lastclose() and _poll_changed()
0c6eec2e08a3 drm/nouveau: Use drm_fb_helper_output_poll_changed()
cdf2e7cf9bbb drm/msm: Use drm_fb_helper_lastclose() and _poll_changed()
6e8639cd8208 drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed()
0e6a351972ee drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()
f5ebbfb307a2 drm/armada: Use drm_fb_helper_lastclose() and _poll_changed()
1232ff1b16b0 drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed()
97f12a3e8c50 drm/amd/display: Use drm_fb_helper_poll_changed()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7418/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
                   ` (11 preceding siblings ...)
  2017-12-05 19:11 ` ✓ Fi.CI.BAT: success for drm/fb-helper: Add .last_close and .output_poll_changed helpers (rev3) Patchwork
@ 2017-12-05 21:11 ` Alex Deucher
  2017-12-06  9:14   ` Daniel Vetter
  2017-12-05 21:18 ` ✗ Fi.CI.IGT: warning for drm/fb-helper: Add .last_close and .output_poll_changed helpers (rev3) Patchwork
  13 siblings, 1 reply; 19+ messages in thread
From: Alex Deucher @ 2017-12-05 21:11 UTC (permalink / raw)
  To: Noralf Trønnes
  Cc: Daniel Vetter, Intel Graphics Development, Seung-Woo Kim,
	Russell King, Maling list - DRI developers, Hans de Goede,
	Kyungmin Park, Tomi Valkeinen, Ben Skeggs, Deucher, Alexander,
	Christian Koenig, mark.yao

On Tue, Dec 5, 2017 at 1:24 PM, Noralf Trønnes <noralf@tronnes.org> wrote:
> The helpers are applied and have reached airlied/drm-next.
>
> amd has gained another .poll_changed user since last.

Patches 1, 2, 9 applied to my -next tree.  Thanks!

Alex

>
> i915 doesn't really need the .poll_changed helper since it now does a
> sync and has to open code it after:
> drm/i915/fbdev: Serialise early hotplug events with async fbdev config
>
> vboxvideo will be re-sent when the helper functions have landed in
> Greg's staging tree.
>
> Noralf.
>
> Changes since version 2:
> - Helper functions have been applied
> - Add drm/amd/display: Use drm_fb_helper_poll_changed()
> - Rebase drm/amdgpu patch
> - Rebase drm/msm patch
> - Drop i915 patch, not applicable after:
>   drm/i915/fbdev: Serialise early hotplug events with async fbdev config
> - Drop vboxvideo patch, it will be re-sent when the helper functions
>   have reached Greg's staging tree.
>
> Changes since version 1:
> - drm_device.drm_fb_helper_private -> drm_device.fb_helper (Ville)
>
> Noralf Trønnes (11):
>   drm/amd/display: Use drm_fb_helper_poll_changed()
>   drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed()
>   drm/armada: Use drm_fb_helper_lastclose() and _poll_changed()
>   drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()
>   drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed()
>   drm/msm: Use drm_fb_helper_lastclose() and _poll_changed()
>   drm/nouveau: Use drm_fb_helper_output_poll_changed()
>   drm/omap: Use drm_fb_helper_lastclose() and _poll_changed()
>   drm/radeon: Use drm_fb_helper_lastclose() and _poll_changed()
>   drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed()
>   drm/tegra: Use drm_fb_helper_lastclose() and _poll_changed()
>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c       |  9 ++----
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.h       |  2 --
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c            | 27 ------------------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c           |  4 +--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h          |  4 ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
>  drivers/gpu/drm/armada/armada_drm.h               |  1 -
>  drivers/gpu/drm/armada/armada_drv.c               |  8 ++----
>  drivers/gpu/drm/armada/armada_fb.c                | 11 +-------
>  drivers/gpu/drm/armada/armada_fbdev.c             |  8 ------
>  drivers/gpu/drm/exynos/exynos_drm_drv.c           |  8 ++----
>  drivers/gpu/drm/exynos/exynos_drm_fb.c            |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c         | 18 ------------
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.h         |  2 --
>  drivers/gpu/drm/gma500/framebuffer.c              |  9 +-----
>  drivers/gpu/drm/gma500/psb_drv.c                  | 15 +---------
>  drivers/gpu/drm/msm/msm_drv.c                     | 18 ++----------
>  drivers/gpu/drm/nouveau/nouveau_display.c         |  3 +-
>  drivers/gpu/drm/nouveau/nouveau_fbcon.c           |  8 ------
>  drivers/gpu/drm/nouveau/nouveau_fbcon.h           |  2 --
>  drivers/gpu/drm/nouveau/nouveau_vga.c             |  3 +-
>  drivers/gpu/drm/nouveau/nv50_display.c            |  2 +-
>  drivers/gpu/drm/omapdrm/omap_drv.c                | 34 ++---------------------
>  drivers/gpu/drm/radeon/radeon_display.c           |  9 ++----
>  drivers/gpu/drm/radeon/radeon_fb.c                | 22 ---------------
>  drivers/gpu/drm/radeon/radeon_kms.c               |  5 ++--
>  drivers/gpu/drm/radeon/radeon_mode.h              |  3 --
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.c       |  9 +-----
>  drivers/gpu/drm/rockchip/rockchip_drm_fb.c        |  9 +-----
>  drivers/gpu/drm/tegra/drm.c                       | 13 ++-------
>  drivers/gpu/drm/tegra/drm.h                       |  4 ---
>  drivers/gpu/drm/tegra/fb.c                        | 14 ----------
>  32 files changed, 29 insertions(+), 259 deletions(-)
>
> --
> 2.14.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.IGT: warning for drm/fb-helper: Add .last_close and .output_poll_changed helpers (rev3)
  2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
                   ` (12 preceding siblings ...)
  2017-12-05 21:11 ` [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Alex Deucher
@ 2017-12-05 21:18 ` Patchwork
  13 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2017-12-05 21:18 UTC (permalink / raw)
  To: Noralf Trønnes; +Cc: intel-gfx

== Series Details ==

Series: drm/fb-helper: Add .last_close and .output_poll_changed helpers (rev3)
URL   : https://patchwork.freedesktop.org/series/32332/
State : warning

== Summary ==

Test kms_chv_cursor_fail:
        Subgroup pipe-b-128x128-top-edge:
                incomplete -> PASS       (shard-hsw)
Test drv_module_reload:
        Subgroup basic-no-display:
                dmesg-warn -> PASS       (shard-hsw) fdo#102707
Test prime_mmap_kms:
        Subgroup buffer-sharing:
                skip       -> PASS       (shard-snb)
Test kms_frontbuffer_tracking:
        Subgroup fbc-rgb101010-draw-render:
                skip       -> PASS       (shard-snb) fdo#103167
Test kms_flip:
        Subgroup vblank-vs-modeset-suspend-interruptible:
                skip       -> PASS       (shard-snb)
        Subgroup vblank-vs-dpms-suspend-interruptible:
                pass       -> INCOMPLETE (shard-hsw) fdo#103706
Test kms_atomic_transition:
        Subgroup plane-all-transition-fencing:
                pass       -> SKIP       (shard-hsw)
Test drv_selftest:
        Subgroup live_hangcheck:
                pass       -> INCOMPLETE (shard-snb) fdo#103880

fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103706 https://bugs.freedesktop.org/show_bug.cgi?id=103706
fdo#103880 https://bugs.freedesktop.org/show_bug.cgi?id=103880

shard-hsw        total:2620 pass:1505 dwarn:1   dfail:0   fail:10  skip:1103 time:8774s
shard-snb        total:2661 pass:1288 dwarn:2   dfail:0   fail:12  skip:1358 time:7965s
Blacklisted hosts:
shard-apl        total:2657 pass:1654 dwarn:2   dfail:0   fail:23  skip:977 time:13414s
shard-kbl        total:2620 pass:1755 dwarn:1   dfail:0   fail:24  skip:839 time:10705s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7418/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers
  2017-12-05 21:11 ` [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Alex Deucher
@ 2017-12-06  9:14   ` Daniel Vetter
  2017-12-08 12:21     ` Noralf Trønnes
  0 siblings, 1 reply; 19+ messages in thread
From: Daniel Vetter @ 2017-12-06  9:14 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Daniel Vetter, Intel Graphics Development, Seung-Woo Kim,
	Russell King, Maling list - DRI developers, Hans de Goede,
	Kyungmin Park, Tomi Valkeinen, Thierry Reding, Ben Skeggs,
	Deucher, Alexander, Christian Koenig, mark.yao

On Tue, Dec 05, 2017 at 04:11:26PM -0500, Alex Deucher wrote:
> On Tue, Dec 5, 2017 at 1:24 PM, Noralf Trønnes <noralf@tronnes.org> wrote:
> > The helpers are applied and have reached airlied/drm-next.
> >
> > amd has gained another .poll_changed user since last.
> 
> Patches 1, 2, 9 applied to my -next tree.  Thanks!

Imo if no one replies I'd push all the remaining ones to drm-misc-next at
the end of next week. There's been plenty of time for maintainers to check
this out, and it's a really nice cleanup imo.
-Daniel

> 
> Alex
> 
> >
> > i915 doesn't really need the .poll_changed helper since it now does a
> > sync and has to open code it after:
> > drm/i915/fbdev: Serialise early hotplug events with async fbdev config
> >
> > vboxvideo will be re-sent when the helper functions have landed in
> > Greg's staging tree.
> >
> > Noralf.
> >
> > Changes since version 2:
> > - Helper functions have been applied
> > - Add drm/amd/display: Use drm_fb_helper_poll_changed()
> > - Rebase drm/amdgpu patch
> > - Rebase drm/msm patch
> > - Drop i915 patch, not applicable after:
> >   drm/i915/fbdev: Serialise early hotplug events with async fbdev config
> > - Drop vboxvideo patch, it will be re-sent when the helper functions
> >   have reached Greg's staging tree.
> >
> > Changes since version 1:
> > - drm_device.drm_fb_helper_private -> drm_device.fb_helper (Ville)
> >
> > Noralf Trønnes (11):
> >   drm/amd/display: Use drm_fb_helper_poll_changed()
> >   drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed()
> >   drm/armada: Use drm_fb_helper_lastclose() and _poll_changed()
> >   drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()
> >   drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed()
> >   drm/msm: Use drm_fb_helper_lastclose() and _poll_changed()
> >   drm/nouveau: Use drm_fb_helper_output_poll_changed()
> >   drm/omap: Use drm_fb_helper_lastclose() and _poll_changed()
> >   drm/radeon: Use drm_fb_helper_lastclose() and _poll_changed()
> >   drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed()
> >   drm/tegra: Use drm_fb_helper_lastclose() and _poll_changed()
> >
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c       |  9 ++----
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_display.h       |  2 --
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c            | 27 ------------------
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c           |  4 +--
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h          |  4 ---
> >  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
> >  drivers/gpu/drm/armada/armada_drm.h               |  1 -
> >  drivers/gpu/drm/armada/armada_drv.c               |  8 ++----
> >  drivers/gpu/drm/armada/armada_fb.c                | 11 +-------
> >  drivers/gpu/drm/armada/armada_fbdev.c             |  8 ------
> >  drivers/gpu/drm/exynos/exynos_drm_drv.c           |  8 ++----
> >  drivers/gpu/drm/exynos/exynos_drm_fb.c            |  2 +-
> >  drivers/gpu/drm/exynos/exynos_drm_fbdev.c         | 18 ------------
> >  drivers/gpu/drm/exynos/exynos_drm_fbdev.h         |  2 --
> >  drivers/gpu/drm/gma500/framebuffer.c              |  9 +-----
> >  drivers/gpu/drm/gma500/psb_drv.c                  | 15 +---------
> >  drivers/gpu/drm/msm/msm_drv.c                     | 18 ++----------
> >  drivers/gpu/drm/nouveau/nouveau_display.c         |  3 +-
> >  drivers/gpu/drm/nouveau/nouveau_fbcon.c           |  8 ------
> >  drivers/gpu/drm/nouveau/nouveau_fbcon.h           |  2 --
> >  drivers/gpu/drm/nouveau/nouveau_vga.c             |  3 +-
> >  drivers/gpu/drm/nouveau/nv50_display.c            |  2 +-
> >  drivers/gpu/drm/omapdrm/omap_drv.c                | 34 ++---------------------
> >  drivers/gpu/drm/radeon/radeon_display.c           |  9 ++----
> >  drivers/gpu/drm/radeon/radeon_fb.c                | 22 ---------------
> >  drivers/gpu/drm/radeon/radeon_kms.c               |  5 ++--
> >  drivers/gpu/drm/radeon/radeon_mode.h              |  3 --
> >  drivers/gpu/drm/rockchip/rockchip_drm_drv.c       |  9 +-----
> >  drivers/gpu/drm/rockchip/rockchip_drm_fb.c        |  9 +-----
> >  drivers/gpu/drm/tegra/drm.c                       | 13 ++-------
> >  drivers/gpu/drm/tegra/drm.h                       |  4 ---
> >  drivers/gpu/drm/tegra/fb.c                        | 14 ----------
> >  32 files changed, 29 insertions(+), 259 deletions(-)
> >
> > --
> > 2.14.2
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

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

* Re: [PATCH v3 04/11] drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()
  2017-12-05 18:24 ` [PATCH v3 04/11] drm/exynos: " Noralf Trønnes
@ 2017-12-07  0:50   ` Inki Dae
  2017-12-07 14:22     ` Noralf Trønnes
  0 siblings, 1 reply; 19+ messages in thread
From: Inki Dae @ 2017-12-07  0:50 UTC (permalink / raw)
  To: Noralf Trønnes, dri-devel
  Cc: daniel.vetter, tomi.valkeinen, sw0312.kim, linux, hdegoede,
	kyungmin.park, thierry.reding, bskeggs, alexander.deucher,
	intel-gfx, christian.koenig, mark.yao



2017년 12월 06일 03:24에 Noralf Trønnes 이(가) 쓴 글:
> This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
> It can also use drm_fb_helper_output_poll_changed() as its
> .output_poll_changed callback.
> 
> 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: Noralf Trønnes <noralf@tronnes.org>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Seems you missed my ACK,
http://www.spinics.net/lists/intel-gfx/msg146188.html

Thanks,
Inki Dae

> ---
>  drivers/gpu/drm/exynos/exynos_drm_drv.c   |  8 ++------
>  drivers/gpu/drm/exynos/exynos_drm_fb.c    |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 18 ------------------
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.h |  2 --
>  4 files changed, 3 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index 82b72425a42f..2f2bd6e37e62 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -16,6 +16,7 @@
>  #include <drm/drm_atomic.h>
>  #include <drm/drm_atomic_helper.h>
>  #include <drm/drm_crtc_helper.h>
> +#include <drm/drm_fb_helper.h>
>  
>  #include <linux/component.h>
>  
> @@ -89,11 +90,6 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
>  	file->driver_priv = NULL;
>  }
>  
> -static void exynos_drm_lastclose(struct drm_device *dev)
> -{
> -	exynos_drm_fbdev_restore_mode(dev);
> -}
> -
>  static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
>  	.fault = exynos_drm_gem_fault,
>  	.open = drm_gem_vm_open,
> @@ -140,7 +136,7 @@ static struct drm_driver exynos_drm_driver = {
>  	.driver_features	= DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME
>  				  | DRIVER_ATOMIC | DRIVER_RENDER,
>  	.open			= exynos_drm_open,
> -	.lastclose		= exynos_drm_lastclose,
> +	.lastclose		= drm_fb_helper_lastclose,
>  	.postclose		= exynos_drm_postclose,
>  	.gem_free_object_unlocked = exynos_drm_gem_free_object,
>  	.gem_vm_ops		= &exynos_drm_gem_vm_ops,
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c
> index 8208df56a88f..0faaf829f5bf 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
> @@ -205,7 +205,7 @@ static struct drm_mode_config_helper_funcs exynos_drm_mode_config_helpers = {
>  
>  static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = {
>  	.fb_create = exynos_user_fb_create,
> -	.output_poll_changed = exynos_drm_output_poll_changed,
> +	.output_poll_changed = drm_fb_helper_output_poll_changed,
>  	.atomic_check = exynos_atomic_check,
>  	.atomic_commit = drm_atomic_helper_commit,
>  };
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> index dfb66ecf417b..132dd52d0ac7 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
> @@ -270,24 +270,6 @@ void exynos_drm_fbdev_fini(struct drm_device *dev)
>  	private->fb_helper = NULL;
>  }
>  
> -void exynos_drm_fbdev_restore_mode(struct drm_device *dev)
> -{
> -	struct exynos_drm_private *private = dev->dev_private;
> -
> -	if (!private || !private->fb_helper)
> -		return;
> -
> -	drm_fb_helper_restore_fbdev_mode_unlocked(private->fb_helper);
> -}
> -
> -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;
> -
> -	drm_fb_helper_hotplug_event(fb_helper);
> -}
> -
>  void exynos_drm_fbdev_suspend(struct drm_device *dev)
>  {
>  	struct exynos_drm_private *private = dev->dev_private;
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
> index 645d1bb7f665..b33847223a85 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
> @@ -19,8 +19,6 @@
>  
>  int exynos_drm_fbdev_init(struct drm_device *dev);
>  void exynos_drm_fbdev_fini(struct drm_device *dev);
> -void exynos_drm_fbdev_restore_mode(struct drm_device *dev);
> -void exynos_drm_output_poll_changed(struct drm_device *dev);
>  void exynos_drm_fbdev_suspend(struct drm_device *drm);
>  void exynos_drm_fbdev_resume(struct drm_device *drm);
>  
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v3 04/11] drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()
  2017-12-07  0:50   ` Inki Dae
@ 2017-12-07 14:22     ` Noralf Trønnes
  0 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-07 14:22 UTC (permalink / raw)
  To: Inki Dae, dri-devel
  Cc: jy0922.shim, daniel.vetter, tomi.valkeinen, sw0312.kim, linux,
	hdegoede, kyungmin.park, bskeggs, alexander.deucher, intel-gfx,
	christian.koenig, mark.yao


Den 07.12.2017 01.50, skrev Inki Dae:
>
> 2017년 12월 06일 03:24에 Noralf Trønnes 이(가) 쓴 글:
>> This driver can use drm_fb_helper_lastclose() as its .lastclose callback.
>> It can also use drm_fb_helper_output_poll_changed() as its
>> .output_poll_changed callback.
>>
>> 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: Noralf Trønnes <noralf@tronnes.org>
>> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Seems you missed my ACK,
> http://www.spinics.net/lists/intel-gfx/msg146188.html

Thanks for reminding me.

Noralf.

> Thanks,
> Inki Dae
>
>> ---
>>   drivers/gpu/drm/exynos/exynos_drm_drv.c   |  8 ++------
>>   drivers/gpu/drm/exynos/exynos_drm_fb.c    |  2 +-
>>   drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 18 ------------------
>>   drivers/gpu/drm/exynos/exynos_drm_fbdev.h |  2 --
>>   4 files changed, 3 insertions(+), 27 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
>> index 82b72425a42f..2f2bd6e37e62 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
>> @@ -16,6 +16,7 @@
>>   #include <drm/drm_atomic.h>
>>   #include <drm/drm_atomic_helper.h>
>>   #include <drm/drm_crtc_helper.h>
>> +#include <drm/drm_fb_helper.h>
>>   
>>   #include <linux/component.h>
>>   
>> @@ -89,11 +90,6 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
>>   	file->driver_priv = NULL;
>>   }
>>   
>> -static void exynos_drm_lastclose(struct drm_device *dev)
>> -{
>> -	exynos_drm_fbdev_restore_mode(dev);
>> -}
>> -
>>   static const struct vm_operations_struct exynos_drm_gem_vm_ops = {
>>   	.fault = exynos_drm_gem_fault,
>>   	.open = drm_gem_vm_open,
>> @@ -140,7 +136,7 @@ static struct drm_driver exynos_drm_driver = {
>>   	.driver_features	= DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME
>>   				  | DRIVER_ATOMIC | DRIVER_RENDER,
>>   	.open			= exynos_drm_open,
>> -	.lastclose		= exynos_drm_lastclose,
>> +	.lastclose		= drm_fb_helper_lastclose,
>>   	.postclose		= exynos_drm_postclose,
>>   	.gem_free_object_unlocked = exynos_drm_gem_free_object,
>>   	.gem_vm_ops		= &exynos_drm_gem_vm_ops,
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c
>> index 8208df56a88f..0faaf829f5bf 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
>> @@ -205,7 +205,7 @@ static struct drm_mode_config_helper_funcs exynos_drm_mode_config_helpers = {
>>   
>>   static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = {
>>   	.fb_create = exynos_user_fb_create,
>> -	.output_poll_changed = exynos_drm_output_poll_changed,
>> +	.output_poll_changed = drm_fb_helper_output_poll_changed,
>>   	.atomic_check = exynos_atomic_check,
>>   	.atomic_commit = drm_atomic_helper_commit,
>>   };
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
>> index dfb66ecf417b..132dd52d0ac7 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
>> @@ -270,24 +270,6 @@ void exynos_drm_fbdev_fini(struct drm_device *dev)
>>   	private->fb_helper = NULL;
>>   }
>>   
>> -void exynos_drm_fbdev_restore_mode(struct drm_device *dev)
>> -{
>> -	struct exynos_drm_private *private = dev->dev_private;
>> -
>> -	if (!private || !private->fb_helper)
>> -		return;
>> -
>> -	drm_fb_helper_restore_fbdev_mode_unlocked(private->fb_helper);
>> -}
>> -
>> -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;
>> -
>> -	drm_fb_helper_hotplug_event(fb_helper);
>> -}
>> -
>>   void exynos_drm_fbdev_suspend(struct drm_device *dev)
>>   {
>>   	struct exynos_drm_private *private = dev->dev_private;
>> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
>> index 645d1bb7f665..b33847223a85 100644
>> --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
>> +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.h
>> @@ -19,8 +19,6 @@
>>   
>>   int exynos_drm_fbdev_init(struct drm_device *dev);
>>   void exynos_drm_fbdev_fini(struct drm_device *dev);
>> -void exynos_drm_fbdev_restore_mode(struct drm_device *dev);
>> -void exynos_drm_output_poll_changed(struct drm_device *dev);
>>   void exynos_drm_fbdev_suspend(struct drm_device *drm);
>>   void exynos_drm_fbdev_resume(struct drm_device *drm);
>>   
>>

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

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

* Re: [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers
  2017-12-06  9:14   ` Daniel Vetter
@ 2017-12-08 12:21     ` Noralf Trønnes
  0 siblings, 0 replies; 19+ messages in thread
From: Noralf Trønnes @ 2017-12-08 12:21 UTC (permalink / raw)
  To: Daniel Vetter, Alex Deucher
  Cc: Daniel Vetter, Intel Graphics Development, Seung-Woo Kim,
	Russell King, Maling list - DRI developers, Hans de Goede,
	Kyungmin Park, Tomi Valkeinen, Ben Skeggs, Deucher, Alexander,
	Christian Koenig, mark.yao


Den 06.12.2017 10.14, skrev Daniel Vetter:
> On Tue, Dec 05, 2017 at 04:11:26PM -0500, Alex Deucher wrote:
>> On Tue, Dec 5, 2017 at 1:24 PM, Noralf Trønnes <noralf@tronnes.org> wrote:
>>> The helpers are applied and have reached airlied/drm-next.
>>>
>>> amd has gained another .poll_changed user since last.
>> Patches 1, 2, 9 applied to my -next tree.  Thanks!
> Imo if no one replies I'd push all the remaining ones to drm-misc-next at
> the end of next week. There's been plenty of time for maintainers to check
> this out, and it's a really nice cleanup imo.

Thanks, rest of series applied to drm-misc-next.

Noralf.

> -Daniel
>
>> Alex
>>
>>> i915 doesn't really need the .poll_changed helper since it now does a
>>> sync and has to open code it after:
>>> drm/i915/fbdev: Serialise early hotplug events with async fbdev config
>>>
>>> vboxvideo will be re-sent when the helper functions have landed in
>>> Greg's staging tree.
>>>
>>> Noralf.
>>>
>>> Changes since version 2:
>>> - Helper functions have been applied
>>> - Add drm/amd/display: Use drm_fb_helper_poll_changed()
>>> - Rebase drm/amdgpu patch
>>> - Rebase drm/msm patch
>>> - Drop i915 patch, not applicable after:
>>>    drm/i915/fbdev: Serialise early hotplug events with async fbdev config
>>> - Drop vboxvideo patch, it will be re-sent when the helper functions
>>>    have reached Greg's staging tree.
>>>
>>> Changes since version 1:
>>> - drm_device.drm_fb_helper_private -> drm_device.fb_helper (Ville)
>>>
>>> Noralf Trønnes (11):
>>>    drm/amd/display: Use drm_fb_helper_poll_changed()
>>>    drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed()
>>>    drm/armada: Use drm_fb_helper_lastclose() and _poll_changed()
>>>    drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()
>>>    drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed()
>>>    drm/msm: Use drm_fb_helper_lastclose() and _poll_changed()
>>>    drm/nouveau: Use drm_fb_helper_output_poll_changed()
>>>    drm/omap: Use drm_fb_helper_lastclose() and _poll_changed()
>>>    drm/radeon: Use drm_fb_helper_lastclose() and _poll_changed()
>>>    drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed()
>>>    drm/tegra: Use drm_fb_helper_lastclose() and _poll_changed()
>>>
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_display.c       |  9 ++----
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_display.h       |  2 --
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c            | 27 ------------------
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c           |  4 +--
>>>   drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h          |  4 ---
>>>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
>>>   drivers/gpu/drm/armada/armada_drm.h               |  1 -
>>>   drivers/gpu/drm/armada/armada_drv.c               |  8 ++----
>>>   drivers/gpu/drm/armada/armada_fb.c                | 11 +-------
>>>   drivers/gpu/drm/armada/armada_fbdev.c             |  8 ------
>>>   drivers/gpu/drm/exynos/exynos_drm_drv.c           |  8 ++----
>>>   drivers/gpu/drm/exynos/exynos_drm_fb.c            |  2 +-
>>>   drivers/gpu/drm/exynos/exynos_drm_fbdev.c         | 18 ------------
>>>   drivers/gpu/drm/exynos/exynos_drm_fbdev.h         |  2 --
>>>   drivers/gpu/drm/gma500/framebuffer.c              |  9 +-----
>>>   drivers/gpu/drm/gma500/psb_drv.c                  | 15 +---------
>>>   drivers/gpu/drm/msm/msm_drv.c                     | 18 ++----------
>>>   drivers/gpu/drm/nouveau/nouveau_display.c         |  3 +-
>>>   drivers/gpu/drm/nouveau/nouveau_fbcon.c           |  8 ------
>>>   drivers/gpu/drm/nouveau/nouveau_fbcon.h           |  2 --
>>>   drivers/gpu/drm/nouveau/nouveau_vga.c             |  3 +-
>>>   drivers/gpu/drm/nouveau/nv50_display.c            |  2 +-
>>>   drivers/gpu/drm/omapdrm/omap_drv.c                | 34 ++---------------------
>>>   drivers/gpu/drm/radeon/radeon_display.c           |  9 ++----
>>>   drivers/gpu/drm/radeon/radeon_fb.c                | 22 ---------------
>>>   drivers/gpu/drm/radeon/radeon_kms.c               |  5 ++--
>>>   drivers/gpu/drm/radeon/radeon_mode.h              |  3 --
>>>   drivers/gpu/drm/rockchip/rockchip_drm_drv.c       |  9 +-----
>>>   drivers/gpu/drm/rockchip/rockchip_drm_fb.c        |  9 +-----
>>>   drivers/gpu/drm/tegra/drm.c                       | 13 ++-------
>>>   drivers/gpu/drm/tegra/drm.h                       |  4 ---
>>>   drivers/gpu/drm/tegra/fb.c                        | 14 ----------
>>>   32 files changed, 29 insertions(+), 259 deletions(-)
>>>
>>> --
>>> 2.14.2
>>>
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

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

end of thread, other threads:[~2017-12-08 12:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-05 18:24 [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Noralf Trønnes
2017-12-05 18:24 ` [PATCH v3 01/11] drm/amd/display: Use drm_fb_helper_poll_changed() Noralf Trønnes
2017-12-05 18:24 ` [PATCH v3 02/11] drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed() Noralf Trønnes
2017-12-05 18:24 ` [PATCH v3 03/11] drm/armada: " Noralf Trønnes
2017-12-05 18:24 ` [PATCH v3 04/11] drm/exynos: " Noralf Trønnes
2017-12-07  0:50   ` Inki Dae
2017-12-07 14:22     ` Noralf Trønnes
2017-12-05 18:24 ` [PATCH v3 05/11] drm/gma500: " Noralf Trønnes
2017-12-05 18:24 ` [PATCH v3 06/11] drm/msm: " Noralf Trønnes
2017-12-05 18:25 ` [PATCH v3 07/11] drm/nouveau: Use drm_fb_helper_output_poll_changed() Noralf Trønnes
2017-12-05 18:25 ` [PATCH v3 08/11] drm/omap: Use drm_fb_helper_lastclose() and _poll_changed() Noralf Trønnes
2017-12-05 18:25 ` [PATCH v3 09/11] drm/radeon: " Noralf Trønnes
2017-12-05 18:25 ` [PATCH v3 10/11] drm/rockchip: " Noralf Trønnes
2017-12-05 18:25 ` [PATCH v3 11/11] drm/tegra: " Noralf Trønnes
2017-12-05 19:11 ` ✓ Fi.CI.BAT: success for drm/fb-helper: Add .last_close and .output_poll_changed helpers (rev3) Patchwork
2017-12-05 21:11 ` [PATCH v3 00/11] drm/fb-helper: Add .last_close and .output_poll_changed helpers Alex Deucher
2017-12-06  9:14   ` Daniel Vetter
2017-12-08 12:21     ` Noralf Trønnes
2017-12-05 21:18 ` ✗ Fi.CI.IGT: warning for drm/fb-helper: Add .last_close and .output_poll_changed helpers (rev3) Patchwork

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.