Skip to content

Commit e3adc46

Browse files
drm/vkms: Remove <drm/drm_simple_kms_helper.h> include
The driver doesn't use simple-KMS helpers to set a simple display pipeline but only the drm_simple_encoder_init() function to initialize an encoder. That helper is just a wrapper of drm_encoder_init(), but passing a struct drm_encoder_funcs that sets the .destroy handler to drm_encoder_cleanup(). Since the <drm/drm_simple_kms_helper.h> header is only included for this helper and because the connector is initialized with drm_connector_init() as well, do the same for the encoder and drop the header include. Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Maíra Canal <mcanal@igalia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230406110235.3092055-3-javierm@redhat.com
1 parent ca0376b commit e3adc46

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/gpu/drm/vkms/vkms_output.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include <drm/drm_atomic_helper.h>
55
#include <drm/drm_edid.h>
66
#include <drm/drm_probe_helper.h>
7-
#include <drm/drm_simple_kms_helper.h>
87

98
static const struct drm_connector_funcs vkms_connector_funcs = {
109
.fill_modes = drm_helper_probe_single_connector_modes,
@@ -14,6 +13,10 @@ static const struct drm_connector_funcs vkms_connector_funcs = {
1413
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
1514
};
1615

16+
static const struct drm_encoder_funcs vkms_encoder_funcs = {
17+
.destroy = drm_encoder_cleanup,
18+
};
19+
1720
static int vkms_conn_get_modes(struct drm_connector *connector)
1821
{
1922
int count;
@@ -86,7 +89,8 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
8689

8790
drm_connector_helper_add(connector, &vkms_conn_helper_funcs);
8891

89-
ret = drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_VIRTUAL);
92+
ret = drm_encoder_init(dev, encoder, &vkms_encoder_funcs,
93+
DRM_MODE_ENCODER_VIRTUAL, NULL);
9094
if (ret) {
9195
DRM_ERROR("Failed to init encoder\n");
9296
goto err_encoder;

0 commit comments

Comments
 (0)