summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/xorg/xorg_exa.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2009-10-09 09:52:17 -0400
committerZack Rusin <zackr@vmware.com>2009-10-11 20:02:47 -0400
commit319a588238b4c0c58f8f8807e1143ad79cd8f698 (patch)
tree215e02475c0f6a8eb0e4bb1fa56bce354bcf2c41 /src/gallium/state_trackers/xorg/xorg_exa.c
parent59ae3d51556229631f558f56268df89c885de664 (diff)
st/xorg: lots of rendering and xv changes
extract all the rendering code to xorg_rendedrer, make both exa and xv share that code. in the process cleanup the rendering code and implement a lot more of the xv infrastructure.
Diffstat (limited to 'src/gallium/state_trackers/xorg/xorg_exa.c')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_exa.c50
1 files changed, 10 insertions, 40 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c
index 2633e8caaf..29785c0040 100644
--- a/src/gallium/state_trackers/xorg/xorg_exa.c
+++ b/src/gallium/state_trackers/xorg/xorg_exa.c
@@ -43,8 +43,6 @@
#include "pipe/p_state.h"
#include "pipe/p_inlines.h"
-#include "cso_cache/cso_context.h"
-
#include "util/u_rect.h"
#define DEBUG_PRINT 0
@@ -90,16 +88,6 @@ exa_get_pipe_format(int depth, enum pipe_format *format, int *bbp)
}
static void
-xorg_exa_init_state(struct exa_context *exa)
-{
- struct pipe_depth_stencil_alpha_state dsa;
-
- /* set common initial clip state */
- memset(&dsa, 0, sizeof(struct pipe_depth_stencil_alpha_state));
- cso_set_depth_stencil_alpha(exa->cso, &dsa);
-}
-
-static void
xorg_exa_common_done(struct exa_context *exa)
{
exa->copy.src = NULL;
@@ -444,9 +432,9 @@ ExaCopy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY,
debug_assert(priv == exa->copy.dst);
- xorg_copy_pixmap(exa, exa->copy.dst, dstX, dstY,
- exa->copy.src, srcX, srcY,
- width, height);
+ renderer_copy_pixmap(exa->renderer, exa->copy.dst, dstX, dstY,
+ exa->copy.src, srcX, srcY,
+ width, height);
}
static Bool
@@ -701,7 +689,7 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
dst_surf = exa->scrn->get_tex_surface(
exa->scrn, texture, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE);
- src_surf = exa_gpu_surface(exa, priv);
+ src_surf = xorg_gpu_surface(exa->pipe->screen, priv);
exa->pipe->surface_copy(exa->pipe, dst_surf, 0, 0, src_surf,
0, 0, min(width, texture->width[0]),
min(height, texture->height[0]));
@@ -731,23 +719,8 @@ xorg_exa_close(ScrnInfoPtr pScrn)
{
modesettingPtr ms = modesettingPTR(pScrn);
struct exa_context *exa = ms->exa;
- struct pipe_constant_buffer *vsbuf = &exa->vs_const_buffer;
- struct pipe_constant_buffer *fsbuf = &exa->fs_const_buffer;
- if (exa->shaders) {
- xorg_shaders_destroy(exa->shaders);
- }
-
- if (vsbuf && vsbuf->buffer)
- pipe_buffer_reference(&vsbuf->buffer, NULL);
-
- if (fsbuf && fsbuf->buffer)
- pipe_buffer_reference(&fsbuf->buffer, NULL);
-
- if (exa->cso) {
- cso_release_all(exa->cso);
- cso_destroy_context(exa->cso);
- }
+ renderer_destroy(exa->renderer);
if (exa->pipe)
exa->pipe->destroy(exa->pipe);
@@ -822,10 +795,7 @@ xorg_exa_init(ScrnInfoPtr pScrn)
/* Share context with DRI */
ms->ctx = exa->pipe;
- exa->cso = cso_create_context(exa->pipe);
- exa->shaders = xorg_shaders_create(exa);
-
- xorg_exa_init_state(exa);
+ exa->renderer = renderer_create(exa->pipe);
return (void *)exa;
@@ -836,11 +806,11 @@ out_err:
}
struct pipe_surface *
-exa_gpu_surface(struct exa_context *exa, struct exa_pixmap_priv *priv)
+xorg_gpu_surface(struct pipe_screen *scrn, struct exa_pixmap_priv *priv)
{
- return exa->scrn->get_tex_surface(exa->scrn, priv->tex, 0, 0, 0,
- PIPE_BUFFER_USAGE_GPU_READ |
- PIPE_BUFFER_USAGE_GPU_WRITE);
+ return scrn->get_tex_surface(scrn, priv->tex, 0, 0, 0,
+ PIPE_BUFFER_USAGE_GPU_READ |
+ PIPE_BUFFER_USAGE_GPU_WRITE);
}