From: Hans de Goede <hidden> Date: 2021-08-17 21:52:13
Hi all,
Here is a rebased-resend of v4 of my patchset making DP over Type-C work on
devices where the Type-C controller does not drive the HPD pin on the GPU,
but instead we need to forward HPD events from the Type-C controller to
the DRM driver.
Changes in v4 resend:
- Rebase on top of latest drm-tip
Changes in v4:
- Rebase on top of latest drm-tip
- Add forward declaration for struct fwnode_handle to drm_crtc_internal.h
(fixes warning reported by kernel test robot [off-list ref])
- Add Heikki's Reviewed-by to patch 7 & 8
- Add Heikki's Tested-by to the series
Changes in v3:
- Base on top of latest drm-tip, which should fix the CI being unable to
apply (and thus to test) the patches
- Make intel_acpi_assign_connector_fwnodes() take a ref on the fwnode
it stores in connector->fwnode and have drm_connector_cleanup() put
this reference
- Drop data argument from drm_connector_oob_hotplug_event()
- Make the Type-C DP altmode code only call drm_connector_oob_hotplug_event()
when the HPD bit in the status vdo changes
- Drop the platform/x86/intel_cht_int33fe: Correct "displayport" fwnode
reference patch, this will be merged independently through the pdx86 tree
Changes in v2:
- Replace the bogus "drm/connector: Make the drm_sysfs connector->kdev
device hold a reference to the connector" patch with:
"drm/connector: Give connector sysfs devices there own device_type"
the new patch is a dep for patch 2/9 see the patches
- Stop using a class-dev-iter, instead at a global connector list
to drm_connector.c and use that to find the connector by the fwnode,
similar to how we already do this in drm_panel.c and drm_bridge.c
- Make drm_connector_oob_hotplug_event() take a fwnode pointer as
argument, rather then a drm_connector pointer and let it do the
lookup itself. This allows making drm_connector_find_by_fwnode() a
drm-internal function and avoids code outside the drm subsystem
potentially holding on the a drm_connector reference for a longer
period.
This series not only touches drm subsys files but it also touches
drivers/usb/typec/altmodes/typec_displayport.c, that file usually
does not see a whole lot of changes. So I believe it would be best
to just merge the entire series through drm-misc, Assuming we can
get an ack from Greg for merging the typec_displayport.c changes
this way.
Regards,
Hans
Hans de Goede (7):
drm/connector: Give connector sysfs devices there own device_type
drm/connector: Add a fwnode pointer to drm_connector and register with
ACPI (v2)
drm/connector: Add drm_connector_find_by_fwnode() function (v3)
drm/connector: Add support for out-of-band hotplug notification (v3)
drm/i915/dp: Add support for out-of-bound hotplug events
usb: typec: altmodes/displayport: Make dp_altmode_notify() more
generic
usb: typec: altmodes/displayport: Notify drm subsys of hotplug events
Heikki Krogerus (1):
drm/i915: Associate ACPI connector nodes with connector entries (v2)
drivers/gpu/drm/drm_connector.c | 79 ++++++++++++++++++
drivers/gpu/drm/drm_crtc_internal.h | 2 +
drivers/gpu/drm/drm_sysfs.c | 87 +++++++++++++++++---
drivers/gpu/drm/i915/display/intel_acpi.c | 46 +++++++++++
drivers/gpu/drm/i915/display/intel_acpi.h | 3 +
drivers/gpu/drm/i915/display/intel_display.c | 1 +
drivers/gpu/drm/i915/display/intel_dp.c | 12 +++
drivers/usb/typec/altmodes/Kconfig | 1 +
drivers/usb/typec/altmodes/displayport.c | 58 ++++++++-----
include/drm/drm_connector.h | 25 ++++++
10 files changed, 279 insertions(+), 35 deletions(-)
--
2.31.1
From: Hans de Goede <hidden> Date: 2021-08-17 21:52:16
Give connector sysfs devices there own device_type, this allows us to
check if a device passed to functions dealing with generic devices is
a drm_connector or not.
A check like this is necessary in the drm_connector_acpi_bus_match()
function added in the next patch in this series.
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <redacted>
---
drivers/gpu/drm/drm_sysfs.c | 50 +++++++++++++++++++++++++++----------
1 file changed, 37 insertions(+), 13 deletions(-)
From: Hans de Goede <hidden> Date: 2021-08-17 21:52:17
Add a fwnode pointer to struct drm_connector and register an acpi_bus_type
for the connectors with the ACPI subsystem (when CONFIG_ACPI is enabled).
The adding of the fwnode pointer allows drivers to associate a fwnode
that represents a connector with that connector.
When the new fwnode pointer points to an ACPI-companion, then the new
acpi_bus_type will cause the ACPI subsys to bind the device instantiated
for the connector with the fwnode by calling acpi_bind_one(). This will
result in a firmware_node symlink under /sys/class/card#-<connecter-name>/
which helps to verify that the fwnode-s and connectors are properly
matched.
Changes in v2:
- Make drm_connector_cleanup() call fwnode_handle_put() on
connector->fwnode and document this
Co-developed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <redacted>
---
drivers/gpu/drm/drm_connector.c | 2 ++
drivers/gpu/drm/drm_sysfs.c | 37 +++++++++++++++++++++++++++++++++
include/drm/drm_connector.h | 8 +++++++
3 files changed, 47 insertions(+)
From: Hans de Goede <hidden> Date: 2021-08-17 21:52:24
Add a function to find a connector based on a fwnode.
This will be used by the new drm_connector_oob_hotplug_event()
function which is added by the next patch in this patch-set.
Changes in v2:
- Complete rewrite to use a global connector list in drm_connector.c
rather then using a class-dev-iter in drm_sysfs.c
Changes in v3:
- Add forward declaration for struct fwnode_handle to drm_crtc_internal.h
(fixes warning reported by kernel test robot [off-list ref])
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <redacted>
---
drivers/gpu/drm/drm_connector.c | 50 +++++++++++++++++++++++++++++
drivers/gpu/drm/drm_crtc_internal.h | 2 ++
include/drm/drm_connector.h | 8 +++++
3 files changed, 60 insertions(+)
@@ -267,6 +275,7 @@ int drm_connector_init(struct drm_device *dev,gotoout_put_type_id;}+INIT_LIST_HEAD(&connector->global_connector_list_entry);INIT_LIST_HEAD(&connector->probed_modes);INIT_LIST_HEAD(&connector->modes);mutex_init(&connector->mutex);
@@ -534,6 +543,9 @@ int drm_connector_register(struct drm_connector *connector)/* Let userspace know we have a new connector */drm_sysfs_hotplug_event(connector->dev);+mutex_lock(&connector_list_lock);+list_add_tail(&connector->global_connector_list_entry,&connector_list);+mutex_unlock(&connector_list_lock);gotounlock;err_debugfs:
From: Hans de Goede <hidden> Date: 2021-08-17 21:52:27
Add a new drm_connector_oob_hotplug_event() function and
oob_hotplug_event drm_connector_funcs member.
On some hardware a hotplug event notification may come from outside the
display driver / device. An example of this is some USB Type-C setups
where the hardware muxes the DisplayPort data and aux-lines but does
not pass the altmode HPD status bit to the GPU's DP HPD pin.
In cases like this the new drm_connector_oob_hotplug_event() function can
be used to report these out-of-band events.
Changes in v2:
- Make drm_connector_oob_hotplug_event() take a fwnode as argument and
have it call drm_connector_find_by_fwnode() internally. This allows
making drm_connector_find_by_fwnode() a drm-internal function and
avoids code outside the drm subsystem potentially holding on the
a drm_connector reference for a longer period.
Changes in v3:
- Drop the data argument to the drm_connector_oob_hotplug_event
function since it is not used atm. This can be re-added later when
a use for it actually arises.
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <redacted>
---
drivers/gpu/drm/drm_connector.c | 27 +++++++++++++++++++++++++++
include/drm/drm_connector.h | 9 +++++++++
2 files changed, 36 insertions(+)
From: Hans de Goede <hidden> Date: 2021-08-17 21:52:31
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
On Intel platforms we know that the ACPI connector device
node order will follow the order the driver (i915) decides.
The decision is made using the custom Intel ACPI OpRegion
(intel_opregion.c), though the driver does not actually know
that the values it sends to ACPI there are used for
associating a device node for the connectors, and assigning
address for them.
In reality that custom Intel ACPI OpRegion actually violates
ACPI specification (we supply dynamic information to objects
that are defined static, for example _ADR), however, it
makes assigning correct connector node for a connector entry
straightforward (it's one-on-one mapping).
Changes in v2 (Hans de goede):
- Take a reference on the fwnode which we assign to the connector,
for ACPI nodes this is a no-op but in the future we may see
software-fwnodes assigned to connectors which are ref-counted.
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <redacted>
---
drivers/gpu/drm/i915/display/intel_acpi.c | 46 ++++++++++++++++++++
drivers/gpu/drm/i915/display/intel_acpi.h | 3 ++
drivers/gpu/drm/i915/display/intel_display.c | 1 +
3 files changed, 50 insertions(+)
@@ -282,3 +282,49 @@ void intel_acpi_device_id_update(struct drm_i915_private *dev_priv)}drm_connector_list_iter_end(&conn_iter);}++/* NOTE: The connector order must be final before this is called. */+voidintel_acpi_assign_connector_fwnodes(structdrm_i915_private*i915)+{+structdrm_connector_list_iterconn_iter;+structdrm_device*drm_dev=&i915->drm;+structfwnode_handle*fwnode=NULL;+structdrm_connector*connector;+structacpi_device*adev;++drm_connector_list_iter_begin(drm_dev,&conn_iter);+drm_for_each_connector_iter(connector,&conn_iter){+/* Always getting the next, even when the last was not used. */+fwnode=device_get_next_child_node(drm_dev->dev,fwnode);+if(!fwnode)+break;++switch(connector->connector_type){+caseDRM_MODE_CONNECTOR_LVDS:+caseDRM_MODE_CONNECTOR_eDP:+caseDRM_MODE_CONNECTOR_DSI:+/*+*Integrateddisplayshaveaspecificaddress0x1fon+*mostIntelplatforms,butnotonallofthem.+*/+adev=acpi_find_child_device(ACPI_COMPANION(drm_dev->dev),+0x1f,0);+if(adev){+connector->fwnode=+fwnode_handle_get(acpi_fwnode_handle(adev));+break;+}+fallthrough;+default:+connector->fwnode=fwnode_handle_get(fwnode);+break;+}+}+drm_connector_list_iter_end(&conn_iter);+/*+*device_get_next_child_node()takesareferenceonthefwnode,if+*westoppediteratingbecauseweareoutofconnectorsweneedto+*putthis,otherwisefwnodeisNULLandtheputisano-op.+*/+fwnode_handle_put(fwnode);+}
From: Hans de Goede <hidden> Date: 2021-08-17 21:52:34
On some Cherry Trail devices, DisplayPort over Type-C is supported through
a USB-PD microcontroller (e.g. a fusb302) + a mux to switch the superspeed
datalines between USB-3 and DP (e.g. a pi3usb30532). The kernel in this
case does the PD/alt-mode negotiation itself, rather then everything being
handled in firmware.
So the kernel itself picks an alt-mode, tells the Type-C "dongle" to switch
to DP mode and sets the mux accordingly. In this setup the HPD pin is not
connected, so the i915 driver needs to respond to a software event and scan
the DP port for changes manually.
This commit adds support for this. Together with the recent addition of
DP alt-mode support to the Type-C subsystem this makes DP over Type-C
work on these devices.
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <redacted>
---
drivers/gpu/drm/i915/display/intel_dp.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
From: Hans de Goede <hidden> Date: 2021-08-17 21:52:39
Make dp_altmode_notify() handle the dp->data.conf == 0 case too,
rather then having separate code-paths for this in various places
which call it.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <redacted>
---
drivers/usb/typec/altmodes/displayport.c | 35 +++++++++---------------
1 file changed, 13 insertions(+), 22 deletions(-)
From: Hans de Goede <hidden> Date: 2021-08-17 21:52:40
Use the new drm_connector_oob_hotplug_event() functions to let drm/kms
drivers know about DisplayPort over Type-C hotplug events.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <redacted>
---
Changes in v3:
- Only call drm_connector_oob_hotplug_event() on hpd status bit change
- Adjust for drm_connector_oob_hotplug_event() no longer having a data
argument
Changes in v2:
- Add missing depends on DRM to TYPEC_DP_ALTMODE Kconfig entry
---
drivers/usb/typec/altmodes/Kconfig | 1 +
drivers/usb/typec/altmodes/displayport.c | 23 +++++++++++++++++++++++
2 files changed, 24 insertions(+)
From: Lyude Paul <lyude@redhat.com> Date: 2021-08-18 21:35:37
On Tue, 2021-08-17 at 23:51 +0200, Hans de Goede wrote:
quoted hunk
Give connector sysfs devices there own device_type, this allows us to
check if a device passed to functions dealing with generic devices is
a drm_connector or not.
A check like this is necessary in the drm_connector_acpi_bus_match()
function added in the next patch in this series.
Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <redacted>
---
drivers/gpu/drm/drm_sysfs.c | 50 +++++++++++++++++++++++++++----------
1 file changed, 37 insertions(+), 13 deletions(-)
From: Lyude Paul <lyude@redhat.com> Date: 2021-08-18 22:03:41
This looks great to me! Wasn't much to comment on here as most of this looks
fine to me. For the whole series:
Reviewed-by: Lyude Paul <lyude@redhat.com>
This will be quite interesting to try getting working for nouveau
On Tue, 2021-08-17 at 23:51 +0200, Hans de Goede wrote:
Hi all,
Here is a rebased-resend of v4 of my patchset making DP over Type-C work on
devices where the Type-C controller does not drive the HPD pin on the GPU,
but instead we need to forward HPD events from the Type-C controller to
the DRM driver.
Changes in v4 resend:
- Rebase on top of latest drm-tip
Changes in v4:
- Rebase on top of latest drm-tip
- Add forward declaration for struct fwnode_handle to drm_crtc_internal.h
(fixes warning reported by kernel test robot [off-list ref])
- Add Heikki's Reviewed-by to patch 7 & 8
- Add Heikki's Tested-by to the series
Changes in v3:
- Base on top of latest drm-tip, which should fix the CI being unable to
apply (and thus to test) the patches
- Make intel_acpi_assign_connector_fwnodes() take a ref on the fwnode
it stores in connector->fwnode and have drm_connector_cleanup() put
this reference
- Drop data argument from drm_connector_oob_hotplug_event()
- Make the Type-C DP altmode code only call
drm_connector_oob_hotplug_event()
when the HPD bit in the status vdo changes
- Drop the platform/x86/intel_cht_int33fe: Correct "displayport" fwnode
reference patch, this will be merged independently through the pdx86 tree
Changes in v2:
- Replace the bogus "drm/connector: Make the drm_sysfs connector->kdev
device hold a reference to the connector" patch with:
"drm/connector: Give connector sysfs devices there own device_type"
the new patch is a dep for patch 2/9 see the patches
- Stop using a class-dev-iter, instead at a global connector list
to drm_connector.c and use that to find the connector by the fwnode,
similar to how we already do this in drm_panel.c and drm_bridge.c
- Make drm_connector_oob_hotplug_event() take a fwnode pointer as
argument, rather then a drm_connector pointer and let it do the
lookup itself. This allows making drm_connector_find_by_fwnode() a
drm-internal function and avoids code outside the drm subsystem
potentially holding on the a drm_connector reference for a longer
period.
This series not only touches drm subsys files but it also touches
drivers/usb/typec/altmodes/typec_displayport.c, that file usually
does not see a whole lot of changes. So I believe it would be best
to just merge the entire series through drm-misc, Assuming we can
get an ack from Greg for merging the typec_displayport.c changes
this way.
Regards,
Hans
Hans de Goede (7):
drm/connector: Give connector sysfs devices there own device_type
drm/connector: Add a fwnode pointer to drm_connector and register with
ACPI (v2)
drm/connector: Add drm_connector_find_by_fwnode() function (v3)
drm/connector: Add support for out-of-band hotplug notification (v3)
drm/i915/dp: Add support for out-of-bound hotplug events
usb: typec: altmodes/displayport: Make dp_altmode_notify() more
generic
usb: typec: altmodes/displayport: Notify drm subsys of hotplug events
Heikki Krogerus (1):
drm/i915: Associate ACPI connector nodes with connector entries (v2)
drivers/gpu/drm/drm_connector.c | 79 ++++++++++++++++++
drivers/gpu/drm/drm_crtc_internal.h | 2 +
drivers/gpu/drm/drm_sysfs.c | 87 +++++++++++++++++---
drivers/gpu/drm/i915/display/intel_acpi.c | 46 +++++++++++
drivers/gpu/drm/i915/display/intel_acpi.h | 3 +
drivers/gpu/drm/i915/display/intel_display.c | 1 +
drivers/gpu/drm/i915/display/intel_dp.c | 12 +++
drivers/usb/typec/altmodes/Kconfig | 1 +
drivers/usb/typec/altmodes/displayport.c | 58 ++++++++-----
include/drm/drm_connector.h | 25 ++++++
10 files changed, 279 insertions(+), 35 deletions(-)
--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat
I'm trying to figure out how to translate this over to DT bindings. Is
there a binding document for this fwnode reference? If not, can you
please update
Documentation/devicetree/bindings/connector/usb-connector.yaml with this
property?
I think this means that the type-c node would have a 'displayport =
<&some_phandle>' property in it that points to the display port hardware
device that's pumping out the DisplayPort data?
@@ -555,6 +571,13 @@ void dp_altmode_remove(struct typec_altmode *alt) sysfs_remove_group(&alt->dev.kobj, &dp_altmode_group); cancel_work_sync(&dp->work);++ if (dp->connector_fwnode) {+ if (dp->hpd)+ drm_connector_oob_hotplug_event(dp->connector_fwnode);
I was hoping that we could make a type-c connector into a drm_bridge.
I'm thinking that it would be a DP-to-panel bridge. Then a panel could
be created as well on the end of the type-c connector and the bridge
would report hpd whenever the type-c logic figures out the cable has
been connected and hpd is asserted. The actual DisplayPort hardware
that's encoding data would then find the bridge through the graph
binding connected to the output node.
I'm not sure how MST is handled though. In that scenario maybe there's
more than one panel?
If you're interested the dts file that I'm trying to make this work for
is sc7180-trogdor.dtsi and I need to hook up mdss_dp's output port to
the two type-c connectors, usb_c0 and usb_c1, somehow. The two ports are
actually muxed by the EC (parent node) so only one type-c port can be
connected to the DP hardware at a time.
I'm trying to figure out how to translate this over to DT bindings.
First of all let me say that it is great that people are looking
into using this functionality outside of the niche application
for which I wrote it.
Is
there a binding document for this fwnode reference? If not, can you
please update
Documentation/devicetree/bindings/connector/usb-connector.yaml with this
property?
My use case is some Intel Cherry Trail based mini-laptops which use a
Intel Whiskey Cove PMIC with a FUSB302 Type-C controller + a
PI3USB30532 USB switch, specifically the GPD Win and GPD Pocket
(first generation of each).
These are ACPI/X86 devices so devicetree is not used there, the
connector_fwnode checked here is actually sw_node, this sw_node
reference gets setup here:
drivers/platform/x86/intel/int33fe/intel_cht_int33fe_typec.c
The setup/use of a sw_node reference for this was actually
designed by Heikki (in the Cc already), so he might be a better
person to answer your questions.
With that said, as to your question if I can document this in
usb-connector.yaml, no I cannot (sorry). Since this is a sw_node
setup by X86 code and not a normal devicetree fwnode reference,
atm this is purely a kernel internal API/binding really and the
DT-binding maintainers have repeatedly told me that I should NOT
submit DT-binding updates for these. Only once a real devicetree
user for this shows up will the accept DT-bindings patches for this.
The good news here though is, that if this turns out to be
non-ideal for the devicetree case we can still change things
as long as drivers/platform/x86/intel/int33fe/intel_cht_int33fe_typec.c
also gets updated so as to not break things.
I think this means that the type-c node would have a 'displayport =
<&some_phandle>' property in it that points to the display port hardware
device that's pumping out the DisplayPort data?
@@ -555,6 +571,13 @@ void dp_altmode_remove(struct typec_altmode *alt) sysfs_remove_group(&alt->dev.kobj, &dp_altmode_group); cancel_work_sync(&dp->work);++ if (dp->connector_fwnode) {+ if (dp->hpd)+ drm_connector_oob_hotplug_event(dp->connector_fwnode);
I was hoping that we could make a type-c connector into a drm_bridge.
I'm thinking that it would be a DP-to-panel bridge. Then a panel could
be created as well on the end of the type-c connector and the bridge
would report hpd whenever the type-c logic figures out the cable has
been connected and hpd is asserted. The actual DisplayPort hardware
that's encoding data would then find the bridge through the graph
binding connected to the output node.
I'm not sure how MST is handled though. In that scenario maybe there's
more than one panel?
Yeah, given that MST over DP over Type-C is very much possible my
first instinct is that this drm_bridge + bridge-to-panel idea is
not going to work very well. Also the output could be anything, it
could be a projector, or the DP input of a video-grabber, or ...
so modelling this as a panel feels wrong.
Regards,
Hans
I'm trying to figure out how to translate this over to DT bindings.
First of all let me say that it is great that people are looking
into using this functionality outside of the niche application
for which I wrote it.
Glad to hear it! This sort of thing is the norm on ARM based SoCs. I
rarely ever see the HPD pin actually connected to the GPU/DPU hardware.
It almost always goes through some other chip and then software has to
deal with it by looking at the gpio or external hardware block, etc.
quoted
Is
there a binding document for this fwnode reference? If not, can you
please update
Documentation/devicetree/bindings/connector/usb-connector.yaml with this
property?
My use case is some Intel Cherry Trail based mini-laptops which use a
Intel Whiskey Cove PMIC with a FUSB302 Type-C controller + a
PI3USB30532 USB switch, specifically the GPD Win and GPD Pocket
(first generation of each).
These are ACPI/X86 devices so devicetree is not used there, the
connector_fwnode checked here is actually sw_node, this sw_node
reference gets setup here:
drivers/platform/x86/intel/int33fe/intel_cht_int33fe_typec.c
The setup/use of a sw_node reference for this was actually
designed by Heikki (in the Cc already), so he might be a better
person to answer your questions.
Ok, thanks for the background.
With that said, as to your question if I can document this in
usb-connector.yaml, no I cannot (sorry). Since this is a sw_node
setup by X86 code and not a normal devicetree fwnode reference,
atm this is purely a kernel internal API/binding really and the
DT-binding maintainers have repeatedly told me that I should NOT
submit DT-binding updates for these. Only once a real devicetree
user for this shows up will the accept DT-bindings patches for this.
The good news here though is, that if this turns out to be
non-ideal for the devicetree case we can still change things
as long as drivers/platform/x86/intel/int33fe/intel_cht_int33fe_typec.c
also gets updated so as to not break things.
I see. At least there's an escape hatch.
quoted
I think this means that the type-c node would have a 'displayport =
<&some_phandle>' property in it that points to the display port hardware
device that's pumping out the DisplayPort data?
Yep. For DT we already have a graph binding to show the output of the
display hardware (DPU). Right now it's not connected to anything though.
I'm currently thinking that a clean solution is to connect that graph
endpoint to some mux node and then have the mux node connect to each
type-c node. Then a driver that registers the mux and type-c connectors
can generate a drm_bridge instance (or instances) and drm can chain them
all together by walking the graph and connecting the DPU to the mux
bridge and then each type-c connector's bridge. I don't know how a mux
would work in the drm bridge design, so either that becomes a first
class type of operation or we register two bridges in the mux driver and
mux in the backend.
This feels similar to how we handle DSI-to-eDP bridges, except that the
end of the bridge chain is a type-c connector that could have MST to
deal with. I'm not super familiar with MST but maybe MST could also
become bridge aware and then we wouldn't have to do anything special.
I'll cross that bridge when I come to it.
I image the DPU would search the graph for a panel and then if there
isn't a panel downstream I think it would make one up, or do nothing?
I'm not very sure about this part either.
Anyway, I'm going to try to prototype out some code to do this unless
someone wants to say it's a terrible idea. Let me know.
@@ -555,6 +571,13 @@ void dp_altmode_remove(struct typec_altmode *alt) sysfs_remove_group(&alt->dev.kobj, &dp_altmode_group); cancel_work_sync(&dp->work);++ if (dp->connector_fwnode) {+ if (dp->hpd)+ drm_connector_oob_hotplug_event(dp->connector_fwnode);
I was hoping that we could make a type-c connector into a drm_bridge.
I'm thinking that it would be a DP-to-panel bridge. Then a panel could
be created as well on the end of the type-c connector and the bridge
would report hpd whenever the type-c logic figures out the cable has
been connected and hpd is asserted. The actual DisplayPort hardware
that's encoding data would then find the bridge through the graph
binding connected to the output node.
I'm not sure how MST is handled though. In that scenario maybe there's
more than one panel?
Yeah, given that MST over DP over Type-C is very much possible my
first instinct is that this drm_bridge + bridge-to-panel idea is
not going to work very well. Also the output could be anything, it
could be a projector, or the DP input of a video-grabber, or ...
so modelling this as a panel feels wrong.
Agreed. I suppose making a panel in the connector is the wrong
direction, but making a bridge there should be OK.