set the name of the allocating process in struct drm_framebuffer
authorjsg <jsg@openbsd.org>
Fri, 30 Jul 2021 04:04:25 +0000 (04:04 +0000)
committerjsg <jsg@openbsd.org>
Fri, 30 Jul 2021 04:04:25 +0000 (04:04 +0000)
sys/dev/pci/drm/drm_fb_helper.c
sys/dev/pci/drm/drm_framebuffer.c

index 29ee15a..fc17044 100644 (file)
@@ -1687,6 +1687,8 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
 
 #ifdef __linux__
        strcpy(fb_helper->fb->comm, "[fbcon]");
+#else
+       strlcpy(fb_helper->fb->comm, "[fbcon]", sizeof(fb_helper->fb->comm));
 #endif
        return 0;
 }
index 239bf76..a6ae8b3 100644 (file)
@@ -852,8 +852,10 @@ int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb,
        INIT_LIST_HEAD(&fb->filp_head);
 
        fb->funcs = funcs;
-#ifdef notyet
-       strlcpy(fb->comm, current->comm, sizeof(fb->comm));
+#ifdef __linux__
+       strcpy(fb->comm, current->comm);
+#else
+       strlcpy(fb->comm, curproc->p_p->ps_comm, sizeof(fb->comm));
 #endif
 
        ret = __drm_mode_object_add(dev, &fb->base, DRM_MODE_OBJECT_FB,