Commit 6af0ffc0 authored by Jani Nikula's avatar Jani Nikula

drm/i915/display: move restore state and ctx under display sub-struct

Move display suspend/resume and display reset modeset state and ctx
members under drm_i915_private display sub-struct.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221109144209.3624739-4-jani.nikula@intel.com
parent e2925e19
...@@ -891,7 +891,7 @@ static bool gpu_reset_clobbers_display(struct drm_i915_private *dev_priv) ...@@ -891,7 +891,7 @@ static bool gpu_reset_clobbers_display(struct drm_i915_private *dev_priv)
void intel_display_prepare_reset(struct drm_i915_private *dev_priv) void intel_display_prepare_reset(struct drm_i915_private *dev_priv)
{ {
struct drm_modeset_acquire_ctx *ctx = &dev_priv->reset_ctx; struct drm_modeset_acquire_ctx *ctx = &dev_priv->display.restore.reset_ctx;
struct drm_atomic_state *state; struct drm_atomic_state *state;
int ret; int ret;
...@@ -947,13 +947,13 @@ void intel_display_prepare_reset(struct drm_i915_private *dev_priv) ...@@ -947,13 +947,13 @@ void intel_display_prepare_reset(struct drm_i915_private *dev_priv)
return; return;
} }
dev_priv->modeset_restore_state = state; dev_priv->display.restore.modeset_state = state;
state->acquire_ctx = ctx; state->acquire_ctx = ctx;
} }
void intel_display_finish_reset(struct drm_i915_private *i915) void intel_display_finish_reset(struct drm_i915_private *i915)
{ {
struct drm_modeset_acquire_ctx *ctx = &i915->reset_ctx; struct drm_modeset_acquire_ctx *ctx = &i915->display.restore.reset_ctx;
struct drm_atomic_state *state; struct drm_atomic_state *state;
int ret; int ret;
...@@ -964,7 +964,7 @@ void intel_display_finish_reset(struct drm_i915_private *i915) ...@@ -964,7 +964,7 @@ void intel_display_finish_reset(struct drm_i915_private *i915)
if (!test_bit(I915_RESET_MODESET, &to_gt(i915)->reset.flags)) if (!test_bit(I915_RESET_MODESET, &to_gt(i915)->reset.flags))
return; return;
state = fetch_and_zero(&i915->modeset_restore_state); state = fetch_and_zero(&i915->display.restore.modeset_state);
if (!state) if (!state)
goto unlock; goto unlock;
...@@ -2444,7 +2444,7 @@ int intel_display_suspend(struct drm_device *dev) ...@@ -2444,7 +2444,7 @@ int intel_display_suspend(struct drm_device *dev)
drm_err(&dev_priv->drm, "Suspending crtc's failed with %i\n", drm_err(&dev_priv->drm, "Suspending crtc's failed with %i\n",
ret); ret);
else else
dev_priv->modeset_restore_state = state; dev_priv->display.restore.modeset_state = state;
return ret; return ret;
} }
...@@ -8900,14 +8900,14 @@ void i830_disable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe) ...@@ -8900,14 +8900,14 @@ void i830_disable_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
void intel_display_resume(struct drm_device *dev) void intel_display_resume(struct drm_device *dev)
{ {
struct drm_i915_private *i915 = to_i915(dev); struct drm_i915_private *i915 = to_i915(dev);
struct drm_atomic_state *state = i915->modeset_restore_state; struct drm_atomic_state *state = i915->display.restore.modeset_state;
struct drm_modeset_acquire_ctx ctx; struct drm_modeset_acquire_ctx ctx;
int ret; int ret;
if (!HAS_DISPLAY(i915)) if (!HAS_DISPLAY(i915))
return; return;
i915->modeset_restore_state = NULL; i915->display.restore.modeset_state = NULL;
if (state) if (state)
state->acquire_ctx = &ctx; state->acquire_ctx = &ctx;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <drm/drm_connector.h> #include <drm/drm_connector.h>
#include <drm/drm_modeset_lock.h>
#include "intel_cdclk.h" #include "intel_cdclk.h"
#include "intel_display.h" #include "intel_display.h"
...@@ -410,6 +411,12 @@ struct intel_display { ...@@ -410,6 +411,12 @@ struct intel_display {
unsigned long mask; unsigned long mask;
} quirks; } quirks;
struct {
/* restore state for suspend/resume and display reset */
struct drm_atomic_state *modeset_state;
struct drm_modeset_acquire_ctx reset_ctx;
} restore;
struct { struct {
enum { enum {
I915_SAGV_UNKNOWN = 0, I915_SAGV_UNKNOWN = 0,
......
...@@ -287,9 +287,6 @@ struct drm_i915_private { ...@@ -287,9 +287,6 @@ struct drm_i915_private {
unsigned long gem_quirks; unsigned long gem_quirks;
struct drm_atomic_state *modeset_restore_state;
struct drm_modeset_acquire_ctx reset_ctx;
struct i915_gem_mm mm; struct i915_gem_mm mm;
bool mchbar_need_disable; bool mchbar_need_disable;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment