Re: [PATCH v4 3/9] drm/panfrost: Restructure the GEM object creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/08/2019 23:21, Rob Herring wrote:
> Setting the GPU VA when creating the GEM object doesn't allow for any
> conditional adjustments to the mapping. In preparation to support
> adjusting the mapping and per FD address spaces, restructure the GEM
> object creation to map and unmap the GEM object in the GEM object .open()
> and .close() hooks.
> 
> While panfrost_gem_free_object() and panfrost_gem_prime_import_sg_table()
> are not really needed after this commit, keep them as we'll need them in
> subsequent commits.
> 
> Cc: Tomeu Vizoso <tomeu.vizoso@xxxxxxxxxxxxx>
> Cc: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
> Cc: Robin Murphy <robin.murphy@xxxxxxx>
> Reviewed-by: Steven Price <steven.price@xxxxxxx>
> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@xxxxxxxxxxxxx>
> Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
> ---
> Steven, Alyssa, I kept your tags, but please take another look as things
> moved around a bit here.

Sadly this doesn't compile (bisection is broken), see below:

>  drivers/gpu/drm/panfrost/panfrost_drv.c |  9 ----
>  drivers/gpu/drm/panfrost/panfrost_gem.c | 67 ++++++++++++++-----------
>  2 files changed, 37 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
> index 926d021ee202..2894cfbbce2b 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_drv.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
> @@ -78,7 +78,6 @@ static int panfrost_ioctl_get_param(struct drm_device *ddev, void *data, struct
>  static int panfrost_ioctl_create_bo(struct drm_device *dev, void *data,
>  		struct drm_file *file)
>  {
> -	int ret;
>  	struct drm_gem_shmem_object *shmem;
>  	struct drm_panfrost_create_bo *args = data;
> 
> @@ -90,17 +89,9 @@ static int panfrost_ioctl_create_bo(struct drm_device *dev, void *data,
>  	if (IS_ERR(shmem))
>  		return PTR_ERR(shmem);
> 
> -	ret = panfrost_mmu_map(to_panfrost_bo(&shmem->base));
> -	if (ret)
> -		goto err_free;
> -
>  	args->offset = to_panfrost_bo(&shmem->base)->node.start << PAGE_SHIFT;
> 
>  	return 0;
> -
> -err_free:
> -	drm_gem_handle_delete(file, args->handle);
> -	return ret;
>  }
> 
>  /**
> diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c
> index 67d374184340..3933f83ba6b0 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_gem.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c
> @@ -15,6 +15,39 @@
>   * BO.
>   */
>  static void panfrost_gem_free_object(struct drm_gem_object *obj)
> +{
> +	mutex_lock(&pfdev->shrinker_lock);
> +	if (!list_empty(&bo->base.madv_list))
> +		list_del(&bo->base.madv_list);
> +	mutex_unlock(&pfdev->shrinker_lock);
> +
> +	drm_gem_shmem_free_object(obj);
> +}

'pfdev' and 'bo' have't been defined yet.

Steve
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux