summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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);
}