diff mbox series

[v4,2/7] drm: always determine branch device with drm_dp_is_branch()

Message ID 20190829114854.1539-2-oleg.vasilev@intel.com (mailing list archive)
State New, archived
Headers show
Series [v4,1/7] drm: move DP_MAX_DOWNSTREAM_PORTS from i915 to drm core | expand

Commit Message

Oleg Vasilev Aug. 29, 2019, 11:48 a.m. UTC
The helper should always be used.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
---
 drivers/gpu/drm/drm_dp_helper.c         | 3 +--
 drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

Comments

Jani Nikula Jan. 10, 2020, 1:42 p.m. UTC | #1
On Thu, 29 Aug 2019, Oleg Vasilev <oleg.vasilev@intel.com> wrote:
> The helper should always be used.
>
> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
> Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: intel-gfx@lists.freedesktop.org

Pushed patches 1-2 to drm-misc-next, thanks for the patches and review.

BR,
Jani.


> ---
>  drivers/gpu/drm/drm_dp_helper.c         | 3 +--
>  drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> index ffc68d305afe..14320930091b 100644
> --- a/drivers/gpu/drm/drm_dp_helper.c
> +++ b/drivers/gpu/drm/drm_dp_helper.c
> @@ -573,8 +573,7 @@ void drm_dp_downstream_debug(struct seq_file *m,
>  	int len;
>  	uint8_t rev[2];
>  	int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
> -	bool branch_device = dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> -			     DP_DWN_STRM_PORT_PRESENT;
> +	bool branch_device = drm_dp_is_branch(dpcd);
>  
>  	seq_printf(m, "\tDP branch device present: %s\n",
>  		   branch_device ? "yes" : "no");
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 23908da1cd5d..6da6a4859f06 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -2922,7 +2922,7 @@ static bool downstream_hpd_needs_d0(struct intel_dp *intel_dp)
>  	 * FIXME should really check all downstream ports...
>  	 */
>  	return intel_dp->dpcd[DP_DPCD_REV] == 0x11 &&
> -		intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT &&
> +		drm_dp_is_branch(intel_dp->dpcd) &&
>  		intel_dp->downstream_ports[0] & DP_DS_PORT_HPD;
>  }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
index ffc68d305afe..14320930091b 100644
--- a/drivers/gpu/drm/drm_dp_helper.c
+++ b/drivers/gpu/drm/drm_dp_helper.c
@@ -573,8 +573,7 @@  void drm_dp_downstream_debug(struct seq_file *m,
 	int len;
 	uint8_t rev[2];
 	int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
-	bool branch_device = dpcd[DP_DOWNSTREAMPORT_PRESENT] &
-			     DP_DWN_STRM_PORT_PRESENT;
+	bool branch_device = drm_dp_is_branch(dpcd);
 
 	seq_printf(m, "\tDP branch device present: %s\n",
 		   branch_device ? "yes" : "no");
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 23908da1cd5d..6da6a4859f06 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2922,7 +2922,7 @@  static bool downstream_hpd_needs_d0(struct intel_dp *intel_dp)
 	 * FIXME should really check all downstream ports...
 	 */
 	return intel_dp->dpcd[DP_DPCD_REV] == 0x11 &&
-		intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT &&
+		drm_dp_is_branch(intel_dp->dpcd) &&
 		intel_dp->downstream_ports[0] & DP_DS_PORT_HPD;
 }