diff options
Diffstat (limited to 'drivers/gpu/drm/arm')
-rw-r--r-- | drivers/gpu/drm/arm/hdlcd_crtc.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/hdlcd_drv.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/malidp_drv.c | 63 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/malidp_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/malidp_planes.c | 3 |
5 files changed, 17 insertions, 61 deletions
diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 5a5427bbd70e..630721f429f7 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -252,10 +252,10 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - return drm_plane_helper_check_state(state, &clip, - DRM_PLANE_HELPER_NO_SCALING, - DRM_PLANE_HELPER_NO_SCALING, - false, true); + return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + DRM_PLANE_HELPER_NO_SCALING, + DRM_PLANE_HELPER_NO_SCALING, + false, true); } static void hdlcd_plane_atomic_update(struct drm_plane *plane, diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 0afb53b1f4e9..feaa8bc3d7b7 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -231,7 +231,6 @@ static int hdlcd_show_pxlclock(struct seq_file *m, void *arg) static struct drm_info_list hdlcd_debugfs_list[] = { { "interrupt_count", hdlcd_show_underrun_count, 0 }, { "clocks", hdlcd_show_pxlclock, 0 }, - { "fb", drm_fb_cma_debugfs_show, 0 }, }; static int hdlcd_debugfs_init(struct drm_minor *minor) @@ -253,6 +252,7 @@ static struct drm_driver hdlcd_driver = { .irq_postinstall = hdlcd_irq_postinstall, .irq_uninstall = hdlcd_irq_uninstall, .gem_free_object_unlocked = drm_gem_cma_free_object, + .gem_print_info = drm_gem_cma_print_info, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 91f2b0191368..3d82712d8002 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -13,7 +13,6 @@ #include <linux/module.h> #include <linux/clk.h> #include <linux/component.h> -#include <linux/console.h> #include <linux/of_device.h> #include <linux/of_graph.h> #include <linux/of_reserved_mem.h> @@ -24,9 +23,11 @@ #include <drm/drm_atomic_helper.h> #include <drm/drm_crtc.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_fb_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_modeset_helper.h> #include <drm/drm_of.h> #include "malidp_drv.h" @@ -182,13 +183,6 @@ static int malidp_set_and_wait_config_valid(struct drm_device *drm) return (ret > 0) ? 0 : -ETIMEDOUT; } -static void malidp_output_poll_changed(struct drm_device *drm) -{ - struct malidp_drm *malidp = drm->dev_private; - - drm_fbdev_cma_hotplug_event(malidp->fbdev); -} - static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state) { struct drm_pending_vblank_event *event; @@ -251,7 +245,7 @@ static const struct drm_mode_config_helper_funcs malidp_mode_config_helpers = { static const struct drm_mode_config_funcs malidp_mode_config_funcs = { .fb_create = drm_gem_fb_create, - .output_poll_changed = malidp_output_poll_changed, + .output_poll_changed = drm_fb_helper_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, }; @@ -316,19 +310,12 @@ static int malidp_irq_init(struct platform_device *pdev) return 0; } -static void malidp_lastclose(struct drm_device *drm) -{ - struct malidp_drm *malidp = drm->dev_private; - - drm_fbdev_cma_restore_mode(malidp->fbdev); -} - DEFINE_DRM_GEM_CMA_FOPS(fops); static struct drm_driver malidp_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_PRIME, - .lastclose = malidp_lastclose, + .lastclose = drm_fb_helper_lastclose, .gem_free_object_unlocked = drm_gem_cma_free_object, .gem_vm_ops = &drm_gem_cma_vm_ops, .dumb_create = drm_gem_cma_dumb_create, @@ -622,14 +609,9 @@ static int malidp_bind(struct device *dev) drm_mode_config_reset(drm); - malidp->fbdev = drm_fbdev_cma_init(drm, 32, - drm->mode_config.num_connector); - - if (IS_ERR(malidp->fbdev)) { - ret = PTR_ERR(malidp->fbdev); - malidp->fbdev = NULL; + ret = drm_fb_cma_fbdev_init(drm, 32, 0); + if (ret) goto fbdev_fail; - } drm_kms_helper_poll_init(drm); @@ -640,10 +622,7 @@ static int malidp_bind(struct device *dev) return 0; register_fail: - if (malidp->fbdev) { - drm_fbdev_cma_fini(malidp->fbdev); - malidp->fbdev = NULL; - } + drm_fb_cma_fbdev_fini(drm); drm_kms_helper_poll_fini(drm); fbdev_fail: pm_runtime_get_sync(dev); @@ -680,10 +659,7 @@ static void malidp_unbind(struct device *dev) struct malidp_drm *malidp = drm->dev_private; drm_dev_unregister(drm); - if (malidp->fbdev) { - drm_fbdev_cma_fini(malidp->fbdev); - malidp->fbdev = NULL; - } + drm_fb_cma_fbdev_fini(drm); drm_kms_helper_poll_fini(drm); pm_runtime_get_sync(dev); malidp_se_irq_fini(drm); @@ -745,34 +721,15 @@ static int malidp_platform_remove(struct platform_device *pdev) static int __maybe_unused malidp_pm_suspend(struct device *dev) { struct drm_device *drm = dev_get_drvdata(dev); - struct malidp_drm *malidp = drm->dev_private; - - drm_kms_helper_poll_disable(drm); - console_lock(); - drm_fbdev_cma_set_suspend(malidp->fbdev, 1); - console_unlock(); - malidp->pm_state = drm_atomic_helper_suspend(drm); - if (IS_ERR(malidp->pm_state)) { - console_lock(); - drm_fbdev_cma_set_suspend(malidp->fbdev, 0); - console_unlock(); - drm_kms_helper_poll_enable(drm); - return PTR_ERR(malidp->pm_state); - } - return 0; + return drm_mode_config_helper_suspend(drm); } static int __maybe_unused malidp_pm_resume(struct device *dev) { struct drm_device *drm = dev_get_drvdata(dev); - struct malidp_drm *malidp = drm->dev_private; - drm_atomic_helper_resume(drm, malidp->pm_state); - console_lock(); - drm_fbdev_cma_set_suspend(malidp->fbdev, 0); - console_unlock(); - drm_kms_helper_poll_enable(drm); + drm_mode_config_helper_resume(drm); return 0; } diff --git a/drivers/gpu/drm/arm/malidp_drv.h b/drivers/gpu/drm/arm/malidp_drv.h index 2e2033140efc..e0d12c9fc6b8 100644 --- a/drivers/gpu/drm/arm/malidp_drv.h +++ b/drivers/gpu/drm/arm/malidp_drv.h @@ -20,11 +20,9 @@ struct malidp_drm { struct malidp_hw_device *dev; - struct drm_fbdev_cma *fbdev; struct drm_crtc crtc; wait_queue_head_t wq; atomic_t config_valid; - struct drm_atomic_state *pm_state; u32 core_id; }; diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index e7419797bbd1..33c5ef96ced0 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -150,7 +150,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret = drm_plane_helper_check_state(state, &clip, 0, INT_MAX, true, true); + ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, + 0, INT_MAX, true, true); if (ret) return ret; |