summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-07-23 11:17:57 +1000
committerBen Skeggs <bskeggs@redhat.com>2010-07-26 11:42:55 +1000
commit49eed80ad0cfa5d5d02992e8088463cbf1a5ff85 (patch)
tree9cc245fada3cd7c3d0dd0cac18855a5bfb19c247
parent5620ba4680db0ba25b89952bdda41a9c8fd11f50 (diff)
downloadop-kernel-dev-49eed80ad0cfa5d5d02992e8088463cbf1a5ff85.zip
op-kernel-dev-49eed80ad0cfa5d5d02992e8088463cbf1a5ff85.tar.gz
drm/nouveau: add nv_mask register accessor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 11c0778..9d53f3d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -1186,6 +1186,14 @@ static inline void nv_wr32(struct drm_device *dev, unsigned reg, u32 val)
iowrite32_native(val, dev_priv->mmio + reg);
}
+static inline void nv_mask(struct drm_device *dev, u32 reg, u32 mask, u32 val)
+{
+ u32 tmp = nv_rd32(dev, reg);
+ tmp &= ~mask;
+ tmp |= val;
+ nv_wr32(dev, reg, tmp);
+}
+
static inline u8 nv_rd08(struct drm_device *dev, unsigned reg)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
OpenPOWER on IntegriCloud