From: junsungpark774@gmail.com
To: tzimmermann@suse.de
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Park Junsung <junsungpark774@gmail.com>
Subject: [PATCH] drivers: drm: remove drm_simple_encoder_init then inline with drm_encoder_init
Date: Thu, 30 Jul 2026 17:49:08 +0900 [thread overview]
Message-ID: <20260730084908.109270-1-junsungpark774@gmail.com> (raw)
From: Park Junsung <junsungpark774@gmail.com>
remove drm_simple_encoder_init which is noted as a unnecessary
intermediate layer in the TODO list
and inline it into drm_encoder_init.
to achieve this,
declare and define drm_encoder_funcs with the static keyword.
has been verified by module compilation with no errors on modified area.
Signed-off-by: Park Junsung <junsungpark774@gmail.com>
---
drivers/gpu/drm/qxl/qxl_display.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index a026bd35ef48..52d9bb46ea95 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -44,6 +44,10 @@
#include "qxl_drv.h"
#include "qxl_object.h"
+static const struct drm_encoder_funcs drm_encoder_funcs_cleanup = {
+ .destroy = drm_encoder_cleanup,
+};
+
static bool qxl_head_enabled(struct qxl_head *head)
{
return head->width && head->height;
@@ -1169,10 +1173,11 @@ static int qdev_output_init(struct drm_device *dev, int num_output)
drm_connector_init(dev, &qxl_output->base,
&qxl_connector_funcs, DRM_MODE_CONNECTOR_VIRTUAL);
- ret = drm_simple_encoder_init(dev, &qxl_output->enc,
- DRM_MODE_ENCODER_VIRTUAL);
+ ret = drm_encoder_init(dev, &qxl_output->enc,
+ &drm_encoder_funcs_cleanup,
+ DRM_MODE_ENCODER_VIRTUAL, NULL);
if (ret) {
- drm_err(dev, "drm_simple_encoder_init() failed, error %d\n",
+ drm_err(dev, "drm_encoder_init() failed, error %d\n",
ret);
goto err_drm_connector_cleanup;
}
--
2.53.0
next reply other threads:[~2026-07-30 12:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 8:49 junsungpark774 [this message]
2026-07-30 12:34 ` [PATCH] drivers: drm: remove drm_simple_encoder_init then inline with drm_encoder_init sashiko-bot
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=20260730084908.109270-1-junsungpark774@gmail.com \
--to=junsungpark774@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tzimmermann@suse.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.