drm/amdgpu: Inline drm_simple_encoder_init()

Simple KMS helpers are deprecated because they introduce an unnecessary
intermediate layer between atomic modesetting and the DRM driver.

Inline the functionality of drm_simple_encoder_init() to remove
dependencies on these deprecated helpers.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Nicolás Antinori <nico.antinori.7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Nicolás Antinori
2026-07-08 19:20:21 -03:00
committed by Alex Deucher
parent 262d5a7dc4
commit 9546c8a9ac

View File

@@ -2,7 +2,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_edid.h>
#include <drm/drm_simple_kms_helper.h>
#include <drm/drm_encoder.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_vblank.h>
#include <drm/drm_vblank_helper.h>
@@ -316,6 +316,10 @@ static struct drm_plane *amdgpu_vkms_plane_init(struct drm_device *dev,
return plane;
}
static const struct drm_encoder_funcs drm_encoder_funcs_cleanup = {
.destroy = drm_encoder_cleanup,
};
static int amdgpu_vkms_output_init(struct drm_device *dev, struct
amdgpu_vkms_output *output, int index)
{
@@ -342,7 +346,9 @@ static int amdgpu_vkms_output_init(struct drm_device *dev, struct
drm_connector_helper_add(connector, &amdgpu_vkms_conn_helper_funcs);
ret = drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_VIRTUAL);
ret = drm_encoder_init(dev, encoder,
&drm_encoder_funcs_cleanup,
DRM_MODE_ENCODER_VIRTUAL, NULL);
if (ret) {
DRM_ERROR("Failed to init encoder\n");
goto err_encoder;