tbm_module: Do not initialize auth server if module has no master drm_fd 19/308419/3
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 25 Mar 2024 07:11:13 +0000 (16:11 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 25 Mar 2024 07:58:32 +0000 (16:58 +0900)
the display server has no master drm_fd when it is launched in container
environment and it connect with host display server.

Change-Id: I14942c7e9a63f1b3472bdb961b08bf7fa198e40b

src/tbm_module.c

index fe7e5a1..729daa3 100644 (file)
@@ -31,6 +31,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "config.h"
 
+#include <xf86drm.h>
+
 #include "tbm_bufmgr_int.h"
 #include "tbm_bufmgr_backend.h"
 #include "tbm_drm_helper.h"
@@ -520,6 +522,10 @@ tbm_module_bind_native_display(tbm_module *module, void *native_display)
                                TBM_INFO("tbm_module has render node.");
                                close(fd);
                                error = TBM_ERROR_NONE;
+                       } else if (!drmIsMaster(fd)) {
+                               TBM_INFO("tbm_module has no master drm_fd");
+                               close(fd);
+                               error = TBM_ERROR_NONE;
                        } else {
                                // make the wayland server socket for sending the authenticated drm_fd to wayland clients.
                                if (!tbm_drm_helper_wl_auth_server_init(native_display, fd, NULL, 0)) {