Skip to content

Commit a4e7112

Browse files
committed
drm/i915: Constify remainder of the state checker
Mark the remaining crtc states used by the state checker as const. There is no reason to ever mutate them here. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-10-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
1 parent 335aa75 commit a4e7112

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

drivers/gpu/drm/i915/display/intel_modeset_verify.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
* Cross check the actual hw state with our own modeset state tracking (and its
2424
* internal consistency).
2525
*/
26-
static void intel_connector_verify_state(struct intel_crtc_state *crtc_state,
27-
struct drm_connector_state *conn_state)
26+
static void intel_connector_verify_state(const struct intel_crtc_state *crtc_state,
27+
const struct drm_connector_state *conn_state)
2828
{
2929
struct intel_connector *connector = to_intel_connector(conn_state->connector);
3030
struct drm_i915_private *i915 = to_i915(connector->base.dev);
@@ -66,12 +66,12 @@ verify_connector_state(struct intel_atomic_state *state,
6666
struct intel_crtc *crtc)
6767
{
6868
struct drm_connector *connector;
69-
struct drm_connector_state *new_conn_state;
69+
const struct drm_connector_state *new_conn_state;
7070
int i;
7171

7272
for_each_new_connector_in_state(&state->base, connector, new_conn_state, i) {
7373
struct drm_encoder *encoder = connector->encoder;
74-
struct intel_crtc_state *crtc_state = NULL;
74+
const struct intel_crtc_state *crtc_state = NULL;
7575

7676
if (new_conn_state->crtc != &crtc->base)
7777
continue;
@@ -110,7 +110,7 @@ verify_encoder_state(struct drm_i915_private *dev_priv, struct intel_atomic_stat
110110
{
111111
struct intel_encoder *encoder;
112112
struct drm_connector *connector;
113-
struct drm_connector_state *old_conn_state, *new_conn_state;
113+
const struct drm_connector_state *old_conn_state, *new_conn_state;
114114
int i;
115115

116116
for_each_intel_encoder(&dev_priv->drm, encoder) {
@@ -226,8 +226,8 @@ verify_crtc_state(struct intel_atomic_state *state,
226226

227227
void intel_modeset_verify_crtc(struct intel_crtc *crtc,
228228
struct intel_atomic_state *state,
229-
struct intel_crtc_state *old_crtc_state,
230-
struct intel_crtc_state *new_crtc_state)
229+
const struct intel_crtc_state *old_crtc_state,
230+
const struct intel_crtc_state *new_crtc_state)
231231
{
232232
if (!intel_crtc_needs_modeset(new_crtc_state) &&
233233
!intel_crtc_needs_fastset(new_crtc_state))

drivers/gpu/drm/i915/display/intel_modeset_verify.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ struct intel_crtc_state;
1313

1414
void intel_modeset_verify_crtc(struct intel_crtc *crtc,
1515
struct intel_atomic_state *state,
16-
struct intel_crtc_state *old_crtc_state,
17-
struct intel_crtc_state *new_crtc_state);
16+
const struct intel_crtc_state *old_crtc_state,
17+
const struct intel_crtc_state *new_crtc_state);
1818
void intel_modeset_verify_disabled(struct drm_i915_private *dev_priv,
1919
struct intel_atomic_state *state);
2020

0 commit comments

Comments
 (0)