summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/g3dvl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/g3dvl')
-rw-r--r--src/gallium/state_trackers/g3dvl/tests/.gitignore6
-rw-r--r--src/gallium/state_trackers/g3dvl/tests/Makefile45
-rw-r--r--src/gallium/state_trackers/g3dvl/tests/test_b_rendering.c226
-rw-r--r--src/gallium/state_trackers/g3dvl/tests/test_context.c22
-rw-r--r--src/gallium/state_trackers/g3dvl/tests/test_i_rendering.c137
-rw-r--r--src/gallium/state_trackers/g3dvl/tests/test_p_rendering.c214
-rw-r--r--src/gallium/state_trackers/g3dvl/tests/test_pf_rendering.c214
-rw-r--r--src/gallium/state_trackers/g3dvl/tests/test_surface.c26
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_basic_csc.c83
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c56
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_surface.c64
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_surface.h32
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_types.h7
13 files changed, 169 insertions, 963 deletions
diff --git a/src/gallium/state_trackers/g3dvl/tests/.gitignore b/src/gallium/state_trackers/g3dvl/tests/.gitignore
deleted file mode 100644
index 9b1ec4e212..0000000000
--- a/src/gallium/state_trackers/g3dvl/tests/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-test_context
-test_surface
-test_i_rendering
-test_p_rendering
-test_pf_rendering
-test_b_rendering
diff --git a/src/gallium/state_trackers/g3dvl/tests/Makefile b/src/gallium/state_trackers/g3dvl/tests/Makefile
deleted file mode 100644
index 45cefa2e57..0000000000
--- a/src/gallium/state_trackers/g3dvl/tests/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-GALLIUMDIR = ../../..
-
-CFLAGS += -g -Wall -Werror \
- -I${GALLIUMDIR}/state_trackers/g3dvl \
- -I${GALLIUMDIR}/winsys/g3dvl \
- -I${GALLIUMDIR}/include \
- -I${GALLIUMDIR}/auxiliary \
- -I${GALLIUMDIR}/drivers
-LDFLAGS += -L${GALLIUMDIR}/state_trackers/g3dvl \
- -L${GALLIUMDIR}/drivers/softpipe \
- -L${GALLIUMDIR}/auxiliary/tgsi \
- -L${GALLIUMDIR}/auxiliary/draw \
- -L${GALLIUMDIR}/auxiliary/util \
- -L${GALLIUMDIR}/auxiliary/translate \
- -L${GALLIUMDIR}/auxiliary/cso_cache \
- -L${GALLIUMDIR}/auxiliary/rtasm
-LIBS += -lg3dvl -lsoftpipe -ldraw -ltgsi -ltranslate -lrtasm -lcso_cache -lutil -lX11 -lm
-
-#############################################
-
-.PHONY = all clean
-
-all: test_context test_surface test_i_rendering test_p_rendering test_pf_rendering test_b_rendering
-
-test_context: test_context.o ${GALLIUMDIR}/winsys/g3dvl/xsp_winsys.o
- $(CC) ${LDFLAGS} -o $@ $^ ${LIBS}
-
-test_surface: test_surface.o ${GALLIUMDIR}/winsys/g3dvl/xsp_winsys.o
- $(CC) ${LDFLAGS} -o $@ $^ ${LIBS}
-
-test_i_rendering: test_i_rendering.o ${GALLIUMDIR}/winsys/g3dvl/xsp_winsys.o
- $(CC) ${LDFLAGS} -o $@ $^ ${LIBS}
-
-test_p_rendering: test_p_rendering.o ${GALLIUMDIR}/winsys/g3dvl/xsp_winsys.o
- $(CC) ${LDFLAGS} -o $@ $^ ${LIBS}
-
-test_pf_rendering: test_pf_rendering.o ${GALLIUMDIR}/winsys/g3dvl/xsp_winsys.o
- $(CC) ${LDFLAGS} -o $@ $^ ${LIBS}
-
-test_b_rendering: test_b_rendering.o ${GALLIUMDIR}/winsys/g3dvl/xsp_winsys.o
- $(CC) ${LDFLAGS} -o $@ $^ ${LIBS}
-
-clean:
- rm -rf *.o test_context test_surface test_i_rendering test_p_rendering test_pf_rendering test_b_rendering
-
diff --git a/src/gallium/state_trackers/g3dvl/tests/test_b_rendering.c b/src/gallium/state_trackers/g3dvl/tests/test_b_rendering.c
deleted file mode 100644
index b78cc851ae..0000000000
--- a/src/gallium/state_trackers/g3dvl/tests/test_b_rendering.c
+++ /dev/null
@@ -1,226 +0,0 @@
-#include <stdio.h>
-#include <X11/Xlib.h>
-#include <vl_context.h>
-#include <vl_surface.h>
-#include <xsp_winsys.h>
-
-static const unsigned short ycbcr16x16_420[8*8*6] =
-{
- 0x00A5,0x00A5,0x00A5,0x0072,0x00A5,0x0072,0x0072,0x0072,
- 0x0072,0x00A5,0x0072,0x0072,0x00A5,0x0072,0x0072,0x0072,
- 0x0072,0x00A5,0x0072,0x0072,0x00A5,0x00A5,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,0x00A5,0x00A5,
-
- 0x004F,0x004F,0x004F,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x004F,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x004F,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x004F,0x004F,
-
- 0x003E,0x003E,0x003E,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x003E,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x003E,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x003E,0x003E
-};
-
-static const signed short ycbcr16x16_420_2[8*8*6] =
-{
- -0x00A5,-0x00A5,-0x00A5,-0x0072,-0x00A5,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x00A5,-0x0072,-0x0072,-0x00A5,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x00A5,-0x0072,-0x0072,-0x00A5,-0x00A5,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
-
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
-
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
-
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x00A5,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x00A5,-0x00A5,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x0072,-0x00A5,-0x00A5,-0x00A5,
- -0x0072,-0x0072,-0x0072,-0x0072,-0x00A5,-0x00A5,-0x00A5,-0x00A5,
-
- -0x004F,-0x004F,-0x004F,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,
- -0x00B2,-0x00B2,-0x004F,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,
- -0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,
- -0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,
- -0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,
- -0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,
- -0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x004F,
- -0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x00B2,-0x004F,-0x004F,
-
- -0x003E,-0x003E,-0x003E,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,
- -0x0060,-0x0060,-0x003E,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,
- -0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,
- -0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,
- -0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,
- -0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,
- -0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x003E,
- -0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x0060,-0x003E,-0x003E
-};
-
-int main(int argc, char **argv)
-{
- const unsigned int video_width = 32, video_height = 32;
- const unsigned int window_width = video_width * 2, window_height = video_height * 2;
- int quit = 0;
- Display *display;
- Window root, window;
- Pixmap framebuffer;
- XEvent event;
- struct pipe_context *pipe;
- struct VL_CONTEXT *ctx;
- struct VL_SURFACE *sfc, *past_sfc, *future_sfc;
- struct VL_MOTION_VECTOR motion_vector[2] =
- {
- {
- {0, 0}, {0, 0}
- },
- {
- {0, 0}, {0, 0}
- }
- };
-
- display = XOpenDisplay(NULL);
- root = XDefaultRootWindow(display);
- window = XCreateSimpleWindow(display, root, 0, 0, window_width, window_height, 0, 0, 0);
- framebuffer = XCreatePixmap(display, root, window_width, window_height, 24);
-
- XSelectInput(display, window, ExposureMask | KeyPressMask);
- XMapWindow(display, window);
- XSync(display, 0);
-
- pipe = create_pipe_context(display);
- vlCreateContext(display, pipe, video_width, video_height, VL_FORMAT_YCBCR_420, &ctx);
- vlCreateSurface(ctx, &sfc);
- vlCreateSurface(ctx, &past_sfc);
- vlCreateSurface(ctx, &future_sfc);
-
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 0, 0, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, past_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 1, 0, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, past_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 0, 1, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, past_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 1, 1, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, past_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 0, 0, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, future_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 1, 0, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, future_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 0, 1, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, future_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 1, 1, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, future_sfc);
- vlRenderBMacroBlock
- (
- VL_FRAME_PICTURE,
- VL_FIELD_FIRST,
- 0,
- 0,
- VL_FRAME_MC,
- motion_vector,
- 0x3F,
- VL_DCT_FRAME_CODED,
- (short*)ycbcr16x16_420_2,
- past_sfc,
- future_sfc,
- sfc
- );
- vlPutSurface(sfc, framebuffer, 0, 0, video_width, video_height, 0, 0, window_width, window_height, VL_FRAME_PICTURE);
-
- puts("Press any key to continue...");
-
- while (!quit)
- {
- XNextEvent(display, &event);
- switch (event.type)
- {
- case Expose:
- {
- XCopyArea
- (
- display,
- framebuffer,
- window,
- XDefaultGC(display, XDefaultScreen(display)),
- 0,
- 0,
- window_width,
- window_height,
- 0,
- 0
- );
- break;
- }
- case KeyPress:
- {
- quit = 1;
- break;
- }
- }
- }
-
- vlDestroySurface(sfc);
- vlDestroySurface(past_sfc);
- vlDestroySurface(future_sfc);
- vlDestroyContext(ctx);
-
- XFreePixmap(display, framebuffer);
- XDestroyWindow(display, window);
- XCloseDisplay(display);
-
- return 0;
-}
-
diff --git a/src/gallium/state_trackers/g3dvl/tests/test_context.c b/src/gallium/state_trackers/g3dvl/tests/test_context.c
deleted file mode 100644
index 2002977ee2..0000000000
--- a/src/gallium/state_trackers/g3dvl/tests/test_context.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <vl_context.h>
-#include <xsp_winsys.h>
-
-int main(int argc, char **argv)
-{
- const unsigned int video_width = 32, video_height = 32;
-
- Display *display;
- struct pipe_context *pipe;
- struct VL_CONTEXT *ctx;
-
- display = XOpenDisplay(NULL);
- pipe = create_pipe_context(display);
-
- vlCreateContext(display, pipe, video_width, video_height, VL_FORMAT_YCBCR_420, &ctx);
- vlDestroyContext(ctx);
-
- XCloseDisplay(display);
-
- return 0;
-}
-
diff --git a/src/gallium/state_trackers/g3dvl/tests/test_i_rendering.c b/src/gallium/state_trackers/g3dvl/tests/test_i_rendering.c
deleted file mode 100644
index 1f96471130..0000000000
--- a/src/gallium/state_trackers/g3dvl/tests/test_i_rendering.c
+++ /dev/null
@@ -1,137 +0,0 @@
-#include <stdio.h>
-#include <X11/Xlib.h>
-#include <vl_context.h>
-#include <vl_surface.h>
-#include <xsp_winsys.h>
-
-static const unsigned short ycbcr16x16_420[8*8*6] =
-{
- 0x00A5,0x00A5,0x00A5,0x0072,0x00A5,0x0072,0x0072,0x0072,
- 0x0072,0x00A5,0x0072,0x0072,0x00A5,0x0072,0x0072,0x0072,
- 0x0072,0x00A5,0x0072,0x0072,0x00A5,0x00A5,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,0x00A5,0x00A5,
-
- 0x004F,0x004F,0x004F,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x004F,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x004F,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x004F,0x004F,
-
- 0x003E,0x003E,0x003E,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x003E,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x003E,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x003E,0x003E
-};
-
-int main(int argc, char **argv)
-{
- const unsigned int video_width = 32, video_height = 32;
- const unsigned int window_width = video_width * 2, window_height = video_height * 2;
- int quit = 0;
- Display *display;
- Window root, window;
- Pixmap framebuffer;
- XEvent event;
- struct pipe_context *pipe;
- struct VL_CONTEXT *ctx;
- struct VL_SURFACE *sfc;
-
- display = XOpenDisplay(NULL);
- root = XDefaultRootWindow(display);
- window = XCreateSimpleWindow(display, root, 0, 0, window_width, window_height, 0, 0, 0);
- framebuffer = XCreatePixmap(display, root, window_width, window_height, 24);
-
- XSelectInput(display, window, ExposureMask | KeyPressMask);
- XMapWindow(display, window);
- XSync(display, 0);
-
- pipe = create_pipe_context(display);
- vlCreateContext(display, pipe, video_width, video_height, VL_FORMAT_YCBCR_420, &ctx);
- vlCreateSurface(ctx, &sfc);
-
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 0, 0, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 1, 0, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 0, 1, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 1, 1, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, sfc);
- vlPutSurface(sfc, framebuffer, 0, 0, video_width, video_height, 0, 0, window_width, window_height, VL_FRAME_PICTURE);
-
- puts("Press any key to continue...");
-
- while (!quit)
- {
- XNextEvent(display, &event);
- switch (event.type)
- {
- case Expose:
- {
- XCopyArea
- (
- display,
- framebuffer,
- window,
- XDefaultGC(display, XDefaultScreen(display)),
- 0,
- 0,
- window_width,
- window_height,
- 0,
- 0
- );
- break;
- }
- case KeyPress:
- {
- quit = 1;
- break;
- }
- }
- }
-
- vlDestroySurface(sfc);
- vlDestroyContext(ctx);
-
- XFreePixmap(display, framebuffer);
- XDestroyWindow(display, window);
- XCloseDisplay(display);
-
- return 0;
-}
-
diff --git a/src/gallium/state_trackers/g3dvl/tests/test_p_rendering.c b/src/gallium/state_trackers/g3dvl/tests/test_p_rendering.c
deleted file mode 100644
index 2203349784..0000000000
--- a/src/gallium/state_trackers/g3dvl/tests/test_p_rendering.c
+++ /dev/null
@@ -1,214 +0,0 @@
-#include <stdio.h>
-#include <X11/Xlib.h>
-#include <vl_context.h>
-#include <vl_surface.h>
-#include <xsp_winsys.h>
-
-static const unsigned short ycbcr16x16_420[8*8*6] =
-{
- 0x00A5,0x00A5,0x00A5,0x0072,0x00A5,0x0072,0x0072,0x0072,
- 0x0072,0x00A5,0x0072,0x0072,0x00A5,0x0072,0x0072,0x0072,
- 0x0072,0x00A5,0x0072,0x0072,0x00A5,0x00A5,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,0x00A5,0x00A5,
-
- 0x004F,0x004F,0x004F,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x004F,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x004F,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x004F,0x004F,
-
- 0x003E,0x003E,0x003E,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x003E,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x003E,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x003E,0x003E
-};
-
-static const signed short ycbcr16x16_420_2[8*8*6] =
-{
- -51,-51,-51, 0,-51, 0, 0, 0,
- 0,-51, 0, 0,-51, 0, 0, 0,
- 0,-51, 0, 0,-51,-51, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 99, 99, 99, 0, 0, 0, 0, 0,
- 0, 0, 99, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 33, 33, 33, 0, 0, 0, 0, 0,
- 0, 0, 33, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-int main(int argc, char **argv)
-{
- const unsigned int video_width = 32, video_height = 32;
- const unsigned int window_width = video_width * 2, window_height = video_height * 2;
- int quit = 0;
- Display *display;
- Window root, window;
- Pixmap framebuffer;
- XEvent event;
- struct pipe_context *pipe;
- struct VL_CONTEXT *ctx;
- struct VL_SURFACE *sfc, *ref_sfc;
- struct VL_MOTION_VECTOR motion_vector =
- {
- {0, 0}, {0, 0}
- };
-
- display = XOpenDisplay(NULL);
- root = XDefaultRootWindow(display);
- window = XCreateSimpleWindow(display, root, 0, 0, window_width, window_height, 0, 0, 0);
- framebuffer = XCreatePixmap(display, root, window_width, window_height, 24);
-
- XSelectInput(display, window, ExposureMask | KeyPressMask);
- XMapWindow(display, window);
- XSync(display, 0);
-
- pipe = create_pipe_context(display);
- vlCreateContext(display, pipe, video_width, video_height, VL_FORMAT_YCBCR_420, &ctx);
- vlCreateSurface(ctx, &sfc);
- vlCreateSurface(ctx, &ref_sfc);
-
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 0, 0, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, ref_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 1, 0, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, ref_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 0, 1, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, ref_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 1, 1, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, ref_sfc);
- vlRenderPMacroBlock
- (
- VL_FRAME_PICTURE,
- VL_FIELD_FIRST,
- 0,
- 0,
- VL_FRAME_MC,
- &motion_vector,
- 0x3F,
- VL_DCT_FRAME_CODED,
- (short*)ycbcr16x16_420_2,
- ref_sfc,
- sfc
- );
- vlPutSurface(sfc, framebuffer, 0, 0, video_width, video_height, 0, 0, window_width, window_height, VL_FRAME_PICTURE);
-
- puts("Press any key to continue...");
-
- while (!quit)
- {
- XNextEvent(display, &event);
- switch (event.type)
- {
- case Expose:
- {
- XCopyArea
- (
- display,
- framebuffer,
- window,
- XDefaultGC(display, XDefaultScreen(display)),
- 0,
- 0,
- window_width,
- window_height,
- 0,
- 0
- );
- break;
- }
- case KeyPress:
- {
- quit = 1;
- break;
- }
- }
- }
-
- vlDestroySurface(sfc);
- vlDestroySurface(ref_sfc);
- vlDestroyContext(ctx);
-
- XFreePixmap(display, framebuffer);
- XDestroyWindow(display, window);
- XCloseDisplay(display);
-
- return 0;
-}
-
diff --git a/src/gallium/state_trackers/g3dvl/tests/test_pf_rendering.c b/src/gallium/state_trackers/g3dvl/tests/test_pf_rendering.c
deleted file mode 100644
index 43586fc553..0000000000
--- a/src/gallium/state_trackers/g3dvl/tests/test_pf_rendering.c
+++ /dev/null
@@ -1,214 +0,0 @@
-#include <stdio.h>
-#include <X11/Xlib.h>
-#include <vl_context.h>
-#include <vl_surface.h>
-#include <xsp_winsys.h>
-
-static const unsigned short ycbcr16x16_420[8*8*6] =
-{
- 0x00A5,0x00A5,0x00A5,0x0072,0x00A5,0x0072,0x0072,0x0072,
- 0x0072,0x00A5,0x0072,0x0072,0x00A5,0x0072,0x0072,0x0072,
- 0x0072,0x00A5,0x0072,0x0072,0x00A5,0x00A5,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
-
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,0x00A5,
- 0x0072,0x0072,0x0072,0x0072,0x00A5,0x00A5,0x00A5,0x00A5,
-
- 0x004F,0x004F,0x004F,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x004F,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x004F,
- 0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x00B2,0x004F,0x004F,
-
- 0x003E,0x003E,0x003E,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x003E,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x003E,
- 0x0060,0x0060,0x0060,0x0060,0x0060,0x0060,0x003E,0x003E
-};
-
-static const signed short ycbcr16x16_420_2[8*8*6] =
-{
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-int main(int argc, char **argv)
-{
- const unsigned int video_width = 32, video_height = 32;
- const unsigned int window_width = video_width * 2, window_height = video_height * 2;
- int quit = 0;
- Display *display;
- Window root, window;
- Pixmap framebuffer;
- XEvent event;
- struct pipe_context *pipe;
- struct VL_CONTEXT *ctx;
- struct VL_SURFACE *sfc, *ref_sfc;
- struct VL_MOTION_VECTOR motion_vector =
- {
- {0, 0}, {32, 32}
- };
-
- display = XOpenDisplay(NULL);
- root = XDefaultRootWindow(display);
- window = XCreateSimpleWindow(display, root, 0, 0, window_width, window_height, 0, 0, 0);
- framebuffer = XCreatePixmap(display, root, window_width, window_height, 24);
-
- XSelectInput(display, window, ExposureMask | KeyPressMask);
- XMapWindow(display, window);
- XSync(display, 0);
-
- pipe = create_pipe_context(display);
- vlCreateContext(display, pipe, video_width, video_height, VL_FORMAT_YCBCR_420, &ctx);
- vlCreateSurface(ctx, &sfc);
- vlCreateSurface(ctx, &ref_sfc);
-
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 0, 0, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, ref_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 1, 0, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, ref_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 0, 1, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, ref_sfc);
- vlRenderIMacroBlock(VL_FRAME_PICTURE, VL_FIELD_FIRST, 1, 1, 0x3F, VL_DCT_FRAME_CODED, (short*)ycbcr16x16_420, ref_sfc);
- vlRenderPMacroBlock
- (
- VL_FRAME_PICTURE,
- VL_FIELD_FIRST,
- 0,
- 0,
- VL_FIELD_MC,
- &motion_vector,
- 0x3F,
- VL_DCT_FRAME_CODED,
- (short*)ycbcr16x16_420_2,
- ref_sfc,
- sfc
- );
- vlPutSurface(sfc, framebuffer, 0, 0, video_width, video_height, 0, 0, window_width, window_height, VL_FRAME_PICTURE);
-
- puts("Press any key to continue...");
-
- while (!quit)
- {
- XNextEvent(display, &event);
- switch (event.type)
- {
- case Expose:
- {
- XCopyArea
- (
- display,
- framebuffer,
- window,
- XDefaultGC(display, XDefaultScreen(display)),
- 0,
- 0,
- window_width,
- window_height,
- 0,
- 0
- );
- break;
- }
- case KeyPress:
- {
- quit = 1;
- break;
- }
- }
- }
-
- vlDestroySurface(sfc);
- vlDestroySurface(ref_sfc);
- vlDestroyContext(ctx);
-
- XFreePixmap(display, framebuffer);
- XDestroyWindow(display, window);
- XCloseDisplay(display);
-
- return 0;
-}
-
diff --git a/src/gallium/state_trackers/g3dvl/tests/test_surface.c b/src/gallium/state_trackers/g3dvl/tests/test_surface.c
deleted file mode 100644
index 4d1946396a..0000000000
--- a/src/gallium/state_trackers/g3dvl/tests/test_surface.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <vl_context.h>
-#include <vl_surface.h>
-#include <xsp_winsys.h>
-
-int main(int argc, char **argv)
-{
- const unsigned int video_width = 32, video_height = 32;
-
- Display *display;
- struct pipe_context *pipe;
- struct VL_CONTEXT *ctx;
- struct VL_SURFACE *sfc;
-
- display = XOpenDisplay(NULL);
- pipe = create_pipe_context(display);
-
- vlCreateContext(display, pipe, video_width, video_height, VL_FORMAT_YCBCR_420, &ctx);
- vlCreateSurface(ctx, &sfc);
- vlDestroySurface(sfc);
- vlDestroyContext(ctx);
-
- XCloseDisplay(display);
-
- return 0;
-}
-
diff --git a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c
index ea003a31d1..9f9dafc8a9 100644
--- a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c
+++ b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c
@@ -14,6 +14,8 @@
struct vlVertexShaderConsts
{
+ struct vlVertex4f dst_scale;
+ struct vlVertex4f dst_trans;
struct vlVertex4f src_scale;
struct vlVertex4f src_trans;
};
@@ -87,6 +89,9 @@ static int vlResizeFrameBuffer
0
);
+ /* Clear to black, in case video doesn't fill the entire window */
+ pipe->clear(pipe, basic_csc->framebuffer.cbufs[0], 0);
+
return 0;
}
@@ -149,6 +154,15 @@ static int vlPutPictureCSC
PIPE_BUFFER_USAGE_CPU_WRITE
);
+ vs_consts->dst_scale.x = destw / (float)basic_csc->framebuffer.cbufs[0]->width;
+ vs_consts->dst_scale.y = desth / (float)basic_csc->framebuffer.cbufs[0]->height;
+ vs_consts->dst_scale.z = 1;
+ vs_consts->dst_scale.w = 1;
+ vs_consts->dst_trans.x = destx / (float)basic_csc->framebuffer.cbufs[0]->width;
+ vs_consts->dst_trans.y = desty / (float)basic_csc->framebuffer.cbufs[0]->height;
+ vs_consts->dst_trans.z = 0;
+ vs_consts->dst_trans.w = 0;
+
vs_consts->src_scale.x = srcw / (float)surface->texture->width[0];
vs_consts->src_scale.y = srch / (float)surface->texture->height[0];
vs_consts->src_scale.z = 1;
@@ -376,10 +390,12 @@ static int vlCreateVertexShader
}
/*
- * decl c0 ; Scaling vector to scale texcoord rect to source size
- * decl c1 ; Translation vector to move texcoord rect into position
+ * decl c0 ; Scaling vector to scale vertex pos rect to destination size
+ * decl c1 ; Translation vector to move vertex pos rect into position
+ * decl c2 ; Scaling vector to scale texcoord rect to source size
+ * decl c3 ; Translation vector to move texcoord rect into position
*/
- decl = vl_decl_constants(TGSI_SEMANTIC_GENERIC, 0, 0, 1);
+ decl = vl_decl_constants(TGSI_SEMANTIC_GENERIC, 0, 0, 3);
ti += tgsi_build_full_declaration(&decl, &tokens[ti], header, max_tokens - ti);
/*
@@ -392,21 +408,19 @@ static int vlCreateVertexShader
ti += tgsi_build_full_declaration(&decl, &tokens[ti], header, max_tokens - ti);
}
- /* decl t0 */
- decl = vl_decl_temps(0, 0);
+ /* decl t0, t1 */
+ decl = vl_decl_temps(0, 1);
ti += tgsi_build_full_declaration(&decl, &tokens[ti], header, max_tokens - ti);
- /* mov o0, i0 ; Move pos in to pos out */
- inst = vl_inst2(TGSI_OPCODE_MOV, TGSI_FILE_OUTPUT, 0, TGSI_FILE_INPUT, 0);
- ti += tgsi_build_full_instruction(&inst, &tokens[ti], header, max_tokens - ti);
-
- /* mul t0, i1, c0 ; Scale unit texcoord rect to source size */
- inst = vl_inst3(TGSI_OPCODE_MUL, TGSI_FILE_TEMPORARY, 0, TGSI_FILE_INPUT, 1, TGSI_FILE_CONSTANT, 0);
- ti += tgsi_build_full_instruction(&inst, &tokens[ti], header, max_tokens - ti);
-
- /* add o1, t0, c1 ; Translate texcoord rect into position */
- inst = vl_inst3(TGSI_OPCODE_ADD, TGSI_FILE_OUTPUT, 1, TGSI_FILE_TEMPORARY, 0, TGSI_FILE_CONSTANT, 1);
- ti += tgsi_build_full_instruction(&inst, &tokens[ti], header, max_tokens - ti);
+ /*
+ * madd o0, i0, c0, c1 ; Scale and translate unit output rect to destination size and pos
+ * madd o1, i1, c2, c3 ; Scale and translate unit texcoord rect to source size and pos
+ */
+ for (i = 0; i < 2; ++i)
+ {
+ inst = vl_inst4(TGSI_OPCODE_MADD, TGSI_FILE_OUTPUT, i, TGSI_FILE_INPUT, i, TGSI_FILE_CONSTANT, i * 2, TGSI_FILE_CONSTANT, i * 2 + 1);
+ ti += tgsi_build_full_instruction(&inst, &tokens[ti], header, max_tokens - ti);
+ }
/* end */
inst = vl_end();
@@ -487,9 +501,8 @@ static int vlCreateFragmentShader
* dp4 o0.x, t0, c1 ; Multiply pixel by the color conversion matrix
* dp4 o0.y, t0, c2
* dp4 o0.z, t0, c3
- * dp4 o0.w, t0, c4 ; XXX: Don't need 4th coefficient
*/
- for (i = 0; i < 4; ++i)
+ for (i = 0; i < 3; ++i)
{
inst = vl_inst3(TGSI_OPCODE_DP4, TGSI_FILE_OUTPUT, 0, TGSI_FILE_TEMPORARY, 0, TGSI_FILE_CONSTANT, i + 1);
inst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_X << i;
@@ -519,11 +532,11 @@ static int vlCreateDataBufs
pipe = csc->pipe;
/*
- Create our vertex buffer and vertex buffer element
- VB contains 4 vertices that render a quad covering the entire window
- to display a rendered surface
- Quad is rendered as a tri strip
- */
+ * Create our vertex buffer and vertex buffer element
+ * VB contains 4 vertices that render a quad covering the entire window
+ * to display a rendered surface
+ * Quad is rendered as a tri strip
+ */
csc->vertex_bufs[0].pitch = sizeof(struct vlVertex2f);
csc->vertex_bufs[0].max_index = 3;
csc->vertex_bufs[0].buffer_offset = 0;
@@ -550,9 +563,9 @@ static int vlCreateDataBufs
csc->vertex_elems[0].src_format = PIPE_FORMAT_R32G32_FLOAT;
/*
- Create our texcoord buffer and texcoord buffer element
- Texcoord buffer contains the TCs for mapping the rendered surface to the 4 vertices
- */
+ * Create our texcoord buffer and texcoord buffer element
+ * Texcoord buffer contains the TCs for mapping the rendered surface to the 4 vertices
+ */
csc->vertex_bufs[1].pitch = sizeof(struct vlVertex2f);
csc->vertex_bufs[1].max_index = 3;
csc->vertex_bufs[1].buffer_offset = 0;
@@ -579,9 +592,9 @@ static int vlCreateDataBufs
csc->vertex_elems[1].src_format = PIPE_FORMAT_R32G32_FLOAT;
/*
- Create our vertex shader's constant buffer
- Const buffer contains scaling and translation vectors
- */
+ * Create our vertex shader's constant buffer
+ * Const buffer contains scaling and translation vectors
+ */
csc->vs_const_buf.size = sizeof(struct vlVertexShaderConsts);
csc->vs_const_buf.buffer = pipe->winsys->buffer_create
(
@@ -592,9 +605,9 @@ static int vlCreateDataBufs
);
/*
- Create our fragment shader's constant buffer
- Const buffer contains the color conversion matrix and bias vectors
- */
+ * Create our fragment shader's constant buffer
+ * Const buffer contains the color conversion matrix and bias vectors
+ */
csc->fs_const_buf.size = sizeof(struct vlFragmentShaderConsts);
csc->fs_const_buf.buffer = pipe->winsys->buffer_create
(
@@ -605,9 +618,9 @@ static int vlCreateDataBufs
);
/*
- TODO: Refactor this into a seperate function,
- allow changing the CSC matrix at runtime to switch between regular & full versions
- */
+ * TODO: Refactor this into a seperate function,
+ * allow changing the CSC matrix at runtime to switch between regular & full versions
+ */
memcpy
(
pipe->winsys->buffer_map(pipe->winsys, csc->fs_const_buf.buffer, PIPE_BUFFER_USAGE_CPU_WRITE),
diff --git a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c
index 93839e8aa9..e7a070ef4d 100644
--- a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c
+++ b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c
@@ -6,10 +6,10 @@
#include <pipe/p_winsys.h>
#include <pipe/p_screen.h>
#include <pipe/p_state.h>
-#include <pipe/p_util.h>
#include <pipe/p_inlines.h>
#include <tgsi/tgsi_parse.h>
#include <tgsi/tgsi_build.h>
+#include <util/u_math.h>
#include "vl_render.h"
#include "vl_shader_build.h"
#include "vl_surface.h"
@@ -108,17 +108,7 @@ static inline int vlGrabFieldCodedBlock(short *src, short *dst, unsigned int dst
{
unsigned int y;
- for (y = 0; y < VL_BLOCK_HEIGHT / 2; ++y)
- memcpy
- (
- dst + y * dst_pitch * 2,
- src + y * VL_BLOCK_WIDTH,
- VL_BLOCK_WIDTH * 2
- );
-
- dst += VL_BLOCK_HEIGHT * dst_pitch;
-
- for (; y < VL_BLOCK_HEIGHT; ++y)
+ for (y = 0; y < VL_BLOCK_HEIGHT; ++y)
memcpy
(
dst + y * dst_pitch * 2,
@@ -586,11 +576,25 @@ static int vlFlush
unsigned int num_macroblocks[vlNumMacroBlockExTypes] = {0};
unsigned int offset[vlNumMacroBlockExTypes];
unsigned int vb_start = 0;
+ unsigned int mbw;
+ unsigned int mbh;
+ unsigned int num_mb_per_frame;
unsigned int i;
assert(render);
mc = (struct vlR16SnormBufferedMC*)render;
+
+ if (!mc->buffered_surface)
+ return 0;
+
+ mbw = align(mc->picture_width, VL_MACROBLOCK_WIDTH) / VL_MACROBLOCK_WIDTH;
+ mbh = align(mc->picture_height, VL_MACROBLOCK_HEIGHT) / VL_MACROBLOCK_HEIGHT;
+ num_mb_per_frame = mbw * mbh;
+
+ if (mc->num_macroblocks < num_mb_per_frame)
+ return 0;
+
pipe = mc->pipe;
for (i = 0; i < mc->num_macroblocks; ++i)
@@ -736,8 +740,12 @@ static int vlFlush
vb_start += num_macroblocks[vlMacroBlockExTypeBiPredictedField] * 24;
}
+ pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, &mc->buffered_surface->render_fence);
+
for (i = 0; i < 3; ++i)
mc->zero_block[i].x = -1.0f;
+
+ mc->buffered_surface = NULL;
mc->num_macroblocks = 0;
mc->cur_buf++;
@@ -760,12 +768,7 @@ static int vlRenderMacroBlocksMpeg2R16SnormBuffered
if (mc->buffered_surface)
{
- if
- (
- mc->buffered_surface != surface /*||
- mc->past_surface != batch->past_surface ||
- mc->future_surface != batch->future_surface*/
- )
+ if (mc->buffered_surface != surface)
{
vlFlush(&mc->base);
mc->buffered_surface = surface;
@@ -981,7 +984,7 @@ static int vlCreateFragmentShaderIMB
*/
for (i = 0; i < 3; ++i)
{
- decl = vl_decl_interpolated_input(TGSI_SEMANTIC_GENERIC, 1, i, i, TGSI_INTERPOLATE_LINEAR);
+ decl = vl_decl_interpolated_input(TGSI_SEMANTIC_GENERIC, i + 1, i, i, TGSI_INTERPOLATE_LINEAR);
ti += tgsi_build_full_declaration(&decl, &tokens[ti], header, max_tokens - ti);
}
@@ -1027,7 +1030,6 @@ static int vlCreateFragmentShaderIMB
inst.FullSrcRegisters[0].SrcRegister.SwizzleZ = TGSI_SWIZZLE_X;
inst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_X << i;
ti += tgsi_build_full_instruction(&inst, &tokens[ti], header, max_tokens - ti);
-
}
/* mul o0, t0, c0 ; Rescale texel to correct range */
@@ -1179,7 +1181,7 @@ static int vlCreateVertexShaderFieldPMB
ti += tgsi_build_full_declaration(&decl, &tokens[ti], header, max_tokens - ti);
}
- /* decl c0 ; Texcoord denorm coefficients */
+ /* decl c0 ; Render target dimensions */
decl = vl_decl_constants(TGSI_SEMANTIC_GENERIC, 0, 0, 0);
ti += tgsi_build_full_declaration(&decl, &tokens[ti], header, max_tokens - ti);
@@ -1194,7 +1196,7 @@ static int vlCreateVertexShaderFieldPMB
*/
for (i = 0; i < 7; i++)
{
- decl = vl_decl_output((i == 0 || i == 6) ? TGSI_SEMANTIC_POSITION : TGSI_SEMANTIC_GENERIC, i, i, i);
+ decl = vl_decl_output(i == 0 ? TGSI_SEMANTIC_POSITION : TGSI_SEMANTIC_GENERIC, i, i, i);
ti += tgsi_build_full_declaration(&decl, &tokens[ti], header, max_tokens - ti);
}
@@ -1323,7 +1325,6 @@ static int vlCreateFragmentShaderFramePMB
inst.FullSrcRegisters[0].SrcRegister.SwizzleZ = TGSI_SWIZZLE_X;
inst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_X << i;
ti += tgsi_build_full_instruction(&inst, &tokens[ti], header, max_tokens - ti);
-
}
/* mul t0, t0, c0 ; Rescale texel to correct range */
@@ -1442,7 +1443,6 @@ static int vlCreateFragmentShaderFieldPMB
inst.FullSrcRegisters[0].SrcRegister.SwizzleZ = TGSI_SWIZZLE_X;
inst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_X << i;
ti += tgsi_build_full_instruction(&inst, &tokens[ti], header, max_tokens - ti);
-
}
/* mul t0, t0, c0 ; Rescale texel to correct range */
@@ -1661,8 +1661,8 @@ static int vlCreateVertexShaderFieldBMB
ti += tgsi_build_full_declaration(&decl, &tokens[ti], header, max_tokens - ti);
}
- /* decl c0 ; Denorm coefficients */
- decl = vl_decl_constants(TGSI_SEMANTIC_GENERIC, 0, 0, 6);
+ /* decl c0 ; Render target dimensions */
+ decl = vl_decl_constants(TGSI_SEMANTIC_GENERIC, 0, 0, 0);
ti += tgsi_build_full_declaration(&decl, &tokens[ti], header, max_tokens - ti);
/*
@@ -1678,7 +1678,7 @@ static int vlCreateVertexShaderFieldBMB
*/
for (i = 0; i < 9; i++)
{
- decl = vl_decl_output((i == 0 || i == 8) ? TGSI_SEMANTIC_POSITION : TGSI_SEMANTIC_GENERIC, i, i, i);
+ decl = vl_decl_output(i == 0 ? TGSI_SEMANTIC_POSITION : TGSI_SEMANTIC_GENERIC, i, i, i);
ti += tgsi_build_full_declaration(&decl, &tokens[ti], header, max_tokens - ti);
}
@@ -1818,7 +1818,6 @@ static int vlCreateFragmentShaderFrameBMB
inst.FullSrcRegisters[0].SrcRegister.SwizzleZ = TGSI_SWIZZLE_X;
inst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_X << i;
ti += tgsi_build_full_instruction(&inst, &tokens[ti], header, max_tokens - ti);
-
}
/* mul t0, t0, c0 ; Rescale texel to correct range */
@@ -1955,7 +1954,6 @@ static int vlCreateFragmentShaderFieldBMB
inst.FullSrcRegisters[0].SrcRegister.SwizzleZ = TGSI_SWIZZLE_X;
inst.FullDstRegisters[0].DstRegister.WriteMask = TGSI_WRITEMASK_X << i;
ti += tgsi_build_full_instruction(&inst, &tokens[ti], header, max_tokens - ti);
-
}
/* mul t0, t0, c0 ; Rescale texel to correct range */
diff --git a/src/gallium/state_trackers/g3dvl/vl_surface.c b/src/gallium/state_trackers/g3dvl/vl_surface.c
index 687fd1ec29..076bd40d41 100644
--- a/src/gallium/state_trackers/g3dvl/vl_surface.c
+++ b/src/gallium/state_trackers/g3dvl/vl_surface.c
@@ -77,6 +77,7 @@ int vlRenderMacroBlocksMpeg2
{
assert(batch);
assert(surface);
+ assert(surface->context);
surface->context->render->vlBegin(surface->context->render);
@@ -104,6 +105,8 @@ int vlPutPicture
int desty,
int destw,
int desth,
+ int drawable_w,
+ int drawable_h,
enum vlPictureType picture_type
)
{
@@ -118,7 +121,7 @@ int vlPutPicture
csc = surface->context->csc;
pipe = surface->context->pipe;
- csc->vlResizeFrameBuffer(csc, destw, desth);
+ csc->vlResizeFrameBuffer(csc, drawable_w, drawable_h);
csc->vlBegin(csc);
@@ -139,9 +142,10 @@ int vlPutPicture
csc->vlEnd(csc);
- pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
+ pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, &surface->disp_fence);
+
bind_pipe_drawable(pipe, drawable);
- /* TODO: Need to take destx, desty into consideration */
+
pipe->winsys->flush_frontbuffer
(
pipe->winsys,
@@ -152,6 +156,60 @@ int vlPutPicture
return 0;
}
+int vlSurfaceGetStatus
+(
+ struct vlSurface *surface,
+ enum vlResourceStatus *status
+)
+{
+ assert(surface);
+ assert(surface->context);
+ assert(status);
+
+ if (surface->render_fence && !surface->context->pipe->winsys->fence_signalled(surface->context->pipe->winsys, surface->render_fence, 0))
+ {
+ *status = vlResourceStatusRendering;
+ return 0;
+ }
+
+ if (surface->disp_fence && !surface->context->pipe->winsys->fence_signalled(surface->context->pipe->winsys, surface->disp_fence, 0))
+ {
+ *status = vlResourceStatusDisplaying;
+ return 0;
+ }
+
+ *status = vlResourceStatusFree;
+
+ return 0;
+}
+
+int vlSurfaceFlush
+(
+ struct vlSurface *surface
+)
+{
+ assert(surface);
+ assert(surface->context);
+
+ surface->context->render->vlFlush(surface->context->render);
+
+ return 0;
+}
+
+int vlSurfaceSync
+(
+ struct vlSurface *surface
+)
+{
+ assert(surface);
+ assert(surface->context);
+ assert(surface->render_fence);
+
+ surface->context->pipe->winsys->fence_finish(surface->context->pipe->winsys, surface->render_fence, 0);
+
+ return 0;
+}
+
struct vlScreen* vlSurfaceGetScreen
(
struct vlSurface *surface
diff --git a/src/gallium/state_trackers/g3dvl/vl_surface.h b/src/gallium/state_trackers/g3dvl/vl_surface.h
index b975e131fa..133e1515ef 100644
--- a/src/gallium/state_trackers/g3dvl/vl_surface.h
+++ b/src/gallium/state_trackers/g3dvl/vl_surface.h
@@ -8,12 +8,14 @@ struct pipe_texture;
struct vlSurface
{
- struct vlScreen *screen;
- struct vlContext *context;
- unsigned int width;
- unsigned int height;
- enum vlFormat format;
- struct pipe_texture *texture;
+ struct vlScreen *screen;
+ struct vlContext *context;
+ unsigned int width;
+ unsigned int height;
+ enum vlFormat format;
+ struct pipe_texture *texture;
+ struct pipe_fence_handle *render_fence;
+ struct pipe_fence_handle *disp_fence;
};
#endif
@@ -49,9 +51,27 @@ int vlPutPicture
int desty,
int destw,
int desth,
+ int drawable_w,
+ int drawable_h,
enum vlPictureType picture_type
);
+int vlSurfaceGetStatus
+(
+ struct vlSurface *surface,
+ enum vlResourceStatus *status
+);
+
+int vlSurfaceFlush
+(
+ struct vlSurface *surface
+);
+
+int vlSurfaceSync
+(
+ struct vlSurface *surface
+);
+
struct vlScreen* vlSurfaceGetScreen
(
struct vlSurface *surface
diff --git a/src/gallium/state_trackers/g3dvl/vl_types.h b/src/gallium/state_trackers/g3dvl/vl_types.h
index b432bfde93..274e1f7437 100644
--- a/src/gallium/state_trackers/g3dvl/vl_types.h
+++ b/src/gallium/state_trackers/g3dvl/vl_types.h
@@ -13,6 +13,13 @@ struct vlScreen;
struct vlContext;
struct vlSurface;
+enum vlResourceStatus
+{
+ vlResourceStatusFree,
+ vlResourceStatusRendering,
+ vlResourceStatusDisplaying
+};
+
enum vlProfile
{
vlProfileMpeg2Simple,