Skip to contentSkip to conversation

libdrm: Allow dynamic drm majors on linux

PATCH In review Thomas Hellstrom 11 participants 25 messages Aug 31, 2018 – Oct 4, 2018 14 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libdrm: Allow dynamic drm majors on linux

To determine whether a device node is a drm device node or not, the code currently compares the node's major number to the static drm major device number.

This breaks the standalone vmwgfx driver on XWayland dri clients,
https://cgit.freedesktop.org/mesa/vmwgfx
and any future attempt to introduce dynamic device numbers for drm.

So instead of checking for the device major, instead check for the presence of the /sys/dev/char/<major>:<minor>/device/drm directory.

---
 xf86drm.c | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)
xf86drm.c +23 -8
index 7807dce9..4cfc5d3e 100644
@@ -2761,6 +2761,21 @@ char *drmGetDeviceNameFromFd(int fd)
     return strdup(name);
 }
 
+static bool
+drmNodeIsDRM(int maj, int min)
+{
+#ifdef __linux__
+  char path[64];
+  struct stat sbuf;
+
+  snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device/drm",
+	   maj, min);
+  return stat(path, &sbuf) == 0;
+#else
+  return maj == DRM_MAJOR;
+#endif
+}
+
 int drmGetNodeTypeFromFd(int fd)
 {
     struct stat sbuf;
@@ -2772,7 +2787,7 @@ int drmGetNodeTypeFromFd(int fd)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) {
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode)) {
         errno = EINVAL;
         return -1;
     }
@@ -2837,7 +2852,7 @@ static char *drmGetMinorNameForFD(int fd, int type)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return NULL;
 
     snprintf(buf, sizeof(buf), "/sys/dev/char/%d:%d/device/drm", maj, min);
@@ -2871,7 +2886,7 @@ static char *drmGetMinorNameForFD(int fd, int type)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return NULL;
 
     switch (type) {
@@ -3731,7 +3746,7 @@ process_device(drmDevicePtr *device, const char *d_name,
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return -1;
 
     subsystem_type = drmParseSubsystemType(maj, min);
@@ -3845,7 +3860,7 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return -EINVAL;
 
     node_type = drmGetMinorType(min);
@@ -3911,7 +3926,7 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return -EINVAL;
 
     subsystem_type = drmParseSubsystemType(maj, min);
@@ -4071,7 +4086,7 @@ char *drmGetDeviceNameFromFd2(int fd)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return NULL;
 
     snprintf(path, sizeof(path), "/sys/dev/char/%d:%d", maj, min);
@@ -4097,7 +4112,7 @@ char *drmGetDeviceNameFromFd2(int fd)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return NULL;
 
     node_type = drmGetMinorType(min);
Signature · 6 lines
2.18.0.rc1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code currently compares the node's major number to the static drm major device number.

This breaks the standalone vmwgfx driver on XWayland dri clients,
https://cgit.freedesktop.org/mesa/vmwgfx
and any future attempt to introduce dynamic device numbers for drm.

So instead of checking for the device major, instead check for the presence of the /sys/dev/char/<major>:<minor>/device/drm directory.

Just FYI, this means it now matches /dev/fb0 too.

I don't think this will be an issue, but just pointing it out so people notice.

Quoted 13 lines
---
 xf86drm.c | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)
xf86drm.c +0 -0
index 7807dce9..4cfc5d3e 100644
@@ -2761,6 +2761,21 @@ char *drmGetDeviceNameFromFd(int fd)
     return strdup(name);
 }

xf86drm.c char *drmGetDeviceNameFromFd(int fd) · line 2772

Quoted 10 lines
xf86drm.c +9 -0
 
+static bool
+drmNodeIsDRM(int maj, int min)
+{
+#ifdef __linux__
+  char path[64];
+  struct stat sbuf;
+
+  snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device/drm",
+	   maj, min);

Nit: mixing tabs and space on this line.

With that fixed:

Quoted 88 lines
xf86drm.c +14 -8
+  return stat(path, &sbuf) == 0;
+#else
+  return maj == DRM_MAJOR;
+#endif
+}
+
 int drmGetNodeTypeFromFd(int fd)
 {
     struct stat sbuf;
@@ -2772,7 +2787,7 @@ int drmGetNodeTypeFromFd(int fd)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) {
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode)) {
         errno = EINVAL;
         return -1;
     }
@@ -2837,7 +2852,7 @@ static char *drmGetMinorNameForFD(int fd, int type)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return NULL;
 
     snprintf(buf, sizeof(buf), "/sys/dev/char/%d:%d/device/drm", maj, min);
@@ -2871,7 +2886,7 @@ static char *drmGetMinorNameForFD(int fd, int type)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return NULL;
 
     switch (type) {
@@ -3731,7 +3746,7 @@ process_device(drmDevicePtr *device, const char *d_name,
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return -1;
 
     subsystem_type = drmParseSubsystemType(maj, min);
@@ -3845,7 +3860,7 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return -EINVAL;
 
     node_type = drmGetMinorType(min);
@@ -3911,7 +3926,7 @@ int drmGetDevice2(int fd, uint32_t flags, drmDevicePtr *device)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return -EINVAL;
 
     subsystem_type = drmParseSubsystemType(maj, min);
@@ -4071,7 +4086,7 @@ char *drmGetDeviceNameFromFd2(int fd)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return NULL;
 
     snprintf(path, sizeof(path), "/sys/dev/char/%d:%d", maj, min);
@@ -4097,7 +4112,7 @@ char *drmGetDeviceNameFromFd2(int fd)
     maj = major(sbuf.st_rdev);
     min = minor(sbuf.st_rdev);
 
-    if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode))
+    if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
         return NULL;
 
     node_type = drmGetMinorType(min);
Signature · 6 lines
2.18.0.rc1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to Thomas Hellstrom

Hi Thomas,

Quoted 6 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code currently compares the node's major number to the static drm major device number.

This breaks the standalone vmwgfx driver on XWayland dri clients,
https://cgit.freedesktop.org/mesa/vmwgfx

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Quoted 2 lines

and any future attempt to introduce dynamic device numbers for drm.

I'm not sure how well any such attempt will pan out, regardless of the libdrm checks.

Namely: the static 226 has been used by a number of tools that interpose the libc' ioctl function.
There could be others that also depend on it.

Personally, I'd go with the kernel developers decision.

Dave, Daniel, others
Should we keep or drop the major == 226 checks.

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Hi, Emil

Quoted 11 lines · Emil Velikov

Hi Thomas,

Quoted 6 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code currently compares the node's major number to the static drm major device number.

This breaks the standalone vmwgfx driver on XWayland dri clients,

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 9 lines
Quoted 3 lines

and any future attempt to introduce dynamic device numbers for drm.

I'm not sure how well any such attempt will pan out, regardless of the libdrm checks.

Namely: the static 226 has been used by a number of tools that interpose the libc' ioctl function.
There could be others that also depend on it.

True, in any case for existing drivers changing static 226 to something else is at least 10+ years away according to Linus' policy, so the main issue here is really to get rid of a big annoyance in the standalone vmwgfx case.

/Thomas

Quoted 8 lines

Personally, I'd go with the kernel developers decision.

Dave, Daniel, others
Should we keep or drop the major == 226 checks.

Thanks
Emil

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): bbb94b6f-c9d5-27ab-9e6d-4b4c1d85db8e-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org

#5 lore raw

[ Adding the amd-gfx list ]

Quoted 8 lines · Thomas Hellstrom
Quoted 7 lines · Emil Velikov
Quoted 5 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code currently compares the node's major number to the static drm major device
number.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

This breaks the standalone vmwgfx driver on XWayland dri clients,

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree drm, so standalone vmwgfx is using dynamic major allocation.

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 33fb1ba6-cc44-f747-545b-9f877917933e-otUistvHUpPR7s880joybQ@public.gmane.org

#7 lore raw
Quoted 19 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 8 lines · Thomas Hellstrom
Quoted 7 lines · Emil Velikov
Quoted 5 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code currently compares the node's major number to the static drm major device
number.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

This breaks the standalone vmwgfx driver on XWayland dri clients,

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 7 lines

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Is standalone AMD supposed to be able to coexist with in-tree drm drivers?

/Thomas

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): e656d26a-be98-cc9c-7962-fd74ad226c60-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org

#9 lore raw
Quoted 21 lines · Thomas Hellstrom
Quoted 20 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 17 lines · Thomas Hellstrom
Quoted 8 lines · Emil Velikov
Quoted 6 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code
currently compares the node's major number to the static drm major device
number.

Quoted 4 lines
Quoted 2 lines

This breaks the standalone vmwgfx driver on XWayland dri clients,

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 8 lines
Quoted 7 lines

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Is standalone AMD supposed to be able to coexist with in-tree drm drivers?

Yes, it does, it's working e.g. on laptops with an Intel integrated and an AMD discrete GPU.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 6d78b948-55bc-3adf-f8c0-691aa80a8bb2-otUistvHUpPR7s880joybQ@public.gmane.org

#11 lore raw
Quoted 29 lines · Michel Dänzer
Quoted 28 lines · Thomas Hellstrom
Quoted 27 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 9 lines · Thomas Hellstrom
Quoted 8 lines · Emil Velikov
Quoted 6 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code
currently compares the node's major number to the static drm major device
number.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

This breaks the standalone vmwgfx driver on XWayland dri clients,

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree drm, so standalone vmwgfx is using dynamic major allocation.

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Quoted 5 lines
Quoted 1 line

Is standalone AMD supposed to be able to coexist with in-tree drm drivers?

Yes, it does, it's working e.g. on laptops with an Intel integrated and an AMD discrete GPU.

Hmm. The symptoms with xf86-video-vmware are that when mesa initializes, we get:
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information

but then vmwgfx_dri.so loads anyway.

With XWayland, mesa just silently tries swrast instead of vmwgfx.

Not sure this has always been the case though. It might be due to a recent XWayland change. In any case, the change to libdrm silence the warnings on Xorg and makes mesa try vmwgfx on XWayland.

/Thomas

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#12 lore raw
In reply to Michel Dänzer
Quoted 21 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 8 lines · Thomas Hellstrom
Quoted 7 lines · Emil Velikov
Quoted 5 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code currently compares the node's major number to the static drm major device
number.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

This breaks the standalone vmwgfx driver on XWayland dri clients,

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 6 lines

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

AFAICT, the difference is that the standalone vmwgfx uses an internal copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): CACvgo53Wd1fq8=V_v7jjuFGimUfh7xD+ccCg-jOTjLSJdWUKeA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#14 lore raw
Quoted 26 lines · Emil Velikov
Quoted 19 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 8 lines · Thomas Hellstrom
Quoted 7 lines · Emil Velikov
Quoted 5 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code currently compares the node's major number to the static drm major device
number.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

This breaks the standalone vmwgfx driver on XWayland dri clients,

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 6 lines

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Quoted 5 lines

AFAICT, the difference is that the standalone vmwgfx uses an internal copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

-Emil

Actually, standalone vmwgfx could perhaps also try to allocate minors from 63 and downwards. That might work, but needs some verification.

/Thomas

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): c1dc7253-d505-dd16-480c-ee9a862d57ef-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org

#16 lore raw
Quoted 27 lines · Thomas Hellstrom
Quoted 26 lines · Emil Velikov
Quoted 25 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 8 lines · Thomas Hellstrom
Quoted 7 lines · Emil Velikov
Quoted 5 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code currently compares the node's major number to the static drm major device
number.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

This breaks the standalone vmwgfx driver on XWayland dri clients,

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree drm, so standalone vmwgfx is using dynamic major allocation.

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Quoted 8 lines
Quoted 5 lines

AFAICT, the difference is that the standalone vmwgfx uses an internal copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

-Emil

Actually, standalone vmwgfx could perhaps also try to allocate minors from 63 and downwards. That might work, but needs some verification.

So unfortuntately this doesn't work since the in-tree drm's file operations are registered with the DRM_MAJOR.
So I still think the patch is the way to go. If people are concerned that also fbdev file descriptors are allowed, perhaps there are other sysfs traits we can look at?

/Thomas

Quoted 2 lines

/Thomas

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#17 lore raw
Quoted 42 lines · Thomas Hellstrom
Quoted 35 lines · Thomas Hellstrom
Quoted 34 lines · Emil Velikov
Quoted 21 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 11 lines · Thomas Hellstrom
Quoted 10 lines · Emil Velikov
Quoted 8 lines · Thomas Hellstrom

To determine whether a device node is a drm device
node or not, the code
currently compares the node's major number to the static drm major device
number.

This breaks the standalone vmwgfx driver on XWayland dri clients,

Quoted 7 lines
Quoted 2 lines

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree
drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 7 lines

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a
different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

AFAICT, the difference is that the standalone vmwgfx uses an internal copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

Quoted 5 lines
Quoted 1 line

-Emil

Actually, standalone vmwgfx could perhaps also try to allocate minors from 63 and downwards. That might work, but needs some verification.

Quoted 5 lines

So unfortuntately this doesn't work since the in-tree drm's file operations are registered with the DRM_MAJOR.
So I still think the patch is the way to go. If people are concerned that also fbdev file descriptors are allowed, perhaps there are other sysfs traits we can look at?

Somewhat out of curiosity, but why do you have to overwrite all of drm? amdgpu seems to be able to pull their stunt off without ... -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): 20180903163310.GJ21634-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org

#19 lore raw
Quoted 41 lines · Daniel Vetter
Quoted 40 lines · Thomas Hellstrom
Quoted 39 lines · Thomas Hellstrom
Quoted 29 lines · Emil Velikov
Quoted 21 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 11 lines · Thomas Hellstrom
Quoted 10 lines · Emil Velikov
Quoted 8 lines · Thomas Hellstrom

To determine whether a device node is a drm device
node or not, the code
currently compares the node's major number to the static drm major device
number.

This breaks the standalone vmwgfx driver on XWayland dri clients,

Quoted 7 lines
Quoted 2 lines

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree
drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 7 lines

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a
different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Quoted 6 lines

AFAICT, the difference is that the standalone vmwgfx uses an internal copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

-Emil

Actually, standalone vmwgfx could perhaps also try to allocate minors from 63 and downwards. That might work, but needs some verification.

Quoted 8 lines
Quoted 5 lines

So unfortuntately this doesn't work since the in-tree drm's file operations are registered with the DRM_MAJOR.
So I still think the patch is the way to go. If people are concerned that also fbdev file descriptors are allowed, perhaps there are other sysfs traits we can look at?

Somewhat out of curiosity, but why do you have to overwrite all of drm? amdgpu seems to be able to pull their stunt off without ... -Daniel

At the time we launched the standalone vmwgfx, the DRM <-> driver interface was moving considerably more rapidly than the DRM <-> kernel interface. I think that's still the case. Hence less work for us. Also meant we can install the full driver stack with latest features on fairly old VMs without backported DRM functionality.

/Thomas

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 91ad6140-4e56-afc1-2515-9ca973d0ea05-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org

Acked-by
#21 lore raw
Quoted 52 lines · Thomas Hellstrom
Quoted 41 lines · Daniel Vetter
Quoted 40 lines · Thomas Hellstrom
Quoted 39 lines · Thomas Hellstrom
Quoted 29 lines · Emil Velikov
Quoted 21 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 11 lines · Thomas Hellstrom
Quoted 10 lines · Emil Velikov
Quoted 8 lines · Thomas Hellstrom

To determine whether a device node is a drm device
node or not, the code
currently compares the node's major number to the static drm major device
number.

This breaks the standalone vmwgfx driver on XWayland dri clients,

Quoted 7 lines
Quoted 2 lines

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree
drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 7 lines

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a
different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Quoted 6 lines

AFAICT, the difference is that the standalone vmwgfx uses an internal copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

-Emil

Actually, standalone vmwgfx could perhaps also try to allocate minors from 63 and downwards. That might work, but needs some verification.

Quoted 8 lines
Quoted 5 lines

So unfortuntately this doesn't work since the in-tree drm's file operations are registered with the DRM_MAJOR.
So I still think the patch is the way to go. If people are concerned that also fbdev file descriptors are allowed, perhaps there are other sysfs traits we can look at?

Somewhat out of curiosity, but why do you have to overwrite all of drm? amdgpu seems to be able to pull their stunt off without ... -Daniel

Quoted 6 lines

At the time we launched the standalone vmwgfx, the DRM <-> driver interface was moving considerably more rapidly than the DRM <-> kernel interface. I think that's still the case. Hence less work for us. Also meant we can install the full driver stack with latest features on fairly old VMs without backported DRM functionality.

I think this should be fine for 99% of drm usage, there may be corner cases in wierd places, but I can't point to any that really matter (maybe strace?)

Dave.
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CAPM=9tzScEQ-RWK55zKeT_yXiN6iAyx34DVX1eCgA3ZqC_SpuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#23 lore raw
Quoted 60 lines · Dave Airlie
Quoted 52 lines · Thomas Hellstrom
Quoted 41 lines · Daniel Vetter
Quoted 40 lines · Thomas Hellstrom
Quoted 39 lines · Thomas Hellstrom
Quoted 29 lines · Emil Velikov
Quoted 21 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 11 lines · Thomas Hellstrom
Quoted 10 lines · Emil Velikov
Quoted 8 lines · Thomas Hellstrom

To determine whether a device node is a drm device
node or not, the code
currently compares the node's major number to the static drm major device
number.

This breaks the standalone vmwgfx driver on XWayland dri clients,

Quoted 7 lines
Quoted 2 lines

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree
drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 7 lines

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a
different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Quoted 6 lines

AFAICT, the difference is that the standalone vmwgfx uses an internal copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

-Emil

Actually, standalone vmwgfx could perhaps also try to allocate minors from 63 and downwards. That might work, but needs some verification.

Quoted 8 lines
Quoted 5 lines

So unfortuntately this doesn't work since the in-tree drm's file operations are registered with the DRM_MAJOR.
So I still think the patch is the way to go. If people are concerned that also fbdev file descriptors are allowed, perhaps there are other sysfs traits we can look at?

Somewhat out of curiosity, but why do you have to overwrite all of drm? amdgpu seems to be able to pull their stunt off without ... -Daniel

Quoted 6 lines

At the time we launched the standalone vmwgfx, the DRM <-> driver interface was moving considerably more rapidly than the DRM <-> kernel interface. I think that's still the case. Hence less work for us. Also meant we can install the full driver stack with latest features on fairly old VMs without backported DRM functionality.

Quoted 4 lines

I think this should be fine for 99% of drm usage, there may be corner cases in wierd places, but I can't point to any that really matter (maybe strace?)

Having a closer look, I think this will break the Firefox/Chrome sandboxing :-\
I cannot see the path /sys/dev/char/%d:%d/device/drm in the allowed list [1] [2].

Thomas, can you please send a patch to the respective teams or give them a heads up?

Thanks
Emil

[1] https://hg.mozilla.org/releases/mozilla-beta/file/264fcd3206a6/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
[2] https://chromium.googlesource.com/chromium/src/+/8655d49f657d3878c937f1387b3d31fa66c8e76a/content/gpu/gpu_sandbox_hook_linux.cc
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CACvgo50cfLHWDUEjeNet4H3F4i3okdhSsXfjNiPvH-YZbQsyEg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#25 lore raw

Hi, Emil,

Quoted 58 lines · Emil Velikov
Quoted 57 lines · Dave Airlie
Quoted 56 lines · Thomas Hellstrom
Quoted 41 lines · Daniel Vetter
Quoted 40 lines · Thomas Hellstrom
Quoted 39 lines · Thomas Hellstrom
Quoted 29 lines · Emil Velikov
Quoted 21 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 11 lines · Thomas Hellstrom
Quoted 10 lines · Emil Velikov
Quoted 8 lines · Thomas Hellstrom

To determine whether a device node is a drm device
node or not, the code
currently compares the node's major number to the static drm major device
number.

This breaks the standalone vmwgfx driver on XWayland dri clients,

Quoted 7 lines
Quoted 2 lines

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree
drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 7 lines

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a
different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Quoted 6 lines

AFAICT, the difference is that the standalone vmwgfx uses an internal copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

-Emil

Actually, standalone vmwgfx could perhaps also try to allocate minors from 63 and downwards. That might work, but needs some verification.

Quoted 8 lines
Quoted 5 lines

So unfortuntately this doesn't work since the in-tree drm's file operations are registered with the DRM_MAJOR.
So I still think the patch is the way to go. If people are concerned that also fbdev file descriptors are allowed, perhaps there are other sysfs traits we can look at?

Somewhat out of curiosity, but why do you have to overwrite all of drm? amdgpu seems to be able to pull their stunt off without ... -Daniel

At the time we launched the standalone vmwgfx, the DRM <-> driver interface was moving considerably more rapidly than the DRM <-> kernel interface. I think that's still the case. Hence less work for us. Also meant we can install the full driver stack with latest features on fairly old VMs without backported DRM functionality.

Quoted 7 lines
Quoted 4 lines

I think this should be fine for 99% of drm usage, there may be corner cases in wierd places, but I can't point to any that really matter (maybe strace?)

Having a closer look, I think this will break the Firefox/Chrome sandboxing :-\
I cannot see the path /sys/dev/char/%d:%d/device/drm in the allowed list [1] [2].

Thanks for pointing this out.

The function drmGetMinorNameForFD() already opens this path, so any user-space using that function would not work before either.

Also mozilla/firefox adds /sys/dev/char/226:* Which means that while it still won't work on standalone vmwgfx, there should at least be no regression.

For Chromium it seems they allow /sys/dev/char/ for AmdGpu, but only under ChromOS, so I'll ping those to be safe.

I also won't be doing an immediate release after pushing.

Thanks,
Thomas

Quoted 6 lines

Thomas, can you please send a patch to the respective teams or give them a heads up?

Thanks
Emil

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#26 lore raw
Quoted 104 lines · Thomas Hellstrom

Hi, Emil,

Quoted 86 lines · Emil Velikov
Quoted 84 lines · Dave Airlie
Quoted 81 lines · Thomas Hellstrom
Quoted 69 lines · Daniel Vetter
Quoted 59 lines · Thomas Hellstrom
Quoted 52 lines · Thomas Hellstrom
Quoted 50 lines · Emil Velikov
Quoted 31 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 21 lines · Thomas Hellstrom
Quoted 12 lines · Emil Velikov
Quoted 8 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code
currently compares the node's major number to the static drm major
device
number.

Quoted 6 lines
Quoted 3 lines

This breaks the standalone vmwgfx driver on XWayland dri clients,

Any particular reason why the code doesn't use a fixed node there?
It will make the diff vs the in-kernel driver a bit smaller.

Quoted 5 lines

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree
drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 10 lines

I wonder why I haven't heard of any of these issues with the standalone
version of amdgpu shipped in packaged AMD releases. Does that also use a
different major number? If yes, maybe it's just that nobody has tried
Xwayland clients with that driver. If no, how does it avoid the other
issues described above?

AFAICT, the difference is that the standalone vmwgfx uses an internal
copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

Quoted 5 lines
Quoted 1 line

-Emil

Actually, standalone vmwgfx could perhaps also try to allocate minors from 63 and downwards. That might work, but needs some verification.

Quoted 7 lines

So unfortuntately this doesn't work since the in-tree drm's file operations
are registered with the DRM_MAJOR.
So I still think the patch is the way to go. If people are concerned that
also fbdev file descriptors are allowed, perhaps there are other sysfs traits we can look at?

Quoted 3 lines

Somewhat out of curiosity, but why do you have to overwrite all of drm? amdgpu seems to be able to pull their stunt off without ... -Daniel

At the time we launched the standalone vmwgfx, the DRM <-> driver interface was moving considerably more rapidly than the DRM <-> kernel interface. I think that's still the case. Hence less work for us. Also meant we can install the full driver stack with latest features on fairly old VMs without backported DRM functionality.

Quoted 8 lines
Quoted 4 lines

I think this should be fine for 99% of drm usage, there may be corner cases in wierd places, but I can't point to any that really matter (maybe strace?)

Having a closer look, I think this will break the Firefox/Chrome sandboxing :-\
I cannot see the path /sys/dev/char/%d:%d/device/drm in the allowed list [1] [2].

Thanks for pointing this out.

The function drmGetMinorNameForFD() already opens this path, so any user-space using that function would not work before either.

Quoted 9 lines

Also mozilla/firefox adds /sys/dev/char/226:* Which means that while it still won't work on standalone vmwgfx, there should at least be no regression.

For Chromium it seems they allow /sys/dev/char/ for AmdGpu, but only under ChromOS, so I'll ping those to be safe.

I also won't be doing an immediate release after pushing.

In that case, please give me 24h to do a libdrm release before pushing. I had to push some workarounds for the sandboxing mentioned earlier :-\

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): CACvgo53t4OSsdmxdHSqrfSWKZGYg4s+uXrSV3gWcignwNxfE8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#28 lore raw
Quoted 95 lines · Emil Velikov
Quoted 94 lines · Thomas Hellstrom

Hi, Emil,

Quoted 70 lines · Emil Velikov
Quoted 69 lines · Dave Airlie
Quoted 67 lines · Thomas Hellstrom
Quoted 57 lines · Daniel Vetter
Quoted 49 lines · Thomas Hellstrom
Quoted 44 lines · Thomas Hellstrom
Quoted 43 lines · Emil Velikov
Quoted 25 lines · Michel Dänzer

[ Adding the amd-gfx list ]

Quoted 14 lines · Thomas Hellstrom
Quoted 13 lines · Emil Velikov
Quoted 10 lines · Thomas Hellstrom

To determine whether a device node is a drm device
node or not, the code
currently compares the node's major number to the static drm
major
device
number.

This breaks the standalone vmwgfx driver on XWayland dri
clients,

Quoted 8 lines
Quoted 3 lines

Any particular reason why the code doesn't use a fixed node there?
It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree
drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 10 lines

I wonder why I haven't heard of any of these issues with the standalone
version of amdgpu shipped in packaged AMD releases. Does that also use a
different major number? If yes, maybe it's just that nobody has tried
Xwayland clients with that driver. If no, how does it avoid the other
issues described above?

AFAICT, the difference is that the standalone vmwgfx uses an internal
copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

Quoted 4 lines
Quoted 1 line

-Emil

Actually, standalone vmwgfx could perhaps also try to allocate minors from 63 and downwards. That might work, but needs some verification.

Quoted 7 lines

So unfortuntately this doesn't work since the in-tree drm's file operations
are registered with the DRM_MAJOR.
So I still think the patch is the way to go. If people are concerned that
also fbdev file descriptors are allowed, perhaps there are other sysfs traits we can look at?

Quoted 3 lines

Somewhat out of curiosity, but why do you have to overwrite all of drm? amdgpu seems to be able to pull their stunt off without ... -Daniel

At the time we launched the standalone vmwgfx, the DRM <-> driver interface was moving considerably more rapidly than the DRM <-> kernel interface. I think that's still the case. Hence less work for us. Also meant we can install the full driver stack with latest features on fairly old VMs without backported DRM functionality.

Quoted 8 lines
Quoted 4 lines

I think this should be fine for 99% of drm usage, there may be corner cases in wierd places, but I can't point to any that really matter (maybe strace?)

Having a closer look, I think this will break the Firefox/Chrome sandboxing :-\
I cannot see the path /sys/dev/char/%d:%d/device/drm in the allowed list [1] [2].

Thanks for pointing this out.

The function drmGetMinorNameForFD() already opens this path, so any user-space using that function would not work before either.

Also mozilla/firefox adds /sys/dev/char/226:* Which means that while it still won't work on standalone vmwgfx, there should at least be no regression.

For Chromium it seems they allow /sys/dev/char/ for AmdGpu, but only under ChromOS, so I'll ping those to be safe.

Quoted 7 lines
Quoted 2 lines

I also won't be doing an immediate release after pushing.

In that case, please give me 24h to do a libdrm release before pushing. I had to push some workarounds for the sandboxing mentioned earlier :-\

Thanks
Emil

Ouch, I just pushed the patch, but feel free to cut the release just before that commit.

/Thomas

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#29 lore raw
Quoted 10 lines · Thomas Hellstrom
Quoted 5 lines

In that case, please give me 24h to do a libdrm release before pushing. I had to push some workarounds for the sandboxing mentioned earlier :-\

Thanks
Emil

Ouch, I just pushed the patch, but feel free to cut the release just before that commit.

That doesn't quite work. Barring any objections I'll: revert, release, reapply.

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#30 lore raw

Hi, Emil,

Quoted 11 lines · Emil Velikov
Quoted 9 lines · Thomas Hellstrom
Quoted 5 lines

In that case, please give me 24h to do a libdrm release before pushing. I had to push some workarounds for the sandboxing mentioned earlier :-\

Thanks
Emil

Ouch, I just pushed the patch, but feel free to cut the release just before that commit.

Quoted 7 lines

That doesn't quite work. Barring any objections I'll: revert, release, reapply.

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

What happened here? I can't really see my commit nor a revert nor a release in libdrm.

/Thomas

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#31 lore raw

Ping?

Quoted 27 lines · Thomas Hellstrom

Hi, Emil,

Quoted 15 lines · Emil Velikov
Quoted 5 lines · Thomas Hellstrom
Quoted 5 lines

In that case, please give me 24h to do a libdrm release before pushing.
I had to push some workarounds for the sandboxing mentioned earlier :-\

Quoted 7 lines
Quoted 2 lines

Thanks
Emil

Ouch, I just pushed the patch, but feel free to cut the release just before
that commit.

Quoted 8 lines

That doesn't quite work. Barring any objections I'll: revert, release, reapply.

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Quoted 6 lines

What happened here? I can't really see my commit nor a revert nor a release in libdrm.

/Thomas

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

A message that is not in the archive (sent off-list or not yet received): a3af864a-8914-3bef-ff26-02c7672a9e50-4+hqylr40dJg9hUCZPvPmw@public.gmane.org

#33 lore raw
Quoted 17 lines · Thomas Hellstrom

Hi, Emil,

Quoted 13 lines · Emil Velikov
Quoted 9 lines · Thomas Hellstrom
Quoted 5 lines

In that case, please give me 24h to do a libdrm release before pushing. I had to push some workarounds for the sandboxing mentioned earlier :-\

Thanks
Emil

Ouch, I just pushed the patch, but feel free to cut the release just before that commit.

That doesn't quite work. Barring any objections I'll: revert, release, reapply.

Quoted 9 lines
Quoted 5 lines

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

What happened here? I can't really see my commit nor a revert nor a release in libdrm.

Coming back from holidays+XDC. I' m doing a release in a moment and will pick your patch just after that.

Hmm you said you pushed the patch, yet it's not in master ... Not sure what happened there.
Either way - it'll be there shortly.

Thanks
Emil
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CACvgo5289XdFe9S4r3uSUA20QP37Zy0iiYEW_nHMho4yc0Pi8A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#35 lore raw

Hi, Emil,

Quoted 24 lines · Emil Velikov
Quoted 15 lines · Thomas Hellstrom

Hi, Emil,

Quoted 12 lines · Emil Velikov
Quoted 8 lines · Thomas Hellstrom
Quoted 5 lines

In that case, please give me 24h to do a libdrm release before pushing. I had to push some workarounds for the sandboxing mentioned earlier :-\

Thanks
Emil

Ouch, I just pushed the patch, but feel free to cut the release just before that commit.

That doesn't quite work. Barring any objections I'll: revert, release, reapply.

Quoted 8 lines
Quoted 5 lines

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=02%7C01%7Cthellstrom%40vmware.com%7C01a5434f4ae94d41e02108d62a042d8b%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636742594763251508&amp;sdata=f4pVmMl%2B2GfI8HIR4GriTD1Ed2eHyEdAttMbcFoavp0%3D&amp;reserved=0

What happened here? I can't really see my commit nor a revert nor a release in libdrm.

Quoted 6 lines

Coming back from holidays+XDC. I' m doing a release in a moment and will pick your patch just after that.

Hmm you said you pushed the patch, yet it's not in master ... Not sure what happened there.
Either way - it'll be there shortly.

Yes, that's strange. I'm offsite too so I can't check the system from which I pushed it. But anyway, I'll push it later today if you haven't already.

Thanks,
Thomas

Quoted 3 lines

Thanks
Emil

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#36 lore raw
In reply to a message not in the archive

Am 31.08.2018 um 17:27 schrieb Emil Velikov:

Quoted 26 lines · Michel Dänzer
Quoted 19 lines

[ Adding the amd-gfx list ]

Quoted 8 lines · Thomas Hellstrom
Quoted 7 lines · Emil Velikov
Quoted 5 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code currently compares the node's major number to the static drm major device
number.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

This breaks the standalone vmwgfx driver on XWayland dri clients,

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree drm, so standalone vmwgfx is using dynamic major allocation.

Quoted 6 lines

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Quoted 3 lines

AFAICT, the difference is that the standalone vmwgfx uses an internal copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

The amdgpu pro package has it's own drm core copy as well and there it still works.

Not sure how our back-porting guys handle that.

Christian.

Quoted 6 lines

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 02acda47-d071-1c97-e151-fcb75d10c656-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#38 lore raw
Quoted 28 lines · Christian König

Am 31.08.2018 um 17:27 schrieb Emil Velikov:

Quoted 26 lines · Michel Dänzer
Quoted 25 lines

[ Adding the amd-gfx list ]

Quoted 8 lines · Thomas Hellstrom
Quoted 7 lines · Emil Velikov
Quoted 5 lines · Thomas Hellstrom

To determine whether a device node is a drm device node or not, the code currently compares the node's major number to the static drm major device
number.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

This breaks the standalone vmwgfx driver on XWayland dri clients,

Any particular reason why the code doesn't use a fixed node there? It will make the diff vs the in-kernel driver a bit smaller.

Because then it won't be able to interoperate with other in-tree drivers, like virtual drm drivers or passthrough usb drm drivers. There is no clean way to share the minor number allocation with in-tree drm, so standalone vmwgfx is using dynamic major allocation.

I wonder why I haven't heard of any of these issues with the standalone version of amdgpu shipped in packaged AMD releases. Does that also use a different major number? If yes, maybe it's just that nobody has tried Xwayland clients with that driver. If no, how does it avoid the other issues described above?

Quoted 6 lines
Quoted 3 lines

AFAICT, the difference is that the standalone vmwgfx uses an internal copy of drm core.
It doesn't reuse the in-kernel drm, hence it cannot know which minor it can use.

The amdgpu pro package has it's own drm core copy as well and there it still works.

We don't use our own copy of drm core in the kernel, we rely on the in kernel one. Just ttm and amdgpu are updated in the dkms packages.

Alex

Quoted 12 lines

Not sure how our back-porting guys handle that.

Christian.

Quoted 6 lines

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx