• Home
  • Raw
  • Download

Lines Matching refs:disp

152 	struct zynqmp_disp *disp;  member
947 void zynqmp_disp_handle_vblank(struct zynqmp_disp *disp) in zynqmp_disp_handle_vblank() argument
949 struct drm_crtc *crtc = &disp->crtc; in zynqmp_disp_handle_vblank()
962 bool zynqmp_disp_audio_enabled(struct zynqmp_disp *disp) in zynqmp_disp_audio_enabled() argument
964 return !!disp->audio.clk; in zynqmp_disp_audio_enabled()
973 unsigned int zynqmp_disp_get_audio_clk_rate(struct zynqmp_disp *disp) in zynqmp_disp_get_audio_clk_rate() argument
975 if (zynqmp_disp_audio_enabled(disp)) in zynqmp_disp_get_audio_clk_rate()
977 return clk_get_rate(disp->audio.clk); in zynqmp_disp_get_audio_clk_rate()
986 uint32_t zynqmp_disp_get_crtc_mask(struct zynqmp_disp *disp) in zynqmp_disp_get_crtc_mask() argument
988 return drm_crtc_mask(&disp->crtc); in zynqmp_disp_get_crtc_mask()
1029 zynqmp_disp_avbuf_enable_video(&layer->disp->avbuf, layer->id, in zynqmp_disp_layer_enable()
1031 zynqmp_disp_blend_layer_enable(&layer->disp->blend, layer); in zynqmp_disp_layer_enable()
1050 zynqmp_disp_avbuf_disable_video(&layer->disp->avbuf, layer->id); in zynqmp_disp_layer_disable()
1051 zynqmp_disp_blend_layer_disable(&layer->disp->blend, layer); in zynqmp_disp_layer_disable()
1071 zynqmp_disp_avbuf_set_format(&layer->disp->avbuf, layer->id, in zynqmp_disp_layer_set_format()
1128 dev_err(layer->disp->dev, in zynqmp_disp_layer_update()
1221 static int zynqmp_disp_create_planes(struct zynqmp_disp *disp) in zynqmp_disp_create_planes() argument
1227 struct zynqmp_disp_layer *layer = &disp->layers[i]; in zynqmp_disp_create_planes()
1231 drm_formats = drmm_kcalloc(disp->drm, sizeof(*drm_formats), in zynqmp_disp_create_planes()
1243 ret = drm_universal_plane_init(disp->drm, &layer->plane, 0, in zynqmp_disp_create_planes()
1265 static void zynqmp_disp_layer_release_dma(struct zynqmp_disp *disp, in zynqmp_disp_layer_release_dma() argument
1289 static void zynqmp_disp_destroy_layers(struct zynqmp_disp *disp) in zynqmp_disp_destroy_layers() argument
1294 zynqmp_disp_layer_release_dma(disp, &disp->layers[i]); in zynqmp_disp_destroy_layers()
1306 static int zynqmp_disp_layer_request_dma(struct zynqmp_disp *disp, in zynqmp_disp_layer_request_dma() argument
1319 dma->chan = of_dma_request_slave_channel(disp->dev->of_node, in zynqmp_disp_layer_request_dma()
1322 dev_err(disp->dev, "failed to request dma channel\n"); in zynqmp_disp_layer_request_dma()
1338 static int zynqmp_disp_create_layers(struct zynqmp_disp *disp) in zynqmp_disp_create_layers() argument
1357 struct zynqmp_disp_layer *layer = &disp->layers[i]; in zynqmp_disp_create_layers()
1360 layer->disp = disp; in zynqmp_disp_create_layers()
1363 ret = zynqmp_disp_layer_request_dma(disp, layer); in zynqmp_disp_create_layers()
1371 zynqmp_disp_destroy_layers(disp); in zynqmp_disp_create_layers()
1383 static void zynqmp_disp_enable(struct zynqmp_disp *disp) in zynqmp_disp_enable() argument
1385 zynqmp_disp_avbuf_enable(&disp->avbuf); in zynqmp_disp_enable()
1387 zynqmp_disp_avbuf_set_clocks_sources(&disp->avbuf, disp->pclk_from_ps, in zynqmp_disp_enable()
1388 disp->audio.clk_from_ps, true); in zynqmp_disp_enable()
1389 zynqmp_disp_avbuf_enable_channels(&disp->avbuf); in zynqmp_disp_enable()
1390 zynqmp_disp_avbuf_enable_audio(&disp->avbuf); in zynqmp_disp_enable()
1392 zynqmp_disp_audio_enable(&disp->audio); in zynqmp_disp_enable()
1399 static void zynqmp_disp_disable(struct zynqmp_disp *disp) in zynqmp_disp_disable() argument
1401 zynqmp_disp_audio_disable(&disp->audio); in zynqmp_disp_disable()
1403 zynqmp_disp_avbuf_disable_audio(&disp->avbuf); in zynqmp_disp_disable()
1404 zynqmp_disp_avbuf_disable_channels(&disp->avbuf); in zynqmp_disp_disable()
1405 zynqmp_disp_avbuf_disable(&disp->avbuf); in zynqmp_disp_disable()
1416 struct zynqmp_disp *disp = crtc_to_disp(crtc); in zynqmp_disp_crtc_setup_clock() local
1422 ret = clk_set_rate(disp->pclk, mode_clock); in zynqmp_disp_crtc_setup_clock()
1424 dev_err(disp->dev, "failed to set a pixel clock\n"); in zynqmp_disp_crtc_setup_clock()
1428 rate = clk_get_rate(disp->pclk); in zynqmp_disp_crtc_setup_clock()
1431 dev_info(disp->dev, in zynqmp_disp_crtc_setup_clock()
1435 dev_dbg(disp->dev, in zynqmp_disp_crtc_setup_clock()
1446 struct zynqmp_disp *disp = crtc_to_disp(crtc); in zynqmp_disp_crtc_atomic_enable() local
1450 pm_runtime_get_sync(disp->dev); in zynqmp_disp_crtc_atomic_enable()
1454 ret = clk_prepare_enable(disp->pclk); in zynqmp_disp_crtc_atomic_enable()
1456 dev_err(disp->dev, "failed to enable a pixel clock\n"); in zynqmp_disp_crtc_atomic_enable()
1457 pm_runtime_put_sync(disp->dev); in zynqmp_disp_crtc_atomic_enable()
1461 zynqmp_disp_blend_set_output_format(&disp->blend, in zynqmp_disp_crtc_atomic_enable()
1463 zynqmp_disp_blend_set_bg_color(&disp->blend, 0, 0, 0); in zynqmp_disp_crtc_atomic_enable()
1464 zynqmp_disp_blend_set_global_alpha(&disp->blend, false, 0); in zynqmp_disp_crtc_atomic_enable()
1466 zynqmp_disp_enable(disp); in zynqmp_disp_crtc_atomic_enable()
1478 struct zynqmp_disp *disp = crtc_to_disp(crtc); in zynqmp_disp_crtc_atomic_disable() local
1491 zynqmp_disp_disable(disp); in zynqmp_disp_crtc_atomic_disable()
1493 drm_crtc_vblank_off(&disp->crtc); in zynqmp_disp_crtc_atomic_disable()
1502 clk_disable_unprepare(disp->pclk); in zynqmp_disp_crtc_atomic_disable()
1503 pm_runtime_put_sync(disp->dev); in zynqmp_disp_crtc_atomic_disable()
1550 struct zynqmp_disp *disp = crtc_to_disp(crtc); in zynqmp_disp_crtc_enable_vblank() local
1552 zynqmp_dp_enable_vblank(disp->dpsub->dp); in zynqmp_disp_crtc_enable_vblank()
1559 struct zynqmp_disp *disp = crtc_to_disp(crtc); in zynqmp_disp_crtc_disable_vblank() local
1561 zynqmp_dp_disable_vblank(disp->dpsub->dp); in zynqmp_disp_crtc_disable_vblank()
1575 static int zynqmp_disp_create_crtc(struct zynqmp_disp *disp) in zynqmp_disp_create_crtc() argument
1577 struct drm_plane *plane = &disp->layers[ZYNQMP_DISP_LAYER_GFX].plane; in zynqmp_disp_create_crtc()
1580 ret = drm_crtc_init_with_planes(disp->drm, &disp->crtc, plane, in zynqmp_disp_create_crtc()
1585 drm_crtc_helper_add(&disp->crtc, &zynqmp_disp_crtc_helper_funcs); in zynqmp_disp_create_crtc()
1588 drm_crtc_vblank_off(&disp->crtc); in zynqmp_disp_create_crtc()
1593 static void zynqmp_disp_map_crtc_to_plane(struct zynqmp_disp *disp) in zynqmp_disp_map_crtc_to_plane() argument
1595 u32 possible_crtcs = drm_crtc_mask(&disp->crtc); in zynqmp_disp_map_crtc_to_plane()
1599 disp->layers[i].plane.possible_crtcs = possible_crtcs; in zynqmp_disp_map_crtc_to_plane()
1608 struct zynqmp_disp *disp = dpsub->disp; in zynqmp_disp_drm_init() local
1611 ret = zynqmp_disp_create_planes(disp); in zynqmp_disp_drm_init()
1615 ret = zynqmp_disp_create_crtc(disp); in zynqmp_disp_drm_init()
1619 zynqmp_disp_map_crtc_to_plane(disp); in zynqmp_disp_drm_init()
1627 struct zynqmp_disp *disp; in zynqmp_disp_probe() local
1632 disp = drmm_kzalloc(drm, sizeof(*disp), GFP_KERNEL); in zynqmp_disp_probe()
1633 if (!disp) in zynqmp_disp_probe()
1636 disp->dev = &pdev->dev; in zynqmp_disp_probe()
1637 disp->dpsub = dpsub; in zynqmp_disp_probe()
1638 disp->drm = drm; in zynqmp_disp_probe()
1640 dpsub->disp = disp; in zynqmp_disp_probe()
1643 disp->blend.base = devm_ioremap_resource(disp->dev, res); in zynqmp_disp_probe()
1644 if (IS_ERR(disp->blend.base)) in zynqmp_disp_probe()
1645 return PTR_ERR(disp->blend.base); in zynqmp_disp_probe()
1648 disp->avbuf.base = devm_ioremap_resource(disp->dev, res); in zynqmp_disp_probe()
1649 if (IS_ERR(disp->avbuf.base)) in zynqmp_disp_probe()
1650 return PTR_ERR(disp->avbuf.base); in zynqmp_disp_probe()
1653 disp->audio.base = devm_ioremap_resource(disp->dev, res); in zynqmp_disp_probe()
1654 if (IS_ERR(disp->audio.base)) in zynqmp_disp_probe()
1655 return PTR_ERR(disp->audio.base); in zynqmp_disp_probe()
1658 disp->pclk = devm_clk_get(disp->dev, "dp_live_video_in_clk"); in zynqmp_disp_probe()
1659 if (!IS_ERR(disp->pclk)) in zynqmp_disp_probe()
1660 disp->pclk_from_ps = false; in zynqmp_disp_probe()
1661 else if (PTR_ERR(disp->pclk) == -EPROBE_DEFER) in zynqmp_disp_probe()
1662 return PTR_ERR(disp->pclk); in zynqmp_disp_probe()
1665 if (IS_ERR_OR_NULL(disp->pclk)) { in zynqmp_disp_probe()
1666 disp->pclk = devm_clk_get(disp->dev, "dp_vtc_pixel_clk_in"); in zynqmp_disp_probe()
1667 if (IS_ERR(disp->pclk)) { in zynqmp_disp_probe()
1668 dev_err(disp->dev, "failed to init any video clock\n"); in zynqmp_disp_probe()
1669 return PTR_ERR(disp->pclk); in zynqmp_disp_probe()
1671 disp->pclk_from_ps = true; in zynqmp_disp_probe()
1674 zynqmp_disp_audio_init(disp->dev, &disp->audio); in zynqmp_disp_probe()
1676 ret = zynqmp_disp_create_layers(disp); in zynqmp_disp_probe()
1680 layer = &disp->layers[ZYNQMP_DISP_LAYER_VID]; in zynqmp_disp_probe()
1688 struct zynqmp_disp *disp = dpsub->disp; in zynqmp_disp_remove() local
1690 zynqmp_disp_destroy_layers(disp); in zynqmp_disp_remove()