From patchwork Thu Mar 15 19:33:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 7319 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8C8D923E14 for ; Thu, 15 Mar 2012 19:33:39 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 32C3AA1818D for ; Thu, 15 Mar 2012 19:33:39 +0000 (UTC) Received: by iage36 with SMTP id e36so5790173iag.11 for ; Thu, 15 Mar 2012 12:33:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :dkim-signature:sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=RWcbDcenB+A+slppMvyk20xQGpV9kEPF9y9h6+ONq6o=; b=OUpKV38jygDpMfOiICwtvxBNT8TatG45xLQcICEZ8YgKYqVa+RnwEr1u3gtfXoPgtn PBRd0AdYp8IarbTcf82ROoUPUFy8woFuFGnKnom88UANALMlHi6b/DeKEv2ypEZvTF1H DOe42HMUCLxkDfBZt01JA3yp+pFeUkkYK4UWqPLvSK4nUZzMWzQUA1zipWKqtitdm/Si 6fQc+vsPpl9v4CKlH4GFettzw/LGhREUFB1RnsnfeDwHtzoN81u84wqvqAc/fZ/Egf+m ws/3bWE2q/58uLvbUKteM7sZEmTP9e08Te/FZFr4jYnmpRlevvvMBoyaErQXkM/ZKlyG 6gNA== Received: by 10.42.145.72 with SMTP id e8mr8767197icv.0.1331840018508; Thu, 15 Mar 2012 12:33:38 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp44787ibg; Thu, 15 Mar 2012 12:33:37 -0700 (PDT) Received: by 10.236.144.134 with SMTP id n6mr9724102yhj.50.1331840017029; Thu, 15 Mar 2012 12:33:37 -0700 (PDT) Received: from mail-gy0-f178.google.com (mail-gy0-f178.google.com [209.85.160.178]) by mx.google.com with ESMTPS id s2si1233271and.0.2012.03.15.12.33.36 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Mar 2012 12:33:37 -0700 (PDT) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.160.178 as permitted sender) client-ip=209.85.160.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.160.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass header.i=@gmail.com Received: by ghbf1 with SMTP id f1so4227851ghb.37 for ; Thu, 15 Mar 2012 12:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=RWcbDcenB+A+slppMvyk20xQGpV9kEPF9y9h6+ONq6o=; b=lFVPzeoFLd5KmFvU3vKL0n9RTBwAjHh1rVzrr+SxTo2nDlOJ1/Ds2UAt9OPPWil8Td 8xgS6uC6Wn1oyCdHlfFGejOxZze0iOdQmBdiot9d37ZknUv1uEGVXQe6MOK5UaAl0Plm 8FWHqqpPN5fahK5zR1EOyC4VXN3icLsl9JY1FEnAEXjDu8OxH/5LXXPF3YKl8TuC8ZCE gKzusJ1wEJM2M7LRCPEY+BN8z28UmFB87BgiriNDntv07gAZFD/BM/rimb0SEcX2Mid9 dH7gJASZrI2zq33yCOEwRTCdaFw3azWK5BvxxBrhj+12RA7CVAuk9n0BaUdVIsxx8MWt /36g== Received: by 10.182.114.70 with SMTP id je6mr9723866obb.30.1331840016512; Thu, 15 Mar 2012 12:33:36 -0700 (PDT) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id g4sm2078154oeg.5.2012.03.15.12.33.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Mar 2012 12:33:35 -0700 (PDT) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: patches@linaro.org, Rob Clark Subject: [PATCH] drm: more consistent use of drm_core_check_feature() Date: Thu, 15 Mar 2012 14:33:30 -0500 Message-Id: <1331840010-9180-1-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.5.4 X-Gm-Message-State: ALoCoQm8PaW1ivoJr6Iy+MrIyIArFps7+ycJFjT8q/LCys15dVBsW/QKbzPrVpZrY2syNVlJK2SZ From: Rob Clark Minor cleanup.. use drm_core_check_feature() consistently in core. Signed-off-by: Rob Clark --- drivers/gpu/drm/drm_fops.c | 6 +++--- drivers/gpu/drm/drm_gem.c | 6 +++--- drivers/gpu/drm/drm_stub.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index cdfbf27..be6362e 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -268,7 +268,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp, init_waitqueue_head(&priv->event_wait); priv->event_space = 4096; /* set aside 4k for event buffer */ - if (dev->driver->driver_features & DRIVER_GEM) + if (drm_core_check_feature(dev, DRIVER_GEM)) drm_gem_open(dev, priv); if (drm_core_check_feature(dev, DRIVER_PRIME)) @@ -507,10 +507,10 @@ int drm_release(struct inode *inode, struct file *filp) drm_events_release(file_priv); - if (dev->driver->driver_features & DRIVER_GEM) + if (drm_core_check_feature(dev, DRIVER_GEM)) drm_gem_release(dev, file_priv); - if (dev->driver->driver_features & DRIVER_MODESET) + if (drm_core_check_feature(dev, DRIVER_MODESET)) drm_fb_release(file_priv); mutex_lock(&dev->ctxlist_mutex); diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index ce3c599..6557d1f 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -409,7 +409,7 @@ drm_gem_close_ioctl(struct drm_device *dev, void *data, struct drm_gem_close *args = data; int ret; - if (!(dev->driver->driver_features & DRIVER_GEM)) + if (!drm_core_check_feature(dev, DRIVER_GEM)) return -ENODEV; ret = drm_gem_handle_delete(file_priv, args->handle); @@ -431,7 +431,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data, struct drm_gem_object *obj; int ret; - if (!(dev->driver->driver_features & DRIVER_GEM)) + if (!drm_core_check_feature(dev, DRIVER_GEM)) return -ENODEV; obj = drm_gem_object_lookup(dev, file_priv, args->handle); @@ -485,7 +485,7 @@ drm_gem_open_ioctl(struct drm_device *dev, void *data, int ret; u32 handle; - if (!(dev->driver->driver_features & DRIVER_GEM)) + if (!drm_core_check_feature(dev, DRIVER_GEM)) return -ENODEV; spin_lock(&dev->object_name_lock); diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index bd2e897..f51dc11 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -304,7 +304,7 @@ int drm_fill_in_dev(struct drm_device *dev, goto error_out_unreg; } - if (driver->driver_features & DRIVER_GEM) { + if (drm_core_check_feature(dev, DRIVER_GEM)) { retcode = drm_gem_init(dev); if (retcode) { DRM_ERROR("Cannot initialize graphics execution " @@ -492,7 +492,7 @@ void drm_put_dev(struct drm_device *dev) if (drm_core_check_feature(dev, DRIVER_MODESET)) drm_put_minor(&dev->control); - if (driver->driver_features & DRIVER_GEM) + if (drm_core_check_feature(dev, DRIVER_GEM)) drm_gem_destroy(dev); drm_put_minor(&dev->primary);