[Mesa-dev] [PATCH] winsys/radeon: fix warnings about incompatible pointer types

Marek Olšák maraeo at gmail.com
Tue Jan 12 09:42:12 PST 2016


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Tue, Jan 12, 2016 at 6:29 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> Some confusion between pb_buffer and radeon_bo as well as between
> radeon_drm_winsys and radeon_winsys.
> ---
>  src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
> index ee61e54..e35d280 100644
> --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
> +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
> @@ -582,7 +582,7 @@ static struct radeon_bo *radeon_create_bo(struct radeon_drm_winsys *rws,
>
>              pipe_mutex_unlock(rws->bo_handles_mutex);
>              pb_reference(&b, &old_bo->base);
> -            return b;
> +            return radeon_bo(b);
>          }
>
>          util_hash_table_set(rws->bo_vas, (void*)(uintptr_t)bo->va, bo);
> @@ -594,7 +594,7 @@ static struct radeon_bo *radeon_create_bo(struct radeon_drm_winsys *rws,
>      else if (initial_domains & RADEON_DOMAIN_GTT)
>          rws->allocated_gtt += align(size, rws->size_align);
>
> -    return &bo->base;
> +    return bo;
>  }
>
>  bool radeon_bo_can_reclaim(struct pb_buffer *_buf)
> @@ -768,9 +768,9 @@ radeon_winsys_bo_create(struct radeon_winsys *rws,
>      usage |= 1 << (flags + 3);
>
>      if (use_reusable_pool) {
> -        bo = pb_cache_reclaim_buffer(&ws->bo_cache, size, alignment, usage);
> +        bo = radeon_bo(pb_cache_reclaim_buffer(&ws->bo_cache, size, alignment, usage));
>          if (bo)
> -            return bo;
> +            return &bo->base;
>      }
>
>      bo = radeon_create_bo(ws, size, alignment, usage, domain, flags);
> @@ -837,7 +837,7 @@ static struct pb_buffer *radeon_winsys_bo_from_ptr(struct radeon_winsys *rws,
>      if (ws->info.r600_virtual_address) {
>          struct drm_radeon_gem_va va;
>
> -        bo->va = radeon_bomgr_find_va(rws, bo->base.size, 1 << 20);
> +        bo->va = radeon_bomgr_find_va(ws, bo->base.size, 1 << 20);
>
>          va.handle = bo->handle;
>          va.operation = RADEON_VA_MAP;
> @@ -969,7 +969,7 @@ done:
>      if (ws->info.r600_virtual_address && !bo->va) {
>          struct drm_radeon_gem_va va;
>
> -        bo->va = radeon_bomgr_find_va(rws, bo->base.size, 1 << 20);
> +        bo->va = radeon_bomgr_find_va(ws, bo->base.size, 1 << 20);
>
>          va.handle = bo->handle;
>          va.operation = RADEON_VA_MAP;
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list