drm/fb-helper: Add .last_close and .output_poll_changed helpers
Subsystems (16)
cover drm/fb-helper: Add .last_close and .output_poll_changed helpers
This patchset adds fbdev .last_close and .output_poll_changed helpers to reduce fbdev emulation footprint in drivers.
I don't know which drivers have their own tree or not, so if you want me to apply your patch to drm-misc, please let me know.
I will do a separate patchset for the cma helper drivers.
Noralf.
Noralf Trønnes (15):
drm/fb-helper: Handle function NULL argument
drm: Add drm_device->drm_fb_helper_private pointer drm/fb-helper: Add .last_close and .output_poll_changed helpers 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/i915: Use drm_fb_helper_output_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()
staging: vboxvideo: Use drm_fb_helper_lastclose()
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 +--- 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/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/drm_fb_helper.c | 69 +++++++++++++++++++++++------ 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/i915/intel_display.c | 2 +- drivers/gpu/drm/i915/intel_drv.h | 5 --- drivers/gpu/drm/i915/intel_fbdev.c | 8 ---- 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 ------ drivers/staging/vboxvideo/vbox_drv.c | 2 +- drivers/staging/vboxvideo/vbox_drv.h | 1 - drivers/staging/vboxvideo/vbox_main.c | 12 ----- include/drm/drm_device.h | 9 ++++ include/drm/drm_fb_helper.h | 11 +++++ 39 files changed, 106 insertions(+), 297 deletions(-)
Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/15 drm/fb-helper: Handle function NULL argument
Make functions tolerate that the drm_fb_helper argument is NULL. This is useful for drivers that continue probing when fbdev emulation fails and not having to do this check themselves.
Update docs for functions that already handles this.
--- drivers/gpu/drm/drm_fb_helper.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +17 -11
@@ -150,6 +150,9 @@ int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, {int err; +if (!fb_helper) +return 0 ; +mutex_lock (&fb_helper->lock); err =__drm_fb_helper_add_one_connector (fb_helper, connector);mutex_unlock (&fb_helper->lock);
@@ -161,7 +164,7 @@ EXPORT_SYMBOL(drm_fb_helper_add_one_connector);/** * drm_fb_helper_single_add_all_connectors() - add all connectors to fbdev * emulation helper -* @fb_helper: fbdev initialized with drm_fb_helper_init +* @fb_helper: fbdev initialized with drm_fb_helper_init, can be NULL * * This functions adds all the available connectors for use with the given * fb_helper. This is a separate step to allow drivers to freely assign
@@ -179,7 +182,7 @@ int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper)struct drm_connector_list_iter conn_iter;int i, ret =0 ; -if (!drm_fbdev_emulation) +if (!drm_fbdev_emulation || !fb_helper)return 0 ;mutex_lock (&fb_helper->lock);
@@ -245,6 +248,9 @@ int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper, {int err; +if (!fb_helper) +return 0 ; +mutex_lock (&fb_helper->lock); err =__drm_fb_helper_remove_one_connector (fb_helper, connector);mutex_unlock (&fb_helper->lock);
@@ -484,7 +490,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)/** * drm_fb_helper_restore_fbdev_mode_unlocked - restore fbdev configuration -* @fb_helper: fbcon to restore +* @fb_helper: driver-allocated fbdev helper, can be NULL * * This should be called from driver's drm &drm_driver.lastclose callback * when implementing an fbcon on top of kms using this helper. This ensures that
@@ -498,7 +504,7 @@ int drm_fb_helper_restore_fbdev_mode_unlocked(struct drm_fb_helper *fb_helper)bool do_delayed;int ret; -if (!drm_fbdev_emulation) +if (!drm_fbdev_emulation || !fb_helper)return -ENODEV ;if (READ_ONCE (fb_helper->deferred_setup))
@@ -883,7 +889,7 @@ EXPORT_SYMBOL(drm_fb_helper_alloc_fbi);/** * drm_fb_helper_unregister_fbi - unregister fb_info framebuffer device -* @fb_helper: driver-allocated fbdev helper +* @fb_helper: driver-allocated fbdev helper, can be NULL * * A wrapper around unregister_framebuffer, to release the fb_info * framebuffer device. This must be called before releasing all resources for
@@ -898,7 +904,7 @@ EXPORT_SYMBOL(drm_fb_helper_unregister_fbi);/** * drm_fb_helper_fini - finialize a &struct drm_fb_helper -* @fb_helper: driver-allocated fbdev helper +* @fb_helper: driver-allocated fbdev helper, can be NULL * * This cleans up all remaining resources associated with @fb_helper. Must be * called after drm_fb_helper_unlink_fbi() was called.
@@ -937,7 +943,7 @@ EXPORT_SYMBOL(drm_fb_helper_fini);/** * drm_fb_helper_unlink_fbi - wrapper around unlink_framebuffer -* @fb_helper: driver-allocated fbdev helper +* @fb_helper: driver-allocated fbdev helper, can be NULL * * A wrapper around unlink_framebuffer implemented by fbdev core */
@@ -1138,7 +1144,7 @@ EXPORT_SYMBOL(drm_fb_helper_cfb_imageblit);/** * drm_fb_helper_set_suspend - wrapper around fb_set_suspend -* @fb_helper: driver-allocated fbdev helper +* @fb_helper: driver-allocated fbdev helper, can be NULL * @suspend: whether to suspend or resume * * A wrapper around fb_set_suspend implemented by fbdev core.
@@ -1155,7 +1161,7 @@ EXPORT_SYMBOL(drm_fb_helper_set_suspend);/** * drm_fb_helper_set_suspend_unlocked - wrapper around fb_set_suspend that also * takes the console lock -* @fb_helper: driver-allocated fbdev helper +* @fb_helper: driver-allocated fbdev helper, can be NULL * @suspend: whether to suspend or resume * * A wrapper around fb_set_suspend() that takes the console lock. If the lock
@@ -2568,7 +2574,7 @@ EXPORT_SYMBOL(drm_fb_helper_initial_config);/** * drm_fb_helper_hotplug_event - respond to a hotplug notification by * probing all the outputs attached to the fb -* @fb_helper: the drm_fb_helper +* @fb_helper: driver-allocated fbdev helper, can be NULL * * Scan the connectors attached to the fb_helper and try to put together a * setup after notification of a change in output configuration.
@@ -2590,7 +2596,7 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) {int err =0 ; -if (!drm_fbdev_emulation) +if (!drm_fbdev_emulation || !fb_helper)return 0 ;mutex_lock (&fb_helper->lock);
Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/15 drm: Add drm_device->drm_fb_helper_private pointer
In reply to Noralf Trønnesdrm_fb_helper is *the* way of doing fbdev emulation so add a pointer to struct drm_device. This makes it possible to add callback helpers for .last_close and .output_poll_changed further reducing fbdev emulation footprint in drivers. The pointer is set by drm_fb_helper_init() and cleared by drm_fb_helper_fini().
---
This patch was initially part of the patchset: drm/tinydrm: Use vmalloc BO Changes since previous version:
- Change member name: fbdev -> drm_fb_helper_private
- Expand docs
- Set and clear pointer in drm_fb_helper_init/fini()
drivers/gpu/drm/drm_fb_helper.c | 13 +++++++++++-- include/drm/drm_device.h | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +11 -2
@@ -799,8 +799,10 @@ int drm_fb_helper_init(struct drm_device *dev,struct drm_mode_config *config = &dev->mode_config;int i; -if (!drm_fbdev_emulation) +if (!drm_fbdev_emulation) { + dev->drm_fb_helper_private = fb_helper;return 0 ; + }if (!max_conn_count)return -EINVAL ;
@@ -835,6 +837,8 @@ int drm_fb_helper_init(struct drm_device *dev, i++; } + dev->drm_fb_helper_private = fb_helper; +return 0 ; out_free:drm_fb_helper_crtc_free (fb_helper);
@@ -913,7 +917,12 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) {struct fb_info *info; -if (!drm_fbdev_emulation || !fb_helper) +if (!fb_helper) +return ; + + fb_helper->dev->drm_fb_helper_private =NULL ; + +if (!drm_fbdev_emulation)return ;cancel_work_sync (&fb_helper->resume_work);
include/drm/drm_device.h +9 -0
@@ -17,6 +17,7 @@ struct drm_vblank_crtc;struct drm_sg_mem ;struct drm_local_map ;struct drm_vma_offset_manager ; +struct drm_fb_helper ;struct inode ;
@@ -185,6 +186,14 @@ struct drm_device {struct drm_vma_offset_manager *vma_offset_manager;/*@} */ int switch_power_state; + +/** +* @drm_fb_helper_private: +* +* Pointer to the fbdev emulation structure. +* Set by drm_fb_helper_init() and cleared by drm_fb_helper_fini(). +*/ + struct drm_fb_helper *drm_fb_helper_private; };#endif
Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/15] drm: Add drm_device->drm_fb_helper_private pointer
Quoted 6 lines · Noralf Trønnes
drm_fb_helperis *the* way of doing fbdev emulation so add a pointer to structdrm_device. This makes it possible to add callback helpers for .last_close and .output_poll_changed further reducing fbdev emulation footprint in drivers. The pointer is set bydrm_fb_helper_init()and cleared bydrm_fb_helper_fini().
Quoted 8 lines
Signed-off-by Noralf Trønnes <[email protected]>---
This patch was initially part of the patchset: drm/tinydrm: Use vmalloc BO Changes since previous version:
- Change member name: fbdev ->drm_fb_helper_private
- Expand docs
- Set and clear pointer in drm_fb_helper_init/fini()
Quoted 74 lines
drivers/gpu/drm/drm_fb_helper.c | 13 +++++++++++-- include/drm/drm_device.h | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_fb_helper.c +11
-2@@ -799,8 +799,10 @@ int drm_fb_helper_init(struct drm_device *dev,struct drm_mode_config *config = &dev->mode_config;int i; -if (!drm_fbdev_emulation) +if (!drm_fbdev_emulation) { + dev->drm_fb_helper_private = fb_helper;return 0 ; + }if (!max_conn_count)return -EINVAL ;@@ -835,6 +837,8 @@ int drm_fb_helper_init(struct drm_device *dev, i++; } + dev->drm_fb_helper_private = fb_helper; +return 0 ; out_free:drm_fb_helper_crtc_free (fb_helper);@@ -913,7 +917,12 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) {struct fb_info *info; -if (!drm_fbdev_emulation || !fb_helper) +if (!fb_helper) +return ; + + fb_helper->dev->drm_fb_helper_private =NULL ; + +if (!drm_fbdev_emulation)return ;cancel_work_sync (&fb_helper->resume_work);include/drm/drm_device.h +9
-0@@ -17,6 +17,7 @@ struct drm_vblank_crtc;struct drm_sg_mem ;struct drm_local_map ;struct drm_vma_offset_manager ; +struct drm_fb_helper ;struct inode ;@@ -185,6 +186,14 @@ struct drm_device {struct drm_vma_offset_manager *vma_offset_manager;/*@} */ int switch_power_state; + +/** +* @drm_fb_helper_private: +* +* Pointer to the fbdev emulation structure. +* Set by drm_fb_helper_init() and cleared by drm_fb_helper_fini(). +*/ + struct drm_fb_helper *drm_fb_helper_private; };#endif Signature · 1 line
2.14.2
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/15] drm: Add drm_device->drm_fb_helper_private pointer
In reply to Noralf TrønnesQuoted 72 lines · Noralf Trønnes
drm_fb_helperis *the* way of doing fbdev emulation so add a pointer to structdrm_device. This makes it possible to add callback helpers for .last_close and .output_poll_changed further reducing fbdev emulation footprint in drivers. The pointer is set bydrm_fb_helper_init()and cleared bydrm_fb_helper_fini().Signed-off-by Noralf Trønnes <[email protected]>---
This patch was initially part of the patchset: drm/tinydrm: Use vmalloc BO Changes since previous version:
- Change member name: fbdev ->drm_fb_helper_private
- Expand docs
- Set and clear pointer in drm_fb_helper_init/fini()drivers/gpu/drm/drm_fb_helper.c | 13 +++++++++++-- include/drm/drm_device.h | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_fb_helper.c +11
-2@@ -799,8 +799,10 @@ int drm_fb_helper_init(struct drm_device *dev,struct drm_mode_config *config = &dev->mode_config;int i; -if (!drm_fbdev_emulation) +if (!drm_fbdev_emulation) { + dev->drm_fb_helper_private = fb_helper;return 0 ; + }if (!max_conn_count)return -EINVAL ;@@ -835,6 +837,8 @@ int drm_fb_helper_init(struct drm_device *dev, i++; } + dev->drm_fb_helper_private = fb_helper; +return 0 ; out_free:drm_fb_helper_crtc_free (fb_helper);@@ -913,7 +917,12 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) {struct fb_info *info; -if (!drm_fbdev_emulation || !fb_helper) +if (!fb_helper) +return ; + + fb_helper->dev->drm_fb_helper_private =NULL ; + +if (!drm_fbdev_emulation)return ;cancel_work_sync (&fb_helper->resume_work);include/drm/drm_device.h +1
-0@@ -17,6 +17,7 @@ struct drm_vblank_crtc;struct drm_sg_mem ;struct drm_local_map ;struct drm_vma_offset_manager ; +struct drm_fb_helper ;struct inode ;@@ -185,6 +186,14 @@ struct drm_device {struct drm_vma_offset_manager *vma_offset_manager;
include/drm/drm_device.h struct drm_device { · line 196
Quoted 10 lines
include/drm/drm_device.h +8
-0/*@} */ int switch_power_state; + +/** +* @drm_fb_helper_private: +* +* Pointer to the fbdev emulation structure. +* Set by drm_fb_helper_init() and cleared by drm_fb_helper_fini(). +*/ +struct drm_fb_helper *drm_fb_helper_private;
Just 'fb_helper' maybe? Not sure what the _private here is supposed to mean, and drm_ seems very much redundant.
Quoted 10 lines
include/drm/drm_device.h +0
-0};#endif Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/15] drm: Add drm_device->drm_fb_helper_private pointer
Den 20.10.2017 15.52, skrev Ville Syrjälä:
Quoted 71 lines · Noralf Trønnes
Quoted 70 lines
drm_fb_helperis *the* way of doing fbdev emulation so add a pointer to structdrm_device. This makes it possible to add callback helpers for .last_close and .output_poll_changed further reducing fbdev emulation footprint in drivers. The pointer is set bydrm_fb_helper_init()and cleared bydrm_fb_helper_fini().Signed-off-by Noralf Trønnes <[email protected]>---
This patch was initially part of the patchset: drm/tinydrm: Use vmalloc BO Changes since previous version:
- Change member name: fbdev ->drm_fb_helper_private
- Expand docs
- Set and clear pointer in drm_fb_helper_init/fini()drivers/gpu/drm/drm_fb_helper.c | 13 +++++++++++-- include/drm/drm_device.h | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_fb_helper.c +11
-2@@ -799,8 +799,10 @@ int drm_fb_helper_init(struct drm_device *dev,struct drm_mode_config *config = &dev->mode_config;int i; -if (!drm_fbdev_emulation) +if (!drm_fbdev_emulation) { + dev->drm_fb_helper_private = fb_helper;return 0 ; + }if (!max_conn_count)return -EINVAL ;@@ -835,6 +837,8 @@ int drm_fb_helper_init(struct drm_device *dev, i++; } + dev->drm_fb_helper_private = fb_helper; +return 0 ; out_free:drm_fb_helper_crtc_free (fb_helper);@@ -913,7 +917,12 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) {struct fb_info *info; -if (!drm_fbdev_emulation || !fb_helper) +if (!fb_helper) +return ; + + fb_helper->dev->drm_fb_helper_private =NULL ; + +if (!drm_fbdev_emulation)return ;cancel_work_sync (&fb_helper->resume_work);include/drm/drm_device.h +1
-0@@ -17,6 +17,7 @@ struct drm_vblank_crtc;struct drm_sg_mem ;struct drm_local_map ;struct drm_vma_offset_manager ; +struct drm_fb_helper ;struct inode ;
Quoted 14 lines
include/drm/drm_device.h struct drm_device { · line 196
Quoted 12 lines
include/drm/drm_device.h +8
-0@@ -185,6 +186,14 @@ struct drm_device {struct drm_vma_offset_manager *vma_offset_manager;/*@} */ int switch_power_state; + +/** +* @drm_fb_helper_private: +* +* Pointer to the fbdev emulation structure. +* Set by drm_fb_helper_init() and cleared by drm_fb_helper_fini(). +*/ +struct drm_fb_helper *drm_fb_helper_private;Just '
fb_helper' maybe? Not sure what the_privatehere is supposed to mean, anddrm_seems very much redundant.
I first called it fbdev, Daniel suggested fbdev_helper_private, then I took it all the way and called it drm_fb_helper_private. I believe the _private part is an indication that this is not part of the core, but a helper, like drm_plane->helper_private.
fb_helper is the common variable name used in drm_fb_helper (which really should have been called drm_fbdev_helper imo).
These are the names that drivers use:
struct amdgpu_fbdev *rfbdev;
struct drm_fb_helper *fbdev;
struct ast_fbdev *fbdev;
struct drm_fb_helper fb.helper;
struct cirrus_fbdev *gfbdev;
struct drm_fb_helper fb_helper;
struct drm_fb_helper *fb_helper;
void *fbdev;
struct hibmc_fbdev *fbdev;
struct mga_fbdev *mfbdev;
struct drm_fb_helper *fbdev;
struct nouveau_fbdev *fbcon;
struct drm_fb_helper *fbdev;
struct qxl_fbdev *qfbdev;
struct radeon_fbdev *rfbdev;
struct drm_fb_helper fbdev_helper;
struct tegra_fbdev *fbdev;
struct udl_fbdev *fbdev;
struct virtio_gpu_fbdev *vgfbdev;
struct vbox_fbdev *fbdev;
Noralf.
Quoted 10 lines
Quoted 10 lines
include/drm/drm_device.h +0
-0};#endif Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/15] drm: Add drm_device->drm_fb_helper_private pointer
Quoted 88 lines · Noralf Trønnes
Den 20.10.2017 15.52, skrev Ville Syrjälä:
Quoted 71 lines · Noralf Trønnes
Quoted 70 lines
drm_fb_helperis *the* way of doing fbdev emulation so add a pointer to structdrm_device. This makes it possible to add callback helpers for .last_close and .output_poll_changed further reducing fbdev emulation footprint in drivers. The pointer is set bydrm_fb_helper_init()and cleared bydrm_fb_helper_fini().Signed-off-by Noralf Trønnes <[email protected]>---
This patch was initially part of the patchset: drm/tinydrm: Use vmalloc BO Changes since previous version:
- Change member name: fbdev ->drm_fb_helper_private
- Expand docs
- Set and clear pointer in drm_fb_helper_init/fini()drivers/gpu/drm/drm_fb_helper.c | 13 +++++++++++-- include/drm/drm_device.h | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_fb_helper.c +11
-2@@ -799,8 +799,10 @@ int drm_fb_helper_init(struct drm_device *dev,struct drm_mode_config *config = &dev->mode_config;int i; -if (!drm_fbdev_emulation) +if (!drm_fbdev_emulation) { + dev->drm_fb_helper_private = fb_helper;return 0 ; + }if (!max_conn_count)return -EINVAL ;@@ -835,6 +837,8 @@ int drm_fb_helper_init(struct drm_device *dev, i++; } + dev->drm_fb_helper_private = fb_helper; +return 0 ; out_free:drm_fb_helper_crtc_free (fb_helper);@@ -913,7 +917,12 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) {struct fb_info *info; -if (!drm_fbdev_emulation || !fb_helper) +if (!fb_helper) +return ; + + fb_helper->dev->drm_fb_helper_private =NULL ; + +if (!drm_fbdev_emulation)return ;cancel_work_sync (&fb_helper->resume_work);include/drm/drm_device.h +1
-0@@ -17,6 +17,7 @@ struct drm_vblank_crtc;struct drm_sg_mem ;struct drm_local_map ;struct drm_vma_offset_manager ; +struct drm_fb_helper ;struct inode ;Quoted 14 lines
include/drm/drm_device.h struct drm_device { · line 196
Quoted 12 lines
include/drm/drm_device.h +8
-0@@ -185,6 +186,14 @@ struct drm_device {struct drm_vma_offset_manager *vma_offset_manager;/*@} */ int switch_power_state; + +/** +* @drm_fb_helper_private: +* +* Pointer to the fbdev emulation structure. +* Set by drm_fb_helper_init() and cleared by drm_fb_helper_fini(). +*/ +struct drm_fb_helper *drm_fb_helper_private;Just '
fb_helper' maybe? Not sure what the_privatehere is supposed to mean, anddrm_seems very much redundant.
Quoted 4 lines
I first called it fbdev, Daniel suggested
fbdev_helper_private, then I took it all the way and called itdrm_fb_helper_private. I believe the_privatepart is an indication that this is not part of the core, but a helper, likedrm_plane->helper_private.
IMO those we should rename to helper_funcs since that's what they always are. IIRC they used to be void* and then the _private made more sense to me since you couldn't directly know what they were pointing at.
To me _private means that it's totally up to driver to specify what to put there (eg. like we have private_flags in the mode structure).
And I believe the "helper" part in "fb_helper" should be enough of a hint to anyone that this has something to do with a helper ;)
Quoted 3 lines
fb_helperis the common variable name used indrm_fb_helper(which really should have been calleddrm_fbdev_helperimo).
Yeah. On a first glance one might think drm_fb_helper has something to do with drm_framebuffers.
Quoted 36 lines
These are the names that drivers use:
struct
amdgpu_fbdev*rfbdev;
struct drm_fb_helper *fbdev;
structast_fbdev*fbdev;
structdrm_fb_helperfb.helper;
struct cirrus_fbdev *gfbdev;
struct drm_fb_helperfb_helper;
structdrm_fb_helper*fb_helper;
void *fbdev;
structhibmc_fbdev*fbdev;
structmga_fbdev*mfbdev;
structdrm_fb_helper*fbdev;
structnouveau_fbdev*fbcon;
structdrm_fb_helper*fbdev;
structqxl_fbdev*qfbdev;
structradeon_fbdev*rfbdev;
structdrm_fb_helperfbdev_helper;
structtegra_fbdev*fbdev;
structudl_fbdev*fbdev;
structvirtio_gpu_fbdev*vgfbdev;
structvbox_fbdev*fbdev;Noralf.
Quoted 10 lines
Quoted 10 lines
include/drm/drm_device.h +0
-0};#endif Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/15] drm: Add drm_device->drm_fb_helper_private pointer
Den 20.10.2017 18.00, skrev Ville Syrjälä:
Quoted 95 lines · Noralf Trønnes
Quoted 86 lines
Den 20.10.2017 15.52, skrev Ville Syrjälä:
Quoted 71 lines · Noralf Trønnes
Quoted 70 lines
drm_fb_helperis *the* way of doing fbdev emulation so add a pointer to structdrm_device. This makes it possible to add callback helpers for .last_close and .output_poll_changed further reducing fbdev emulation footprint in drivers. The pointer is set bydrm_fb_helper_init()and cleared bydrm_fb_helper_fini().Signed-off-by Noralf Trønnes <[email protected]>---
This patch was initially part of the patchset: drm/tinydrm: Use vmalloc BO Changes since previous version:
- Change member name: fbdev ->drm_fb_helper_private
- Expand docs
- Set and clear pointer in drm_fb_helper_init/fini()drivers/gpu/drm/drm_fb_helper.c | 13 +++++++++++-- include/drm/drm_device.h | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_fb_helper.c +11
-2@@ -799,8 +799,10 @@ int drm_fb_helper_init(struct drm_device *dev,struct drm_mode_config *config = &dev->mode_config;int i; -if (!drm_fbdev_emulation) +if (!drm_fbdev_emulation) { + dev->drm_fb_helper_private = fb_helper;return 0 ; + }if (!max_conn_count)return -EINVAL ;@@ -835,6 +837,8 @@ int drm_fb_helper_init(struct drm_device *dev, i++; } + dev->drm_fb_helper_private = fb_helper; +return 0 ; out_free:drm_fb_helper_crtc_free (fb_helper);@@ -913,7 +917,12 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) {struct fb_info *info; -if (!drm_fbdev_emulation || !fb_helper) +if (!fb_helper) +return ; + + fb_helper->dev->drm_fb_helper_private =NULL ; + +if (!drm_fbdev_emulation)return ;cancel_work_sync (&fb_helper->resume_work);include/drm/drm_device.h +1
-0@@ -17,6 +17,7 @@ struct drm_vblank_crtc;struct drm_sg_mem ;struct drm_local_map ;struct drm_vma_offset_manager ; +struct drm_fb_helper ;struct inode ;Quoted 14 lines
include/drm/drm_device.h struct drm_device { · line 196
Quoted 12 lines
include/drm/drm_device.h +8
-0@@ -185,6 +186,14 @@ struct drm_device {struct drm_vma_offset_manager *vma_offset_manager;/*@} */ int switch_power_state; + +/** +* @drm_fb_helper_private: +* +* Pointer to the fbdev emulation structure. +* Set by drm_fb_helper_init() and cleared by drm_fb_helper_fini(). +*/ +struct drm_fb_helper *drm_fb_helper_private;Just '
fb_helper' maybe? Not sure what the_privatehere is supposed to mean, anddrm_seems very much redundant.Quoted 4 lines
I first called it fbdev, Daniel suggested
fbdev_helper_private, then I took it all the way and called itdrm_fb_helper_private. I believe the_privatepart is an indication that this is not part of the core, but a helper, likedrm_plane->helper_private.IMO those we should rename to
helper_funcssince that's what they always are. IIRC they used to be void* and then the_privatemade more sense to me since you couldn't directly know what they were pointing at.
Quoted 5 lines
To me
_privatemeans that it's totally up to driver to specify what to put there (eg. like we haveprivate_flagsin the mode structure).And I believe the "helper" part in "
fb_helper" should be enough of a hint to anyone that this has something to do with a helper ;)
Daniel, do you have any objections to calling it: fb_helper?
Noralf.
Quoted 40 lines
Quoted 2 lines
fb_helperis the common variable name used indrm_fb_helper(which really should have been calleddrm_fbdev_helperimo).Yeah. On a first glance one might think
drm_fb_helperhas something to do withdrm_framebuffers.Quoted 35 lines
These are the names that drivers use:
struct
amdgpu_fbdev*rfbdev;
struct drm_fb_helper *fbdev;
structast_fbdev*fbdev;
structdrm_fb_helperfb.helper;
struct cirrus_fbdev *gfbdev;
struct drm_fb_helperfb_helper;
structdrm_fb_helper*fb_helper;
void *fbdev;
structhibmc_fbdev*fbdev;
structmga_fbdev*mfbdev;
structdrm_fb_helper*fbdev;
structnouveau_fbdev*fbcon;
structdrm_fb_helper*fbdev;
structqxl_fbdev*qfbdev;
structradeon_fbdev*rfbdev;
structdrm_fb_helperfbdev_helper;
structtegra_fbdev*fbdev;
structudl_fbdev*fbdev;
structvirtio_gpu_fbdev*vgfbdev;
structvbox_fbdev*fbdev;Noralf.
Quoted 10 lines
Quoted 10 lines
include/drm/drm_device.h +0
-0};#endif Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 02/15] drm: Add drm_device->drm_fb_helper_private pointer
Quoted 90 lines · Noralf Trønnes
Den 20.10.2017 18.00, skrev Ville Syrjälä:
Quoted 88 lines · Noralf Trønnes
Quoted 79 lines
Den 20.10.2017 15.52, skrev Ville Syrjälä:
Quoted 70 lines · Noralf Trønnes
Quoted 69 lines
drm_fb_helperis *the* way of doing fbdev emulation so add a pointer to structdrm_device. This makes it possible to add callback helpers for .last_close and .output_poll_changed further reducing fbdev emulation footprint in drivers. The pointer is set bydrm_fb_helper_init()and cleared bydrm_fb_helper_fini().Signed-off-by Noralf Trønnes <[email protected]>---
This patch was initially part of the patchset: drm/tinydrm: Use vmalloc BO Changes since previous version:
- Change member name: fbdev ->drm_fb_helper_private
- Expand docs
- Set and clear pointer in drm_fb_helper_init/fini()drivers/gpu/drm/drm_fb_helper.c | 13 +++++++++++-- include/drm/drm_device.h | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-)drivers/gpu/drm/drm_fb_helper.c +11
-2@@ -799,8 +799,10 @@ int drm_fb_helper_init(struct drm_device *dev,struct drm_mode_config *config = &dev->mode_config;int i; -if (!drm_fbdev_emulation) +if (!drm_fbdev_emulation) { + dev->drm_fb_helper_private = fb_helper;return 0 ; + }if (!max_conn_count)return -EINVAL ;@@ -835,6 +837,8 @@ int drm_fb_helper_init(struct drm_device *dev, i++; } + dev->drm_fb_helper_private = fb_helper; +return 0 ; out_free:drm_fb_helper_crtc_free (fb_helper);@@ -913,7 +917,12 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) {struct fb_info *info; -if (!drm_fbdev_emulation || !fb_helper) +if (!fb_helper) +return ; + + fb_helper->dev->drm_fb_helper_private =NULL ; + +if (!drm_fbdev_emulation)return ;cancel_work_sync (&fb_helper->resume_work);include/drm/drm_device.h +3
-0@@ -17,6 +17,7 @@ struct drm_vblank_crtc;struct drm_sg_mem ;struct drm_local_map ;struct drm_vma_offset_manager ; +struct drm_fb_helper ;struct inode ;@@ -185,6 +186,14 @@ struct drm_device {struct drm_vma_offset_manager *vma_offset_manager;/*@} */ int switch_power_state; + +/** Quoted 8 lines
include/drm/drm_device.h struct drm_device { · line 196
Quoted 6 lines
include/drm/drm_device.h +6
-0+* @drm_fb_helper_private: +* +* Pointer to the fbdev emulation structure. +* Set by drm_fb_helper_init() and cleared by drm_fb_helper_fini(). +*/ +struct drm_fb_helper *drm_fb_helper_private;Just '
fb_helper' maybe? Not sure what the_privatehere is supposed to mean, anddrm_seems very much redundant.Quoted 4 lines
I first called it fbdev, Daniel suggested
fbdev_helper_private, then I took it all the way and called itdrm_fb_helper_private. I believe the_privatepart is an indication that this is not part of the core, but a helper, likedrm_plane->helper_private.IMO those we should rename to
helper_funcssince that's what they always are. IIRC they used to be void* and then the_privatemade more sense to me since you couldn't directly know what they were pointing at.
Quoted 7 lines
Quoted 5 lines
To me
_privatemeans that it's totally up to driver to specify what to put there (eg. like we haveprivate_flagsin the mode structure).And I believe the "helper" part in "
fb_helper" should be enough of a hint to anyone that this has something to do with a helper ;)Daniel, do you have any objections to calling it:
fb_helper?
I retract my bikeshed, looks like you&Ville are much more informed :-) -Daniel
Quoted 43 lines
Noralf.
Quoted 39 lines
Quoted 2 lines
fb_helperis the common variable name used indrm_fb_helper(which really should have been calleddrm_fbdev_helperimo).Yeah. On a first glance one might think
drm_fb_helperhas something to do withdrm_framebuffers.Quoted 34 lines
These are the names that drivers use:
struct
amdgpu_fbdev*rfbdev;
struct drm_fb_helper *fbdev;
structast_fbdev*fbdev;
structdrm_fb_helperfb.helper;
struct cirrus_fbdev *gfbdev;
struct drm_fb_helperfb_helper;
structdrm_fb_helper*fb_helper;
void *fbdev;
structhibmc_fbdev*fbdev;
structmga_fbdev*mfbdev;
structdrm_fb_helper*fbdev;
structnouveau_fbdev*fbcon;
structdrm_fb_helper*fbdev;
structqxl_fbdev*qfbdev;
structradeon_fbdev*rfbdev;
structdrm_fb_helperfbdev_helper;
structtegra_fbdev*fbdev;
structudl_fbdev*fbdev;
structvirtio_gpu_fbdev*vgfbdev;
structvbox_fbdev*fbdev;Noralf.
Quoted 9 lines
Quoted 9 lines
include/drm/drm_device.h +0
-0};#endif Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/15 drm/fb-helper: Add .last_close and .output_poll_changed helpers
In reply to Noralf TrønnesThis adds helpers for the drm_driver->last_close and the drm_mode_config_funcs->output_poll_changed callbacks.
--- drivers/gpu/drm/drm_fb_helper.c | 28 ++++++++++++++++++++++++++++ include/drm/drm_fb_helper.h | 11 +++++++++++ 2 files changed, 39 insertions(+)
drivers/gpu/drm/drm_fb_helper.c +28 -0
@@ -2633,6 +2633,34 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) }EXPORT_SYMBOL (drm_fb_helper_hotplug_event); +/** +* drm_fb_helper_lastclose - DRM driver lastclose helper for fbdev emulation +* @dev: DRM device +* +* This function can be used as the &drm_driver->lastclose callback for drivers +* that only need to call drm_fb_helper_restore_fbdev_mode_unlocked(). +*/ +void drm_fb_helper_lastclose (struct drm_device *dev) +{ +drm_fb_helper_restore_fbdev_mode_unlocked (dev->drm_fb_helper_private); +} +EXPORT_SYMBOL (drm_fb_helper_lastclose); + +/** +* drm_fb_helper_output_poll_changed - DRM mode config \.output_poll_changed +* helper for fbdev emulation +* @dev: DRM device +* +* This function can be used as the +* &drm_mode_config_funcs.output_poll_changed callback for drivers that only +* need to call drm_fb_helper_hotplug_event(). +*/ +void drm_fb_helper_output_poll_changed (struct drm_device *dev) +{ +drm_fb_helper_hotplug_event (dev->drm_fb_helper_private); +} +EXPORT_SYMBOL (drm_fb_helper_output_poll_changed); +/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) * but the module doesn't depend on any fb console symbols. At least * attempt to load fbcon to avoid leaving the system without a usable console.
include/drm/drm_fb_helper.h +11 -0
@@ -310,6 +310,9 @@ drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn);int drm_fb_helper_add_one_connector (struct drm_fb_helper *fb_helper,struct drm_connector *connector);int drm_fb_helper_remove_one_connector (struct drm_fb_helper *fb_helper,struct drm_connector *connector); + +void drm_fb_helper_lastclose (struct drm_device *dev); +void drm_fb_helper_output_poll_changed (struct drm_device *dev);#else static inline void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
@@ -507,6 +510,14 @@ drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,return 0 ; } +static inline void drm_fb_helper_lastclose (struct drm_device *dev) +{ +} + +static inline void drm_fb_helper_output_poll_changed (struct drm_device *dev) +{ +} +#endif static inline int
Signature · 6 lines
2.14.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/15 drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed()
In reply to Noralf TrønnesThis 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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 ++------- 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 ---- 4 files changed, 3 insertions(+), 41 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +2 -7
@@ -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; } -static 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[] =
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +0 -27
@@ -288,12 +288,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;
@@ -397,24 +391,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" ); -}
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -3
@@ -785,9 +785,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 (); }
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +0 -4
@@ -570,10 +570,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);
Signature · 6 lines
2.14.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/15 drm/armada: Use drm_fb_helper_lastclose() and _poll_changed()
In reply to Noralf TrønnesThis 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.
--- 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(-)
drivers/gpu/drm/armada/armada_drm.h +0 -1
@@ -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 );
drivers/gpu/drm/armada/armada_drv.c +2 -6
@@ -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,
drivers/gpu/drm/armada/armada_fb.c +1 -10
@@ -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, };
drivers/gpu/drm/armada/armada_fbdev.c +0 -8
@@ -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;
Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 05/15] drm/armada: Use drm_fb_helper_lastclose() and _poll_changed()
Quoted 5 lines · Noralf Trønnes
This driver can use
drm_fb_helper_lastclose()as its .lastclose callback. It can also usedrm_fb_helper_output_poll_changed()as its .output_poll_changed callback.Cc Russell King <[email protected]>
Thanks.
Quoted 93 lines
Signed-off-by Noralf Trønnes <[email protected]>--- 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(-)drivers/gpu/drm/armada/armada_drm.h +0
-1@@ -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 );drivers/gpu/drm/armada/armada_drv.c +2
-6@@ -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,drivers/gpu/drm/armada/armada_fb.c +1
-10@@ -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, };drivers/gpu/drm/armada/armada_fbdev.c +0
-8@@ -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;Signature · 1 line
2.14.2
Signature · 7 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/15 drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed()
In reply to Noralf TrønnesThis 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.
--- 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(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +2 -6
@@ -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,
drivers/gpu/drm/exynos/exynos_drm_fb.c +1 -1
@@ -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, };
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +0 -18
@@ -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;
drivers/gpu/drm/exynos/exynos_drm_fbdev.h +0 -2
@@ -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);
Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 7/15 drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed()
In reply to Noralf TrønnesThis 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.
--- drivers/gpu/drm/gma500/framebuffer.c | 9 +-------- drivers/gpu/drm/gma500/psb_drv.c | 15 +-------------- 2 files changed, 2 insertions(+), 22 deletions(-)
drivers/gpu/drm/gma500/framebuffer.c +1 -8
@@ -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)
drivers/gpu/drm/gma500/psb_drv.c +1 -14
@@ -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,
Signature · 6 lines
2.14.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/15 drm/i915: Use drm_fb_helper_output_poll_changed()
In reply to Noralf TrønnesThis driver can use drm_fb_helper_output_poll_changed() as its .output_poll_changed callback.
--- drivers/gpu/drm/i915/intel_display.c | 2 +- drivers/gpu/drm/i915/intel_drv.h | 5 ----- drivers/gpu/drm/i915/intel_fbdev.c | 8 -------- 3 files changed, 1 insertion(+), 14 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
@@ -14123,7 +14123,7 @@ static void intel_atomic_state_free(struct drm_atomic_state *state)static const struct drm_mode_config_funcs intel_mode_funcs = { .fb_create = intel_user_framebuffer_create, .get_format_info = intel_get_format_info, - .output_poll_changed = intel_fbdev_output_poll_changed, + .output_poll_changed = drm_fb_helper_output_poll_changed, .atomic_check = intel_atomic_check, .atomic_commit = intel_atomic_commit, .atomic_state_alloc = intel_atomic_state_alloc,
drivers/gpu/drm/i915/intel_drv.h +0 -5
@@ -1607,7 +1607,6 @@ extern void intel_fbdev_initial_config_async(struct drm_device *dev);extern void intel_fbdev_unregister (struct drm_i915_private *dev_priv);extern void intel_fbdev_fini (struct drm_i915_private *dev_priv);extern void intel_fbdev_set_suspend (struct drm_device *dev,int state,bool synchronous); -extern void intel_fbdev_output_poll_changed (struct drm_device *dev);extern void intel_fbdev_restore_mode (struct drm_device *dev);#else static inline int intel_fbdev_init (struct drm_device *dev)
@@ -1631,10 +1630,6 @@ static inline void intel_fbdev_set_suspend(struct drm_device *dev, int state, bo { } -static inline void intel_fbdev_output_poll_changed (struct drm_device *dev) -{ -} -static inline void intel_fbdev_restore_mode (struct drm_device *dev) { }
drivers/gpu/drm/i915/intel_fbdev.c +0 -8
@@ -796,14 +796,6 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronousconsole_unlock (); } -void intel_fbdev_output_poll_changed (struct drm_device *dev) -{ -struct intel_fbdev *ifbdev =to_i915 (dev)->fbdev; - -if (ifbdev) -drm_fb_helper_hotplug_event (&ifbdev->helper); -} -void intel_fbdev_restore_mode (struct drm_device *dev) {struct intel_fbdev *ifbdev =to_i915 (dev)->fbdev;
Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 9/15 drm/msm: Use drm_fb_helper_lastclose() and _poll_changed()
In reply to Noralf TrønnesThis 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.
--- drivers/gpu/drm/msm/msm_drv.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-)
drivers/gpu/drm/msm/msm_drv.c +2 -16
@@ -34,16 +34,9 @@#define MSM_VERSION_MINOR 2#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 = msm_atomic_check, .atomic_commit = msm_atomic_commit, .atomic_state_alloc = msm_atomic_state_alloc,
@@ -545,13 +538,6 @@ static void msm_postclose(struct drm_device *dev, struct drm_file *file)kfree (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;
@@ -825,7 +811,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,
Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 10/15 drm/nouveau: Use drm_fb_helper_output_poll_changed()
In reply to Noralf TrønnesThis driver can use drm_fb_helper_output_poll_changed() instead of its own nouveau_fbcon_output_poll_changed().
--- 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(-)
drivers/gpu/drm/nouveau/nouveau_display.c +2 -1
@@ -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, };
drivers/gpu/drm/nouveau/nouveau_fbcon.c +0 -8
@@ -411,14 +411,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) {
drivers/gpu/drm/nouveau/nouveau_fbcon.h +0 -2
@@ -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__ */
drivers/gpu/drm/nouveau/nouveau_vga.c +2 -1
@@ -3,6 +3,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"
@@ -60,7 +61,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
drivers/gpu/drm/nouveau/nv50_display.c +1 -1
@@ -4308,7 +4308,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,
Signature · 6 lines
2.14.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 11/15 drm/omap: Use drm_fb_helper_lastclose() and _poll_changed()
In reply to Noralf TrønnesThis 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.
--- drivers/gpu/drm/omapdrm/omap_drv.c | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +2 -32
@@ -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
Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 12/15 drm/radeon: Use drm_fb_helper_lastclose() and _poll_changed()
In reply to Noralf TrønnesThis 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.
--- 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(-)
drivers/gpu/drm/radeon/radeon_display.c +2 -7
@@ -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[] =
drivers/gpu/drm/radeon/radeon_fb.c +0 -22
@@ -307,12 +307,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;
@@ -423,19 +417,3 @@ void radeon_fb_remove_connector(struct radeon_device *rdev, struct drm_connectorif (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" ); -}
drivers/gpu/drm/radeon/radeon_kms.c +2 -3
@@ -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"
@@ -636,9 +637,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 (); }
drivers/gpu/drm/radeon/radeon_mode.h +0 -3
@@ -988,9 +988,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);
Signature · 6 lines
2.14.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 13/15 drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed()
In reply to Noralf TrønnesThis 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.
--- 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(-)
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +1 -8
@@ -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,
drivers/gpu/drm/rockchip/rockchip_drm_fb.c +1 -8
@@ -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, };
Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 14/15 drm/tegra: Use drm_fb_helper_lastclose() and _poll_changed()
In reply to Noralf TrønnesThis 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.
--- 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(-)
drivers/gpu/drm/tegra/drm.c +2 -11
@@ -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,
@@ -287,15 +287,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,
drivers/gpu/drm/tegra/drm.h +0 -4
@@ -290,10 +290,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;
drivers/gpu/drm/tegra/fb.c +0 -14
@@ -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)
Signature · 6 lines
2.14.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 15/15 staging: vboxvideo: Use drm_fb_helper_lastclose()
In reply to Noralf TrønnesThis driver can use drm_fb_helper_lastclose() as its .lastclose callback.
--- drivers/staging/vboxvideo/vbox_drv.c | 2 +- drivers/staging/vboxvideo/vbox_drv.h | 1 - drivers/staging/vboxvideo/vbox_main.c | 12 ------------ 3 files changed, 1 insertion(+), 14 deletions(-)
drivers/staging/vboxvideo/vbox_drv.c +1 -1
@@ -229,7 +229,7 @@ static struct drm_driver driver = { .load = vbox_driver_load, .unload = vbox_driver_unload, - .lastclose = vbox_driver_lastclose, + .lastclose = drm_fb_helper_lastclose, .master_set = vbox_master_set, .master_drop = vbox_master_drop,
drivers/staging/vboxvideo/vbox_drv.h +0 -1
@@ -128,7 +128,6 @@ struct vbox_private {int vbox_driver_load (struct drm_device *dev,unsigned long flags);void vbox_driver_unload (struct drm_device *dev); -void vbox_driver_lastclose (struct drm_device *dev);struct vbox_gem_object ;
drivers/staging/vboxvideo/vbox_main.c +0 -12
@@ -421,18 +421,6 @@ void vbox_driver_unload(struct drm_device *dev)vbox_hw_fini (vbox); } -/** -* @note this is described in the DRM framework documentation. AST does not -* have it, but we get an oops on driver unload if it is not present. -*/ -void vbox_driver_lastclose (struct drm_device *dev) -{ -struct vbox_private *vbox = dev->dev_private; - -if (vbox->fbdev) -drm_fb_helper_restore_fbdev_mode_unlocked (&vbox->fbdev->helper); -} -int vbox_gem_create (struct drm_device *dev,u32 size,bool iskernel,struct drm_gem_object **obj) {
Signature · 6 lines
2.14.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 15/15] staging: vboxvideo: Use drm_fb_helper_lastclose()
HI,
Quoted 4 lines · Noralf Trønnes
This driver can use
drm_fb_helper_lastclose()as its .lastclose callback.Cc Hans de Goede <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>
Thank you for doing this, looks good to me:
Regards,
Hans
Quoted 45 lines
--- drivers/staging/vboxvideo/vbox_drv.c | 2 +- drivers/staging/vboxvideo/vbox_drv.h | 1 - drivers/staging/vboxvideo/vbox_main.c | 12 ------------ 3 files changed, 1 insertion(+), 14 deletions(-)drivers/staging/vboxvideo/vbox_drv.c +1
-1@@ -229,7 +229,7 @@ static struct drm_driver driver = { .load = vbox_driver_load, .unload = vbox_driver_unload, - .lastclose = vbox_driver_lastclose, + .lastclose = drm_fb_helper_lastclose, .master_set = vbox_master_set, .master_drop = vbox_master_drop,drivers/staging/vboxvideo/vbox_drv.h +0
-1@@ -128,7 +128,6 @@ struct vbox_private {int vbox_driver_load (struct drm_device *dev,unsigned long flags);void vbox_driver_unload (struct drm_device *dev); -void vbox_driver_lastclose (struct drm_device *dev);struct vbox_gem_object ;drivers/staging/vboxvideo/vbox_main.c +0
-5@@ -421,18 +421,6 @@ void vbox_driver_unload(struct drm_device *dev)vbox_hw_fini (vbox); } -/** -* @note this is described in the DRM framework documentation. AST does not -* have it, but we get an oops on driver unload if it is not present. -*/ -void vbox_driver_lastclose (struct drm_device *dev)
drivers/staging/vboxvideo/vbox_main.c void vbox_driver_unload(struct drm_device *dev) · line 426
Quoted 10 lines
drivers/staging/vboxvideo/vbox_main.c +0
-7-{ -struct vbox_private *vbox = dev->dev_private; - -if (vbox->fbdev) -drm_fb_helper_restore_fbdev_mode_unlocked (&vbox->fbdev->helper); -} -int vbox_gem_create (struct drm_device *dev,u32 size,bool iskernel,struct drm_gem_object **obj) {
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/fb-helper: Add .last_close and .output_poll_changed helpers
In reply to Noralf Trønnes== Series Details ==
== Series Details ==
Series: drm/fb-helper: Add .last_close and .output_poll_changed helpers
URL : https://patchwork.freedesktop.org/series/32332/
State : success
== Summary ==
Series 32332v1 drm/fb-helper: Add .last_close and .output_poll_changed helpers
https://patchwork.freedesktop.org/api/1.0/series/32332/revisions/1/mbox/
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
incomplete -> PASS (fi-skl-6700hq)
Test kms_pipe_crc_basic:
Subgroup read-crc-pipe-b-frame-sequence:
notrun -> INCOMPLETE (fi-skl-6700hq)
Subgroup suspend-read-crc-pipe-b:
pass -> DMESG-WARN (fi-byt-n2820) fdo#101705fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:441s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:451s fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:371s fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:530s fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:266s fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:494s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:496s fi-byt-j1900 total:289 pass:253 dwarn:1 dfail:0 fail:0 skip:35 time:489s fi-byt-n2820 total:289 pass:249 dwarn:1 dfail:0 fail:0 skip:39 time:472s fi-cfl-s total:289 pass:253 dwarn:4 dfail:0 fail:0 skip:32 time:551s fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:418s fi-gdg-551 total:289 pass:178 dwarn:1 dfail:0 fail:1 skip:109 time:250s fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:581s fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:445s fi-hsw-4770r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:428s fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:431s fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:493s fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:462s fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:487s fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:572s fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:475s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:582s fi-pnv-d510 total:289 pass:222 dwarn:1 dfail:0 fail:0 skip:66 time:547s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:450s fi-skl-6700hq total:242 pass:217 dwarn:0 dfail:0 fail:0 skip:24 fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:527s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:497s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:455s fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:570s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:417s
87b113da0ae43b97650ddcec6c05ef69469e2107 drm-tip: 2017y-10m-19d-18h-14m-41s UTC integration manifest 742ccf2c2da0 staging: vboxvideo: Use drm_fb_helper_lastclose()70c0b14c7764 drm/tegra: Use drm_fb_helper_lastclose() and _poll_changed() 6fef91fd7667 drm/rockchip: Use drm_fb_helper_lastclose() and _poll_changed() 0e49f03da2fd drm/radeon: Use drm_fb_helper_lastclose() and _poll_changed() 344ce1a5ea30 drm/omap: Use drm_fb_helper_lastclose() and _poll_changed() 3e04ff4cbc8a drm/nouveau: Use drm_fb_helper_output_poll_changed()c90505059e8b drm/msm: Use drm_fb_helper_lastclose() and _poll_changed()dee1ecaeb0a4 drm/i915: Use drm_fb_helper_output_poll_changed()8566e07a2b26 drm/gma500: Use drm_fb_helper_lastclose() and _poll_changed() 480449dcb8c9 drm/exynos: Use drm_fb_helper_lastclose() and _poll_changed() b720bee357cf drm/armada: Use drm_fb_helper_lastclose() and _poll_changed() 4e12c87943f2 drm/amdgpu: Use drm_fb_helper_lastclose() and _poll_changed() 34ce6de2b311 drm/fb-helper: Add .last_close and .output_poll_changed helpers 61ec81d147cf drm: Add drm_device->drm_fb_helper_private pointer62d16aed8fa6 drm/fb-helper: Handle function NULL argument
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6117/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/fb-helper: Add .last_close and .output_poll_changed helpers
In reply to Noralf Trønnes== Series Details ==
== Series Details ==
Series: drm/fb-helper: Add .last_close and .output_poll_changed helpers
URL : https://patchwork.freedesktop.org/series/32332/
State : success
== Summary ==
Test kms_setmode:
Subgroup basic:
pass -> FAIL (shard-hsw) fdo#99912fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
shard-hsw total:2540 pass:1429 dwarn:1 dfail:0 fail:9 skip:1101 time:9197s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6117/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx