Re: [PATCH] drm/i915: properly check for MODESET for kms driver ioctls

Chris Wilson
2012-04-24T08:22:36Z

On Tue, 24 Apr 2012 08:19:31 +0200, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
> index 0f0fe31..aa14235 100644
> --- a/drivers/gpu/drm/i915/intel_overlay.c
> +++ b/drivers/gpu/drm/i915/intel_overlay.c
> @@ -1122,10 +1122,8 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
> struct put_image_params *params;
> int ret;
>
> - if (!dev_priv) {
> - DRM_ERROR("called with no initialization\n");
> - return -EINVAL;
> - }
> + if (!drm_core_check_feature(dev, DRIVER_MODESET))
> + return -ENODEV;

For the overlay case, we don't setup dev_priv->overlay either with
nomodeset or on arches where we don't support overlays. So
if (!dev_priv->overlay) return -ENODEV; seems to be the more generic
test. Might want a comment that prevents the nomodeset case as well.
-Chris

--
Chris Wilson, Intel Open Source Technology Centre