summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-01-22 22:11:55 +1100
committerDave Airlie <airlied@linux.ie>2007-01-22 22:11:55 +1100
commit26e1bab2c7a4ad52710746265b3da495b54dab36 (patch)
tree5c2d3ba5b11a62c93a9bd3b3083bc033781928ca
parent9008e1caa45e4a18e6f3289c7b17036730fe578a (diff)
radeon: fixup some of the video code after randr
This may not be complete, I need to test on dual-head system later
-rw-r--r--src/radeon.h9
-rw-r--r--src/radeon_display.c11
-rw-r--r--src/radeon_video.c72
3 files changed, 42 insertions, 50 deletions
diff --git a/src/radeon.h b/src/radeon.h
index 4d3f96d6..4f77bd38 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -781,19 +781,10 @@ typedef struct {
ScrnInfoPtr CRT2pScrn;
DisplayModePtr CRT1Modes;
DisplayModePtr CRT1CurrentMode;
- int CRT1frameX0;
- int CRT1frameY0;
- int CRT1frameX1;
- int CRT1frameY1;
RADEONMonitorType MergeType;
RADEONDDCType MergeDDCType;
void (*PointerMoved)(int index, int x, int y);
/* pseudo xinerama support for mergedfb */
- int maxCRT1_X1, maxCRT1_X2, maxCRT1_Y1, maxCRT1_Y2;
- int maxCRT2_X1, maxCRT2_X2, maxCRT2_Y1, maxCRT2_Y2;
- int maxClone_X1, maxClone_X2, maxClone_Y1, maxClone_Y2;
- Bool UseRADEONXinerama;
- Bool CRT2IsScrn0;
ExtensionEntry *XineramaExtEntry;
int RADEONXineramaVX, RADEONXineramaVY;
Bool AtLeastOneNonClone;
diff --git a/src/radeon_display.c b/src/radeon_display.c
index a02167a4..afe6f944 100644
--- a/src/radeon_display.c
+++ b/src/radeon_display.c
@@ -2765,16 +2765,17 @@ RADEONChooseOverlayCRTC(ScrnInfoPtr pScrn, BoxPtr dstBox)
for (c = 0; c < xf86_config->num_crtc; c++)
{
- xf86CrtcPtr crtc = xf86_config->crtc[c];
+ xf86CrtcPtr crtc = xf86_config->crtc[c];
+
if (!crtc->enabled)
- continue;
+ continue;
if ((dstBox->x1 >= crtc->x) && (dstBox->y1 >= crtc->y))
- crtc_num = c;
+ crtc_num = c;
}
if (crtc_num == 1)
- info->OverlayOnCRTC2 = TRUE;
+ info->OverlayOnCRTC2 = TRUE;
else
- info->OverlayOnCRTC2 = FALSE;
+ info->OverlayOnCRTC2 = FALSE;
}
diff --git a/src/radeon_video.c b/src/radeon_video.c
index 95755928..93ea1ebf 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -2448,7 +2448,7 @@ RADEONDisplayVideo(
Here we need to find ecp_div again, as the user may have switched resolutions */
/* Figure out which head we are on for dot clock */
- if ((info->MergedFB && info->OverlayOnCRTC2) || info->IsSecondary)
+ if (info->OverlayOnCRTC2 || info->IsSecondary)
dot_clock = info->ModeReg.dot_clock_freq_2;
else
dot_clock = info->ModeReg.dot_clock_freq;
@@ -2468,6 +2468,7 @@ RADEONDisplayVideo(
v_inc_shift = 20;
y_mult = 1;
+ /* TODO NO IDEA WHAT THIS IS ABOUT */
if (info->MergedFB) {
if (overlay_mode->Flags & V_INTERLACE)
v_inc_shift++;
@@ -2607,7 +2608,7 @@ RADEONDisplayVideo(
* rendering for the second head.
*/
- if ((info->MergedFB && info->OverlayOnCRTC2) || info->IsSecondary) {
+ if (info->OverlayOnCRTC2 || info->IsSecondary) {
x_off = 0;
OUTREG(RADEON_OV1_Y_X_START, ((dstBox->x1 + x_off) |
((dstBox->y1*y_mult) << 16)));
@@ -2710,6 +2711,7 @@ RADEONPutImage(
DrawablePtr pDraw
){
RADEONInfoPtr info = RADEONPTR(pScrn);
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr)data;
INT32 xa, xb, ya, yb;
unsigned char *dst_start;
@@ -2718,6 +2720,7 @@ RADEONPutImage(
int top, left, npixels, nlines, bpp;
BoxRec dstBox;
CARD32 tmp;
+ xf86CrtcPtr crtc;
/*
* s2offset, s3offset - byte offsets into U and V plane of the
@@ -2755,17 +2758,15 @@ RADEONPutImage(
clipBoxes, width, height))
return Success;
- if (info->MergedFB && info->OverlayOnCRTC2) {
- dstBox.x1 -= info->CRT2pScrn->frameX0;
- dstBox.x2 -= info->CRT2pScrn->frameX0;
- dstBox.y1 -= info->CRT2pScrn->frameY0;
- dstBox.y2 -= info->CRT2pScrn->frameY0;
- } else {
- dstBox.x1 -= pScrn->frameX0;
- dstBox.x2 -= pScrn->frameX0;
- dstBox.y1 -= pScrn->frameY0;
- dstBox.y2 -= pScrn->frameY0;
- }
+ if (info->OverlayOnCRTC2)
+ crtc = xf86_config->crtc[1];
+ else
+ crtc = xf86_config->crtc[0];
+
+ dstBox.x1 -= crtc->x;
+ dstBox.x2 -= crtc->x;
+ dstBox.y1 -= crtc->y;
+ dstBox.y2 -= crtc->y;
bpp = pScrn->bitsPerPixel >> 3;
@@ -3089,12 +3090,13 @@ RADEONDisplaySurface(
){
OffscreenPrivPtr pPriv = (OffscreenPrivPtr)surface->devPrivate.ptr;
ScrnInfoPtr pScrn = surface->pScrn;
-
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONPortPrivPtr portPriv = info->adaptor->pPortPrivates[0].ptr;
INT32 xa, ya, xb, yb;
BoxRec dstBox;
+ xf86CrtcPtr crtc;
if (src_w > (drw_w << 4))
drw_w = src_w >> 4;
@@ -3117,17 +3119,15 @@ RADEONDisplaySurface(
surface->width, surface->height))
return Success;
- if (info->MergedFB && info->OverlayOnCRTC2) {
- dstBox.x1 -= info->CRT2pScrn->frameX0;
- dstBox.x2 -= info->CRT2pScrn->frameX0;
- dstBox.y1 -= info->CRT2pScrn->frameY0;
- dstBox.y2 -= info->CRT2pScrn->frameY0;
- } else {
- dstBox.x1 -= pScrn->frameX0;
- dstBox.x2 -= pScrn->frameX0;
- dstBox.y1 -= pScrn->frameY0;
- dstBox.y2 -= pScrn->frameY0;
- }
+ if (info->OverlayOnCRTC2)
+ crtc = xf86_config->crtc[1];
+ else
+ crtc = xf86_config->crtc[0];
+
+ dstBox.x1 -= crtc->x;
+ dstBox.x2 -= crtc->x;
+ dstBox.y1 -= crtc->y;
+ dstBox.y2 -= crtc->y;
#if 0
/* this isn't needed */
@@ -3198,6 +3198,7 @@ RADEONPutVideo(
){
RADEONInfoPtr info = RADEONPTR(pScrn);
RADEONPortPrivPtr pPriv = (RADEONPortPrivPtr)data;
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
unsigned char *RADEONMMIO = info->MMIO;
INT32 xa, xb, ya, yb, top;
unsigned int pitch, new_size, alloc_size;
@@ -3210,6 +3211,7 @@ RADEONPutVideo(
int width, height;
int mult;
int vbi_line_width, vbi_start, vbi_end;
+ xf86CrtcPtr crtc;
RADEON_SYNC(info, pScrn);
/*
@@ -3256,17 +3258,15 @@ RADEONPutVideo(
if(!xf86XVClipVideoHelper(&dstBox, &xa, &xb, &ya, &yb, clipBoxes, width, height))
return Success;
- if (info->MergedFB && info->OverlayOnCRTC2) {
- dstBox.x1 -= info->CRT2pScrn->frameX0;
- dstBox.x2 -= info->CRT2pScrn->frameX0;
- dstBox.y1 -= info->CRT2pScrn->frameY0;
- dstBox.y2 -= info->CRT2pScrn->frameY0;
- } else {
- dstBox.x1 -= pScrn->frameX0;
- dstBox.x2 -= pScrn->frameX0;
- dstBox.y1 -= pScrn->frameY0;
- dstBox.y2 -= pScrn->frameY0;
- }
+ if (info->OverlayOnCRTC2)
+ crtc = xf86_config->crtc[1];
+ else
+ crtc = xf86_config->crtc[0];
+
+ dstBox.x1 -= crtc->x;
+ dstBox.x2 -= crtc->x;
+ dstBox.y1 -= crtc->y;
+ dstBox.y2 -= crtc->y;
bpp = pScrn->bitsPerPixel >> 3;
pitch = bpp * pScrn->displayWidth;