From: Lyude Paul <lyude@redhat.com>
To: David Francis <David.Francis@amd.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 4/5] drm/dp-mst: Fill branch->num_ports
Date: Thu, 22 Aug 2019 17:55:48 -0400 [thread overview]
Message-ID: <797d5a92cbcf2f3de9e2ee6be92e34a2d26f1bcb.camel@redhat.com> (raw)
In-Reply-To: <20190822135741.12923-5-David.Francis@amd.com>
On Thu, 2019-08-22 at 09:57 -0400, David Francis wrote:
> This field on drm_dp_mst_branch was never filled
>
> Initialize it to zero when the list of ports is created.
> When a port is added to the list, increment num_ports,
> and when a port is removed from the list, decrement num_ports.
>
> v2: remember to decrement on port removal
>
> Signed-off-by: David Francis <David.Francis@amd.com>
> Reviewed-by: Lyude Paul <lyude@redhat.com>
> ---
> drivers/gpu/drm/drm_dp_mst_topology.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 50a044718439..af4b5cec7c84 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -919,6 +919,7 @@ static struct drm_dp_mst_branch
> *drm_dp_add_mst_branch_device(u8 lct, u8 *rad)
> INIT_LIST_HEAD(&mstb->ports);
> kref_init(&mstb->topology_kref);
> kref_init(&mstb->malloc_kref);
> + mstb->num_ports = 0;
Just realized as well, we can drop the mstb->num_ports = 0; here, since we're
allocating the struct with kzalloc()
> return mstb;
> }
>
> @@ -1669,6 +1670,7 @@ static void drm_dp_add_port(struct drm_dp_mst_branch
> *mstb,
> mutex_lock(&mstb->mgr->lock);
> drm_dp_mst_topology_get_port(port);
> list_add(&port->next, &mstb->ports);
> + mstb->num_ports++;
> mutex_unlock(&mstb->mgr->lock);
> }
>
> @@ -1703,6 +1705,7 @@ static void drm_dp_add_port(struct drm_dp_mst_branch
> *mstb,
> /* remove it from the port list */
> mutex_lock(&mstb->mgr->lock);
> list_del(&port->next);
> + mstb->num_ports--;
> mutex_unlock(&mstb->mgr->lock);
> /* drop port list reference */
> drm_dp_mst_topology_put_port(port);
--
Cheers,
Lyude Paul
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-08-22 21:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-22 13:57 [PATCH v4 0/5] MST DSC support in drm-mst David Francis
2019-08-22 13:57 ` [PATCH v4 1/5] drm/dp-mst: Add PBN calculation for DSC modes David Francis
2019-08-22 21:42 ` Lyude Paul
2019-08-22 13:57 ` [PATCH v4 2/5] drm/dp-mst: Parse FEC capability on MST ports David Francis
2019-08-22 13:57 ` [PATCH v4 3/5] drm/dp-mst: Add MST support to DP DPCD R/W functions David Francis
2019-08-22 21:54 ` Lyude Paul
2019-08-22 13:57 ` [PATCH v4 4/5] drm/dp-mst: Fill branch->num_ports David Francis
2019-08-22 21:55 ` Lyude Paul [this message]
2019-08-22 13:57 ` [PATCH v4 5/5] drm/dp-mst: Add helpers for querying and enabling MST DSC David Francis
2019-08-22 23:49 ` Lyude Paul
2019-08-22 21:39 ` [PATCH v4 0/5] MST DSC support in drm-mst Lyude Paul
2019-08-23 0:03 ` Lyude Paul
2019-08-23 20:24 ` Francis, David
2019-08-26 19:50 ` Dave Airlie
2019-08-26 21:12 ` Harry Wentland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=797d5a92cbcf2f3de9e2ee6be92e34a2d26f1bcb.camel@redhat.com \
--to=lyude@redhat.com \
--cc=David.Francis@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox