Lines Matching full:drm

20 #include <drm/drm_atomic_helper.h>
21 #include <drm/drm_bridge.h>
22 #include <drm/drm_connector.h>
23 #include <drm/drm_drv.h>
24 #include <drm/drm_fbdev_dma.h>
25 #include <drm/drm_fourcc.h>
26 #include <drm/drm_gem_dma_helper.h>
27 #include <drm/drm_gem_framebuffer_helper.h>
28 #include <drm/drm_mode_config.h>
29 #include <drm/drm_module.h>
30 #include <drm/drm_of.h>
31 #include <drm/drm_probe_helper.h>
32 #include <drm/drm_vblank.h>
120 struct drm_device *drm = mxsfb->drm; in mxsfb_attach_bridge() local
126 ret = drm_of_find_panel_or_bridge(drm->dev->of_node, 0, 0, &panel, in mxsfb_attach_bridge()
132 bridge = devm_drm_panel_bridge_add_typed(drm->dev, panel, in mxsfb_attach_bridge()
143 return dev_err_probe(drm->dev, ret, "Failed to attach bridge\n"); in mxsfb_attach_bridge()
151 drm_connector_list_iter_begin(drm, &iter); in mxsfb_attach_bridge()
160 struct drm_device *drm = data; in mxsfb_irq_handler() local
161 struct mxsfb_drm_private *mxsfb = drm->dev_private; in mxsfb_irq_handler()
181 static void mxsfb_irq_disable(struct drm_device *drm) in mxsfb_irq_disable() argument
183 struct mxsfb_drm_private *mxsfb = drm->dev_private; in mxsfb_irq_disable()
212 static int mxsfb_load(struct drm_device *drm, in mxsfb_load() argument
215 struct platform_device *pdev = to_platform_device(drm->dev); in mxsfb_load()
224 mxsfb->drm = drm; in mxsfb_load()
225 drm->dev_private = mxsfb; in mxsfb_load()
229 mxsfb->base = devm_ioremap_resource(drm->dev, res); in mxsfb_load()
233 mxsfb->clk = devm_clk_get(drm->dev, NULL); in mxsfb_load()
237 mxsfb->clk_axi = devm_clk_get_optional(drm->dev, "axi"); in mxsfb_load()
241 mxsfb->clk_disp_axi = devm_clk_get(drm->dev, "disp_axi"); in mxsfb_load()
245 ret = dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)); in mxsfb_load()
249 pm_runtime_enable(drm->dev); in mxsfb_load()
252 ret = drmm_mode_config_init(drm); in mxsfb_load()
254 dev_err(drm->dev, "Failed to initialize mode config\n"); in mxsfb_load()
260 dev_err(drm->dev, "Failed to initialize KMS pipeline\n"); in mxsfb_load()
264 ret = drm_vblank_init(drm, drm->mode_config.num_crtc); in mxsfb_load()
266 dev_err(drm->dev, "Failed to initialise vblank\n"); in mxsfb_load()
275 dev_err_probe(drm->dev, ret, "Cannot connect bridge\n"); in mxsfb_load()
279 drm->mode_config.min_width = MXSFB_MIN_XRES; in mxsfb_load()
280 drm->mode_config.min_height = MXSFB_MIN_YRES; in mxsfb_load()
281 drm->mode_config.max_width = MXSFB_MAX_XRES; in mxsfb_load()
282 drm->mode_config.max_height = MXSFB_MAX_YRES; in mxsfb_load()
283 drm->mode_config.funcs = &mxsfb_mode_config_funcs; in mxsfb_load()
284 drm->mode_config.helper_private = &mxsfb_mode_config_helpers; in mxsfb_load()
286 drm_mode_config_reset(drm); in mxsfb_load()
293 pm_runtime_get_sync(drm->dev); in mxsfb_load()
294 ret = mxsfb_irq_install(drm, mxsfb->irq); in mxsfb_load()
295 pm_runtime_put_sync(drm->dev); in mxsfb_load()
298 dev_err(drm->dev, "Failed to install IRQ handler\n"); in mxsfb_load()
302 drm_kms_helper_poll_init(drm); in mxsfb_load()
304 platform_set_drvdata(pdev, drm); in mxsfb_load()
306 drm_helper_hpd_irq_event(drm); in mxsfb_load()
311 pm_runtime_disable(drm->dev); in mxsfb_load()
316 static void mxsfb_unload(struct drm_device *drm) in mxsfb_unload() argument
318 drm_kms_helper_poll_fini(drm); in mxsfb_unload()
320 pm_runtime_get_sync(drm->dev); in mxsfb_unload()
321 mxsfb_irq_uninstall(drm); in mxsfb_unload()
322 pm_runtime_put_sync(drm->dev); in mxsfb_unload()
324 drm->dev_private = NULL; in mxsfb_unload()
326 pm_runtime_disable(drm->dev); in mxsfb_unload()
335 .name = "mxsfb-drm",
336 .desc = "MXSFB Controller DRM",
352 struct drm_device *drm; in mxsfb_probe() local
355 drm = drm_dev_alloc(&mxsfb_driver, &pdev->dev); in mxsfb_probe()
356 if (IS_ERR(drm)) in mxsfb_probe()
357 return PTR_ERR(drm); in mxsfb_probe()
359 ret = mxsfb_load(drm, device_get_match_data(&pdev->dev)); in mxsfb_probe()
363 ret = drm_dev_register(drm, 0); in mxsfb_probe()
367 drm_fbdev_dma_setup(drm, 32); in mxsfb_probe()
372 mxsfb_unload(drm); in mxsfb_probe()
374 drm_dev_put(drm); in mxsfb_probe()
381 struct drm_device *drm = platform_get_drvdata(pdev); in mxsfb_remove() local
383 drm_dev_unregister(drm); in mxsfb_remove()
384 drm_atomic_helper_shutdown(drm); in mxsfb_remove()
385 mxsfb_unload(drm); in mxsfb_remove()
386 drm_dev_put(drm); in mxsfb_remove()
391 struct drm_device *drm = platform_get_drvdata(pdev); in mxsfb_shutdown() local
393 drm_atomic_helper_shutdown(drm); in mxsfb_shutdown()
399 struct drm_device *drm = dev_get_drvdata(dev); in mxsfb_suspend() local
401 return drm_mode_config_helper_suspend(drm); in mxsfb_suspend()
406 struct drm_device *drm = dev_get_drvdata(dev); in mxsfb_resume() local
408 return drm_mode_config_helper_resume(drm); in mxsfb_resume()
430 MODULE_DESCRIPTION("Freescale MXS DRM/KMS driver");