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/i915 i915: mutex_init/destroy...



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

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

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c       |   8 +++-
 sys/external/bsd/drm2/dist/drm/i915/display/intel_display_power.c |   5 +-
 sys/external/bsd/drm2/dist/drm/i915/display/intel_dpll_mgr.c      |  12 ++++++-
 sys/external/bsd/drm2/dist/drm/i915/display/intel_dpll_mgr.h      |   3 +-
 sys/external/bsd/drm2/dist/drm/i915/display/intel_fbc.c           |  12 ++++++-
 sys/external/bsd/drm2/dist/drm/i915/display/intel_fbc.h           |   3 +-
 sys/external/bsd/drm2/dist/drm/i915/display/intel_fbdev.c         |   6 ++-
 sys/external/bsd/drm2/dist/drm/i915/display/intel_hdcp.c          |   7 ++-
 sys/external/bsd/drm2/dist/drm/i915/display/intel_pipe_crc.c      |  15 ++++++++-
 sys/external/bsd/drm2/dist/drm/i915/display/intel_pipe_crc.h      |   4 +-
 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c        |   5 +-
 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_userptr.c        |   9 +++-
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_breadcrumbs.c        |   7 +++-
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_engine_cs.c          |   6 ++-
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_gt_pm.c              |   5 +-
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_lrc.c                |   7 +++-
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_reset.c              |   5 +-
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_rps.c                |  11 +++++-
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_rps.h                |   3 +-
 sys/external/bsd/drm2/dist/drm/i915/gt/intel_timeline.c           |   7 +++-
 sys/external/bsd/drm2/dist/drm/i915/gt/uc/intel_guc.c             |   7 +++-
 sys/external/bsd/drm2/dist/drm/i915/gt/uc/intel_guc_ct.c          |   5 +-
 sys/external/bsd/drm2/dist/drm/i915/gt/uc/intel_guc_log.c         |   5 +-
 sys/external/bsd/drm2/dist/drm/i915/gt/uc/intel_guc_submission.c  |   5 +-
 sys/external/bsd/drm2/dist/drm/i915/i915_drv.c                    |  10 ++++-
 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c                    |   5 +-
 sys/external/bsd/drm2/dist/drm/i915/i915_perf.c                   |   9 ++++-
 sys/external/bsd/drm2/dist/drm/i915/i915_pmu.c                    |   5 +-
 sys/external/bsd/drm2/dist/drm/i915/intel_runtime_pm.c            |  14 +++++++-
 sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c                |  16 ++++++++-
 sys/external/bsd/drm2/dist/drm/i915/intel_uncore.h                |   6 +++-
 sys/external/bsd/drm2/dist/drm/i915/intel_wakeref.c               |  16 ++++++---
 32 files changed, 178 insertions(+), 65 deletions(-)

diffs (truncated from 957 to 300 lines):

diff -r 1e7e46ace5e8 -r a6ba74a138a7 sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c       Sun Dec 19 12:32:01 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c       Sun Dec 19 12:32:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_display.c,v 1.10 2021/12/19 12:28:55 riastradh Exp $     */
+/*     $NetBSD: intel_display.c,v 1.11 2021/12/19 12:32:15 riastradh Exp $     */
 
 /*
  * Copyright © 2006-2007 Intel Corporation
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.10 2021/12/19 12:28:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.11 2021/12/19 12:32:15 riastradh Exp $");
 
 #include "intel_display.h"     /* for pipe_drmhack */
 
@@ -18576,8 +18576,12 @@
 
        intel_overlay_cleanup(i915);
 
+       intel_shared_dpll_cleanup(&i915->drm);
+
        intel_gmbus_teardown(i915);
 
+       intel_fbc_cleanup(i915);
+
        intel_bw_cleanup(i915);
 
        DRM_DESTROY_WAITQUEUE(&i915->atomic_commit_wq);
diff -r 1e7e46ace5e8 -r a6ba74a138a7 sys/external/bsd/drm2/dist/drm/i915/display/intel_display_power.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_display_power.c Sun Dec 19 12:32:01 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_display_power.c Sun Dec 19 12:32:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_display_power.c,v 1.4 2021/12/19 11:54:48 riastradh Exp $        */
+/*     $NetBSD: intel_display_power.c,v 1.5 2021/12/19 12:32:15 riastradh Exp $        */
 
 /* SPDX-License-Identifier: MIT */
 /*
@@ -6,7 +6,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_display_power.c,v 1.4 2021/12/19 11:54:48 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_display_power.c,v 1.5 2021/12/19 12:32:15 riastradh Exp $");
 
 #include "display/intel_crt.h"
 #include "display/intel_dp.h"
@@ -4362,6 +4362,7 @@
 void intel_power_domains_cleanup(struct drm_i915_private *dev_priv)
 {
        kfree(dev_priv->power_domains.power_wells);
+       mutex_destroy(&dev_priv->power_domains.lock);
 }
 
 static void intel_power_domains_sync_hw(struct drm_i915_private *dev_priv)
diff -r 1e7e46ace5e8 -r a6ba74a138a7 sys/external/bsd/drm2/dist/drm/i915/display/intel_dpll_mgr.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_dpll_mgr.c      Sun Dec 19 12:32:01 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_dpll_mgr.c      Sun Dec 19 12:32:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_dpll_mgr.c,v 1.3 2021/12/19 11:38:26 riastradh Exp $     */
+/*     $NetBSD: intel_dpll_mgr.c,v 1.4 2021/12/19 12:32:15 riastradh Exp $     */
 
 /*
  * Copyright © 2006-2016 Intel Corporation
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_dpll_mgr.c,v 1.3 2021/12/19 11:38:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_dpll_mgr.c,v 1.4 2021/12/19 12:32:15 riastradh Exp $");
 
 #include "intel_display_types.h"
 #include "intel_dpio_phy.h"
@@ -3795,6 +3795,14 @@
        BUG_ON(dev_priv->num_shared_dpll > I915_NUM_PLLS);
 }
 
+void
+intel_shared_dpll_cleanup(struct drm_device *dev)
+{
+       struct drm_i915_private *dev_priv = to_i915(dev);
+
+       mutex_destroy(&dev_priv->dpll_lock);
+}
+
 /**
  * intel_reserve_shared_dplls - reserve DPLLs for CRTC and encoder combination
  * @state: atomic state
diff -r 1e7e46ace5e8 -r a6ba74a138a7 sys/external/bsd/drm2/dist/drm/i915/display/intel_dpll_mgr.h
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_dpll_mgr.h      Sun Dec 19 12:32:01 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_dpll_mgr.h      Sun Dec 19 12:32:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_dpll_mgr.h,v 1.2 2021/12/18 23:45:30 riastradh Exp $     */
+/*     $NetBSD: intel_dpll_mgr.h,v 1.3 2021/12/19 12:32:15 riastradh Exp $     */
 
 /*
  * Copyright © 2012-2016 Intel Corporation
@@ -379,6 +379,7 @@
 void intel_disable_shared_dpll(const struct intel_crtc_state *crtc_state);
 void intel_shared_dpll_swap_state(struct intel_atomic_state *state);
 void intel_shared_dpll_init(struct drm_device *dev);
+void intel_shared_dpll_cleanup(struct drm_device *dev);
 
 void intel_dpll_dump_hw_state(struct drm_i915_private *dev_priv,
                              const struct intel_dpll_hw_state *hw_state);
diff -r 1e7e46ace5e8 -r a6ba74a138a7 sys/external/bsd/drm2/dist/drm/i915/display/intel_fbc.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_fbc.c   Sun Dec 19 12:32:01 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_fbc.c   Sun Dec 19 12:32:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_fbc.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $  */
+/*     $NetBSD: intel_fbc.c,v 1.3 2021/12/19 12:32:15 riastradh Exp $  */
 
 /*
  * Copyright © 2014 Intel Corporation
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_fbc.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_fbc.c,v 1.3 2021/12/19 12:32:15 riastradh Exp $");
 
 #include <drm/drm_fourcc.h>
 
@@ -1363,3 +1363,11 @@
        if (intel_fbc_hw_is_active(dev_priv))
                intel_fbc_hw_deactivate(dev_priv);
 }
+
+void
+intel_fbc_cleanup(struct drm_i915_private *dev_priv)
+{
+       struct intel_fbc *fbc = &dev_priv->fbc;
+
+       mutex_destroy(&fbc->lock);
+}
diff -r 1e7e46ace5e8 -r a6ba74a138a7 sys/external/bsd/drm2/dist/drm/i915/display/intel_fbc.h
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_fbc.h   Sun Dec 19 12:32:01 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_fbc.h   Sun Dec 19 12:32:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_fbc.h,v 1.2 2021/12/18 23:45:30 riastradh Exp $  */
+/*     $NetBSD: intel_fbc.h,v 1.3 2021/12/19 12:32:15 riastradh Exp $  */
 
 /* SPDX-License-Identifier: MIT */
 /*
@@ -26,6 +26,7 @@
                          const struct intel_plane_state *plane_state);
 void intel_fbc_post_update(struct intel_crtc *crtc);
 void intel_fbc_init(struct drm_i915_private *dev_priv);
+void intel_fbc_cleanup(struct drm_i915_private *dev_priv);
 void intel_fbc_enable(struct intel_crtc *crtc,
                      const struct intel_crtc_state *crtc_state,
                      const struct intel_plane_state *plane_state);
diff -r 1e7e46ace5e8 -r a6ba74a138a7 sys/external/bsd/drm2/dist/drm/i915/display/intel_fbdev.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_fbdev.c Sun Dec 19 12:32:01 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_fbdev.c Sun Dec 19 12:32:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_fbdev.c,v 1.8 2021/12/19 11:45:01 riastradh Exp $        */
+/*     $NetBSD: intel_fbdev.c,v 1.9 2021/12/19 12:32:15 riastradh Exp $        */
 
 /*
  * Copyright © 2007 David Airlie
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_fbdev.c,v 1.8 2021/12/19 11:45:01 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_fbdev.c,v 1.9 2021/12/19 12:32:15 riastradh Exp $");
 
 #include <linux/async.h>
 #include <linux/console.h>
@@ -357,6 +357,8 @@
        if (ifbdev->fb)
                drm_framebuffer_remove(&ifbdev->fb->base);
 
+       mutex_destroy(&ifbdev->hpd_lock);
+
        kfree(ifbdev);
 }
 
diff -r 1e7e46ace5e8 -r a6ba74a138a7 sys/external/bsd/drm2/dist/drm/i915/display/intel_hdcp.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_hdcp.c  Sun Dec 19 12:32:01 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_hdcp.c  Sun Dec 19 12:32:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_hdcp.c,v 1.5 2021/12/19 11:49:11 riastradh Exp $ */
+/*     $NetBSD: intel_hdcp.c,v 1.6 2021/12/19 12:32:15 riastradh Exp $ */
 
 /* SPDX-License-Identifier: MIT */
 /*
@@ -11,7 +11,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_hdcp.c,v 1.5 2021/12/19 11:49:11 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_hdcp.c,v 1.6 2021/12/19 12:32:15 riastradh Exp $");
 
 #include <linux/component.h>
 #include <linux/i2c.h>
@@ -1949,7 +1949,6 @@
        }
 
        hdcp->shim = shim;
-       /* XXX destroy */
        mutex_init(&hdcp->mutex);
        INIT_DELAYED_WORK(&hdcp->check_work, intel_hdcp_check_work);
        INIT_WORK(&hdcp->prop_work, intel_hdcp_prop_work);
@@ -2054,6 +2053,8 @@
        mutex_lock(&connector->hdcp.mutex);
        kfree(connector->hdcp.port_data.streams);
        mutex_unlock(&connector->hdcp.mutex);
+
+       mutex_destroy(&connector->hdcp.mutex);
 }
 
 void intel_hdcp_atomic_check(struct drm_connector *connector,
diff -r 1e7e46ace5e8 -r a6ba74a138a7 sys/external/bsd/drm2/dist/drm/i915/display/intel_pipe_crc.c
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_pipe_crc.c      Sun Dec 19 12:32:01 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_pipe_crc.c      Sun Dec 19 12:32:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_pipe_crc.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $     */
+/*     $NetBSD: intel_pipe_crc.c,v 1.3 2021/12/19 12:32:15 riastradh Exp $     */
 
 /*
  * Copyright © 2013 Intel Corporation
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_pipe_crc.c,v 1.2 2021/12/18 23:45:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_pipe_crc.c,v 1.3 2021/12/19 12:32:15 riastradh Exp $");
 
 #include <linux/circ_buf.h>
 #include <linux/ctype.h>
@@ -456,6 +456,17 @@
        }
 }
 
+void intel_display_crc_init(struct drm_i915_private *dev_priv)
+{
+       enum pipe pipe;
+
+       for_each_pipe(dev_priv, pipe) {
+               struct intel_pipe_crc *pipe_crc = &dev_priv->pipe_crc[pipe];
+
+               spin_lock_destroy(&pipe_crc->lock);
+       }
+}
+
 static int i8xx_crc_source_valid(struct drm_i915_private *dev_priv,
                                 const enum intel_pipe_crc_source source)
 {
diff -r 1e7e46ace5e8 -r a6ba74a138a7 sys/external/bsd/drm2/dist/drm/i915/display/intel_pipe_crc.h
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_pipe_crc.h      Sun Dec 19 12:32:01 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_pipe_crc.h      Sun Dec 19 12:32:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_pipe_crc.h,v 1.2 2021/12/18 23:45:30 riastradh Exp $     */
+/*     $NetBSD: intel_pipe_crc.h,v 1.3 2021/12/19 12:32:15 riastradh Exp $     */
 
 /* SPDX-License-Identifier: MIT */
 /*
@@ -16,6 +16,7 @@
 
 #ifdef CONFIG_DEBUG_FS
 void intel_display_crc_init(struct drm_i915_private *dev_priv);
+void intel_display_crc_fini(struct drm_i915_private *dev_priv);
 int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name);
 int intel_crtc_verify_crc_source(struct drm_crtc *crtc,
                                 const char *source_name, size_t *values_cnt);
@@ -25,6 +26,7 @@
 void intel_crtc_enable_pipe_crc(struct intel_crtc *crtc);
 #else
 static inline void intel_display_crc_init(struct drm_i915_private *dev_priv) {}
+static inline void intel_display_crc_fini(struct drm_i915_private *dev_priv) {}
 #define intel_crtc_set_crc_source NULL
 #define intel_crtc_verify_crc_source NULL
 #define intel_crtc_get_crc_sources NULL
diff -r 1e7e46ace5e8 -r a6ba74a138a7 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c        Sun Dec 19 12:32:01 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c        Sun Dec 19 12:32:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem_context.c,v 1.4 2021/12/19 11:27:20 riastradh Exp $   */
+/*     $NetBSD: i915_gem_context.c,v 1.5 2021/12/19 12:32:15 riastradh Exp $   */
 
 /*
  * SPDX-License-Identifier: MIT
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_context.c,v 1.4 2021/12/19 11:27:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_context.c,v 1.5 2021/12/19 12:32:15 riastradh Exp $");
 
 #include <linux/log2.h>
 #include <linux/nospec.h>
@@ -786,6 +786,7 @@
 void i915_gem_driver_release__contexts(struct drm_i915_private *i915)
 {
        flush_work(&i915->gem.contexts.free_work);
+       spin_lock_destroy(&i915->gem.contexts.lock);



Home | Main Index | Thread Index | Old Index