[g3dvl] don't upload all quant buffer layers at once
There seems to be a bug in r600g when uploading more than one layer of a 3D resource at once with a hardware blit. So just do them one at a time to workaround this.
This commit is contained in:
@@ -330,8 +330,10 @@ vl_mpeg12_buffer_set_quant_matrix(struct pipe_video_decode_buffer *buffer,
|
|||||||
struct vl_mpeg12_buffer *buf = (struct vl_mpeg12_buffer*)buffer;
|
struct vl_mpeg12_buffer *buf = (struct vl_mpeg12_buffer*)buffer;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
for (i = 0; i < VL_MAX_PLANES; ++i)
|
for (i = 0; i < VL_MAX_PLANES; ++i) {
|
||||||
vl_zscan_upload_quant(&buf->zscan[i], intra_matrix, non_intra_matrix);
|
vl_zscan_upload_quant(&buf->zscan[i], intra_matrix, true);
|
||||||
|
vl_zscan_upload_quant(&buf->zscan[i], non_intra_matrix, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct pipe_ycbcr_block *
|
static struct pipe_ycbcr_block *
|
||||||
|
@@ -525,26 +525,23 @@ vl_zscan_set_layout(struct vl_zscan_buffer *buffer, struct pipe_sampler_view *la
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vl_zscan_upload_quant(struct vl_zscan_buffer *buffer,
|
vl_zscan_upload_quant(struct vl_zscan_buffer *buffer, const uint8_t matrix[64], bool intra)
|
||||||
const uint8_t intra_matrix[64],
|
|
||||||
const uint8_t non_intra_matrix[64])
|
|
||||||
{
|
{
|
||||||
struct pipe_context *pipe;
|
struct pipe_context *pipe;
|
||||||
struct pipe_transfer *buf_transfer;
|
struct pipe_transfer *buf_transfer;
|
||||||
unsigned x, y, i, pitch;
|
unsigned x, y, i, pitch;
|
||||||
uint8_t *intra, *non_intra;
|
uint8_t *data;
|
||||||
|
|
||||||
struct pipe_box rect =
|
struct pipe_box rect =
|
||||||
{
|
{
|
||||||
0, 0, 0,
|
0, 0, intra ? 1 : 0,
|
||||||
BLOCK_WIDTH,
|
BLOCK_WIDTH,
|
||||||
BLOCK_HEIGHT,
|
BLOCK_HEIGHT,
|
||||||
2
|
1
|
||||||
};
|
};
|
||||||
|
|
||||||
assert(buffer);
|
assert(buffer);
|
||||||
assert(intra_matrix);
|
assert(matrix);
|
||||||
assert(non_intra_matrix);
|
|
||||||
|
|
||||||
pipe = buffer->zscan->pipe;
|
pipe = buffer->zscan->pipe;
|
||||||
|
|
||||||
@@ -561,18 +558,14 @@ vl_zscan_upload_quant(struct vl_zscan_buffer *buffer,
|
|||||||
|
|
||||||
pitch = buf_transfer->stride;
|
pitch = buf_transfer->stride;
|
||||||
|
|
||||||
non_intra = pipe->transfer_map(pipe, buf_transfer);
|
data = pipe->transfer_map(pipe, buf_transfer);
|
||||||
if (!non_intra)
|
if (!data)
|
||||||
goto error_map;
|
goto error_map;
|
||||||
|
|
||||||
intra = non_intra + BLOCK_HEIGHT * pitch;
|
|
||||||
|
|
||||||
for (i = 0; i < buffer->zscan->blocks_per_line; ++i)
|
for (i = 0; i < buffer->zscan->blocks_per_line; ++i)
|
||||||
for (y = 0; y < BLOCK_HEIGHT; ++y)
|
for (y = 0; y < BLOCK_HEIGHT; ++y)
|
||||||
for (x = 0; x < BLOCK_WIDTH; ++x) {
|
for (x = 0; x < BLOCK_WIDTH; ++x)
|
||||||
intra[i * BLOCK_WIDTH + y * pitch + x] = intra_matrix[x + y * BLOCK_WIDTH];
|
data[i * BLOCK_WIDTH + y * pitch + x] = matrix[x + y * BLOCK_WIDTH];
|
||||||
non_intra[i * BLOCK_WIDTH + y * pitch + x] = non_intra_matrix[x + y * BLOCK_WIDTH];
|
|
||||||
}
|
|
||||||
|
|
||||||
pipe->transfer_unmap(pipe, buf_transfer);
|
pipe->transfer_unmap(pipe, buf_transfer);
|
||||||
|
|
||||||
|
@@ -93,9 +93,7 @@ void
|
|||||||
vl_zscan_set_layout(struct vl_zscan_buffer *buffer, struct pipe_sampler_view *layout);
|
vl_zscan_set_layout(struct vl_zscan_buffer *buffer, struct pipe_sampler_view *layout);
|
||||||
|
|
||||||
void
|
void
|
||||||
vl_zscan_upload_quant(struct vl_zscan_buffer *buffer,
|
vl_zscan_upload_quant(struct vl_zscan_buffer *buffer, const uint8_t matrix[64], bool intra);
|
||||||
const uint8_t intra_matrix[64],
|
|
||||||
const uint8_t non_intra_matrix[64]);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
vl_zscan_render(struct vl_zscan_buffer *buffer, unsigned num_instances);
|
vl_zscan_render(struct vl_zscan_buffer *buffer, unsigned num_instances);
|
||||||
|
Reference in New Issue
Block a user