diff options
author | Dave Airlie <airlied@redhat.com> | 2012-06-15 16:55:23 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-06-15 16:55:23 +0100 |
commit | 857179e538c9752fab239a21312d0fcc80022151 (patch) | |
tree | 66cc4a2b3753433b2c86251b53b1bfda352b033e /src/radeon.h | |
parent | 148e889149f5ecc3dc2473f2a9e01572eeb037d3 (diff) |
radeon: move macros into radeon.h
Drop separate header file, there isn't many separate macros now.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/radeon.h')
-rw-r--r-- | src/radeon.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/radeon.h b/src/radeon.h index 5d7190e5..46263686 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -747,6 +747,33 @@ do { \ info->accel_state->engineMode = EXA_ENGINEMODE_3D; \ } while (0); + /* Memory mapped register access macros */ + +#define BEGIN_ACCEL_RELOC(n, r) do { \ + int _nqw = (n) + (r); \ + BEGIN_RING(2*_nqw); \ + } while (0) + +#define EMIT_OFFSET(reg, value, pPix, rd, wd) do { \ + driver_priv = exaGetPixmapDriverPrivate(pPix); \ + OUT_RING_REG((reg), (value)); \ + OUT_RING_RELOC(driver_priv->bo, (rd), (wd)); \ + } while(0) + +#define EMIT_READ_OFFSET(reg, value, pPix) EMIT_OFFSET(reg, value, pPix, (RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT), 0) +#define EMIT_WRITE_OFFSET(reg, value, pPix) EMIT_OFFSET(reg, value, pPix, 0, RADEON_GEM_DOMAIN_VRAM) + +#define OUT_TEXTURE_REG(reg, offset, bo) do { \ + OUT_RING_REG((reg), (offset)); \ + OUT_RING_RELOC((bo), RADEON_GEM_DOMAIN_VRAM | RADEON_GEM_DOMAIN_GTT, 0); \ + } while(0) + +#define EMIT_COLORPITCH(reg, value, pPix) do { \ + driver_priv = exaGetPixmapDriverPrivate(pPix); \ + OUT_RING_REG((reg), value); \ + OUT_RING_RELOC(driver_priv->bo, 0, RADEON_GEM_DOMAIN_VRAM); \ +} while(0) + static __inline__ void RADEON_SYNC(RADEONInfoPtr info, ScrnInfoPtr pScrn) { if (pScrn->pScreen) |