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

Chris Wilson chris at chris-wilson.co.uk
Tue Jun 21 09:48:08 UTC 2016


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_getresources(struct drm_device *dev, void *data,
>  			}
>  			copied++;
>  		}
> +		connector_count = copied;

You forgot to actually make sure we don't copy more conectors than
planned.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list