mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Davide Bonatto <bonatto.davide@gmail.com>,
	David Airlie <airlied@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: Gurchetan Singh <gurchetansingh@chromium.org>,
	Chia-I Wu <olvaffe@gmail.com>,
	dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/virtio: Replace deprecated drm_simple_encoder_init()
Date: Wed, 9 Sep 2026 09:52:20 +0200	[thread overview]
Message-ID: <c5eef215-6f2e-4807-8b9e-5356b3978f8b@suse.de> (raw)
In-Reply-To: <20260909073440.52641-1-bonatto.davide@gmail.com>

Hi

Am 09.09.26 um 09:34 schrieb Davide Bonatto:
> drm_simple_encoder_init() is deprecated as it introduces an unnecessary
> intermediate layer between atomic modesetting and DRM drivers.

This helper has meanwhile been removed entirely.

Best regards
Thomas

>
> Inline the helper call in virtgpu_display by defining
> virtio_gpu_encoder_funcs with the default drm_encoder_cleanup callback,
> and migrate directly to drm_encoder_init()
>
> Signed-off-by: Davide Bonatto <bonatto.davide@gmail.com>
> ---
>   drivers/gpu/drm/virtio/virtgpu_display.c | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c
> index a1a875a0c706..85986578001f 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_display.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_display.c
> @@ -67,6 +67,10 @@ static const struct drm_framebuffer_funcs virtio_gpu_fb_funcs = {
>   	.dirty = drm_atomic_helper_dirtyfb,
>   };
>   
> +static const struct drm_encoder_funcs virtio_gpu_encoder_funcs = {
> +	.destroy = drm_encoder_cleanup,
> +};
> +
>   static int
>   virtio_gpu_framebuffer_init(struct drm_device *dev,
>   			    struct virtio_gpu_framebuffer *vgfb,
> @@ -306,7 +310,9 @@ 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);
> +	drm_encoder_init(dev, encoder, &virtio_gpu_encoder_funcs,
> +		DRM_MODE_ENCODER_VIRTUAL, NULL);
> +
>   	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: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)



      reply	other threads:[~2026-09-09  7:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09  7:34 Davide Bonatto
2026-09-09  7:52 ` Thomas Zimmermann [this message]

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=c5eef215-6f2e-4807-8b9e-5356b3978f8b@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@redhat.com \
    --cc=bonatto.davide@gmail.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=olvaffe@gmail.com \
    --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®