1 // SPDX-License-Identifier: GPL-2.0+
2 // Copyright 2018 IBM Corporation
4 #include <drm/drm_atomic_helper.h>
5 #include <drm/drm_connector.h>
6 #include <drm/drm_crtc_helper.h>
7 #include <drm/drm_probe_helper.h>
9 #include "aspeed_gfx.h"
11 static int aspeed_gfx_get_modes(struct drm_connector
*connector
)
13 return drm_add_modes_noedid(connector
, 800, 600);
17 drm_connector_helper_funcs aspeed_gfx_connector_helper_funcs
= {
18 .get_modes
= aspeed_gfx_get_modes
,
21 static const struct drm_connector_funcs aspeed_gfx_connector_funcs
= {
22 .fill_modes
= drm_helper_probe_single_connector_modes
,
23 .destroy
= drm_connector_cleanup
,
24 .reset
= drm_atomic_helper_connector_reset
,
25 .atomic_duplicate_state
= drm_atomic_helper_connector_duplicate_state
,
26 .atomic_destroy_state
= drm_atomic_helper_connector_destroy_state
,
29 int aspeed_gfx_create_output(struct drm_device
*drm
)
31 struct aspeed_gfx
*priv
= to_aspeed_gfx(drm
);
34 priv
->connector
.dpms
= DRM_MODE_DPMS_OFF
;
35 priv
->connector
.polled
= 0;
36 drm_connector_helper_add(&priv
->connector
,
37 &aspeed_gfx_connector_helper_funcs
);
38 ret
= drm_connector_init(drm
, &priv
->connector
,
39 &aspeed_gfx_connector_funcs
,
40 DRM_MODE_CONNECTOR_Unknown
);