All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "Thomas Hellstrom" <thellstrom@vmware.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	openchrome-devel@lists.freedesktop.org,
	"Kevin Brace" <kevinbrace@gmx.com>,
	"ML dri-devel" <dri-devel@lists.freedesktop.org>,
	"Emil Velikov" <emil.velikov@collabora.com>,
	"Ira Weiny" <ira.weiny@intel.com>,
	"Michel Dänzer" <michel@daenzer.net>,
	"Mike Marshall" <hubcap@omnibond.com>
Subject: Re: [PATCH v2 1/4] drm/via: drop use of DRM(READ|WRITE) macros
Date: Mon, 22 Jul 2019 18:17:20 +0200	[thread overview]
Message-ID: <20190722161720.GA14638@ravnborg.org> (raw)
In-Reply-To: <CACvgo52wD5pMjz4jEFMJXQ3kb-PDOkjyfGHhR5PeAT72otjv1g@mail.gmail.com>

Hi Emil.

On Mon, Jul 22, 2019 at 04:38:39PM +0100, Emil Velikov wrote:
> On Sat, 20 Jul 2019 at 09:46, Sam Ravnborg <sam@ravnborg.org> wrote:
> >
> > The DRM_READ, DRM_WRITE macros comes from the deprecated drm_os_linux.h
> > header file. Remove their use to remove this dependency.
> >
> > Replace the use of the macros with open coded variants.
> >
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Kevin Brace <kevinbrace@gmx.com>
> > Cc: Thomas Hellstrom <thellstrom@vmware.com>
> > Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
> > Cc: Mike Marshall <hubcap@omnibond.com>
> > Cc: Ira Weiny <ira.weiny@intel.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Emil Velikov <emil.velikov@collabora.com>
> > Cc: Michel Dänzer <michel@daenzer.net>
> > ---
> >  drivers/gpu/drm/via/via_drv.h | 15 +++++++++++----
> >  1 file changed, 11 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
> > index 6d1ae834484c..d5a2b1ffd8c1 100644
> > --- a/drivers/gpu/drm/via/via_drv.h
> > +++ b/drivers/gpu/drm/via/via_drv.h
> > @@ -115,10 +115,17 @@ enum via_family {
> >  /* VIA MMIO register access */
> >  #define VIA_BASE ((dev_priv->mmio))
> >
> > -#define VIA_READ(reg)          DRM_READ32(VIA_BASE, reg)
> > -#define VIA_WRITE(reg, val)    DRM_WRITE32(VIA_BASE, reg, val)
> > -#define VIA_READ8(reg)         DRM_READ8(VIA_BASE, reg)
> > -#define VIA_WRITE8(reg, val)   DRM_WRITE8(VIA_BASE, reg, val)
> > +#define VIA_READ(reg) \
> > +       readl(((void __iomem *)VIA_BASE->handle) + (reg))
> > +
> > +#define VIA_WRITE(reg, val) \
> > +       writel(val, ((void __iomem *)VIA_BASE->handle) + (reg))
> > +
> > +#define VIA_READ8(reg) \
> > +       readb(((void __iomem *)VIA_BASE->handle) + (reg))
> > +
> > +#define VIA_WRITE8(reg, val) \
> > +       writeb(val, ((void __iomem *)VIA_BASE->handle) + (reg))
> >
> IMHO a far better idea is to expand these macros as static inline functions.
> The extra bonus here is that the pseudo-magical VIA_BASE will also disappear.
> 
> Since all the VIA_READ8 are used for masking, one might as well drop
> them in favour of via_mask().
> 
> WDYT?

As this is a legacy driver I like the steps to be small.
So we keep it like this but maybe address it in a follow-up patch?

	Sam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-07-22 16:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-20  8:45 [PATCH v2 0/6] drm/via: drop use of deprecated headers drmP.h and drm_os_linux.h Sam Ravnborg
2019-07-20  8:45 ` [PATCH v2 1/4] drm/via: drop use of DRM(READ|WRITE) macros Sam Ravnborg
2019-07-22 15:38   ` Emil Velikov
2019-07-22 16:17     ` Sam Ravnborg [this message]
2019-07-22 16:27       ` Emil Velikov
2019-07-22 18:27         ` Sam Ravnborg
2019-07-23 11:49           ` Emil Velikov
2019-07-23 19:01             ` Sam Ravnborg
2019-07-20  8:45 ` [PATCH v2 2/4] drm/via: add VIA_WAIT_ON() Sam Ravnborg
2019-07-22 15:46   ` Emil Velikov
2019-07-22 16:18     ` Sam Ravnborg
2019-07-20  8:45 ` [PATCH v2 3/4] drm/via: make via_drv.h self-contained Sam Ravnborg
2019-07-22 16:21   ` Emil Velikov
2019-07-20  8:45 ` [PATCH v2 4/4] drm/via: drop use of drmP.h Sam Ravnborg
2019-07-22 16:22   ` Emil Velikov

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=20190722161720.GA14638@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=emil.velikov@collabora.com \
    --cc=gustavo@embeddedor.com \
    --cc=hubcap@omnibond.com \
    --cc=ira.weiny@intel.com \
    --cc=kevinbrace@gmx.com \
    --cc=michel@daenzer.net \
    --cc=openchrome-devel@lists.freedesktop.org \
    --cc=thellstrom@vmware.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.