Initialize and destroy dev_priv->drrs.mutex only once.

Not once per connector!

Candidate fix for:
https://mail-index.netbsd.org/current-users/2018/08/30/msg034155.html
This commit is contained in:
riastradh 2018-09-02 17:36:57 +00:00
parent b4c7496bd8
commit 1537d232a4
2 changed files with 8 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: intel_display.c,v 1.21 2018/08/27 07:28:41 riastradh Exp $ */
/* $NetBSD: intel_display.c,v 1.22 2018/09/02 17:36:57 riastradh Exp $ */
/*
* Copyright © 2006-2007 Intel Corporation
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.21 2018/08/27 07:28:41 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: intel_display.c,v 1.22 2018/09/02 17:36:57 riastradh Exp $");
#include <linux/dmi.h>
#include <linux/module.h>
@ -14775,8 +14775,10 @@ static void intel_init_display(struct drm_device *dev)
#ifdef __NetBSD__
linux_mutex_init(&dev_priv->pps_mutex);
linux_mutex_init(&dev_priv->drrs.mutex);
#else
mutex_init(&dev_priv->pps_mutex);
mutex_init(&dev_priv->drrs.mutex);
#endif
}
@ -15710,10 +15712,12 @@ void intel_modeset_cleanup(struct drm_device *dev)
#ifdef __NetBSD__
linux_mutex_destroy(&dev_priv->psr.lock);
linux_mutex_destroy(&dev_priv->drrs.mutex);
linux_mutex_destroy(&dev_priv->pps_mutex);
linux_mutex_destroy(&dev_priv->fbc.lock);
#else
mutex_destroy(&dev_priv->psr.lock);
mutex_destroy(&dev_priv->drrs.mutex);
mutex_destroy(&dev_priv->pps_mutex);
mutex_destroy(&dev_priv->fbc.lock);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: intel_dp.c,v 1.17 2018/08/27 13:41:23 riastradh Exp $ */
/* $NetBSD: intel_dp.c,v 1.18 2018/09/02 17:36:57 riastradh Exp $ */
/*
* Copyright © 2008 Intel Corporation
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: intel_dp.c,v 1.17 2018/08/27 13:41:23 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: intel_dp.c,v 1.18 2018/09/02 17:36:57 riastradh Exp $");
#include <linux/i2c.h>
#include <linux/slab.h>
@ -5014,8 +5014,6 @@ static void
intel_dp_connector_destroy(struct drm_connector *connector)
{
struct intel_connector *intel_connector = to_intel_connector(connector);
struct drm_device *dev = intel_connector->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
kfree(intel_connector->detect_edid);
@ -5028,11 +5026,6 @@ intel_dp_connector_destroy(struct drm_connector *connector)
intel_panel_fini(&intel_connector->panel);
drm_connector_cleanup(connector);
#ifdef __NetBSD__
linux_mutex_destroy(&dev_priv->drrs.mutex);
#else
mutex_destroy(&dev_priv->drrs.mutex);
#endif
kfree(connector);
}
@ -6025,12 +6018,6 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
intel_dp->pps_pipe = INVALID_PIPE;
#ifdef __NetBSD__
linux_mutex_init(&dev_priv->drrs.mutex);
#else
mutex_init(&dev_priv->drrs.mutex);
#endif
/* intel_dp vfuncs */
if (INTEL_INFO(dev)->gen >= 9)
intel_dp->get_aux_clock_divider = skl_get_aux_clock_divider;