[Intel-gfx] [PATCH 15/19] drm/i915: Debugfs support for GuC logging control

Chris Wilson chris at chris-wilson.co.uk
Fri Aug 19 18:18:15 UTC 2016


On Fri, Aug 19, 2016 at 02:13:14PM +0530, akash.goel at intel.com wrote:
> +static int i915_guc_log_control_get(void *data, u64 *val)
> +{
> +	struct drm_device *dev = data;
> +	struct drm_i915_private *dev_priv = to_i915(dev);
> +
> +	if (!dev_priv->guc.log.vma)
> +		return -EINVAL;

return -ENODEV;

> +
> +	*val = i915.guc_log_level;
> +
> +	return 0;
> +}
> +
> +static int i915_guc_log_control_set(void *data, u64 val)
> +{
> +	struct drm_device *dev = data;
> +	struct drm_i915_private *dev_priv = to_i915(dev);
> +	int ret;

if (!dev_priv->guc.log.vma)
	return -ENODEV;

you don't need struct_mutex to check for its existence.

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list