st/omx/enc: use PIPE_USAGE_STAGING for output buffer
authorLeo Liu <leo.liu@amd.com>
Thu, 23 Mar 2017 14:29:47 +0000 (10:29 -0400)
committerLeo Liu <leo.liu@amd.com>
Thu, 23 Mar 2017 18:43:42 +0000 (14:43 -0400)
Workaround an unknown bug with inside the transfer_map for certain
ASIC, also tested with un-affected ASICs, the performance actually
improved slightly.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/state_trackers/omx/vid_enc.c

index b58063e6e6591aea0fe3951b16f2ed82eead75c4..5274f6403bd00f150fdf28dbe02000f0920b28b5 100644 (file)
@@ -1092,8 +1092,10 @@ static void enc_HandleTask(omx_base_PortType *port, struct encode_task *task,
    priv->s_pipe->flush(priv->s_pipe, NULL, 0);
 
    /* -------------- allocate output buffer --------- */
-   task->bitstream = pipe_buffer_create(priv->s_pipe->screen, PIPE_BIND_VERTEX_BUFFER,
-                                        PIPE_USAGE_STREAM, size);
+   task->bitstream = pipe_buffer_create(priv->s_pipe->screen,
+                                        PIPE_BIND_VERTEX_BUFFER,
+                                        PIPE_USAGE_STAGING, /* map for read */
+                                        size);
 
    picture.picture_type = picture_type;
    picture.pic_order_cnt = task->pic_order_cnt;