Re: [PATCH] drm/virtio: support mapping exported vram

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

 



  Hi,

> +static struct sg_table *virtgpu_gem_map_dma_buf(
> +		struct dma_buf_attachment *attach,
> +		enum dma_data_direction dir)

checkpatch doesn't like that:

-:47: CHECK:OPEN_ENDED_LINE: Lines should not end with a '('
#47: FILE: drivers/gpu/drm/virtio/virtgpu_prime.c:46:
+static struct sg_table *virtgpu_gem_map_dma_buf(

> +{
> +	struct drm_gem_object *obj = attach->dmabuf->priv;
> +	struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj);
> +
> +	if (virtio_gpu_is_vram(bo))
> +		return virtio_gpu_vram_map_dma_buf(bo, attach->dev, dir);
> +
> +	return drm_gem_map_dma_buf(attach, dir);
> +}
> +
> +static void virtgpu_gem_unmap_dma_buf(struct dma_buf_attachment *attach,
> +				      struct sg_table *sgt,
> +				      enum dma_data_direction dir)
> +{
> +	struct drm_gem_object *obj = attach->dmabuf->priv;
> +	struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj);
> +
> +	if (virtio_gpu_is_vram(bo))
> +		virtio_gpu_vram_unmap_dma_buf(attach->dev, sgt, dir);
> +	else
> +		drm_gem_unmap_dma_buf(attach, sgt, dir);
> +}

Minor nit:  Can we use the same logic in both functions?  I like the
virtgpu_gem_map_dma_buf variant (without else) more.

Otherwise looks sane to me.

thanks,
  Gerd




[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