OSDN Git Service

Don't show an error on hybrid driver failure
[android-x86/hardware-intel-common-vaapi.git] / src / i965_drv_video.c
index d87cdc1..911c34d 100644 (file)
@@ -1279,13 +1279,16 @@ i965_GetConfigAttributes(VADriverContextP ctx,
             break;
 
         case VAConfigAttribFEIFunctionType:
-            /* Supporing all possible modes of FEI */
-            attrib_list[i].value = VA_FEI_FUNCTION_ENC |
-                                   VA_FEI_FUNCTION_PAK | VA_FEI_FUNCTION_ENC_PAK;
+            if (entrypoint == VAEntrypointFEI) {
+                /* Supporting all possible modes of FEI */
+                attrib_list[i].value = VA_FEI_FUNCTION_ENC |
+                                       VA_FEI_FUNCTION_PAK | VA_FEI_FUNCTION_ENC_PAK;
+            }
             break;
 
         case VAConfigAttribFEIMVPredictors:
-            attrib_list[i].value = 4;
+            if (entrypoint == VAEntrypointFEI)
+                attrib_list[i].value = 4;
             break;
 
         case VAConfigAttribStats:
@@ -1432,8 +1435,21 @@ i965_CreateConfig(VADriverContextP ctx,
         if (attrib_found) {
             uint32_t enc_packed_attribs = i965_get_enc_packed_attributes(ctx, profile, entrypoint);
 
-            if (!(attrib_found->value & enc_packed_attribs))
+            if (enc_packed_attribs == VA_ATTRIB_NOT_SUPPORTED) {
+                i965_log_info(ctx, "vaCreateConfig: invalid EncPackedHeaders attribute %#x: "
+                              "packed headers are not supported.\n", attrib_found->value);
                 vaStatus = VA_STATUS_ERROR_INVALID_VALUE;
+            } else if (attrib_found->value == 0) {
+                i965_log_info(ctx, "vaCreateConfig: setting the EncPackedHeaders attribute to zero to "
+                              "indicate that no packed headers will be used is deprecated.\n");
+            } else {
+                if (attrib_found->value & ~enc_packed_attribs) {
+                    i965_log_info(ctx, "vaCreateConfig: invalid EncPackedHeaders attribute %#x: "
+                                  "some packed headers are not supported (supported set %#x).\n",
+                                  attrib_found->value, enc_packed_attribs);
+                    vaStatus = VA_STATUS_ERROR_INVALID_VALUE;
+                }
+            }
         }
     }
 
@@ -7479,7 +7495,7 @@ i965_initialize_wrapper(VADriverContextP ctx, const char *driver_name)
         i965->wrapper_pdrvctx = wrapper_pdrvctx;
         return VA_STATUS_SUCCESS;
     } else {
-        fprintf(stderr, "Failed to wrapper %s%s\n", driver_name, DRIVER_EXTENSION);
+        fprintf(stdout, "Not using %s%s\n", driver_name, DRIVER_EXTENSION);
         free(vtable);
         free(wrapper_pdrvctx);
         return VA_STATUS_ERROR_OPERATION_FAILED;