xf86-video-ati: Branch 'master' - 3 commits
Dave Airlie
airlied at kemper.freedesktop.org
Wed Jul 1 22:21:29 PDT 2009
src/radeon_commonfuncs.c | 2
src/radeon_kms.c | 12 ----
src/radeon_textured_video.c | 8 ++
src/radeon_textured_videofuncs.c | 114 +++++++++++++++++++++++++++++++--------
4 files changed, 102 insertions(+), 34 deletions(-)
New commits:
commit 851b2b8cab883e4422745cca1827aa8ac9f193a3
Author: Dave Airlie <airlied at redhat.com>
Date: Thu Jul 2 15:17:13 2009 +1000
radeon/kms: add textured video BO size checks
diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c
index 10414b9..184258c 100644
--- a/src/radeon_textured_video.c
+++ b/src/radeon_textured_video.c
@@ -137,6 +137,14 @@ static REF_TRANSFORM trans[2] =
{1.1643, 0.0, 1.7927, -0.2132, -0.5329, 2.1124, 0.0} /* BT.709 */
};
+static inline void radeon_add_bo(struct radeon_cs_space_check *bos, int index, struct radeon_bo *bo, int read_domains, int write_domain)
+{
+ bos[index].bo = bo;
+ bos[index].read_domains = read_domains;
+ bos[index].write_domain = write_domain;
+ bos[index].new_accounted = 0;
+}
+
#define ACCEL_MMIO
#define ACCEL_PREAMBLE() unsigned char *RADEONMMIO = info->MMIO
#define BEGIN_ACCEL(n) RADEONWaitForFifo(pScrn, (n))
diff --git a/src/radeon_textured_videofuncs.c b/src/radeon_textured_videofuncs.c
index b9930c7..2efe449 100644
--- a/src/radeon_textured_videofuncs.c
+++ b/src/radeon_textured_videofuncs.c
@@ -106,39 +106,25 @@ FUNC_NAME(RADEONDisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv
retry:
if (info->cs) {
-
i = 0;
- bos[i].bo = pPriv->src_bo;
- bos[i].read_domains = RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM;
- bos[i].write_domain = 0;
- bos[i].new_accounted = 0;
- i++;
+ radeon_add_bo(bos, i++, pPriv->src_bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
- if (pPriv->bicubic_enabled) {
- bos[i].bo = pPriv->bicubic_bo;
- bos[i].read_domains = RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM;
- bos[i].write_domain = 0;
- bos[i].new_accounted = 0;
- i++;
- }
+ if (pPriv->bicubic_enabled)
+ radeon_add_bo(bos, i++, pPriv->bicubic_bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
driver_priv = exaGetPixmapDriverPrivate(pPixmap);
- bos[i].bo = driver_priv->bo;
- bos[i].read_domains = 0;
- bos[i].write_domain = RADEON_GEM_DOMAIN_VRAM;
- bos[i].new_accounted = 0;
- i++;
+ radeon_add_bo(bos, i++, driver_priv->bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
ret = radeon_cs_space_check(info->cs, bos, i);
if (ret == RADEON_CS_SPACE_OP_TO_BIG) {
- ErrorF("Not enough RAM to hw accel composite operation\n");
+ ErrorF("Not enough RAM to hw accel xv operation\n");
return;
}
if (ret == RADEON_CS_SPACE_FLUSH) {
radeon_cs_flush_indirect(pScrn);
retry_count++;
if (retry_count == 2) {
- ErrorF("Not enough RAM to hw accel composite operation\n");
+ ErrorF("Not enough RAM to hw accel xv operation\n");
return;
}
goto retry;
@@ -511,9 +497,37 @@ FUNC_NAME(R200DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
int ref = pPriv->transform_index;
float ucscale = 0.25, vcscale = 0.25;
Bool needux8 = FALSE, needvx8 = FALSE;
-
+ struct radeon_cs_space_check bos[3];
+ int i, ret, retry_count = 0;
ACCEL_PREAMBLE();
+ retry:
+ if (info->cs) {
+ i = 0;
+ radeon_add_bo(bos, i++, pPriv->src_bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
+
+ if (pPriv->bicubic_enabled)
+ radeon_add_bo(bos, i++, pPriv->bicubic_bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
+
+ driver_priv = exaGetPixmapDriverPrivate(pPixmap);
+ radeon_add_bo(bos, i++, driver_priv->bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
+
+ ret = radeon_cs_space_check(info->cs, bos, i);
+ if (ret == RADEON_CS_SPACE_OP_TO_BIG) {
+ ErrorF("Not enough RAM to hw accel xv operation\n");
+ return;
+ }
+ if (ret == RADEON_CS_SPACE_FLUSH) {
+ radeon_cs_flush_indirect(pScrn);
+ retry_count++;
+ if (retry_count == 2) {
+ ErrorF("Not enough RAM to hw accel xv operation\n");
+ return;
+ }
+ goto retry;
+ }
+ }
+
pixel_shift = pPixmap->drawable.bitsPerPixel >> 4;
#ifdef USE_EXA
@@ -1033,8 +1047,37 @@ FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
int dstxoff, dstyoff, pixel_shift, vtx_count;
BoxPtr pBox = REGION_RECTS(&pPriv->clip);
int nBox = REGION_NUM_RECTS(&pPriv->clip);
+ struct radeon_cs_space_check bos[3];
+ int i, ret, retry_count = 0;
ACCEL_PREAMBLE();
+ retry:
+ if (info->cs) {
+ i = 0;
+ radeon_add_bo(bos, i++, pPriv->src_bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
+
+ if (pPriv->bicubic_enabled)
+ radeon_add_bo(bos, i++, pPriv->bicubic_bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
+
+ driver_priv = exaGetPixmapDriverPrivate(pPixmap);
+ radeon_add_bo(bos, i++, driver_priv->bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
+
+ ret = radeon_cs_space_check(info->cs, bos, i);
+ if (ret == RADEON_CS_SPACE_OP_TO_BIG) {
+ ErrorF("Not enough RAM to hw accel xv operation\n");
+ return;
+ }
+ if (ret == RADEON_CS_SPACE_FLUSH) {
+ radeon_cs_flush_indirect(pScrn);
+ retry_count++;
+ if (retry_count == 2) {
+ ErrorF("Not enough RAM to hw accel xv operation\n");
+ return;
+ }
+ goto retry;
+ }
+ }
+
pixel_shift = pPixmap->drawable.bitsPerPixel >> 4;
#ifdef USE_EXA
@@ -2463,8 +2506,37 @@ FUNC_NAME(R500DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
int dstxoff, dstyoff, pixel_shift, vtx_count;
BoxPtr pBox = REGION_RECTS(&pPriv->clip);
int nBox = REGION_NUM_RECTS(&pPriv->clip);
+ struct radeon_cs_space_check bos[3];
+ int i, ret, retry_count = 0;
ACCEL_PREAMBLE();
+ retry:
+ if (info->cs) {
+ i = 0;
+ radeon_add_bo(bos, i++, pPriv->src_bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
+
+ if (pPriv->bicubic_enabled)
+ radeon_add_bo(bos, i++, pPriv->bicubic_bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
+
+ driver_priv = exaGetPixmapDriverPrivate(pPixmap);
+ radeon_add_bo(bos, i++, driver_priv->bo, RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
+
+ ret = radeon_cs_space_check(info->cs, bos, i);
+ if (ret == RADEON_CS_SPACE_OP_TO_BIG) {
+ ErrorF("Not enough RAM to hw accel xv operation\n");
+ return;
+ }
+ if (ret == RADEON_CS_SPACE_FLUSH) {
+ radeon_cs_flush_indirect(pScrn);
+ retry_count++;
+ if (retry_count == 2) {
+ ErrorF("Not enough RAM to hw accel xv operation\n");
+ return;
+ }
+ goto retry;
+ }
+ }
+
pixel_shift = pPixmap->drawable.bitsPerPixel >> 4;
#ifdef USE_EXA
commit 9d092060236e8587697fdd57a7a01f3c0dddd680
Author: Dave Airlie <airlied at redhat.com>
Date: Thu Jul 2 15:17:03 2009 +1000
kms: drop DGA
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 5c570ac..cd3ec9a 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -465,13 +465,6 @@ static Bool RADEONCloseScreen_KMS(int scrnIndex, ScreenPtr pScreen)
if (info->cursor) xf86DestroyCursorInfoRec(info->cursor);
info->cursor = NULL;
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
- "Disposing DGA\n");
- if (info->DGAModes) xfree(info->DGAModes);
- info->DGAModes = NULL;
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
- "Unmapping memory\n");
-
pScrn->vtSema = FALSE;
xf86ClearPrimInitDone(info->pEnt->index);
pScreen->BlockHandler = info->BlockHandler;
@@ -650,11 +643,6 @@ Bool RADEONScreenInit_KMS(int scrnIndex, ScreenPtr pScreen,
}
}
- /* DGA setup */
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
- "Initializing DGA\n");
- RADEONDGAInit(pScreen);
-
/* Init Xv */
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Initializing Xv\n");
commit 207174ea964c561076bdd5297a2fb6f136b4b645
Author: Dave Airlie <airlied at redhat.com>
Date: Thu Jul 2 15:16:47 2009 +1000
radeon: fix CS imbalance
diff --git a/src/radeon_commonfuncs.c b/src/radeon_commonfuncs.c
index 96c84e8..f2554bb 100644
--- a/src/radeon_commonfuncs.c
+++ b/src/radeon_commonfuncs.c
@@ -110,7 +110,7 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn)
OUT_ACCEL_REG(RADEON_WAIT_UNTIL, RADEON_WAIT_2D_IDLECLEAN | RADEON_WAIT_3D_IDLECLEAN);
FINISH_ACCEL();
- BEGIN_ACCEL(5);
+ BEGIN_ACCEL(3);
OUT_ACCEL_REG(R300_GB_AA_CONFIG, 0);
OUT_ACCEL_REG(R300_RB3D_DSTCACHE_CTLSTAT, R300_DC_FLUSH_3D | R300_DC_FREE_3D);
OUT_ACCEL_REG(R300_RB3D_ZCACHE_CTLSTAT, R300_ZC_FLUSH | R300_ZC_FREE);
More information about the xorg-commit
mailing list