Lines Matching refs:drm
107 static int aspeed_gfx_setup_mode_config(struct drm_device *drm) in aspeed_gfx_setup_mode_config() argument
111 ret = drmm_mode_config_init(drm); in aspeed_gfx_setup_mode_config()
115 drm->mode_config.min_width = 0; in aspeed_gfx_setup_mode_config()
116 drm->mode_config.min_height = 0; in aspeed_gfx_setup_mode_config()
117 drm->mode_config.max_width = 800; in aspeed_gfx_setup_mode_config()
118 drm->mode_config.max_height = 600; in aspeed_gfx_setup_mode_config()
119 drm->mode_config.funcs = &aspeed_gfx_mode_config_funcs; in aspeed_gfx_setup_mode_config()
126 struct drm_device *drm = data; in aspeed_gfx_irq_handler() local
127 struct aspeed_gfx *priv = to_aspeed_gfx(drm); in aspeed_gfx_irq_handler()
141 static int aspeed_gfx_load(struct drm_device *drm) in aspeed_gfx_load() argument
143 struct platform_device *pdev = to_platform_device(drm->dev); in aspeed_gfx_load()
144 struct aspeed_gfx *priv = to_aspeed_gfx(drm); in aspeed_gfx_load()
151 priv->base = devm_ioremap_resource(drm->dev, res); in aspeed_gfx_load()
174 ret = of_reserved_mem_device_init(drm->dev); in aspeed_gfx_load()
181 ret = dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)); in aspeed_gfx_load()
195 priv->clk = devm_clk_get(drm->dev, NULL); in aspeed_gfx_load()
207 ret = aspeed_gfx_setup_mode_config(drm); in aspeed_gfx_load()
211 ret = drm_vblank_init(drm, 1); in aspeed_gfx_load()
213 dev_err(drm->dev, "Failed to initialise vblank\n"); in aspeed_gfx_load()
217 ret = aspeed_gfx_create_output(drm); in aspeed_gfx_load()
219 dev_err(drm->dev, "Failed to create outputs\n"); in aspeed_gfx_load()
223 ret = aspeed_gfx_create_pipe(drm); in aspeed_gfx_load()
225 dev_err(drm->dev, "Cannot setup simple display pipe\n"); in aspeed_gfx_load()
229 ret = devm_request_irq(drm->dev, platform_get_irq(pdev, 0), in aspeed_gfx_load()
230 aspeed_gfx_irq_handler, 0, "aspeed gfx", drm); in aspeed_gfx_load()
232 dev_err(drm->dev, "Failed to install IRQ handler\n"); in aspeed_gfx_load()
236 drm_mode_config_reset(drm); in aspeed_gfx_load()
241 static void aspeed_gfx_unload(struct drm_device *drm) in aspeed_gfx_unload() argument
243 drm_kms_helper_poll_fini(drm); in aspeed_gfx_unload()
326 struct aspeed_gfx, drm); in aspeed_gfx_probe()
330 ret = aspeed_gfx_load(&priv->drm); in aspeed_gfx_probe()
340 ret = drm_dev_register(&priv->drm, 0); in aspeed_gfx_probe()
344 drm_client_setup(&priv->drm, NULL); in aspeed_gfx_probe()
349 aspeed_gfx_unload(&priv->drm); in aspeed_gfx_probe()
356 struct drm_device *drm = platform_get_drvdata(pdev); in aspeed_gfx_remove() local
359 drm_dev_unregister(drm); in aspeed_gfx_remove()
360 aspeed_gfx_unload(drm); in aspeed_gfx_remove()
361 drm_atomic_helper_shutdown(drm); in aspeed_gfx_remove()