aspeed_gfx_out.c 1.2 KB

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