I've run into a problem with Mesa 3.1b3 on Onyx2 InfiniteReality
running IRIX 6.5.4f. The X server on InfiniteReality graphics exports
both TrueColor and PseudoColor overlay visuals:


$ xprop -root | grep SERER_OVERLAY_VISUALS
SERVER_OVERLAY_VISUALS(SERVER_OVERLAY_VISUALS) = 0x20, 0x1, 0x0, 0x2, 0x21, 0x1, 0x0, 
0x1, 0x22, 0x1, 0x0, 0x1, 0x23, 0x0, 0x0, 0x1, 0x24, 0x0, 0x0, 0x1, 0x25, 0x1, 0x0, 
0x1, 0x26, 0x1, 0x0, 0x1, 0x27, 0x0, 0x0, 0x1, 0x28, 0x0, 0x0, 0x1, 0x2f, 0x1, 0x0, 
0x1, 0x30, 0x1, 0x0, 0x1, 0x31, 0x0, 0x0, 0x1, 0x32, 0x0, 0x0, 0x1, 0x42, 0x1, 0x0, 
0x1, 0x43, 0x0, 0x0, 0x1


For instance, visual 0x2f corresponds to the kind of 8 bit colorindex
visual which is normally found for hardware overlay planes, as shown
by xdpyinfo:

  visual:
    visual id:    0x2f
    class:    PseudoColor
    depth:    8 planes
    available colormap entries:    256
    red, green, blue masks:    0x0, 0x0, 0x0
    significant bits in color specification:    10 bits


But visual 0x42 is an actual double-buffered, RGBA 5/5/5/1 overlay
plane visual:

  visual:
    visual id:    0x42
    class:    TrueColor
    depth:    15 planes
    available colormap entries:    32 per subfield
    red, green, blue masks:    0x7c00, 0x3e0, 0x1f
    significant bits in color specification:    10 bits


Unfortunately, it seems that when you request a colorindex overlay
visual, Mesa 3.1b3 gets confused and returns the RGBA overlay visual:

-----------------------
#include <stdio.h>
#include <X11/Xlib.h>

#include <GL/gl.h>
#include <GL/glx.h>

static int oattrib[] =
{
  GLX_LEVEL, 1,
  GLX_BUFFER_SIZE, 4,
  None,
};

main(int argc, char **argv)
{
  long                 i, j;
  unsigned char*       buffer;
  XSetWindowAttributes swa;
  XVisualInfo          *vi;
  GLXContext           OglContext;
  Window               win;
  Display              *display;
  char                 c;
  
  if( ( display = XOpenDisplay( NULL ) ) == NULL )
  {
    fprintf( stderr, "Cannot connect to X server.\n" );
    exit( 1 );
  }

  vi = glXChooseVisual( display, DefaultScreen( display ), oattrib );

  printf("Visual ID is 0x%x\n",vi->visualid);    

}
--------------------

Run this and you get:

$ ./dboverlay 
Visual ID is 0x42

If you then try to allocate X colormap entries, thinking you have
received a colorindex visual as you have requested, this will fail.


The problem appears to come from src/X/fakeglx.c, in
choose_x_overlay_visual(). First of all, it would be nice if this
function looked at an environment variable such as MESA_OVERLAY_VISUAL
which could be used as a back door to override the visual selection
mechanism in the same way that choose_x_visual() looks at
MESA_RGB_VISUAL and MESA_CI_VISUAL.

Secondly, it should be passed "rgb_flag" from Fake_glXChooseVisual()
in the same way as choose_x_visual() to specify what kind of visual
is desired.

Let me know if more information is required to reproduce this problem,
or if there are any patches I should be trying. I currently do not
subscribe to any Mesa-related mailing lists.

Thanks,
JF Panisset


Jean-Francois Panisset                                [EMAIL PROTECTED]
Software Engineer
Discreet Logic 




_______________________________________________
Mesa-bug maillist  -  [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-bug


_______________________________________________
Mesa-dev maillist  -  [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev

Reply via email to