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 20:27:31 +0200 [thread overview]
Message-ID: <20190722182731.GA791@ravnborg.org> (raw)
In-Reply-To: <CACvgo51_T1rcTnK7dYtQVdRTtcEd8am04THidD-CrHwdS3hk9w@mail.gmail.com>
Hi Email.
> > > 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().
Like this:
static inline u32 via_read(struct drm_via_private *dev_priv, u32 reg)
{
return readl((void __iomem *)(dev_priv->mmio->handle + reg));
}
static inline void via_write(struct drm_via_private *dev_priv, u32 reg,
u32 val)
{
writel(val, (void __iomem *)(dev_priv->mmio->handle + reg));
}
static inline void via_write8(struct drm_via_private *dev_priv, u32 reg,
u32 val)
{
writeb(val, (void __iomem *)(dev_priv->mmio->handle + reg));
}
static inline void via_write8_mask_or(struct drm_via_private *dev_priv,
u32 reg, u32 mask)
{
u32 val;
val = readb((void __iomem *)(dev_priv->mmio->handle + reg));
writeb(val | mask, (void __iomem *)(dev_priv->mmio->handle + reg));
}
static inline void via_write8_mask_and(struct drm_via_private *dev_priv,
u32 reg, u32 mask)
{
u32 val;
val = readb((void __iomem *)(dev_priv->mmio->handle + reg));
writeb(val & mask, (void __iomem *)(dev_priv->mmio->handle + reg));
}
Patches are almost ready, but if there is any quick feedback let me
know.
Sam
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-07-22 18:27 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
2019-07-22 16:27 ` Emil Velikov
2019-07-22 18:27 ` Sam Ravnborg [this message]
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=20190722182731.GA791@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox