[1/2] drm/vkms: Drop vkms_connector_destroy() wrapper

Message ID 20230406110235.3092055-2-javierm@redhat.com
State New
Headers
Series drm/vkms: A couple of trivial cleanups |

Commit Message

Javier Martinez Canillas April 6, 2023, 11:02 a.m. UTC
  This helper is just a wrapper that calls drm_connector_cleanup(), there's
no need to have another level of indirection.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---

 drivers/gpu/drm/vkms/vkms_output.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
  

Comments

Daniel Vetter April 6, 2023, 11:11 a.m. UTC | #1
On Thu, Apr 06, 2023 at 01:02:34PM +0200, Javier Martinez Canillas wrote:
> This helper is just a wrapper that calls drm_connector_cleanup(), there's
> no need to have another level of indirection.
> 
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>

On both patches:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Aside, would be a nice cleanup to move vkms output stuff (crtc and
connector) over to the drmm_ stuff. The plane already does that.

That should also simplify the multi-output work.
-Daniel

> ---
> 
>  drivers/gpu/drm/vkms/vkms_output.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
> index 991857125bb4..4de6f8ae38be 100644
> --- a/drivers/gpu/drm/vkms/vkms_output.c
> +++ b/drivers/gpu/drm/vkms/vkms_output.c
> @@ -6,14 +6,9 @@
>  #include <drm/drm_probe_helper.h>
>  #include <drm/drm_simple_kms_helper.h>
>  
> -static void vkms_connector_destroy(struct drm_connector *connector)
> -{
> -	drm_connector_cleanup(connector);
> -}
> -
>  static const struct drm_connector_funcs vkms_connector_funcs = {
>  	.fill_modes = drm_helper_probe_single_connector_modes,
> -	.destroy = vkms_connector_destroy,
> +	.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,
> -- 
> 2.40.0
>
  
Maíra Canal April 6, 2023, 11:26 a.m. UTC | #2
On 4/6/23 08:11, Daniel Vetter wrote:
> On Thu, Apr 06, 2023 at 01:02:34PM +0200, Javier Martinez Canillas wrote:
>> This helper is just a wrapper that calls drm_connector_cleanup(), there's
>> no need to have another level of indirection.
>>
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> 
> On both patches:
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Aside, would be a nice cleanup to move vkms output stuff (crtc and
> connector) over to the drmm_ stuff. The plane already does that.

I sent a patch [1] a while ago moving the CRTC to the drmm_ functions.
If you could take a look at it, it would be great.

[1] https://lore.kernel.org/dri-devel/20230116205800.1266227-1-mcanal@igalia.com/T/

Best Regards,
- Maíra Canal

> 
> That should also simplify the multi-output work.
> -Daniel
> 
>> ---
>>
>>   drivers/gpu/drm/vkms/vkms_output.c | 7 +------
>>   1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
>> index 991857125bb4..4de6f8ae38be 100644
>> --- a/drivers/gpu/drm/vkms/vkms_output.c
>> +++ b/drivers/gpu/drm/vkms/vkms_output.c
>> @@ -6,14 +6,9 @@
>>   #include <drm/drm_probe_helper.h>
>>   #include <drm/drm_simple_kms_helper.h>
>>   
>> -static void vkms_connector_destroy(struct drm_connector *connector)
>> -{
>> -	drm_connector_cleanup(connector);
>> -}
>> -
>>   static const struct drm_connector_funcs vkms_connector_funcs = {
>>   	.fill_modes = drm_helper_probe_single_connector_modes,
>> -	.destroy = vkms_connector_destroy,
>> +	.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,
>> -- 
>> 2.40.0
>>
>
  
Javier Martinez Canillas April 6, 2023, 11:47 a.m. UTC | #3
Maíra Canal <mcanal@igalia.com> writes:

Hello Maíra,

> On 4/6/23 08:11, Daniel Vetter wrote:
>> On Thu, Apr 06, 2023 at 01:02:34PM +0200, Javier Martinez Canillas wrote:
>>> This helper is just a wrapper that calls drm_connector_cleanup(), there's
>>> no need to have another level of indirection.
>>>
>>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>> 
>> On both patches:
>> 
>> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> 
>> Aside, would be a nice cleanup to move vkms output stuff (crtc and
>> connector) over to the drmm_ stuff. The plane already does that.
>
> I sent a patch [1] a while ago moving the CRTC to the drmm_ functions.
> If you could take a look at it, it would be great.
>
> [1] https://lore.kernel.org/dri-devel/20230116205800.1266227-1-mcanal@igalia.com/T/
>

I've now reviewed both patches from your series and they look good to me.

> Best Regards,
> - Maíra Canal
>
  

Patch

diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
index 991857125bb4..4de6f8ae38be 100644
--- a/drivers/gpu/drm/vkms/vkms_output.c
+++ b/drivers/gpu/drm/vkms/vkms_output.c
@@ -6,14 +6,9 @@ 
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
 
-static void vkms_connector_destroy(struct drm_connector *connector)
-{
-	drm_connector_cleanup(connector);
-}
-
 static const struct drm_connector_funcs vkms_connector_funcs = {
 	.fill_modes = drm_helper_probe_single_connector_modes,
-	.destroy = vkms_connector_destroy,
+	.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,