[PATCH 4/8] drm/amdgpu: shadow and mn list are mutal exclusive

Deucher, Alexander Alexander.Deucher at amd.com
Thu Jul 27 17:39:53 UTC 2017


> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
> Of Christian König
> Sent: Thursday, July 27, 2017 11:44 AM
> To: amd-gfx at lists.freedesktop.org
> Subject: [PATCH 4/8] drm/amdgpu: shadow and mn list are mutal exclusive

mutually

> 
> From: Christian König <christian.koenig at amd.com>
> 
> Save some memory because only on of those is used at all times.

one

> 
> TODO: Should we use an union here or just a single field?

I think the union is better since it makes it clear when we use each version.  With the above fixes:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> 
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> index a401fe3..3b92d52 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> @@ -87,8 +87,11 @@ struct amdgpu_bo {
> 
>  	struct ttm_bo_kmap_obj		dma_buf_vmap;
>  	struct amdgpu_mn		*mn;
> -	struct list_head		mn_list;
> -	struct list_head		shadow_list;
> +
> +	union {
> +		struct list_head	mn_list;
> +		struct list_head	shadow_list;
> +	};
>  };
> 
>  /**
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list