Lines Matching full:drm
16 #include <drm/drm_atomic_helper.h>
17 #include <drm/drm_device.h>
18 #include <drm/drm_fbdev_dma.h>
19 #include <drm/drm_gem_dma_helper.h>
20 #include <drm/drm_gem_framebuffer_helper.h>
21 #include <drm/drm_module.h>
22 #include <drm/drm_probe_helper.h>
23 #include <drm/drm_simple_kms_helper.h>
24 #include <drm/drm_vblank.h>
25 #include <drm/drm_drv.h>
106 static int aspeed_gfx_setup_mode_config(struct drm_device *drm) in aspeed_gfx_setup_mode_config() argument
110 ret = drmm_mode_config_init(drm); in aspeed_gfx_setup_mode_config()
114 drm->mode_config.min_width = 0; in aspeed_gfx_setup_mode_config()
115 drm->mode_config.min_height = 0; in aspeed_gfx_setup_mode_config()
116 drm->mode_config.max_width = 800; in aspeed_gfx_setup_mode_config()
117 drm->mode_config.max_height = 600; in aspeed_gfx_setup_mode_config()
118 drm->mode_config.funcs = &aspeed_gfx_mode_config_funcs; in aspeed_gfx_setup_mode_config()
125 struct drm_device *drm = data; in aspeed_gfx_irq_handler() local
126 struct aspeed_gfx *priv = to_aspeed_gfx(drm); in aspeed_gfx_irq_handler()
140 static int aspeed_gfx_load(struct drm_device *drm) in aspeed_gfx_load() argument
142 struct platform_device *pdev = to_platform_device(drm->dev); in aspeed_gfx_load()
143 struct aspeed_gfx *priv = to_aspeed_gfx(drm); in aspeed_gfx_load()
150 priv->base = devm_ioremap_resource(drm->dev, res); in aspeed_gfx_load()
173 ret = of_reserved_mem_device_init(drm->dev); in aspeed_gfx_load()
180 ret = dma_set_mask_and_coherent(drm->dev, DMA_BIT_MASK(32)); in aspeed_gfx_load()
194 priv->clk = devm_clk_get(drm->dev, NULL); in aspeed_gfx_load()
206 ret = aspeed_gfx_setup_mode_config(drm); in aspeed_gfx_load()
210 ret = drm_vblank_init(drm, 1); in aspeed_gfx_load()
212 dev_err(drm->dev, "Failed to initialise vblank\n"); in aspeed_gfx_load()
216 ret = aspeed_gfx_create_output(drm); in aspeed_gfx_load()
218 dev_err(drm->dev, "Failed to create outputs\n"); in aspeed_gfx_load()
222 ret = aspeed_gfx_create_pipe(drm); in aspeed_gfx_load()
224 dev_err(drm->dev, "Cannot setup simple display pipe\n"); in aspeed_gfx_load()
228 ret = devm_request_irq(drm->dev, platform_get_irq(pdev, 0), in aspeed_gfx_load()
229 aspeed_gfx_irq_handler, 0, "aspeed gfx", drm); in aspeed_gfx_load()
231 dev_err(drm->dev, "Failed to install IRQ handler\n"); in aspeed_gfx_load()
235 drm_mode_config_reset(drm); in aspeed_gfx_load()
240 static void aspeed_gfx_unload(struct drm_device *drm) in aspeed_gfx_unload() argument
242 drm_kms_helper_poll_fini(drm); in aspeed_gfx_unload()
251 .name = "aspeed-gfx-drm",
252 .desc = "ASPEED GFX DRM",
324 struct aspeed_gfx, drm); in aspeed_gfx_probe()
328 ret = aspeed_gfx_load(&priv->drm); in aspeed_gfx_probe()
338 ret = drm_dev_register(&priv->drm, 0); in aspeed_gfx_probe()
342 drm_fbdev_dma_setup(&priv->drm, 32); in aspeed_gfx_probe()
347 aspeed_gfx_unload(&priv->drm); in aspeed_gfx_probe()
354 struct drm_device *drm = platform_get_drvdata(pdev); in aspeed_gfx_remove() local
357 drm_dev_unregister(drm); in aspeed_gfx_remove()
358 aspeed_gfx_unload(drm); in aspeed_gfx_remove()
359 drm_atomic_helper_shutdown(drm); in aspeed_gfx_remove()
380 MODULE_DESCRIPTION("ASPEED BMC DRM/KMS driver");