All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] A Helper function that returns available link bandwidth
@ 2016-08-11 23:41 Anusha Srivatsa
  2016-08-11 23:41 ` [PATCH 2/2] Validate modes against " Anusha Srivatsa
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Anusha Srivatsa @ 2016-08-11 23:41 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel

drm/dp/mst

Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>

Add a function that returns the available link bandwidth for
MST port so that we can accurately determine whether a new
mode is valid for the link or not.

Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 12 ++++++++++++
 include/drm/drm_dp_mst_helper.h       |  1 +
 2 files changed, 13 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 04e4571..7a239f6 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -43,6 +43,8 @@ static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr,
 				  char *buf);
 static int test_calc_pbn_mode(void);
 
+int drm_dp_mst_get_avail_pbn(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
+
 static void drm_dp_put_port(struct drm_dp_mst_port *port);
 
 static int drm_dp_dpcd_write_payload(struct drm_dp_mst_topology_mgr *mgr,
@@ -2730,6 +2732,16 @@ static int test_calc_pbn_mode(void)
 	return 0;
 }
 
+int drm_dp_mst_get_avail_pbn(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port)
+{
+        port = drm_dp_get_validated_port_ref(mgr,port);
+        if (port)
+                return port->available_pbn;
+
+        return -EINVAL;
+}
+EXPORT_SYMBOL(drm_dp_mst_get_avail_pbn);
+
 /* we want to kick the TX after we've ack the up/down IRQs. */
 static void drm_dp_mst_kick_tx(struct drm_dp_mst_topology_mgr *mgr)
 {
diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h
index 0032076..74dc4ab 100644
--- a/include/drm/drm_dp_mst_helper.h
+++ b/include/drm/drm_dp_mst_helper.h
@@ -576,6 +576,7 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_
 
 int drm_dp_calc_pbn_mode(int clock, int bpp);
 
+int drm_dp_mst_get_avail_pbn(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
 
 bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int pbn, int *slots);
 
-- 
2.7.4

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

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

* [PATCH 2/2] Validate modes against available link bandwidth
  2016-08-11 23:41 [PATCH 1/2] A Helper function that returns available link bandwidth Anusha Srivatsa
@ 2016-08-11 23:41 ` Anusha Srivatsa
  2016-08-12  3:29   ` Pandiyan, Dhinakaran
  2016-08-12  3:26 ` [PATCH 1/2] A Helper function that returns " Pandiyan, Dhinakaran
  2016-08-12  6:07 ` ✗ Ro.CI.BAT: failure for series starting with [1/2] " Patchwork
  2 siblings, 1 reply; 5+ messages in thread
From: Anusha Srivatsa @ 2016-08-11 23:41 UTC (permalink / raw)
  To: intel-gfx

drm/dp/mst/i915

Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>

Validate the modes against available link bandwidth rather than
maximum link bandwidth so that we have a better idea as to whether
a proposed mode can truly run beside existing stream.
---
 drivers/gpu/drm/i915/intel_dp_mst.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 629337d..e7e87d7 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -352,13 +352,23 @@ static enum drm_mode_status
 intel_dp_mst_mode_valid(struct drm_connector *connector,
 			struct drm_display_mode *mode)
 {
+	int req_pbn = 0;
+	int avail_pbn = 0;
+	struct intel_connector *intel_connector = to_intel_connector(connector);
+	struct intel_dp *intel_dp = intel_connector->mst_port;
+	struct drm_dp_mst_topology_mgr *mgr = &intel_dp->mst_mgr;
+	struct drm_dp_mst_port *port = (struct drm_dp_mst_port *) (intel_connector->port);
 	int max_dotclk = to_i915(connector->dev)->max_dotclk_freq;
 
-	/* TODO - validate mode against available PBN for link */
+	avail_pbn = drm_dp_mst_get_avail_pbn(mgr, port);
+	req_pbn = drm_dp_calc_pbn_mode(mode->clock, 24);
+	if (req_pbn > avail_pbn)
+		return MODE_H_ILLEGAL;
+
 	if (mode->clock < 10000)
 		return MODE_CLOCK_LOW;
 
-	if (mode->flags & DRM_MODE_FLAG_DBLCLK)
+        if (mode->flags & DRM_MODE_FLAG_DBLCLK)
 		return MODE_H_ILLEGAL;
 
 	if (mode->clock > max_dotclk)
-- 
2.7.4

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

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

* Re: [PATCH 1/2] A Helper function that returns available link bandwidth
  2016-08-11 23:41 [PATCH 1/2] A Helper function that returns available link bandwidth Anusha Srivatsa
  2016-08-11 23:41 ` [PATCH 2/2] Validate modes against " Anusha Srivatsa
@ 2016-08-12  3:26 ` Pandiyan, Dhinakaran
  2016-08-12  6:07 ` ✗ Ro.CI.BAT: failure for series starting with [1/2] " Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Pandiyan, Dhinakaran @ 2016-08-12  3:26 UTC (permalink / raw)
  To: Srivatsa, Anusha; +Cc: intel-gfx, dri-devel

On Thu, 2016-08-11 at 16:41 -0700, Anusha Srivatsa wrote:
> drm/dp/mst
> 
> Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
> 
> Add a function that returns the available link bandwidth for
> MST port so that we can accurately determine whether a new
> mode is valid for the link or not.
> 

The Signed-off line should follow the explanation body.

> Cc: dri-devel@lists.freedesktop.org
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 12 ++++++++++++
>  include/drm/drm_dp_mst_helper.h       |  1 +
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 04e4571..7a239f6 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -43,6 +43,8 @@ static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr,
>  				  char *buf);
>  static int test_calc_pbn_mode(void);
>  
> +int drm_dp_mst_get_avail_pbn(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
> +
>  static void drm_dp_put_port(struct drm_dp_mst_port *port);
>  
>  static int drm_dp_dpcd_write_payload(struct drm_dp_mst_topology_mgr *mgr,
> @@ -2730,6 +2732,16 @@ static int test_calc_pbn_mode(void)
>  	return 0;
>  }
>  
> +int drm_dp_mst_get_avail_pbn(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port)
> +{
> +        port = drm_dp_get_validated_port_ref(mgr,port);
> +        if (port)
> +                return port->available_pbn;
> +
> +        return -EINVAL;
> +}
> +EXPORT_SYMBOL(drm_dp_mst_get_avail_pbn);
> +
>  /* we want to kick the TX after we've ack the up/down IRQs. */
>  static void drm_dp_mst_kick_tx(struct drm_dp_mst_topology_mgr *mgr)
>  {
> diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h
> index 0032076..74dc4ab 100644
> --- a/include/drm/drm_dp_mst_helper.h
> +++ b/include/drm/drm_dp_mst_helper.h
> @@ -576,6 +576,7 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_
>  
>  int drm_dp_calc_pbn_mode(int clock, int bpp);
>  
> +int drm_dp_mst_get_avail_pbn(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port);
>  
>  bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, int pbn, int *slots);
>  

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

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

* Re: [PATCH 2/2] Validate modes against available link bandwidth
  2016-08-11 23:41 ` [PATCH 2/2] Validate modes against " Anusha Srivatsa
@ 2016-08-12  3:29   ` Pandiyan, Dhinakaran
  0 siblings, 0 replies; 5+ messages in thread
From: Pandiyan, Dhinakaran @ 2016-08-12  3:29 UTC (permalink / raw)
  To: Srivatsa, Anusha; +Cc: intel-gfx

On Thu, 2016-08-11 at 16:41 -0700, Anusha Srivatsa wrote:
> drm/dp/mst/i915
> 
> Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com>
> 
> Validate the modes against available link bandwidth rather than
> maximum link bandwidth so that we have a better idea as to whether
> a proposed mode can truly run beside existing stream.

The Signed-off line follows the explanation body.
https://www.kernel.org/doc/Documentation/SubmittingPatches

> ---
>  drivers/gpu/drm/i915/intel_dp_mst.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> index 629337d..e7e87d7 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -352,13 +352,23 @@ static enum drm_mode_status
>  intel_dp_mst_mode_valid(struct drm_connector *connector,
>  			struct drm_display_mode *mode)
>  {
> +	int req_pbn = 0;
> +	int avail_pbn = 0;
> +	struct intel_connector *intel_connector = to_intel_connector(connector);
> +	struct intel_dp *intel_dp = intel_connector->mst_port;
> +	struct drm_dp_mst_topology_mgr *mgr = &intel_dp->mst_mgr;
> +	struct drm_dp_mst_port *port = (struct drm_dp_mst_port *) (intel_connector->port);
>  	int max_dotclk = to_i915(connector->dev)->max_dotclk_freq;
>  
> -	/* TODO - validate mode against available PBN for link */
> +	avail_pbn = drm_dp_mst_get_avail_pbn(mgr, port);
> +	req_pbn = drm_dp_calc_pbn_mode(mode->clock, 24);
> +	if (req_pbn > avail_pbn)
> +		return MODE_H_ILLEGAL;
> +
>  	if (mode->clock < 10000)
>  		return MODE_CLOCK_LOW;
>  
> -	if (mode->flags & DRM_MODE_FLAG_DBLCLK)
> +        if (mode->flags & DRM_MODE_FLAG_DBLCLK)
>  		return MODE_H_ILLEGAL;
>  
>  	if (mode->clock > max_dotclk)

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

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

* ✗ Ro.CI.BAT: failure for series starting with [1/2] A Helper function that returns available link bandwidth
  2016-08-11 23:41 [PATCH 1/2] A Helper function that returns available link bandwidth Anusha Srivatsa
  2016-08-11 23:41 ` [PATCH 2/2] Validate modes against " Anusha Srivatsa
  2016-08-12  3:26 ` [PATCH 1/2] A Helper function that returns " Pandiyan, Dhinakaran
@ 2016-08-12  6:07 ` Patchwork
  2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2016-08-12  6:07 UTC (permalink / raw)
  To: Anusha Srivatsa; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] A Helper function that returns available link bandwidth
URL   : https://patchwork.freedesktop.org/series/10997/
State : failure

== Summary ==

Series 10997v1 Series without cover letter
http://patchwork.freedesktop.org/api/1.0/series/10997/revisions/1/mbox

Test drv_module_reload_basic:
                pass       -> SKIP       (fi-skl-i5-6260u)
Test gem_exec_suspend:
        Subgroup basic-s3:
                dmesg-warn -> PASS       (ro-bdw-i7-5600u)
Test kms_cursor_legacy:
        Subgroup basic-cursor-vs-flip-varying-size:
                pass       -> FAIL       (ro-ilk1-i5-650)
        Subgroup basic-flip-vs-cursor-varying-size:
                fail       -> PASS       (ro-bdw-i5-5250u)
Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-b-frame-sequence:
                fail       -> PASS       (ro-ivb2-i7-3770)
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> SKIP       (ro-bdw-i5-5250u)

fi-hsw-i7-4770k  total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-kbl-qkkr      total:244  pass:186  dwarn:28  dfail:0   fail:3   skip:27 
fi-skl-i5-6260u  total:244  pass:223  dwarn:4   dfail:0   fail:2   skip:15 
fi-skl-i7-6700k  total:244  pass:208  dwarn:4   dfail:2   fail:2   skip:28 
fi-snb-i7-2600   total:244  pass:202  dwarn:0   dfail:0   fail:0   skip:42 
ro-bdw-i5-5250u  total:240  pass:219  dwarn:1   dfail:0   fail:1   skip:19 
ro-bdw-i7-5600u  total:240  pass:207  dwarn:0   dfail:0   fail:1   skip:32 
ro-bsw-n3050     total:240  pass:194  dwarn:0   dfail:0   fail:4   skip:42 
ro-byt-n2820     total:240  pass:197  dwarn:0   dfail:0   fail:3   skip:40 
ro-hsw-i3-4010u  total:240  pass:214  dwarn:0   dfail:0   fail:0   skip:26 
ro-hsw-i7-4770r  total:240  pass:185  dwarn:0   dfail:0   fail:0   skip:55 
ro-ilk1-i5-650   total:235  pass:173  dwarn:0   dfail:0   fail:2   skip:60 
ro-ivb-i7-3770   total:240  pass:205  dwarn:0   dfail:0   fail:0   skip:35 
ro-ivb2-i7-3770  total:240  pass:209  dwarn:0   dfail:0   fail:0   skip:31 
ro-skl3-i5-6260u total:240  pass:222  dwarn:0   dfail:0   fail:4   skip:14 

Results at /archive/results/CI_IGT_test/RO_Patchwork_1844/

4a26251 drm-intel-nightly: 2016y-08m-11d-16h-12m-42s UTC integration manifest
ef872f8 Validate modes against available link bandwidth
c7015d7 A Helper function that returns available link bandwidth

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

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-11 23:41 [PATCH 1/2] A Helper function that returns available link bandwidth Anusha Srivatsa
2016-08-11 23:41 ` [PATCH 2/2] Validate modes against " Anusha Srivatsa
2016-08-12  3:29   ` Pandiyan, Dhinakaran
2016-08-12  3:26 ` [PATCH 1/2] A Helper function that returns " Pandiyan, Dhinakaran
2016-08-12  6:07 ` ✗ Ro.CI.BAT: failure for series starting with [1/2] " 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.