-
Notifications
You must be signed in to change notification settings - Fork 304
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
Rework device names #682
Rework device names #682
Conversation
56daf44
to
79bf781
Compare
@sivileri this MR reworks the driver-name API, conflicting with your other work. Would be great if we can merge this first, but at the least can you please check this doesn't explode on Windows. Thanks o/ @XinfengZhang @dvrogozh this is the first big step towards addressing the DRI3 regressions some people are seeing. Would be great if we can get to it sooner than later. |
79bf781
to
3cf9ecd
Compare
fwiw, it looks cleaner and robust. What worries me is that drivers lists are scattered among different backend implementation files, and, iiuc, some drivers can be used by several backends. I wonder if we could centralized all of them in a single file so we could update that single structure for all at once. Anyway, this change can be done later. |
3cf9ecd
to
f5a3ab3
Compare
IMHO we should probably spend our efforts into a proper mechanism (say something like the Vulkan ICD/json) to remove this hard-coding + add some order/priority guarantees. Which in itself is an important yet orthogonal task. |
@XinfengZhang @dvrogozh any comments? |
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, proposal is to completely replace 2 functions currently used to enumerate drivers:
$ cat va_backend.h
vaGetNumCandidates
vaGetDriverNameByIndex
with single one:
$ cat va_backend.h
vaGetNumCandidates // DEPRECATED =NULL
vaGetDriverNameByIndex // DEPRECATED =NULL
vaGetDriverNames
I think this highlight needs to be added to PR description to save time to understand what's being done in the PR.
f5a3ab3
to
7c5bb75
Compare
Rebased, fixed the reserved bits and added one line summary about the API change. @dvrogozh can you have another look? |
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.
Change looks good to me. Basically I am trying to imagine the case where something might go wrong, but without a success so far. I think this change needs to be extensively tried before the merge. Recommend to pick it up for validation. @XinfengZhang - please, take a look.
the change itself looks good, but from my perspective, we do need test it. |
@XinfengZhang when you say "we need to test it" can you elaborate who is "we" and what testing do you expect to be done? There has been zero comments here for over 3 months and 2.18 was released 2 month ago. This makes me wonder if as-is libva is even considered maintained? |
* the safe side. In the worst case, the DRIVER BUG below will print and | ||
* we'll be capped to the current selection. | ||
*/ | ||
char *drivers[20] = { 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.
20 should be enough now, but does we need a check?
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.
What check are you looking for - can you provide a concrete example?
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 need check now, it is impossible that {i915, {iHD, i965, i966 .... iHD1, iHD2...} exceed 20 backend UMD drivers for one KMD.
@evelikov could you help to rebase it? |
@XinfengZhang do you mind replying to my earlier question #682 (comment), thanks. |
sorry for late response firstly, just like my previous comments, the change itself looks good to me about why we did not include it in 2.18. I tested it with intel media stack. |
Move all the existing open driver code into a legacy function. It will soon be replaced (in gradual non-regressing manner) with a new shorter and more coherent solution. Signed-off-by: Emil Velikov <[email protected]>
The current GetDriver API is rather fragile and bonkers. In particular it does a two-step pass - number vs names. That in itself is not great, since it assumes the devices do not change in between. Additionally there is the assumption of index X will match device (name) X, which does not hold true. The most prominent issue is the inability to provide accurate number and list of names. Instead, we can have a single API, that provides both pieces of data in one go - shorter and simpler code - in reliable manner. Signed-off-by: Emil Velikov <[email protected]>
This way we can reuse it with the follow-up patches. Signed-off-by: Emil Velikov <[email protected]>
v2: Add WSL case v3: Drop sentinel, use ARRAY_SIZE Signed-off-by: Emil Velikov <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
This way we can reuse it with the follow-up patches. Signed-off-by: Emil Velikov <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Drop a bunch of set but unused variables and associated dead code. Signed-off-by: Emil Velikov <[email protected]>
Drop a bunch of set but unused variables and associated dead code. Note: if we are to remove the version handling, then 2/3 of the code in this file will become unused. Yet it's fairly subtle code and there's a notable chance of detection breaking if we remove it. So keep the variables around and (void) prefix them so the compiler does not warn. Signed-off-by: Emil Velikov <[email protected]>
v2: Drop sentinel, use ARRAY_SIZE Signed-off-by: Emil Velikov <[email protected]>
There are some corner cases where DRI3 does not work correctly. While bug reports are appreciated, this enables users to get back to their machines in meaningful way - aka w/o having to rebuild libva. Signed-off-by: Emil Velikov <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
7c5bb75
to
89b15d1
Compare
While I appreciate the heartfelt apology, I am a firm believer that actions speak louder than words. Here's to this being the last instance. MR has been updated and lightly tested - basically a simple s/getenv/secure_getenv/ change was required. |
hi @dvrogozh , could you help to dismiss your changes request if your concern was addressed already and no further concerns. |
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.
Looks good.
The current GetDriver API is rather fragile and bonkers.
In particular it does a two-step pass - number vs names. That in itself
is not great, since it assumes the devices do not change in between.
Additionally there is the assumption of index X will match device (name)
X, which does not hold true.
The most prominent issue is the inability to provide accurate number and
list of names.
Instead, we can have a single API, that provides both pieces of data in
one do - shorter and simpler code - in reliable manner.
In other words: this replaces and deprecates
vaGetNumCandidates
&&vaGetDriverNameByIndex
in favour ofvaGetDriverNames
This is the first step towards fixing #677