xf86drm: adjust device node path for minor base
authorJonathan Gray <jsg@jsg.id.au>
Sat, 17 Dec 2016 05:09:51 +0000 (16:09 +1100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sat, 24 Dec 2016 17:06:49 +0000 (17:06 +0000)
commitd5cf3f98314c1b9d87216e00c30c9fef06ff24c3
tree16479426affd410a56731ac1b99a61e4eb1809a6
parente3af5368b2c372cfda27bc010b9c98a923d83cd9
xf86drm: adjust device node path for minor base

When constructing a path to a device node the minor number retrieved
from fstat needs to have the offset of the node type subtracted from it.
Control and render node types have the same major as the primary node
but each has their own block of minor types at fixed offsets.

v2: remove min < base test as requested by Emil

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
xf86drm.c