[PATCH RESEND v2 29/32] drm/vkms: Rename vkms_connector_init to vkms_connector_init_static

Louis Chauvet posted 32 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH RESEND v2 29/32] drm/vkms: Rename vkms_connector_init to vkms_connector_init_static
Posted by Louis Chauvet 3 months, 1 week ago
With the introduction of dynamic connectors we will have two way of
initializing a VKMS connector. Rename the current function to clarify
the case.

Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
---
 drivers/gpu/drm/vkms/vkms_connector.c | 4 ++--
 drivers/gpu/drm/vkms/vkms_connector.h | 7 ++++---
 drivers/gpu/drm/vkms/vkms_output.c    | 4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/vkms/vkms_connector.c b/drivers/gpu/drm/vkms/vkms_connector.c
index 699b6779a46c..1b7ccca2abc0 100644
--- a/drivers/gpu/drm/vkms/vkms_connector.c
+++ b/drivers/gpu/drm/vkms/vkms_connector.c
@@ -108,8 +108,8 @@ static const struct drm_connector_helper_funcs vkms_conn_helper_funcs = {
 	.best_encoder = vkms_conn_best_encoder,
 };
 
-struct vkms_connector *vkms_connector_init(struct vkms_device *vkmsdev,
-					   struct vkms_config_connector *connector_cfg)
+struct vkms_connector *vkms_connector_init_static(struct vkms_device *vkmsdev,
+						  struct vkms_config_connector *connector_cfg)
 {
 	struct drm_device *dev = &vkmsdev->drm;
 	struct vkms_connector *connector;
diff --git a/drivers/gpu/drm/vkms/vkms_connector.h b/drivers/gpu/drm/vkms/vkms_connector.h
index a124c5403697..85f9082c710e 100644
--- a/drivers/gpu/drm/vkms/vkms_connector.h
+++ b/drivers/gpu/drm/vkms/vkms_connector.h
@@ -4,6 +4,7 @@
 #define _VKMS_CONNECTOR_H_
 
 #include "vkms_drv.h"
+#include "vkms_config.h"
 
 #define drm_connector_to_vkms_connector(target) \
 	container_of(target, struct vkms_connector, base)
@@ -18,14 +19,14 @@ struct vkms_connector {
 };
 
 /**
- * vkms_connector_init() - Initialize a connector
+ * vkms_connector_init_static() - Initialize a connector
  * @vkmsdev: VKMS device containing the connector
  *
  * Returns:
  * The connector or an error on failure.
  */
-struct vkms_connector *vkms_connector_init(struct vkms_device *vkmsdev,
-					   struct vkms_config_connector *connector_cfg);
+struct vkms_connector *vkms_connector_init_static(struct vkms_device *vkmsdev,
+						  struct vkms_config_connector *connector_cfg);
 
 /**
  * vkms_trigger_connector_hotplug() - Update the device's connectors status
diff --git a/drivers/gpu/drm/vkms/vkms_output.c b/drivers/gpu/drm/vkms/vkms_output.c
index 217f054d9598..44f8f53c9194 100644
--- a/drivers/gpu/drm/vkms/vkms_output.c
+++ b/drivers/gpu/drm/vkms/vkms_output.c
@@ -92,11 +92,11 @@ int vkms_output_init(struct vkms_device *vkmsdev)
 		}
 	}
 
-	vkms_config_for_each_connector(vkmsdev->config, connector_cfg) {
+	vkms_config_for_each_connector_static(vkmsdev->config, connector_cfg) {
 		struct vkms_config_encoder *possible_encoder;
 		unsigned long idx = 0;
 
-		connector_cfg->connector = vkms_connector_init(vkmsdev, connector_cfg);
+		connector_cfg->connector = vkms_connector_init_static(vkmsdev, connector_cfg);
 		if (IS_ERR(connector_cfg->connector)) {
 			DRM_ERROR("Failed to init connector\n");
 			return PTR_ERR(connector_cfg->connector);

-- 
2.51.0
Re: [PATCH RESEND v2 29/32] drm/vkms: Rename vkms_connector_init to vkms_connector_init_static
Posted by Luca Ceresoli 1 month, 3 weeks ago
On Wed Oct 29, 2025 at 3:37 PM CET, Louis Chauvet wrote:
> With the introduction of dynamic connectors we will have two way of
> initializing a VKMS connector. Rename the current function to clarify
> the case.
>
> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>

> --- a/drivers/gpu/drm/vkms/vkms_connector.h
> +++ b/drivers/gpu/drm/vkms/vkms_connector.h
> @@ -4,6 +4,7 @@
>  #define _VKMS_CONNECTOR_H_
>
>  #include "vkms_drv.h"
> +#include "vkms_config.h"

Why? Maybe this is for another patch in the series?

With that line removed:

 Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>


--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Re: [PATCH RESEND v2 29/32] drm/vkms: Rename vkms_connector_init to vkms_connector_init_static
Posted by Louis Chauvet 1 month, 3 weeks ago

On 12/19/25 19:58, Luca Ceresoli wrote:
> On Wed Oct 29, 2025 at 3:37 PM CET, Louis Chauvet wrote:
>> With the introduction of dynamic connectors we will have two way of
>> initializing a VKMS connector. Rename the current function to clarify
>> the case.
>>
>> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
> 
>> --- a/drivers/gpu/drm/vkms/vkms_connector.h
>> +++ b/drivers/gpu/drm/vkms/vkms_connector.h
>> @@ -4,6 +4,7 @@
>>   #define _VKMS_CONNECTOR_H_
>>
>>   #include "vkms_drv.h"
>> +#include "vkms_config.h"
> 
> Why? Maybe this is for another patch in the series?

This line is useful, I use struct vkms_config_connector
But I agree, this should be a separate patch.

> With that line removed:
> 
>   Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> 
> 
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Re: [PATCH RESEND v2 29/32] drm/vkms: Rename vkms_connector_init to vkms_connector_init_static
Posted by Luca Ceresoli 1 month, 3 weeks ago
On Fri Dec 19, 2025 at 8:11 PM CET, Louis Chauvet wrote:
>
>
> On 12/19/25 19:58, Luca Ceresoli wrote:
>> On Wed Oct 29, 2025 at 3:37 PM CET, Louis Chauvet wrote:
>>> With the introduction of dynamic connectors we will have two way of
>>> initializing a VKMS connector. Rename the current function to clarify
>>> the case.
>>>
>>> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
>>
>>> --- a/drivers/gpu/drm/vkms/vkms_connector.h
>>> +++ b/drivers/gpu/drm/vkms/vkms_connector.h
>>> @@ -4,6 +4,7 @@
>>>   #define _VKMS_CONNECTOR_H_
>>>
>>>   #include "vkms_drv.h"
>>> +#include "vkms_config.h"
>>
>> Why? Maybe this is for another patch in the series?
>
> This line is useful, I use struct vkms_config_connector
> But I agree, this should be a separate patch.

Ah, I see, perhaps it is working currently because it is included by some
other .h files. Yes, better making that explicit (include what you use), or
use a forward declaration if you want. In any case, a separate patch
indeed.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com