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: add drm_dp_aux_fini; use it ...



details:   https://anonhg.NetBSD.org/src/rev/5f3651330e4e
branches:  trunk
changeset: 1029005:5f3651330e4e
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 12:41:54 2021 +0000

description:
drm: add drm_dp_aux_fini; use it in i915 to fix missing mutex destroy.


Author: chuq <chs%NetBSD.org@localhost>
Committer: Taylor R Campbell <riastradh%NetBSD.org@localhost>

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_dp_helper.c         |  18 ++++++++++++++----
 sys/external/bsd/drm2/dist/drm/i915/display/intel_dp.c |   5 +++--
 sys/external/bsd/drm2/dist/include/drm/drm_dp_helper.h |   3 ++-
 3 files changed, 19 insertions(+), 7 deletions(-)

diffs (89 lines):

diff -r fdb495b4b1d9 -r 5f3651330e4e 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:41:44 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_dp_helper.c    Sun Dec 19 12:41:54 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_dp_helper.c,v 1.15 2021/12/19 12:32:01 riastradh Exp $     */
+/*     $NetBSD: drm_dp_helper.c,v 1.16 2021/12/19 12:41:54 riastradh Exp $     */
 
 /*
  * Copyright © 2009 Keith Packard
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_dp_helper.c,v 1.15 2021/12/19 12:32:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_dp_helper.c,v 1.16 2021/12/19 12:41:54 riastradh Exp $");
 
 #include <linux/delay.h>
 #include <linux/errno.h>
@@ -1024,6 +1024,17 @@
 EXPORT_SYMBOL(drm_dp_aux_init);
 
 /**
+ * drm_dp_aux_fini() - undo what drm_dp_aux_init() does.
+ * @aux: DisplayPort AUX channel
+ */
+void drm_dp_aux_fini(struct drm_dp_aux *aux)
+{
+       mutex_destroy(&aux->cec.lock);
+       mutex_destroy(&aux->hw_mutex);
+}
+EXPORT_SYMBOL(drm_dp_aux_fini);
+
+/**
  * drm_dp_aux_register() - initialise and register aux channel
  * @aux: DisplayPort AUX channel
  *
@@ -1075,8 +1086,7 @@
 {
        drm_dp_aux_unregister_devnode(aux);
        i2c_del_adapter(&aux->ddc);
-       mutex_destroy(&aux->cec.lock);
-       mutex_destroy(&aux->hw_mutex);
+       drm_dp_aux_fini(aux);
 }
 EXPORT_SYMBOL(drm_dp_aux_unregister);
 
diff -r fdb495b4b1d9 -r 5f3651330e4e sys/external/bsd/drm2/dist/drm/i915/display/intel_dp.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_dp.c    Sun Dec 19 12:41:44 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_dp.c    Sun Dec 19 12:41:54 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_dp.c,v 1.6 2021/12/19 12:40:31 riastradh Exp $   */
+/*     $NetBSD: intel_dp.c,v 1.7 2021/12/19 12:41:54 riastradh Exp $   */
 
 /*
  * Copyright © 2008 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_dp.c,v 1.6 2021/12/19 12:40:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_dp.c,v 1.7 2021/12/19 12:41:54 riastradh Exp $");
 
 #include <linux/export.h>
 #include <linux/i2c.h>
@@ -1730,6 +1730,7 @@
 static void
 intel_dp_aux_fini(struct intel_dp *intel_dp)
 {
+       drm_dp_aux_fini(&intel_dp->aux);
        kfree(__UNCONST(intel_dp->aux.name));
 }
 
diff -r fdb495b4b1d9 -r 5f3651330e4e sys/external/bsd/drm2/dist/include/drm/drm_dp_helper.h
--- a/sys/external/bsd/drm2/dist/include/drm/drm_dp_helper.h    Sun Dec 19 12:41:44 2021 +0000
+++ b/sys/external/bsd/drm2/dist/include/drm/drm_dp_helper.h    Sun Dec 19 12:41:54 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_dp_helper.h,v 1.8 2021/12/19 10:48:47 riastradh Exp $      */
+/*     $NetBSD: drm_dp_helper.h,v 1.9 2021/12/19 12:41:54 riastradh Exp $      */
 
 /*
  * Copyright © 2008 Keith Packard
@@ -1472,6 +1472,7 @@
 
 void drm_dp_remote_aux_init(struct drm_dp_aux *aux);
 void drm_dp_aux_init(struct drm_dp_aux *aux);
+void drm_dp_aux_fini(struct drm_dp_aux *aux);
 int drm_dp_aux_register(struct drm_dp_aux *aux);
 void drm_dp_aux_unregister(struct drm_dp_aux *aux);
 



Home | Main Index | Thread Index | Old Index