lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKMK7uFwsQ4pVpAtsP4RBCY2RNkvcnc+QqTkEX5VT+pkJ-kLVA@mail.gmail.com>
Date:   Fri, 28 Jun 2019 09:50:49 +0200
From:   Daniel Vetter <daniel@...ll.ch>
To:     Thomas Zimmermann <tzimmermann@...e.de>
Cc:     Gerd Hoffmann <kraxel@...hat.com>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        Maxime Ripard <maxime.ripard@...tlin.com>,
        David Airlie <airlied@...ux.ie>,
        Christian König <ckoenig.leichtzumerken@...il.com>,
        open list <linux-kernel@...r.kernel.org>,
        Xinliang Liu <z.liuxinliang@...ilicon.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Xinwei Kong <kong.kongxinwei@...ilicon.com>,
        Chen Feng <puck.chen@...ilicon.com>,
        Rongrong Zou <zourongrong@...il.com>,
        Dave Airlie <airlied@...hat.com>, Sean Paul <sean@...rly.run>
Subject: Re: [PATCH v2 02/18] drm/vram: use embedded gem object

On Fri, Jun 28, 2019 at 9:30 AM Thomas Zimmermann <tzimmermann@...e.de> wrote:
>
> Hi
>
> Am 21.06.19 um 13:57 schrieb Gerd Hoffmann:
> > Drop drm_gem_object from drm_gem_vram_object, use the
> > ttm_buffer_object.base instead.
> >
> > Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>
> > ---
> >  include/drm/drm_gem_vram_helper.h           |  3 +--
> >  drivers/gpu/drm/ast/ast_main.c              |  2 +-
> >  drivers/gpu/drm/drm_gem_vram_helper.c       | 16 ++++++++--------
> >  drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c |  2 +-
> >  drivers/gpu/drm/mgag200/mgag200_main.c      |  2 +-
> >  drivers/gpu/drm/vboxvideo/vbox_main.c       |  2 +-
> >  6 files changed, 13 insertions(+), 14 deletions(-)
> >
> > diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h
> > index 9581ea0a4f7e..7b9f50ba3fce 100644
> > --- a/include/drm/drm_gem_vram_helper.h
> > +++ b/include/drm/drm_gem_vram_helper.h
> > @@ -36,7 +36,6 @@ struct vm_area_struct;
> >   * video memory becomes scarce.
> >   */
> >  struct drm_gem_vram_object {
> > -     struct drm_gem_object gem;
> >       struct ttm_buffer_object bo;
> >       struct ttm_bo_kmap_obj kmap;
> >
> > @@ -68,7 +67,7 @@ static inline struct drm_gem_vram_object *drm_gem_vram_of_bo(
> >  static inline struct drm_gem_vram_object *drm_gem_vram_of_gem(
> >       struct drm_gem_object *gem)
>
> To avoid ambiguities, I used the form <destination type name>_of_<field
> name>() to name these cast functions. The canonical name here would now
> be drm_gem_vram_of_bo_base(). But that's just nitpicking. If you don't
> want to change the name (and all its callers), maybe leave a FIXME comment.

Bikeshed: I think generally we call these
<source_type>_to_<destination_type>, with the source type left out if
you cast from the most generic version. E.g. this one here would just
be

static inline struct drm_gem_vram_object *drm_gem_to_vram_bo(struct
drm_gem_object *gem)

or something like that. I don't remember having seen the *_of_*
pattern anywhere.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ