mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javierm@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: "Thomas Zimmermann" <tzimmermann@suse.de>,
	"Maíra Canal" <mcanal@igalia.com>,
	"Marius Vlad" <marius.vlad@collabora.com>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"David Airlie" <airlied@gmail.com>,
	"Haneen Mohammed" <hamohammed.sa@gmail.com>,
	"Melissa Wen" <melissa.srw@gmail.com>,
	"Rodrigo Siqueira" <rodrigosiqueiramelo@gmail.com>,
	dri-devel@lists.freedesktop.org
Subject: [PATCH 2/2] drm/vkms: Remove <drm/drm_simple_kms_helper.h> include
Date: Thu,  6 Apr 2023 13:02:35 +0200	[thread overview]
Message-ID: <20230406110235.3092055-3-javierm@redhat.com> (raw)
In-Reply-To: <20230406110235.3092055-1-javierm@redhat.com>

The driver doesn't use simple-KMS helpers to set a simple display pipeline
but it only uses the drm_simple_encoder_init() helper from simple-KMS that
initializes and 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>
---

 drivers/gpu/drm/vkms/vkms_output.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
index 4de6f8ae38be..5ce70dd946aa 100644
--- a/drivers/gpu/drm/vkms/vkms_output.c
+++ b/drivers/gpu/drm/vkms/vkms_output.c
@@ -4,7 +4,6 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 
 static const struct drm_connector_funcs vkms_connector_funcs = {
 	.fill_modes = drm_helper_probe_single_connector_modes,
@@ -14,6 +13,10 @@ static const struct drm_connector_funcs vkms_connector_funcs = {
 	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };
 
+static const struct drm_encoder_funcs vkms_encoder_funcs = {
+	.destroy = drm_encoder_cleanup,
+};
+
 static int vkms_conn_get_modes(struct drm_connector *connector)
 {
 	int count;
@@ -86,7 +89,8 @@ int vkms_output_init(struct vkms_device *vkmsdev, int index)
 
 	drm_connector_helper_add(connector, &vkms_conn_helper_funcs);
 
-	ret = drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_VIRTUAL);
+	ret = drm_encoder_init(dev, encoder, &vkms_encoder_funcs,
+			       DRM_MODE_ENCODER_VIRTUAL, NULL);
 	if (ret) {
 		DRM_ERROR("Failed to init encoder\n");
 		goto err_encoder;
-- 
2.40.0


  parent reply	other threads:[~2023-04-06 11:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06 11:02 [PATCH 0/2] drm/vkms: A couple of trivial cleanups Javier Martinez Canillas
2023-04-06 11:02 ` [PATCH 1/2] drm/vkms: Drop vkms_connector_destroy() wrapper Javier Martinez Canillas
2023-04-06 11:11   ` Daniel Vetter
2023-04-06 11:26     ` Maíra Canal
2023-04-06 11:47       ` Javier Martinez Canillas
2023-04-06 11:02 ` Javier Martinez Canillas [this message]
2023-04-06 11:15 ` [PATCH 0/2] drm/vkms: A couple of trivial cleanups Thomas Zimmermann
2023-04-06 11:31 ` Maíra Canal
2023-04-07 11:22 ` Javier Martinez Canillas

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=20230406110235.3092055-3-javierm@redhat.com \
    --to=javierm@redhat.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marius.vlad@collabora.com \
    --cc=mcanal@igalia.com \
    --cc=melissa.srw@gmail.com \
    --cc=rodrigosiqueiramelo@gmail.com \
    --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 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®