-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Return error when no va devices available. #369
Conversation
FYI, this is for fixing a regression introduced by 6650b39, The current code without this fix crashes on system without supported hardware (for example, inside an vm). |
va/drm/va_drm_utils.c
Outdated
@@ -69,7 +69,7 @@ VA_DRM_GetNumCandidates(VADriverContextP ctx, int * num_candidates) | |||
} | |||
drmFreeVersion(drm_version); | |||
*num_candidates = num_of_candidate; | |||
return VA_STATUS_SUCCESS; | |||
return num_of_candidate ? VA_STATUS_SUCCESS : VA_STATUS_ERROR_UNKNOWN; |
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.
*num_of_candidate?
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.
no:). num_of_candidate is local variable declared int. num_candidates is function argument declared int*. I would suggest to use simpler and more different names to avoid misreading:).
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.
sorry,a mistake
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.
So should I roll back to original version?
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.
OK, now I changed num_of_candidate to count in my cl.
Please take another look, thanks!
c71ceec
to
5b3c668
Compare
Ping, any comments? Thanks |
LGTM, will merge it |
@LeptonWu please help to re-base it with latest code |
Signed-off-by: Lepton Wu <ytht.net@gmail.com>
Thanks, can we get this merge now? |
Signed-off-by: Lepton Wu ytht.net@gmail.com