summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-02-12 11:34:47 -0500
committerAlex Deucher <alexdeucher@gmail.com>2010-02-12 11:34:47 -0500
commit8ad4025affe1fb2f417e3a3031d74f83be5df253 (patch)
tree3559f1dc54dfc709ad2df7512b0def5807733348
parent4f9d1714a7382594b834d446bbe502663f6a2778 (diff)
radeon: consolidate crtc selector for vline wait
Use the Xv version as it takes into account the area covered by the op rather than just picking the largest crtc area.
-rw-r--r--src/r600_textured_videofuncs.c10
-rw-r--r--src/radeon.h2
-rw-r--r--src/radeon_exa.c28
-rw-r--r--src/radeon_exa_funcs.c12
-rw-r--r--src/radeon_exa_render.c4
-rw-r--r--src/radeon_textured_videofuncs.c40
-rw-r--r--src/radeon_video.c4
-rw-r--r--src/radeon_video.h4
8 files changed, 41 insertions, 63 deletions
diff --git a/src/r600_textured_videofuncs.c b/src/r600_textured_videofuncs.c
index 69deb815..f9794802 100644
--- a/src/r600_textured_videofuncs.c
+++ b/src/r600_textured_videofuncs.c
@@ -520,11 +520,11 @@ R600DisplayTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
if (pPriv->desired_crtc)
crtc = pPriv->desired_crtc;
else
- crtc = radeon_xv_pick_best_crtc(pScrn,
- pPriv->drw_x,
- pPriv->drw_x + pPriv->dst_w,
- pPriv->drw_y,
- pPriv->drw_y + pPriv->dst_h);
+ crtc = radeon_pick_best_crtc(pScrn,
+ pPriv->drw_x,
+ pPriv->drw_x + pPriv->dst_w,
+ pPriv->drw_y,
+ pPriv->drw_y + pPriv->dst_h);
if (crtc)
cp_wait_vline_sync(pScrn, accel_state->ib, pPixmap,
crtc,
diff --git a/src/radeon.h b/src/radeon.h
index 2138b4a1..0c775564 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -1319,6 +1319,8 @@ extern void RADEONUpdateHVPosition(xf86OutputPtr output, DisplayModePtr mode);
extern void RADEONInitVideo(ScreenPtr pScreen);
extern void RADEONResetVideo(ScrnInfoPtr pScrn);
extern Bool radeon_load_bicubic_texture(ScrnInfoPtr pScrn);
+extern xf86CrtcPtr radeon_pick_best_crtc(ScrnInfoPtr pScrn,
+ int x1, int x2, int y1, int y2);
/* radeon_legacy_memory.c */
extern uint32_t
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index 97733c3b..f8b0cc92 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -205,34 +205,6 @@ Bool RADEONGetPixmapOffsetPitch(PixmapPtr pPix, uint32_t *pitch_offset)
return RADEONGetOffsetPitch(pPix, bpp, pitch_offset, offset, pitch);
}
-/*
- * Used for vblank render stalling.
- * Ideally we'd have one pixmap per crtc.
- * syncing per-blit is unrealistic so,
- * we sync to whichever crtc has a larger area.
- */
-xf86CrtcPtr RADEONBiggerCrtcArea(PixmapPtr pPix)
-{
- ScrnInfoPtr pScrn = xf86Screens[pPix->drawable.pScreen->myNum];
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
- int c, area = 0;
- xf86CrtcPtr ret_crtc = NULL;
-
- for (c = 0; c < xf86_config->num_crtc; c++) {
- xf86CrtcPtr crtc = xf86_config->crtc[c];
-
- if (!crtc->enabled)
- continue;
-
- if ((crtc->mode.HDisplay * crtc->mode.VDisplay) > area) {
- area = crtc->mode.HDisplay * crtc->mode.VDisplay;
- ret_crtc = crtc;
- }
- }
-
- return ret_crtc;
-}
-
#if X_BYTE_ORDER == X_BIG_ENDIAN
static unsigned long swapper_surfaces[6];
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index 6d2522a6..a3098d8f 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -226,7 +226,9 @@ FUNC_NAME(RADEONSolid)(PixmapPtr pPix, int x1, int y1, int x2, int y2)
#endif
if (info->accel_state->vsync)
- FUNC_NAME(RADEONWaitForVLine)(pScrn, pPix, RADEONBiggerCrtcArea(pPix), y1, y2);
+ FUNC_NAME(RADEONWaitForVLine)(pScrn, pPix,
+ radeon_pick_best_crtc(pScrn, x1, y1, x2, y2),
+ y1, y2);
BEGIN_ACCEL(2);
OUT_ACCEL_REG(RADEON_DST_Y_X, (y1 << 16) | x1);
@@ -345,7 +347,9 @@ FUNC_NAME(RADEONCopy)(PixmapPtr pDst,
}
if (info->accel_state->vsync)
- FUNC_NAME(RADEONWaitForVLine)(pScrn, pDst, RADEONBiggerCrtcArea(pDst), dstY, dstY + h);
+ FUNC_NAME(RADEONWaitForVLine)(pScrn, pDst,
+ radeon_pick_best_crtc(pScrn, dstX, dstY, dstX + w, dstY + h),
+ dstY, dstY + h);
BEGIN_ACCEL(3);
@@ -381,7 +385,9 @@ RADEONUploadToScreenCP(PixmapPtr pDst, int x, int y, int w, int h,
RADEON_SWITCH_TO_2D();
if (info->accel_state->vsync)
- FUNC_NAME(RADEONWaitForVLine)(pScrn, pDst, RADEONBiggerCrtcArea(pDst), y, y + h);
+ FUNC_NAME(RADEONWaitForVLine)(pScrn, pDst,
+ radeon_pick_best_crtc(pScrn, x, y, x + w, y + h),
+ y, y + h);
while ((buf = RADEONHostDataBlit(pScrn,
cpp, w, dst_pitch_off, &buf_pitch,
diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index c1448900..7f350fb6 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -2255,7 +2255,9 @@ static void FUNC_NAME(RadeonCompositeTile)(ScrnInfoPtr pScrn,
vtx_count = 4;
if (info->accel_state->vsync)
- FUNC_NAME(RADEONWaitForVLine)(pScrn, pDst, RADEONBiggerCrtcArea(pDst), dstY, dstY + h);
+ FUNC_NAME(RADEONWaitForVLine)(pScrn, pDst,
+ radeon_pick_best_crtc(pScrn, dstX, dstY, dstX + w, dstY + h),
+ dstY, dstY + h);
#ifdef ACCEL_CP
if (info->ChipFamily < CHIP_FAMILY_R200) {
diff --git a/src/radeon_textured_videofuncs.c b/src/radeon_textured_videofuncs.c
index 3492a1db..92dbe901 100644
--- a/src/radeon_textured_videofuncs.c
+++ b/src/radeon_textured_videofuncs.c
@@ -360,11 +360,11 @@ FUNC_NAME(RADEONDisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv
if (pPriv->desired_crtc)
crtc = pPriv->desired_crtc;
else
- crtc = radeon_xv_pick_best_crtc(pScrn,
- pPriv->drw_x,
- pPriv->drw_x + pPriv->dst_w,
- pPriv->drw_y,
- pPriv->drw_y + pPriv->dst_h);
+ crtc = radeon_pick_best_crtc(pScrn,
+ pPriv->drw_x,
+ pPriv->drw_x + pPriv->dst_w,
+ pPriv->drw_y,
+ pPriv->drw_y + pPriv->dst_h);
if (crtc)
FUNC_NAME(RADEONWaitForVLine)(pScrn, pPixmap,
crtc,
@@ -928,11 +928,11 @@ FUNC_NAME(R200DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
if (pPriv->desired_crtc)
crtc = pPriv->desired_crtc;
else
- crtc = radeon_xv_pick_best_crtc(pScrn,
- pPriv->drw_x,
- pPriv->drw_x + pPriv->dst_w,
- pPriv->drw_y,
- pPriv->drw_y + pPriv->dst_h);
+ crtc = radeon_pick_best_crtc(pScrn,
+ pPriv->drw_x,
+ pPriv->drw_x + pPriv->dst_w,
+ pPriv->drw_y,
+ pPriv->drw_y + pPriv->dst_h);
if (crtc)
FUNC_NAME(RADEONWaitForVLine)(pScrn, pPixmap,
crtc,
@@ -2304,11 +2304,11 @@ FUNC_NAME(R300DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
if (pPriv->desired_crtc)
crtc = pPriv->desired_crtc;
else
- crtc = radeon_xv_pick_best_crtc(pScrn,
- pPriv->drw_x,
- pPriv->drw_x + pPriv->dst_w,
- pPriv->drw_y,
- pPriv->drw_y + pPriv->dst_h);
+ crtc = radeon_pick_best_crtc(pScrn,
+ pPriv->drw_x,
+ pPriv->drw_x + pPriv->dst_w,
+ pPriv->drw_y,
+ pPriv->drw_y + pPriv->dst_h);
if (crtc)
FUNC_NAME(RADEONWaitForVLine)(pScrn, pPixmap,
crtc,
@@ -3888,11 +3888,11 @@ FUNC_NAME(R500DisplayTexturedVideo)(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
if (pPriv->desired_crtc)
crtc = pPriv->desired_crtc;
else
- crtc = radeon_xv_pick_best_crtc(pScrn,
- pPriv->drw_x,
- pPriv->drw_x + pPriv->dst_w,
- pPriv->drw_y,
- pPriv->drw_y + pPriv->dst_h);
+ crtc = radeon_pick_best_crtc(pScrn,
+ pPriv->drw_x,
+ pPriv->drw_x + pPriv->dst_w,
+ pPriv->drw_y,
+ pPriv->drw_y + pPriv->dst_h);
if (crtc)
FUNC_NAME(RADEONWaitForVLine)(pScrn, pPixmap,
crtc,
diff --git a/src/radeon_video.c b/src/radeon_video.c
index b1b3f158..d7700fa0 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -136,8 +136,8 @@ radeon_box_area(BoxPtr box)
}
xf86CrtcPtr
-radeon_xv_pick_best_crtc(ScrnInfoPtr pScrn,
- int x1, int x2, int y1, int y2)
+radeon_pick_best_crtc(ScrnInfoPtr pScrn,
+ int x1, int x2, int y1, int y2)
{
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
int coverage, best_coverage, c;
diff --git a/src/radeon_video.h b/src/radeon_video.h
index 1b8f6842..be3df697 100644
--- a/src/radeon_video.h
+++ b/src/radeon_video.h
@@ -140,10 +140,6 @@ typedef struct tagREF_TRANSFORM
#define RTFContrast(a) (1.0 + ((a)*1.0)/1000.0)
#define RTFHue(a) (((a)*3.1416)/1000.0)
-xf86CrtcPtr
-radeon_xv_pick_best_crtc(ScrnInfoPtr pScrn,
- int x1, int x2, int y1, int y2);
-
void RADEONInitI2C(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv);
void RADEONResetI2C(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv);