summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2015-02-10 03:39:41 +0000
committerjsg <jsg@openbsd.org>2015-02-10 03:39:41 +0000
commit464c317bedaf6a85d40b61cbfec15b735918bf26 (patch)
treed5d462680a2b4fd77cbd2b79a95916f776d8c99e
parentRemove m_act; it was the historical name of m_nextpkt and has been (diff)
downloadwireguard-openbsd-464c317bedaf6a85d40b61cbfec15b735918bf26.tar.xz
wireguard-openbsd-464c317bedaf6a85d40b61cbfec15b735918bf26.zip
use linux function names when locking mode config
-rw-r--r--sys/dev/pci/drm/drm_crtc.c132
-rw-r--r--sys/dev/pci/drm/drm_crtc.h4
-rw-r--r--sys/dev/pci/drm/drm_crtc_helper.c10
-rw-r--r--sys/dev/pci/drm/drm_fb_helper.c12
-rw-r--r--sys/dev/pci/drm/i915/i915_irq.c6
-rw-r--r--sys/dev/pci/drm/i915/intel_dp.c6
-rw-r--r--sys/dev/pci/drm/i915/intel_fb.c6
-rw-r--r--sys/dev/pci/drm/i915/intel_lvds.c6
-rw-r--r--sys/dev/pci/drm/i915/intel_overlay.c20
-rw-r--r--sys/dev/pci/drm/i915/intel_sprite.c10
10 files changed, 106 insertions, 106 deletions
diff --git a/sys/dev/pci/drm/drm_crtc.c b/sys/dev/pci/drm/drm_crtc.c
index f8e1b676f09..c64f9db79ad 100644
--- a/sys/dev/pci/drm/drm_crtc.c
+++ b/sys/dev/pci/drm/drm_crtc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_crtc.c,v 1.8 2014/03/09 11:07:18 jsg Exp $ */
+/* $OpenBSD: drm_crtc.c,v 1.9 2015/02/10 03:39:41 jsg Exp $ */
/*
* Copyright (c) 2006-2008 Intel Corporation
* Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
@@ -460,7 +460,7 @@ int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
crtc->funcs = funcs;
crtc->invert_dimensions = false;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
ret = drm_mode_object_get(dev, &crtc->base, DRM_MODE_OBJECT_CRTC);
if (ret)
@@ -472,7 +472,7 @@ int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
dev->mode_config.num_crtc++;
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -559,7 +559,7 @@ int drm_connector_init(struct drm_device *dev,
{
int ret;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
ret = drm_mode_object_get(dev, &connector->base, DRM_MODE_OBJECT_CONNECTOR);
if (ret)
@@ -589,7 +589,7 @@ int drm_connector_init(struct drm_device *dev,
dev->mode_config.dpms_property, 0);
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -618,11 +618,11 @@ void drm_connector_cleanup(struct drm_connector *connector)
list_for_each_entry_safe(mode, t, &connector->user_modes, head)
drm_mode_remove(connector, mode);
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
drm_mode_object_put(dev, &connector->base);
list_del(&connector->head);
dev->mode_config.num_connector--;
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
}
EXPORT_SYMBOL(drm_connector_cleanup);
@@ -645,7 +645,7 @@ int drm_encoder_init(struct drm_device *dev,
{
int ret;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
ret = drm_mode_object_get(dev, &encoder->base, DRM_MODE_OBJECT_ENCODER);
if (ret)
@@ -659,7 +659,7 @@ int drm_encoder_init(struct drm_device *dev,
dev->mode_config.num_encoder++;
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -668,11 +668,11 @@ EXPORT_SYMBOL(drm_encoder_init);
void drm_encoder_cleanup(struct drm_encoder *encoder)
{
struct drm_device *dev = encoder->dev;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
drm_mode_object_put(dev, &encoder->base);
list_del(&encoder->head);
dev->mode_config.num_encoder--;
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
}
EXPORT_SYMBOL(drm_encoder_cleanup);
@@ -684,7 +684,7 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
{
int ret;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
ret = drm_mode_object_get(dev, &plane->base, DRM_MODE_OBJECT_PLANE);
if (ret)
@@ -719,7 +719,7 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
}
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -729,7 +729,7 @@ void drm_plane_cleanup(struct drm_plane *plane)
{
struct drm_device *dev = plane->dev;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
kfree(plane->format_types);
drm_mode_object_put(dev, &plane->base);
/* if not added to a list, it must be a private plane */
@@ -737,7 +737,7 @@ void drm_plane_cleanup(struct drm_plane *plane)
list_del(&plane->head);
dev->mode_config.num_plane--;
}
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
}
EXPORT_SYMBOL(drm_plane_cleanup);
@@ -1010,7 +1010,7 @@ EXPORT_SYMBOL(drm_mode_create_dirty_info_property);
*/
void drm_mode_config_init(struct drm_device *dev)
{
- rw_init(&dev->mode_config.rwl, "mcrwl");
+ rw_init(&dev->mode_config.mutex, "mcrwl");
rw_init(&dev->mode_config.idr_rwl, "idrwl");
INIT_LIST_HEAD(&dev->mode_config.fb_list);
INIT_LIST_HEAD(&dev->mode_config.crtc_list);
@@ -1021,9 +1021,9 @@ void drm_mode_config_init(struct drm_device *dev)
INIT_LIST_HEAD(&dev->mode_config.plane_list);
SPLAY_INIT(&dev->mode_config.mode_tree);
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
drm_mode_create_standard_connector_properties(dev);
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
/* Just to be sure */
dev->mode_config.num_fb = 0;
@@ -1258,7 +1258,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
/*
* For the non-control nodes we need to limit the list of resources
@@ -1418,7 +1418,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
card_res->count_connectors, card_res->count_encoders);
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -1450,7 +1450,7 @@ int drm_mode_getcrtc(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, crtc_resp->crtc_id,
DRM_MODE_OBJECT_CRTC);
@@ -1478,7 +1478,7 @@ int drm_mode_getcrtc(struct drm_device *dev,
}
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -1525,7 +1525,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
DRM_DEBUG_KMS("[CONNECTOR:%d:?]\n", out_resp->connector_id);
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, out_resp->connector_id,
DRM_MODE_OBJECT_CONNECTOR);
@@ -1625,7 +1625,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
out_resp->count_encoders = encoders_count;
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -1640,7 +1640,7 @@ int drm_mode_getencoder(struct drm_device *dev, void *data,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, enc_resp->encoder_id,
DRM_MODE_OBJECT_ENCODER);
if (!obj) {
@@ -1659,7 +1659,7 @@ int drm_mode_getencoder(struct drm_device *dev, void *data,
enc_resp->possible_clones = encoder->possible_clones;
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -1686,7 +1686,7 @@ int drm_mode_getplane_res(struct drm_device *dev, void *data,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
config = &dev->mode_config;
/*
@@ -1709,7 +1709,7 @@ int drm_mode_getplane_res(struct drm_device *dev, void *data,
plane_resp->count_planes = config->num_plane;
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -1737,7 +1737,7 @@ int drm_mode_getplane(struct drm_device *dev, void *data,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, plane_resp->plane_id,
DRM_MODE_OBJECT_PLANE);
if (!obj) {
@@ -1777,7 +1777,7 @@ int drm_mode_getplane(struct drm_device *dev, void *data,
plane_resp->count_format_types = plane->format_count;
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -1808,7 +1808,7 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
/*
* First, find the plane, crtc, and fb objects. If not available,
@@ -1907,7 +1907,7 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
}
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -1951,7 +1951,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
if (crtc_req->x > INT_MAX || crtc_req->y > INT_MAX)
return -ERANGE;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, crtc_req->crtc_id,
DRM_MODE_OBJECT_CRTC);
if (!obj) {
@@ -2088,7 +2088,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
out:
kfree(connector_set);
drm_mode_destroy(dev, mode);
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -2106,7 +2106,7 @@ int drm_mode_cursor_ioctl(struct drm_device *dev,
if (!req->flags || (~DRM_MODE_CURSOR_FLAGS & req->flags))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, req->crtc_id, DRM_MODE_OBJECT_CRTC);
if (!obj) {
DRM_DEBUG_KMS("Unknown CRTC ID %d\n", req->crtc_id);
@@ -2134,7 +2134,7 @@ int drm_mode_cursor_ioctl(struct drm_device *dev,
}
}
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -2217,7 +2217,7 @@ int drm_mode_addfb(struct drm_device *dev,
if ((config->min_height > r.height) || (r.height > config->max_height))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
/* TODO check buffer is sufficiently large */
/* TODO setup destructor callback */
@@ -2234,7 +2234,7 @@ int drm_mode_addfb(struct drm_device *dev,
DRM_DEBUG_KMS("[FB:%d]\n", fb->base.id);
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -2406,7 +2406,7 @@ int drm_mode_addfb2(struct drm_device *dev,
if (ret)
return ret;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
fb = dev->mode_config.funcs->fb_create(dev, file_priv, r);
if (IS_ERR(fb)) {
@@ -2420,7 +2420,7 @@ int drm_mode_addfb2(struct drm_device *dev,
DRM_DEBUG_KMS("[FB:%d]\n", fb->base.id);
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -2454,7 +2454,7 @@ int drm_mode_rmfb(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, *id, DRM_MODE_OBJECT_FB);
/* TODO check that we really get a framebuffer back. */
if (!obj) {
@@ -2475,7 +2475,7 @@ int drm_mode_rmfb(struct drm_device *dev,
drm_framebuffer_remove(fb);
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -2507,7 +2507,7 @@ int drm_mode_getfb(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB);
if (!obj) {
ret = -EINVAL;
@@ -2523,7 +2523,7 @@ int drm_mode_getfb(struct drm_device *dev,
fb->funcs->create_handle(fb, file_priv, &r->handle);
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -2542,7 +2542,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB);
if (!obj) {
ret = -EINVAL;
@@ -2597,7 +2597,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
out_err2:
kfree(clips);
out_err1:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -2620,11 +2620,11 @@ void drm_fb_release(struct drm_device *dev, struct drm_file *priv)
{
struct drm_framebuffer *fb, *tfb;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
list_for_each_entry_safe(fb, tfb, &priv->fbs, filp_head) {
drm_framebuffer_remove(fb);
}
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
}
/**
@@ -2740,7 +2740,7 @@ int drm_mode_attachmode_ioctl(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, mode_cmd->connector_id, DRM_MODE_OBJECT_CONNECTOR);
if (!obj) {
@@ -2764,7 +2764,7 @@ int drm_mode_attachmode_ioctl(struct drm_device *dev,
drm_mode_attachmode(dev, connector, mode);
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -2794,7 +2794,7 @@ int drm_mode_detachmode_ioctl(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, mode_cmd->connector_id, DRM_MODE_OBJECT_CONNECTOR);
if (!obj) {
@@ -2811,7 +2811,7 @@ int drm_mode_detachmode_ioctl(struct drm_device *dev,
ret = drm_mode_detachmode(dev, connector, &mode);
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -3057,7 +3057,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, out_resp->prop_id, DRM_MODE_OBJECT_PROPERTY);
if (!obj) {
ret = -EINVAL;
@@ -3142,7 +3142,7 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
out_resp->count_enum_blobs = blob_count;
}
done:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -3193,7 +3193,7 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, out_resp->blob_id, DRM_MODE_OBJECT_BLOB);
if (!obj) {
ret = -EINVAL;
@@ -3211,7 +3211,7 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
out_resp->length = blob->length;
done:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -3353,7 +3353,7 @@ int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, arg->obj_id, arg->obj_type);
if (!obj) {
@@ -3392,7 +3392,7 @@ int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
}
arg->count_props = props_count;
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -3409,7 +3409,7 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
arg_obj = drm_mode_object_find(dev, arg->obj_id, arg->obj_type);
if (!arg_obj)
@@ -3447,7 +3447,7 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
}
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -3509,7 +3509,7 @@ int drm_mode_gamma_set_ioctl(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, crtc_lut->crtc_id, DRM_MODE_OBJECT_CRTC);
if (!obj) {
ret = -EINVAL;
@@ -3553,7 +3553,7 @@ int drm_mode_gamma_set_ioctl(struct drm_device *dev,
crtc->funcs->gamma_set(crtc, r_base, g_base, b_base, 0, crtc->gamma_size);
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -3571,7 +3571,7 @@ int drm_mode_gamma_get_ioctl(struct drm_device *dev,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, crtc_lut->crtc_id, DRM_MODE_OBJECT_CRTC);
if (!obj) {
ret = -EINVAL;
@@ -3607,7 +3607,7 @@ int drm_mode_gamma_get_ioctl(struct drm_device *dev,
goto out;
}
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -3630,7 +3630,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
if (page_flip->flags & DRM_MODE_PAGE_FLIP_ASYNC)
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, page_flip->crtc_id, DRM_MODE_OBJECT_CRTC);
if (!obj)
goto out;
@@ -3711,7 +3711,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
}
out:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
diff --git a/sys/dev/pci/drm/drm_crtc.h b/sys/dev/pci/drm/drm_crtc.h
index 0cd9001cd87..2ad7a148884 100644
--- a/sys/dev/pci/drm/drm_crtc.h
+++ b/sys/dev/pci/drm/drm_crtc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_crtc.h,v 1.2 2013/10/29 06:30:57 jsg Exp $ */
+/* $OpenBSD: drm_crtc.h,v 1.3 2015/02/10 03:39:41 jsg Exp $ */
/*
* Copyright © 2006 Keith Packard
* Copyright © 2007-2008 Dave Airlie
@@ -768,7 +768,7 @@ struct drm_mode_group {
* global restrictions are also here, e.g. dimension restrictions.
*/
struct drm_mode_config {
- struct rwlock rwl; /* protects configuration (mode lists etc.) */
+ struct rwlock mutex; /* protects configuration (mode lists etc.) */
struct rwlock idr_rwl; /* for IDR management */
SPLAY_HEAD(drm_mode_tree, drm_mode_handle) mode_tree; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */
uint32_t mode_obj_id;
diff --git a/sys/dev/pci/drm/drm_crtc_helper.c b/sys/dev/pci/drm/drm_crtc_helper.c
index a8f1be0ab10..a4af3a19fb2 100644
--- a/sys/dev/pci/drm/drm_crtc_helper.c
+++ b/sys/dev/pci/drm/drm_crtc_helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_crtc_helper.c,v 1.8 2015/01/27 03:17:36 dlg Exp $ */
+/* $OpenBSD: drm_crtc_helper.c,v 1.9 2015/02/10 03:39:41 jsg Exp $ */
/*
* Copyright (c) 2006-2008 Intel Corporation
* Copyright (c) 2007 Dave Airlie <airlied@linux.ie>
@@ -977,7 +977,7 @@ static void drm_output_poll_execute(void *arg1)
if (!drm_kms_helper_poll)
return;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
/* Ignore forced connectors. */
@@ -1008,7 +1008,7 @@ static void drm_output_poll_execute(void *arg1)
}
}
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
if (changed)
drm_kms_helper_hotplug_event(dev);
@@ -1081,7 +1081,7 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
if (!dev->mode_config.poll_enabled)
return;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
/* Only handle HPD capable connectors. */
@@ -1099,7 +1099,7 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
changed = true;
}
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
if (changed)
drm_kms_helper_hotplug_event(dev);
diff --git a/sys/dev/pci/drm/drm_fb_helper.c b/sys/dev/pci/drm/drm_fb_helper.c
index 57e53cb149e..07071d40a57 100644
--- a/sys/dev/pci/drm/drm_fb_helper.c
+++ b/sys/dev/pci/drm/drm_fb_helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: drm_fb_helper.c,v 1.6 2014/03/09 11:07:18 jsg Exp $ */
+/* $OpenBSD: drm_fb_helper.c,v 1.7 2015/02/10 03:39:41 jsg Exp $ */
/*
* Copyright (c) 2006-2009 Red Hat Inc.
* Copyright (c) 2006-2008 Intel Corporation
@@ -334,7 +334,7 @@ void drm_fb_helper_dpms(struct drm_fb_helper *fb_helper, int dpms_mode)
/*
* For each CRTC in this fb, turn the connectors on/off.
*/
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
for (i = 0; i < fb_helper->crtc_count; i++) {
crtc = fb_helper->crtc_info[i].mode_set.crtc;
@@ -349,7 +349,7 @@ void drm_fb_helper_dpms(struct drm_fb_helper *fb_helper, int dpms_mode)
dev->mode_config.dpms_property, dpms_mode);
}
}
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
}
#if 0
@@ -1394,7 +1394,7 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
if (!fb_helper->fb)
return 0;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
if (crtc->fb)
crtcs_bound++;
@@ -1404,7 +1404,7 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
if (bound < crtcs_bound) {
fb_helper->delayed_hotplug = true;
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return 0;
}
DRM_DEBUG_KMS("\n");
@@ -1416,7 +1416,7 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
count = drm_fb_helper_probe_connector_modes(fb_helper, max_width,
max_height);
drm_setup_crtcs(fb_helper);
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return drm_fb_helper_single_fb_probe(fb_helper, bpp_sel);
}
diff --git a/sys/dev/pci/drm/i915/i915_irq.c b/sys/dev/pci/drm/i915/i915_irq.c
index 75c2de3b944..9ae017fe4cc 100644
--- a/sys/dev/pci/drm/i915/i915_irq.c
+++ b/sys/dev/pci/drm/i915/i915_irq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_irq.c,v 1.15 2015/02/10 01:39:32 jsg Exp $ */
+/* $OpenBSD: i915_irq.c,v 1.16 2015/02/10 03:39:41 jsg Exp $ */
/* i915_irq.c -- IRQ support for the I915 -*- linux-c -*-
*/
/*
@@ -285,14 +285,14 @@ static void i915_hotplug_work_func(void *arg1)
struct drm_mode_config *mode_config = &dev->mode_config;
struct intel_encoder *encoder;
- rw_enter_write(&mode_config->rwl);
+ mutex_lock(&mode_config->mutex);
DRM_DEBUG_KMS("running encoder hotplug functions\n");
list_for_each_entry(encoder, &mode_config->encoder_list, base.head)
if (encoder->hot_plug)
encoder->hot_plug(encoder);
- rw_exit_write(&mode_config->rwl);
+ mutex_unlock(&mode_config->mutex);
/* Just fire off a uevent and let userspace tell us what to do */
drm_helper_hpd_irq_event(dev);
diff --git a/sys/dev/pci/drm/i915/intel_dp.c b/sys/dev/pci/drm/i915/intel_dp.c
index fa28a84e327..a152d04827b 100644
--- a/sys/dev/pci/drm/i915/intel_dp.c
+++ b/sys/dev/pci/drm/i915/intel_dp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_dp.c,v 1.21 2015/01/27 03:17:36 dlg Exp $ */
+/* $OpenBSD: intel_dp.c,v 1.22 2015/02/10 03:39:41 jsg Exp $ */
/*
* Copyright © 2008 Intel Corporation
*
@@ -1114,9 +1114,9 @@ static void ironlake_panel_vdd_work(void *arg1)
struct intel_dp *intel_dp = arg1;
struct drm_device *dev = intel_dp_to_dev(intel_dp);
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
ironlake_panel_vdd_off_sync(intel_dp);
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
}
static void
diff --git a/sys/dev/pci/drm/i915/intel_fb.c b/sys/dev/pci/drm/i915/intel_fb.c
index 9a349e85de5..e06af785015 100644
--- a/sys/dev/pci/drm/i915/intel_fb.c
+++ b/sys/dev/pci/drm/i915/intel_fb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_fb.c,v 1.11 2015/02/10 01:39:32 jsg Exp $ */
+/* $OpenBSD: intel_fb.c,v 1.12 2015/02/10 03:39:41 jsg Exp $ */
/*
* Copyright © 2007 David Airlie
*
@@ -292,7 +292,7 @@ void intel_fb_restore_mode(struct drm_device *dev)
struct drm_mode_config *config = &dev->mode_config;
struct drm_plane *plane;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
ret = drm_fb_helper_restore_fbdev_mode(&dev_priv->fbdev->helper);
if (ret)
@@ -302,5 +302,5 @@ void intel_fb_restore_mode(struct drm_device *dev)
list_for_each_entry(plane, &config->plane_list, head)
plane->funcs->disable_plane(plane);
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
}
diff --git a/sys/dev/pci/drm/i915/intel_lvds.c b/sys/dev/pci/drm/i915/intel_lvds.c
index 6c18e639ef4..e400c8ddc45 100644
--- a/sys/dev/pci/drm/i915/intel_lvds.c
+++ b/sys/dev/pci/drm/i915/intel_lvds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_lvds.c,v 1.11 2014/01/22 22:33:24 jsg Exp $ */
+/* $OpenBSD: intel_lvds.c,v 1.12 2015/02/10 03:39:41 jsg Exp $ */
/*
* Copyright © 2006-2007 Intel Corporation
* Copyright (c) 2006 Dave Airlie <airlied@linux.ie>
@@ -542,9 +542,9 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
dev_priv->modeset_on_lid = 0;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
intel_modeset_setup_hw_state(dev, true);
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return NOTIFY_OK;
}
diff --git a/sys/dev/pci/drm/i915/intel_overlay.c b/sys/dev/pci/drm/i915/intel_overlay.c
index 69a01cf2315..55efee12602 100644
--- a/sys/dev/pci/drm/i915/intel_overlay.c
+++ b/sys/dev/pci/drm/i915/intel_overlay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_overlay.c,v 1.10 2015/02/10 01:39:32 jsg Exp $ */
+/* $OpenBSD: intel_overlay.c,v 1.11 2015/02/10 03:39:41 jsg Exp $ */
/*
* Copyright © 2009
*
@@ -710,7 +710,7 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
#ifdef notyet
BUG_ON(!mutex_is_locked(&dev->struct_mutex));
#endif
- rw_assert_wrlock(&dev->mode_config.rwl);
+ rw_assert_wrlock(&dev->mode_config.mutex);
BUG_ON(!overlay);
ret = intel_overlay_release_old_vid(overlay);
@@ -817,7 +817,7 @@ int intel_overlay_switch_off(struct intel_overlay *overlay)
#ifdef notyet
BUG_ON(!mutex_is_locked(&dev->struct_mutex));
#endif
- rw_assert_wrlock(&dev->mode_config.rwl);
+ rw_assert_wrlock(&dev->mode_config.mutex);
ret = intel_overlay_recover_from_interrupt(overlay);
if (ret != 0)
@@ -1069,13 +1069,13 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
}
if (!(put_image_rec->flags & I915_OVERLAY_ENABLE)) {
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
mutex_lock(&dev->struct_mutex);
ret = intel_overlay_switch_off(overlay);
mutex_unlock(&dev->struct_mutex);
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -1099,7 +1099,7 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
goto out_free;
}
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
mutex_lock(&dev->struct_mutex);
if (new_bo->tiling_mode) {
@@ -1181,7 +1181,7 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
goto out_unlock;
mutex_unlock(&dev->struct_mutex);
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
kfree(params);
@@ -1189,7 +1189,7 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
out_unlock:
mutex_unlock(&dev->struct_mutex);
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
drm_gem_object_unreference_unlocked(&new_bo->base);
out_free:
kfree(params);
@@ -1264,7 +1264,7 @@ int intel_overlay_attrs(struct drm_device *dev, void *data,
return -ENODEV;
}
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
mutex_lock(&dev->struct_mutex);
ret = -EINVAL;
@@ -1330,7 +1330,7 @@ int intel_overlay_attrs(struct drm_device *dev, void *data,
ret = 0;
out_unlock:
mutex_unlock(&dev->struct_mutex);
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
diff --git a/sys/dev/pci/drm/i915/intel_sprite.c b/sys/dev/pci/drm/i915/intel_sprite.c
index d61caf0e5bd..906c669709f 100644
--- a/sys/dev/pci/drm/i915/intel_sprite.c
+++ b/sys/dev/pci/drm/i915/intel_sprite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intel_sprite.c,v 1.5 2015/02/10 01:39:32 jsg Exp $ */
+/* $OpenBSD: intel_sprite.c,v 1.6 2015/02/10 03:39:41 jsg Exp $ */
/*
* Copyright © 2011 Intel Corporation
*
@@ -594,7 +594,7 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
if ((set->flags & (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE))
return -EINVAL;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, set->plane_id, DRM_MODE_OBJECT_PLANE);
if (!obj) {
@@ -607,7 +607,7 @@ int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
ret = intel_plane->update_colorkey(plane, set);
out_unlock:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}
@@ -623,7 +623,7 @@ int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -ENODEV;
- rw_enter_write(&dev->mode_config.rwl);
+ mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, get->plane_id, DRM_MODE_OBJECT_PLANE);
if (!obj) {
@@ -636,7 +636,7 @@ int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
intel_plane->get_colorkey(plane, get);
out_unlock:
- rw_exit_write(&dev->mode_config.rwl);
+ mutex_unlock(&dev->mode_config.mutex);
return ret;
}