[Intel-gfx] [PATCH] drm: Simplify GETRESOURCES ioctl

2016-12-12 Thread Daniel Vetter
On Sun, Dec 11, 2016 at 07:53:42PM +, Chris Wilson wrote: > On Sun, Dec 11, 2016 at 08:20:19PM +0100, Daniel Vetter wrote: > > Looping twice when we can do it once is silly. Also use a consistent > > style. Note that there's a good race with the connector list walking, > > since that is no long

[PATCH] drm: Simplify GETRESOURCES ioctl

2016-12-11 Thread Daniel Vetter
Looping twice when we can do it once is silly. Also use a consistent style. Note that there's a good race with the connector list walking, since that is no longer protected by mode_config.mutex. But that's for a later patch to fix. v2: Actually try to not blow up, somehow I lost the hunk that chec

[PATCH] drm: Simplify GETRESOURCES ioctl

2016-12-11 Thread Chris Wilson
On Sun, Dec 11, 2016 at 08:20:19PM +0100, Daniel Vetter wrote: > Looping twice when we can do it once is silly. Also use a consistent > style. Note that there's a good race with the connector list walking, > since that is no longer protected by mode_config.mutex. But that's for > a later patch to f

[PATCH] drm: Simplify GETRESOURCES ioctl

2016-12-11 Thread Chris Wilson
On Sun, Dec 11, 2016 at 01:39:15PM +0100, Daniel Vetter wrote: > + count = 0; > + fb_id = u64_to_user_ptr(card_res->fb_id_ptr); > + list_for_each_entry(fb, &file_priv->fbs, filp_head) { > + count++; > + if (count > card_res->count_fbs) > + con

[PATCH] drm: Simplify GETRESOURCES ioctl

2016-12-11 Thread Daniel Vetter
Looping twice when we can do it once is silly. Also use a consistent style. Note that there's a good race with the connector list walking, since that is no longer protected by mode_config.mutex. But that's for a later patch to fix. v2: Actually try to not blow up, somehow I lost the hunk that chec