Skip to content

Commit e9b590c

Browse files
committed
drm/vc4: Convert vc4_dsi to use atomic enable/disable/mode_set.
The atomic calls are preferred as the non-atomic ones are deprecated. In preparation for conversion to a bridge, switch to the atomic calls. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 4b8b607 commit e9b590c

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

drivers/gpu/drm/vc4/vc4_dsi.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,8 @@ dsi_esc_timing(u32 ns)
792792
return DIV_ROUND_UP(ns, ESC_TIME_NS);
793793
}
794794

795-
static void vc4_dsi_encoder_disable(struct drm_encoder *encoder)
795+
static void vc4_dsi_encoder_disable(struct drm_encoder *encoder,
796+
struct drm_atomic_state *state)
796797
{
797798
struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
798799
struct vc4_dsi *dsi = vc4_encoder->dsi;
@@ -858,18 +859,19 @@ static bool vc4_dsi_encoder_mode_fixup(struct drm_encoder *encoder,
858859
}
859860

860861
static void vc4_dsi_encoder_mode_set(struct drm_encoder *encoder,
861-
struct drm_display_mode *user_mode,
862-
struct drm_display_mode *adjusted_mode)
862+
struct drm_crtc_state *crtc_state,
863+
struct drm_connector_state *conn_state)
863864
{
864865
struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
865866
struct vc4_dsi *dsi = vc4_encoder->dsi;
866867
struct device *dev = &dsi->pdev->dev;
868+
const struct drm_display_mode *mode;
867869
bool debug_dump_regs = false;
868870
unsigned long hs_clock;
869871
u32 ui_ns;
870872
/* Minimum LP state duration in escape clock cycles. */
871873
u32 lpx = dsi_esc_timing(60);
872-
unsigned long pixel_clock_hz = adjusted_mode->clock * 1000;
874+
unsigned long pixel_clock_hz;
873875
unsigned long dsip_clock;
874876
unsigned long phy_clock;
875877
int ret;
@@ -886,6 +888,10 @@ static void vc4_dsi_encoder_mode_set(struct drm_encoder *encoder,
886888
drm_print_regset32(&p, &dsi->regset);
887889
}
888890

891+
mode = &crtc_state->adjusted_mode;
892+
893+
pixel_clock_hz = mode->clock * 1000;
894+
889895
/* Round up the clk_set_rate() request slightly, since
890896
* PLLD_DSI1 is an integer divider and its rate selection will
891897
* never round up.
@@ -1098,7 +1104,8 @@ static void vc4_dsi_encoder_mode_set(struct drm_encoder *encoder,
10981104
vc4_dsi_ulps(dsi, false);
10991105
}
11001106

1101-
static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
1107+
static void vc4_dsi_encoder_enable(struct drm_encoder *encoder,
1108+
struct drm_atomic_state *state)
11021109
{
11031110
struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
11041111
struct vc4_dsi *dsi = vc4_encoder->dsi;
@@ -1355,10 +1362,10 @@ static const struct mipi_dsi_host_ops vc4_dsi_host_ops = {
13551362
};
13561363

13571364
static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = {
1358-
.disable = vc4_dsi_encoder_disable,
1359-
.enable = vc4_dsi_encoder_enable,
1365+
.atomic_disable = vc4_dsi_encoder_disable,
1366+
.atomic_enable = vc4_dsi_encoder_enable,
13601367
.mode_fixup = vc4_dsi_encoder_mode_fixup,
1361-
.mode_set = vc4_dsi_encoder_mode_set,
1368+
.atomic_mode_set = vc4_dsi_encoder_mode_set,
13621369
};
13631370

13641371
static const struct vc4_dsi_variant bcm2711_dsi1_variant = {

0 commit comments

Comments
 (0)