drm/rockchip: Add support for out-of-band hotplug notification
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. Avoid the conflict of GKI, the drm_connector_oob_hotplug_event() is be completed in rockchip drm driver, not the drm framework. Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com> Change-Id: I5b1428daa83b0fdb7cf88e95d0b8fde2548d43d8
This commit is contained in:
@@ -46,6 +46,32 @@
|
||||
static bool is_support_iommu = true;
|
||||
static struct drm_driver rockchip_drm_driver;
|
||||
|
||||
/**
|
||||
* drm_connector_oob_hotplug_event - Report out-of-band hotplug event to connector
|
||||
* @connector: connector to report the event on
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This function can be used to report these out-of-band events after obtaining
|
||||
* a drm_connector reference through calling drm_connector_find_by_fwnode().
|
||||
*/
|
||||
void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode)
|
||||
{
|
||||
struct rockchip_drm_sub_dev *sub_dev;
|
||||
|
||||
if (!connector_fwnode || !connector_fwnode->dev)
|
||||
return;
|
||||
|
||||
sub_dev = rockchip_drm_get_sub_dev(dev_of_node(connector_fwnode->dev));
|
||||
|
||||
if (sub_dev && sub_dev->connector && sub_dev->oob_hotplug_event)
|
||||
sub_dev->oob_hotplug_event(sub_dev->connector);
|
||||
}
|
||||
EXPORT_SYMBOL(drm_connector_oob_hotplug_event);
|
||||
|
||||
uint32_t rockchip_drm_get_bpp(const struct drm_format_info *info)
|
||||
{
|
||||
/* use whatever a driver has set */
|
||||
|
||||
@@ -58,6 +58,7 @@ struct rockchip_drm_sub_dev {
|
||||
struct drm_connector *connector;
|
||||
struct device_node *of_node;
|
||||
void (*loader_protect)(struct drm_encoder *encoder, bool on);
|
||||
void (*oob_hotplug_event)(struct drm_connector *connector);
|
||||
};
|
||||
|
||||
struct rockchip_sdr2hdr_state {
|
||||
|
||||
@@ -1649,6 +1649,7 @@ drm_connector_is_unregistered(struct drm_connector *connector)
|
||||
DRM_CONNECTOR_UNREGISTERED;
|
||||
}
|
||||
|
||||
void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode);
|
||||
const char *drm_get_connector_type_name(unsigned int connector_type);
|
||||
const char *drm_get_connector_status_name(enum drm_connector_status status);
|
||||
const char *drm_get_subpixel_order_name(enum subpixel_order order);
|
||||
|
||||
Reference in New Issue
Block a user