summaryrefslogtreecommitdiff
path: root/src/radeon_textured_video.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@tungstengraphics.com>2009-03-05 02:07:46 +0100
committerRoland Scheidegger <sroland@tungstengraphics.com>2009-03-24 19:57:26 +0100
commit18e56eb179fde28477487c63e6f9ebf7579e2cd5 (patch)
treee0a4c6597a2c29f2a7bdfbce7b084306404018df /src/radeon_textured_video.c
parent58530bf4912800f9e09ebaea42a13cff8a80c19e (diff)
don't convert planar yuv to packed for r200
uses 3 textures for planar yuv and does yuv->rgb conversion in the shader. Similar to r300 code, but might have precision issues - hardware alu should have enough precision but hardware consts are only 8bit and we'd want at least 11. This also enables textured video on rv250 (and also supports packed yuv on that chip by using basically the same shader with packed data).
Diffstat (limited to 'src/radeon_textured_video.c')
-rw-r--r--src/radeon_textured_video.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/radeon_textured_video.c b/src/radeon_textured_video.c
index ed4dd3e0..63d56740 100644
--- a/src/radeon_textured_video.c
+++ b/src/radeon_textured_video.c
@@ -119,6 +119,15 @@ static __inline__ uint32_t F_TO_24(float val)
return float24;
}
+static __inline__ uint32_t float4touint(float fr, float fg, float fb, float fa)
+{
+ unsigned ur = fr * 255.0 + 0.5;
+ unsigned ug = fg * 255.0 + 0.5;
+ unsigned ub = fb * 255.0 + 0.5;
+ unsigned ua = fa * 255.0 + 0.5;
+ return (ua << 24) | (ur << 16) | (ug << 8) | ub;
+}
+
#define ACCEL_MMIO
#define ACCEL_PREAMBLE() unsigned char *RADEONMMIO = info->MMIO
#define BEGIN_ACCEL(n) RADEONWaitForFifo(pScrn, (n))
@@ -350,7 +359,11 @@ RADEONPutImageTextured(ScrnInfoPtr pScrn,
}
pPriv->planar_hw = pPriv->planar_state;
- if (pPriv->bicubic_enabled || !( IS_R300_3D ))
+ if (pPriv->bicubic_enabled || !( IS_R300_3D ||
+ (info->ChipFamily == CHIP_FAMILY_RV250) ||
+ (info->ChipFamily == CHIP_FAMILY_RV280) ||
+ (info->ChipFamily == CHIP_FAMILY_RS300) ||
+ (info->ChipFamily == CHIP_FAMILY_R200) ))
pPriv->planar_hw = 0;
switch(id) {
@@ -625,11 +638,12 @@ static XF86VideoFormatRec Formats[NUM_FORMATS] =
{15, TrueColor}, {16, TrueColor}, {24, TrueColor}
};
-#define NUM_ATTRIBUTES 1
+#define NUM_ATTRIBUTES 2
static XF86AttributeRec Attributes[NUM_ATTRIBUTES+1] =
{
{XvSettable | XvGettable, 0, 1, "XV_VSYNC"},
+ {XvSettable | XvGettable, 0, 1, "XV_HWPLANAR"},
{0, 0, 0, NULL}
};