Sfoglia il codice sorgente

st/glx: add support for multiple displays

This is a quick & dirty solution, but it works.  See comments in
the code for other ideas.

Fixes regressions/breakage seen in progs/xdemos/glxheads, etc. from commit
6632915e95.
tags/mesa-7.9-rc1
Brian Paul 15 anni fa
parent
commit
8ba47561dd
1 ha cambiato i file con 26 aggiunte e 4 eliminazioni
  1. 26
    4
      src/gallium/state_trackers/glx/xlib/xm_api.c

+ 26
- 4
src/gallium/state_trackers/glx/xlib/xm_api.c Vedi File

@@ -78,17 +78,39 @@ void xmesa_set_driver( const struct xm_driver *templ )
stapi = driver.create_st_api();
}


/*
* XXX replace this with a linked list, or better yet, try to attach the
* gallium/mesa extra bits to the X Display object with XAddExtension().
*/
#define MAX_DISPLAYS 10
static struct xmesa_display Displays[MAX_DISPLAYS];
static int NumDisplays = 0;


static XMesaDisplay
xmesa_init_display( Display *display )
{
pipe_static_mutex(init_mutex);
static struct xmesa_display xm_display;
XMesaDisplay xmdpy;
int i;

pipe_mutex_lock(init_mutex);

/* TODO support for multiple displays */
xmdpy = &xm_display;
/* Look for XMesaDisplay which corresponds to 'display' */
for (i = 0; i < NumDisplays; i++) {
if (Displays[i].display == display) {
/* Found it */
pipe_mutex_unlock(init_mutex);
return &Displays[i];
}
}

/* Create new XMesaDisplay */

assert(NumDisplays < MAX_DISPLAYS);
xmdpy = &Displays[NumDisplays];
NumDisplays++;

if (!xmdpy->display && display) {
xmdpy->display = display;

Loading…
Annulla
Salva