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