Re: [PATCH 71/72] drm: generalized *_bo_create_for_name()

Chris Wilson <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On Tue, Dec 29, 2015 at 10:17:49AM +0100, Enrico Weigelt, metux IT consult wrote:
> Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
> ---
>  src/drm/cairo-drm-bo.c             | 20 ++++++++++++++++++++
>  src/drm/cairo-drm-private.h        |  3 +++
>  src/drm/cairo-drm-radeon-private.h |  3 ---
>  src/drm/cairo-drm-radeon-surface.c |  3 +--
>  src/drm/cairo-drm-radeon.c         | 21 ---------------------
>  5 files changed, 24 insertions(+), 26 deletions(-)
> 
> diff --git a/src/drm/cairo-drm-bo.c b/src/drm/cairo-drm-bo.c
> index 532700e..957d0bf 100644
> --- a/src/drm/cairo-drm-bo.c
> +++ b/src/drm/cairo-drm-bo.c
> @@ -114,3 +114,23 @@ _cairo_drm_bo_unmap (cairo_drm_bo_t *bo)
>      munmap (bo->mapped, bo->size);
>      bo->mapped = NULL;
>  }
> +
> +cairo_drm_bo_t *
> +_cairo_drm_bo_create_for_name (cairo_drm_device_t *device,
> +			       uint32_t name)
> +{
> +    cairo_status_t status;
> +    cairo_drm_bo_t *bo = _cairo_drm_bo_from_pool (device);

There is no indication in _cairo_drm_bo_from_pool() about what it
actually does; it returns a bo from a pool of bo. What pool? Why is it
safe to overwrite it with a new name/handle? What happens if the pool is
empty?

_cairo_drm_bo_create(),
_cairo_drm_bo_alloc() <- probably the better name
_cairo_drm_bo_new()

And you also want a corresponding function to hide the release into the
freepool afterwards.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.