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:
parent
c8dd06612a
commit
3b24cd911e
1 changed files with 6 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue