diff options
| author | Dave Airlie <airlied@redhat.com> | 2025-06-18 08:09:27 +1000 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2025-06-18 08:09:35 +1000 |
| commit | 45215c589e7f22641e2fc6f518bcbead71d90f9c (patch) | |
| tree | 1faca88e4993230babcf5b95d590d3e5e0b14f2b /drivers/gpu/drm/drm_auth.c | |
| parent | e04c78d86a9699d136910cfc0bdcf01087e3267e (diff) | |
| parent | c5b4393c5492555e35c08677a326c9c53b275abd (diff) | |
Merge tag 'drm-misc-next-2025-06-12' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-next
drm-misc-next for 6.17:
UAPI Changes:
Cross-subsystem Changes:
Core Changes:
- atomic-helpers: Tune the enable / disable sequence
- bridge: Add destroy hook
- color management: Add helpers for hardware gamma LUT handling
- HDMI: Add CEC handling, YUV420 output support
- sched: tracing improvements
Driver Changes:
- hyperv: Move out of simple-kms, drm_panic support
- i915: drm_panel_follower support
- imx: Add IMX8qxq Display Controller Support
- lima: Add Rockchip RK3528 GPU Support
- nouveau: fence handling cleanup
- panfrost: Add BO labeling, 64-bit registers access
- qaic: Add RAS Support
- rz-du: Add RZ/V2H(P) Support, MIPI-DSI DCS Support
- sun4i: Add H616 Support
- tidss: Add TI AM62L Support
- vkms: YUV and R* formats support
- bridges:
- Switched to reference counted drm_bridge allocations
- panels:
- Switched to reference counted drm_panel allocations
- Add support for fwnode-based panel lookup
- himax-hx8394: Support for Huiling hl055fhv028c
- ilitek-ili9881c: Support for 7" Raspberry Pi 720x1280
- panel-edp: Support for KDC KD116N3730A05, N160JCE-ELL CMN,
- panel-simple: Support for AUO P238HAN01
- st7701: Support for Winstar wf40eswaa6mnn0
- visionox-rm69299: Support for rm69299-shift
- New panels: Renesas R61307, Renesas R69328
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maxime Ripard <mripard@redhat.com>
Link: https://lore.kernel.org/r/20250612-coucal-of-impossible-cleaning-a5eecf@houat
Diffstat (limited to 'drivers/gpu/drm/drm_auth.c')
| -rw-r--r-- | drivers/gpu/drm/drm_auth.c | 64 |
1 files changed, 23 insertions, 41 deletions
diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index 22aa015df387..d6bf605b4b90 100644 --- a/drivers/gpu/drm/drm_auth.c +++ b/drivers/gpu/drm/drm_auth.c @@ -95,7 +95,7 @@ int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv) struct drm_auth *auth = data; int ret = 0; - mutex_lock(&dev->master_mutex); + guard(mutex)(&dev->master_mutex); if (!file_priv->magic) { ret = idr_alloc(&file_priv->master->magic_map, file_priv, 1, 0, GFP_KERNEL); @@ -103,7 +103,6 @@ int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv) file_priv->magic = ret; } auth->magic = file_priv->magic; - mutex_unlock(&dev->master_mutex); drm_dbg_core(dev, "%u\n", auth->magic); @@ -118,13 +117,12 @@ int drm_authmagic(struct drm_device *dev, void *data, drm_dbg_core(dev, "%u\n", auth->magic); - mutex_lock(&dev->master_mutex); + guard(mutex)(&dev->master_mutex); file = idr_find(&file_priv->master->magic_map, auth->magic); if (file) { file->authenticated = 1; idr_replace(&file_priv->master->magic_map, NULL, auth->magic); } - mutex_unlock(&dev->master_mutex); return file ? 0 : -EINVAL; } @@ -248,41 +246,33 @@ int drm_setmaster_ioctl(struct drm_device *dev, void *data, { int ret; - mutex_lock(&dev->master_mutex); + guard(mutex)(&dev->master_mutex); ret = drm_master_check_perm(dev, file_priv); if (ret) - goto out_unlock; + return ret; if (drm_is_current_master_locked(file_priv)) - goto out_unlock; + return ret; - if (dev->master) { - ret = -EBUSY; - goto out_unlock; - } + if (dev->master) + return -EBUSY; - if (!file_priv->master) { - ret = -EINVAL; - goto out_unlock; - } + if (!file_priv->master) + return -EINVAL; - if (!file_priv->is_master) { - ret = drm_new_set_master(dev, file_priv); - goto out_unlock; - } + if (!file_priv->is_master) + return drm_new_set_master(dev, file_priv); if (file_priv->master->lessor != NULL) { drm_dbg_lease(dev, "Attempt to set lessee %d as master\n", file_priv->master->lessee_id); - ret = -EINVAL; - goto out_unlock; + return -EINVAL; } drm_set_master(dev, file_priv, false); -out_unlock: - mutex_unlock(&dev->master_mutex); + return ret; } @@ -299,33 +289,27 @@ int drm_dropmaster_ioctl(struct drm_device *dev, void *data, { int ret; - mutex_lock(&dev->master_mutex); + guard(mutex)(&dev->master_mutex); ret = drm_master_check_perm(dev, file_priv); if (ret) - goto out_unlock; + return ret; - if (!drm_is_current_master_locked(file_priv)) { - ret = -EINVAL; - goto out_unlock; - } + if (!drm_is_current_master_locked(file_priv)) + return -EINVAL; - if (!dev->master) { - ret = -EINVAL; - goto out_unlock; - } + if (!dev->master) + return -EINVAL; if (file_priv->master->lessor != NULL) { drm_dbg_lease(dev, "Attempt to drop lessee %d as master\n", file_priv->master->lessee_id); - ret = -EINVAL; - goto out_unlock; + return -EINVAL; } drm_drop_master(dev, file_priv); -out_unlock: - mutex_unlock(&dev->master_mutex); + return ret; } @@ -337,7 +321,7 @@ int drm_master_open(struct drm_file *file_priv) /* if there is no current master make this fd it, but do not create * any master object for render clients */ - mutex_lock(&dev->master_mutex); + guard(mutex)(&dev->master_mutex); if (!dev->master) { ret = drm_new_set_master(dev, file_priv); } else { @@ -345,7 +329,6 @@ int drm_master_open(struct drm_file *file_priv) file_priv->master = drm_master_get(dev->master); spin_unlock(&file_priv->master_lookup_lock); } - mutex_unlock(&dev->master_mutex); return ret; } @@ -355,7 +338,7 @@ void drm_master_release(struct drm_file *file_priv) struct drm_device *dev = file_priv->minor->dev; struct drm_master *master; - mutex_lock(&dev->master_mutex); + guard(mutex)(&dev->master_mutex); master = file_priv->master; if (file_priv->magic) idr_remove(&file_priv->master->magic_map, file_priv->magic); @@ -376,7 +359,6 @@ out: /* drop the master reference held by the file priv */ if (file_priv->master) drm_master_put(&file_priv->master); - mutex_unlock(&dev->master_mutex); } /** |
