#include <drm/drm_edid.h>
#include <drm/i915_component.h>
+#include <drm/drm_drv.h>
#include "i915_drv.h"
#include "intel_atomic.h"
{
struct i915_audio_component *acomp = data;
struct drm_i915_private *dev_priv = kdev_to_i915(i915_kdev);
- int i;
+ struct drm_modeset_acquire_ctx ctx;
+ int i, ret;
if (drm_WARN_ON(&dev_priv->drm, acomp->base.ops || acomp->base.dev))
return -EEXIST;
DL_FLAG_STATELESS)))
return -ENOMEM;
- drm_modeset_lock_all(&dev_priv->drm);
+ DRM_MODESET_LOCK_ALL_BEGIN((&dev_priv->drm), ctx, 0, ret);
acomp->base.ops = &i915_audio_component_ops;
acomp->base.dev = i915_kdev;
BUILD_BUG_ON(MAX_PORTS != I915_MAX_PORTS);
for (i = 0; i < ARRAY_SIZE(acomp->aud_sample_rate); i++)
acomp->aud_sample_rate[i] = 0;
dev_priv->audio_component = acomp;
- drm_modeset_unlock_all(&dev_priv->drm);
+ DRM_MODESET_LOCK_ALL_END((&dev_priv->drm), ctx, ret);
- return 0;
+ return ret;
}
static void i915_audio_component_unbind(struct device *i915_kdev,
{
struct i915_audio_component *acomp = data;
struct drm_i915_private *dev_priv = kdev_to_i915(i915_kdev);
+ struct drm_modeset_acquire_ctx ctx;
+ int ret;
- drm_modeset_lock_all(&dev_priv->drm);
+ DRM_MODESET_LOCK_ALL_BEGIN((&dev_priv->drm), ctx, 0, ret);
acomp->base.ops = NULL;
acomp->base.dev = NULL;
dev_priv->audio_component = NULL;
- drm_modeset_unlock_all(&dev_priv->drm);
+ DRM_MODESET_LOCK_ALL_END((&dev_priv->drm), ctx, ret);
device_link_remove(hda_kdev, i915_kdev);
int intel_modeset_init_nogem(struct drm_i915_private *i915)
{
struct drm_device *dev = &i915->drm;
+ struct drm_modeset_acquire_ctx ctx;
enum pipe pipe;
struct intel_crtc *crtc;
int ret;
intel_vga_disable(i915);
intel_setup_outputs(i915);
- drm_modeset_lock_all(dev);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
intel_modeset_setup_hw_state(dev, dev->mode_config.acquire_ctx);
- drm_modeset_unlock_all(dev);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
for_each_intel_crtc(dev, crtc) {
struct intel_initial_plane_config plane_config = {};
#include <drm/drm_debugfs.h>
#include <drm/drm_fourcc.h>
+#include <drm/drm_drv.h>
#include "i915_debugfs.h"
#include "intel_display_debugfs.h"
struct intel_crtc *crtc;
struct drm_connector *connector;
struct drm_connector_list_iter conn_iter;
+ struct drm_modeset_acquire_ctx ctx;
intel_wakeref_t wakeref;
+ int ret;
wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
- drm_modeset_lock_all(dev);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
seq_printf(m, "CRTC info\n");
seq_printf(m, "---------\n");
intel_connector_info(m, connector);
drm_connector_list_iter_end(&conn_iter);
- drm_modeset_unlock_all(dev);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref);
- return 0;
+ return ret;
}
static int i915_shared_dplls_info(struct seq_file *m, void *unused)
{
struct drm_i915_private *dev_priv = node_to_i915(m->private);
struct drm_device *dev = &dev_priv->drm;
- int i;
+ struct drm_modeset_acquire_ctx ctx;
+ int i, ret;
- drm_modeset_lock_all(dev);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
seq_printf(m, "PLL refclks: non-SSC: %d kHz, SSC: %d kHz\n",
dev_priv->dpll.ref_clks.nssc,
seq_printf(m, " mg_pll_tdc_coldst_bias: 0x%08x\n",
pll->state.hw_state.mg_pll_tdc_coldst_bias);
}
- drm_modeset_unlock_all(dev);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
- return 0;
+ return ret;
}
static int i915_ipc_status_show(struct seq_file *m, void *data)
{
struct drm_i915_private *dev_priv = node_to_i915(m->private);
struct drm_device *dev = &dev_priv->drm;
+ struct drm_modeset_acquire_ctx ctx;
struct skl_ddb_entry *entry;
struct intel_crtc *crtc;
+ int ret;
if (DISPLAY_VER(dev_priv) < 9)
return -ENODEV;
- drm_modeset_lock_all(dev);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
seq_printf(m, "%-15s%8s%8s%8s\n", "", "Start", "End", "Size");
entry->end, skl_ddb_entry_size(entry));
}
- drm_modeset_unlock_all(dev);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
- return 0;
+ return ret;
}
static void drrs_status_per_crtc(struct seq_file *m,
{
struct drm_i915_private *dev_priv = node_to_i915(m->private);
struct drm_device *dev = &dev_priv->drm;
+ struct drm_modeset_acquire_ctx ctx;
struct intel_crtc *crtc;
int active_crtc_cnt = 0;
+ int ret;
- drm_modeset_lock_all(dev);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
for_each_intel_crtc(dev, crtc) {
if (crtc->base.state->active) {
active_crtc_cnt++;
drrs_status_per_crtc(m, dev, crtc);
}
}
- drm_modeset_unlock_all(dev);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
if (!active_crtc_cnt)
seq_puts(m, "No active crtc found\n");
{
struct drm_i915_private *dev_priv = m->private;
struct drm_device *dev = &dev_priv->drm;
+ struct drm_modeset_acquire_ctx ctx;
int level;
int num_levels;
+ int ret;
if (IS_CHERRYVIEW(dev_priv))
num_levels = 3;
else
num_levels = ilk_wm_max_level(dev_priv) + 1;
- drm_modeset_lock_all(dev);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
for (level = 0; level < num_levels; level++) {
unsigned int latency = wm[level];
level, wm[level], latency / 10, latency % 10);
}
- drm_modeset_unlock_all(dev);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
}
static int pri_wm_latency_show(struct seq_file *m, void *data)
struct seq_file *m = file->private_data;
struct drm_i915_private *dev_priv = m->private;
struct drm_device *dev = &dev_priv->drm;
+ struct drm_modeset_acquire_ctx ctx;
u16 new[8] = { 0 };
int num_levels;
int level;
if (ret != num_levels)
return -EINVAL;
- drm_modeset_lock_all(dev);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
for (level = 0; level < num_levels; level++)
wm[level] = new[level];
- drm_modeset_unlock_all(dev);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
+
+ if (ret)
+ return ret;
return len;
}
*/
#include <drm/drm_fourcc.h>
+#include <drm/drm_drv.h>
#include "gem/i915_gem_pm.h"
#include "gt/intel_gpu_commands.h"
{
struct drm_intel_overlay_attrs *attrs = data;
struct drm_i915_private *dev_priv = to_i915(dev);
+ struct drm_modeset_acquire_ctx ctx;
struct intel_overlay *overlay;
int ret;
return -ENODEV;
}
- drm_modeset_lock_all(dev);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
ret = -EINVAL;
if (!(attrs->flags & I915_OVERLAY_UPDATE_ATTRS)) {
ret = 0;
out_unlock:
- drm_modeset_unlock_all(dev);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
return ret;
}
#include <linux/debugfs.h>
#include <linux/seq_file.h>
+#include <drm/drm_drv.h>
+
#include "intel_atomic.h"
#include "intel_de.h"
#include "intel_display_types.h"
enum intel_pipe_crc_source *source)
{
struct drm_device *dev = &dev_priv->drm;
+ struct drm_modeset_acquire_ctx ctx;
struct intel_encoder *encoder;
struct intel_crtc *crtc;
struct intel_digital_port *dig_port;
*source = INTEL_PIPE_CRC_SOURCE_PIPE;
- drm_modeset_lock_all(dev);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
for_each_intel_encoder(dev, encoder) {
if (!encoder->base.crtc)
continue;
break;
}
}
- drm_modeset_unlock_all(dev);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
return ret;
}
#include <drm/drm_ioctl.h>
#include <drm/drm_managed.h>
#include <drm/drm_probe_helper.h>
+#include <drm/drm_drv.h>
#include "display/intel_acpi.h"
#include "display/intel_bw.h"
static void intel_suspend_encoders(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = &dev_priv->drm;
+ struct drm_modeset_acquire_ctx ctx;
struct intel_encoder *encoder;
+ int ret;
if (!HAS_DISPLAY(dev_priv))
return;
- drm_modeset_lock_all(dev);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
for_each_intel_encoder(dev, encoder)
if (encoder->suspend)
encoder->suspend(encoder);
- drm_modeset_unlock_all(dev);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
}
static void intel_shutdown_encoders(struct drm_i915_private *dev_priv)
{
struct drm_device *dev = &dev_priv->drm;
+ struct drm_modeset_acquire_ctx ctx;
struct intel_encoder *encoder;
+ int ret;
if (!HAS_DISPLAY(dev_priv))
return;
- drm_modeset_lock_all(dev);
+ DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret);
for_each_intel_encoder(dev, encoder)
if (encoder->shutdown)
encoder->shutdown(encoder);
- drm_modeset_unlock_all(dev);
+ DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
}
void i915_driver_shutdown(struct drm_i915_private *i915)