mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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
This commit is contained in:
parent
1044f4a317
commit
ae3436a5e7
1 changed files with 18 additions and 19 deletions
|
@ -55,7 +55,6 @@ struct rk3066_hdmi {
|
|||
unsigned int tmdsclk;
|
||||
|
||||
struct hdmi_data_info hdmi_data;
|
||||
struct drm_display_mode previous_mode;
|
||||
};
|
||||
|
||||
static struct rk3066_hdmi *encoder_to_rk3066_hdmi(struct drm_encoder *encoder)
|
||||
|
@ -387,22 +386,22 @@ static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
rk3066_hdmi_encoder_mode_set(struct drm_encoder *encoder,
|
||||
struct drm_display_mode *mode,
|
||||
struct drm_display_mode *adj_mode)
|
||||
{
|
||||
struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder);
|
||||
|
||||
/* Store the display mode for plugin/DPMS poweron events. */
|
||||
drm_mode_copy(&hdmi->previous_mode, adj_mode);
|
||||
}
|
||||
|
||||
static void rk3066_hdmi_encoder_enable(struct drm_encoder *encoder)
|
||||
static void rk3066_hdmi_encoder_enable(struct drm_encoder *encoder,
|
||||
struct drm_atomic_state *state)
|
||||
{
|
||||
struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder);
|
||||
struct drm_connector_state *conn_state;
|
||||
struct drm_crtc_state *crtc_state;
|
||||
int mux, val;
|
||||
|
||||
conn_state = drm_atomic_get_new_connector_state(state, &hdmi->connector);
|
||||
if (WARN_ON(!conn_state))
|
||||
return;
|
||||
|
||||
crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc);
|
||||
if (WARN_ON(!crtc_state))
|
||||
return;
|
||||
|
||||
mux = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, encoder);
|
||||
if (mux)
|
||||
val = (HDMI_VIDEO_SEL << 16) | HDMI_VIDEO_SEL;
|
||||
|
@ -414,10 +413,11 @@ static void rk3066_hdmi_encoder_enable(struct drm_encoder *encoder)
|
|||
DRM_DEV_DEBUG(hdmi->dev, "hdmi encoder enable select: vop%s\n",
|
||||
(mux) ? "1" : "0");
|
||||
|
||||
rk3066_hdmi_setup(hdmi, &hdmi->previous_mode);
|
||||
rk3066_hdmi_setup(hdmi, &crtc_state->adjusted_mode);
|
||||
}
|
||||
|
||||
static void rk3066_hdmi_encoder_disable(struct drm_encoder *encoder)
|
||||
static void rk3066_hdmi_encoder_disable(struct drm_encoder *encoder,
|
||||
struct drm_atomic_state *state)
|
||||
{
|
||||
struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder);
|
||||
|
||||
|
@ -449,10 +449,9 @@ rk3066_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
|
|||
|
||||
static const
|
||||
struct drm_encoder_helper_funcs rk3066_hdmi_encoder_helper_funcs = {
|
||||
.enable = rk3066_hdmi_encoder_enable,
|
||||
.disable = rk3066_hdmi_encoder_disable,
|
||||
.mode_set = rk3066_hdmi_encoder_mode_set,
|
||||
.atomic_check = rk3066_hdmi_encoder_atomic_check,
|
||||
.atomic_check = rk3066_hdmi_encoder_atomic_check,
|
||||
.atomic_enable = rk3066_hdmi_encoder_enable,
|
||||
.atomic_disable = rk3066_hdmi_encoder_disable,
|
||||
};
|
||||
|
||||
static enum drm_connector_status
|
||||
|
|
Loading…
Add table
Reference in a new issue