Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / gpu / drm / aspeed / aspeed_gfx_out.c
blob6759cb88415a4ca3e944ed64869c2e7963ef1833
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);
16 static const struct
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);
32 int ret;
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);
41 return ret;