From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 1/4] drm: Define drm_mm_for_each_node_in_range()
Date: Thu, 17 Nov 2016 15:56:36 +0200 [thread overview]
Message-ID: <1479390996.2946.9.camel@linux.intel.com> (raw)
In-Reply-To: <20161117120844.27340-1-chris@chris-wilson.co.uk>
On to, 2016-11-17 at 12:08 +0000, Chris Wilson wrote:
> Some clients would like to iterate over every node within a certain
> range. Make a nice little macro for them to hide the mixing of the
> rbtree search and linear walk.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: dri-devel@lists.freedesktop.org
>
<SNIP>
>
> @@ -174,19 +174,12 @@ INTERVAL_TREE_DEFINE(struct drm_mm_node, rb,
> START, LAST, static inline, drm_mm_interval_tree)
>
> struct drm_mm_node *
> -drm_mm_interval_first(struct drm_mm *mm, u64 start, u64 last)
> +__drm_mm_interval_first(struct drm_mm *mm, u64 start, u64 last)
> {
> return drm_mm_interval_tree_iter_first(&mm->interval_tree,
> start, last);
> }
> -EXPORT_SYMBOL(drm_mm_interval_first);
> -
> -struct drm_mm_node *
> -drm_mm_interval_next(struct drm_mm_node *node, u64 start, u64 last)
> -{
> - return drm_mm_interval_tree_iter_next(node, start, last);
> -}
> -EXPORT_SYMBOL(drm_mm_interval_next);
These were introduced by you so I guess the reason for them ceased to
exist, so the removal should not hurt anybody.
> +EXPORT_SYMBOL(__drm_mm_interval_first);
>
> static void drm_mm_interval_tree_add_node(struct drm_mm_node *hole_node,
> struct drm_mm_node *node)
> diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
> index 41ddafe92b2f..fca5f313cf18 100644
> --- a/include/drm/drm_mm.h
> +++ b/include/drm/drm_mm.h
> @@ -308,10 +308,12 @@ void drm_mm_takedown(struct drm_mm *mm);
> bool drm_mm_clean(struct drm_mm *mm);
>
> struct drm_mm_node *
> -drm_mm_interval_first(struct drm_mm *mm, u64 start, u64 last);
> +__drm_mm_interval_first(struct drm_mm *mm, u64 start, u64 last);
>
> -struct drm_mm_node *
> -drm_mm_interval_next(struct drm_mm_node *node, u64 start, u64 last);
> +#define drm_mm_for_each_node_in_range(node, mm, start, end) \
> + for (node = __drm_mm_interval_first((mm), (start), (end)-1); \
> + node && node->start < (end); \
> + node = list_next_entry(node, node_list)) \
Drop a quick kerneldoc for this. It's almost ready in the commit message.
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-11-17 13:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 12:08 [PATCH v2 1/4] drm: Define drm_mm_for_each_node_in_range() Chris Wilson
2016-11-17 12:08 ` [PATCH v2 2/4] drm: Check against color expansion in drm_mm_reserve_node() Chris Wilson
2016-11-17 13:20 ` Joonas Lahtinen
2016-11-17 12:08 ` [PATCH v2 3/4] drm/i915: Mark all non-vma being inserted into the address spaces Chris Wilson
2016-11-17 13:31 ` Joonas Lahtinen
2016-11-17 14:12 ` Chris Wilson
2016-11-18 9:05 ` Chris Wilson
2016-11-18 9:55 ` Joonas Lahtinen
2016-11-17 12:08 ` [PATCH v2 4/4] drm/i915: Fix i915_gem_evict_for_vma (soft-pinning) Chris Wilson
2016-11-18 9:18 ` Joonas Lahtinen
2016-11-18 10:14 ` Chris Wilson
2016-11-18 11:31 ` Joonas Lahtinen
2016-11-18 12:06 ` Chris Wilson
2016-11-18 12:14 ` Chris Wilson
2016-11-17 12:46 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/4] drm: Define drm_mm_for_each_node_in_range() Patchwork
2016-11-17 13:56 ` Joonas Lahtinen [this message]
2016-11-17 14:49 ` [PATCH] " Chris Wilson
2016-11-18 8:43 ` Joonas Lahtinen
2016-11-17 16:53 ` ✗ Fi.CI.BAT: failure for series starting with drm: Define drm_mm_for_each_node_in_range() (rev2) Patchwork
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=1479390996.2946.9.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.