Miguel de Icaza writes:
>
> 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.
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.
> Second question: what does the GFX_LABEL ioctl do on the
> /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.
|