Commit 7b0a89a6 authored by Dhinakaran Pandiyan's avatar Dhinakaran Pandiyan Committed by Daniel Vetter

drm/dp: Store drm_device in MST topology manager

struct drm_dp_mst_topology_mgr currently stores a pointer to struct dev.
Changing this to instead hold a pointer to drm_device is more useful as it
gives access to DRM structures. This also makes it consistent with other
DRM structures like drm_crtc, drm_connector etc.
Signed-off-by: default avatarDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1485301777-3465-2-git-send-email-dhinakaran.pandiyan@intel.com
parent 442ffefc
...@@ -1086,7 +1086,7 @@ static void build_mst_prop_path(const struct drm_dp_mst_branch *mstb, ...@@ -1086,7 +1086,7 @@ static void build_mst_prop_path(const struct drm_dp_mst_branch *mstb,
} }
static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, static void drm_dp_add_port(struct drm_dp_mst_branch *mstb,
struct device *dev, struct drm_device *dev,
struct drm_dp_link_addr_reply_port *port_msg) struct drm_dp_link_addr_reply_port *port_msg)
{ {
struct drm_dp_mst_port *port; struct drm_dp_mst_port *port;
...@@ -1104,7 +1104,7 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, ...@@ -1104,7 +1104,7 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb,
port->port_num = port_msg->port_number; port->port_num = port_msg->port_number;
port->mgr = mstb->mgr; port->mgr = mstb->mgr;
port->aux.name = "DPMST"; port->aux.name = "DPMST";
port->aux.dev = dev; port->aux.dev = dev->dev;
created = true; created = true;
} else { } else {
old_pdt = port->pdt; old_pdt = port->pdt;
...@@ -2949,7 +2949,7 @@ static void drm_dp_destroy_connector_work(struct work_struct *work) ...@@ -2949,7 +2949,7 @@ static void drm_dp_destroy_connector_work(struct work_struct *work)
* Return 0 for success, or negative error code on failure * Return 0 for success, or negative error code on failure
*/ */
int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
struct device *dev, struct drm_dp_aux *aux, struct drm_device *dev, struct drm_dp_aux *aux,
int max_dpcd_transaction_bytes, int max_dpcd_transaction_bytes,
int max_payloads, int conn_base_id) int max_payloads, int conn_base_id)
{ {
......
...@@ -587,7 +587,8 @@ intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_ba ...@@ -587,7 +587,8 @@ intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_ba
/* create encoders */ /* create encoders */
intel_dp_create_fake_mst_encoders(intel_dig_port); intel_dp_create_fake_mst_encoders(intel_dig_port);
ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, dev->dev, &intel_dp->aux, 16, 3, conn_base_id); ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, dev,
&intel_dp->aux, 16, 3, conn_base_id);
if (ret) { if (ret) {
intel_dp->can_mst = false; intel_dp->can_mst = false;
return ret; return ret;
......
...@@ -3417,7 +3417,7 @@ nv50_mstm_new(struct nouveau_encoder *outp, struct drm_dp_aux *aux, int aux_max, ...@@ -3417,7 +3417,7 @@ nv50_mstm_new(struct nouveau_encoder *outp, struct drm_dp_aux *aux, int aux_max,
mstm->outp = outp; mstm->outp = outp;
mstm->mgr.cbs = &nv50_mstm; mstm->mgr.cbs = &nv50_mstm;
ret = drm_dp_mst_topology_mgr_init(&mstm->mgr, dev->dev, aux, aux_max, ret = drm_dp_mst_topology_mgr_init(&mstm->mgr, dev, aux, aux_max,
max_payloads, conn_base_id); max_payloads, conn_base_id);
if (ret) if (ret)
return ret; return ret;
......
...@@ -667,7 +667,7 @@ radeon_dp_mst_init(struct radeon_connector *radeon_connector) ...@@ -667,7 +667,7 @@ radeon_dp_mst_init(struct radeon_connector *radeon_connector)
return 0; return 0;
radeon_connector->mst_mgr.cbs = &mst_cbs; radeon_connector->mst_mgr.cbs = &mst_cbs;
return drm_dp_mst_topology_mgr_init(&radeon_connector->mst_mgr, dev->dev, return drm_dp_mst_topology_mgr_init(&radeon_connector->mst_mgr, dev,
&radeon_connector->ddc_bus->aux, 16, 6, &radeon_connector->ddc_bus->aux, 16, 6,
radeon_connector->base.base.id); radeon_connector->base.base.id);
} }
......
...@@ -414,7 +414,7 @@ struct drm_dp_mst_topology_mgr { ...@@ -414,7 +414,7 @@ struct drm_dp_mst_topology_mgr {
/** /**
* @dev: device pointer for adding i2c devices etc. * @dev: device pointer for adding i2c devices etc.
*/ */
struct device *dev; struct drm_device *dev;
/** /**
* @cbs: callbacks for connector addition and destruction. * @cbs: callbacks for connector addition and destruction.
*/ */
...@@ -556,7 +556,10 @@ struct drm_dp_mst_topology_mgr { ...@@ -556,7 +556,10 @@ struct drm_dp_mst_topology_mgr {
struct work_struct destroy_connector_work; struct work_struct destroy_connector_work;
}; };
int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, struct device *dev, struct drm_dp_aux *aux, int max_dpcd_transaction_bytes, int max_payloads, int conn_base_id); int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr,
struct drm_device *dev, struct drm_dp_aux *aux,
int max_dpcd_transaction_bytes,
int max_payloads, int conn_base_id);
void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr); void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr);
......
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