diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-06-21 13:04:21 +0200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-06-21 13:40:13 +0200 |
commit | 7822492fd21a44eeb3568082b0ab915df7388061 (patch) | |
tree | 1357da4d492361c39d3c35d934ffc254478bd476 /drivers/gpu/drm/i915/intel_gvt.c | |
parent | drm/i915: Set the access right of kernel param "i915.enable_gvt" to read-only. (diff) | |
download | linux-7822492fd21a44eeb3568082b0ab915df7388061.tar.xz linux-7822492fd21a44eeb3568082b0ab915df7388061.zip |
drm/i915/gvt: Mark i915.enable_gvt as false if loading fails
If we update the value of i915.enable_gvt should we fail to load GVT,
userspace can easily detect when it fails to load as requested.
Testcase: igt/gvt_basic
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Zhi Wang <zhi.a.wang@intel.com>
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466507234-23242-1-git-send-email-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/intel_gvt.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_gvt.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_gvt.c b/drivers/gpu/drm/i915/intel_gvt.c index 9fa458ce40a6..434f4d5c553d 100644 --- a/drivers/gpu/drm/i915/intel_gvt.c +++ b/drivers/gpu/drm/i915/intel_gvt.c @@ -63,7 +63,7 @@ int intel_gvt_init(struct drm_i915_private *dev_priv) if (!is_supported_device(dev_priv)) { DRM_DEBUG_DRIVER("Unsupported device. GVT-g is disabled\n"); - return 0; + goto bail; } /* @@ -72,16 +72,20 @@ int intel_gvt_init(struct drm_i915_private *dev_priv) ret = intel_gvt_init_host(); if (ret) { DRM_DEBUG_DRIVER("Not in host or MPT modules not found\n"); - return 0; + goto bail; } ret = intel_gvt_init_device(dev_priv); if (ret) { DRM_DEBUG_DRIVER("Fail to init GVT device\n"); - return 0; + goto bail; } return 0; + +bail: + i915.enable_gvt = 0; + return 0; } /** |