[Mplayer-cvslog] CVS: main/vidix/drivers radeon_vid.c,1.79,1.80
Alex Beregszaszi
syncmail at mplayerhq.hu
Mon Apr 26 10:59:24 CEST 2004
CVS change done by Alex Beregszaszi
Update of /cvsroot/mplayer/main/vidix/drivers
In directory mail:/var2/tmp/cvs-serv30493
Modified Files:
radeon_vid.c
Log Message:
support for ATI fireglx
Index: radeon_vid.c
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/drivers/radeon_vid.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- radeon_vid.c 26 Mar 2004 16:03:53 -0000 1.79
+++ radeon_vid.c 26 Apr 2004 08:59:22 -0000 1.80
@@ -3,6 +3,9 @@
Copyrights 2002 Nick Kurshev. This file is based on sources from
GATOS (gatos.sf.net) and X11 (www.xfree86.org)
Licence: GPL
+
+ 31.12.2002 added support for fglrx drivers by Marcel Naziri (zwobbl at zwobbl.de)
+ 6.04.2004 fixes to allow compiling vidix without X11 (broken in original patch)
PPC support by Alex Beregszaszi
*/
@@ -22,6 +25,10 @@
#include "../../libdha/libdha.h"
#include "radeon.h"
+#ifdef HAVE_X11
+#include <X11/Xlib.h>
+#endif
+
#ifdef RAGE128
#define RADEON_MSG "[rage128]"
#define X_ADJUST 0
@@ -198,6 +205,9 @@
DECLARE_VREG(CONFIG_CNTL)
};
+#ifdef HAVE_X11
+static uint32_t firegl_shift = 0;
+#endif
static void * radeon_mmio_base = 0;
static void * radeon_mem_base = 0;
static int32_t radeon_overlay_off = 0;
@@ -910,6 +920,31 @@
{ 0, 0, 0, 0}
};
+#ifdef HAVE_X11
+void probe_fireGL_driver() {
+ Display *dp = XOpenDisplay ((void*)0);
+ int n = 0;
+ char **extlist = XListExtensions (dp, &n);
+ XCloseDisplay (dp);
+ if (extlist) {
+ int i;
+ int ext_fgl = 0, ext_fglrx = 0;
+ for (i = 0; i < n; i++) {
+ if (!strcmp(extlist[i], "ATIFGLEXTENSION")) ext_fgl = 1;
+ if (!strcmp(extlist[i], "ATIFGLRXDRI")) ext_fglrx = 1;
+ }
+ if (ext_fgl) {
+ printf(RADEON_MSG" ATI FireGl driver detected");
+ firegl_shift = 0x500000;
+ if (!ext_fglrx) {
+ printf(", but DRI seems not to be activated\n");
+ printf(RADEON_MSG" Output may not work correctly, check your DRI configuration!");
+ }
+ printf("\n");
+ }
+ }
+}
+#endif
int vixProbe( int verbose,int force )
{
@@ -944,6 +979,9 @@
}
#ifndef RAGE128
if(idx != -1)
+#ifdef HAVE_X11
+ probe_fireGL_driver();
+#endif
{
switch(ati_card_ids[idx]) {
/* Original radeon */
@@ -1669,6 +1707,9 @@
for(;nfr>0; nfr--)
{
radeon_overlay_off = radeon_ram_size - info->frame_size*nfr;
+#ifdef HAVE_X11
+ radeon_overlay_off -= firegl_shift;
+#endif
radeon_overlay_off &= 0xffff0000;
if(radeon_overlay_off >= (int)rgb_size ) break;
}
@@ -1678,6 +1719,9 @@
for(;nfr>0; nfr--)
{
radeon_overlay_off = radeon_ram_size - info->frame_size*nfr;
+#ifdef HAVE_X11
+ radeon_overlay_off -= firegl_shift;
+#endif
radeon_overlay_off &= 0xffff0000;
if(radeon_overlay_off > 0) break;
}
More information about the MPlayer-cvslog
mailing list