Lines Matching full:drm

12 #include <drm/drm_atomic.h>
13 #include <drm/drm_atomic_helper.h>
14 #include <drm/drm_blend.h>
15 #include <drm/drm_bridge.h>
16 #include <drm/drm_bridge_connector.h>
17 #include <drm/drm_connector.h>
18 #include <drm/drm_crtc.h>
19 #include <drm/drm_device.h>
20 #include <drm/drm_drv.h>
21 #include <drm/drm_encoder.h>
22 #include <drm/drm_fbdev_dma.h>
23 #include <drm/drm_fourcc.h>
24 #include <drm/drm_framebuffer.h>
25 #include <drm/drm_gem_dma_helper.h>
26 #include <drm/drm_gem_framebuffer_helper.h>
27 #include <drm/drm_managed.h>
28 #include <drm/drm_mode_config.h>
29 #include <drm/drm_plane.h>
30 #include <drm/drm_probe_helper.h>
31 #include <drm/drm_simple_kms_helper.h>
32 #include <drm/drm_vblank.h>
44 static inline struct zynqmp_dpsub *to_zynqmp_dpsub(struct drm_device *drm) in to_zynqmp_dpsub() argument
46 return container_of(drm, struct zynqmp_dpsub_drm, dev)->dpsub; in to_zynqmp_dpsub()
50 * DRM Planes
126 * implicitly after DPSUB reset during display mode change. DRM in zynqmp_dpsub_plane_atomic_update()
152 for (i = 0; i < ARRAY_SIZE(dpsub->drm->planes); i++) { in zynqmp_dpsub_create_planes()
154 struct drm_plane *plane = &dpsub->drm->planes[i]; in zynqmp_dpsub_create_planes()
166 ret = drm_universal_plane_init(&dpsub->drm->dev, plane, 0, in zynqmp_dpsub_create_planes()
185 * DRM CRTC
318 struct drm_plane *plane = &dpsub->drm->planes[ZYNQMP_DPSUB_LAYER_GFX]; in zynqmp_dpsub_create_crtc()
319 struct drm_crtc *crtc = &dpsub->drm->crtc; in zynqmp_dpsub_create_crtc()
322 ret = drm_crtc_init_with_planes(&dpsub->drm->dev, crtc, plane, in zynqmp_dpsub_create_crtc()
337 u32 possible_crtcs = drm_crtc_mask(&dpsub->drm->crtc); in zynqmp_dpsub_map_crtc_to_plane()
340 for (i = 0; i < ARRAY_SIZE(dpsub->drm->planes); i++) in zynqmp_dpsub_map_crtc_to_plane()
341 dpsub->drm->planes[i].possible_crtcs = possible_crtcs; in zynqmp_dpsub_map_crtc_to_plane()
353 drm_crtc_handle_vblank(&dpsub->drm->crtc); in zynqmp_dpsub_drm_handle_vblank()
361 struct drm_device *drm, in zynqmp_dpsub_dumb_create() argument
364 struct zynqmp_dpsub *dpsub = to_zynqmp_dpsub(drm); in zynqmp_dpsub_dumb_create()
370 return drm_gem_dma_dumb_create_internal(file_priv, drm, args); in zynqmp_dpsub_dumb_create()
374 zynqmp_dpsub_fb_create(struct drm_device *drm, struct drm_file *file_priv, in zynqmp_dpsub_fb_create() argument
377 struct zynqmp_dpsub *dpsub = to_zynqmp_dpsub(drm); in zynqmp_dpsub_fb_create()
385 return drm_gem_fb_create(drm, file_priv, &cmd); in zynqmp_dpsub_fb_create()
395 * DRM/KMS Driver
417 struct drm_encoder *encoder = &dpsub->drm->encoder; in zynqmp_dpsub_kms_init()
433 encoder->possible_crtcs |= drm_crtc_mask(&dpsub->drm->crtc); in zynqmp_dpsub_kms_init()
434 drm_simple_encoder_init(&dpsub->drm->dev, encoder, DRM_MODE_ENCODER_NONE); in zynqmp_dpsub_kms_init()
444 connector = drm_bridge_connector_init(&dpsub->drm->dev, encoder); in zynqmp_dpsub_kms_init()
464 static void zynqmp_dpsub_drm_release(struct drm_device *drm, void *res) in zynqmp_dpsub_drm_release() argument
474 struct drm_device *drm; in zynqmp_dpsub_drm_init() local
480 * dpsub->drm will remain NULL, which tells the caller that it must in zynqmp_dpsub_drm_init()
489 drm = &dpdrm->dev; in zynqmp_dpsub_drm_init()
491 ret = drmm_add_action(drm, zynqmp_dpsub_drm_release, dpdrm); in zynqmp_dpsub_drm_init()
495 dpsub->drm = dpdrm; in zynqmp_dpsub_drm_init()
498 ret = drmm_mode_config_init(drm); in zynqmp_dpsub_drm_init()
502 drm->mode_config.funcs = &zynqmp_dpsub_mode_config_funcs; in zynqmp_dpsub_drm_init()
503 drm->mode_config.min_width = 0; in zynqmp_dpsub_drm_init()
504 drm->mode_config.min_height = 0; in zynqmp_dpsub_drm_init()
505 drm->mode_config.max_width = ZYNQMP_DISP_MAX_WIDTH; in zynqmp_dpsub_drm_init()
506 drm->mode_config.max_height = ZYNQMP_DISP_MAX_HEIGHT; in zynqmp_dpsub_drm_init()
508 ret = drm_vblank_init(drm, 1); in zynqmp_dpsub_drm_init()
512 drm_kms_helper_poll_init(drm); in zynqmp_dpsub_drm_init()
518 /* Reset all components and register the DRM device. */ in zynqmp_dpsub_drm_init()
519 drm_mode_config_reset(drm); in zynqmp_dpsub_drm_init()
521 ret = drm_dev_register(drm, 0); in zynqmp_dpsub_drm_init()
526 drm_fbdev_dma_setup(drm, 24); in zynqmp_dpsub_drm_init()
531 drm_kms_helper_poll_fini(drm); in zynqmp_dpsub_drm_init()
537 struct drm_device *drm = &dpsub->drm->dev; in zynqmp_dpsub_drm_cleanup() local
539 drm_dev_unregister(drm); in zynqmp_dpsub_drm_cleanup()
540 drm_atomic_helper_shutdown(drm); in zynqmp_dpsub_drm_cleanup()
541 drm_encoder_cleanup(&dpsub->drm->encoder); in zynqmp_dpsub_drm_cleanup()
542 drm_kms_helper_poll_fini(drm); in zynqmp_dpsub_drm_cleanup()