18:25 pmoreau: Is it expected that we resize `global_residents` if it’s exactly enough to store the requested data?
18:25 pmoreau: `if (nv50->global_residents.size <= (end * sizeof(struct pipe_resource *))) { /* resize */ }`
18:26 karolherbst: pmoreau: https://github.com/karolherbst/mesa/commit/2d37f19f21095e26f2e780f88f40db2ab993b8cd
18:27 karolherbst: but mhh
18:27 karolherbst: maybe nv50 is more strange here
18:27 karolherbst: pmoreau: the problem is, this code is clover only
18:27 karolherbst: so...
18:27 karolherbst: just fix it :p
18:27 pmoreau: That’s not my point
18:27 pmoreau: If `nv50->global_residents.size == end * sizeof(struct pipe_resource *))`, we still resize global_residents, which seems stupid
18:28 imirkin: karol's point is that this code is only accessible via clover
18:28 imirkin: so never tested
18:28 imirkin: so ... just fix it if it's dumb
18:28 pmoreau: Will do
18:28 imirkin: but ... is end inclusive?
18:29 imirkin: if it is, the condition is correct
18:29 imirkin: if end is exclusive, then it's not
18:29 karolherbst: well.. it's wrong if the count is 0
18:29 karolherbst: I hit it with nvc0 then
18:29 karolherbst: size is 0 and size would... be 0 as well, so the resize failed
18:30 karolherbst: and I am sure pmoreau hits something similiar as well
18:30 pmoreau: Yeah, it is wrong for nr == 0, for sure
18:30 karolherbst: but I think the condition is wrong nonetheless
18:30 karolherbst: should be <
18:30 karolherbst: not <=
18:31 karolherbst: we have "const unsigned end = start + nr;" in nc0
18:31 karolherbst: *nvc0
18:31 pmoreau: What I am hitting is: `nv50_set_global_bindings(pipe, 0, 2, res, handles)`, followed by `nv50_set_global_bindings(pipe, 0, 2, res, handles)` results in global_residents being resized every time.
18:31 karolherbst: yeah
18:31 karolherbst: it looks broken
18:31 pmoreau: It’s the same code in both nv50 and nvc0.
18:31 karolherbst: yeah
18:32 karolherbst: but as I said: nothing uses the code yet, so it's probably very broken in many places :p
18:32 karolherbst: especially nv50
18:32 pmoreau: :-)
18:33 pmoreau: Btw, what happens if you run `/bin/test_api null_buffer_arg` from the CTS on nvc0?
18:33 karolherbst: passes
18:34 pmoreau: The 2nd subtest is failing on nv50, and I’m not sure why. The input buffer looks good, so I am guessing something wrong with the handles.
18:34 karolherbst: maybe
18:34 pmoreau: Mmh, should retry on top of your patches.