diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2011-03-02 20:44:19 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-05-24 15:55:58 +1000 |
commit | b8ade97c9d0fa5aacb0e3166868bb72e9bc679a6 (patch) | |
tree | 6e30e7d614cc47b9a031f762418f5d878f964c9d /src/evergreen_exa.c | |
parent | 01b646ed800732985c1638b147716641a99082f9 (diff) |
cayman: first pass at exa/Xv shaders
Main differences with evergreen:
- 4-way rather than 5-way
- END_OF_PROGRAM bit removed from CF istructions, use
CF_INST_END instead.
- MEGA_FETCH* fields removed from VTX commands
- no more VC, all fetches go through the TC
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Diffstat (limited to 'src/evergreen_exa.c')
-rw-r--r-- | src/evergreen_exa.c | 76 |
1 files changed, 73 insertions, 3 deletions
diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c index 8879d011..58f3bf1c 100644 --- a/src/evergreen_exa.c +++ b/src/evergreen_exa.c @@ -43,6 +43,18 @@ #include "radeon_exa_shared.h" #include "radeon_vbo.h" +extern int cayman_solid_vs(RADEONChipFamily ChipSet, uint32_t* vs); +extern int cayman_solid_ps(RADEONChipFamily ChipSet, uint32_t* ps); + +extern int cayman_copy_vs(RADEONChipFamily ChipSet, uint32_t* vs); +extern int cayman_copy_ps(RADEONChipFamily ChipSet, uint32_t* ps); + +extern int cayman_xv_vs(RADEONChipFamily ChipSet, uint32_t* shader); +extern int cayman_xv_ps(RADEONChipFamily ChipSet, uint32_t* shader); + +extern int cayman_comp_vs(RADEONChipFamily ChipSet, uint32_t* vs); +extern int cayman_comp_ps(RADEONChipFamily ChipSet, uint32_t* ps); + static void EVERGREENDoneSolid(PixmapPtr pPix); @@ -1685,7 +1697,7 @@ EVERGREENAllocShaders(ScrnInfoPtr pScrn, ScreenPtr pScreen) return TRUE; } -Bool +static Bool EVERGREENLoadShaders(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); @@ -1738,6 +1750,59 @@ EVERGREENLoadShaders(ScrnInfoPtr pScrn) return TRUE; } +static Bool +CAYMANLoadShaders(ScrnInfoPtr pScrn) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + struct radeon_accel_state *accel_state = info->accel_state; + RADEONChipFamily ChipSet = info->ChipFamily; + uint32_t *shader; + int ret; + + ret = radeon_bo_map(accel_state->shaders_bo, 1); + if (ret) { + FatalError("failed to map shader %d\n", ret); + return FALSE; + } + shader = accel_state->shaders_bo->ptr; + + /* solid vs --------------------------------------- */ + accel_state->solid_vs_offset = 0; + cayman_solid_vs(ChipSet, shader + accel_state->solid_vs_offset / 4); + + /* solid ps --------------------------------------- */ + accel_state->solid_ps_offset = 512; + cayman_solid_ps(ChipSet, shader + accel_state->solid_ps_offset / 4); + + /* copy vs --------------------------------------- */ + accel_state->copy_vs_offset = 1024; + cayman_copy_vs(ChipSet, shader + accel_state->copy_vs_offset / 4); + + /* copy ps --------------------------------------- */ + accel_state->copy_ps_offset = 1536; + cayman_copy_ps(ChipSet, shader + accel_state->copy_ps_offset / 4); + + /* comp vs --------------------------------------- */ + accel_state->comp_vs_offset = 2048; + cayman_comp_vs(ChipSet, shader + accel_state->comp_vs_offset / 4); + + /* comp ps --------------------------------------- */ + accel_state->comp_ps_offset = 2560; + cayman_comp_ps(ChipSet, shader + accel_state->comp_ps_offset / 4); + + /* xv vs --------------------------------------- */ + accel_state->xv_vs_offset = 3072; + cayman_xv_vs(ChipSet, shader + accel_state->xv_vs_offset / 4); + + /* xv ps --------------------------------------- */ + accel_state->xv_ps_offset = 3584; + cayman_xv_ps(ChipSet, shader + accel_state->xv_ps_offset / 4); + + radeon_bo_unmap(accel_state->shaders_bo); + + return TRUE; +} + Bool EVERGREENDrawInit(ScreenPtr pScreen) { @@ -1837,8 +1902,13 @@ EVERGREENDrawInit(ScreenPtr pScreen) if (!EVERGREENAllocShaders(pScrn, pScreen)) return FALSE; - if (!EVERGREENLoadShaders(pScrn)) - return FALSE; + if (info->ChipFamily == CHIP_FAMILY_CAYMAN) { + if (!CAYMANLoadShaders(pScrn)) + return FALSE; + } else { + if (!EVERGREENLoadShaders(pScrn)) + return FALSE; + } exaMarkSync(pScreen); |