[Mplayer-cvslog] CVS: main/drivers/radeon radeon.h,1.24,1.25 radeon_vid.c,1.37,1.38 radeonfb.c,1.20,1.21 Makefile,1.8,1.9
Nick Kurshev
nick at mplayer.dev.hu
Wed Jan 2 10:37:44 CET 2002
Update of /cvsroot/mplayer/main/drivers/radeon
In directory mplayer:/var/tmp.root/cvs-serv11218/main/drivers/radeon
Modified Files:
radeon.h radeon_vid.c radeonfb.c Makefile
Log Message:
Added support of Radeon2 8500 AIW
Ugly fix (from non-x86 point) of FPU problems for Radeons color correction
Added checking of boundaries during color correction on Radeon
Index: radeon.h
===================================================================
RCS file: /cvsroot/mplayer/main/drivers/radeon/radeon.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- radeon.h 30 Dec 2001 17:28:09 -0000 1.24
+++ radeon.h 2 Jan 2002 09:37:37 -0000 1.25
@@ -24,6 +24,7 @@
#define PCI_DEVICE_ID_RADEON_LW 0x4C57
#define PCI_DEVICE_ID_R200_QL 0x514C
#define PCI_DEVICE_ID_RV200_QW 0x5157
+#define PCI_DEVICE_ID_R200_BB 0x4242
#define RADEON_REGSIZE 0x4000
Index: radeon_vid.c
===================================================================
RCS file: /cvsroot/mplayer/main/drivers/radeon/radeon_vid.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- radeon_vid.c 31 Dec 2001 16:08:32 -0000 1.37
+++ radeon_vid.c 2 Jan 2002 09:37:37 -0000 1.38
@@ -17,7 +17,7 @@
* Rage128(pro) stuff of this driver.
*/
-#define RADEON_VID_VERSION "1.2.0"
+#define RADEON_VID_VERSION "1.2.1"
/*
It's entirely possible this major conflicts with something else
@@ -38,7 +38,6 @@
...........................................................
BUGS and LACKS:
Color and video keys don't work
- Contrast and brightness are unconfigurable on radeons
*/
#include <linux/config.h>
@@ -110,14 +109,37 @@
#define RTRACE(...) ((void)0)
#endif
+#ifndef RAGE128
+#if defined(__i386__)
+/* Ugly but only way */
+#undef AVOID_FPU
+static double inline __FastSin(double x)
+{
+ register double res;
+ __asm __volatile("fsin":"=t"(res):"0"(x));
+ return res;
+}
+#undef sin
+#define sin(x) __FastSin(x)
+
+static double inline __FastCos(double x)
+{
+ register double res;
+ __asm __volatile("fcos":"=t"(res):"0"(x));
+ return res;
+}
+#undef cos
+#define cos(x) __FastCos(x)
+#else
+#define AVOID_FPU
+#warning You have non x86 system. Please port MATH support.
+#endif /*__386__*/
+#endif /*RAGE128*/
+
#if !defined( RAGE128 ) && !defined( AVOID_FPU )
#define RADEON_FPU 1
#endif
-#ifdef RADEON_FPU
-#include <math.h>
-#endif
-
typedef struct bes_registers_s
{
/* base address of yuv framebuffer */
@@ -1167,6 +1189,7 @@
{ PCI_DEVICE_ID_RADEON_LZ, "Radeon M6 LZ " },
{ PCI_DEVICE_ID_RADEON_LW, "Radeon M7 LW " },
{ PCI_DEVICE_ID_R200_QL, "Radeon2 8500 QL " },
+ { PCI_DEVICE_ID_R200_BB, "Radeon2 8500 AIW" },
{ PCI_DEVICE_ID_RV200_QW, "Radeon2 7500 QW " }
#endif
};
@@ -1203,6 +1226,7 @@
printk(RVID_MSG"Found %s (%uMb memory)\n",ati_card_ids[i].name,radeon_ram_size);
#ifndef RAGE128
if(ati_card_ids[i].id == PCI_DEVICE_ID_R200_QL ||
+ ati_card_ids[i].id == PCI_DEVICE_ID_R200_BB ||
ati_card_ids[i].id == PCI_DEVICE_ID_RV200_QW) IsR200 = 1;
#endif
return TRUE;
@@ -1276,6 +1300,10 @@
#define RTFBrightness(a) (((a)*1.0)/2000.0)
#define RTFContrast(a) (1.0 + ((a)*1.0)/1000.0)
#define RTFHue(a) (((a)*3.1416)/1000.0)
+#define RadeonSetParm(a,b,c,d) if((b)>=(c)&&(b)<=(d)) { (a)=(b);\
+ radeon_set_transform(RTFBrightness(ovBrightness),RTFContrast(ovContrast)\
+ ,RTFSaturation(ovSaturation),RTFHue(ovHue),ov_trans_idx); }
+
static ssize_t radeon_vid_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
{
@@ -1307,30 +1335,30 @@
#ifdef RADEON_FPU
if(memcmp(buf,PARAM_BRIGHTNESS,min(count,strlen(PARAM_BRIGHTNESS))) == 0)
{
- ovBrightness=simple_strtol(&buf[strlen(PARAM_BRIGHTNESS)],NULL,10);
- radeon_set_transform(RTFBrightness(ovBrightness),RTFContrast(ovContrast)
- ,RTFSaturation(ovSaturation),RTFHue(ovHue),ov_trans_idx);
+ int tmp;
+ tmp=simple_strtol(&buf[strlen(PARAM_BRIGHTNESS)],NULL,10);
+ RadeonSetParm(ovBrightness,tmp,-1000,1000);
}
else
if(memcmp(buf,PARAM_SATURATION,min(count,strlen(PARAM_SATURATION))) == 0)
{
- ovSaturation=simple_strtol(&buf[strlen(PARAM_SATURATION)],NULL,10);
- radeon_set_transform(RTFBrightness(ovBrightness),RTFContrast(ovContrast)
- ,RTFSaturation(ovSaturation),RTFHue(ovHue),ov_trans_idx);
+ int tmp;
+ tmp=simple_strtol(&buf[strlen(PARAM_SATURATION)],NULL,10);
+ RadeonSetParm(ovSaturation,tmp,-1000,1000);
}
else
if(memcmp(buf,PARAM_CONTRAST,min(count,strlen(PARAM_CONTRAST))) == 0)
{
- ovContrast=simple_strtol(&buf[strlen(PARAM_CONTRAST)],NULL,10);
- radeon_set_transform(RTFBrightness(ovBrightness),RTFContrast(ovContrast)
- ,RTFSaturation(ovSaturation),RTFHue(ovHue),ov_trans_idx);
+ int tmp;
+ tmp=simple_strtol(&buf[strlen(PARAM_CONTRAST)],NULL,10);
+ RadeonSetParm(ovContrast,tmp,-1000,1000);
}
else
if(memcmp(buf,PARAM_HUE,min(count,strlen(PARAM_HUE))) == 0)
{
- ovHue=simple_strtol(&buf[strlen(PARAM_HUE)],NULL,10);
- radeon_set_transform(RTFBrightness(ovBrightness),RTFContrast(ovContrast)
- ,RTFSaturation(ovSaturation),RTFHue(ovHue),ov_trans_idx);
+ int tmp;
+ tmp=simple_strtol(&buf[strlen(PARAM_HUE)],NULL,10);
+ RadeonSetParm(ovHue,tmp,-1000,1000);
}
else
#endif
Index: radeonfb.c
===================================================================
RCS file: /cvsroot/mplayer/main/drivers/radeon/radeonfb.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- radeonfb.c 17 Dec 2001 09:07:12 -0000 1.20
+++ radeonfb.c 2 Jan 2002 09:37:37 -0000 1.21
@@ -124,6 +124,7 @@
RADEON_LZ,
RADEON_LW,
R200_QL,
+ R200_BB,
RV200_QW
};
@@ -148,6 +149,7 @@
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_LZ, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_LZ},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RADEON_LW, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RADEON_LW},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_R200_QL, PCI_ANY_ID, PCI_ANY_ID, 0, 0, R200_QL},
+ { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_R200_BB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, R200_BB},
{ PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_RV200_QW, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RV200_QW},
{ 0, }
};
@@ -1080,6 +1082,11 @@
rinfo->hasCRTC2 = 1;
rinfo->isR200 = 1;
strcpy(rinfo->name, "Radeon2 8500 QL ");
+ break;
+ case PCI_DEVICE_ID_R200_BB:
+ rinfo->hasCRTC2 = 1;
+ rinfo->isR200 = 1;
+ strcpy(rinfo->name, "Radeon2 8500 AIW");
break;
case PCI_DEVICE_ID_RV200_QW:
rinfo->hasCRTC2 = 1;
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/drivers/radeon/Makefile,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Makefile 2 Dec 2001 12:21:06 -0000 1.8
+++ Makefile 2 Jan 2002 09:37:37 -0000 1.9
@@ -13,7 +13,7 @@
CPPFLAGS := -D__KERNEL__ -I$(KERNEL_INCLUDES)
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
- -fomit-frame-pointer -fno-strict-aliasing -fno-common\
+ -fomit-frame-pointer -fno-strict-aliasing -fno-common -ffast-math\
-D__KERNEL__ -DMODULE -include $(KERNEL_INCLUDES)/linux/modversions.h
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
More information about the MPlayer-cvslog
mailing list