1
0

disp: msm: dp: use base connector properties for mst connectors

When DRM property objects are created, the DRM framework attaches a
dellocator which can eventually free the object when the last reference
is removed from it. The framework can only do this before the driver is
registered. If a property is created after the registration then the
framework is unable to attach a deallocator causing a memory leak during
tear down.

The current DP driver creates a new colorspace property whenever a
new dp connector is initialized. It creates a base connector at probe
time prior to registration. But then it also creates new connectors,
post registration, whenever a new MST dongle is attached to the
topology, causing memory leaks.

This change limits the property creation to the base connector and
attaches the same object to MST connectors to avoid memory leak.

Change-Id: Ib97dc7aac260b4f3f96c1097f58bd276c68501f8
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
Este cometimento está contido em:
Rajkumar Subbiah
2020-07-10 22:20:20 -04:00
ascendente 20ed4f0785
cometimento 9522cd1382
6 ficheiros modificados com 59 adições e 4 eliminações

Ver ficheiro

@@ -2729,10 +2729,8 @@ static int _sde_connector_install_properties(struct drm_device *dev,
sizeof(hdr),
CONNECTOR_PROP_EXT_HDR_INFO);
/* create and attach colorspace property for DP */
if (!drm_mode_create_dp_colorspace_property(connector))
drm_object_attach_property(&connector->base,
connector->colorspace_property, 0);
if (c_conn->ops.install_properties)
c_conn->ops.install_properties(display, connector);
}
msm_property_install_volatile_range(&c_conn->property_info,