mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-02-04 15:20:27 +01:00
Merge branch 'nonlinux-correct-rendernode' into 'main'
xf86drm: open real correct render node on non-linux See merge request mesa/libdrm!419
This commit is contained in:
commit
ebb6210ecb
1 changed files with 6 additions and 1 deletions
|
|
@ -3499,6 +3499,8 @@ static char *drmGetMinorNameForFD(int fd, int type)
|
|||
const char *dev_name = drmGetDeviceName(type);
|
||||
unsigned int maj, min;
|
||||
int n;
|
||||
int base = drmGetMinorBase(type);
|
||||
int renderbase = drmGetMinorBase(DRM_NODE_RENDER);
|
||||
|
||||
if (fstat(fd, &sbuf))
|
||||
return NULL;
|
||||
|
|
@ -3512,7 +3514,10 @@ static char *drmGetMinorNameForFD(int fd, int type)
|
|||
if (!dev_name)
|
||||
return NULL;
|
||||
|
||||
n = snprintf(buf, sizeof(buf), dev_name, DRM_DIR_NAME, min);
|
||||
if (min >= renderbase)
|
||||
min -= renderbase;
|
||||
|
||||
n = snprintf(buf, sizeof(buf), dev_name, DRM_DIR_NAME, base + min);
|
||||
if (n == -1 || n >= sizeof(buf))
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue