Re: IPv6 problems on Linux

2003-07-23 Thread Andrew C Aitchison
On Tue, 22 Jul 2003, Alan Coopersmith wrote:

 Egbert Eich wrote:
  When I switch the order of initialization around and skip the IPv4
  protocol if IPv6 initialization was successful, everything works: 
  I can connect thru IPv6 and IPv4. 
 
 This was one of the patches suggested to the X.org IPv6 review which
 we declined to include in our patch set, but which got checked into
 the XFree86 CVS anyway.   We were told that separately binding to both is
 the usual habit on OpenBSD, while simply binding to IPv6 and letting it
 handle both was the way we coded it to work, and had it working on both
 Solaris and Linux.

The source code for exim, a mail transport agent which supports IPv6
on a significant number of platforms, contains the following comment
(in src/daemon.c):

 /* Otherwise we set up things to listen on all interfaces. In an IPv4 world,
 this is just a single, empty address. On systems with IPv6, several different
 implementation approaches have been taken. This code is now supposed to work
 with all of them. The point of difference is whether an IPv6 socket that is
 listening on all interfaces will receive incoming IPv4 calls or not.

 . On Solaris, an IPv6 socket will accept IPv4 calls, and give them as mapped
   addresses. However, if an IPv4 socket is also listening on all interfaces,
   calls are directed to the appropriate socket.

 . On (some versions of) Linux, an IPv6 socket will accept IPv4 calls, and
   give them as mapped addresses, but an attempt also to listen on an IPv4
   socket on all interfaces causes an error.

 . On OpenBSD, an IPv6 socket will not accept IPv4 calls. You have to set up
   two sockets if you want to accept both kinds of call.

 . FreeBSD is like OpenBSD, but it has the IPV6_V6ONLY socket option, which
   can be turned off, to make it behave like the versions of Linux described
   above.

 . I heard a report that the USAGI IPv6 stack for Linux has implemented
   IPV6_V6ONLY.

So, what we do is as follows:

 (1) At this point we set up two addresses, one containing : to indicate
 an IPv6 wildcard address, and an empty one to indicate an IPv4 wildcard
 address.

 (2) Later, when we create the IPv6 socket, we set IPV6_V6ONLY if that option
 is defined.

 (3) We listen on the v6 socket first. If that fails, there is a serious
 error.

 (4) We listen on the v4 socket second. If that fails with the error
 EADDRINUSE, assume we are in the situation where just a single socket is
 permitted, and ignore the error. */


---
I'm suprised at how broken the X.Org IPv6 code has proven.

-- 
Andrew C Aitchison

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


X KeyRelease problem

2003-07-23 Thread David Snyder
Hello all,

I'll try to make this short and to the point, but I can't promise 
anything.  If someone on this list thinks this question shouldn't be on 
this list, let me know, and I'll drop it.  Thanks.

The problem concerns my tweaking of a window manager (evilwm).  Now, I 
don't want everyone to go off on a 'my window manager is better than 
yours' rant -- my question has to do the way X handles a key release. 
Now, the thing I'm trying to do is make the cycling through the windows 
re-order themselves after all the Alt+Tab's have done (kinda like 
Windows).  The reason I want to do this, is that it's a major pain in 
the arse to cycle through all the windows to get to the one I want. 
Plus, if I want to flip through two in quick succession, I don't want to 
have to cycle through _all_ the rest to get to the one I want.  Just a 
little background here, but as you may guess, the window list is in a 
linked-list format.  Which means that the you go through the list 
whenever you go through the windows linked-list with Alt+Tab. 
Basically, what I want to do is re-order the list when the Alt and Tab 
are released.

Now, my problem is that X isn't notifying the program, evilwm, that the 
Alt key has been released.  What I do is, at the first Tab KeyPress, I 
grab the Alt key with:

XGrabKey(dpy, XKeysymToKeycode(dpy, \
XK_Alt_L), AnyModifier, \
screens[0].root, False, \
GrabModeAsync, GrabModeAsync);
Then at the Alt KeyRelease event, I ungrab the Alt key.  Pretty easy, 
right?  However, the Alt KeyRelease isn't always sent (sometimes it is, 
with particular combinations of Alt+Tab which I won't go into, but 
usually not).  I've been able to work around part of the problem. 
Whenever another KeyPress comes in, I see if it's _not_ Tab and if the 
Alt has been grabbed, then I ungrab the Alt key, re-order the windows, 
and XTEST the key again.  That seems to handle the major problem. 
However, that just leaves me with a thornier one.  If the user wants to 
flip back and forth between windows, they'll come back with a Alt+Tab 
combo.  This means the above work-around _doesn't_ work.  The Alt won't 
be released, the windows won't be re-ordered, and the XTEST doesn't get 
sent.  So my questions are:

1) Why doesn't X send the Alt KeyRelease?  And how can I (without 
changing the X server) get it to?  Is my GrabKey incorrect?  Do I have 
to redo the key repeat setting for the Alt key?  BTW, this 
non-KeyRelease sending on Alt release happens on Slack9.0 (X ver. 4.3.0) 
and OpenBSD 3.2 (X ver. 4.2.1), so I'd say it's not an OS-specific prob.

2) If someone knows a window manager which does window re-ordering on 
the X level (KDE and Gnome are too abstracted from X to help me) after 
window switching, I'd like to know it.  I've take a look at weewm, aewm, 
and many others besides, so if you've got any suggestions, I'd be glad 
to hear'em.

BTW, if there's anything that'll help you help me figure this out, I'll 
be glad to get it to you.

Thanks.

David

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Matthias Scheler
On Wed, Jul 23, 2003 at 07:38:11AM +0100, Andrew C Aitchison wrote:
 So, what we do is as follows:
 
  (1) At this point we set up two addresses, one containing : to indicate
  an IPv6 wildcard address, ...

That should read ::.

  (2) Later, when we create the IPv6 socket, we set IPV6_V6ONLY if that option
  is defined.

That's not really necessary because ...

  (4) We listen on the v4 socket second. If that fails with the error
  EADDRINUSE, assume we are in the situation where just a single socket is
  permitted, and ignore the error. */

... of this.

Kind regards

-- 
Matthias Scheler  http://scheler.de/~matthias/
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Egbert Eich
Matthias Scheler writes:
  On Tue, Jul 22, 2003 at 09:14:08PM +0200, Egbert Eich wrote:
   As I tried to explain binding to an IPv6 socket implicitely binds to
   an IPv4 socket.
  
  That's a bug.
  
According to what I've heared it is intended and 
therefore considered a feature.
I'm not going to argue about this, I just observed
this behavior.

Egbert.
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Egbert Eich
Fabio Massimo Di Nitto writes:
  On Tue, 22 Jul 2003, Matthias Scheler wrote:
  
   On Tue, Jul 22, 2003 at 08:03:35PM +0200, Egbert Eich wrote:
The current CVS code produces the error:
   
_XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
   
Fatal server error:
Cannot establish any listening sockets - Make sure an X server isn't already 
running
   
bind() returns an EADDRINUSE error when binding to the second IP
protocol (in CVS it is IPv6).
   
When I switch the order of initialization around and skip the IPv4
protocol if IPv6 initialization was successful, everything works:
I can connect thru IPv6 and IPv4.
  
   This sounds like a bug in Linux's socket implementation.
  
  Not really. Linux has been always working like this. the USAGI patch for
  linux kernel implements a runtime configurable option to separate ipv6 and
  ipv4 bindings.


Something like:

int off = 0;
 [...]
if (setsockopt(listen_socket, IPPROTO_IPV6, IPV6_V6ONLY, off,
sizeof (off))  0) {

? 
This of course would help, however it wouldn't address the problem on
the existing systems.

Egbert.
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Egbert Eich
Matthias Scheler writes:
  
  I wasn't suggesting to use it on Linux. My suggestion was to revert to
  using a single socket on all platforms and use the above code to enable
  accepting IPv4 connections on *BSD.
  

Yes, I understand. I was just looking for a decend way of making
things work on Linux.

Egbert.
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Frame rate

2003-07-23 Thread Nitin Mahajan
Hello !
Can any one please tell me,how will I measure the frame rate in this
case.
How will I test my driver for the frame rate?
Regards
Nitin

-Original Message-
From: Nitin Mahajan 
Sent: Wednesday, July 23, 2003 8:41 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Driver for 69030


Hello Everyone!
Thank u so much for replying.

1.I meant the chips and technnologies 69030.

2.When I say a frame rate of 30fps is required,that means I want to
play the MPEG4 software decoded movies at the rate of 30fps and at
present Iam getting RGB(24 bpp) as the input.I should be able to display
on screen 30fps. My question was can I get this rate with the help of
BitBLT alone(which has a limitation of 64K)or I don't have any other
alternative other than programming the multimedia engine which takes YUV
or 16bit RGB as input.

Please write if  more clarification is needed from my side.
I again very much thankful to the gentlemen who replied so fast to the
mail. Waiting to hear from u , Regards,

Nitin Mahajan
mail:[EMAIL PROTECTED]
Ph:51101667. Mobile : 9886099925 ==
The Lord gave us two ends -- one to sit on and the other to think with.
Success depends on which one we use the most.


-Original Message-
From: Egbert Eich [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 23, 2003 12:52 AM
To: Tim Roberts
Cc: [EMAIL PROTECTED]
Subject: Re: Driver for 69030


Yes, I'm sure the posting refers to a ChipsTechnologies 69030. This is
already supported in 4.3, including video playback. Capture isn't
supported as I never had anything to test it with.

I would have replied to the original email if I had been able to
understand it better.

Egbert.


Tim Roberts writes:
  On Tue, 22 Jul 2003 10:27:44 +0530, Nitin Mahajan wrote:
  
   Hello Everyone!
  
   Iam writing a driver for 69030 card.
   I have to support CIF and QCIF formats.
  
  WHICH 69030?  Surely you must realize that chip numbers are not
unique 
  industry-wide.
  
  If you are talking about the Asiliant 69030, are you aware that a
Linux 
  driver already exists?  It is a renamed version of the old Chips  
  Technologies 65550, which was supported in XFree86 3.x.
  
 http://www.humboldt.co.uk/matc.html
  
  1. The format says that a frame rate of 30fps is required for both.
  
  2.Each frame should have
 a. 144 lines and 176 pixels/line for QCIF.
 b. 288 lines and 352 pixels/line for CIF.
   
  Now my interpretation is that the second point above refers to the
frame   size and the driver implementation (video modes)has nothing to
do with it.   Is this interpretation of mine is correct?   
  I doubt it, but I'm confused by your mixing of graphics and video.
When you 
  say a frame rate of 30fps is required, what are you talking about?
Do you 
  mean video coming in through the zoom video port?  Or are you talking
about 
  ordinary software-decoded movies?  Tells us WHAT you have to support
at 
  30fps, and perhaps we can offer suggestions.
  
  Second question is that, how do I achive the frame rate of 30fps?  

  30fps for what?
  
  I have
  programmed the BitBLT engine for the card,but that also puts only
64Kb data   on screen in on shot,so always I need to divide the Image
into 64KB parts.   
  Are you talking about system-memory-to-video-memory transfers?  I'm
surprised 
  to hear there is a 64K limitation in any relatively modern graphics
card.  
  Are you sure about that?
  
  --
  - Tim Roberts, [EMAIL PROTECTED]
Providenza  Boekelheide, Inc.
  
  
  ___
  Devel mailing list
  [EMAIL PROTECTED]
  http://XFree86.Org/mailman/listinfo/devel
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel
Scanned by SecureSynergy VirusScreen Service. 
For more information log on to : http://www.securesynergyonline.com or 
http://www.securesynergy.com

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Forwarded from Jun-ichiro itojun Hagino: Re: IPv6 problems on Linux

2003-07-23 Thread Matthieu Herrb
---BeginMessage---
(todd and matthieu, if this does not go through please forward it)

I wasn't suggesting to use it on Linux. My suggestion was to revert to
using a single socket on all platforms and use the above code to enable
accepting IPv4 connections on *BSD.

there is security risk in using single socket, as outlined in
draft-cmetz-v6ops-v4mapped-api-harmful-00.txt
draft-itojun-v6ops-v4mapped-harmful-01.txt
therefore, there are platforms which does not have IPV6_V6ONLY sysctl,
and there are platforms which does not work at all with single socket
(IPv4 packet does not get routed to IPv6).

therefore, i suggest
- on all platforms try to open 2 sockets, AF_INET6 then AF_INET
- ignore error from socket(2) and bind(2) on both cases
- raise error only if both attempt fails

by doing this,
- userland code works with IPv4-only kernel, IPv6-only kernel or
  IPv4/v6 dual stack kernel (independence from kernel configuration)
- with linux IPv4/v6 dual stack case, it will use single AF_INET6
  socket (with security risk described above)
- other platforms should work with two sockets

itojun
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel
---End Message---


Re: IPv6 problems on Linux

2003-07-23 Thread Fabio Massimo Di Nitto
On Wed, 23 Jul 2003, Egbert Eich wrote:

 Fabio Massimo Di Nitto writes:
   On Tue, 22 Jul 2003, Matthias Scheler wrote:
  
On Tue, Jul 22, 2003 at 08:03:35PM +0200, Egbert Eich wrote:
 The current CVS code produces the error:

 _XSERVTransSocketINETCreateListener: ...SocketCreateListener() failed
 _XSERVTransMakeAllCOTSServerListeners: server already running

 Fatal server error:
 Cannot establish any listening sockets - Make sure an X server isn't already 
 running

 bind() returns an EADDRINUSE error when binding to the second IP
 protocol (in CVS it is IPv6).

 When I switch the order of initialization around and skip the IPv4
 protocol if IPv6 initialization was successful, everything works:
 I can connect thru IPv6 and IPv4.
   
This sounds like a bug in Linux's socket implementation.
  
   Not really. Linux has been always working like this. the USAGI patch for
   linux kernel implements a runtime configurable option to separate ipv6 and
   ipv4 bindings.


 Something like:

   int off = 0;
  [...]
   if (setsockopt(listen_socket, IPPROTO_IPV6, IPV6_V6ONLY, off,
   sizeof (off))  0) {

 ?
 This of course would help, however it wouldn't address the problem on
 the existing systems.


I didn't check/produce any code but the easiest way to implement in linux
is something like (if the user does not specify --nolisten):

bind to ipv6
if it works ok
otherwise fail silently
bind to ipv4
if it works ok
otherwise fail with error message.

specifing --nolisten the fail conditions might change their behaviour.

This is basically what i did when i first tried the ipv6 kame patch for X.

Fabio

-- 
Our mission: make IPv6 the default IP protocol
We are on a mission from God - Elwood Blues

http://www.itojun.org/paper/itojun-nanog-200210-ipv6isp/mgp4.html
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Egbert Eich

I've made the patch below which takes care of the problem for me.
I have tried several different versions, I didn't really like any
of them. 
This code is one of the rare pieces of code that is rather well
structured and relatively free of any ugly hacks. This fix makes
it a lot uglier, what I particularly don't like is that it now
depends on the order in which the listeners for the different 
protocols are created.

I've tried several different solutions including the use if
getaddrinfo(), everything made this code more ugly.

Any better solutions are welcome. If there are none, I'll commit this
code.

Egbert.

Index: Xtrans.c
===
RCS file: /home/x-cvs/xc/lib/xtrans/Xtrans.c,v
retrieving revision 3.31
diff -u -w -r3.31 Xtrans.c
--- Xtrans.c20 Jul 2003 16:12:15 -  3.31
+++ Xtrans.c23 Jul 2003 13:35:40 -
@@ -90,10 +90,10 @@
 #endif /* STREAMSCONN */
 #if defined(TCPCONN)
 { TRANS(SocketTCPFuncs),  TRANS_SOCKET_TCP_INDEX },
-{ TRANS(SocketINETFuncs), TRANS_SOCKET_INET_INDEX },
 #if defined(IPv6)  defined(AF_INET6)
 { TRANS(SocketINET6Funcs),TRANS_SOCKET_INET6_INDEX },
 #endif /* IPv6 */
+{ TRANS(SocketINETFuncs), TRANS_SOCKET_INET_INDEX },
 #endif /* TCPCONN */
 #if defined(DNETCONN)
 { TRANS(DNETFuncs),   TRANS_DNET_INDEX },
@@ -768,10 +768,10 @@
 #ifdef TRANS_SERVER
 
 int
-TRANS(CreateListener) (XtransConnInfo ciptr, char *port)
+TRANS(CreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags)
 
 {
-return ciptr-transptr-CreateListener (ciptr, port);
+return ciptr-transptr-CreateListener (ciptr, port, flags);
 }
 
 int
@@ -1037,6 +1037,9 @@
 char   buffer[256]; /* ??? What size ?? */
 XtransConnInfo ciptr, temp_ciptrs[NUMTRANS];
 intstatus, i, j;
+#if defined (linux)  defined(IPv6)  defined(AF_INET6)
+Bool   ipv6_succ = FALSE;
+#endif
 
 PRMSG (2,MakeAllCOTSServerListeners(%s,%p)\n,
   port ? port : NULL, ciptrs_ret, 0);
@@ -1046,6 +1049,7 @@
 for (i = 0; i  NUMTRANS; i++)
 {
Xtransport *trans = Xtransports[i].transport;
+   unsigned int flags = 0;
 
if (trans-flagsTRANS_ALIAS || trans-flagsTRANS_NOLISTEN)
continue;
@@ -1065,8 +1069,13 @@
  trans-TransName, 0, 0);
continue;
}
+#if defined (linux)  defined(IPv6)  defined(AF_INET6)
+   if ((Xtransports[i].transport_id == TRANS_SOCKET_INET_INDEX
+ ipv6_succ))
+   flags |= ADDR_IN_USE_ALLOWED;
+#endif
 
-   if ((status = TRANS(CreateListener (ciptr, port)))  0)
+   if ((status = TRANS(CreateListener (ciptr, port, flags)))  0)
{
if (status == TRANS_ADDR_IN_USE)
{
@@ -1098,6 +1107,11 @@
}
}
 
+#if defined (linux)  defined(IPv6)  defined(AF_INET6)
+   if (Xtransports[i].transport_id == TRANS_SOCKET_INET6_INDEX)
+   ipv6_succ = TRUE;
+#endif
+   
PRMSG (5,
  MakeAllCOTSServerListeners: opened listener for %s, %d\n,
  trans-TransName, ciptr-fd, 0);
@@ -1165,7 +1179,7 @@
continue;
}
 
-   if ((status = TRANS(CreateListener (ciptr, port)))  0)
+   if ((status = TRANS(CreateListener (ciptr, port, 0)))  0)
{
if (status == TRANS_ADDR_IN_USE)
{
Index: Xtrans.h
===
RCS file: /home/x-cvs/xc/lib/xtrans/Xtrans.h,v
retrieving revision 3.21
diff -u -w -r3.21 Xtrans.h
--- Xtrans.h20 Jul 2003 16:12:15 -  3.21
+++ Xtrans.h23 Jul 2003 13:35:41 -
@@ -339,7 +339,8 @@
 
 int TRANS(CreateListener)(
 XtransConnInfo,/* ciptr */
-char * /* port */
+char *,/* port */
+unsigned int   /* flags */
 );
 
 int TRANS(NoListen) (
Index: Xtransint.h
===
RCS file: /home/x-cvs/xc/lib/xtrans/Xtransint.h,v
retrieving revision 3.35
diff -u -w -r3.35 Xtransint.h
--- Xtransint.h 26 Nov 2002 01:12:30 -  3.35
+++ Xtransint.h 23 Jul 2003 13:35:41 -
@@ -26,7 +26,7 @@
 from The Open Group.
 
 */
-/* $XFree86: xc/lib/xtrans/Xtransint.h,v 3.35 2002/11/26 01:12:30 dawes Exp $ */
+/* $XFree86: xc/lib/xtrans/Xtransint.h,v 3.34 2002/11/20 23:00:36 dawes Exp $ */
 
 /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA
  *
@@ -283,10 +283,13 @@
 );
 
 #ifdef TRANS_SERVER
+/* Flags */
+# define ADDR_IN_USE_ALLOWED   1
 
 int(*CreateListener)(
XtransConnInfo, /* connection */
-   char *  /* port */
+   char *, /* port */
+   unsigned int/* flags */
 );
 
 int(*ResetListener)(
Index: Xtranssock.c
===
RCS file: 

Full screen page flip

2003-07-23 Thread Nitin Mahajan
Title: Message



Hello 
!
As regards CT 
69030 ,can anyone please tell ,what instant full screen page FLIP 
means
What part of the 
driver code in xfree86 is handling this???
regards

Nitin Mahajan

mail:[EMAIL PROTECTED]
Ph:51101667. Mobile : 
9886099925
==
The Lord gave us two ends -- one to 
sit on and the other to think with. Success depends on which one we use the 
most.



Re: Full screen page flip

2003-07-23 Thread Loic Grenie
From: Nitin Mahajan [EMAIL PROTECTED]
 Hello !
 As regards CT 69030 ,can anyone please tell ,what instant full screen
 page FLIP means

It usually means that you render something to be displayed on the screen
  in some offscreen part of the video memory, then you tell the chipset that
  the screen starts at the new position. It's usefull for any fullscreen thing.
  Example:

- Video memory starts at byte 0 and is 2MB long.
- There is a red dragon drawn on the screen.
- You render a blue fish from the 2MB-4MB region of the video memory.
- You wait for the scanline to reach the end of the screen (this is the dodgy
  part).
- You tell the chipset that the video memory starts at 2MB. And presto ! a blue
  fish is drawn on the screen.
- You can start to render a green mountain at 0MB.
- You wait for the scanline to reach the end of the screen.
- You tell the chipset that the video memory starts at 0MB. A green mountain is
  now drawn on the screen.

 What part of the driver code in xfree86 is handling this???

Usually you have something in the code handling the viewport position.


   Loïc
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


RE: Full screen page flip

2003-07-23 Thread Nitin Mahajan
Hi! Loic,

Thanx for the reply.
I think I got the concept.

1.Is this the double buffering???
2.I guess can be achieved by a frame buffer to framebuffer copy using the BitBLT 
engine??? 
  Am I right??
3.Will this help me in achieving a frame rate of 30fps to play a software decoded 
video.

Regards,

Nitin Mahajan
Socrates Software India Pvt Ltd...
mail:[EMAIL PROTECTED]
Ph:51101667. Mobile : 9886099925
==
The Lord gave us two ends -- one to sit on and the other to think with. Success 
depends on which one we use the most.


-Original Message-
From: Loic Grenie [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 23, 2003 9:21 PM
To: [EMAIL PROTECTED]
Subject: Re: Full screen page flip


From: Nitin Mahajan [EMAIL PROTECTED]
 Hello !
 As regards CT 69030 ,can anyone please tell ,what instant full screen 
 page FLIP means

It usually means that you render something to be displayed on the screen
  in some offscreen part of the video memory, then you tell the chipset that
  the screen starts at the new position. It's usefull for any fullscreen thing.
  Example:

- Video memory starts at byte 0 and is 2MB long.
- There is a red dragon drawn on the screen.
- You render a blue fish from the 2MB-4MB region of the video memory.
- You wait for the scanline to reach the end of the screen (this is the dodgy
  part).
- You tell the chipset that the video memory starts at 2MB. And presto ! a blue
  fish is drawn on the screen.
- You can start to render a green mountain at 0MB.
- You wait for the scanline to reach the end of the screen.
- You tell the chipset that the video memory starts at 0MB. A green mountain is
  now drawn on the screen.

 What part of the driver code in xfree86 is handling this???

Usually you have something in the code handling the viewport position.


   Loïc
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel
Scanned by SecureSynergy VirusScreen Service. 
For more information log on to : http://www.securesynergyonline.com or 
http://www.securesynergy.com

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Dr Andrew C Aitchison
On Wed, 23 Jul 2003, Egbert Eich wrote:

 I've made the patch below which takes care of the problem for me.

make[3]: Entering directory `/home/XFree86/4.2/std/xc/lib/ICE'
rm -f transport.o
gcc -m32 -c -O2 -fno-strength-reduce -fno-strict-aliasing  -ansi -pedantic 
-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes 
-Wmissing-declarations -Wredundant-decls -Wnested-externs -Wundef
-I../.. -I../../exports/include   -Dlinux -D__i386__ 
-D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE 
-D_SVID_SOURCE  -D_GNU_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO 
-I../../lib/xtrans -DUNIXCONN -DTCPCONN -DHAS_STICKY_DIR_BIT -DHAS_FCHOWN 
-DIPv6 -DICE_t -DTRANS_CLIENT -DTRANS_SERVER-fPIC transport.c
In file included from transport.c:85:
../../lib/xtrans/Xtrans.c: In function `_IceTransMakeAllCOTSServerListeners':
../../lib/xtrans/Xtrans.c:1041: `Bool' undeclared (first use in this function)
../../lib/xtrans/Xtrans.c:1041: (Each undeclared identifier is reported only once
../../lib/xtrans/Xtrans.c:1041: for each function it appears in.)
../../lib/xtrans/Xtrans.c:1041: parse error before ipv6_succ
../../lib/xtrans/Xtrans.c:1074: `ipv6_succ' undeclared (first use in this function)
../../lib/xtrans/Xtrans.c:1112: `TRUE' undeclared (first use in this function)
make[3]: *** [transport.o] Error 1

Should that be BOOL, TRUE (and FALSE) as defined I don't know where
(or Bool, True and False as defiend in ICElib.h) ?

-- 
Dr. Andrew C. Aitchison Computer Officer, DPMMS, Cambridge
[EMAIL PROTECTED]   http://www.dpmms.cam.ac.uk/~werdna

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


RE: Full screen page flip

2003-07-23 Thread Loic Grenie
 Hi! Loic,

 Thanx for the reply.
 I think I got the concept.

 1.Is this the double buffering???
Yes indeed. Triple would be to have one more buffer:
  1 displayed
  1 waiting to be displayed
  1 in which you render
 2.I guess can be achieved by a frame buffer to framebuffer copy using the BitBLT 
 engine??? 
   Am I right??

   Nope. Thats the whole trick: you do not copy anything. You change one
  (or two or three) register(s) and you are done. No bitblitting, no copy.
  Fast and efficient. This works only for fullscreen because you need to render
  the whole screen.

   You can also copy the second buffer in the image, if you are not fullscreen,
  using bitblitting, but that's not the same concept (and it's usually far
  slower).

 3.Will this help me in achieving a frame rate of 30fps to play a software decoded 
 video.

This highly depends on your hardware. You did not say anything about your
  hardware: processor, memory, FSB (of processor and memory). If your processor
  can produce 30 frames of RGB images per second, double buffering is THE way
  to go if you can afford it: you hardly slow the rendering while doing so. If
  you copy the image from offscreen memory to onscreen memory, you slow things
  down (usually). If you render your images is system memory, then copy them
  to offscreen video memory then blit them onscreen, you make a lot of copies.
  (and one more if you do not use shared memory extension). Now if your system
  is fast enough, it can render 30fps with many image copies in between. You
  should try to see how many frames per second you get with a simple approach:
  render in a pixmap and display it.

  Loïc
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


RE: Full screen page flip

2003-07-23 Thread Tim Roberts
On Wed, 23 Jul 2003 21:36:43 +0530, Nitin Mahajan wrote:

1.Is this the double buffering???

Yes; while one offscreen buffer is being displayed, you draw into a second 
offscreen buffer.  When that buffer is finished, you flip them so that the 
second becomes visible and the first is free for drawing.

2.I guess can be achieved by a frame buffer to framebuffer copy using the
 BitBLT engine??? 
  Am I right??

Not at 30 fps, no.  A 1024x768 RGB24 image is 2.4 megabytes.  Drawing that 30 
times per second exceeds the practical capacity of the PCI bus.

3.Will this help me in achieving a frame rate of 30fps to play a 
 software decoded video.

What application software are you using to do the drawing?  Programs like xine 
and mplayer expect to decode their frames into an overlay surface, using the 
xvideo extension in XFree86.  The applications decode the frames directly into 
a surface in the frame buffer outside of the visible region, usually in a YUV 
format.  The xvideo code in the driver sets up the overlay hardware to display 
this on the screen.  Most overlay hardware can scale the overlay image as it 
displays, so a 320x240 decoded movie can be viewed at 1024x768.

That can be done at 30fps.

--
- Tim Roberts, [EMAIL PROTECTED]
  Providenza  Boekelheide, Inc.


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Egbert Eich
Fabio Massimo Di Nitto writes:
  
  I didn't check/produce any code but the easiest way to implement in linux
  is something like (if the user does not specify --nolisten):
  
  bind to ipv6
  if it works ok
  otherwise fail silently
  bind to ipv4
  if it works ok
  otherwise fail with error message.
  
  specifing --nolisten the fail conditions might change their behaviour.
  
  This is basically what i did when i first tried the ipv6 kame patch for X.
  

The Xserverallows one or more protocols to fail unless the -nopn 
option is given. You are pretty much suggesting to make this 
option the default with allowing ipv6 to fail silently.

That's possible. I'd like to hear more opinions on that.

Egbert.

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Egbert Eich
Oops, I haven't rebuilt the server.
Maybe this should be changed to int, 0 and 1.

Egbert.


Dr Andrew C Aitchison writes:
  On Wed, 23 Jul 2003, Egbert Eich wrote:
  
   I've made the patch below which takes care of the problem for me.
  
  make[3]: Entering directory `/home/XFree86/4.2/std/xc/lib/ICE'
  rm -f transport.o
  gcc -m32 -c -O2 -fno-strength-reduce -fno-strict-aliasing  -ansi -pedantic 
  -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes 
  -Wmissing-declarations -Wredundant-decls -Wnested-externs -Wundef
  -I../.. -I../../exports/include   -Dlinux -D__i386__ 
  -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE 
  -D_SVID_SOURCE  -D_GNU_SOURCE   -DFUNCPROTO=15 -DNARROWPROTO 
  -I../../lib/xtrans -DUNIXCONN -DTCPCONN -DHAS_STICKY_DIR_BIT -DHAS_FCHOWN 
  -DIPv6 -DICE_t -DTRANS_CLIENT -DTRANS_SERVER-fPIC transport.c
  In file included from transport.c:85:
  ../../lib/xtrans/Xtrans.c: In function `_IceTransMakeAllCOTSServerListeners':
  ../../lib/xtrans/Xtrans.c:1041: `Bool' undeclared (first use in this function)
  ../../lib/xtrans/Xtrans.c:1041: (Each undeclared identifier is reported only once
  ../../lib/xtrans/Xtrans.c:1041: for each function it appears in.)
  ../../lib/xtrans/Xtrans.c:1041: parse error before ipv6_succ
  ../../lib/xtrans/Xtrans.c:1074: `ipv6_succ' undeclared (first use in this function)
  ../../lib/xtrans/Xtrans.c:1112: `TRUE' undeclared (first use in this function)
  make[3]: *** [transport.o] Error 1
  
  Should that be BOOL, TRUE (and FALSE) as defined I don't know where
  (or Bool, True and False as defiend in ICElib.h) ?
  
  -- 
  Dr. Andrew C. Aitchison  Computer Officer, DPMMS, Cambridge
  [EMAIL PROTECTED]http://www.dpmms.cam.ac.uk/~werdna
  
  ___
  Devel mailing list
  [EMAIL PROTECTED]
  http://XFree86.Org/mailman/listinfo/devel
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: Rant (was Re: ATI Drivers.)

2003-07-23 Thread Allen Akin
On Tue, Jul 22, 2003 at 06:56:58PM -0700, Mark Vojkovich wrote:
| The interest, at least as far as the press is concerned, seems to
| be almost totally in the chipset performance.  nForce2 is available
| without internal graphics.  If I recall correctly, nForce3 (I believe
| there were some reviews out today) has no internal graphics.

I'll take a look.

|I do not expect graphics hardware to become a commodity.  

As Joel Spolsky mentioned, Microsoft tries hard to make such things
happen. :-)

| It is something that graphics hardware vendors fight hard against,

Understandably.

| and commoditization has not been the trend.

In the PC, workstation, and simulator spaces there are fewer graphics
hardware vendors today, and their products are more compatible, than at
any time in the past five to ten years.  I agree that graphics hardware
hasn't been completely commoditized, but it sure looks like the trend is
strong in that direction.  I'd expect the same trend to carry through to
embedded devices (as the PC folks leverage their technologies in the new
markets).

I'd also argue that programmable GPUs with a common programming
interface increase the tendency toward commoditization.  The business
model for graphics apps running on various vendors' GPUs begins to look
a lot like that of ordinary application software running on various
implementations of the x86.  This isn't accidental.

|  There is at least one very significant incentive -- driving down system
|  cost and enlarging the market by commoditizing the software
| 
|This is something graphics vendors will fight hard against.
| They don't want to commoditize the software.  ...

If you believe that lower device/system costs lead to higher volumes of
sales, and software cost is an appreciable fraction of the device/system
cost, then commoditizing the software leads to higher revenue for the
hardware vendors.  That's one reason Linux gained a foothold in the
embedded space.

Maybe you're thinking primarily about driver software.  Graphics vendors
do add a tremendous amount of value in their drivers, but even there
parts of the software are commoditized when it makes economic sense.
Perhaps the commonly-used code in XAA is a good example.

| The goal is to have your graphics kill your competitors, and that
| is done by preventing commoditization of software and hardware.
| It involves outfeaturing and outperforming your competitor and protecting 
| your software and hardware IP. 

Certainly that used to be true.

Judging by what I hear from app developers, it's getting less true all
the time.  They really want to stick to standardized functionality
that's available with decent performance on all platforms.  Their
return-on-investment is highest if the hardware is commoditized.

And Microsoft maintains its position in part by playing the hardware
vendors off against one another.  MS wants the best price and
performance for the features in its APIs, not for features that aren't
part of those APIs.  That leaves less room for the hardware vendors to
compete on features.

Allen
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Egbert Eich
Marc Aurele La France writes:
  
  I don't like the peppering of this code with more OS #ifdef's.  I think
  the approach espoused by Itojun, Todd, Matthieu and Andrew is better.
  
So maybe you can tell what the big difference is?
It tries to preserve more of the old behavoir with 
respect to the -nolisten and -pn/-nopn option.

You can of course remove the 'defined (Linux)' as this
patch should work for all systems as it allows
bind() for ipv4 to fail silently.

I've attached a corrected version below.

Egbert.

Index: Xtrans.c
===
RCS file: /home/x-cvs/xc/lib/xtrans/Xtrans.c,v
retrieving revision 3.31
diff -u -w -r3.31 Xtrans.c
--- Xtrans.c20 Jul 2003 16:12:15 -  3.31
+++ Xtrans.c23 Jul 2003 13:35:40 -
@@ -90,10 +90,10 @@
 #endif /* STREAMSCONN */
 #if defined(TCPCONN)
 { TRANS(SocketTCPFuncs),  TRANS_SOCKET_TCP_INDEX },
-{ TRANS(SocketINETFuncs), TRANS_SOCKET_INET_INDEX },
 #if defined(IPv6)  defined(AF_INET6)
 { TRANS(SocketINET6Funcs),TRANS_SOCKET_INET6_INDEX },
 #endif /* IPv6 */
+{ TRANS(SocketINETFuncs), TRANS_SOCKET_INET_INDEX },
 #endif /* TCPCONN */
 #if defined(DNETCONN)
 { TRANS(DNETFuncs),   TRANS_DNET_INDEX },
@@ -768,10 +768,10 @@
 #ifdef TRANS_SERVER
 
 int
-TRANS(CreateListener) (XtransConnInfo ciptr, char *port)
+TRANS(CreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags)
 
 {
-return ciptr-transptr-CreateListener (ciptr, port);
+return ciptr-transptr-CreateListener (ciptr, port, flags);
 }
 
 int
@@ -1037,6 +1037,9 @@
 char   buffer[256]; /* ??? What size ?? */
 XtransConnInfo ciptr, temp_ciptrs[NUMTRANS];
 intstatus, i, j;
+#if defined (linux)  defined(IPv6)  defined(AF_INET6)
+Bool   ipv6_succ = FALSE;
+#endif
 
 PRMSG (2,MakeAllCOTSServerListeners(%s,%p)\n,
   port ? port : NULL, ciptrs_ret, 0);
@@ -1046,6 +1049,7 @@
 for (i = 0; i  NUMTRANS; i++)
 {
Xtransport *trans = Xtransports[i].transport;
+   unsigned int flags = 0;
 
if (trans-flagsTRANS_ALIAS || trans-flagsTRANS_NOLISTEN)
continue;
@@ -1065,8 +1069,13 @@
  trans-TransName, 0, 0);
continue;
}
+#if defined (linux)  defined(IPv6)  defined(AF_INET6)
+   if ((Xtransports[i].transport_id == TRANS_SOCKET_INET_INDEX
+ ipv6_succ))
+   flags |= ADDR_IN_USE_ALLOWED;
+#endif
 
-   if ((status = TRANS(CreateListener (ciptr, port)))  0)
+   if ((status = TRANS(CreateListener (ciptr, port, flags)))  0)
{
if (status == TRANS_ADDR_IN_USE)
{
@@ -1098,6 +1107,11 @@
}
}
 
+#if defined (linux)  defined(IPv6)  defined(AF_INET6)
+   if (Xtransports[i].transport_id == TRANS_SOCKET_INET6_INDEX)
+   ipv6_succ = TRUE;
+#endif
+   
PRMSG (5,
  MakeAllCOTSServerListeners: opened listener for %s, %d\n,
  trans-TransName, ciptr-fd, 0);
@@ -1165,7 +1179,7 @@
continue;
}
 
-   if ((status = TRANS(CreateListener (ciptr, port)))  0)
+   if ((status = TRANS(CreateListener (ciptr, port, 0)))  0)
{
if (status == TRANS_ADDR_IN_USE)
{
Index: Xtrans.h
===
RCS file: /home/x-cvs/xc/lib/xtrans/Xtrans.h,v
retrieving revision 3.21
diff -u -w -r3.21 Xtrans.h
--- Xtrans.h20 Jul 2003 16:12:15 -  3.21
+++ Xtrans.h23 Jul 2003 13:35:41 -
@@ -339,7 +339,8 @@
 
 int TRANS(CreateListener)(
 XtransConnInfo,/* ciptr */
-char * /* port */
+char *,/* port */
+unsigned int   /* flags */
 );
 
 int TRANS(NoListen) (
Index: Xtransint.h
===
RCS file: /home/x-cvs/xc/lib/xtrans/Xtransint.h,v
retrieving revision 3.35
diff -u -w -r3.35 Xtransint.h
--- Xtransint.h 26 Nov 2002 01:12:30 -  3.35
+++ Xtransint.h 23 Jul 2003 13:35:41 -
@@ -26,7 +26,7 @@
 from The Open Group.
 
 */
-/* $XFree86: xc/lib/xtrans/Xtransint.h,v 3.35 2002/11/26 01:12:30 dawes Exp $ */
+/* $XFree86: xc/lib/xtrans/Xtransint.h,v 3.34 2002/11/20 23:00:36 dawes Exp $ */
 
 /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA
  *
@@ -283,10 +283,13 @@
 );
 
 #ifdef TRANS_SERVER
+/* Flags */
+# define ADDR_IN_USE_ALLOWED   1
 
 int(*CreateListener)(
XtransConnInfo, /* connection */
-   char *  /* port */
+   char *, /* port */
+   unsigned int/* flags */
 );
 
 int(*ResetListener)(
Index: Xtranssock.c
===
RCS file: /home/x-cvs/xc/lib/xtrans/Xtranssock.c,v
retrieving revision 3.59
diff -u -w -r3.59 Xtranssock.c
--- Xtranssock.c18 Jul 2003 

Re: IPv6 problems on Linux

2003-07-23 Thread Egbert Eich

I've accidently sent the wrong file before. Sorry.

Egbert.

Index: Xtrans.c
===
RCS file: /home/x-cvs/xc/lib/xtrans/Xtrans.c,v
retrieving revision 3.31
diff -u -r3.31 Xtrans.c
--- Xtrans.c20 Jul 2003 16:12:15 -  3.31
+++ Xtrans.c23 Jul 2003 18:17:17 -
@@ -90,10 +90,10 @@
 #endif /* STREAMSCONN */
 #if defined(TCPCONN)
 { TRANS(SocketTCPFuncs),  TRANS_SOCKET_TCP_INDEX },
-{ TRANS(SocketINETFuncs), TRANS_SOCKET_INET_INDEX },
 #if defined(IPv6)  defined(AF_INET6)
 { TRANS(SocketINET6Funcs),TRANS_SOCKET_INET6_INDEX },
 #endif /* IPv6 */
+{ TRANS(SocketINETFuncs), TRANS_SOCKET_INET_INDEX },
 #endif /* TCPCONN */
 #if defined(DNETCONN)
 { TRANS(DNETFuncs),   TRANS_DNET_INDEX },
@@ -768,10 +768,10 @@
 #ifdef TRANS_SERVER
 
 int
-TRANS(CreateListener) (XtransConnInfo ciptr, char *port)
+TRANS(CreateListener) (XtransConnInfo ciptr, char *port, unsigned int flags)
 
 {
-return ciptr-transptr-CreateListener (ciptr, port);
+return ciptr-transptr-CreateListener (ciptr, port, flags);
 }
 
 int
@@ -1037,6 +1037,9 @@
 char   buffer[256]; /* ??? What size ?? */
 XtransConnInfo ciptr, temp_ciptrs[NUMTRANS];
 intstatus, i, j;
+#if defined(IPv6)  defined(AF_INET6)
+intipv6_succ = 0;
+#endif
 
 PRMSG (2,MakeAllCOTSServerListeners(%s,%p)\n,
   port ? port : NULL, ciptrs_ret, 0);
@@ -1046,6 +1049,7 @@
 for (i = 0; i  NUMTRANS; i++)
 {
Xtransport *trans = Xtransports[i].transport;
+   unsigned int flags = 0;
 
if (trans-flagsTRANS_ALIAS || trans-flagsTRANS_NOLISTEN)
continue;
@@ -1065,8 +1069,13 @@
  trans-TransName, 0, 0);
continue;
}
+#if defined(IPv6)  defined(AF_INET6)
+   if ((Xtransports[i].transport_id == TRANS_SOCKET_INET_INDEX
+ ipv6_succ))
+   flags |= ADDR_IN_USE_ALLOWED;
+#endif
 
-   if ((status = TRANS(CreateListener (ciptr, port)))  0)
+   if ((status = TRANS(CreateListener (ciptr, port, flags)))  0)
{
if (status == TRANS_ADDR_IN_USE)
{
@@ -1098,6 +1107,11 @@
}
}
 
+#if defined(IPv6)  defined(AF_INET6)
+   if (Xtransports[i].transport_id == TRANS_SOCKET_INET6_INDEX)
+   ipv6_succ = 1;
+#endif
+   
PRMSG (5,
  MakeAllCOTSServerListeners: opened listener for %s, %d\n,
  trans-TransName, ciptr-fd, 0);
@@ -1165,7 +1179,7 @@
continue;
}
 
-   if ((status = TRANS(CreateListener (ciptr, port)))  0)
+   if ((status = TRANS(CreateListener (ciptr, port, 0)))  0)
{
if (status == TRANS_ADDR_IN_USE)
{
Index: Xtrans.h
===
RCS file: /home/x-cvs/xc/lib/xtrans/Xtrans.h,v
retrieving revision 3.21
diff -u -r3.21 Xtrans.h
--- Xtrans.h20 Jul 2003 16:12:15 -  3.21
+++ Xtrans.h23 Jul 2003 18:17:18 -
@@ -339,7 +339,8 @@
 
 int TRANS(CreateListener)(
 XtransConnInfo,/* ciptr */
-char * /* port */
+char *,/* port */
+unsigned int   /* flags */
 );
 
 int TRANS(NoListen) (
Index: Xtransint.h
===
RCS file: /home/x-cvs/xc/lib/xtrans/Xtransint.h,v
retrieving revision 3.35
diff -u -r3.35 Xtransint.h
--- Xtransint.h 26 Nov 2002 01:12:30 -  3.35
+++ Xtransint.h 23 Jul 2003 18:17:18 -
@@ -26,7 +26,7 @@
 from The Open Group.
 
 */
-/* $XFree86: xc/lib/xtrans/Xtransint.h,v 3.35 2002/11/26 01:12:30 dawes Exp $ */
+/* $XFree86: xc/lib/xtrans/Xtransint.h,v 3.34 2002/11/20 23:00:36 dawes Exp $ */
 
 /* Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA
  *
@@ -283,10 +283,13 @@
 );
 
 #ifdef TRANS_SERVER
+/* Flags */
+# define ADDR_IN_USE_ALLOWED   1
 
 int(*CreateListener)(
XtransConnInfo, /* connection */
-   char *  /* port */
+   char *, /* port */
+   unsigned int/* flags */
 );
 
 int(*ResetListener)(
Index: Xtranssock.c
===
RCS file: /home/x-cvs/xc/lib/xtrans/Xtranssock.c,v
retrieving revision 3.59
diff -u -r3.59 Xtranssock.c
--- Xtranssock.c18 Jul 2003 15:39:48 -  3.59
+++ Xtranssock.c23 Jul 2003 18:17:18 -
@@ -783,7 +783,8 @@
 
 static int
 TRANS(SocketCreateListener) (XtransConnInfo ciptr, 
-struct sockaddr *sockname, int socknamelen)
+struct sockaddr *sockname,
+int socknamelen, unsigned int flags)
 
 {
 intnamelen = socknamelen;
@@ -803,7 +804,10 @@
 
 while (bind (fd, (struct sockaddr *) sockname, namelen)  0)
 {
-   if (errno == 

Re: IPv6 problems on Linux

2003-07-23 Thread Marc Aurele La France
On Wed, 23 Jul 2003, Egbert Eich wrote:

 Marc Aurele La France writes:
   I don't like the peppering of this code with more OS #ifdef's.  I think
   the approach espoused by Itojun, Todd, Matthieu and Andrew is better.

 So maybe you can tell what the big difference is?

So maybe not.  I've already stated I cannot test IPv6 function.  As such,
I'm here more as an overseer, and in that capacity I am of the opinion
that this code need not be unnecessarily OS-#ifdef'ed.  Take that as you
see fit.

Marc.

+--+---+
|  Marc Aurele La France   |  work:   1-780-492-9310   |
|  Computing and Network Services  |  fax:1-780-492-1729   |
|  352 General Services Building   |  email:  [EMAIL PROTECTED]  |
|  University of Alberta   +---+
|  Edmonton, Alberta   |   |
|  T6G 2H1 | Standard disclaimers apply|
|  CANADA  |   |
+--+---+
XFree86 Core Team member.  ATI driver and X server internals.

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Matthieu Herrb
Here's a patch to allow multiple '-nolisten' options on the command
line. To disable both IPv4 and IPv6 transports, one needs to say:

  X -nolisten tcp -nolisten inet6 

I'll add a documentation patch too later. 

Index: xc/programs/Xserver/include/os.h
===
RCS file: /cvs/xf86/xc/programs/Xserver/include/os.h,v
retrieving revision 3.45
diff -u -r3.45 os.h
--- xc/programs/Xserver/include/os.h4 Jul 2003 16:24:29 -   3.45
+++ xc/programs/Xserver/include/os.h23 Jul 2003 20:34:47 -
@@ -480,5 +480,12 @@
 extern void AbortDDX(void);
 extern void ddxGiveUp(void);
 extern int TimeSinceLastInputEvent(void);
+
+typedef struct NoListenList {
+   char *name;
+   struct NoListenList *next;
+} *NoListenListPtr;
+
+extern NoListenListPtr noListenList;
 
 #endif /* OS_H */
Index: xc/programs/Xserver/os/connection.c
===
RCS file: /cvs/xf86/xc/programs/Xserver/os/connection.c,v
retrieving revision 3.61
diff -u -r3.61 connection.c
--- xc/programs/Xserver/os/connection.c 16 Jul 2003 01:39:00 -  3.61
+++ xc/programs/Xserver/os/connection.c 23 Jul 2003 20:34:47 -
@@ -186,7 +186,7 @@
 
 Bool RunFromSmartParent;   /* send SIGUSR1 to parent process */
 Bool PartialNetwork;   /* continue even if unable to bind all addrs */
-char *protNoListen; /* don't listen on this protocol */
+NoListenListPtr noListenList;  /* don't listen on these protocols */
 static Pid_t ParentProcess;
 #ifdef __UNIXOS2__
 Pid_t GetPPID(Pid_t pid);
@@ -309,6 +309,7 @@
 inti;
 intpartial;
 char   port[20];
+NoListenListPtr p;
 
 FD_ZERO(AllSockets);
 FD_ZERO(AllClients);
@@ -323,13 +324,13 @@
 
 FD_ZERO (WellKnownConnections);
 
-sprintf (port, %d, atoi (display));
+snprintf (port, sizeof(port), %d, atoi (display));
 
-if (protNoListen)
-if (_XSERVTransNoListen(protNoListen))
-{
-   FatalError (Failed to disable listen for %s, protNoListen);
-   }
+for (p = noListenList; p != NULL; p = p-next) {
+   if (_XSERVTransNoListen(p-name)) {
+   FatalError(Failed to disable listen for %s, p-name);
+   }
+}
 
 if ((_XSERVTransMakeAllCOTSServerListeners (port, partial,
ListenTransCount, ListenTransConns) = 0) 
Index: xc/programs/Xserver/os/utils.c
===
RCS file: /cvs/xf86/xc/programs/Xserver/os/utils.c,v
retrieving revision 3.89
diff -u -r3.89 utils.c
--- xc/programs/Xserver/os/utils.c  9 Jul 2003 15:27:35 -   3.89
+++ xc/programs/Xserver/os/utils.c  23 Jul 2003 20:34:47 -
@@ -602,6 +602,7 @@
 {
 int i, skip;
 
+noListenList = NULL;
 defaultKeyboardControl.autoRepeat = TRUE;
 
 #ifdef PART_NET
@@ -816,8 +823,13 @@
 #endif
else if ( strcmp( argv[i], -nolisten) == 0)
{
-if(++i  argc)
-   protNoListen = argv[i];
+   if(++i  argc) {
+   NoListenListPtr p = 
+   (NoListenListPtr)xalloc(sizeof(struct NoListenList));
+   p-name = argv[i];
+   p-next = noListenList;
+   noListenList = p;
+   }
else
UseMsg();
}


Matthieu
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Alan Coopersmith
Maybe I'm missing something, but I always thought the XFree86 nolisten
code was overly complicated, and this just seems to make it worse.  When
we added -nolisten to Xsun, we got multiple listeners for free with a
simpler implementation, contained entirely in utils.c:
else if ( strcmp( argv[i], -nolisten) == 0)
{
if(++i  argc) {
if (_XSERVTransNoListen(argv[i])) {
FatalError (Failed to disable listen for %s transport,
  argv[i]);
}
} else
UseMsg();
}
--
-Alan Coopersmith-  [EMAIL PROTECTED]
 Sun Microsystems, Inc. - Sun Software Group
 Quality / User Experience (QUE)   -   Globalization
 Platform Globalization Engineering: X11 Development
Matthieu Herrb wrote:
Here's a patch to allow multiple '-nolisten' options on the command
line. To disable both IPv4 and IPv6 transports, one needs to say:
  X -nolisten tcp -nolisten inet6 

I'll add a documentation patch too later. 

Index: xc/programs/Xserver/include/os.h
===
RCS file: /cvs/xf86/xc/programs/Xserver/include/os.h,v
retrieving revision 3.45
diff -u -r3.45 os.h
--- xc/programs/Xserver/include/os.h	4 Jul 2003 16:24:29 -	3.45
+++ xc/programs/Xserver/include/os.h	23 Jul 2003 20:34:47 -
@@ -480,5 +480,12 @@
 extern void AbortDDX(void);
 extern void ddxGiveUp(void);
 extern int TimeSinceLastInputEvent(void);
+
+typedef struct NoListenList {
+	char *name;
+	struct NoListenList *next;
+} *NoListenListPtr;
+
+extern NoListenListPtr noListenList;
 
 #endif /* OS_H */
Index: xc/programs/Xserver/os/connection.c
===
RCS file: /cvs/xf86/xc/programs/Xserver/os/connection.c,v
retrieving revision 3.61
diff -u -r3.61 connection.c
--- xc/programs/Xserver/os/connection.c	16 Jul 2003 01:39:00 -	3.61
+++ xc/programs/Xserver/os/connection.c	23 Jul 2003 20:34:47 -
@@ -186,7 +186,7 @@
 
 Bool RunFromSmartParent;	/* send SIGUSR1 to parent process */
 Bool PartialNetwork;		/* continue even if unable to bind all addrs */
-char *protNoListen; /* don't listen on this protocol */
+NoListenListPtr noListenList;	/* don't listen on these protocols */
 static Pid_t ParentProcess;
 #ifdef __UNIXOS2__
 Pid_t GetPPID(Pid_t pid);
@@ -309,6 +309,7 @@
 int		i;
 int		partial;
 char 	port[20];
+NoListenListPtr p;
 
 FD_ZERO(AllSockets);
 FD_ZERO(AllClients);
@@ -323,13 +324,13 @@
 
 FD_ZERO (WellKnownConnections);
 
-sprintf (port, %d, atoi (display));
+snprintf (port, sizeof(port), %d, atoi (display));
 
-if (protNoListen)
-if (_XSERVTransNoListen(protNoListen))
-{
-	FatalError (Failed to disable listen for %s, protNoListen);
-	}
+for (p = noListenList; p != NULL; p = p-next) {
+	if (_XSERVTransNoListen(p-name)) {
+		FatalError(Failed to disable listen for %s, p-name);
+	}
+}
 
 if ((_XSERVTransMakeAllCOTSServerListeners (port, partial,
 	ListenTransCount, ListenTransConns) = 0) 
Index: xc/programs/Xserver/os/utils.c
===
RCS file: /cvs/xf86/xc/programs/Xserver/os/utils.c,v
retrieving revision 3.89
diff -u -r3.89 utils.c
--- xc/programs/Xserver/os/utils.c	9 Jul 2003 15:27:35 -	3.89
+++ xc/programs/Xserver/os/utils.c	23 Jul 2003 20:34:47 -
@@ -602,6 +602,7 @@
 {
 int i, skip;
 
+noListenList = NULL;
 defaultKeyboardControl.autoRepeat = TRUE;
 
 #ifdef PART_NET
@@ -816,8 +823,13 @@
 #endif
 	else if ( strcmp( argv[i], -nolisten) == 0)
 	{
-if(++i  argc)
-	protNoListen = argv[i];
+	if(++i  argc) {
+		NoListenListPtr p = 
+		(NoListenListPtr)xalloc(sizeof(struct NoListenList));
+		p-name = argv[i];
+		p-next = noListenList;
+		noListenList = p;
+	}
 	else
 		UseMsg();
 	}

Matthieu
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Elliott Mitchell
 From: Matthias Scheler [EMAIL PROTECTED]
 On Wed, Jul 23, 2003 at 01:48:08PM +0200, Egbert Eich wrote:
I wasn't suggesting to use it on Linux. My suggestion was to revert to
using a single socket on all platforms and use the above code to enable
accepting IPv4 connections on *BSD.
  Yes, I understand. I was just looking for a decend way of making
  things work on Linux.
 
 Using a single socket should work on Linux according to your observations.
 And it definitely works on Solaris. So adding some conditional code which
 uses setsockopt() with IPV6_V6ONLY on platforms which have IPV6_V6ONLY
 defined should work arround the platform.

The danger is that on systems where V4-mapped addresses are disabled an
attacker might just manage to bind to either the V6 socket, or the V4
socket and possibly execute a MitM attack.

 But we would get complaints from the IPv6 folks which consider accepting
 IPv4 connections on IPv6 listeners a problem. See here:
 
 http://www.ietf.org/internet-drafts/draft-itojun-v6ops-v4mapped-harmful-01.txt
 
 So we probably need to implement heuristics similar to the one described
 by Andrew Aitchison.

The issues that the draft brings up are irrelevant to XFree86. They are
strictly OS/firewall issues. If those problems can occur on a system, the
system is already swiss cheese; and nothing XFree86 can do will
alleviate things.

The draft was sent to BugTraq, and everyone who responded brought the
exact same issue up:

http://www.securityfocus.com/archive/1/289420/2002-08-20/2002-08-26/2
http://www.securityfocus.com/archive/1/289409/2002-08-20/2002-08-26/2
http://www.securityfocus.com/archive/1/289375/2002-08-20/2002-08-26/2
http://www.securityfocus.com/archive/1/289364/2002-08-20/2002-08-26/2

If you want to see both sides and the rest of the thread:
http://www.securityfocus.com/archive/1/288622/2002-08-20/2002-08-26/1


-- 
(\___(\___(\__  --= 8-) EHM =--  __/)___/)___/)
 \   (| [EMAIL PROTECTED] PGP 8881EF59 |)   /
  \_  \   |  _  -O #include stddisclaimer.h O-   _  |   /  _/
\___\_|_/82 04 A1 3C C7 B1 37 2A*E3 6E 84 DA 97 4C 40 E6\_|_/___/


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: Rant (was Re: ATI Drivers.)

2003-07-23 Thread Jon Leech
On Sun, Jul 20, 2003 at 03:10:14AM -0400, Mike A. Harris wrote:
...
 Anyone in my position who has to deal with these types of support
 questions or customer/user feedback, will very likely know
 exactly where I am coming from, and will strongly back up my
 statement that it is often better to just shut the hell up and
 not say anything to a customer/user about something than it is to
 be honest and then upset them even more, possibly getting them to
 spread their negativity around and generate more bad publicity or
 angst toward your company.

I'll back that up. Besides which, after a few years of being bitched
at (and in one case involving a friend who's a senior software engineer
at a commodity graphics vendor, physically threatened) because their
company wasn't doing enough for Linux/OSS, I know a number of folks in
industry who have moved well away from their initial pro-Linux/OSS
position. It would be foolish to think that the personal views of
important individuals inside a company do not have an effect on that
company's official policies.

It definitely DOES NOT WORK to harangue, Slashdot, or otherwise
abuse the people responsible for the product you care about. At best you
and others like you will be tuned out in the future. At worst you will
be responsible for creating hostility towards you and your needs. There
is no upside to this behavior.

Jon
__@/
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: Rant (was Re: ATI Drivers.)

2003-07-23 Thread Kendall Bennett
Jon Leech [EMAIL PROTECTED] wrote:

 I'll back that up. Besides which, after a few years of being bitched
 at (and in one case involving a friend who's a senior software engineer at
 a commodity graphics vendor, physically threatened) because their company
 wasn't doing enough for Linux/OSS, I know a number of folks in industry
 who have moved well away from their initial pro-Linux/OSS position. It
 would be foolish to think that the personal views of important individuals
 inside a company do not have an effect on that company's official
 policies.
 
 It definitely DOES NOT WORK to harangue, Slashdot, or otherwise
 abuse the people responsible for the product you care about. At best you
 and others like you will be tuned out in the future. At worst you will be
 responsible for creating hostility towards you and your needs. There is no
 upside to this behavior.

I agree with that 100%. We actually would have had a release version of 
our Linux product at least three years ago, except for the massive amount 
of negative feedback we received during our initial public beta cycle on 
slashdot etc. Most of the complaints were along the lines of it ain't 
free, where's the source etc. It left such a bad taste in our mouths 
that when the original intern working on the project went home, we 
basically canned the product and only recently got back to working on it 
again. Thankfully the Linux community seems much more receptive to our 
products now (but then again we haven't announced anything on slashdot in 
years ;-).

Regards,

---
Kendall Bennett
Chief Executive Officer
SciTech Software, Inc.
Phone: (530) 894 8400
http://www.scitechsoft.com

~ SciTech SNAP - The future of device driver technology! ~

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Keith Packard
Around 23 o'clock on Jul 23, Matthieu Herrb wrote:

 Here's a patch to allow multiple '-nolisten' options on the command
 line. To disable both IPv4 and IPv6 transports, one needs to say:
 
   X -nolisten tcp -nolisten inet6 

While supporting multiple -nolisten arguments is good, I suggest that the
current '-nolisten tcp' should include both inet4 and inet6 tcp options; 
most people use '-nolisten tcp' to avoid exposing an open port to the X 
server to the network.

-nolisten inet4 don't listen for TCP/IPv4 connections
-nolisten inet6 don't listen for TCP/IPv6 connections
-nolisten tcp   don't listen for any TCP connections

-keith


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: IPv6 problems on Linux

2003-07-23 Thread Todd T. Fries
I'd like to say this was a head scratcher for me.  I like Keith's thouhts
on this.
-- 
Todd Fries .. [EMAIL PROTECTED]


Free Daemon Consulting, LLCLand: 405-748-4596
http://FreeDaemonConsulting.com  Mobile: 405-203-6124
..in support of free software solutions.

Key fingerprint: 37E7 D3EB 74D0 8D66 A68D  B866 0326 204E 3F42 004A
Key: http://todd.fries.net/pgp.txt

(last updated 2003/03/13 07:14:10)

Penned by Keith Packard on Wed, Jul 23, 2003 at 11:34:53PM -0400, we have:
| Around 23 o'clock on Jul 23, Matthieu Herrb wrote:
| 
|  Here's a patch to allow multiple '-nolisten' options on the command
|  line. To disable both IPv4 and IPv6 transports, one needs to say:
|  
|X -nolisten tcp -nolisten inet6 
| 
| While supporting multiple -nolisten arguments is good, I suggest that the
| current '-nolisten tcp' should include both inet4 and inet6 tcp options; 
| most people use '-nolisten tcp' to avoid exposing an open port to the X 
| server to the network.
| 
|   -nolisten inet4 don't listen for TCP/IPv4 connections
|   -nolisten inet6 don't listen for TCP/IPv6 connections
|   -nolisten tcp   don't listen for any TCP connections
| 
| -keith
| 
| 
| ___
| Devel mailing list
| [EMAIL PROTECTED]
| http://XFree86.Org/mailman/listinfo/devel
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel