Linux-ARM-MSM Archive on lore.kernel.org
 help / color / Atom feed
* Re: [PATCH v4 16/23] drm/mgag200: Provide ddc symlink in connector sysfs directory
       [not found] ` <d32a6b1f0a3b79f1fbc8d0894080908526f6e61e.1562843413.git.andrzej.p@collabora.com>
@ 2019-07-23  9:07   ` Sam Ravnborg
  0 siblings, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2019-07-23  9:07 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz
  Cc: dri-devel, Neil Armstrong, Maxime Ripard, Douglas Anderson,
	Thierry Reding, Laurent Pinchart, kernel, linux-samsung-soc,
	linux-rockchip, Vincent Abriou, Krzysztof Kozlowski,
	Jonathan Hunter, David Airlie, Chen-Yu Tsai, Kukjin Kim,
	NXP Linux Team, Dave Airlie, intel-gfx, freedreno, linux-tegra,
	Jonas Karlman, linux-arm-msm, Alexios Zavras, Mamta Shukla,
	linux-mediatek, Jyri Sarha, Rodrigo Vivi, Matthias Brugger,
	Thomas Gleixner, Sean Paul, Pengutronix Kernel Team,
	linux-arm-kernel, amd-gfx, Tomi Valkeinen, Thomas Zimmermann,
	Seung-Woo Kim, linux-kernel, Todor Tomov, Kyungmin Park,
	Huang Rui, Alex Deucher, Shawn Guo, Christian König,
	Gerd Hoffmann

Hi Andrzej.

On Thu, Jul 11, 2019 at 01:26:43PM +0200, Andrzej Pietrasiewicz wrote:
> Use the ddc pointer provided by the generic connector.
> 
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> ---
>  drivers/gpu/drm/mgag200/mgag200_mode.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
> index a25054015e8c..8fb9444b2142 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_mode.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
> @@ -1703,6 +1703,11 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev)
>  		return NULL;
>  
>  	connector = &mga_connector->base;
> +	mga_connector->i2c = mgag200_i2c_create(dev);
> +	if (!mga_connector->i2c)
> +		DRM_ERROR("failed to add ddc bus\n");
> +
> +	connector->ddc = &mga_connector->i2c->adapter;
>  
>  	drm_connector_init(dev, connector,
>  			   &mga_vga_connector_funcs, DRM_MODE_CONNECTOR_VGA);
Like on other patch, assigning connector->ddc before
drm_connector_init() looks wrong.

	Sam

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 14/23] drm/tilcdc: Provide ddc symlink in connector sysfs directory
       [not found]   ` <20190723090532.GA787@ravnborg.org>
@ 2019-07-23 12:44     ` " Andrzej Pietrasiewicz
  2019-07-23 15:19       ` Sam Ravnborg
  2019-07-24  8:01       ` Thomas Zimmermann
  0 siblings, 2 replies; 6+ messages in thread
From: Andrzej Pietrasiewicz @ 2019-07-23 12:44 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Neil Armstrong, Maxime Ripard, dri-devel, linux-kernel,
	Matthias Brugger, Thierry Reding, Laurent Pinchart, Shawn Guo,
	kernel, linux-samsung-soc, linux-rockchip, Sean Paul,
	Krzysztof Kozlowski, Jonathan Hunter, David Airlie, Chen-Yu Tsai,
	Kukjin Kim, NXP Linux Team, Dave Airlie, Thomas Zimmermann,
	Jonas Karlman, linux-arm-msm, intel-gfx, Jyri Sarha,
	Alexios Zavras, Mamta Shukla, linux-mediatek, Rodrigo Vivi,
	linux-tegra, Thomas Gleixner, Vincent Abriou, linux-arm-kernel,
	Jernej Skrabec, amd-gfx, Tomi Valkeinen, Greg Kroah-Hartman,
	Seung-Woo Kim, Douglas Anderson, Todor Tomov, Kyungmin Park,
	Huang Rui, Pengutronix Kernel Team, Alex Deucher, freedreno,
	Christian König, Gerd Hoffmann

Hi Sam,

W dniu 23.07.2019 o 11:05, Sam Ravnborg pisze:
> Hi Andrzej
> 
> On Thu, Jul 11, 2019 at 01:26:41PM +0200, Andrzej Pietrasiewicz wrote:
>> Use the ddc pointer provided by the generic connector.
>>
>> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
>> ---
>>   drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
>> index 62d014c20988..c373edb95666 100644
>> --- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
>> @@ -219,6 +219,7 @@ static struct drm_connector *tfp410_connector_create(struct drm_device *dev,
>>   	tfp410_connector->mod = mod;
>>   
>>   	connector = &tfp410_connector->base;
>> +	connector->ddc = mod->i2c;
>>   
>>   	drm_connector_init(dev, connector, &tfp410_connector_funcs,
>>   			DRM_MODE_CONNECTOR_DVID);
> 
> When reading this code, it looks strange that we set connector->ddc
> *before* the call to init the connector.
> One could risk that drm_connector_init() used memset(..) to clear all
> fields or so, and it would break this order.

I verified the code of drm_connector_init() and cannot find any memset()
invocations there. What is your actual concern?

Andrzej

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 14/23] drm/tilcdc: Provide ddc symlink in connector sysfs directory
  2019-07-23 12:44     ` [PATCH v4 14/23] drm/tilcdc: " Andrzej Pietrasiewicz
@ 2019-07-23 15:19       ` Sam Ravnborg
  2019-07-24  8:01       ` Thomas Zimmermann
  1 sibling, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2019-07-23 15:19 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz
  Cc: Neil Armstrong, Maxime Ripard, dri-devel, linux-kernel,
	Matthias Brugger, Thierry Reding, Laurent Pinchart, Shawn Guo,
	kernel, linux-samsung-soc, linux-rockchip, Sean Paul,
	Krzysztof Kozlowski, Jonathan Hunter, David Airlie, Chen-Yu Tsai,
	Kukjin Kim, NXP Linux Team, Dave Airlie, Thomas Zimmermann,
	Jonas Karlman, linux-arm-msm, intel-gfx, Jyri Sarha,
	Alexios Zavras, Mamta Shukla, linux-mediatek, Rodrigo Vivi,
	linux-tegra, Thomas Gleixner, Vincent Abriou, linux-arm-kernel,
	Jernej Skrabec, amd-gfx, Tomi Valkeinen, Greg Kroah-Hartman,
	Seung-Woo Kim, Douglas Anderson, Todor Tomov, Kyungmin Park,
	Huang Rui, Pengutronix Kernel Team, Alex Deucher, freedreno,
	Christian König, Gerd Hoffmann

Hi Andrej.

On Tue, Jul 23, 2019 at 02:44:50PM +0200, Andrzej Pietrasiewicz wrote:
> Hi Sam,
> 
> W dniu 23.07.2019 o 11:05, Sam Ravnborg pisze:
> > Hi Andrzej
> > 
> > On Thu, Jul 11, 2019 at 01:26:41PM +0200, Andrzej Pietrasiewicz wrote:
> > > Use the ddc pointer provided by the generic connector.
> > > 
> > > Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> > > ---
> > >   drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 +
> > >   1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
> > > index 62d014c20988..c373edb95666 100644
> > > --- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
> > > +++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
> > > @@ -219,6 +219,7 @@ static struct drm_connector *tfp410_connector_create(struct drm_device *dev,
> > >   	tfp410_connector->mod = mod;
> > >   	connector = &tfp410_connector->base;
> > > +	connector->ddc = mod->i2c;
> > >   	drm_connector_init(dev, connector, &tfp410_connector_funcs,
> > >   			DRM_MODE_CONNECTOR_DVID);
> > 
> > When reading this code, it looks strange that we set connector->ddc
> > *before* the call to init the connector.
> > One could risk that drm_connector_init() used memset(..) to clear all
> > fields or so, and it would break this order.
> 
> I verified the code of drm_connector_init() and cannot find any memset()
> invocations there. What is your actual concern?
My concern is that drm_connector_init() maybe sometime in the future
will init all fileds in drm_connector, so we loose any assingments
done to drm_connector from *before* we called the init function.

Moving the assignment to after drm_connector_init() would not
let us depend on the actual implmentation of drm_connector_init().

	Sam

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 14/23] drm/tilcdc: Provide ddc symlink in connector sysfs directory
  2019-07-23 12:44     ` [PATCH v4 14/23] drm/tilcdc: " Andrzej Pietrasiewicz
  2019-07-23 15:19       ` Sam Ravnborg
@ 2019-07-24  8:01       ` Thomas Zimmermann
  2019-07-24  8:51         ` Andrzej Pietrasiewicz
  2019-07-31 19:39         ` Ezequiel Garcia
  1 sibling, 2 replies; 6+ messages in thread
From: Thomas Zimmermann @ 2019-07-24  8:01 UTC (permalink / raw)
  To: Andrzej Pietrasiewicz, Sam Ravnborg
  Cc: Neil Armstrong, Maxime Ripard, dri-devel, Douglas Anderson,
	linux-tegra, Thierry Reding, Laurent Pinchart, kernel,
	linux-samsung-soc, linux-rockchip, Vincent Abriou,
	Krzysztof Kozlowski, Jonathan Hunter, David Airlie, Chen-Yu Tsai,
	Kukjin Kim, NXP Linux Team, Dave Airlie, freedreno,
	Pengutronix Kernel Team, Jonas Karlman, linux-arm-msm, intel-gfx,
	Jyri Sarha, Alexios Zavras, Mamta Shukla, linux-mediatek,
	Rodrigo Vivi, Matthias Brugger, Thomas Gleixner, Sean Paul,
	linux-arm-kernel, Jernej Skrabec, amd-gfx, Tomi Valkeinen,
	Greg Kroah-Hartman, Seung-Woo Kim, linux-kernel, Todor Tomov,
	Kyungmin Park, Huang Rui, Alex Deucher, Shawn Guo,
	Christian König, Gerd Hoffmann

[-- Attachment #1.1: Type: text/plain, Size: 2381 bytes --]

Hi

Am 23.07.19 um 14:44 schrieb Andrzej Pietrasiewicz:
> Hi Sam,
> 
> W dniu 23.07.2019 o 11:05, Sam Ravnborg pisze:
>> Hi Andrzej
>>
>> On Thu, Jul 11, 2019 at 01:26:41PM +0200, Andrzej Pietrasiewicz wrote:
>>> Use the ddc pointer provided by the generic connector.
>>>
>>> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
>>> ---
>>>   drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
>>> b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
>>> index 62d014c20988..c373edb95666 100644
>>> --- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
>>> +++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
>>> @@ -219,6 +219,7 @@ static struct drm_connector
>>> *tfp410_connector_create(struct drm_device *dev,
>>>       tfp410_connector->mod = mod;
>>>         connector = &tfp410_connector->base;
>>> +    connector->ddc = mod->i2c;
>>>         drm_connector_init(dev, connector, &tfp410_connector_funcs,
>>>               DRM_MODE_CONNECTOR_DVID);
>>
>> When reading this code, it looks strange that we set connector->ddc
>> *before* the call to init the connector.
>> One could risk that drm_connector_init() used memset(..) to clear all
>> fields or so, and it would break this order.
> 
> I verified the code of drm_connector_init() and cannot find any memset()
> invocations there. What is your actual concern?

I think this echoes my concern about the implicit order of operation. It
seems too easy to get this wrong. If you don't want to add an additional
interface for setting the ddc field, why not add a dedicated initializer
function that sets the ddc field? Something like this.

int drm_connector_init_with_ddc(connector, funcs, ..., ddc)
{
	ret = drm_connector_init(connector, funcs, ...);
	if (ret)
		return ret;

	if (!ddc)
		return 0;

	connector->ddc = ddc;
	/* set up sysfs */

	return 0;
}

Best regards
Thomas

> Andrzej
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 14/23] drm/tilcdc: Provide ddc symlink in connector sysfs directory
  2019-07-24  8:01       ` Thomas Zimmermann
@ 2019-07-24  8:51         ` Andrzej Pietrasiewicz
  2019-07-31 19:39         ` Ezequiel Garcia
  1 sibling, 0 replies; 6+ messages in thread
From: Andrzej Pietrasiewicz @ 2019-07-24  8:51 UTC (permalink / raw)
  To: Thomas Zimmermann, Sam Ravnborg
  Cc: Neil Armstrong, Maxime Ripard, dri-devel, Douglas Anderson,
	linux-tegra, Thierry Reding, Laurent Pinchart, kernel,
	linux-samsung-soc, linux-rockchip, Vincent Abriou,
	Krzysztof Kozlowski, Jonathan Hunter, David Airlie, Chen-Yu Tsai,
	Kukjin Kim, NXP Linux Team, Dave Airlie, freedreno,
	Pengutronix Kernel Team, Jonas Karlman, linux-arm-msm, intel-gfx,
	Jyri Sarha, Alexios Zavras, Mamta Shukla, linux-mediatek,
	Rodrigo Vivi, Matthias Brugger, Thomas Gleixner, Sean Paul,
	linux-arm-kernel, Jernej Skrabec, amd-gfx, Tomi Valkeinen,
	Greg Kroah-Hartman, Seung-Woo Kim, linux-kernel, Todor Tomov,
	Kyungmin Park, Huang Rui, Alex Deucher, Shawn Guo,
	Christian König, Gerd Hoffmann

Hi Thomas,

W dniu 24.07.2019 o 10:01, Thomas Zimmermann pisze:
> Hi
> 


> 
> I think this echoes my concern about the implicit order of operation. It
> seems too easy to get this wrong. If you don't want to add an additional
> interface for setting the ddc field, why not add a dedicated initializer
> function that sets the ddc field? Something like this.
> 
> int drm_connector_init_with_ddc(connector, funcs, ..., ddc)
> {
> 	ret = drm_connector_init(connector, funcs, ...);
> 	if (ret)
> 		return ret;
> 
> 	if (!ddc)
> 		return 0;
> 
> 	connector->ddc = ddc;
> 	/* set up sysfs */
> 
> 	return 0;
> }
> 

True. I will send a v5 soon.

Thanks,

Andrzej

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 14/23] drm/tilcdc: Provide ddc symlink in connector sysfs directory
  2019-07-24  8:01       ` Thomas Zimmermann
  2019-07-24  8:51         ` Andrzej Pietrasiewicz
@ 2019-07-31 19:39         ` Ezequiel Garcia
  1 sibling, 0 replies; 6+ messages in thread
From: Ezequiel Garcia @ 2019-07-31 19:39 UTC (permalink / raw)
  To: Thomas Zimmermann, Andrzej Pietrasiewicz, Sam Ravnborg
  Cc: Neil Armstrong, Maxime Ripard, dri-devel, linux-kernel,
	Matthias Brugger, Thierry Reding, Laurent Pinchart, Shawn Guo,
	kernel, linux-samsung-soc, linux-rockchip, Sean Paul,
	Krzysztof Kozlowski, Jonathan Hunter, David Airlie, Chen-Yu Tsai,
	Kukjin Kim, NXP Linux Team, Dave Airlie, Jonas Karlman,
	linux-arm-msm, intel-gfx, Jyri Sarha, Alexios Zavras,
	Mamta Shukla, linux-mediatek, Rodrigo Vivi, linux-tegra,
	Thomas Gleixner, Vincent Abriou, linux-arm-kernel,
	Jernej Skrabec, amd-gfx, Tomi Valkeinen, Greg Kroah-Hartman,
	Seung-Woo Kim, Douglas Anderson, Todor Tomov, Kyungmin Park,
	Huang Rui, Pengutronix Kernel Team, Alex Deucher, freedreno,
	Christian König, Gerd Hoffmann

Hi,

I'm glad to see this work moving forward!

On Wed, 2019-07-24 at 10:01 +0200, Thomas Zimmermann wrote:
> Hi
> 
> Am 23.07.19 um 14:44 schrieb Andrzej Pietrasiewicz:
> > Hi Sam,
> > 
> > W dniu 23.07.2019 o 11:05, Sam Ravnborg pisze:
> > > Hi Andrzej
> > > 
> > > On Thu, Jul 11, 2019 at 01:26:41PM +0200, Andrzej Pietrasiewicz wrote:
> > > > Use the ddc pointer provided by the generic connector.
> > > > 
> > > > Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> > > > ---
> > > >   drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 +
> > > >   1 file changed, 1 insertion(+)
> > > > 
> > > > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
> > > > b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
> > > > index 62d014c20988..c373edb95666 100644
> > > > --- a/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
> > > > +++ b/drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
> > > > @@ -219,6 +219,7 @@ static struct drm_connector
> > > > *tfp410_connector_create(struct drm_device *dev,
> > > >       tfp410_connector->mod = mod;
> > > >         connector = &tfp410_connector->base;
> > > > +    connector->ddc = mod->i2c;
> > > >         drm_connector_init(dev, connector, &tfp410_connector_funcs,
> > > >               DRM_MODE_CONNECTOR_DVID);
> > > 
> > > When reading this code, it looks strange that we set connector->ddc
> > > *before* the call to init the connector.
> > > One could risk that drm_connector_init() used memset(..) to clear all
> > > fields or so, and it would break this order.
> > 
> > I verified the code of drm_connector_init() and cannot find any memset()
> > invocations there. What is your actual concern?
> 
> I think this echoes my concern about the implicit order of operation. It
> seems too easy to get this wrong. If you don't want to add an additional
> interface for setting the ddc field, why not add a dedicated initializer
> function that sets the ddc field? Something like this.
> 
> int drm_connector_init_with_ddc(connector, funcs, ..., ddc)
> {
> 	ret = drm_connector_init(connector, funcs, ...);
> 	if (ret)
> 		return ret;
> 
> 	if (!ddc)
> 		return 0;
> 
> 	connector->ddc = ddc;
> 	/* set up sysfs */
> 

I know this comment comes late to the party, but I'm a slightly
suprised to see the above instead of implementing drm_connector_init
in terms of drm_connector_init_with_ddc, as we typically do.

Namely, something along these lines (code might not even build!):

--------------------------------------8<-----------------------------
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index d49e19f3de3a..dbd095933175 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -179,11 +179,12 @@ void drm_connector_free_work_fn(struct work_struct *work)
 }
 
 /**
- * drm_connector_init - Init a preallocated connector
+ * drm_connector_init_with_ddc - Init a preallocated connector
  * @dev: DRM device
  * @connector: the connector to init
  * @funcs: callbacks for this connector
  * @connector_type: user visible type of the connector
+ * @ddc: pointer to the associated ddc adapter (optional)
  *
  * Initialises a preallocated connector. Connectors should be
  * subclassed as part of driver connector objects.
@@ -191,10 +192,11 @@ void drm_connector_free_work_fn(struct work_struct *work)
  * Returns:
  * Zero on success, error code on failure.
  */
-int drm_connector_init(struct drm_device *dev,
-		       struct drm_connector *connector,
-		       const struct drm_connector_funcs *funcs,
-		       int connector_type)
+int drm_connector_init_with_ddc(struct drm_device *dev,
+				struct drm_connector *connector,
+				const struct drm_connector_funcs *funcs,
+				int connector_type,
+				struct i2c_adapter *ddc)
 {
 	struct drm_mode_config *config = &dev->mode_config;
 	int ret;
@@ -215,6 +217,9 @@ int drm_connector_init(struct drm_device *dev,
 	connector->dev = dev;
 	connector->funcs = funcs;
 
+	/* provide ddc symlink in sysfs */
+	connector->ddc = ddc;
+
 	/* connector index is used with 32bit bitmasks */
 	ret = ida_simple_get(&config->connector_ida, 0, 32, GFP_KERNEL);
 	if (ret < 0) {
@@ -295,41 +300,6 @@ int drm_connector_init(struct drm_device *dev,
 
 	return ret;
 }
-EXPORT_SYMBOL(drm_connector_init);
-
-/**
- * drm_connector_init_with_ddc - Init a preallocated connector
- * @dev: DRM device
- * @connector: the connector to init
- * @funcs: callbacks for this connector
- * @connector_type: user visible type of the connector
- * @ddc: pointer to the associated ddc adapter
- *
- * Initialises a preallocated connector. Connectors should be
- * subclassed as part of driver connector objects.
- *
- * Ensures that the ddc field of the connector is correctly set.
- *
- * Returns:
- * Zero on success, error code on failure.
- */
-int drm_connector_init_with_ddc(struct drm_device *dev,
-				struct drm_connector *connector,
-				const struct drm_connector_funcs *funcs,
-				int connector_type,
-				struct i2c_adapter *ddc)
-{
-	int ret;
-
-	ret = drm_connector_init(dev, connector, funcs, connector_type);
-	if (ret)
-		return ret;
-
-	/* provide ddc symlink in sysfs */
-	connector->ddc = ddc;
-
-	return ret;
-}
 EXPORT_SYMBOL(drm_connector_init_with_ddc);
 
 /**
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index fc5d08438333..1884abf61a86 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1408,10 +1408,6 @@ struct drm_connector {
 
 #define obj_to_connector(x) container_of(x, struct drm_connector, base)
 
-int drm_connector_init(struct drm_device *dev,
-		       struct drm_connector *connector,
-		       const struct drm_connector_funcs *funcs,
-		       int connector_type);
 int drm_connector_init_with_ddc(struct drm_device *dev,
 				struct drm_connector *connector,
 				const struct drm_connector_funcs *funcs,
@@ -1425,6 +1421,16 @@ int drm_connector_attach_encoder(struct drm_connector *connector,
 
 void drm_connector_cleanup(struct drm_connector *connector);
 
+static inline int
+drm_connector_init(struct drm_device *dev,
+		   struct drm_connector *connector,
+		   const struct drm_connector_funcs *funcs,
+		   int connector_type);
+{
+	return drm_connector_init_with_ddc(dev, connector, funcs,
+					   connector_type, NULL);
+}
+
 static inline unsigned int drm_connector_index(const struct drm_connector *connector)
 {
 	return connector->index;
-------------------------------------->8-----------------------------

This might be seen as bikeshed but it seems there's value keeping all the init
code in the same place, as opposed to scattered.

Unless there are reasons for the current code, that I'm missing?

Thanks,
Ezequiel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1562843413.git.andrzej.p@collabora.com>
     [not found] ` <d32a6b1f0a3b79f1fbc8d0894080908526f6e61e.1562843413.git.andrzej.p@collabora.com>
2019-07-23  9:07   ` [PATCH v4 16/23] drm/mgag200: Provide ddc symlink in connector sysfs directory Sam Ravnborg
     [not found] ` <d1d415022c598fb7acd033f0f322dd67250adaa9.1562843413.git.andrzej.p@collabora.com>
     [not found]   ` <20190723090532.GA787@ravnborg.org>
2019-07-23 12:44     ` [PATCH v4 14/23] drm/tilcdc: " Andrzej Pietrasiewicz
2019-07-23 15:19       ` Sam Ravnborg
2019-07-24  8:01       ` Thomas Zimmermann
2019-07-24  8:51         ` Andrzej Pietrasiewicz
2019-07-31 19:39         ` Ezequiel Garcia

Linux-ARM-MSM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-msm/0 linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ https://lore.kernel.org/linux-arm-msm \
		linux-arm-msm@vger.kernel.org linux-arm-msm@archiver.kernel.org
	public-inbox-index linux-arm-msm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arm-msm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox