summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-03-13 12:56:29 +1000
committerDave Airlie <airlied@redhat.com>2009-03-13 13:01:30 +1000
commitf70d7a0fd9ac3659d93511ab362eb80a7ff49777 (patch)
treeb4b1eb78521aeb960c2e5866984a05519b36ce3b
parent1fe0dcfe98dfe30499ba53c1f208c4ef10bef001 (diff)
r600: reload shaders into VRAM on resume
As VRAM gets zeroed out over s/r, we need to reload the shaders.
-rw-r--r--src/r600_exa.c20
-rw-r--r--src/radeon.h1
-rw-r--r--src/radeon_driver.c2
3 files changed, 19 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);
diff --git a/src/radeon.h b/src/radeon.h
index 4c966ec0..7bb720a0 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -1084,6 +1084,7 @@ extern void RADEONDoPrepareCopyMMIO(ScrnInfoPtr pScrn,
uint32_t datatype, int rop,
Pixel planemask);
extern Bool R600DrawInit(ScreenPtr pScreen);
+extern Bool R600LoadShaders(ScrnInfoPtr pScrn);
#endif
#if defined(XF86DRI) && defined(USE_EXA)
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 2456dc58..c0f5e7bf 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -5663,6 +5663,8 @@ Bool RADEONEnterVT(int scrnIndex, int flags)
#ifdef XF86DRI
if (info->directRenderingEnabled) {
+ if (info->ChipFamily >= CHIP_FAMILY_R600)
+ R600LoadShaders(pScrn);
RADEONCP_START(pScrn, info);
DRIUnlock(pScrn->pScreen);
}