search for: drm_dp_get_validated_port_ref

Displaying 20 results from an estimated 45 matches for "drm_dp_get_validated_port_ref".

2018 Dec 20
0
[PATCH v2 01/16] drm/dp_mst: Rename drm_dp_mst_get_validated_(port|mstb)_ref and friends
s/drm_dp_get_validated_port_ref/drm_dp_mst_topology_get_port_validated/ s/drm_dp_put_port/drm_dp_mst_topology_put_port/ s/drm_dp_get_validated_mstb_ref/drm_dp_mst_topology_get_mstb_validated/ s/drm_dp_put_mst_branch_device/drm_dp_mst_topology_put_mstb/ This is a much more consistent naming scheme, and will make even more sense o...
2018 Dec 14
0
[WIP PATCH 03/15] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports
..., to_find); + mport = drm_dp_mst_topology_get_port_validated_locked( + port->mstb, to_find); if (mport) return mport; } @@ -1021,12 +1241,20 @@ static struct drm_dp_mst_port *drm_dp_mst_get_port_ref_locked(struct drm_dp_mst_ return NULL; } -static struct drm_dp_mst_port *drm_dp_get_validated_port_ref(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port) +static struct drm_dp_mst_port * +drm_dp_mst_topology_get_port_validated(struct drm_dp_mst_topology_mgr *mgr, + struct drm_dp_mst_port *port) { struct drm_dp_mst_port *rport = NULL; + mutex_lock(&mgr->lock); -...
2018 Dec 14
2
[WIP PATCH 03/15] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports
...et_port_validated_locked( > + port->mstb, to_find); > if (mport) > return mport; > } > @@ -1021,12 +1241,20 @@ static struct drm_dp_mst_port *drm_dp_mst_get_port_ref_locked(struct drm_dp_mst_ > return NULL; > } > > -static struct drm_dp_mst_port *drm_dp_get_validated_port_ref(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port) > +static struct drm_dp_mst_port * > +drm_dp_mst_topology_get_port_validated(struct drm_dp_mst_topology_mgr *mgr, > + struct drm_dp_mst_port *port) > { > struct drm_dp_mst_port *rport = NULL; > + >...
2018 Dec 19
1
[WIP PATCH 03/15] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports
...gt; > > return mport; > > > } > > > @@ -1021,12 +1241,20 @@ static struct drm_dp_mst_port > > > *drm_dp_mst_get_port_ref_locked(struct drm_dp_mst_ > > > return NULL; > > > } > > > > > > -static struct drm_dp_mst_port *drm_dp_get_validated_port_ref(struct > > > drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port) > > > +static struct drm_dp_mst_port * > > > +drm_dp_mst_topology_get_port_validated(struct drm_dp_mst_topology_mgr > > > *mgr, > > > + struct drm_dp_mst_port *port) >...
2018 Dec 18
0
[WIP PATCH 03/15] drm/dp_mst: Introduce new refcounting scheme for mstbs and ports
...tb, to_find); > > if (mport) > > return mport; > > } > > @@ -1021,12 +1241,20 @@ static struct drm_dp_mst_port > > *drm_dp_mst_get_port_ref_locked(struct drm_dp_mst_ > > return NULL; > > } > > > > -static struct drm_dp_mst_port *drm_dp_get_validated_port_ref(struct > > drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port) > > +static struct drm_dp_mst_port * > > +drm_dp_mst_topology_get_port_validated(struct drm_dp_mst_topology_mgr > > *mgr, > > + struct drm_dp_mst_port *port) > > { > > struc...
2018 Dec 20
22
[PATCH v2 00/16] MST refcounting/atomic helpers cleanup
This is the series I've been working on for a while now to get all of the atomic DRM drivers in the tree to use the atomic MST helpers, and to make the atomic MST helpers actually idempotent. Turns out it's a lot more difficult to do that without also fixing how port and branch device refcounting works so that it actually makes sense, since the current upstream implementation requires a
2018 Dec 14
22
[WIP PATCH 00/15] MST refcounting/atomic helpers cleanup
This is a WIP version of the series I've been working on for a while now to get all of the atomic DRM drivers in the tree to use the atomic MST helpers, and to make the atomic MST helpers actually idempotent. Turns out it's a lot more difficult to do that without also fixing how port and branch device refcounting works so that it actually makes sense, since the current upstream
2018 Nov 27
1
[PATCH 1/6] drm/dp_mst: Add drm_dp_get_payload_info()
...p_get_payload_info(struct drm_dp_mst_topology_mgr *mgr, > + struct drm_dp_mst_port *port, > + struct drm_dp_vcpi *vcpi_out, > + struct drm_dp_payload *payload_out) > +{ > + struct drm_dp_payload *payload = NULL; > + int i; > + int ret = 0; > + > + port = drm_dp_get_validated_port_ref(mgr, port); > + if (!port) > + return -EINVAL; This is the part that I mean in our other/irc discussions. The dp_get_validated_port here could fail when it's going to surprise the driver. With the dp_port_malloc_get stuff we could instead just grab a port_malloc_kref when storing the po...
2018 Dec 14
1
[WIP PATCH 02/15] drm/dp_mst: Refactor drm_dp_update_payload_part1()
...hw view */ > req_payload.start_slot = cur_slots; > - if (mgr->proposed_vcpis[i]) { > - port = container_of(mgr->proposed_vcpis[i], struct drm_dp_mst_port, vcpi); > + if (vcpi) { > + port = container_of(vcpi, struct drm_dp_mst_port, > + vcpi); > port = drm_dp_get_validated_port_ref(mgr, port); > if (!port) { > mutex_unlock(&mgr->payload_lock); > return -EINVAL; > } > - req_payload.num_slots = mgr->proposed_vcpis[i]->num_slots; > - req_payload.vcpi = mgr->proposed_vcpis[i]->vcpi; > + req_payload.num_slots = vcpi-&...
2018 Sep 19
1
[PATCH 1/6] drm/dp_mst: Introduce drm_dp_mst_connector_atomic_check() (fwd)
...18-09-18 3141 if (!mstb) f8df31d5 Lyude Paul 2018-09-18 3142 return false; f8df31d5 Lyude Paul 2018-09-18 3143 f8df31d5 Lyude Paul 2018-09-18 @3144 list_for_each_entry(port, &mstb->ports, next) { f8df31d5 Lyude Paul 2018-09-18 @3145 port = drm_dp_get_validated_port_ref(mgr, port); f8df31d5 Lyude Paul 2018-09-18 3146 if (!port) f8df31d5 Lyude Paul 2018-09-18 3147 continue; f8df31d5 Lyude Paul 2018-09-18 3148 f8df31d5 Lyude Paul 2018-09-18 3149 exists = (port->connector == connector || f8df31d5 Lyude Paul...
2018 Oct 29
2
[PATCH v2 2/4] drm/dp_mst: Start tracking per-port VCPI allocations
...dp_vcpi_allocation *pos, *vcpi = NULL; > + int prev_slots, req_slots, ret; > > topology_state = drm_atomic_get_mst_topology_state(state, mgr); > if (IS_ERR(topology_state)) > @@ -2637,20 +2649,41 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state, > port = drm_dp_get_validated_port_ref(mgr, port); > if (port == NULL) > return -EINVAL; > - req_slots = DIV_ROUND_UP(pbn, mgr->pbn_div); > - DRM_DEBUG_KMS("vcpi slots req=%d, avail=%d\n", > - req_slots, topology_state->avail_slots); > > - if (req_slots > topology_state->avail_slots) {...
2019 Jan 11
20
[PATCH v7 00/20] MST refcounting/atomic helpers cleanup
This is the series I've been working on for a while now to get all of the atomic DRM drivers in the tree to use the atomic MST helpers, and to make the atomic MST helpers actually idempotent. Turns out it's a lot more difficult to do that without also fixing how port and branch device refcounting works so that it actually makes sense, since the current upstream implementation requires a
2018 Sep 18
4
[PATCH 1/6] drm/dp_mst: Introduce drm_dp_mst_connector_atomic_check()
...ector, + struct drm_dp_mst_topology_mgr *mgr, + struct drm_dp_mst_branch *mstb) +{ + struct drm_dp_mst_port *port; + bool exists = false; + + mstb = drm_dp_get_validated_mstb_ref(mgr, mstb); + if (!mstb) + return false; + + list_for_each_entry(port, &mstb->ports, next) { + port = drm_dp_get_validated_port_ref(mgr, port); + if (!port) + continue; + + exists = (port->connector == connector || + (port->mstb && + drm_dp_mst_connector_still_exists(connector, mgr, + port->mstb))); + + drm_dp_put_port(port); + if (exists) + break; + } + + drm_dp_put_mst_branch_devic...
2019 Jan 10
21
[PATCH v6 00/20] MST refcounting/atomic helpers cleanup
This is the series I've been working on for a while now to get all of the atomic DRM drivers in the tree to use the atomic MST helpers, and to make the atomic MST helpers actually idempotent. Turns out it's a lot more difficult to do that without also fixing how port and branch device refcounting works so that it actually makes sense, since the current upstream implementation requires a
2019 Jan 03
16
[PATCH v3 00/16] MST refcounting/atomic helpers cleanup
This is the series I've been working on for a while now to get all of the atomic DRM drivers in the tree to use the atomic MST helpers, and to make the atomic MST helpers actually idempotent. Turns out it's a lot more difficult to do that without also fixing how port and branch device refcounting works so that it actually makes sense, since the current upstream implementation requires a
2018 Nov 26
4
[PATCH v6 3/6] drm/dp_mst: Start tracking per-port VCPI allocations
...dp_vcpi_allocation *pos, *vcpi = NULL; > + int prev_slots, req_slots, ret; > > topology_state = drm_atomic_get_mst_topology_state(state, mgr); > if (IS_ERR(topology_state)) > @@ -2640,20 +2661,60 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state, > port = drm_dp_get_validated_port_ref(mgr, port); > if (port == NULL) > return -EINVAL; > - req_slots = DIV_ROUND_UP(pbn, mgr->pbn_div); > - DRM_DEBUG_KMS("vcpi slots req=%d, avail=%d\n", > - req_slots, topology_state->avail_slots); > > - if (req_slots > topology_state->avail_slots) {...
2018 Nov 16
0
[PATCH v6 3/6] drm/dp_mst: Start tracking per-port VCPI allocations
...- int req_slots; + struct drm_dp_vcpi_allocation *pos, *vcpi = NULL; + int prev_slots, req_slots, ret; topology_state = drm_atomic_get_mst_topology_state(state, mgr); if (IS_ERR(topology_state)) @@ -2640,20 +2661,60 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state, port = drm_dp_get_validated_port_ref(mgr, port); if (port == NULL) return -EINVAL; - req_slots = DIV_ROUND_UP(pbn, mgr->pbn_div); - DRM_DEBUG_KMS("vcpi slots req=%d, avail=%d\n", - req_slots, topology_state->avail_slots); - if (req_slots > topology_state->avail_slots) { - drm_dp_put_port(port); - retur...
2018 Nov 29
1
[PATCH v6 3/6] drm/dp_mst: Start tracking per-port VCPI allocations
...> > > > > mgr); > > > > > > > if (IS_ERR(topology_state)) > > > > > > > @@ -2640,20 +2661,60 @@ int drm_dp_atomic_find_vcpi_slots(struct > > > > > > > drm_atomic_state *state, > > > > > > > port = drm_dp_get_validated_port_ref(mgr, port); > > > > > > > if (port == NULL) > > > > > > > return -EINVAL; > > > > > > > - req_slots = DIV_ROUND_UP(pbn, mgr->pbn_div); > > > > > > > - DRM_DEBUG_KMS("vcpi slots req=%d, avail=%d\n",...
2019 Jan 09
0
[PATCH v5 04/20] drm/dp_mst: Fix some formatting in drm_dp_mst_deallocate_vcpi()
...@mgr: manager for this port * @port: unverified port to deallocate vcpi for */ -void drm_dp_mst_deallocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port) +void drm_dp_mst_deallocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, + struct drm_dp_mst_port *port) { port = drm_dp_get_validated_port_ref(mgr, port); if (!port) -- 2.20.1
2018 Oct 23
0
[PATCH 4/6] drm/dp_mst: Start tracking per-port VCPI allocations
...- int req_slots; + struct drm_dp_vcpi_allocation *pos, *vcpi = NULL; + int prev_slots, req_slots, ret; topology_state = drm_atomic_get_mst_topology_state(state, mgr); if (IS_ERR(topology_state)) @@ -2637,20 +2649,41 @@ int drm_dp_atomic_find_vcpi_slots(struct drm_atomic_state *state, port = drm_dp_get_validated_port_ref(mgr, port); if (port == NULL) return -EINVAL; - req_slots = DIV_ROUND_UP(pbn, mgr->pbn_div); - DRM_DEBUG_KMS("vcpi slots req=%d, avail=%d\n", - req_slots, topology_state->avail_slots); - if (req_slots > topology_state->avail_slots) { - drm_dp_put_port(port); - retur...