0001
0002
0003
0004 #include <drm/drm_atomic_helper.h>
0005 #include <drm/drm_connector.h>
0006 #include <drm/drm_crtc_helper.h>
0007 #include <drm/drm_edid.h>
0008 #include <drm/drm_probe_helper.h>
0009
0010 #include "aspeed_gfx.h"
0011
0012 static int aspeed_gfx_get_modes(struct drm_connector *connector)
0013 {
0014 return drm_add_modes_noedid(connector, 800, 600);
0015 }
0016
0017 static const struct
0018 drm_connector_helper_funcs aspeed_gfx_connector_helper_funcs = {
0019 .get_modes = aspeed_gfx_get_modes,
0020 };
0021
0022 static const struct drm_connector_funcs aspeed_gfx_connector_funcs = {
0023 .fill_modes = drm_helper_probe_single_connector_modes,
0024 .destroy = drm_connector_cleanup,
0025 .reset = drm_atomic_helper_connector_reset,
0026 .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
0027 .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
0028 };
0029
0030 int aspeed_gfx_create_output(struct drm_device *drm)
0031 {
0032 struct aspeed_gfx *priv = to_aspeed_gfx(drm);
0033 int ret;
0034
0035 priv->connector.dpms = DRM_MODE_DPMS_OFF;
0036 priv->connector.polled = 0;
0037 drm_connector_helper_add(&priv->connector,
0038 &aspeed_gfx_connector_helper_funcs);
0039 ret = drm_connector_init(drm, &priv->connector,
0040 &aspeed_gfx_connector_funcs,
0041 DRM_MODE_CONNECTOR_Unknown);
0042 return ret;
0043 }