Lines Matching refs:drm
121 struct drm_device *drm = mxsfb->drm; in mxsfb_attach_bridge() local
127 ret = drm_of_find_panel_or_bridge(drm->dev->of_node, 0, 0, &panel, in mxsfb_attach_bridge()
133 bridge = devm_drm_panel_bridge_add_typed(drm->dev, panel, in mxsfb_attach_bridge()
144 return dev_err_probe(drm->dev, ret, "Failed to attach bridge\n"); in mxsfb_attach_bridge()
152 drm_connector_list_iter_begin(drm, &iter); in mxsfb_attach_bridge()
161 struct drm_device *drm = data; in mxsfb_irq_handler() local
162 struct mxsfb_drm_private *mxsfb = drm->dev_private; in mxsfb_irq_handler()
182 static void mxsfb_irq_disable(struct drm_device *drm) in mxsfb_irq_disable() argument
184 struct mxsfb_drm_private *mxsfb = drm->dev_private; in mxsfb_irq_disable()
213 static int mxsfb_load(struct drm_device *drm, in mxsfb_load() argument
216 struct platform_device *pdev = to_platform_device(drm->dev); in mxsfb_load()
225 mxsfb->drm = drm; in mxsfb_load()
226 drm->dev_private = mxsfb; in mxsfb_load()
230 mxsfb->base = devm_ioremap_resource(drm->dev, res); in mxsfb_load()
234 mxsfb->clk = devm_clk_get(drm->dev, NULL); in mxsfb_load()
238 mxsfb->clk_axi = devm_clk_get_optional(drm->dev, "axi"); in mxsfb_load()
242 mxsfb->clk_disp_axi = devm_clk_get(drm->dev, "disp_axi"); in mxsfb_load()
246 ret = dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)); in mxsfb_load()
250 pm_runtime_enable(drm->dev); in mxsfb_load()
253 ret = drmm_mode_config_init(drm); in mxsfb_load()
255 dev_err(drm->dev, "Failed to initialize mode config\n"); in mxsfb_load()
261 dev_err(drm->dev, "Failed to initialize KMS pipeline\n"); in mxsfb_load()
265 ret = drm_vblank_init(drm, drm->mode_config.num_crtc); in mxsfb_load()
267 dev_err(drm->dev, "Failed to initialise vblank\n"); in mxsfb_load()
276 dev_err_probe(drm->dev, ret, "Cannot connect bridge\n"); in mxsfb_load()
280 drm->mode_config.min_width = MXSFB_MIN_XRES; in mxsfb_load()
281 drm->mode_config.min_height = MXSFB_MIN_YRES; in mxsfb_load()
282 drm->mode_config.max_width = MXSFB_MAX_XRES; in mxsfb_load()
283 drm->mode_config.max_height = MXSFB_MAX_YRES; in mxsfb_load()
284 drm->mode_config.funcs = &mxsfb_mode_config_funcs; in mxsfb_load()
285 drm->mode_config.helper_private = &mxsfb_mode_config_helpers; in mxsfb_load()
287 drm_mode_config_reset(drm); in mxsfb_load()
294 pm_runtime_get_sync(drm->dev); in mxsfb_load()
295 ret = mxsfb_irq_install(drm, mxsfb->irq); in mxsfb_load()
296 pm_runtime_put_sync(drm->dev); in mxsfb_load()
299 dev_err(drm->dev, "Failed to install IRQ handler\n"); in mxsfb_load()
303 drm_kms_helper_poll_init(drm); in mxsfb_load()
305 platform_set_drvdata(pdev, drm); in mxsfb_load()
307 drm_helper_hpd_irq_event(drm); in mxsfb_load()
312 pm_runtime_disable(drm->dev); in mxsfb_load()
317 static void mxsfb_unload(struct drm_device *drm) in mxsfb_unload() argument
319 drm_kms_helper_poll_fini(drm); in mxsfb_unload()
321 pm_runtime_get_sync(drm->dev); in mxsfb_unload()
322 mxsfb_irq_uninstall(drm); in mxsfb_unload()
323 pm_runtime_put_sync(drm->dev); in mxsfb_unload()
325 drm->dev_private = NULL; in mxsfb_unload()
327 pm_runtime_disable(drm->dev); in mxsfb_unload()
354 struct drm_device *drm; in mxsfb_probe() local
357 drm = drm_dev_alloc(&mxsfb_driver, &pdev->dev); in mxsfb_probe()
358 if (IS_ERR(drm)) in mxsfb_probe()
359 return PTR_ERR(drm); in mxsfb_probe()
361 ret = mxsfb_load(drm, device_get_match_data(&pdev->dev)); in mxsfb_probe()
365 ret = drm_dev_register(drm, 0); in mxsfb_probe()
369 drm_client_setup(drm, NULL); in mxsfb_probe()
374 mxsfb_unload(drm); in mxsfb_probe()
376 drm_dev_put(drm); in mxsfb_probe()
383 struct drm_device *drm = platform_get_drvdata(pdev); in mxsfb_remove() local
385 drm_dev_unregister(drm); in mxsfb_remove()
386 drm_atomic_helper_shutdown(drm); in mxsfb_remove()
387 mxsfb_unload(drm); in mxsfb_remove()
388 drm_dev_put(drm); in mxsfb_remove()
393 struct drm_device *drm = platform_get_drvdata(pdev); in mxsfb_shutdown() local
395 drm_atomic_helper_shutdown(drm); in mxsfb_shutdown()
401 struct drm_device *drm = dev_get_drvdata(dev); in mxsfb_suspend() local
403 return drm_mode_config_helper_suspend(drm); in mxsfb_suspend()
408 struct drm_device *drm = dev_get_drvdata(dev); in mxsfb_resume() local
410 return drm_mode_config_helper_resume(drm); in mxsfb_resume()