[PATCH 02/10] drm: Don't compute obj counts expensively in get_resources

2016-06-21 Thread Daniel Vetter
On Tue, Jun 21, 2016 at 10:48:08AM +0100, Chris Wilson wrote: > On Tue, Jun 21, 2016 at 11:10:27AM +0200, Daniel Vetter wrote: > > And to avoid surprising userspace, make sure we don't copy more > > connectors than planned, and report the actual number of connectors > > copied. That way any racing

[PATCH 02/10] drm: Don't compute obj counts expensively in get_resources

2016-06-21 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 actu

[PATCH 02/10] drm: Don't compute obj counts expensively in get_resources

2016-06-21 Thread Chris Wilson
On Tue, Jun 21, 2016 at 11:10:27AM +0200, Daniel Vetter wrote: > And to avoid surprising userspace, make sure we don't copy more > connectors than planned, and report the actual number of connectors > copied. That way any racing hot-add/remove will be handled. > @@ -1938,6 +1929,7 @@ int drm_mode_