Return supported external memory types in vaQuerySurfaceAttributes()
authorXiang, Haihao <haihao.xiang@intel.com>
Fri, 7 Jun 2013 01:47:22 +0000 (09:47 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 21 Jun 2013 04:17:06 +0000 (12:17 +0800)
Return the number of elements actually filled in output as well.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
src/i965_drv_video.c

index c7558bc..fdc0e7a 100755 (executable)
@@ -4441,6 +4441,14 @@ i965_QuerySurfaceAttributes(VADriverContextP ctx,
         }
     }
 
+    attribs[i].type = VASurfaceAttribMemoryType;
+    attribs[i].value.type = VAGenericValueTypeInteger;
+    attribs[i].flags = VA_SURFACE_ATTRIB_GETTABLE | VA_SURFACE_ATTRIB_SETTABLE;
+    attribs[i].value.value.i = VA_SURFACE_ATTRIB_MEM_TYPE_VA |
+        VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM |
+        VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME;
+    i++;
+
     attribs[i].type = VASurfaceAttribExternalBufferDescriptor;
     attribs[i].value.type = VAGenericValueTypePointer;
     attribs[i].flags = VA_SURFACE_ATTRIB_SETTABLE;
@@ -4453,6 +4461,7 @@ i965_QuerySurfaceAttributes(VADriverContextP ctx,
         return VA_STATUS_ERROR_MAX_NUM_EXCEEDED;
     }
 
+    *num_attribs = i;
     memcpy(attrib_list, attribs, i * sizeof(*attribs));
     free(attribs);