drm/nouveau: add nv_mask register accessor
authorBen Skeggs <bskeggs@redhat.com>
Fri, 23 Jul 2010 01:17:57 +0000 (11:17 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 26 Jul 2010 01:42:55 +0000 (11:42 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_drv.h

index 11c077899a121cba8322faca65d8c4034d3e2389..9d53f3d1487d452ba1e620628c6b3cfbae33b90f 100644 (file)
@@ -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;