Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9682ac93 authored by Govinda Rajulu Chenna's avatar Govinda Rajulu Chenna Committed by Gerrit - the friendly Code Review server
Browse files

drm/dp: cache edid for mst physical output ports



The current implementation is caching the edid during add_port
only for logical output ports and depending on get_edid api
to read edid for physical output ports. get_edid for physical
ports is executed only when get_connector ioctl is performed
by drm client.

The get_connector ioctl is locking the operation using mode_config
lock/unlock and get_edid for mst port may take couple of seconds
due to mst sideband operations. This lock/unlock is not allowing
atomic_commit ioctl for other active displays which results in
screen freeze.

This change caches the edid for mst physical ports during the
add_port operation to avoid executing get_edid as part of get_connector
ioctl to complete the ioctl operation as quick as possible. This
unblocks atomic_commit ioctl for other active displays to minimize
the screen freeze issue.

Change-Id: I993d89b8bd84f776494d72bc8ceb48eb62d2322b
Signed-off-by: default avatarGovinda Rajulu Chenna <gchenna@codeaurora.org>
parent 54f3590a
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -1208,9 +1208,8 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb,
			drm_dp_put_port(port);
			goto out;
		}
		if ((port->pdt == DP_PEER_DEVICE_DP_LEGACY_CONV ||
		     port->pdt == DP_PEER_DEVICE_SST_SINK) &&
		    port->port_num >= DP_MST_LOGICAL_PORT_0) {
		if (port->pdt == DP_PEER_DEVICE_DP_LEGACY_CONV ||
		     port->pdt == DP_PEER_DEVICE_SST_SINK) {
			port->cached_edid = drm_get_edid(port->connector, &port->aux.ddc);
			drm_connector_set_tile_property(port->connector);
		}
@@ -1248,6 +1247,13 @@ static void drm_dp_update_port(struct drm_dp_mst_branch *mstb,
		}
	}
	if (old_pdt != port->pdt && !port->input) {
		if ((old_pdt == DP_PEER_DEVICE_DP_LEGACY_CONV ||
		     old_pdt == DP_PEER_DEVICE_SST_SINK) &&
		    port->port_num < DP_MST_LOGICAL_PORT_0) {
			kfree(port->cached_edid);
			port->cached_edid = NULL;
		}

		drm_dp_port_teardown_pdt(port, old_pdt);

		if (drm_dp_port_setup_pdt(port))