Subject: Linux/SGI /dev/opengl magic ioctl

From: Miguel de Icaza <[email-masked]>
Date: Thu, 11 Sep 1997 22:48:59 -0500

Hello guys,

   Ok, 2 questions 2 for tonight :-).

   Ok, I am getting close, just out of curiosity, what does the ioctl
cmd=1 do on the /dev/opengl device?  

   If the ioctl does not return 3, the X server complains.  Right now
I have this nice piece of code in the graphics driver:

	switch (cmd){
		...

	case 1:
		return 3;
		...
	}
   
    which is not exactly what I would like to have, so any comments
are appreciated.

    Second question: what does the GFX_LABEL ioctl do on the
/dev/opengl device?  I am missing this one in my implementation.

    I am around 100 system calls far from getting a nice display on
Linux/SGI X. 

Cheers,
Miguel.

---

From: "William J. Earl" <[email-masked]>
Date: Fri, 12 Sep 1997 09:50:45 -0700

>     which is not exactly what I would like to have, so any comments

      It turns out that is pretty much what the graphics driver is doing
in IRIX:

	        case GFX_SYNC :
		{
			*rvalp = GFX_SYNC_VALUE;
			goto out;
		}

For GL (not OpenGL), if the process is an sproc (a process sharing and
address space and file descriptors with a parent or siblings), the driver
acquires a semaphore before doing an ioctl and releases it afterwards.
For OpenGL, this ioctl does not really do anything at all.  

 > /dev/opengl device?  I am missing this one in my implementation.

It copies GFX_INFO_LABEL_SIZE (16) bytes from the argument (a char *) to
the label field of the gfx_info struct for the graphics device.  The label
field is the choice of the current owner of the device, so it is not really
significant.  The /usr/gfx/gfxinfo command can print the gfx_info structure
for the local device.