Skip to content

Commit 22f3a47

Browse files
author
ZhuChenyanX
committed
Add igpu node selection
Tracked-On: OAM-132135 Signed-off-by: ZhuChenyanX <zhucx@intel.com>
1 parent d090464 commit 22f3a47

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

_studio/mfx_lib/shared/src/libmfxsw.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,21 @@ static bool QueryImplCaps(std::function < bool (VideoCORE&, mfxU32, mfxU32 , mfx
684684
{
685685
int use_dgpu = 1;
686686
#if defined(ANDROID)
687-
char value[PROPERTY_VALUE_MAX] = {};
688-
689-
property_get("video.hw.dgpu", value, "1");
690-
use_dgpu = atoi(value);
687+
FILE *file;
688+
int value;
689+
char prop[PROPERTY_VALUE_MAX] = {};
690+
file = fopen("/vendor/etc/dgpu-codec.cfg", "r");
691+
if (file) {
692+
while (fscanf(file, "%49s %d", prop, &value) == 2) {
693+
if (!strcmp(prop, "vendor.video.hw.dgpu")) {
694+
use_dgpu = value;
695+
}
696+
}
697+
fclose(file);
698+
} else {
699+
property_get("vendor.video.hw.dgpu", prop, "1");
700+
use_dgpu = atoi(prop);
701+
}
691702
#endif
692703

693704
for (int i = 0; i < 64; ++i)
@@ -768,6 +779,8 @@ static bool QueryImplCaps(std::function < bool (VideoCORE&, mfxU32, mfxU32 , mfx
768779
// otherwise use the last available intel node for codec
769780
if (use_dgpu && IsIntelDgpu(fd))
770781
return true;
782+
if (!use_dgpu && !IsIntelDgpu(fd))
783+
return true;
771784
}
772785
}
773786
}

0 commit comments

Comments
 (0)