xf86-video-ati: Branch 'master' - 2 commits
George Sapountzis
gsap7 at kemper.freedesktop.org
Sun Mar 4 20:46:50 EET 2007
src/atimach64xv.c | 132 +++++++++++++++++-------------------------------------
1 files changed, 42 insertions(+), 90 deletions(-)
New commits:
diff-tree 1e270b411cf691c69194932b864ee2c9db292263 (from 54f9b8c1d01ecb97e2d4d247918f0efc86ed6037)
Author: George Sapountzis <gsap7 at yahoo.gr>
Date: Sun Mar 4 18:21:49 2007 +0200
[mach64] Bug 5586: overlay scaler limited to 720 pixels on ATI Rage Pro.
diff --git a/src/atimach64xv.c b/src/atimach64xv.c
index 844f08d..997fa69 100644
--- a/src/atimach64xv.c
+++ b/src/atimach64xv.c
@@ -765,8 +765,10 @@ ATIMach64ClipVideo
CARD32 HScale, VScale;
/* Check hardware limits */
- if ((Height <= 0) || (Height > 2048) || (Width <= 0) || (Width > 720) ||
- ((Width > 384) && (pATI->Chip < ATI_CHIP_264VTB)))
+ if ((Height <= 0) || (Height > 2048) || (Width <= 0) || (Width > 768) ||
+ ((Width > 384) && (pATI->Chip < ATI_CHIP_264VTB)) ||
+ ((Width > 720) && (pATI->Chip < ATI_CHIP_264GTPRO ||
+ pATI->Chip > ATI_CHIP_264LTPRO)))
return FALSE;
ATIMach64ScaleVideo(pATI, pScreenInfo->currentMode,
@@ -1132,8 +1134,10 @@ ATIMach64AllocateSurface
if (pATI->ActiveSurface)
return BadAlloc;
- if ((Height <= 0) || (Height > 2048) || (Width <= 0) || (Width > 720) ||
- ((Width > 384) && (pATI->Chip < ATI_CHIP_264VTB)))
+ if ((Height <= 0) || (Height > 2048) || (Width <= 0) || (Width > 768) ||
+ ((Width > 384) && (pATI->Chip < ATI_CHIP_264VTB)) ||
+ ((Width > 720) && (pATI->Chip < ATI_CHIP_264GTPRO ||
+ pATI->Chip > ATI_CHIP_264LTPRO)))
return BadValue;
Width = (Width + 1) & ~1;
@@ -1375,10 +1379,15 @@ ATIMach64XVInitialiseAdaptor
{
enc->width = 384;
}
- else
+ else if (pATI->Chip < ATI_CHIP_264GTPRO ||
+ pATI->Chip > ATI_CHIP_264LTPRO)
{
/* Do nothing */
}
+ else
+ {
+ enc->width = 768;
+ }
pAdaptor->nEncodings = nATIMach64VideoEncoding;
pAdaptor->pEncodings = ATIMach64VideoEncoding;
@@ -1426,10 +1435,16 @@ ATIMach64XVInitialiseAdaptor
surf0->max_width = 384;
surf1->max_width = 384;
}
- else
+ else if (pATI->Chip < ATI_CHIP_264GTPRO ||
+ pATI->Chip > ATI_CHIP_264LTPRO)
{
/* Do nothing */
}
+ else
+ {
+ surf0->max_width = 768;
+ surf1->max_width = 768;
+ }
if (pATI->Chip < ATI_CHIP_264GTPRO)
{
diff-tree 54f9b8c1d01ecb97e2d4d247918f0efc86ed6037 (from e1e55b533d3ae528c8da37dcb77ed906d05697fb)
Author: George Sapountzis <gsap7 at yahoo.gr>
Date: Sun Mar 4 18:16:40 2007 +0200
[mach64] Xv: use single surface and encoding structs.
diff --git a/src/atimach64xv.c b/src/atimach64xv.c
index 5df903b..844f08d 100644
--- a/src/atimach64xv.c
+++ b/src/atimach64xv.c
@@ -41,20 +41,11 @@
static unsigned long ATIMach64XVAtomGeneration = (unsigned long)(-1);
-static XF86VideoEncodingRec ATIMach64VideoEncoding_A[] =
-{
- { 0, "XV_IMAGE", 384, 2048, {1, 1} }
-};
-#define nATIMach64VideoEncoding_A NumberOf(ATIMach64VideoEncoding_A)
-
-static XF86VideoEncodingRec ATIMach64VideoEncoding_B[] =
+static XF86VideoEncodingRec ATIMach64VideoEncoding[] =
{
{ 0, "XV_IMAGE", 720, 2048, {1, 1} }
};
-#define nATIMach64VideoEncoding_B NumberOf(ATIMach64VideoEncoding_B)
-
-/* nATIMach64VideoEncoding_[AB] should be equal */
-#define nATIMach64VideoEncoding nATIMach64VideoEncoding_A
+#define nATIMach64VideoEncoding NumberOf(ATIMach64VideoEncoding)
static XF86VideoFormatRec ATIMach64VideoFormat[] =
{
@@ -1306,69 +1297,7 @@ ATIMach64SetSurfaceAttribute
}
/* XVideo surface registration data */
-static XF86OffscreenImageRec ATIMach64Surface_A[] =
-{
- {
- &ATIMach64Image[0], /* YUY2 */
- VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT,
- ATIMach64AllocateSurface,
- ATIMach64FreeSurface,
- ATIMach64DisplaySurface,
- ATIMach64StopSurface,
- ATIMach64GetSurfaceAttribute,
- ATIMach64SetSurfaceAttribute,
- 384, 2048,
- nATIMach64Attribute - 5, /* No double-buffering */
- ATIMach64Attribute + 4 /* No saturation nor brightness */
- },
- {
- &ATIMach64Image[1], /* UYVY */
- VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT,
- ATIMach64AllocateSurface,
- ATIMach64FreeSurface,
- ATIMach64DisplaySurface,
- ATIMach64StopSurface,
- ATIMach64GetSurfaceAttribute,
- ATIMach64SetSurfaceAttribute,
- 384, 2048,
- nATIMach64Attribute - 5, /* No double-buffering */
- ATIMach64Attribute + 4 /* No saturation nor brightness */
- }
-};
-#define nATIMach64Surface_A NumberOf(ATIMach64Surface_A)
-
-static XF86OffscreenImageRec ATIMach64Surface_B[] =
-{
- {
- &ATIMach64Image[0], /* YUY2 */
- VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT,
- ATIMach64AllocateSurface,
- ATIMach64FreeSurface,
- ATIMach64DisplaySurface,
- ATIMach64StopSurface,
- ATIMach64GetSurfaceAttribute,
- ATIMach64SetSurfaceAttribute,
- 720, 2048,
- nATIMach64Attribute - 5, /* No double-buffering */
- ATIMach64Attribute + 4 /* No saturation nor brightness */
- },
- {
- &ATIMach64Image[1], /* UYVY */
- VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT,
- ATIMach64AllocateSurface,
- ATIMach64FreeSurface,
- ATIMach64DisplaySurface,
- ATIMach64StopSurface,
- ATIMach64GetSurfaceAttribute,
- ATIMach64SetSurfaceAttribute,
- 720, 2048,
- nATIMach64Attribute - 5, /* No double-buffering */
- ATIMach64Attribute + 4 /* No saturation nor brightness */
- }
-};
-#define nATIMach64Surface_B NumberOf(ATIMach64Surface_B)
-
-static XF86OffscreenImageRec ATIMach64Surface_C[] =
+static XF86OffscreenImageRec ATIMach64Surface[] =
{
{
&ATIMach64Image[0], /* YUY2 */
@@ -1397,7 +1326,7 @@ static XF86OffscreenImageRec ATIMach64Su
ATIMach64Attribute
}
};
-#define nATIMach64Surface_C NumberOf(ATIMach64Surface_C)
+#define nATIMach64Surface NumberOf(ATIMach64Surface)
/*
* ATIMach64XVInitialiseAdaptor --
@@ -1418,6 +1347,10 @@ ATIMach64XVInitialiseAdaptor
XF86VideoAdaptorPtr pAdaptor;
int Index;
+ XF86VideoEncodingPtr enc = &(ATIMach64VideoEncoding[0]);
+ XF86OffscreenImagePtr surf0 = &(ATIMach64Surface[0]);
+ XF86OffscreenImagePtr surf1 = &(ATIMach64Surface[1]);
+
if (pppAdaptor)
*pppAdaptor = NULL;
@@ -1440,14 +1373,14 @@ ATIMach64XVInitialiseAdaptor
if (pATI->Chip < ATI_CHIP_264VTB)
{
- pAdaptor->nEncodings = nATIMach64VideoEncoding_A;
- pAdaptor->pEncodings = ATIMach64VideoEncoding_A;
+ enc->width = 384;
}
else
{
- pAdaptor->nEncodings = nATIMach64VideoEncoding_B;
- pAdaptor->pEncodings = ATIMach64VideoEncoding_B;
+ /* Do nothing */
}
+ pAdaptor->nEncodings = nATIMach64VideoEncoding;
+ pAdaptor->pEncodings = ATIMach64VideoEncoding;
pAdaptor->nFormats = nATIMach64VideoFormat;
pAdaptor->pFormats = ATIMach64VideoFormat;
@@ -1490,19 +1423,23 @@ ATIMach64XVInitialiseAdaptor
if (pATI->Chip < ATI_CHIP_264VTB)
{
- xf86XVRegisterOffscreenImages(pScreen,
- ATIMach64Surface_A, nATIMach64Surface_A);
+ surf0->max_width = 384;
+ surf1->max_width = 384;
}
- else if (pATI->Chip < ATI_CHIP_264GTPRO)
+ else
{
- xf86XVRegisterOffscreenImages(pScreen,
- ATIMach64Surface_B, nATIMach64Surface_B);
+ /* Do nothing */
}
- else
+
+ if (pATI->Chip < ATI_CHIP_264GTPRO)
{
- xf86XVRegisterOffscreenImages(pScreen,
- ATIMach64Surface_C, nATIMach64Surface_C);
+ /* No saturation nor brightness */
+ surf0->num_attributes -= 4;
+ surf1->num_attributes -= 4;
+ surf0->attributes += 4;
+ surf1->attributes += 4;
}
+ xf86XVRegisterOffscreenImages(pScreen, ATIMach64Surface, nATIMach64Surface);
if (pppAdaptor)
*pppAdaptor = ppAdaptor;
More information about the xorg-commit
mailing list