All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: drm_connector->s/connector_id/index/ for consistency
@ 2016-07-19 10:57 Daniel Vetter
  2016-07-19 11:49 ` ✗ Ro.CI.BAT: failure for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Daniel Vetter @ 2016-07-19 10:57 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Daniel Vetter, Intel Graphics Development

connector_id in the uapi actually means drm_connector->base.id, which
is something entirely different. And ->index is also consistent with
plane/encoder/CRTCS and the various drm_*_index() functions.

While at it also improve/align the kerneldoc comment.

v2: Mention where those ids are from ...

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_crtc.c | 11 +++++------
 include/drm/drm_crtc.h     | 13 ++++++++++---
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index c456628740dd..f9f2506b1855 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -934,11 +934,10 @@ int drm_connector_init(struct drm_device *dev,
 	connector->dev = dev;
 	connector->funcs = funcs;
 
-	connector->connector_id = ida_simple_get(&config->connector_ida, 0, 0, GFP_KERNEL);
-	if (connector->connector_id < 0) {
-		ret = connector->connector_id;
+	ret = ida_simple_get(&config->connector_ida, 0, 0, GFP_KERNEL);
+	if (ret < 0)
 		goto out_put;
-	}
+	connector->index = ret;
 
 	connector->connector_type = connector_type;
 	connector->connector_type_id =
@@ -986,7 +985,7 @@ out_put_type_id:
 		ida_remove(connector_ida, connector->connector_type_id);
 out_put_id:
 	if (ret)
-		ida_remove(&config->connector_ida, connector->connector_id);
+		ida_remove(&config->connector_ida, connector->index);
 out_put:
 	if (ret)
 		drm_mode_object_unregister(dev, &connector->base);
@@ -1030,7 +1029,7 @@ void drm_connector_cleanup(struct drm_connector *connector)
 		   connector->connector_type_id);
 
 	ida_remove(&dev->mode_config.connector_ida,
-		   connector->connector_id);
+		   connector->index);
 
 	kfree(connector->display_info.bus_formats);
 	drm_mode_object_unregister(dev, &connector->base);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index f8ba5aab5d28..4aa4c4341d01 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1246,7 +1246,6 @@ struct drm_encoder {
  * @head: list management
  * @base: base KMS object
  * @name: human readable name, can be overwritten by the driver
- * @connector_id: compacted connector id useful indexing arrays
  * @connector_type: one of the %DRM_MODE_CONNECTOR_<foo> types from drm_mode.h
  * @connector_type_id: index into connector type enum
  * @interlace_allowed: can this connector handle interlaced modes?
@@ -1303,7 +1302,15 @@ struct drm_connector {
 	struct drm_mode_object base;
 
 	char *name;
-	int connector_id;
+
+	/**
+	 * @index: Compacted connector index, which matches the position inside
+	 * the mode_config.list for drivers not support hot-add/removing. Can be
+	 * used as an array index. It is invariant over the lifetime of the
+	 * connector.
+	 */
+	unsigned index;
+
 	int connector_type;
 	int connector_type_id;
 	bool interlace_allowed;
@@ -2764,7 +2771,7 @@ void drm_connector_unregister(struct drm_connector *connector);
 extern void drm_connector_cleanup(struct drm_connector *connector);
 static inline unsigned drm_connector_index(struct drm_connector *connector)
 {
-	return connector->connector_id;
+	return connector->index;
 }
 
 extern __printf(5, 6)
-- 
2.8.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Ro.CI.BAT: failure for drm: drm_connector->s/connector_id/index/ for consistency
  2016-07-19 10:57 [PATCH] drm: drm_connector->s/connector_id/index/ for consistency Daniel Vetter
@ 2016-07-19 11:49 ` Patchwork
  2016-07-19 12:00 ` [PATCH] " Chris Wilson
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2016-07-19 11:49 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: drm: drm_connector->s/connector_id/index/ for consistency
URL   : https://patchwork.freedesktop.org/series/10029/
State : failure

== Summary ==

Series 10029v1 drm: drm_connector->s/connector_id/index/ for consistency
http://patchwork.freedesktop.org/api/1.0/series/10029/revisions/1/mbox

Test drv_module_reload_basic:
                pass       -> DMESG-WARN (ro-bdw-i7-5557U)
                pass       -> DMESG-WARN (ro-ilk1-i5-650)
                pass       -> DMESG-WARN (ro-hsw-i3-4010u)
                skip       -> DMESG-WARN (fi-skl-i5-6260u)
                pass       -> DMESG-WARN (ro-bdw-i7-5600u)
                pass       -> DMESG-WARN (ro-snb-i7-2620M)
                pass       -> DMESG-WARN (ro-bdw-i5-5250u)
                pass       -> DMESG-WARN (ro-hsw-i7-4770r)
                pass       -> DMESG-WARN (fi-hsw-i7-4770k)
                pass       -> DMESG-WARN (fi-snb-i7-2600)
                pass       -> DMESG-WARN (ro-ivb-i7-3770)
                pass       -> DMESG-WARN (ro-byt-n2820)
                pass       -> DMESG-WARN (fi-skl-i7-6700k)
Test gem_exec_suspend:
        Subgroup basic-s3:
                pass       -> DMESG-WARN (ro-bdw-i7-5600u)
                dmesg-warn -> PASS       (ro-bdw-i5-5250u)
Test gem_sync:
        Subgroup basic-store-each:
                pass       -> DMESG-FAIL (ro-bdw-i7-5600u)
Test kms_cursor_legacy:
        Subgroup basic-cursor-vs-flip:
                pass       -> SKIP       (ro-bdw-i7-5557U)
                pass       -> SKIP       (ro-ilk1-i5-650)
                pass       -> SKIP       (ro-skl3-i5-6260u)
                pass       -> SKIP       (ro-bdw-i5-5250u)
                pass       -> SKIP       (fi-hsw-i7-4770k)
                pass       -> SKIP       (fi-snb-i7-2600)
                pass       -> SKIP       (ro-byt-n2820)
        Subgroup basic-flip-vs-cursor:
                pass       -> SKIP       (ro-bdw-i7-5557U)
                pass       -> SKIP       (ro-ilk1-i5-650)
                pass       -> SKIP       (ro-skl3-i5-6260u)
                pass       -> SKIP       (ro-bdw-i5-5250u)
                pass       -> SKIP       (fi-hsw-i7-4770k)
                pass       -> SKIP       (fi-snb-i7-2600)
                pass       -> SKIP       (ro-byt-n2820)
Test kms_flip:
        Subgroup basic-flip-vs-dpms:
                pass       -> FAIL       (ro-bdw-i7-5557U)
                pass       -> FAIL       (ro-ilk1-i5-650)
                pass       -> FAIL       (ro-hsw-i3-4010u)
                pass       -> FAIL       (fi-skl-i5-6260u)
                pass       -> FAIL       (ro-bdw-i7-5600u)
                pass       -> FAIL       (ro-snb-i7-2620M)
                pass       -> FAIL       (ro-bdw-i5-5250u)
                pass       -> FAIL       (ro-hsw-i7-4770r)
                pass       -> FAIL       (fi-hsw-i7-4770k)
                pass       -> FAIL       (fi-snb-i7-2600)
                pass       -> FAIL       (ro-ivb-i7-3770)
                pass       -> FAIL       (ro-byt-n2820)
                pass       -> FAIL       (fi-skl-i7-6700k)
                pass       -> FAIL       (ro-skl3-i5-6260u)
        Subgroup basic-flip-vs-modeset:
                pass       -> FAIL       (ro-bdw-i7-5557U)
                pass       -> FAIL       (ro-ilk1-i5-650)
                pass       -> FAIL       (ro-hsw-i3-4010u)
                pass       -> FAIL       (fi-skl-i5-6260u)
                pass       -> FAIL       (ro-bdw-i7-5600u)
                pass       -> FAIL       (ro-snb-i7-2620M)
                pass       -> FAIL       (ro-bdw-i5-5250u)
                pass       -> FAIL       (ro-hsw-i7-4770r)
                pass       -> FAIL       (fi-hsw-i7-4770k)
                pass       -> FAIL       (fi-snb-i7-2600)
                pass       -> FAIL       (ro-ivb-i7-3770)
                pass       -> FAIL       (ro-byt-n2820)
                pass       -> FAIL       (fi-skl-i7-6700k)
                pass       -> FAIL       (ro-skl3-i5-6260u)
        Subgroup basic-flip-vs-wf_vblank:
                pass       -> FAIL       (ro-bdw-i7-5557U)
                pass       -> FAIL       (ro-ilk1-i5-650)
                pass       -> FAIL       (ro-hsw-i3-4010u)
                pass       -> FAIL       (fi-skl-i5-6260u)
                pass       -> FAIL       (ro-bdw-i7-5600u)
                pass       -> FAIL       (ro-snb-i7-2620M)
                pass       -> FAIL       (ro-bdw-i5-5250u)
                pass       -> FAIL       (ro-hsw-i7-4770r)
                pass       -> FAIL       (fi-hsw-i7-4770k)
                pass       -> FAIL       (fi-snb-i7-2600)
                pass       -> FAIL       (ro-ivb-i7-3770)
                pass       -> FAIL       (ro-byt-n2820)
                pass       -> FAIL       (fi-skl-i7-6700k)
                pass       -> FAIL       (ro-skl3-i5-6260u)
        Subgroup basic-plain-flip:
                pass       -> FAIL       (ro-bdw-i7-5557U)
                pass       -> FAIL       (ro-ilk1-i5-650)
                pass       -> FAIL       (ro-hsw-i3-4010u)
                pass       -> FAIL       (fi-skl-i5-6260u)
                pass       -> FAIL       (ro-bdw-i7-5600u)
                pass       -> FAIL       (ro-snb-i7-2620M)
                pass       -> FAIL       (ro-bdw-i5-5250u)
                pass       -> FAIL       (ro-hsw-i7-4770r)
                pass       -> FAIL       (fi-hsw-i7-4770k)
                pass       -> FAIL       (fi-snb-i7-2600)
                pass       -> FAIL       (ro-ivb-i7-3770)
                pass       -> FAIL       (ro-byt-n2820)
WARNING: Long output truncated

Results at /archive/results/CI_IGT_test/RO_Patchwork_1529/

d59b92b drm-intel-nightly: 2016y-07m-19d-09h-52m-15s UTC integration manifest
8e83bd9 drm: drm_connector->s/connector_id/index/ for consistency

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm: drm_connector->s/connector_id/index/ for consistency
  2016-07-19 10:57 [PATCH] drm: drm_connector->s/connector_id/index/ for consistency Daniel Vetter
  2016-07-19 11:49 ` ✗ Ro.CI.BAT: failure for " Patchwork
@ 2016-07-19 12:00 ` Chris Wilson
  2016-07-19 12:19 ` Daniel Vetter
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2016-07-19 12:00 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Tue, Jul 19, 2016 at 12:57:52PM +0200, Daniel Vetter wrote:
> connector_id in the uapi actually means drm_connector->base.id, which
> is something entirely different. And ->index is also consistent with
> plane/encoder/CRTCS and the various drm_*_index() functions.
> 
> While at it also improve/align the kerneldoc comment.
> 
> v2: Mention where those ids are from ...
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_crtc.c | 11 +++++------
>  include/drm/drm_crtc.h     | 13 ++++++++++---
>  2 files changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index c456628740dd..f9f2506b1855 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -934,11 +934,10 @@ int drm_connector_init(struct drm_device *dev,
>  	connector->dev = dev;
>  	connector->funcs = funcs;
>  
> -	connector->connector_id = ida_simple_get(&config->connector_ida, 0, 0, GFP_KERNEL);
> -	if (connector->connector_id < 0) {
> -		ret = connector->connector_id;
> +	ret = ida_simple_get(&config->connector_ida, 0, 0, GFP_KERNEL);
> +	if (ret < 0)
>  		goto out_put;
> -	}
> +	connector->index = ret;

Oh, that is glorious!

>  out_put_id:
>  	if (ret)
> -		ida_remove(&config->connector_ida, connector->connector_id);
> +		ida_remove(&config->connector_ida, connector->index);

ret == connector->index (it's only otherwise set on failure).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm: drm_connector->s/connector_id/index/ for consistency
  2016-07-19 10:57 [PATCH] drm: drm_connector->s/connector_id/index/ for consistency Daniel Vetter
  2016-07-19 11:49 ` ✗ Ro.CI.BAT: failure for " Patchwork
  2016-07-19 12:00 ` [PATCH] " Chris Wilson
@ 2016-07-19 12:19 ` Daniel Vetter
  2016-07-19 12:50 ` Daniel Vetter
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2016-07-19 12:19 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Daniel Vetter, Intel Graphics Development

On Tue, Jul 19, 2016 at 12:57:52PM +0200, Daniel Vetter wrote:
> connector_id in the uapi actually means drm_connector->base.id, which
> is something entirely different. And ->index is also consistent with
> plane/encoder/CRTCS and the various drm_*_index() functions.
> 
> While at it also improve/align the kerneldoc comment.
> 
> v2: Mention where those ids are from ...
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

fixed up the s/support/supporting/ that somehow escape git add and then
pushed to drm-misc.
-Daniel

> ---
>  drivers/gpu/drm/drm_crtc.c | 11 +++++------
>  include/drm/drm_crtc.h     | 13 ++++++++++---
>  2 files changed, 15 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index c456628740dd..f9f2506b1855 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -934,11 +934,10 @@ int drm_connector_init(struct drm_device *dev,
>  	connector->dev = dev;
>  	connector->funcs = funcs;
>  
> -	connector->connector_id = ida_simple_get(&config->connector_ida, 0, 0, GFP_KERNEL);
> -	if (connector->connector_id < 0) {
> -		ret = connector->connector_id;
> +	ret = ida_simple_get(&config->connector_ida, 0, 0, GFP_KERNEL);
> +	if (ret < 0)
>  		goto out_put;
> -	}
> +	connector->index = ret;
>  
>  	connector->connector_type = connector_type;
>  	connector->connector_type_id =
> @@ -986,7 +985,7 @@ out_put_type_id:
>  		ida_remove(connector_ida, connector->connector_type_id);
>  out_put_id:
>  	if (ret)
> -		ida_remove(&config->connector_ida, connector->connector_id);
> +		ida_remove(&config->connector_ida, connector->index);
>  out_put:
>  	if (ret)
>  		drm_mode_object_unregister(dev, &connector->base);
> @@ -1030,7 +1029,7 @@ void drm_connector_cleanup(struct drm_connector *connector)
>  		   connector->connector_type_id);
>  
>  	ida_remove(&dev->mode_config.connector_ida,
> -		   connector->connector_id);
> +		   connector->index);
>  
>  	kfree(connector->display_info.bus_formats);
>  	drm_mode_object_unregister(dev, &connector->base);
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index f8ba5aab5d28..4aa4c4341d01 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -1246,7 +1246,6 @@ struct drm_encoder {
>   * @head: list management
>   * @base: base KMS object
>   * @name: human readable name, can be overwritten by the driver
> - * @connector_id: compacted connector id useful indexing arrays
>   * @connector_type: one of the %DRM_MODE_CONNECTOR_<foo> types from drm_mode.h
>   * @connector_type_id: index into connector type enum
>   * @interlace_allowed: can this connector handle interlaced modes?
> @@ -1303,7 +1302,15 @@ struct drm_connector {
>  	struct drm_mode_object base;
>  
>  	char *name;
> -	int connector_id;
> +
> +	/**
> +	 * @index: Compacted connector index, which matches the position inside
> +	 * the mode_config.list for drivers not support hot-add/removing. Can be
> +	 * used as an array index. It is invariant over the lifetime of the
> +	 * connector.
> +	 */
> +	unsigned index;
> +
>  	int connector_type;
>  	int connector_type_id;
>  	bool interlace_allowed;
> @@ -2764,7 +2771,7 @@ void drm_connector_unregister(struct drm_connector *connector);
>  extern void drm_connector_cleanup(struct drm_connector *connector);
>  static inline unsigned drm_connector_index(struct drm_connector *connector)
>  {
> -	return connector->connector_id;
> +	return connector->index;
>  }
>  
>  extern __printf(5, 6)
> -- 
> 2.8.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH] drm: drm_connector->s/connector_id/index/ for consistency
  2016-07-19 10:57 [PATCH] drm: drm_connector->s/connector_id/index/ for consistency Daniel Vetter
                   ` (2 preceding siblings ...)
  2016-07-19 12:19 ` Daniel Vetter
@ 2016-07-19 12:50 ` Daniel Vetter
  2016-07-19 16:25 ` Daniel Vetter
  2016-07-19 16:52 ` ✓ Ro.CI.BAT: success for drm: drm_connector->s/connector_id/index/ for consistency (rev2) Patchwork
  5 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2016-07-19 12:50 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter, DRI Development

connector_id in the uapi actually means drm_connector->base.id, which
is something entirely different. And ->index is also consistent with
plane/encoder/CRTCS and the various drm_*_index() functions.

While at it also improve/align the kerneldoc comment.

v2: Mention where those ids are from ...

v3: Add -ing to supporting and try to not break the world.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_crtc.c | 12 ++++++------
 include/drm/drm_crtc.h     | 13 ++++++++++---
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index c456628740dd..da9bbe0fdb1e 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -934,11 +934,11 @@ int drm_connector_init(struct drm_device *dev,
 	connector->dev = dev;
 	connector->funcs = funcs;
 
-	connector->connector_id = ida_simple_get(&config->connector_ida, 0, 0, GFP_KERNEL);
-	if (connector->connector_id < 0) {
-		ret = connector->connector_id;
+	ret = ida_simple_get(&config->connector_ida, 0, 0, GFP_KERNEL);
+	if (ret < 0)
 		goto out_put;
-	}
+	connector->index = ret;
+	ret = 0;
 
 	connector->connector_type = connector_type;
 	connector->connector_type_id =
@@ -986,7 +986,7 @@ out_put_type_id:
 		ida_remove(connector_ida, connector->connector_type_id);
 out_put_id:
 	if (ret)
-		ida_remove(&config->connector_ida, connector->connector_id);
+		ida_remove(&config->connector_ida, connector->index);
 out_put:
 	if (ret)
 		drm_mode_object_unregister(dev, &connector->base);
@@ -1030,7 +1030,7 @@ void drm_connector_cleanup(struct drm_connector *connector)
 		   connector->connector_type_id);
 
 	ida_remove(&dev->mode_config.connector_ida,
-		   connector->connector_id);
+		   connector->index);
 
 	kfree(connector->display_info.bus_formats);
 	drm_mode_object_unregister(dev, &connector->base);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index f8ba5aab5d28..3edeaf88ebc0 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1246,7 +1246,6 @@ struct drm_encoder {
  * @head: list management
  * @base: base KMS object
  * @name: human readable name, can be overwritten by the driver
- * @connector_id: compacted connector id useful indexing arrays
  * @connector_type: one of the %DRM_MODE_CONNECTOR_<foo> types from drm_mode.h
  * @connector_type_id: index into connector type enum
  * @interlace_allowed: can this connector handle interlaced modes?
@@ -1303,7 +1302,15 @@ struct drm_connector {
 	struct drm_mode_object base;
 
 	char *name;
-	int connector_id;
+
+	/**
+	 * @index: Compacted connector index, which matches the position inside
+	 * the mode_config.list for drivers not supporting hot-add/removing. Can
+	 * be used as an array index. It is invariant over the lifetime of the
+	 * connector.
+	 */
+	unsigned index;
+
 	int connector_type;
 	int connector_type_id;
 	bool interlace_allowed;
@@ -2764,7 +2771,7 @@ void drm_connector_unregister(struct drm_connector *connector);
 extern void drm_connector_cleanup(struct drm_connector *connector);
 static inline unsigned drm_connector_index(struct drm_connector *connector)
 {
-	return connector->connector_id;
+	return connector->index;
 }
 
 extern __printf(5, 6)
-- 
2.8.1

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

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

* [PATCH] drm: drm_connector->s/connector_id/index/ for consistency
  2016-07-19 10:57 [PATCH] drm: drm_connector->s/connector_id/index/ for consistency Daniel Vetter
                   ` (3 preceding siblings ...)
  2016-07-19 12:50 ` Daniel Vetter
@ 2016-07-19 16:25 ` Daniel Vetter
  2016-07-20 12:37   ` Chris Wilson
  2016-07-19 16:52 ` ✓ Ro.CI.BAT: success for drm: drm_connector->s/connector_id/index/ for consistency (rev2) Patchwork
  5 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2016-07-19 16:25 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter, DRI Development

connector_id in the uapi actually means drm_connector->base.id, which
is something entirely different. And ->index is also consistent with
plane/encoder/CRTCS and the various drm_*_index() functions.

While at it also improve/align the kerneldoc comment.

v2: Mention where those ids are from ...

v3: Add -ing to supporting and try to not break the world.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_crtc.c | 12 ++++++------
 include/drm/drm_crtc.h     | 13 ++++++++++---
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index c456628740dd..da9bbe0fdb1e 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -934,11 +934,11 @@ int drm_connector_init(struct drm_device *dev,
 	connector->dev = dev;
 	connector->funcs = funcs;
 
-	connector->connector_id = ida_simple_get(&config->connector_ida, 0, 0, GFP_KERNEL);
-	if (connector->connector_id < 0) {
-		ret = connector->connector_id;
+	ret = ida_simple_get(&config->connector_ida, 0, 0, GFP_KERNEL);
+	if (ret < 0)
 		goto out_put;
-	}
+	connector->index = ret;
+	ret = 0;
 
 	connector->connector_type = connector_type;
 	connector->connector_type_id =
@@ -986,7 +986,7 @@ out_put_type_id:
 		ida_remove(connector_ida, connector->connector_type_id);
 out_put_id:
 	if (ret)
-		ida_remove(&config->connector_ida, connector->connector_id);
+		ida_remove(&config->connector_ida, connector->index);
 out_put:
 	if (ret)
 		drm_mode_object_unregister(dev, &connector->base);
@@ -1030,7 +1030,7 @@ void drm_connector_cleanup(struct drm_connector *connector)
 		   connector->connector_type_id);
 
 	ida_remove(&dev->mode_config.connector_ida,
-		   connector->connector_id);
+		   connector->index);
 
 	kfree(connector->display_info.bus_formats);
 	drm_mode_object_unregister(dev, &connector->base);
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index f8ba5aab5d28..3edeaf88ebc0 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1246,7 +1246,6 @@ struct drm_encoder {
  * @head: list management
  * @base: base KMS object
  * @name: human readable name, can be overwritten by the driver
- * @connector_id: compacted connector id useful indexing arrays
  * @connector_type: one of the %DRM_MODE_CONNECTOR_<foo> types from drm_mode.h
  * @connector_type_id: index into connector type enum
  * @interlace_allowed: can this connector handle interlaced modes?
@@ -1303,7 +1302,15 @@ struct drm_connector {
 	struct drm_mode_object base;
 
 	char *name;
-	int connector_id;
+
+	/**
+	 * @index: Compacted connector index, which matches the position inside
+	 * the mode_config.list for drivers not supporting hot-add/removing. Can
+	 * be used as an array index. It is invariant over the lifetime of the
+	 * connector.
+	 */
+	unsigned index;
+
 	int connector_type;
 	int connector_type_id;
 	bool interlace_allowed;
@@ -2764,7 +2771,7 @@ void drm_connector_unregister(struct drm_connector *connector);
 extern void drm_connector_cleanup(struct drm_connector *connector);
 static inline unsigned drm_connector_index(struct drm_connector *connector)
 {
-	return connector->connector_id;
+	return connector->index;
 }
 
 extern __printf(5, 6)
-- 
2.8.1

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

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

* ✓ Ro.CI.BAT: success for drm: drm_connector->s/connector_id/index/ for consistency (rev2)
  2016-07-19 10:57 [PATCH] drm: drm_connector->s/connector_id/index/ for consistency Daniel Vetter
                   ` (4 preceding siblings ...)
  2016-07-19 16:25 ` Daniel Vetter
@ 2016-07-19 16:52 ` Patchwork
  5 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2016-07-19 16:52 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: drm: drm_connector->s/connector_id/index/ for consistency (rev2)
URL   : https://patchwork.freedesktop.org/series/10029/
State : success

== Summary ==

Series 10029v2 drm: drm_connector->s/connector_id/index/ for consistency
http://patchwork.freedesktop.org/api/1.0/series/10029/revisions/2/mbox

Test gem_sync:
        Subgroup basic-store-each:
                fail       -> DMESG-FAIL (ro-bdw-i7-5600u)

fi-hsw-i7-4770k  total:243  pass:213  dwarn:0   dfail:0   fail:10  skip:20 
fi-kbl-qkkr      total:243  pass:177  dwarn:27  dfail:2   fail:9   skip:28 
fi-skl-i5-6260u  total:243  pass:222  dwarn:0   dfail:0   fail:9   skip:12 
fi-skl-i7-6700k  total:243  pass:208  dwarn:0   dfail:0   fail:9   skip:26 
fi-snb-i7-2600   total:243  pass:193  dwarn:0   dfail:0   fail:10  skip:40 
ro-bdw-i5-5250u  total:244  pass:217  dwarn:4   dfail:0   fail:10  skip:13 
ro-bdw-i7-5557U  total:244  pass:218  dwarn:2   dfail:0   fail:10  skip:14 
ro-bdw-i7-5600u  total:244  pass:201  dwarn:0   dfail:1   fail:10  skip:32 
ro-bsw-n3050     total:218  pass:173  dwarn:0   dfail:0   fail:2   skip:42 
ro-byt-n2820     total:244  pass:194  dwarn:0   dfail:0   fail:12  skip:38 
ro-hsw-i3-4010u  total:244  pass:209  dwarn:0   dfail:0   fail:11  skip:24 
ro-hsw-i7-4770r  total:244  pass:209  dwarn:0   dfail:0   fail:11  skip:24 
ro-ilk-i7-620lm  total:244  pass:169  dwarn:0   dfail:0   fail:12  skip:63 
ro-ilk1-i5-650   total:239  pass:170  dwarn:0   dfail:0   fail:11  skip:58 
ro-ivb-i7-3770   total:244  pass:200  dwarn:0   dfail:0   fail:11  skip:33 
ro-snb-i7-2620M  total:244  pass:190  dwarn:0   dfail:0   fail:12  skip:42 
ro-skl3-i5-6260u failed to connect after reboot

Results at /archive/results/CI_IGT_test/RO_Patchwork_1534/

635555a drm-intel-nightly: 2016y-07m-19d-13h-02m-39s UTC integration manifest
0b87802 drm: drm_connector->s/connector_id/index/ for consistency

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm: drm_connector->s/connector_id/index/ for consistency
  2016-07-19 16:25 ` Daniel Vetter
@ 2016-07-20 12:37   ` Chris Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2016-07-20 12:37 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, DRI Development

On Tue, Jul 19, 2016 at 06:25:01PM +0200, Daniel Vetter wrote:
> connector_id in the uapi actually means drm_connector->base.id, which
> is something entirely different. And ->index is also consistent with
> plane/encoder/CRTCS and the various drm_*_index() functions.
> 
> While at it also improve/align the kerneldoc comment.
> 
> v2: Mention where those ids are from ...
> 
> v3: Add -ing to supporting and try to not break the world.
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

No longer breaks...
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-07-20 12:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-19 10:57 [PATCH] drm: drm_connector->s/connector_id/index/ for consistency Daniel Vetter
2016-07-19 11:49 ` ✗ Ro.CI.BAT: failure for " Patchwork
2016-07-19 12:00 ` [PATCH] " Chris Wilson
2016-07-19 12:19 ` Daniel Vetter
2016-07-19 12:50 ` Daniel Vetter
2016-07-19 16:25 ` Daniel Vetter
2016-07-20 12:37   ` Chris Wilson
2016-07-19 16:52 ` ✓ Ro.CI.BAT: success for drm: drm_connector->s/connector_id/index/ for consistency (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.