diff options
author | Dave Airlie <airlied@redhat.com> | 2009-03-13 12:56:29 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-03-13 13:01:30 +1000 |
commit | f70d7a0fd9ac3659d93511ab362eb80a7ff49777 (patch) | |
tree | b4b1eb78521aeb960c2e5866984a05519b36ce3b /src/r600_exa.c | |
parent | 1fe0dcfe98dfe30499ba53c1f208c4ef10bef001 (diff) |
r600: reload shaders into VRAM on resume
As VRAM gets zeroed out over s/r, we need to reload the
shaders.
Diffstat (limited to 'src/r600_exa.c')
-rw-r--r-- | src/r600_exa.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/r600_exa.c b/src/r600_exa.c index 3a4dc8df..f16e040f 100644 --- a/src/r600_exa.c +++ b/src/r600_exa.c @@ -1963,12 +1963,11 @@ R600Sync(ScreenPtr pScreen, int marker) } static Bool -R600LoadShaders(ScrnInfoPtr pScrn, ScreenPtr pScreen) +R600AllocShaders(ScrnInfoPtr pScrn, ScreenPtr pScreen) { RADEONInfoPtr info = RADEONPTR(pScrn); struct radeon_accel_state *accel_state = info->accel_state; - RADEONChipFamily ChipSet = info->ChipFamily; - uint32_t *shader; + /* 512 bytes per shader for now */ int size = 512 * 9; @@ -1979,6 +1978,16 @@ R600LoadShaders(ScrnInfoPtr pScrn, ScreenPtr pScreen) if (accel_state->shaders == NULL) return FALSE; + return TRUE; +} + +Bool +R600LoadShaders(ScrnInfoPtr pScrn) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + struct radeon_accel_state *accel_state = info->accel_state; + RADEONChipFamily ChipSet = info->ChipFamily; + uint32_t *shader; shader = (pointer)((char *)info->FB + accel_state->shaders->offset); @@ -2117,7 +2126,10 @@ R600DrawInit(ScreenPtr pScreen) info->accel_state->XInited3D = FALSE; info->accel_state->copy_area = NULL; - if (!R600LoadShaders(pScrn, pScreen)) + if (!R600AllocShaders(pScrn, pScreen)) + return FALSE; + + if (!R600LoadShaders(pScrn)) return FALSE; exaMarkSync(pScreen); |