[PATCH v16 3/5] drm: renesas: Add RZ/G2L DU Support
Maxime Ripard
mripard at kernel.org
Fri Feb 9 15:07:14 UTC 2024
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?
Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20240209/49c131ea/attachment.sig>
More information about the dri-devel
mailing list