dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: Andrzej Hajda <a.hajda@samsung.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH] drm/core: use helper to check driver features
Date: Fri, 3 Oct 2014 10:39:25 +0200	[thread overview]
Message-ID: <20141003083925.GD16117@phenom.ffwll.local> (raw)
In-Reply-To: <CANq1E4T4h9S1CzM+RGb3g9YTUrTBA+sRwCCiYnS18rja+EPNWw@mail.gmail.com>

On Thu, Oct 02, 2014 at 04:15:26PM +0200, David Herrmann wrote:
> Hi
> 
> On Tue, Sep 30, 2014 at 4:49 PM, Andrzej Hajda <a.hajda@samsung.com> wrote:
> > The patch replaces direct access to driver_features field
> > by calls to helper function.
> >
> > Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> 
> Looks good:
> 
> Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
> 
> CC'ing Daniel, he'll put it in his drm-core-stuff branch.

Already happened, but I've added your r-b now too.
-Daniel

> 
> Thanks
> David
> 
> > ---
> >  drivers/gpu/drm/drm_drv.c  | 4 ++--
> >  drivers/gpu/drm/drm_fops.c | 8 ++++----
> >  drivers/gpu/drm/drm_gem.c  | 6 +++---
> >  3 files changed, 9 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> > index 6a11902..2b30430 100644
> > --- a/drivers/gpu/drm/drm_drv.c
> > +++ b/drivers/gpu/drm/drm_drv.c
> > @@ -598,7 +598,7 @@ struct drm_device *drm_dev_alloc(struct drm_driver *driver,
> >                 goto err_ht;
> >         }
> >
> > -       if (driver->driver_features & DRIVER_GEM) {
> > +       if (drm_core_check_feature(dev, DRIVER_GEM)) {
> >                 ret = drm_gem_init(dev);
> >                 if (ret) {
> >                         DRM_ERROR("Cannot initialize graphics execution manager (GEM)\n");
> > @@ -628,7 +628,7 @@ static void drm_dev_release(struct kref *ref)
> >  {
> >         struct drm_device *dev = container_of(ref, struct drm_device, ref);
> >
> > -       if (dev->driver->driver_features & DRIVER_GEM)
> > +       if (drm_core_check_feature(dev, DRIVER_GEM))
> >                 drm_gem_destroy(dev);
> >
> >         drm_legacy_ctxbitmap_cleanup(dev);
> > diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
> > index 3e66946..ed7bc68 100644
> > --- a/drivers/gpu/drm/drm_fops.c
> > +++ b/drivers/gpu/drm/drm_fops.c
> > @@ -171,7 +171,7 @@ static int drm_open_helper(struct file *filp, struct drm_minor *minor)
> >         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))
> > @@ -256,7 +256,7 @@ out_close:
> >  out_prime_destroy:
> >         if (drm_core_check_feature(dev, DRIVER_PRIME))
> >                 drm_prime_destroy_file_private(&priv->prime);
> > -       if (dev->driver->driver_features & DRIVER_GEM)
> > +       if (drm_core_check_feature(dev, DRIVER_GEM))
> >                 drm_gem_release(dev, priv);
> >         put_pid(priv->pid);
> >         kfree(priv);
> > @@ -408,10 +408,10 @@ int drm_release(struct inode *inode, struct file *filp)
> >
> >         drm_events_release(file_priv);
> >
> > -       if (dev->driver->driver_features & DRIVER_MODESET)
> > +       if (drm_core_check_feature(dev, DRIVER_MODESET))
> >                 drm_fb_release(file_priv);
> >
> > -       if (dev->driver->driver_features & DRIVER_GEM)
> > +       if (drm_core_check_feature(dev, DRIVER_GEM))
> >                 drm_gem_release(dev, file_priv);
> >
> >         drm_legacy_ctxbitmap_flush(dev, file_priv);
> > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
> > index eb5dd67..b2c7bab 100644
> > --- a/drivers/gpu/drm/drm_gem.c
> > +++ b/drivers/gpu/drm/drm_gem.c
> > @@ -580,7 +580,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);
> > @@ -607,7 +607,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);
> > @@ -660,7 +660,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;
> >
> >         mutex_lock(&dev->object_name_lock);
> > --
> > 1.9.1
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

      reply	other threads:[~2014-10-03  8:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30 14:49 [PATCH] drm/core: use helper to check driver features Andrzej Hajda
2014-10-02 14:15 ` David Herrmann
2014-10-03  8:39   ` Daniel Vetter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141003083925.GD16117@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=a.hajda@samsung.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dh.herrmann@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox