[Intel-gfx] [PATCH v2 4/7] drm/i915: add common intel_digital_port_connected function
Sivakumar Thulasimani
sivakumar.thulasimani at intel.com
Thu Aug 27 01:12:10 PDT 2015
On 8/27/2015 1:38 PM, Jani Nikula wrote:
> On Thu, 27 Aug 2015, Sivakumar Thulasimani <sivakumar.thulasimani at intel.com> wrote:
>> On 8/27/2015 12:30 PM, Jani Nikula wrote:
>>> On Wed, 26 Aug 2015, Sivakumar Thulasimani <sivakumar.thulasimani at intel.com> wrote:
>>>> On 8/20/2015 1:17 PM, Jani Nikula wrote:
>>>>> Add a common intel_digital_port_connected() that splits out to functions
>>>>> for different platforms. No functional changes.
>>>>>
>>>>> v2: make the function return a boolean
>>>>>
>>>>> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
>>>>> ---
>>>>> drivers/gpu/drm/i915/intel_dp.c | 41 ++++++++++++++++++++++-------------------
>>>>> 1 file changed, 22 insertions(+), 19 deletions(-)
>>>>>
>>>>> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
>>>>> index f08859471841..f947951a01d4 100644
>>>>> --- a/drivers/gpu/drm/i915/intel_dp.c
>>>>> +++ b/drivers/gpu/drm/i915/intel_dp.c
>>>>> @@ -4473,13 +4473,6 @@ edp_detect(struct intel_dp *intel_dp)
>>>>> return status;
>>>>> }
>>>>>
>>>>> -/*
>>>>> - * ibx_digital_port_connected - is the specified port connected?
>>>>> - * @dev_priv: i915 private structure
>>>>> - * @port: the port to test
>>>>> - *
>>>>> - * Returns true if @port is connected, false otherwise.
>>>>> - */
>>>>> static bool ibx_digital_port_connected(struct drm_i915_private *dev_priv,
>>>>> struct intel_digital_port *port)
>>>>> {
>>>>> @@ -4524,13 +4517,12 @@ static bool ibx_digital_port_connected(struct drm_i915_private *dev_priv,
>>>>> return I915_READ(SDEISR) & bit;
>>>>> }
>>>>>
>>>>> -static bool g4x_digital_port_connected(struct drm_device *dev,
>>>>> +static bool g4x_digital_port_connected(struct drm_i915_private *dev_priv,
>>>>> struct intel_digital_port *port)
>>>>> {
>>>>> - struct drm_i915_private *dev_priv = dev->dev_private;
>>>>> uint32_t bit;
>>>>>
>>>>> - if (IS_VALLEYVIEW(dev)) {
>>>>> + if (IS_VALLEYVIEW(dev_priv)) {
>>>> this might not work :(. just noted this as part of another review.
>>>> please fix this since
>>>> it is merged.
>>> Sorry, what might not work?
>>>
>>> Jani.
>> - if (IS_VALLEYVIEW(dev)) {
>> + if (IS_VALLEYVIEW(dev_priv)) { <----- dev_priv is used instead of dev
>> should be IS_VALLEYVIEW(dev_priv->dev)
> Ah, that may be confusing. We're transitioning towards preferring
> dev_priv, and instead of switching everything at once (which would not
> work) Chris put together some magic to have these macros accept either
> drm_i915_private or drm_device pointer. See __I915__ in i915_drv.h.
>
> BR,
> Jani.
sorry, missed that part :(.
>
>>>>> switch (port->port) {
>>>>> case PORT_B:
>>>>> bit = PORTB_HOTPLUG_LIVE_STATUS_VLV;
>>>>> @@ -4565,6 +4557,22 @@ static bool g4x_digital_port_connected(struct drm_device *dev,
>>>>> return I915_READ(PORT_HOTPLUG_STAT) & bit;
>>>>> }
>>>>>
>>>>> +/*
>>>>> + * intel_digital_port_connected - is the specified port connected?
>>>>> + * @dev_priv: i915 private structure
>>>>> + * @port: the port to test
>>>>> + *
>>>>> + * Return %true if @port is connected, %false otherwise.
>>>>> + */
>>>>> +static bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
>>>>> + struct intel_digital_port *port)
>>>>> +{
>>>>> + if (HAS_PCH_SPLIT(dev_priv))
>>>>> + return ibx_digital_port_connected(dev_priv, port);
>>>>> + else
>>>>> + return g4x_digital_port_connected(dev_priv, port);
>>>>> +}
>>>>> +
>>>>> static enum drm_connector_status
>>>>> ironlake_dp_detect(struct intel_dp *intel_dp)
>>>>> {
>>>>> @@ -4572,7 +4580,7 @@ ironlake_dp_detect(struct intel_dp *intel_dp)
>>>>> struct drm_i915_private *dev_priv = dev->dev_private;
>>>>> struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
>>>>>
>>>>> - if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
>>>>> + if (!intel_digital_port_connected(dev_priv, intel_dig_port))
>>>>> return connector_status_disconnected;
>>>>>
>>>>> return intel_dp_detect_dpcd(intel_dp);
>>>>> @@ -4594,7 +4602,7 @@ g4x_dp_detect(struct intel_dp *intel_dp)
>>>>> return status;
>>>>> }
>>>>>
>>>>> - if (!g4x_digital_port_connected(dev, intel_dig_port))
>>>>> + if (!intel_digital_port_connected(dev->dev_private, intel_dig_port))
>>>>> return connector_status_disconnected;
>>>>>
>>>>> return intel_dp_detect_dpcd(intel_dp);
>>>>> @@ -5057,13 +5065,8 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd)
>>>>> /* indicate that we need to restart link training */
>>>>> intel_dp->train_set_valid = false;
>>>>>
>>>>> - if (HAS_PCH_SPLIT(dev)) {
>>>>> - if (!ibx_digital_port_connected(dev_priv, intel_dig_port))
>>>>> - goto mst_fail;
>>>>> - } else {
>>>>> - if (!g4x_digital_port_connected(dev, intel_dig_port))
>>>>> - goto mst_fail;
>>>>> - }
>>>>> + if (!intel_digital_port_connected(dev_priv, intel_dig_port))
>>>>> + goto mst_fail;
>>>>>
>>>>> if (!intel_dp_get_dpcd(intel_dp)) {
>>>>> goto mst_fail;
>>>> --
>>>> regards,
>>>> Sivakumar
>>>>
>> --
>> regards,
>> Sivakumar
>>
--
regards,
Sivakumar
More information about the Intel-gfx
mailing list