Mesa (pipe-video): [g3dvl] autoconfigure nr of idct render targets

Christian König deathsimple at kemper.freedesktop.org
Tue Apr 12 10:43:20 PDT 2011


Module: Mesa
Branch: pipe-video
Commit: 871d6d49c931739d94e646f2b0c3eb5db8a03d69
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=871d6d49c931739d94e646f2b0c3eb5db8a03d69

Author: Christian König <deathsimple at vodafone.de>
Date:   Sun Apr 10 20:49:18 2011 +0200

[g3dvl] autoconfigure nr of idct render targets

---

 src/gallium/auxiliary/vl/vl_mpeg12_decoder.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index ce5d509..b905f49 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -536,7 +536,10 @@ init_idct(struct vl_mpeg12_decoder *dec, unsigned buffer_width, unsigned buffer_
    unsigned chroma_width, chroma_height, chroma_blocks_x, chroma_blocks_y;
    struct pipe_sampler_view *idct_matrix;
 
-   dec->nr_of_idct_render_targets = 4;
+   dec->nr_of_idct_render_targets = dec->pipe->screen->get_param(dec->pipe->screen, PIPE_CAP_MAX_RENDER_TARGETS);
+
+   // more than 4 render targets usually doesn't makes any seens
+   dec->nr_of_idct_render_targets = MIN2(dec->nr_of_idct_render_targets, 4);
 
    if (!(idct_matrix = vl_idct_upload_matrix(dec->pipe, sqrt(SCALE_FACTOR_16_TO_9))))
       goto error_idct_matrix;



More information about the mesa-commit mailing list