Message ID | 1471261687-10601-5-git-send-email-mika.kuoppala@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, Aug 15, 2016 at 02:48:07PM +0300, Mika Kuoppala wrote: > From: Jesse Barnes <jbarnes@virtuousgeek.org> > > Add possibility to query if svm is available. When we try to enable SVM on the context we get an error. We have to do that first anywhere, that seems like a good spot for userspace to catch all issues. What usecase do you have that doesn't involve creating an SVM context? -Chris
Chris Wilson <chris@chris-wilson.co.uk> writes: > On Mon, Aug 15, 2016 at 02:48:07PM +0300, Mika Kuoppala wrote: >> From: Jesse Barnes <jbarnes@virtuousgeek.org> >> >> Add possibility to query if svm is available. > > When we try to enable SVM on the context we get an error. We have to do > that first anywhere, that seems like a good spot for userspace to catch > all issues. > > What usecase do you have that doesn't involve creating an SVM context? I can't think of any. So this patch stinks superfluous. -Mika > -Chris > > -- > Chris Wilson, Intel Open Source Technology Centre
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index a07918d821e4..6d9c84253412 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -354,6 +354,9 @@ static int i915_getparam(struct drm_device *dev, void *data, case I915_PARAM_MIN_EU_IN_POOL: value = INTEL_INFO(dev)->min_eu_in_pool; break; + case I915_PARAM_HAS_SVM: + value = dev_priv->svm_available; + break; default: DRM_DEBUG("Unknown parameter %d\n", param->param); return -EINVAL; diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 8d567744f221..c21ba4b769c4 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h @@ -391,6 +391,7 @@ typedef struct drm_i915_irq_wait { #define I915_PARAM_HAS_EXEC_SOFTPIN 37 #define I915_PARAM_HAS_POOLED_EU 38 #define I915_PARAM_MIN_EU_IN_POOL 39 +#define I915_PARAM_HAS_SVM 40 typedef struct drm_i915_getparam { __s32 param;