1
0
Fork 0

drm_hwcomposer: Ensure composer has master access to DRM/KMS

Allocator service is always loaded before Composer service.
Kernel will assign master access to the first client that
opened /dev/dri/cardX node.

Allocator should immediately execute drmDropMaster() to
allow Composer service to acquire master privileges.

If this does not happen, the composer should gracefully exit,
otherwise a lot of DRM ioctls will fail without displaying anything
on the UI.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
This commit is contained in:
Roman Stratiienko 2021-01-13 10:32:04 +02:00
parent c8dd06612a
commit 3b24cd911e

View file

@ -145,6 +145,12 @@ std::tuple<int, int> DrmDevice::Init(const char *path, int num_displays) {
}
#endif
ret = drmSetMaster(fd());
if (ret) {
ALOGE("drmSetMaster() failed with errno: %d", errno);
return std::make_tuple(ret, 0);
}
drmModeResPtr res = drmModeGetResources(fd());
if (!res) {
ALOGE("Failed to get DrmDevice resources");