intel / intel/libva

regression found by drm: remove VA_DRM_IsRenderNodeFd() helper

Open
#692 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
784
Forks
314
PR merge metrics
No merged PRs in 30d

Description

the case is chrome out of process decode case,
after this patch [4d4c5f06519fe4c40d6fe1b2ccff812ff3b3b402](https://github.com/intel/libva/commit/4d4c5f06519fe4c40d6fe1b2ccff812ff3b3b402)
it will break the initialization process, suppose it is because the check in drmGetNodeTypeFromFd is strict than
if (fstat(fd, &st) == 0)
return S_ISCHR(st.st_mode) && (st.st_rdev & 0x80);

ps:
int drmGetNodeTypeFromFd(int fd)
{
struct stat sbuf;
int maj, min, type;

if (fstat(fd, &sbuf))
return -1;

maj = major(sbuf.st_rdev);
min = minor(sbuf.st_rdev);

if (maj != DRM_MAJOR || !S_ISCHR(sbuf.st_mode)) {
errno = EINVAL;
return -1;
}

type = drmGetMinorType(min);
if (type == -1)
errno = ENODEV;
return type;
}
@evelikov-work

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.