From: Thomas Zimmermann <tzimmermann@suse.de>
To: Melih Emik <melihemik@noirlang.tr>,
airlied@redhat.com, kraxel@redhat.com,
dmitry.osipenko@collabora.com
Cc: gurchetansingh@chromium.org, olvaffe@gmail.com,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
simona@ffwll.ch, dri-devel@lists.freedesktop.org,
virtualization@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/virtio: inline drm_simple_encoder_init()
Date: Mon, 19 Oct 2026 09:27:30 +0200 [thread overview]
Message-ID: <f91ca908-689f-4732-bfb3-0e254c22361d@suse.de> (raw)
In-Reply-To: <20261018112844.360262-1-melihemik@noirlang.tr>
Hi
Am 18.10.26 um 13:28 schrieb Melih Emik:
> The helper drm_simple_encoder_init() is deprecated because it adds an
> unnecessary intermediate layer between atomic modesetting and DRM drivers,
> as documented in Documentation/gpu/todo.rst.
>
> Inline the functionality by calling drm_encoder_init() directly with a
> local instance of struct drm_encoder_funcs. This allows removing the
> dependency on <drm/drm_simple_kms_helper.h> in favor of
> <drm/drm_encoder.h>.
These have all been fixed already. You need to work on drm-tip, drm-misc
or a driver-specific git tree for development.
Best regards
Thomas
>
> Signed-off-by: Melih Emik <melihemik@noirlang.tr>
> ---
> Tested:
> - Compiled with W=1 on x86_64 with zero warnings or errors.
> - Verified with lockdep and debug mutexes enabled
> (CONFIG_PROVE_LOCKING=y, CONFIG_DEBUG_MUTEXES=y).
> - Boot-tested full bzImage in QEMU with -device virtio-gpu-pci and
> initcall_debug, confirming successful probe and initialization
> (probe of virtio0 with driver virtio_gpu returned 0) and zero
> lockdep/kernel warnings.
> - Verified with scripts/checkpatch.pl (0 errors, 0 warnings).
>
> drivers/gpu/drm/virtio/virtgpu_display.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
> index a1a875a0c706..1bdbf452d111 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_display.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_display.c
> @@ -28,11 +28,11 @@
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_damage_helper.h>
> #include <drm/drm_edid.h>
> +#include <drm/drm_encoder.h>
> #include <drm/drm_fourcc.h>
> #include <drm/drm_gem_framebuffer_helper.h>
> #include <drm/drm_print.h>
> #include <drm/drm_probe_helper.h>
> -#include <drm/drm_simple_kms_helper.h>
> #include <drm/drm_vblank.h>
> #include <drm/drm_vblank_helper.h>
>
> @@ -232,6 +232,10 @@ static enum drm_mode_status virtio_gpu_conn_mode_valid(struct drm_connector *con
> return MODE_BAD;
> }
>
> +static const struct drm_encoder_funcs virtio_gpu_encoder_funcs = {
> + .destroy = drm_encoder_cleanup,
> +};
> +
> static const struct drm_encoder_helper_funcs virtio_gpu_enc_helper_funcs = {
> .mode_set = virtio_gpu_enc_mode_set,
> .enable = virtio_gpu_enc_enable,
> @@ -306,7 +310,10 @@ static int vgdev_output_init(struct virtio_gpu_device *vgdev, int index)
> if (vgdev->has_edid)
> drm_connector_attach_edid_property(connector);
>
> - drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_VIRTUAL);
> + ret = drm_encoder_init(dev, encoder, &virtio_gpu_encoder_funcs,
> + DRM_MODE_ENCODER_VIRTUAL, NULL);
> + if (ret)
> + return ret;
> drm_encoder_helper_add(encoder, &virtio_gpu_enc_helper_funcs);
> encoder->possible_crtcs = 1 << index;
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)
next prev parent reply other threads:[~2026-10-19 7:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 11:28 Melih Emik
2026-10-19 7:27 ` Thomas Zimmermann [this message]
2026-10-19 8:58 ` Melih Emik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f91ca908-689f-4732-bfb3-0e254c22361d@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@redhat.com \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gurchetansingh@chromium.org \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=melihemik@noirlang.tr \
--cc=mripard@kernel.org \
--cc=olvaffe@gmail.com \
--cc=simona@ffwll.ch \
--cc=virtualization@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®