Commit 5c4e9806 authored by Andrey Grodzovsky's avatar Andrey Grodzovsky Committed by Alex Deucher

drm/amd/display: Remove get_connector_for_sink.

Keep 1:1 relation between MST sink and it's MST connector.
Signed-off-by: default avatarAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Reviewed-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9fb8de78
...@@ -133,21 +133,6 @@ enum dc_edid_status dm_helpers_parse_edid_caps( ...@@ -133,21 +133,6 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
return result; return result;
} }
static struct amdgpu_connector *get_connector_for_sink(
struct drm_device *dev,
const struct dc_sink *sink)
{
struct drm_connector *connector;
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
struct amdgpu_connector *aconnector = to_amdgpu_connector(connector);
if (aconnector->dc_sink == sink)
return aconnector;
}
return NULL;
}
static void get_payload_table( static void get_payload_table(
struct amdgpu_connector *aconnector, struct amdgpu_connector *aconnector,
struct dp_mst_stream_allocation_table *proposed_table) struct dp_mst_stream_allocation_table *proposed_table)
...@@ -194,8 +179,6 @@ bool dm_helpers_dp_mst_write_payload_allocation_table( ...@@ -194,8 +179,6 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
struct dp_mst_stream_allocation_table *proposed_table, struct dp_mst_stream_allocation_table *proposed_table,
bool enable) bool enable)
{ {
struct amdgpu_device *adev = ctx->driver_context;
struct drm_device *dev = adev->ddev;
struct amdgpu_connector *aconnector; struct amdgpu_connector *aconnector;
struct drm_dp_mst_topology_mgr *mst_mgr; struct drm_dp_mst_topology_mgr *mst_mgr;
struct drm_dp_mst_port *mst_port; struct drm_dp_mst_port *mst_port;
...@@ -205,7 +188,7 @@ bool dm_helpers_dp_mst_write_payload_allocation_table( ...@@ -205,7 +188,7 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
int bpp = 0; int bpp = 0;
int pbn = 0; int pbn = 0;
aconnector = get_connector_for_sink(dev, stream->sink); aconnector = stream->sink->priv;
if (!aconnector || !aconnector->mst_port) if (!aconnector || !aconnector->mst_port)
return false; return false;
...@@ -284,13 +267,11 @@ bool dm_helpers_dp_mst_poll_for_allocation_change_trigger( ...@@ -284,13 +267,11 @@ bool dm_helpers_dp_mst_poll_for_allocation_change_trigger(
struct dc_context *ctx, struct dc_context *ctx,
const struct dc_stream *stream) const struct dc_stream *stream)
{ {
struct amdgpu_device *adev = ctx->driver_context;
struct drm_device *dev = adev->ddev;
struct amdgpu_connector *aconnector; struct amdgpu_connector *aconnector;
struct drm_dp_mst_topology_mgr *mst_mgr; struct drm_dp_mst_topology_mgr *mst_mgr;
int ret; int ret;
aconnector = get_connector_for_sink(dev, stream->sink); aconnector = stream->sink->priv;
if (!aconnector || !aconnector->mst_port) if (!aconnector || !aconnector->mst_port)
return false; return false;
...@@ -313,14 +294,12 @@ bool dm_helpers_dp_mst_send_payload_allocation( ...@@ -313,14 +294,12 @@ bool dm_helpers_dp_mst_send_payload_allocation(
const struct dc_stream *stream, const struct dc_stream *stream,
bool enable) bool enable)
{ {
struct amdgpu_device *adev = ctx->driver_context;
struct drm_device *dev = adev->ddev;
struct amdgpu_connector *aconnector; struct amdgpu_connector *aconnector;
struct drm_dp_mst_topology_mgr *mst_mgr; struct drm_dp_mst_topology_mgr *mst_mgr;
struct drm_dp_mst_port *mst_port; struct drm_dp_mst_port *mst_port;
int ret; int ret;
aconnector = get_connector_for_sink(dev, stream->sink); aconnector = stream->sink->priv;
if (!aconnector || !aconnector->mst_port) if (!aconnector || !aconnector->mst_port)
return false; return false;
......
...@@ -325,6 +325,7 @@ static void dm_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr) ...@@ -325,6 +325,7 @@ static void dm_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr)
struct drm_connector *connector; struct drm_connector *connector;
struct amdgpu_connector *aconnector; struct amdgpu_connector *aconnector;
struct edid *edid; struct edid *edid;
struct dc_sink *dc_sink;
drm_modeset_lock_all(dev); drm_modeset_lock_all(dev);
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
...@@ -352,11 +353,15 @@ static void dm_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr) ...@@ -352,11 +353,15 @@ static void dm_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr)
aconnector->edid = edid; aconnector->edid = edid;
aconnector->dc_sink = dc_link_add_remote_sink( dc_sink = dc_link_add_remote_sink(
aconnector->dc_link, aconnector->dc_link,
(uint8_t *)edid, (uint8_t *)edid,
(edid->extensions + 1) * EDID_LENGTH, (edid->extensions + 1) * EDID_LENGTH,
&init_params); &init_params);
dc_sink->priv = aconnector;
aconnector->dc_sink = dc_sink;
if (aconnector->dc_sink) if (aconnector->dc_sink)
amdgpu_dm_add_sink_to_freesync_module( amdgpu_dm_add_sink_to_freesync_module(
connector, connector,
......
...@@ -719,6 +719,7 @@ struct dc_sink { ...@@ -719,6 +719,7 @@ struct dc_sink {
struct dc_container_id *dc_container_id; struct dc_container_id *dc_container_id;
uint32_t dongle_max_pix_clk; uint32_t dongle_max_pix_clk;
bool converter_disable_audio; bool converter_disable_audio;
void *priv;
}; };
void dc_sink_retain(const struct dc_sink *sink); void dc_sink_retain(const struct dc_sink *sink);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment