All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Sean Paul <seanpaul@chromium.org>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	David Airlie <airlied@linux.ie>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel@lists.freedesktop.org, linux-usb@vger.kernel.org
Subject: [3/3] usb: typec: altmodes/displayport: Notify drm subsys of hotplug events
Date: Mon, 25 Feb 2019 15:06:39 +0100	[thread overview]
Message-ID: <20190225140639.GA31039@kroah.com> (raw)

On Mon, Feb 25, 2019 at 02:20:37PM +0100, Hans de Goede wrote:
> Use the new drm_kms_call_oob_hotplug_notifier_chain() function to load
> drm/kms drivers know about DisplayPort over Type-C hotplug events.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/usb/typec/altmodes/displayport.c | 34 ++++++++++++++++--------
>  1 file changed, 23 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
> index 35161594e368..87760ea252d6 100644
> --- a/drivers/usb/typec/altmodes/displayport.c
> +++ b/drivers/usb/typec/altmodes/displayport.c
> @@ -13,6 +13,7 @@
>  #include <linux/module.h>
>  #include <linux/usb/pd_vdo.h>
>  #include <linux/usb/typec_dp.h>
> +#include <drm/drm_probe_helper.h>
>  
>  #define DP_HEADER(cmd)			(VDO(USB_TYPEC_DP_SID, 1, cmd) | \
>  					 VDO_OPOS(USB_TYPEC_DP_MODE))
> @@ -67,12 +68,23 @@ struct dp_altmode {
>  	const struct typec_altmode *port;
>  };
>  
> -static int dp_altmode_notify(struct dp_altmode *dp)
> +static int dp_altmode_notify(struct dp_altmode *dp, unsigned long conf)
> +{
> +	int ret;
> +
> +	ret = typec_altmode_notify(dp->alt, conf, &dp->data);
> +	if (ret)
> +		return ret;
> +
> +	drm_kms_call_oob_hotplug_notifier_chain(DRM_OOB_HOTPLUG_TYPE_C_DP);

Is this causing a build/run-time dependancy of the USB code on DRM now?
What about typec systems without DRM, is that a thing?

I have no objection to this if the DRM people like this type of api
(personally I hate notifier chains), just curious about the dependancy
issues involved.

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	David Airlie <airlied@linux.ie>,
	linux-usb@vger.kernel.org, Sean Paul <seanpaul@chromium.org>,
	dri-devel@lists.freedesktop.org,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 3/3] usb: typec: altmodes/displayport: Notify drm subsys of hotplug events
Date: Mon, 25 Feb 2019 15:06:39 +0100	[thread overview]
Message-ID: <20190225140639.GA31039@kroah.com> (raw)
In-Reply-To: <20190225132037.31458-4-hdegoede@redhat.com>

On Mon, Feb 25, 2019 at 02:20:37PM +0100, Hans de Goede wrote:
> Use the new drm_kms_call_oob_hotplug_notifier_chain() function to load
> drm/kms drivers know about DisplayPort over Type-C hotplug events.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/usb/typec/altmodes/displayport.c | 34 ++++++++++++++++--------
>  1 file changed, 23 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
> index 35161594e368..87760ea252d6 100644
> --- a/drivers/usb/typec/altmodes/displayport.c
> +++ b/drivers/usb/typec/altmodes/displayport.c
> @@ -13,6 +13,7 @@
>  #include <linux/module.h>
>  #include <linux/usb/pd_vdo.h>
>  #include <linux/usb/typec_dp.h>
> +#include <drm/drm_probe_helper.h>
>  
>  #define DP_HEADER(cmd)			(VDO(USB_TYPEC_DP_SID, 1, cmd) | \
>  					 VDO_OPOS(USB_TYPEC_DP_MODE))
> @@ -67,12 +68,23 @@ struct dp_altmode {
>  	const struct typec_altmode *port;
>  };
>  
> -static int dp_altmode_notify(struct dp_altmode *dp)
> +static int dp_altmode_notify(struct dp_altmode *dp, unsigned long conf)
> +{
> +	int ret;
> +
> +	ret = typec_altmode_notify(dp->alt, conf, &dp->data);
> +	if (ret)
> +		return ret;
> +
> +	drm_kms_call_oob_hotplug_notifier_chain(DRM_OOB_HOTPLUG_TYPE_C_DP);

Is this causing a build/run-time dependancy of the USB code on DRM now?
What about typec systems without DRM, is that a thing?

I have no objection to this if the DRM people like this type of api
(personally I hate notifier chains), just curious about the dependancy
issues involved.

thanks,

greg k-h
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2019-02-25 14:06 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 14:06 Greg Kroah-Hartman [this message]
2019-02-25 14:06 ` [PATCH 3/3] usb: typec: altmodes/displayport: Notify drm subsys of hotplug events Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2019-02-27 15:51 [3/3] " Hans de Goede
2019-02-27 15:51 ` [PATCH 3/3] " Hans de Goede
2019-02-27  9:44 [3/3] " Heikki Krogerus
2019-02-27  9:44 ` [PATCH 3/3] " Heikki Krogerus
2019-02-26 16:04 [3/3] " kbuild test robot
2019-02-26 16:04 ` [PATCH 3/3] " kbuild test robot
2019-02-26  7:40 [3/3] " kbuild test robot
2019-02-26  7:40 ` [PATCH 3/3] " kbuild test robot
2019-02-25 16:19 [3/3] " Hans de Goede
2019-02-25 16:19 ` [PATCH 3/3] " Hans de Goede
2019-02-25 13:20 [3/3] " Hans de Goede
2019-02-25 13:20 ` [PATCH 3/3] " Hans de Goede
2019-02-25 13:20 [2/3] i915: Add support for out-of-bound " Hans de Goede
2019-02-25 13:20 ` [PATCH 2/3] " Hans de Goede
2019-02-25 13:20 [1/3] drm: Add support for out-of-band hotplug notification Hans de Goede
2019-02-25 13:20 ` [PATCH 1/3] " Hans de Goede
2019-02-25 13:20 [PATCH 0/3] Propagate DP-over-Type-C hotplug events from Type-C subsys to drm-drivers Hans de Goede
2019-02-25 14:41 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-02-25 14:43 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-02-25 15:02 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-25 19:55 ` ✓ Fi.CI.IGT: " Patchwork
2019-02-27 10:55 ` [PATCH 0/3] " Heikki Krogerus
2019-02-27 11:16   ` Jani Nikula
2019-02-27 11:49     ` Heikki Krogerus
2019-02-27 15:45     ` Hans de Goede
2019-02-28  9:15       ` Heikki Krogerus
2019-02-28 11:24         ` Hans de Goede
2019-02-28 14:47           ` Heikki Krogerus
2019-02-28 16:54             ` Hans de Goede
2019-03-04 15:17               ` Heikki Krogerus
2019-03-05  7:45                 ` Hans de Goede

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=20190225140639.GA31039@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=seanpaul@chromium.org \
    /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 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.