mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
drm/i915: Move struct_mutex to drm_i915_private
Move legacy BKL struct_mutex from drm_device to drm_i915_private, which is the last remaining user. Signed-off-by: Luiz Otavio Mello <luiz.mello@estudante.ufscar.br> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/20250908131518.36625-2-luiz.mello@estudante.ufscar.br Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
parent
f985e105ce
commit
86a9fe82e9
|
|
@ -697,7 +697,6 @@ static void drm_dev_init_release(struct drm_device *dev, void *res)
|
|||
mutex_destroy(&dev->master_mutex);
|
||||
mutex_destroy(&dev->clientlist_mutex);
|
||||
mutex_destroy(&dev->filelist_mutex);
|
||||
mutex_destroy(&dev->struct_mutex);
|
||||
}
|
||||
|
||||
static int drm_dev_init(struct drm_device *dev,
|
||||
|
|
@ -738,7 +737,6 @@ static int drm_dev_init(struct drm_device *dev,
|
|||
INIT_LIST_HEAD(&dev->vblank_event_list);
|
||||
|
||||
spin_lock_init(&dev->event_lock);
|
||||
mutex_init(&dev->struct_mutex);
|
||||
mutex_init(&dev->filelist_mutex);
|
||||
mutex_init(&dev->clientlist_mutex);
|
||||
mutex_init(&dev->master_mutex);
|
||||
|
|
|
|||
|
|
@ -678,7 +678,7 @@ int intel_guc_log_set_level(struct intel_guc_log *log, u32 level)
|
|||
if (level < GUC_LOG_LEVEL_DISABLED || level > GUC_LOG_LEVEL_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&i915->drm.struct_mutex);
|
||||
mutex_lock(&i915->struct_mutex);
|
||||
|
||||
if (log->level == level)
|
||||
goto out_unlock;
|
||||
|
|
@ -696,7 +696,7 @@ int intel_guc_log_set_level(struct intel_guc_log *log, u32 level)
|
|||
log->level = level;
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&i915->drm.struct_mutex);
|
||||
mutex_unlock(&i915->struct_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,6 +235,7 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
|
|||
|
||||
intel_sbi_init(display);
|
||||
vlv_iosf_sb_init(dev_priv);
|
||||
mutex_init(&dev_priv->struct_mutex);
|
||||
mutex_init(&dev_priv->sb_lock);
|
||||
|
||||
i915_memcpy_init_early(dev_priv);
|
||||
|
|
@ -293,6 +294,7 @@ static void i915_driver_late_release(struct drm_i915_private *dev_priv)
|
|||
i915_workqueues_cleanup(dev_priv);
|
||||
|
||||
mutex_destroy(&dev_priv->sb_lock);
|
||||
mutex_destroy(&dev_priv->struct_mutex);
|
||||
vlv_iosf_sb_fini(dev_priv);
|
||||
intel_sbi_fini(display);
|
||||
|
||||
|
|
|
|||
|
|
@ -224,6 +224,17 @@ struct drm_i915_private {
|
|||
|
||||
bool irqs_enabled;
|
||||
|
||||
/*
|
||||
* Currently, struct_mutex is only used by the i915 driver as a replacement
|
||||
* for BKL.
|
||||
*
|
||||
* For this reason, it is no longer part of struct drm_device.
|
||||
*/
|
||||
struct mutex struct_mutex;
|
||||
|
||||
/* LPT/WPT IOSF sideband protection */
|
||||
struct mutex sbi_lock;
|
||||
|
||||
/* VLV/CHV IOSF sideband */
|
||||
struct {
|
||||
struct mutex lock; /* protect sideband access */
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ static void ivb_parity_work(struct work_struct *work)
|
|||
* In order to prevent a get/put style interface, acquire struct mutex
|
||||
* any time we access those registers.
|
||||
*/
|
||||
mutex_lock(&dev_priv->drm.struct_mutex);
|
||||
mutex_lock(&dev_priv->struct_mutex);
|
||||
|
||||
/* If we've screwed up tracking, just let the interrupt fire again */
|
||||
if (drm_WARN_ON(&dev_priv->drm, !dev_priv->l3_parity.which_slice))
|
||||
|
|
@ -225,7 +225,7 @@ static void ivb_parity_work(struct work_struct *work)
|
|||
gen5_gt_enable_irq(gt, GT_PARITY_ERROR(dev_priv));
|
||||
spin_unlock_irq(gt->irq_lock);
|
||||
|
||||
mutex_unlock(&dev_priv->drm.struct_mutex);
|
||||
mutex_unlock(&dev_priv->struct_mutex);
|
||||
}
|
||||
|
||||
static irqreturn_t valleyview_irq_handler(int irq, void *arg)
|
||||
|
|
|
|||
|
|
@ -186,16 +186,6 @@ struct drm_device {
|
|||
/** @unique: Unique name of the device */
|
||||
char *unique;
|
||||
|
||||
/**
|
||||
* @struct_mutex:
|
||||
*
|
||||
* Lock for others (not &drm_minor.master and &drm_file.is_master)
|
||||
*
|
||||
* TODO: This lock used to be the BKL of the DRM subsystem. Move the
|
||||
* lock into i915, which is the only remaining user.
|
||||
*/
|
||||
struct mutex struct_mutex;
|
||||
|
||||
/**
|
||||
* @master_mutex:
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user