Commit 58009c25 authored by Maxime Ripard's avatar Maxime Ripard

drm/vc4: hdmi: Constify drm_display_mode

We don't modify the drm_display_mode pointer we have in the driver in
most places, so let's make them const.
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20220829134731.213478-2-maxime@cerno.tech
parent b78e5d83
...@@ -335,7 +335,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) ...@@ -335,7 +335,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector)
if (vc4_hdmi->disable_4kp60) { if (vc4_hdmi->disable_4kp60) {
struct drm_device *drm = connector->dev; struct drm_device *drm = connector->dev;
struct drm_display_mode *mode; const struct drm_display_mode *mode;
list_for_each_entry(mode, &connector->probed_modes, head) { list_for_each_entry(mode, &connector->probed_modes, head) {
if (vc4_hdmi_mode_needs_scrambling(mode, 8, VC4_HDMI_OUTPUT_RGB)) { if (vc4_hdmi_mode_needs_scrambling(mode, 8, VC4_HDMI_OUTPUT_RGB)) {
...@@ -709,7 +709,7 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) ...@@ -709,7 +709,7 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder)
} }
static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder, static bool vc4_hdmi_supports_scrambling(struct drm_encoder *encoder,
struct drm_display_mode *mode) const struct drm_display_mode *mode)
{ {
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
struct drm_display_info *display = &vc4_hdmi->connector.display_info; struct drm_display_info *display = &vc4_hdmi->connector.display_info;
...@@ -732,7 +732,7 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder) ...@@ -732,7 +732,7 @@ static void vc4_hdmi_enable_scrambling(struct drm_encoder *encoder)
{ {
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
struct drm_device *drm = vc4_hdmi->connector.dev; struct drm_device *drm = vc4_hdmi->connector.dev;
struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
unsigned long flags; unsigned long flags;
int idx; int idx;
...@@ -1077,7 +1077,7 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi, ...@@ -1077,7 +1077,7 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi,
struct drm_connector_state *state, struct drm_connector_state *state,
struct drm_display_mode *mode) const struct drm_display_mode *mode)
{ {
struct drm_device *drm = vc4_hdmi->connector.dev; struct drm_device *drm = vc4_hdmi->connector.dev;
bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC;
...@@ -1141,7 +1141,7 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, ...@@ -1141,7 +1141,7 @@ static void vc4_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi,
static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi, static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi,
struct drm_connector_state *state, struct drm_connector_state *state,
struct drm_display_mode *mode) const struct drm_display_mode *mode)
{ {
struct drm_device *drm = vc4_hdmi->connector.dev; struct drm_device *drm = vc4_hdmi->connector.dev;
const struct vc4_hdmi_connector_state *vc4_state = const struct vc4_hdmi_connector_state *vc4_state =
...@@ -1303,7 +1303,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder, ...@@ -1303,7 +1303,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
drm_atomic_get_new_connector_state(state, connector); drm_atomic_get_new_connector_state(state, connector);
struct vc4_hdmi_connector_state *vc4_conn_state = struct vc4_hdmi_connector_state *vc4_conn_state =
conn_state_to_vc4_hdmi_conn_state(conn_state); conn_state_to_vc4_hdmi_conn_state(conn_state);
struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
unsigned long tmds_char_rate = vc4_conn_state->tmds_char_rate; unsigned long tmds_char_rate = vc4_conn_state->tmds_char_rate;
unsigned long bvb_rate, hsm_rate; unsigned long bvb_rate, hsm_rate;
unsigned long flags; unsigned long flags;
...@@ -1416,7 +1416,7 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder, ...@@ -1416,7 +1416,7 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct drm_encoder *encoder,
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
struct drm_device *drm = vc4_hdmi->connector.dev; struct drm_device *drm = vc4_hdmi->connector.dev;
struct drm_connector *connector = &vc4_hdmi->connector; struct drm_connector *connector = &vc4_hdmi->connector;
struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
struct drm_connector_state *conn_state = struct drm_connector_state *conn_state =
drm_atomic_get_new_connector_state(state, connector); drm_atomic_get_new_connector_state(state, connector);
unsigned long flags; unsigned long flags;
...@@ -1445,7 +1445,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder, ...@@ -1445,7 +1445,7 @@ static void vc4_hdmi_encoder_post_crtc_enable(struct drm_encoder *encoder,
{ {
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
struct drm_device *drm = vc4_hdmi->connector.dev; struct drm_device *drm = vc4_hdmi->connector.dev;
struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode; const struct drm_display_mode *mode = &vc4_hdmi->saved_adjusted_mode;
struct drm_display_info *display = &vc4_hdmi->connector.display_info; struct drm_display_info *display = &vc4_hdmi->connector.display_info;
bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC; bool hsync_pos = mode->flags & DRM_MODE_FLAG_PHSYNC;
bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC; bool vsync_pos = mode->flags & DRM_MODE_FLAG_PVSYNC;
......
...@@ -72,7 +72,7 @@ struct vc4_hdmi_variant { ...@@ -72,7 +72,7 @@ struct vc4_hdmi_variant {
/* Callback to configure the video timings in the HDMI block */ /* Callback to configure the video timings in the HDMI block */
void (*set_timings)(struct vc4_hdmi *vc4_hdmi, void (*set_timings)(struct vc4_hdmi *vc4_hdmi,
struct drm_connector_state *state, struct drm_connector_state *state,
struct drm_display_mode *mode); const struct drm_display_mode *mode);
/* Callback to initialize the PHY according to the connector state */ /* Callback to initialize the PHY according to the connector state */
void (*phy_init)(struct vc4_hdmi *vc4_hdmi, void (*phy_init)(struct vc4_hdmi *vc4_hdmi,
......
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