Message ID | 5fca72c5-3d24-c688-7625-78f45d46ef5b@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Apr 19, 2017 at 06:09:00PM -0700, Michel Thierry wrote: > This patch is missing: > > diff --git a/drivers/gpu/drm/i915/i915_gem_context.c > b/drivers/gpu/drm/i915/i915_gem_context.c > index c1013af0b910..a8bdea43a217 100644 > --- a/drivers/gpu/drm/i915/i915_gem_context.c > +++ b/drivers/gpu/drm/i915/i915_gem_context.c > @@ -1135,7 +1135,7 @@ int i915_gem_context_getparam_ioctl(struct > drm_device *dev, void *data, > return PTR_ERR(ctx); > } > > - args->size = 0; > + args->size = (args->param != I915_CONTEXT_PARAM_WATCHDOG) ? 0 : > args->size; > switch (args->param) { > case I915_CONTEXT_PARAM_BAN_PERIOD: > ret = -EINVAL; > > Or there will be no way to get the current thresholds (chunk was > missed due to some TRTT code nearby). I'll be sure to include it in > the next version. No. It is always preset to 0. The PARAM should set it to the actual struct size (it would write) and *not* the user's size. -Chris
On 20/04/17 01:52, Chris Wilson wrote: > On Wed, Apr 19, 2017 at 06:09:00PM -0700, Michel Thierry wrote: >> This patch is missing: >> >> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c >> b/drivers/gpu/drm/i915/i915_gem_context.c >> index c1013af0b910..a8bdea43a217 100644 >> --- a/drivers/gpu/drm/i915/i915_gem_context.c >> +++ b/drivers/gpu/drm/i915/i915_gem_context.c >> @@ -1135,7 +1135,7 @@ int i915_gem_context_getparam_ioctl(struct >> drm_device *dev, void *data, >> return PTR_ERR(ctx); >> } >> >> - args->size = 0; >> + args->size = (args->param != I915_CONTEXT_PARAM_WATCHDOG) ? 0 : >> args->size; >> switch (args->param) { >> case I915_CONTEXT_PARAM_BAN_PERIOD: >> ret = -EINVAL; >> >> Or there will be no way to get the current thresholds (chunk was >> missed due to some TRTT code nearby). I'll be sure to include it in >> the next version. > > No. It is always preset to 0. The PARAM should set it to the actual > struct size (it would write) and *not* the user's size. > -Chris > Ok, then I'll change the shortcut in get_watchdog, because as it is you can query the size, but not the thresholds. int i915_gem_context_get_watchdog() { ... if (args->size == 0) goto out; ... out: args->size = sizeof(threshold_in_us); return 0; } }
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index c1013af0b910..a8bdea43a217 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -1135,7 +1135,7 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data, return PTR_ERR(ctx); } - args->size = 0; + args->size = (args->param != I915_CONTEXT_PARAM_WATCHDOG) ? 0 : args->size; switch (args->param) {