From: Daniel Vetter <daniel@ffwll.ch>
To: Imre Deak <imre.deak@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v10 3/4] drm/i915: Set aux.dev to the drm_connector device, instead of drm_device.
Date: Sun, 14 Feb 2016 19:21:48 +0100 [thread overview]
Message-ID: <20160214182148.GE11240@phenom.ffwll.local> (raw)
In-Reply-To: <1455308908.27989.21.camel@intel.com>
On Fri, Feb 12, 2016 at 10:28:28PM +0200, Imre Deak wrote:
> On Thu, 2016-01-21 at 15:10 -0800, Rafael Antognolli wrote:
> > So far, the i915 driver and some other drivers set it to the
> > drm_device,
> > which doesn't allow one to know which DP a given aux channel is
> > related
> > to. Changing this to be the drm_connector provides proper nesting,
> > still
> > allowing one to get the drm_device from it. Some drivers already set
> > it
> > to the drm_connector.
> >
> > This also removes the need to add a sysfs link for the i2c device
> > under
> > the connector, as it will already be there.
>
> Yes, having the i2c-dev only at one place under the connector is more
> logical and what we want imo. It's an ABI change but if other drivers
> already have it in this way then I assume it's fine. For HDMI
> connectors we still have them under the drm_device (and there is no
> symlink for them under the connector device) but this was inconsistent
> already before this patch and can be fixed up later.
>
> Adding Jani, in case he has comments on this.
>
> Below one more comment:
>
> > v9:
> > - As a side effect, drm_dp_aux_unregister() must be called before
> > intel_connector_unregister(), as both the aux.dev and the i2c
> > adapter
> > dev are children of the drm_connector device now. Calling
> > drm_dp_aux_unregister() before prevents them from being destroyed
> > twice.
> >
> > v10:
> > - move aux_fini() to connector_unregister(), instead of moving
> > drm_dp_aux_unregister() outside of connector_register().
> >
> > Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_dp.c | 18 ++----------------
> > 1 file changed, 2 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c
> > b/drivers/gpu/drm/i915/intel_dp.c
> > index e2bea710..da704c6 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -1188,7 +1188,6 @@ intel_dp_aux_fini(struct intel_dp *intel_dp)
> > static int
> > intel_dp_aux_init(struct intel_dp *intel_dp, struct intel_connector
> > *connector)
> > {
> > - struct drm_device *dev = intel_dp_to_dev(intel_dp);
> > struct intel_digital_port *intel_dig_port =
> > dp_to_dig_port(intel_dp);
> > enum port port = intel_dig_port->port;
> > int ret;
> > @@ -1199,7 +1198,7 @@ intel_dp_aux_init(struct intel_dp *intel_dp,
> > struct intel_connector *connector)
> > if (!intel_dp->aux.name)
> > return -ENOMEM;
> >
> > - intel_dp->aux.dev = dev->dev;
> > + intel_dp->aux.dev = connector->base.kdev;
> > intel_dp->aux.transfer = intel_dp_aux_transfer;
> >
> > DRM_DEBUG_KMS("registering %s bus for %s\n",
> > @@ -1214,16 +1213,6 @@ intel_dp_aux_init(struct intel_dp *intel_dp,
> > struct intel_connector *connector)
> > return ret;
> > }
> >
> > - ret = sysfs_create_link(&connector->base.kdev->kobj,
> > - &intel_dp->aux.ddc.dev.kobj,
> > - intel_dp->aux.ddc.dev.kobj.name);
> > - if (ret < 0) {
> > - DRM_ERROR("sysfs_create_link() for %s failed
> > (%d)\n",
> > - intel_dp->aux.name, ret);
> > - intel_dp_aux_fini(intel_dp);
> > - return ret;
> > - }
> > -
> > return 0;
> > }
> >
> > @@ -1232,9 +1221,7 @@ intel_dp_connector_unregister(struct
> > intel_connector *intel_connector)
> > {
> > struct intel_dp *intel_dp =
> > intel_attached_dp(&intel_connector->base);
> >
> > - if (!intel_connector->mst_port)
> > - sysfs_remove_link(&intel_connector->base.kdev->kobj,
> > - intel_dp->aux.ddc.dev.kobj.name);
> > + intel_dp_aux_fini(intel_dp);
>
> Hrm, the mst_port check seems to have been misplaced at some point,
> this function isn't called for virtual MST connectors. So I think it's
> fine to remove it. The patch looks ok:
>
> Reviewed-by: Imre Deak <imre.deak@intel.com>
Added to drm-misc, thanks.
-Daniel
>
> > intel_connector_unregister(intel_connector);
> > }
> >
> > @@ -4868,7 +4855,6 @@ void intel_dp_encoder_destroy(struct
> > drm_encoder *encoder)
> > struct intel_digital_port *intel_dig_port =
> > enc_to_dig_port(encoder);
> > struct intel_dp *intel_dp = &intel_dig_port->dp;
> >
> > - intel_dp_aux_fini(intel_dp);
> > intel_dp_mst_encoder_cleanup(intel_dig_port);
> > if (is_edp(intel_dp)) {
> > cancel_delayed_work_sync(&intel_dp->panel_vdd_work);
> _______________________________________________
> 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-02-14 18:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-21 23:10 [PATCH v10 0/4] Add drm_dp_aux chardev support Rafael Antognolli
2016-01-21 23:10 ` [PATCH v10 1/4] drm/kms_helper: Add a common place to call init and exit functions Rafael Antognolli
2016-02-12 11:51 ` Ville Syrjälä
2016-01-21 23:10 ` [PATCH v10 2/4] drm/dp: Add a drm_aux-dev module for reading/writing dpcd registers Rafael Antognolli
2016-02-12 11:53 ` Ville Syrjälä
2016-02-12 13:23 ` [Intel-gfx] " Daniel Vetter
2016-01-21 23:10 ` [PATCH v10 3/4] drm/i915: Set aux.dev to the drm_connector device, instead of drm_device Rafael Antognolli
2016-02-12 20:28 ` Imre Deak
2016-02-14 18:21 ` Daniel Vetter [this message]
2016-01-21 23:10 ` [PATCH v10 4/4] drm/radeon: Fix WARN_ON if DRM_DP_AUX_CHARDEV is enabled Rafael Antognolli
2016-02-12 20:56 ` Alex Deucher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160214182148.GE11240@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox