diff --git a/media_driver/linux/common/ddi/media_libva.cpp b/media_driver/linux/common/ddi/media_libva.cpp index 9ff22bc2f..0f758f0a9 100755 --- a/media_driver/linux/common/ddi/media_libva.cpp +++ b/media_driver/linux/common/ddi/media_libva.cpp @@ -1622,7 +1622,7 @@ static int DdiMedia_SelectIntelDevice() #if defined(ANDROID) char value[PROPERTY_VALUE_MAX] = {}; - property_get("video.hw.dgpu", value, "1"); + property_get("video.hw.dgpu", value, "0"); use_dgpu = atoi(value); #endif @@ -1642,6 +1642,7 @@ static int DdiMedia_SelectIntelDevice() if (strncmp(version->name, "i915", strlen("i915")) == 0) { intel_gpu_index = i; // If specify to use dgpu and found dgpu, return the first found dgpu, + // else if specify to use igpu and found igpu, return the first found igpu, // otherwise use the last available intel node for codec if (use_dgpu && DdiMedia_IsIntelDgpu(temp)) { DDI_NORMALMESSAGE("%s:%d find dgpu", __FUNCTION__, __LINE__); @@ -1649,6 +1650,12 @@ static int DdiMedia_SelectIntelDevice() close(temp); break; } + if (!use_dgpu && !DdiMedia_IsIntelDgpu(temp)) { + DDI_NORMALMESSAGE("%s:%d find igpu", __FUNCTION__, __LINE__); + drmFreeVersion(version); + close(temp); + break; + } } drmFreeVersion(version); close(temp);