g3dvl: Ignore client flush requests unless entire frame is buffered.
authorYounes Manton <younes.m@gmail.com>
Mon, 22 Sep 2008 16:26:13 +0000 (12:26 -0400)
committerYounes Manton <younes.m@gmail.com>
Sat, 4 Oct 2008 17:12:09 +0000 (13:12 -0400)
src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c
src/gallium/state_trackers/g3dvl/vl_surface.c

index 62107803ac06c8ac799fae2dc0b42f84b8501646..e7a070ef4df28a1c4f395cc6c097360ac0b5e3ce 100644 (file)
@@ -576,6 +576,9 @@ 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);
@@ -585,6 +588,13 @@ static int vlFlush
        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)
index 6648133ef830d8edf8f0884a73bc588841254d32..076bd40d4140b6b1f8263fe0abf186e74218644e 100644 (file)
@@ -179,6 +179,7 @@ int vlSurfaceGetStatus
        }
 
        *status = vlResourceStatusFree;
+
        return 0;
 }