summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/glx
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/glx')
-rw-r--r--src/gallium/state_trackers/glx/xlib/glx_api.c7
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.c10
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.h5
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_st.c34
4 files changed, 29 insertions, 27 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c
index dcd50e19d7..205a7e3c19 100644
--- a/src/gallium/state_trackers/glx/xlib/glx_api.c
+++ b/src/gallium/state_trackers/glx/xlib/glx_api.c
@@ -46,9 +46,6 @@
#define SERVER_MAJOR_VERSION 1
#define SERVER_MINOR_VERSION 4
-/* This is appended onto the glXGetClient/ServerString version strings. */
-#define MESA_GLX_VERSION "Mesa " MESA_VERSION_STRING
-
/* Who implemented this GLX? */
#define VENDOR "Brian Paul"
@@ -1672,7 +1669,7 @@ glXQueryServerString( Display *dpy, int screen, int name )
{
static char version[1000];
sprintf(version, "%d.%d %s",
- SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, MESA_GLX_VERSION);
+ SERVER_MAJOR_VERSION, SERVER_MINOR_VERSION, xmesa_get_name());
(void) dpy;
(void) screen;
@@ -1697,7 +1694,7 @@ glXGetClientString( Display *dpy, int name )
{
static char version[1000];
sprintf(version, "%d.%d %s", CLIENT_MAJOR_VERSION,
- CLIENT_MINOR_VERSION, MESA_GLX_VERSION);
+ CLIENT_MINOR_VERSION, xmesa_get_name());
(void) dpy;
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c
index 8332633f01..7c47a25ceb 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
@@ -828,6 +828,16 @@ void XMesaDestroyVisual( XMesaVisual v )
/**
+ * Return the informative name.
+ */
+const char *
+xmesa_get_name(void)
+{
+ return stapi->name;
+}
+
+
+/**
* Do per-display initializations.
*/
void
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.h b/src/gallium/state_trackers/glx/xlib/xm_api.h
index b8ac979edc..4ea42dc375 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.h
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.h
@@ -57,7 +57,7 @@ and create a window, you must do the following to use the X/Mesa interface:
#define XMESA_H
-#include "main/core.h" /* for GLvisual and MESA_VERSION_STRING */
+#include "main/core.h" /* for gl_config */
#include "state_tracker/st_api.h"
#include "os/os_thread.h"
@@ -351,6 +351,9 @@ struct xmesa_buffer {
+extern const char *
+xmesa_get_name(void);
+
extern void
xmesa_init(Display *dpy);
diff --git a/src/gallium/state_trackers/glx/xlib/xm_st.c b/src/gallium/state_trackers/glx/xlib/xm_st.c
index e7466bdbee..6bfe8b0788 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_st.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_st.c
@@ -42,7 +42,7 @@ struct xmesa_st_framebuffer {
unsigned texture_width, texture_height, texture_mask;
struct pipe_resource *textures[ST_ATTACHMENT_COUNT];
- struct pipe_surface *display_surface;
+ struct pipe_resource *display_resource;
};
static INLINE struct xmesa_st_framebuffer *
@@ -60,25 +60,19 @@ xmesa_st_framebuffer_display(struct st_framebuffer_iface *stfbi,
{
struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
struct pipe_resource *ptex = xstfb->textures[statt];
- struct pipe_surface *psurf;
+ struct pipe_resource *pres;
if (!ptex)
return TRUE;
- psurf = xstfb->display_surface;
+ pres = xstfb->display_resource;
/* (re)allocate the surface for the texture to be displayed */
- if (!psurf || psurf->texture != ptex) {
- pipe_surface_reference(&xstfb->display_surface, NULL);
-
- psurf = xstfb->screen->get_tex_surface(xstfb->screen,
- ptex, 0, 0, 0, PIPE_BIND_DISPLAY_TARGET);
- if (!psurf)
- return FALSE;
-
- xstfb->display_surface = psurf;
+ if (!pres || pres != ptex) {
+ pipe_resource_reference(&xstfb->display_resource, ptex);
+ pres = xstfb->display_resource;
}
- xstfb->screen->flush_frontbuffer(xstfb->screen, psurf, &xstfb->buffer->ws);
+ xstfb->screen->flush_frontbuffer(xstfb->screen, pres, 0, 0, &xstfb->buffer->ws);
return TRUE;
}
@@ -96,7 +90,7 @@ xmesa_st_framebuffer_copy_textures(struct st_framebuffer_iface *stfbi,
struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
struct pipe_resource *src_ptex = xstfb->textures[src_statt];
struct pipe_resource *dst_ptex = xstfb->textures[dst_statt];
- struct pipe_subresource subsrc, subdst;
+ struct pipe_box src_box;
struct pipe_context *pipe;
if (!src_ptex || !dst_ptex)
@@ -110,14 +104,11 @@ xmesa_st_framebuffer_copy_textures(struct st_framebuffer_iface *stfbi,
xstfb->display->pipe = pipe;
}
- subsrc.face = 0;
- subsrc.level = 0;
- subdst.face = 0;
- subdst.level = 0;
+ u_box_2d(x, y, width, height, &src_box);
if (src_ptex && dst_ptex)
- pipe->resource_copy_region(pipe, dst_ptex, subdst, x, y, 0,
- src_ptex, subsrc, x, y, 0, width, height);
+ pipe->resource_copy_region(pipe, dst_ptex, 0, x, y, 0,
+ src_ptex, 0, &src_box);
}
/**
@@ -144,6 +135,7 @@ xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi,
templ.width0 = width;
templ.height0 = height;
templ.depth0 = 1;
+ templ.array_size = 1;
templ.last_level = 0;
for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
@@ -321,7 +313,7 @@ xmesa_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi)
struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
int i;
- pipe_surface_reference(&xstfb->display_surface, NULL);
+ pipe_resource_reference(&xstfb->display_resource, NULL);
for (i = 0; i < ST_ATTACHMENT_COUNT; i++)
pipe_resource_reference(&xstfb->textures[i], NULL);