Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm drm: mutex_init/destroy and s...



details:   https://anonhg.NetBSD.org/src/rev/1e7e46ace5e8
branches:  trunk
changeset: 1028940:1e7e46ace5e8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:32:01 2021 +0000

description:
drm: mutex_init/destroy and spin_lock_init/destroy audit

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_connector.c   |  14 ++++----------
 sys/external/bsd/drm2/dist/drm/drm_dp_helper.c   |   5 +++--
 sys/external/bsd/drm2/dist/drm/drm_drv.c         |   6 ++++--
 sys/external/bsd/drm2/dist/drm/drm_flip_work.c   |   5 +++--
 sys/external/bsd/drm2/dist/drm/drm_mode_config.c |   9 +++++++--
 sys/external/bsd/drm2/dist/drm/drm_syncobj.c     |   5 +++--
 sys/external/bsd/drm2/dist/drm/drm_vblank.c      |   6 ++++--
 7 files changed, 28 insertions(+), 22 deletions(-)

diffs (222 lines):

diff -r 492f985b11fd -r 1e7e46ace5e8 sys/external/bsd/drm2/dist/drm/drm_connector.c
--- a/sys/external/bsd/drm2/dist/drm/drm_connector.c    Sun Dec 19 12:31:45 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_connector.c    Sun Dec 19 12:32:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_connector.c,v 1.6 2021/12/19 11:06:54 riastradh Exp $      */
+/*     $NetBSD: drm_connector.c,v 1.7 2021/12/19 12:32:01 riastradh Exp $      */
 
 /*
  * Copyright (c) 2016 Intel Corporation
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_connector.c,v 1.6 2021/12/19 11:06:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_connector.c,v 1.7 2021/12/19 12:32:01 riastradh Exp $");
 
 #include <drm/drm_connector.h>
 #include <drm/drm_edid.h>
@@ -38,6 +38,8 @@
 #include "drm_crtc_internal.h"
 #include "drm_internal.h"
 
+#include <linux/nbsd-namespace.h>
+
 /**
  * DOC: overview
  *
@@ -256,11 +258,7 @@
 
        INIT_LIST_HEAD(&connector->probed_modes);
        INIT_LIST_HEAD(&connector->modes);
-#ifdef __NetBSD__
-       linux_mutex_init(&connector->mutex);
-#else
        mutex_init(&connector->mutex);
-#endif
        connector->edid_blob_ptr = NULL;
        connector->tile_blob_ptr = NULL;
        connector->status = connector_status_unknown;
@@ -473,11 +471,7 @@
                connector->funcs->atomic_destroy_state(connector,
                                                       connector->state);
 
-#ifdef __NetBSD__
-       linux_mutex_destroy(&connector->mutex);
-#else
        mutex_destroy(&connector->mutex);
-#endif
 
        memset(connector, 0, sizeof(*connector));
 }
diff -r 492f985b11fd -r 1e7e46ace5e8 sys/external/bsd/drm2/dist/drm/drm_dp_helper.c
--- a/sys/external/bsd/drm2/dist/drm/drm_dp_helper.c    Sun Dec 19 12:31:45 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_dp_helper.c    Sun Dec 19 12:32:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_dp_helper.c,v 1.14 2021/12/19 00:56:40 riastradh Exp $     */
+/*     $NetBSD: drm_dp_helper.c,v 1.15 2021/12/19 12:32:01 riastradh Exp $     */
 
 /*
  * Copyright © 2009 Keith Packard
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_dp_helper.c,v 1.14 2021/12/19 00:56:40 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_dp_helper.c,v 1.15 2021/12/19 12:32:01 riastradh Exp $");
 
 #include <linux/delay.h>
 #include <linux/errno.h>
@@ -1075,6 +1075,7 @@
 {
        drm_dp_aux_unregister_devnode(aux);
        i2c_del_adapter(&aux->ddc);
+       mutex_destroy(&aux->cec.lock);
        mutex_destroy(&aux->hw_mutex);
 }
 EXPORT_SYMBOL(drm_dp_aux_unregister);
diff -r 492f985b11fd -r 1e7e46ace5e8 sys/external/bsd/drm2/dist/drm/drm_drv.c
--- a/sys/external/bsd/drm2/dist/drm/drm_drv.c  Sun Dec 19 12:31:45 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_drv.c  Sun Dec 19 12:32:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_drv.c,v 1.21 2021/12/19 11:10:09 riastradh Exp $   */
+/*     $NetBSD: drm_drv.c,v 1.22 2021/12/19 12:32:01 riastradh Exp $   */
 
 /*
  * Created: Fri Jan 19 10:48:35 2001 by faith%acm.org@localhost
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.21 2021/12/19 11:10:09 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.22 2021/12/19 12:32:01 riastradh Exp $");
 
 #include <linux/debugfs.h>
 #include <linux/fs.h>
@@ -761,6 +761,7 @@
        mutex_destroy(&dev->clientlist_mutex);
        mutex_destroy(&dev->filelist_mutex);
        mutex_destroy(&dev->struct_mutex);
+       spin_lock_destroy(&dev->event_lock);
        drm_legacy_destroy_members(dev);
        return ret;
 }
@@ -843,6 +844,7 @@
        mutex_destroy(&dev->clientlist_mutex);
        mutex_destroy(&dev->filelist_mutex);
        mutex_destroy(&dev->struct_mutex);
+       spin_lock_destroy(&dev->event_lock);
        drm_legacy_destroy_members(dev);
        kfree(dev->unique);
 }
diff -r 492f985b11fd -r 1e7e46ace5e8 sys/external/bsd/drm2/dist/drm/drm_flip_work.c
--- a/sys/external/bsd/drm2/dist/drm/drm_flip_work.c    Sun Dec 19 12:31:45 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_flip_work.c    Sun Dec 19 12:32:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_flip_work.c,v 1.5 2021/12/18 23:44:57 riastradh Exp $      */
+/*     $NetBSD: drm_flip_work.c,v 1.6 2021/12/19 12:32:01 riastradh Exp $      */
 
 /*
  * Copyright (C) 2013 Red Hat
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_flip_work.c,v 1.5 2021/12/18 23:44:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_flip_work.c,v 1.6 2021/12/19 12:32:01 riastradh Exp $");
 
 #include <linux/slab.h>
 
@@ -171,5 +171,6 @@
 void drm_flip_work_cleanup(struct drm_flip_work *work)
 {
        WARN_ON(!list_empty(&work->queued) || !list_empty(&work->commited));
+       spin_lock_destroy(&work->lock);
 }
 EXPORT_SYMBOL(drm_flip_work_cleanup);
diff -r 492f985b11fd -r 1e7e46ace5e8 sys/external/bsd/drm2/dist/drm/drm_mode_config.c
--- a/sys/external/bsd/drm2/dist/drm/drm_mode_config.c  Sun Dec 19 12:31:45 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_mode_config.c  Sun Dec 19 12:32:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_mode_config.c,v 1.4 2021/12/19 10:47:29 riastradh Exp $    */
+/*     $NetBSD: drm_mode_config.c,v 1.5 2021/12/19 12:32:01 riastradh Exp $    */
 
 /*
  * Copyright (c) 2016 Intel Corporation
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_mode_config.c,v 1.4 2021/12/19 10:47:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_mode_config.c,v 1.5 2021/12/19 12:32:01 riastradh Exp $");
 
 #include <linux/uaccess.h>
 
@@ -533,9 +533,14 @@
                drm_framebuffer_free(&fb->base.refcount);
        }
 
+       spin_lock_destroy(&dev->mode_config.connector_list_lock);
        ida_destroy(&dev->mode_config.connector_ida);
        idr_destroy(&dev->mode_config.tile_idr);
        idr_destroy(&dev->mode_config.object_idr);
+       mutex_destroy(&dev->mode_config.blob_lock);
+       mutex_destroy(&dev->mode_config.fb_lock);
+       mutex_destroy(&dev->mode_config.idr_mutex);
        drm_modeset_lock_fini(&dev->mode_config.connection_mutex);
+       mutex_destroy(&dev->mode_config.mutex);
 }
 EXPORT_SYMBOL(drm_mode_config_cleanup);
diff -r 492f985b11fd -r 1e7e46ace5e8 sys/external/bsd/drm2/dist/drm/drm_syncobj.c
--- a/sys/external/bsd/drm2/dist/drm/drm_syncobj.c      Sun Dec 19 12:31:45 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_syncobj.c      Sun Dec 19 12:32:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_syncobj.c,v 1.4 2021/12/19 10:39:14 riastradh Exp $        */
+/*     $NetBSD: drm_syncobj.c,v 1.5 2021/12/19 12:32:01 riastradh Exp $        */
 
 /*
  * Copyright 2017 Red Hat
@@ -125,7 +125,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_syncobj.c,v 1.4 2021/12/19 10:39:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_syncobj.c,v 1.5 2021/12/19 12:32:01 riastradh Exp $");
 
 #include <linux/anon_inodes.h>
 #include <linux/file.h>
@@ -465,6 +465,7 @@
                                                   struct drm_syncobj,
                                                   refcount);
        drm_syncobj_replace_fence(syncobj, NULL);
+       spin_lock_destroy(&syncobj->lock);
        kfree(syncobj);
 }
 EXPORT_SYMBOL(drm_syncobj_free);
diff -r 492f985b11fd -r 1e7e46ace5e8 sys/external/bsd/drm2/dist/drm/drm_vblank.c
--- a/sys/external/bsd/drm2/dist/drm/drm_vblank.c       Sun Dec 19 12:31:45 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_vblank.c       Sun Dec 19 12:32:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_vblank.c,v 1.13 2021/12/19 12:24:57 riastradh Exp $        */
+/*     $NetBSD: drm_vblank.c,v 1.14 2021/12/19 12:32:01 riastradh Exp $        */
 
 /*
  * drm_irq.c IRQ and vblank support
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_vblank.c,v 1.13 2021/12/19 12:24:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_vblank.c,v 1.14 2021/12/19 12:32:01 riastradh Exp $");
 
 #include <linux/export.h>
 #include <linux/moduleparam.h>
@@ -480,6 +480,8 @@
        kfree(dev->vblank);
 
        dev->num_crtcs = 0;
+
+       spin_lock_destroy(&dev->vblank_time_lock);
 }
 
 /**



Home | Main Index | Thread Index | Old Index