[PATCH v5 11/14] drm/panthor: Add the driver frontend block
Boris Brezillon
boris.brezillon at collabora.com
Thu Feb 29 09:11:16 UTC 2024
On Sun, 18 Feb 2024 22:41:25 +0100
Boris Brezillon <boris.brezillon at collabora.com> wrote:
> +static int panthor_ioctl_bo_create(struct drm_device *ddev, void *data,
> + struct drm_file *file)
> +{
> + struct panthor_file *pfile = file->driver_priv;
> + struct drm_panthor_bo_create *args = data;
> + struct panthor_vm *vm = NULL;
> + int cookie, ret;
> +
> + if (!drm_dev_enter(ddev, &cookie))
> + return -ENODEV;
> +
> + if (!args->size || args->pad ||
> + (args->flags & ~PANTHOR_BO_FLAGS)) {
> + ret = -EINVAL;
> + goto out_dev_exit;
> + }
> +
> + if (args->exclusive_vm_id) {
> + vm = panthor_vm_pool_get_vm(pfile->vms, args->exclusive_vm_id);
> + if (!vm) {
> + ret = -EINVAL;
> + goto out_dev_exit;
> + }
> + }
> +
> + ret = panthor_gem_create_with_handle(file, ddev, vm, args->size,
> + args->flags, &args->handle);
Despite what's stated in the uAPI doc, we never update args->size to
make it page-aligned. We need to change
panthor_gem_create_with_handle()'s prototype to take the size as an 'u64
*' so we can reflect the page-size alignment done by the BO allocation
logic.
Will send a v6 with this fix and the other 2 fixes for the bugs I
reported previously.
More information about the dri-devel
mailing list