1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2015 Freescale Semiconductor, Inc.
5 * Freescale DCU drm device driver
8 #include <drm/drm_atomic_helper.h>
9 #include <drm/drm_fb_cma_helper.h>
10 #include <drm/drm_gem_framebuffer_helper.h>
11 #include <drm/drm_probe_helper.h>
13 #include "fsl_dcu_drm_crtc.h"
14 #include "fsl_dcu_drm_drv.h"
16 static const struct drm_mode_config_funcs fsl_dcu_drm_mode_config_funcs
= {
17 .atomic_check
= drm_atomic_helper_check
,
18 .atomic_commit
= drm_atomic_helper_commit
,
19 .fb_create
= drm_gem_fb_create
,
22 int fsl_dcu_drm_modeset_init(struct fsl_dcu_drm_device
*fsl_dev
)
26 drm_mode_config_init(fsl_dev
->drm
);
28 fsl_dev
->drm
->mode_config
.min_width
= 0;
29 fsl_dev
->drm
->mode_config
.min_height
= 0;
30 fsl_dev
->drm
->mode_config
.max_width
= 2031;
31 fsl_dev
->drm
->mode_config
.max_height
= 2047;
32 fsl_dev
->drm
->mode_config
.funcs
= &fsl_dcu_drm_mode_config_funcs
;
34 ret
= fsl_dcu_drm_crtc_create(fsl_dev
);
38 ret
= fsl_dcu_drm_encoder_create(fsl_dev
, &fsl_dev
->crtc
);
42 ret
= fsl_dcu_create_outputs(fsl_dev
);
46 drm_mode_config_reset(fsl_dev
->drm
);
47 drm_kms_helper_poll_init(fsl_dev
->drm
);
52 drm_mode_config_cleanup(fsl_dev
->drm
);