lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6bf1a372bfe9b4849138ecf7800b5758049f3bd9.camel@collabora.com>
Date:   Wed, 02 Jan 2019 14:10:12 -0300
From:   Ezequiel Garcia <ezequiel@...labora.com>
To:     Gerd Hoffmann <kraxel@...hat.com>, dri-devel@...ts.freedesktop.org,
        David Airlie <airlied@...hat.com>
Cc:     David Airlie <airlied@...ux.ie>,
        open list <linux-kernel@...r.kernel.org>,
        "open list:VIRTIO GPU DRIVER" 
        <virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH 03/10] drm/virtio: drop virtio_gpu_fence_cleanup()

On Wed, 2018-12-19 at 13:27 +0100, Gerd Hoffmann wrote:
> Just call drm_fence_put directly instead.
> Also set vgfb->fence to NULL after dropping the reference.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>
> ---
>  drivers/gpu/drm/virtio/virtgpu_drv.h   | 1 -
>  drivers/gpu/drm/virtio/virtgpu_fence.c | 8 --------
>  drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +-
>  drivers/gpu/drm/virtio/virtgpu_plane.c | 6 ++++--
>  4 files changed, 5 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
> index 63704915f8..bfb31fc3d0 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_drv.h
> +++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
> @@ -337,7 +337,6 @@ int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma);
>  /* virtio_gpu_fence.c */
>  struct virtio_gpu_fence *virtio_gpu_fence_alloc(
>  	struct virtio_gpu_device *vgdev);
> -void virtio_gpu_fence_cleanup(struct virtio_gpu_fence *fence);
>  int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
>  			  struct virtio_gpu_ctrl_hdr *cmd_hdr,
>  			  struct virtio_gpu_fence *fence);
> diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c
> index 4d6826b278..21bd4c4a32 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_fence.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_fence.c
> @@ -81,14 +81,6 @@ struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device *vgdev)
>  	return fence;
>  }
>  
> -void virtio_gpu_fence_cleanup(struct virtio_gpu_fence *fence)
> -{
> -	if (!fence)
> -		return;
> -
> -	dma_fence_put(&fence->f);
> -}
> -
>  int virtio_gpu_fence_emit(struct virtio_gpu_device *vgdev,
>  			  struct virtio_gpu_ctrl_hdr *cmd_hdr,
>  			  struct virtio_gpu_fence *fence)
> diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> index 161b80fee4..14ce8188c0 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
> @@ -351,7 +351,7 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data,
>  		virtio_gpu_cmd_resource_create_3d(vgdev, qobj, &rc_3d);
>  		ret = virtio_gpu_object_attach(vgdev, qobj, fence);
>  		if (ret) {
> -			virtio_gpu_fence_cleanup(fence);
> +			dma_fence_put(&fence->f);
>  			goto fail_backoff;
>  		}
>  		ttm_eu_fence_buffer_objects(&ticket, &validate_list, &fence->f);
> diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
> index 548265b8e8..024c2aa0c9 100644
> --- a/drivers/gpu/drm/virtio/virtgpu_plane.c
> +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
> @@ -169,8 +169,10 @@ static void virtio_gpu_cursor_cleanup_fb(struct drm_plane *plane,
>  		return;
>  
>  	vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
> -	if (vgfb->fence)
> -		virtio_gpu_fence_cleanup(vgfb->fence);
> +	if (vgfb->fence) {
> +		dma_fence_put(&vgfb->fence->f);
> +		vgfb->fence = NULL;
> +	}
>  }
>  
>  static void virtio_gpu_cursor_plane_update(struct drm_plane *plane,

Reviewed-by: Ezequiel Garcia <ezequiel@...labora.com>

Regards,
Ezequiel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ