RE: [PATCH v16 3/5] drm: renesas: Add RZ/G2L DU Support

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

 



Hi Maxime Ripard,

Thanks for the feedback.

> -----Original Message-----
> From: Maxime Ripard <mripard@xxxxxxxxxx>
> Sent: Friday, February 9, 2024 3:07 PM
> Subject: Re: [PATCH v16 3/5] drm: renesas: Add RZ/G2L DU Support
> 
> On Mon, Jan 22, 2024 at 04:42:55PM +0000, Biju Das wrote:
> > +static const struct drm_gem_object_funcs rzg2l_du_gem_funcs = {
> > +	.free = drm_gem_dma_object_free,
> > +	.print_info = drm_gem_dma_object_print_info,
> > +	.get_sg_table = drm_gem_dma_object_get_sg_table,
> > +	.vmap = drm_gem_dma_object_vmap,
> > +	.mmap = drm_gem_dma_object_mmap,
> > +	.vm_ops = &drm_gem_dma_vm_ops,
> > +};
> > +
> > +struct drm_gem_object *
> > +rzg2l_du_gem_prime_import_sg_table(struct drm_device *dev,
> > +				   struct dma_buf_attachment *attach,
> > +				   struct sg_table *sgt)
> > +{
> > +	struct drm_gem_dma_object *dma_obj;
> > +	struct drm_gem_object *gem_obj;
> > +	int ret;
> > +
> > +	/* Create a DMA GEM buffer. */
> > +	dma_obj = kzalloc(sizeof(*dma_obj), GFP_KERNEL);
> > +	if (!dma_obj)
> > +		return ERR_PTR(-ENOMEM);
> > +
> > +	gem_obj = &dma_obj->base;
> > +	gem_obj->funcs = &rzg2l_du_gem_funcs;
> > +
> > +	drm_gem_private_object_init(dev, gem_obj, attach->dmabuf->size);
> > +	dma_obj->map_noncoherent = false;
> > +
> > +	ret = drm_gem_create_mmap_offset(gem_obj);
> > +	if (ret) {
> > +		drm_gem_object_release(gem_obj);
> > +		kfree(dma_obj);
> > +		return ERR_PTR(ret);
> > +	}
> > +
> > +	dma_obj->dma_addr = 0;
> > +	dma_obj->sgt = sgt;
> > +
> > +	return gem_obj;
> > +}
> 
> It looks like you're just reusing the helpers there, why do you need to
> declare a new import_sg_table implementation?

It is not needed. I will remove it in the next version.

Cheers,
Biju




[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