Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5e55187 authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/nvif: allow userspace access to its own client object



Regression from "abi16: implement limited interoperability with
usif/nvif".

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 0d7fc246
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@

#include <nvif/client.h>
#include <nvif/device.h>
#include <nvif/ioctl.h>

#include <drmP.h>

@@ -65,9 +66,10 @@ struct nouveau_drm_tile {
};

enum nouveau_drm_object_route {
	NVDRM_OBJECT_NVIF = 0,
	NVDRM_OBJECT_NVIF = NVIF_IOCTL_V0_OWNER_NVIF,
	NVDRM_OBJECT_USIF,
	NVDRM_OBJECT_ABI16,
	NVDRM_OBJECT_ANY = NVIF_IOCTL_V0_OWNER_ANY,
};

enum nouveau_drm_notify_route {
+4 −1
Original line number Diff line number Diff line
@@ -313,6 +313,9 @@ usif_ioctl(struct drm_file *filp, void __user *user, u32 argc)
	if (nvif_unpack(argv->v0, 0, 0, true)) {
		/* block access to objects not created via this interface */
		owner = argv->v0.owner;
		if (argv->v0.object == 0ULL)
			argv->v0.owner = NVDRM_OBJECT_ANY; /* except client */
		else
			argv->v0.owner = NVDRM_OBJECT_USIF;
	} else
		goto done;