lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250116155500.3476-1-jose.exposito89@gmail.com>
Date: Thu, 16 Jan 2025 16:54:59 +0100
From: José Expósito <jose.exposito89@...il.com>
To: louis.chauvet@...tlin.com
Cc: airlied@...il.com,
	arthurgrillo@...eup.net,
	dri-devel@...ts.freedesktop.org,
	hamohammed.sa@...il.com,
	jeremie.dautheribes@...tlin.com,
	linux-kernel@...r.kernel.org,
	maarten.lankhorst@...ux.intel.com,
	mairacanal@...eup.net,
	mcanal@...lia.com,
	melissa.srw@...il.com,
	miquel.raynal@...tlin.com,
	mripard@...nel.org,
	nicolejadeyee@...gle.com,
	rodrigosiqueiramelo@...il.com,
	seanpaul@...gle.com,
	simona.vetter@...ll.ch,
	simona@...ll.ch,
	thomas.petazzoni@...tlin.com,
	tzimmermann@...e.de,
	José Expósito <jose.exposito89@...il.com>
Subject: [PATCH v8 2/8] drm/vkms: Switch to managed for encoder

> The current VKMS driver uses non-managed function to create encoders. It
> is not an issue yet, but in order to support multiple devices easily,
> convert this code to use drm and device managed helpers.
> 
> Reviewed-by: Maxime Ripard <mripard@...nel.org>
> Reviewed-by: Maíra Canal <mcanal@...lia.com>
> Reviewed-by: Thomas Zimmermann <tzimmermann@...e.de>
> Signed-off-by: Louis Chauvet <louis.chauvet@...tlin.com>

Reviewed-by: José Expósito <jose.exposito89@...il.com>

Thanks!

> ---
>  drivers/gpu/drm/vkms/vkms_output.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
> index 570823ecb28f589e6323036590ec05a2f633bc9b..ab9affa75b66ce9f00fe025052439405206144ec 100644
> --- a/drivers/gpu/drm/vkms/vkms_output.c
> +++ b/drivers/gpu/drm/vkms/vkms_output.c
> @@ -13,10 +13,6 @@ 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;
> @@ -84,8 +80,8 @@ int vkms_output_init(struct vkms_device *vkmsdev)
>  
>  	drm_connector_helper_add(connector, &vkms_conn_helper_funcs);
>  
> -	ret = drm_encoder_init(dev, encoder, &vkms_encoder_funcs,
> -			       DRM_MODE_ENCODER_VIRTUAL, NULL);
> +	ret = drmm_encoder_init(dev, encoder, NULL,
> +				DRM_MODE_ENCODER_VIRTUAL, NULL);
>  	if (ret) {
>  		DRM_ERROR("Failed to init encoder\n");
>  		return ret;
> @@ -95,7 +91,7 @@ int vkms_output_init(struct vkms_device *vkmsdev)
>  	ret = drm_connector_attach_encoder(connector, encoder);
>  	if (ret) {
>  		DRM_ERROR("Failed to attach connector to encoder\n");
> -		goto err_attach;
> +		return ret;
>  	}
>  
>  	if (vkmsdev->config->writeback) {
> @@ -108,7 +104,5 @@ int vkms_output_init(struct vkms_device *vkmsdev)
>  
>  	return 0;
>  
> -err_attach:
> -	drm_encoder_cleanup(encoder);
>  	return ret;
>  }
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ