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