-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
X11 DRI2: check if device is a render node #584
Conversation
va/x11/dri2_util.c
Outdated
name = drmGetDeviceNameFromFd(fd); | ||
if (name) { | ||
/* drmGetDeviceNameFromFd returns a strdup'ed string */ | ||
int r = strncmp(name, "/dev/dri/renderD", 16) == 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only renderDxx return 0, if the fd is from open(/dev/dri/card0) , it return <0 or >0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, the == 0 should make r essentially boolean (0 or 1). For clarification it may be better to put it in ()
This is copied over from drm/drm_utils.c with the only change being a memory leak fix (drmGetDeviceNameFromFd returns a string that according the docs needs to drmFree'd)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, thanks
583e3ce
to
eef133e
Compare
hi @akarl10 , I will squash your two commit to one, and keep the description of first commit, is it ok to you? |
@XinfengZhang of course thats ok 👍 |
sorry, I could not apply "squash & merge" , could you help to squash these two commits, the second one looks a part of first commit. |
and if so skip drmGetMagic and VA_DRI2Authenticate. This is essentailly the same as in the pure drm non X11 case
eef133e
to
ea91670
Compare
and if so skip drmGetMagic and VA_DRI2Authenticate.
This is essentailly the same as in the pure drm non X11 case
fixes #582