radeon: move state changes into flush function

This commit is contained in:
Dave Airlie
2009-07-06 15:29:53 +10:00
parent 503b513432
commit 98824f37fc

View File

@@ -73,12 +73,17 @@ const OptionInfoRec RADEONOptions_KMS[] = {
void radeon_cs_flush_indirect(ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
int ret;
if (!info->cs->cdw)
return;
radeon_cs_emit(info->cs);
radeon_cs_erase(info->cs);
ret = radeon_cs_space_check(info->cs);
if (ret)
ErrorF("space check failed in flush\n");
if (info->reemit_current2d)
info->reemit_current2d(pScrn, 0);
if (info->dri2.enabled) {
@@ -92,14 +97,10 @@ void radeon_ddx_cs_start(ScrnInfoPtr pScrn,
const char *func, int line)
{
RADEONInfoPtr info = RADEONPTR(pScrn);
int ret;
if (info->cs->cdw + n > info->cs->ndw) {
radeon_cs_flush_indirect(pScrn);
ret = radeon_cs_space_check(info->cs);
if (ret)
ErrorF("space check failed in DDX CS start %s:%s:%d\n",
file, func, line);
}
radeon_cs_begin(info->cs, n, file, func, line);
}