Re: [Intel-gfx] [PATCH 5/7] drm: Don't compute obj counts expensively in get_resources

2016-12-09 Thread Daniel Vetter
On Fri, Dec 09, 2016 at 09:47:56PM +, Chris Wilson wrote: > On Fri, Dec 09, 2016 at 03:19:42PM +0100, Daniel Vetter wrote: > > Looping when we keep track of this is silly. Only thing we have to > > be careful is with sampling the connector count. To avoid inconsisten > > results due to gcc

Re: [Intel-gfx] [PATCH 5/7] drm: Don't compute obj counts expensively in get_resources

2016-12-09 Thread Chris Wilson
On Fri, Dec 09, 2016 at 03:19:42PM +0100, Daniel Vetter wrote: > Looping when we keep track of this is silly. Only thing we have to > be careful is with sampling the connector count. To avoid inconsisten > results due to gcc re-computing this, use READ_ONCE. Later on in the function we take the

[Intel-gfx] [PATCH 5/7] drm: Don't compute obj counts expensively in get_resources

2016-12-09 Thread Daniel Vetter
Looping when we keep track of this is silly. Only thing we have to be careful is with sampling the connector count. To avoid inconsisten results due to gcc re-computing this, use READ_ONCE. And to avoid surprising userspace, make sure we don't copy more connectors than planned, and report the