diff options
author | Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> | 2018-07-12 05:02:14 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-07-12 09:48:42 +0300 |
commit | d16489307a52f028dcb072addf681f9280f585c6 (patch) | |
tree | 8b9f38c40c77efc4c82dfa278916dc6dc727882b /drivers/gpu/drm/vkms/vkms_output.c | |
parent | 657cd71e8eb3ac9ba91b8e1e403632b24d6cfdf9 (diff) | |
download | linux-d16489307a52f028dcb072addf681f9280f585c6.tar.xz |
drm/vkms: Add connectors helpers
This patch adds the struct drm_connector_helper_funcs with some
necessary hooks. Additionally, it also adds some missing hooks at
drm_connector_funcs.
Changes since V1:
- None
Change since V2:
Daniel Vetter:
- Remove vkms_conn_mode_valid
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/c8ee28b889234e866ef18bce4216385661c48041.1531359228.git.rodrigosiqueiramelo@gmail.com
Diffstat (limited to 'drivers/gpu/drm/vkms/vkms_output.c')
-rw-r--r-- | drivers/gpu/drm/vkms/vkms_output.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c index 48143eac3c12..a7c0ec9b643f 100644 --- a/drivers/gpu/drm/vkms/vkms_output.c +++ b/drivers/gpu/drm/vkms/vkms_output.c @@ -8,6 +8,7 @@ #include "vkms_drv.h" #include <drm/drm_crtc_helper.h> +#include <drm/drm_atomic_helper.h> static void vkms_connector_destroy(struct drm_connector *connector) { @@ -18,12 +19,29 @@ static void vkms_connector_destroy(struct drm_connector *connector) static const struct drm_connector_funcs vkms_connector_funcs = { .fill_modes = drm_helper_probe_single_connector_modes, .destroy = vkms_connector_destroy, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; static const struct drm_encoder_funcs vkms_encoder_funcs = { .destroy = drm_encoder_cleanup, }; +static int vkms_conn_get_modes(struct drm_connector *connector) +{ + int count; + + count = drm_add_modes_noedid(connector, XRES_MAX, YRES_MAX); + drm_set_preferred_mode(connector, XRES_DEF, YRES_DEF); + + return count; +} + +static const struct drm_connector_helper_funcs vkms_conn_helper_funcs = { + .get_modes = vkms_conn_get_modes, +}; + int vkms_output_init(struct vkms_device *vkmsdev) { struct vkms_output *output = &vkmsdev->output; @@ -49,6 +67,8 @@ int vkms_output_init(struct vkms_device *vkmsdev) goto err_connector; } + drm_connector_helper_add(connector, &vkms_conn_helper_funcs); + ret = drm_connector_register(connector); if (ret) { DRM_ERROR("Failed to register connector\n"); |