* [PATCH v2 1/8] drm/dp: Factor out helper to distinguish between branch and sink devices
[not found] <1477326811-30431-1-git-send-email-imre.deak@intel.com>
@ 2016-10-24 16:33 ` Imre Deak
2016-10-24 17:10 ` Jani Nikula
0 siblings, 1 reply; 5+ messages in thread
From: Imre Deak @ 2016-10-24 16:33 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, dri-devel
This check is open-coded in a few places, so it makes sense to simplify
things by having a helper for it similar to the rest of DPCD feature
helpers.
v2: (Jani)
- Move the helper to drm_dp_helper.h.
- Split out this change to a separate patch.
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/intel_dp.c | 11 ++++-------
include/drm/drm_dp_helper.h | 6 ++++++
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index f30db8f..3c2293b 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1459,8 +1459,7 @@ static void intel_dp_print_hw_revision(struct intel_dp *intel_dp)
if ((drm_debug & DRM_UT_KMS) == 0)
return;
- if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
- DP_DWN_STRM_PORT_PRESENT))
+ if (!drm_dp_is_branch(intel_dp->dpcd))
return;
len = drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_HW_REV, &rev, 1);
@@ -1478,8 +1477,7 @@ static void intel_dp_print_sw_revision(struct intel_dp *intel_dp)
if ((drm_debug & DRM_UT_KMS) == 0)
return;
- if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
- DP_DWN_STRM_PORT_PRESENT))
+ if (!drm_dp_is_branch(intel_dp->dpcd))
return;
len = drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_SW_REV, &rev, 2);
@@ -3615,8 +3613,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
if (!is_edp(intel_dp) && !intel_dp->sink_count)
return false;
- if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
- DP_DWN_STRM_PORT_PRESENT))
+ if (!drm_dp_is_branch(intel_dp->dpcd))
return true; /* native DP sink */
if (intel_dp->dpcd[DP_DPCD_REV] == 0x10)
@@ -4134,7 +4131,7 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
return connector_status_connected;
/* if there's no downstream port, we're done */
- if (!(dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT))
+ if (!drm_dp_is_branch(dpcd))
return connector_status_connected;
/* If we're HPD-aware, SINK_COUNT changes dynamically */
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 2a79882..55bbeb0 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -690,6 +690,12 @@ drm_dp_tps3_supported(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
dpcd[DP_MAX_LANE_COUNT] & DP_TPS3_SUPPORTED;
}
+static inline bool
+drm_dp_is_branch(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
+{
+ return dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT;
+}
+
/*
* DisplayPort AUX channel
*/
--
2.5.0
_______________________________________________
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 v2 1/8] drm/dp: Factor out helper to distinguish between branch and sink devices
2016-10-24 16:33 ` [PATCH v2 1/8] drm/dp: Factor out helper to distinguish between branch and sink devices Imre Deak
@ 2016-10-24 17:10 ` Jani Nikula
2016-10-25 6:54 ` [Intel-gfx] " Daniel Vetter
0 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2016-10-24 17:10 UTC (permalink / raw)
To: Imre Deak, intel-gfx; +Cc: dri-devel
On Mon, 24 Oct 2016, Imre Deak <imre.deak@intel.com> wrote:
> This check is open-coded in a few places, so it makes sense to simplify
> things by having a helper for it similar to the rest of DPCD feature
> helpers.
>
> v2: (Jani)
> - Move the helper to drm_dp_helper.h.
> - Split out this change to a separate patch.
>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Imre Deak <imre.deak@intel.com>
DP 1.4 has changed the name of "branch" devices, but I think this is
good.
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/intel_dp.c | 11 ++++-------
> include/drm/drm_dp_helper.h | 6 ++++++
> 2 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index f30db8f..3c2293b 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -1459,8 +1459,7 @@ static void intel_dp_print_hw_revision(struct intel_dp *intel_dp)
> if ((drm_debug & DRM_UT_KMS) == 0)
> return;
>
> - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> - DP_DWN_STRM_PORT_PRESENT))
> + if (!drm_dp_is_branch(intel_dp->dpcd))
> return;
>
> len = drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_HW_REV, &rev, 1);
> @@ -1478,8 +1477,7 @@ static void intel_dp_print_sw_revision(struct intel_dp *intel_dp)
> if ((drm_debug & DRM_UT_KMS) == 0)
> return;
>
> - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> - DP_DWN_STRM_PORT_PRESENT))
> + if (!drm_dp_is_branch(intel_dp->dpcd))
> return;
>
> len = drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_SW_REV, &rev, 2);
> @@ -3615,8 +3613,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
> if (!is_edp(intel_dp) && !intel_dp->sink_count)
> return false;
>
> - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> - DP_DWN_STRM_PORT_PRESENT))
> + if (!drm_dp_is_branch(intel_dp->dpcd))
> return true; /* native DP sink */
>
> if (intel_dp->dpcd[DP_DPCD_REV] == 0x10)
> @@ -4134,7 +4131,7 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
> return connector_status_connected;
>
> /* if there's no downstream port, we're done */
> - if (!(dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT))
> + if (!drm_dp_is_branch(dpcd))
> return connector_status_connected;
>
> /* If we're HPD-aware, SINK_COUNT changes dynamically */
> diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> index 2a79882..55bbeb0 100644
> --- a/include/drm/drm_dp_helper.h
> +++ b/include/drm/drm_dp_helper.h
> @@ -690,6 +690,12 @@ drm_dp_tps3_supported(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
> dpcd[DP_MAX_LANE_COUNT] & DP_TPS3_SUPPORTED;
> }
>
> +static inline bool
> +drm_dp_is_branch(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
> +{
> + return dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT;
> +}
> +
> /*
> * DisplayPort AUX channel
> */
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
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: [Intel-gfx] [PATCH v2 1/8] drm/dp: Factor out helper to distinguish between branch and sink devices
2016-10-24 17:10 ` Jani Nikula
@ 2016-10-25 6:54 ` Daniel Vetter
2016-10-25 7:46 ` Jani Nikula
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Vetter @ 2016-10-25 6:54 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx, dri-devel
On Mon, Oct 24, 2016 at 08:10:46PM +0300, Jani Nikula wrote:
> On Mon, 24 Oct 2016, Imre Deak <imre.deak@intel.com> wrote:
> > This check is open-coded in a few places, so it makes sense to simplify
> > things by having a helper for it similar to the rest of DPCD feature
> > helpers.
> >
> > v2: (Jani)
> > - Move the helper to drm_dp_helper.h.
> > - Split out this change to a separate patch.
> >
> > Cc: Jani Nikula <jani.nikula@intel.com>
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
>
> DP 1.4 has changed the name of "branch" devices, but I think this is
> good.
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Applied to drm-misc, thanks.
-Daniel
>
>
> > ---
> > drivers/gpu/drm/i915/intel_dp.c | 11 ++++-------
> > include/drm/drm_dp_helper.h | 6 ++++++
> > 2 files changed, 10 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> > index f30db8f..3c2293b 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -1459,8 +1459,7 @@ static void intel_dp_print_hw_revision(struct intel_dp *intel_dp)
> > if ((drm_debug & DRM_UT_KMS) == 0)
> > return;
> >
> > - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> > - DP_DWN_STRM_PORT_PRESENT))
> > + if (!drm_dp_is_branch(intel_dp->dpcd))
> > return;
> >
> > len = drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_HW_REV, &rev, 1);
> > @@ -1478,8 +1477,7 @@ static void intel_dp_print_sw_revision(struct intel_dp *intel_dp)
> > if ((drm_debug & DRM_UT_KMS) == 0)
> > return;
> >
> > - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> > - DP_DWN_STRM_PORT_PRESENT))
> > + if (!drm_dp_is_branch(intel_dp->dpcd))
> > return;
> >
> > len = drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_SW_REV, &rev, 2);
> > @@ -3615,8 +3613,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
> > if (!is_edp(intel_dp) && !intel_dp->sink_count)
> > return false;
> >
> > - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> > - DP_DWN_STRM_PORT_PRESENT))
> > + if (!drm_dp_is_branch(intel_dp->dpcd))
> > return true; /* native DP sink */
> >
> > if (intel_dp->dpcd[DP_DPCD_REV] == 0x10)
> > @@ -4134,7 +4131,7 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
> > return connector_status_connected;
> >
> > /* if there's no downstream port, we're done */
> > - if (!(dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT))
> > + if (!drm_dp_is_branch(dpcd))
> > return connector_status_connected;
> >
> > /* If we're HPD-aware, SINK_COUNT changes dynamically */
> > diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> > index 2a79882..55bbeb0 100644
> > --- a/include/drm/drm_dp_helper.h
> > +++ b/include/drm/drm_dp_helper.h
> > @@ -690,6 +690,12 @@ drm_dp_tps3_supported(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
> > dpcd[DP_MAX_LANE_COUNT] & DP_TPS3_SUPPORTED;
> > }
> >
> > +static inline bool
> > +drm_dp_is_branch(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
> > +{
> > + return dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT;
> > +}
> > +
> > /*
> > * DisplayPort AUX channel
> > */
>
> --
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Intel-gfx] [PATCH v2 1/8] drm/dp: Factor out helper to distinguish between branch and sink devices
2016-10-25 6:54 ` [Intel-gfx] " Daniel Vetter
@ 2016-10-25 7:46 ` Jani Nikula
2016-10-25 8:12 ` Daniel Vetter
0 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2016-10-25 7:46 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx, dri-devel
On Tue, 25 Oct 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Mon, Oct 24, 2016 at 08:10:46PM +0300, Jani Nikula wrote:
>> On Mon, 24 Oct 2016, Imre Deak <imre.deak@intel.com> wrote:
>> > This check is open-coded in a few places, so it makes sense to simplify
>> > things by having a helper for it similar to the rest of DPCD feature
>> > helpers.
>> >
>> > v2: (Jani)
>> > - Move the helper to drm_dp_helper.h.
>> > - Split out this change to a separate patch.
>> >
>> > Cc: Jani Nikula <jani.nikula@intel.com>
>> > Cc: dri-devel@lists.freedesktop.org
>> > Signed-off-by: Imre Deak <imre.deak@intel.com>
>>
>> DP 1.4 has changed the name of "branch" devices, but I think this is
>> good.
>>
>> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
>
> Applied to drm-misc, thanks.
Thanks, but... that actually makes this series harder to land. We can't
move forward with the i915 changes before a backmerge to dinq with this
helper included.
BR,
Jani.
> -Daniel
>>
>>
>> > ---
>> > drivers/gpu/drm/i915/intel_dp.c | 11 ++++-------
>> > include/drm/drm_dp_helper.h | 6 ++++++
>> > 2 files changed, 10 insertions(+), 7 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
>> > index f30db8f..3c2293b 100644
>> > --- a/drivers/gpu/drm/i915/intel_dp.c
>> > +++ b/drivers/gpu/drm/i915/intel_dp.c
>> > @@ -1459,8 +1459,7 @@ static void intel_dp_print_hw_revision(struct intel_dp *intel_dp)
>> > if ((drm_debug & DRM_UT_KMS) == 0)
>> > return;
>> >
>> > - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
>> > - DP_DWN_STRM_PORT_PRESENT))
>> > + if (!drm_dp_is_branch(intel_dp->dpcd))
>> > return;
>> >
>> > len = drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_HW_REV, &rev, 1);
>> > @@ -1478,8 +1477,7 @@ static void intel_dp_print_sw_revision(struct intel_dp *intel_dp)
>> > if ((drm_debug & DRM_UT_KMS) == 0)
>> > return;
>> >
>> > - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
>> > - DP_DWN_STRM_PORT_PRESENT))
>> > + if (!drm_dp_is_branch(intel_dp->dpcd))
>> > return;
>> >
>> > len = drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_SW_REV, &rev, 2);
>> > @@ -3615,8 +3613,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
>> > if (!is_edp(intel_dp) && !intel_dp->sink_count)
>> > return false;
>> >
>> > - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
>> > - DP_DWN_STRM_PORT_PRESENT))
>> > + if (!drm_dp_is_branch(intel_dp->dpcd))
>> > return true; /* native DP sink */
>> >
>> > if (intel_dp->dpcd[DP_DPCD_REV] == 0x10)
>> > @@ -4134,7 +4131,7 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
>> > return connector_status_connected;
>> >
>> > /* if there's no downstream port, we're done */
>> > - if (!(dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT))
>> > + if (!drm_dp_is_branch(dpcd))
>> > return connector_status_connected;
>> >
>> > /* If we're HPD-aware, SINK_COUNT changes dynamically */
>> > diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
>> > index 2a79882..55bbeb0 100644
>> > --- a/include/drm/drm_dp_helper.h
>> > +++ b/include/drm/drm_dp_helper.h
>> > @@ -690,6 +690,12 @@ drm_dp_tps3_supported(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
>> > dpcd[DP_MAX_LANE_COUNT] & DP_TPS3_SUPPORTED;
>> > }
>> >
>> > +static inline bool
>> > +drm_dp_is_branch(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
>> > +{
>> > + return dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT;
>> > +}
>> > +
>> > /*
>> > * DisplayPort AUX channel
>> > */
>>
>> --
>> Jani Nikula, Intel Open Source Technology Center
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/8] drm/dp: Factor out helper to distinguish between branch and sink devices
2016-10-25 7:46 ` Jani Nikula
@ 2016-10-25 8:12 ` Daniel Vetter
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2016-10-25 8:12 UTC (permalink / raw)
To: Jani Nikula; +Cc: dri-devel, intel-gfx
On Tue, Oct 25, 2016 at 10:46:44AM +0300, Jani Nikula wrote:
> On Tue, 25 Oct 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Mon, Oct 24, 2016 at 08:10:46PM +0300, Jani Nikula wrote:
> >> On Mon, 24 Oct 2016, Imre Deak <imre.deak@intel.com> wrote:
> >> > This check is open-coded in a few places, so it makes sense to simplify
> >> > things by having a helper for it similar to the rest of DPCD feature
> >> > helpers.
> >> >
> >> > v2: (Jani)
> >> > - Move the helper to drm_dp_helper.h.
> >> > - Split out this change to a separate patch.
> >> >
> >> > Cc: Jani Nikula <jani.nikula@intel.com>
> >> > Cc: dri-devel@lists.freedesktop.org
> >> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> >>
> >> DP 1.4 has changed the name of "branch" devices, but I think this is
> >> good.
> >>
> >> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> >
> > Applied to drm-misc, thanks.
>
> Thanks, but... that actually makes this series harder to land. We can't
> move forward with the i915 changes before a backmerge to dinq with this
> helper included.
Oh garbage, I thought it was 1/1. Should wait for coffee to kick in first.
I guess just apply it to drm-intel also, and we'll deal with the fallout
(I can't rebase and all that).
-Daniel
>
> BR,
> Jani.
>
> > -Daniel
> >>
> >>
> >> > ---
> >> > drivers/gpu/drm/i915/intel_dp.c | 11 ++++-------
> >> > include/drm/drm_dp_helper.h | 6 ++++++
> >> > 2 files changed, 10 insertions(+), 7 deletions(-)
> >> >
> >> > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> >> > index f30db8f..3c2293b 100644
> >> > --- a/drivers/gpu/drm/i915/intel_dp.c
> >> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> >> > @@ -1459,8 +1459,7 @@ static void intel_dp_print_hw_revision(struct intel_dp *intel_dp)
> >> > if ((drm_debug & DRM_UT_KMS) == 0)
> >> > return;
> >> >
> >> > - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> >> > - DP_DWN_STRM_PORT_PRESENT))
> >> > + if (!drm_dp_is_branch(intel_dp->dpcd))
> >> > return;
> >> >
> >> > len = drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_HW_REV, &rev, 1);
> >> > @@ -1478,8 +1477,7 @@ static void intel_dp_print_sw_revision(struct intel_dp *intel_dp)
> >> > if ((drm_debug & DRM_UT_KMS) == 0)
> >> > return;
> >> >
> >> > - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> >> > - DP_DWN_STRM_PORT_PRESENT))
> >> > + if (!drm_dp_is_branch(intel_dp->dpcd))
> >> > return;
> >> >
> >> > len = drm_dp_dpcd_read(&intel_dp->aux, DP_BRANCH_SW_REV, &rev, 2);
> >> > @@ -3615,8 +3613,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
> >> > if (!is_edp(intel_dp) && !intel_dp->sink_count)
> >> > return false;
> >> >
> >> > - if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> >> > - DP_DWN_STRM_PORT_PRESENT))
> >> > + if (!drm_dp_is_branch(intel_dp->dpcd))
> >> > return true; /* native DP sink */
> >> >
> >> > if (intel_dp->dpcd[DP_DPCD_REV] == 0x10)
> >> > @@ -4134,7 +4131,7 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
> >> > return connector_status_connected;
> >> >
> >> > /* if there's no downstream port, we're done */
> >> > - if (!(dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT))
> >> > + if (!drm_dp_is_branch(dpcd))
> >> > return connector_status_connected;
> >> >
> >> > /* If we're HPD-aware, SINK_COUNT changes dynamically */
> >> > diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> >> > index 2a79882..55bbeb0 100644
> >> > --- a/include/drm/drm_dp_helper.h
> >> > +++ b/include/drm/drm_dp_helper.h
> >> > @@ -690,6 +690,12 @@ drm_dp_tps3_supported(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
> >> > dpcd[DP_MAX_LANE_COUNT] & DP_TPS3_SUPPORTED;
> >> > }
> >> >
> >> > +static inline bool
> >> > +drm_dp_is_branch(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
> >> > +{
> >> > + return dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT;
> >> > +}
> >> > +
> >> > /*
> >> > * DisplayPort AUX channel
> >> > */
> >>
> >> --
> >> Jani Nikula, Intel Open Source Technology Center
> >> _______________________________________________
> >> Intel-gfx mailing list
> >> Intel-gfx@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Jani Nikula, Intel Open Source Technology Center
--
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] 5+ messages in thread
end of thread, other threads:[~2016-10-25 8:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1477326811-30431-1-git-send-email-imre.deak@intel.com>
2016-10-24 16:33 ` [PATCH v2 1/8] drm/dp: Factor out helper to distinguish between branch and sink devices Imre Deak
2016-10-24 17:10 ` Jani Nikula
2016-10-25 6:54 ` [Intel-gfx] " Daniel Vetter
2016-10-25 7:46 ` Jani Nikula
2016-10-25 8:12 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).