Lines Matching full:drm
6 * ARM Mali DP500/DP550/DP650 KMS/DRM driver
18 #include <drm/drm_atomic.h>
19 #include <drm/drm_atomic_helper.h>
20 #include <drm/drm_crtc.h>
21 #include <drm/drm_drv.h>
22 #include <drm/drm_fb_cma_helper.h>
23 #include <drm/drm_fb_helper.h>
24 #include <drm/drm_fourcc.h>
25 #include <drm/drm_gem_cma_helper.h>
26 #include <drm/drm_gem_framebuffer_helper.h>
27 #include <drm/drm_modeset_helper.h>
28 #include <drm/drm_of.h>
29 #include <drm/drm_probe_helper.h>
30 #include <drm/drm_vblank.h>
169 static int malidp_set_and_wait_config_valid(struct drm_device *drm) in malidp_set_and_wait_config_valid() argument
171 struct malidp_drm *malidp = drm->dev_private; in malidp_set_and_wait_config_valid()
191 struct drm_device *drm = state->dev; in malidp_atomic_commit_hw_done() local
192 struct malidp_drm *malidp = drm->dev_private; in malidp_atomic_commit_hw_done()
208 if (malidp_set_and_wait_config_valid(drm) < 0) { in malidp_atomic_commit_hw_done()
214 if (!malidp_set_and_wait_config_valid(drm)) in malidp_atomic_commit_hw_done()
222 spin_lock_irq(&drm->event_lock); in malidp_atomic_commit_hw_done()
225 spin_unlock_irq(&drm->event_lock); in malidp_atomic_commit_hw_done()
232 struct drm_device *drm = state->dev; in malidp_atomic_commit_tail() local
233 struct malidp_drm *malidp = drm->dev_private; in malidp_atomic_commit_tail()
238 pm_runtime_get_sync(drm->dev); in malidp_atomic_commit_tail()
247 drm_atomic_helper_commit_modeset_disables(drm, state); in malidp_atomic_commit_tail()
255 drm_atomic_helper_commit_planes(drm, state, DRM_PLANE_COMMIT_ACTIVE_ONLY); in malidp_atomic_commit_tail()
257 malidp_mw_atomic_commit(drm, state); in malidp_atomic_commit_tail()
259 drm_atomic_helper_commit_modeset_enables(drm, state); in malidp_atomic_commit_tail()
263 pm_runtime_put(drm->dev); in malidp_atomic_commit_tail()
265 drm_atomic_helper_cleanup_planes(drm, state); in malidp_atomic_commit_tail()
389 static int malidp_init(struct drm_device *drm) in malidp_init() argument
392 struct malidp_drm *malidp = drm->dev_private; in malidp_init()
395 drm_mode_config_init(drm); in malidp_init()
397 drm->mode_config.min_width = hwdev->min_line_size; in malidp_init()
398 drm->mode_config.min_height = hwdev->min_line_size; in malidp_init()
399 drm->mode_config.max_width = hwdev->max_line_size; in malidp_init()
400 drm->mode_config.max_height = hwdev->max_line_size; in malidp_init()
401 drm->mode_config.funcs = &malidp_mode_config_funcs; in malidp_init()
402 drm->mode_config.helper_private = &malidp_mode_config_helpers; in malidp_init()
403 drm->mode_config.allow_fb_modifiers = true; in malidp_init()
405 ret = malidp_crtc_init(drm); in malidp_init()
409 ret = malidp_mw_connector_init(drm); in malidp_init()
416 drm_mode_config_cleanup(drm); in malidp_init()
420 static void malidp_fini(struct drm_device *drm) in malidp_fini() argument
422 drm_mode_config_cleanup(drm); in malidp_fini()
428 struct drm_device *drm = dev_get_drvdata(&pdev->dev); in malidp_irq_init() local
429 struct malidp_drm *malidp = drm->dev_private; in malidp_irq_init()
444 ret = malidp_de_irq_init(drm, irq_de); in malidp_irq_init()
448 ret = malidp_se_irq_init(drm, irq_se); in malidp_irq_init()
460 struct drm_device *drm, in malidp_dumb_create() argument
463 struct malidp_drm *malidp = drm->dev_private; in malidp_dumb_create()
469 return drm_gem_cma_dumb_create_internal(file_priv, drm, args); in malidp_dumb_create()
508 struct drm_device *drm = m->private; in malidp_show_stats() local
509 struct malidp_drm *malidp = drm->dev_private; in malidp_show_stats()
531 struct drm_device *drm = m->private; in malidp_debugfs_write() local
532 struct malidp_drm *malidp = drm->dev_private; in malidp_debugfs_write()
652 struct drm_device *drm = dev_get_drvdata(dev); in core_id_show() local
653 struct malidp_drm *malidp = drm->dev_private; in core_id_show()
670 struct drm_device *drm = dev_get_drvdata(dev); in malidp_runtime_pm_suspend() local
671 struct malidp_drm *malidp = drm->dev_private; in malidp_runtime_pm_suspend()
689 struct drm_device *drm = dev_get_drvdata(dev); in malidp_runtime_pm_resume() local
690 struct malidp_drm *malidp = drm->dev_private; in malidp_runtime_pm_resume()
706 struct drm_device *drm; in malidp_bind() local
754 drm = drm_dev_alloc(&malidp_driver, dev); in malidp_bind()
755 if (IS_ERR(drm)) { in malidp_bind()
756 ret = PTR_ERR(drm); in malidp_bind()
760 drm->dev_private = malidp; in malidp_bind()
761 dev_set_drvdata(dev, drm); in malidp_bind()
822 ret = malidp_init(drm); in malidp_bind()
829 ret = component_bind_all(dev, drm); in malidp_bind()
838 WARN_ON(drm->mode_config.num_encoder > 2); in malidp_bind()
839 list_for_each_entry(encoder, &drm->mode_config.encoder_list, head) { in malidp_bind()
841 (1 << drm->mode_config.num_encoder) - 1; in malidp_bind()
848 drm->irq_enabled = true; in malidp_bind()
850 ret = drm_vblank_init(drm, drm->mode_config.num_crtc); in malidp_bind()
857 drm_mode_config_reset(drm); in malidp_bind()
859 drm_kms_helper_poll_init(drm); in malidp_bind()
861 ret = drm_dev_register(drm, 0); in malidp_bind()
865 drm_fbdev_generic_setup(drm, 32); in malidp_bind()
870 drm_kms_helper_poll_fini(drm); in malidp_bind()
875 drm->irq_enabled = false; in malidp_bind()
877 drm_atomic_helper_shutdown(drm); in malidp_bind()
878 component_unbind_all(dev, drm); in malidp_bind()
882 malidp_fini(drm); in malidp_bind()
889 drm->dev_private = NULL; in malidp_bind()
891 drm_dev_put(drm); in malidp_bind()
900 struct drm_device *drm = dev_get_drvdata(dev); in malidp_unbind() local
901 struct malidp_drm *malidp = drm->dev_private; in malidp_unbind()
904 drm_dev_unregister(drm); in malidp_unbind()
905 drm_kms_helper_poll_fini(drm); in malidp_unbind()
907 drm_atomic_helper_shutdown(drm); in malidp_unbind()
910 drm->irq_enabled = false; in malidp_unbind()
911 component_unbind_all(dev, drm); in malidp_unbind()
914 malidp_fini(drm); in malidp_unbind()
920 drm->dev_private = NULL; in malidp_unbind()
922 drm_dev_put(drm); in malidp_unbind()
966 struct drm_device *drm = dev_get_drvdata(dev); in malidp_pm_suspend() local
968 return drm_mode_config_helper_suspend(drm); in malidp_pm_suspend()
973 struct drm_device *drm = dev_get_drvdata(dev); in malidp_pm_resume() local
975 drm_mode_config_helper_resume(drm); in malidp_pm_resume()
1016 MODULE_DESCRIPTION("ARM Mali DP DRM driver");