From: Louis Chauvet <louis.chauvet@bootlin.com>
To: "Maíra Canal" <mairacanal@riseup.net>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
Melissa Wen <melissa.srw@gmail.com>,
Haneen Mohammed <hamohammed.sa@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Simona Vetter <simona.vetter@ffwll.ch>,
dri-devel@lists.freedesktop.org, arthurgrillo@riseup.net,
linux-kernel@vger.kernel.org, jeremie.dautheribes@bootlin.com,
miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com,
seanpaul@google.com, nicolejadeyee@google.com,
20241010-vkms-remove-index-v2-1-6b8d6cfd5a15@bootlin.com
Subject: Re: [PATCH v4 1/5] drm/vkms: Switch to managed for connector
Date: Mon, 28 Oct 2024 10:50:35 +0100 [thread overview]
Message-ID: <Zx9eazl8s7o6Mx-T@fedora> (raw)
In-Reply-To: <575323aa-d322-4d03-8343-15aaaa955437@riseup.net>
On 26/10/24 - 12:29, Maíra Canal wrote:
> Hi Louis,
>
> On 10/10/24 14:39, Louis Chauvet wrote:
> > The current VKMS driver uses non-managed function to create connectors. It
> > is not an issue yet, but in order to support multiple devices easily,
> > convert this code to use drm and device managed helpers.
> >
> > Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
> > ---
> > drivers/gpu/drm/vkms/vkms_output.c | 19 +++++++------------
> > 1 file changed, 7 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
> > index 5128aa3b2eb6..8f7a05b73e1d 100644
> > --- a/drivers/gpu/drm/vkms/vkms_output.c
> > +++ b/drivers/gpu/drm/vkms/vkms_output.c
> > @@ -3,11 +3,11 @@
> > #include "vkms_drv.h"
> > #include <drm/drm_atomic_helper.h>
> > #include <drm/drm_edid.h>
> > +#include <drm/drm_managed.h>
> > #include <drm/drm_probe_helper.h>
> > static const struct drm_connector_funcs vkms_connector_funcs = {
> > .fill_modes = drm_helper_probe_single_connector_modes,
> > - .destroy = drm_connector_cleanup,
> > .reset = drm_atomic_helper_connector_reset,
> > .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
> > .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> > @@ -70,17 +70,17 @@ int vkms_output_init(struct vkms_device *vkmsdev)
> > if (IS_ERR(overlay)) {
> > DRM_DEV_ERROR(dev->dev, "Failed to init vkms plane\n");
> > ret = PTR_ERR(overlay);
> > - goto err_crtc;
> > + goto err_connector;
>
> Why did you renamed err_crtc to err_connector? I think err_crtc looks
> correct.
I rename it many times during my work, it was never clear for me if
"err_crtc" is about an error during the CRTC initialization or a label to
clean the crtc.
If for you err_crtc is correct (ie err_<thing> means "cleanup <thing>"), I
will switch to this pattern.
Thanks,
Louis Chauvet
> Best Regards,
> - Maíra
>
> > }
> > overlay->base.possible_crtcs = drm_crtc_mask(crtc);
> > }
> > }
> > - ret = drm_connector_init(dev, connector, &vkms_connector_funcs,
> > - DRM_MODE_CONNECTOR_VIRTUAL);
> > + ret = drmm_connector_init(dev, connector, &vkms_connector_funcs,
> > + DRM_MODE_CONNECTOR_VIRTUAL, NULL);
> > if (ret) {
> > DRM_ERROR("Failed to init connector\n");
> > - goto err_crtc;
> > + goto err_connector;
> > }
> > drm_connector_helper_add(connector, &vkms_conn_helper_funcs);
> > @@ -89,7 +89,7 @@ int vkms_output_init(struct vkms_device *vkmsdev)
> > DRM_MODE_ENCODER_VIRTUAL, NULL);
> > if (ret) {
> > DRM_ERROR("Failed to init encoder\n");
> > - goto err_encoder;
> > + return ret;
> > }
> > encoder->possible_crtcs = drm_crtc_mask(crtc);
> > @@ -111,12 +111,7 @@ int vkms_output_init(struct vkms_device *vkmsdev)
> > err_attach:
> > drm_encoder_cleanup(encoder);
> > -
> > -err_encoder:
> > - drm_connector_cleanup(connector);
> > -
> > -err_crtc:
> > +err_connector:
> > drm_crtc_cleanup(crtc);
> > -
> > return ret;
> > }
> >
next prev parent reply other threads:[~2024-10-28 9:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 17:39 [PATCH v4 0/5] drm/vkms: Switch all vkms object to DRM managed objects Louis Chauvet
2024-10-10 17:39 ` [PATCH v4 1/5] drm/vkms: Switch to managed for connector Louis Chauvet
2024-10-26 15:29 ` Maíra Canal
2024-10-28 9:50 ` Louis Chauvet [this message]
2024-10-10 17:39 ` [PATCH v4 2/5] drm/vkms: Switch to managed for encoder Louis Chauvet
2024-10-10 17:39 ` [PATCH v4 3/5] drm/vkms: Switch to managed for crtc Louis Chauvet
2024-10-10 17:39 ` [PATCH v4 4/5] drm: writeback: Introduce drm managed helpers Louis Chauvet
2024-10-24 8:19 ` Maxime Ripard
2024-10-10 17:39 ` [PATCH v4 5/5] drm/vkms: Switch to managed for writeback connector Louis Chauvet
2024-10-26 15:33 ` [PATCH v4 0/5] drm/vkms: Switch all vkms object to DRM managed objects Maíra Canal
2024-10-28 9:50 ` Louis Chauvet
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=Zx9eazl8s7o6Mx-T@fedora \
--to=louis.chauvet@bootlin.com \
--cc=20241010-vkms-remove-index-v2-1-6b8d6cfd5a15@bootlin.com \
--cc=airlied@gmail.com \
--cc=arthurgrillo@riseup.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=jeremie.dautheribes@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mairacanal@riseup.net \
--cc=melissa.srw@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=mripard@kernel.org \
--cc=nicolejadeyee@google.com \
--cc=rodrigosiqueiramelo@gmail.com \
--cc=seanpaul@google.com \
--cc=simona.vetter@ffwll.ch \
--cc=simona@ffwll.ch \
--cc=thomas.petazzoni@bootlin.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