Skip to content
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

Merged
merged 1 commit into from
Feb 26, 2020

Conversation

LeptonWu
Copy link
Contributor

Signed-off-by: Lepton Wu ytht.net@gmail.com

@LeptonWu
Copy link
Contributor Author

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).

@@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*num_of_candidate?

Copy link
Contributor

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:).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry,a mistake

Copy link
Contributor Author

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?

Copy link
Contributor Author

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!

@LeptonWu LeptonWu force-pushed the fixnum branch 2 times, most recently from c71ceec to 5b3c668 Compare February 11, 2020 01:34
@LeptonWu
Copy link
Contributor Author

Ping, any comments? Thanks

@XinfengZhang
Copy link
Contributor

LGTM, will merge it

@XinfengZhang
Copy link
Contributor

@LeptonWu please help to re-base it with latest code

Signed-off-by: Lepton Wu <ytht.net@gmail.com>
@LeptonWu
Copy link
Contributor Author

Thanks, can we get this merge now?

@XinfengZhang XinfengZhang merged commit 48f446b into intel:master Feb 26, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants