Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/rockchip: rk3066_hdmi: Switch encoder hooks to atomic

The rk3066_hdmi encoder still uses the non atomic variants
of enable and disable. Convert to their atomic equivalents.
In atomic mode there is no need to save the adjusted mode,
so remove the mode_set function.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/034c3446-d619-f4c3-3aaa-ab51dc19d07f@gmail.com

authored by

Johan Jonker and committed by
Heiko Stuebner
ae3436a5 1044f4a3

+18 -19
+18 -19
drivers/gpu/drm/rockchip/rk3066_hdmi.c
··· 55 55 unsigned int tmdsclk; 56 56 57 57 struct hdmi_data_info hdmi_data; 58 - struct drm_display_mode previous_mode; 59 58 }; 60 59 61 60 static struct rk3066_hdmi *encoder_to_rk3066_hdmi(struct drm_encoder *encoder) ··· 386 387 return 0; 387 388 } 388 389 389 - static void 390 - rk3066_hdmi_encoder_mode_set(struct drm_encoder *encoder, 391 - struct drm_display_mode *mode, 392 - struct drm_display_mode *adj_mode) 390 + static void rk3066_hdmi_encoder_enable(struct drm_encoder *encoder, 391 + struct drm_atomic_state *state) 393 392 { 394 393 struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder); 395 - 396 - /* Store the display mode for plugin/DPMS poweron events. */ 397 - drm_mode_copy(&hdmi->previous_mode, adj_mode); 398 - } 399 - 400 - static void rk3066_hdmi_encoder_enable(struct drm_encoder *encoder) 401 - { 402 - struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder); 394 + struct drm_connector_state *conn_state; 395 + struct drm_crtc_state *crtc_state; 403 396 int mux, val; 397 + 398 + conn_state = drm_atomic_get_new_connector_state(state, &hdmi->connector); 399 + if (WARN_ON(!conn_state)) 400 + return; 401 + 402 + crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); 403 + if (WARN_ON(!crtc_state)) 404 + return; 404 405 405 406 mux = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, encoder); 406 407 if (mux) ··· 413 414 DRM_DEV_DEBUG(hdmi->dev, "hdmi encoder enable select: vop%s\n", 414 415 (mux) ? "1" : "0"); 415 416 416 - rk3066_hdmi_setup(hdmi, &hdmi->previous_mode); 417 + rk3066_hdmi_setup(hdmi, &crtc_state->adjusted_mode); 417 418 } 418 419 419 - static void rk3066_hdmi_encoder_disable(struct drm_encoder *encoder) 420 + static void rk3066_hdmi_encoder_disable(struct drm_encoder *encoder, 421 + struct drm_atomic_state *state) 420 422 { 421 423 struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder); 422 424 ··· 449 449 450 450 static const 451 451 struct drm_encoder_helper_funcs rk3066_hdmi_encoder_helper_funcs = { 452 - .enable = rk3066_hdmi_encoder_enable, 453 - .disable = rk3066_hdmi_encoder_disable, 454 - .mode_set = rk3066_hdmi_encoder_mode_set, 455 - .atomic_check = rk3066_hdmi_encoder_atomic_check, 452 + .atomic_check = rk3066_hdmi_encoder_atomic_check, 453 + .atomic_enable = rk3066_hdmi_encoder_enable, 454 + .atomic_disable = rk3066_hdmi_encoder_disable, 456 455 }; 457 456 458 457 static enum drm_connector_status