Skip to content

Commit d62b72e

Browse files
ZhuChenyanXchenyanxzhu
authored andcommitted
Switch codec device by property
Tracked-On: OAM-132134 Signed-off-by: ZhuChenyanX <zhucx@intel.com>
1 parent 5bc6695 commit d62b72e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

va/android/va_android.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ static int va_IsIntelDgpu(int fd)
114114
}
115115
static int va_SelectIntelDevice()
116116
{
117-
int use_dgpu = 1;
117+
int use_dgpu;
118118
#if defined(ANDROID)
119119
char value[PROPERTY_VALUE_MAX] = {};
120120

121-
property_get("video.hw.dgpu", value, "1");
121+
property_get("vendor.video.hw.dgpu", value, "1");
122122
use_dgpu = atoi(value);
123123
#endif
124124

@@ -138,11 +138,18 @@ static int va_SelectIntelDevice()
138138
if (strncmp(version->name, "i915", strlen("i915")) == 0) {
139139
intel_gpu_index = i;
140140
// If specify to use dgpu and found dgpu, return the first found dgpu,
141+
// else if specify to use igpu and found igpu, return the first found igpu,
141142
// otherwise use the last available intel node for codec
142143
if (use_dgpu && va_IsIntelDgpu(temp)) {
143144
drmFreeVersion(version);
144145
close(temp);
145-
va_logd("%s:%d find dgpu", __FUNCTION__, __LINE__);
146+
va_logd("find dgpu");
147+
break;
148+
}
149+
if (!use_dgpu && !va_IsIntelDgpu(temp)) {
150+
va_logd("find igpu");
151+
drmFreeVersion(version);
152+
close(temp);
146153
break;
147154
}
148155
}

0 commit comments

Comments
 (0)