[PATCH v2] drm/panfrost: Document base field location constraint in panfrost_gem_object

Alyssa Rosenzweig alyssa.rosenzweig at collabora.com
Fri Nov 29 14:16:59 UTC 2019


Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>

On Fri, Nov 29, 2019 at 02:56:14PM +0100, Boris Brezillon wrote:
> I've spent hours chasing a memory corruption that was caused by
> insertion of an extra field field before ->base. Let's document the
> fact that base has to be the first field in panfrost_gem_object.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
> ---
> Changes in v2:
> * Use the proper prefix in the subject line
> ---
>  drivers/gpu/drm/panfrost/panfrost_gem.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.h b/drivers/gpu/drm/panfrost/panfrost_gem.h
> index b3517ff9630c..d480261fc177 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_gem.h
> +++ b/drivers/gpu/drm/panfrost/panfrost_gem.h
> @@ -10,6 +10,10 @@
>  struct panfrost_mmu;
>  
>  struct panfrost_gem_object {
> +	/*
> +	 * Must be the first element because we're using some of the
> +	 * drm_gem_shmem helpers.
> +	 */
>  	struct drm_gem_shmem_object base;
>  	struct sg_table *sgts;
>  
> -- 
> 2.23.0
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20191129/297e1275/attachment.sig>


More information about the dri-devel mailing list