Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-intel-common-vaapi: Commit

hardware/intel/common/vaapi


Commit MetaInfo

Revision329975c63123610fc750241654a3bd18add75beb (tree)
Time2019-02-13 09:15:14
AuthorHaihao Xiang <haihao.xiang@inte...>
CommiterXiang, Haihao

Log Message

Return false instead of assertion failure

If so, the upper-layer application or library may handle the error.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>

Change Summary

Incremental Difference

--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -123,7 +123,9 @@ intel_driver_init(VADriverContextP ctx)
123123 intel->locked = 0;
124124 pthread_mutex_init(&intel->ctxmutex, NULL);
125125
126- intel_memman_init(intel);
126+ if (!intel_memman_init(intel))
127+ return false;
128+
127129 intel->device_id = drm_intel_bufmgr_gem_get_devid(intel->bufmgr);
128130 intel->device_info = i965_get_device_info(intel->device_id);
129131
--- a/src/intel_memman.c
+++ b/src/intel_memman.c
@@ -35,7 +35,10 @@ Bool
3535 intel_memman_init(struct intel_driver_data *intel)
3636 {
3737 intel->bufmgr = intel_bufmgr_gem_init(intel->fd, BATCH_SIZE);
38- assert(intel->bufmgr);
38+
39+ if (!intel->bufmgr)
40+ return False;
41+
3942 intel_bufmgr_gem_enable_reuse(intel->bufmgr);
4043
4144 if (g_intel_debug_option_flags & VA_INTEL_DEBUG_OPTION_DUMP_AUB) {
@@ -50,6 +53,7 @@ intel_memman_init(struct intel_driver_data *intel)
5053 Bool
5154 intel_memman_terminate(struct intel_driver_data *intel)
5255 {
53- drm_intel_bufmgr_destroy(intel->bufmgr);
56+ if (intel->bufmgr)
57+ drm_intel_bufmgr_destroy(intel->bufmgr);
5458 return True;
5559 }
Show on old repository browser