hardware/intel/libva
Revisión | 5d4faa102b49ef6dbf8a1fcd04a82a8c04030e6a (tree) |
---|---|
Tiempo | 2014-09-09 02:16:43 |
Autor | Austin Yuan <shengquan.yuan@inte...> |
Commiter | Xiang, Haihao |
vafool: fix the vaMapBuffer for the buffer from vaDeriveImage
It is not desired to run into FOOL path for the vaMapBuffer
from vaDeriveImage
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
(cherry picked from commit 2896166fefa36772ea6946ebc5df85024928dd6c)
@@ -252,8 +252,14 @@ VAStatus va_FoolBufferInfo( | ||
252 | 252 | unsigned int *num_elements /* out */ |
253 | 253 | ) |
254 | 254 | { |
255 | + unsigned int magic; | |
256 | + | |
255 | 257 | DPY2FOOLCTX_CHK(dpy); |
256 | 258 | |
259 | + magic = buf_id & FOOL_BUFID_MASK; | |
260 | + if (magic != FOOL_BUFID_MAGIC) | |
261 | + return 0; /* could be VAImageBufferType from vaDeriveImage */ | |
262 | + | |
257 | 263 | *type = buf_id & 0xff; |
258 | 264 | *size = fool_ctx->fool_buf_size[*type]; |
259 | 265 | *num_elements = fool_ctx->fool_buf_element[*type];; |
@@ -342,9 +348,13 @@ VAStatus va_FoolMapBuffer( | ||
342 | 348 | void **pbuf /* out */ |
343 | 349 | ) |
344 | 350 | { |
345 | - unsigned int buftype; | |
351 | + unsigned int magic, buftype; | |
346 | 352 | DPY2FOOLCTX_CHK(dpy); |
347 | 353 | |
354 | + magic = buf_id & FOOL_BUFID_MASK; | |
355 | + if (magic != FOOL_BUFID_MAGIC) | |
356 | + return 0; /* could be VAImageBufferType from vaDeriveImage */ | |
357 | + | |
348 | 358 | buftype = buf_id & 0xff; |
349 | 359 | *pbuf = fool_ctx->fool_buf[buftype]; |
350 | 360 |
@@ -2938,7 +2938,7 @@ void va_TraceRenderPicture( | ||
2938 | 2938 | |
2939 | 2939 | case VAProfileNone: |
2940 | 2940 | for (j=0; j<num_elements; j++) { |
2941 | - va_TraceMsg(trace_ctx, "\telement[%d] = ", j); | |
2941 | + va_TraceMsg(trace_ctx, "\telement[%d] =\n", j); | |
2942 | 2942 | |
2943 | 2943 | va_TraceNoneBuf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j); |
2944 | 2944 | } |
@@ -2946,7 +2946,7 @@ void va_TraceRenderPicture( | ||
2946 | 2946 | |
2947 | 2947 | case VAProfileVP8Version0_3: |
2948 | 2948 | for (j=0; j<num_elements; j++) { |
2949 | - va_TraceMsg(trace_ctx, "\telement[%d] = ", j); | |
2949 | + va_TraceMsg(trace_ctx, "\telement[%d] =\n", j); | |
2950 | 2950 | |
2951 | 2951 | va_TraceVP8Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j); |
2952 | 2952 | } |