-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/nouveau: have non-core mmio accesses go through device object
Adds an extra layer of indirection to each register access, but it's not too bad, and will also go away as pieces are ported. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
- Loading branch information
Ben Skeggs
committed
Oct 3, 2012
1 parent
9458029
commit 586c55f
Showing
5 changed files
with
99 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "nouveau_drm.h" | ||
#include "nouveau_compat.h" | ||
|
||
void *nouveau_newpriv(struct drm_device *); | ||
|
||
u8 | ||
_nv_rd08(struct drm_device *dev, u32 reg) | ||
{ | ||
struct nouveau_drm *drm = nouveau_newpriv(dev); | ||
return nv_ro08(drm->device, reg); | ||
} | ||
|
||
void | ||
_nv_wr08(struct drm_device *dev, u32 reg, u8 val) | ||
{ | ||
struct nouveau_drm *drm = nouveau_newpriv(dev); | ||
nv_wo08(drm->device, reg, val); | ||
} | ||
|
||
u32 | ||
_nv_rd32(struct drm_device *dev, u32 reg) | ||
{ | ||
struct nouveau_drm *drm = nouveau_newpriv(dev); | ||
return nv_ro32(drm->device, reg); | ||
} | ||
|
||
void | ||
_nv_wr32(struct drm_device *dev, u32 reg, u32 val) | ||
{ | ||
struct nouveau_drm *drm = nouveau_newpriv(dev); | ||
nv_wo32(drm->device, reg, val); | ||
} | ||
|
||
u32 | ||
_nv_mask(struct drm_device *dev, u32 reg, u32 mask, u32 val) | ||
{ | ||
u32 tmp = _nv_rd32(dev, reg); | ||
_nv_wr32(dev, reg, (tmp & ~mask) | val); | ||
return tmp; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef __NOUVEAU_COMPAT_H__ | ||
#define __NOUVEAU_COMPAT_H__ | ||
|
||
u8 _nv_rd08(struct drm_device *, u32); | ||
void _nv_wr08(struct drm_device *, u32, u8); | ||
u32 _nv_rd32(struct drm_device *, u32); | ||
void _nv_wr32(struct drm_device *, u32, u32); | ||
u32 _nv_mask(struct drm_device *, u32, u32, u32); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters