diff options
author | Neil Armstrong <narmstrong@baylibre.com> | 2017-04-04 08:15:21 -0400 |
---|---|---|
committer | Neil Armstrong <narmstrong@baylibre.com> | 2017-04-04 11:49:30 -0400 |
commit | cc0c43a0450ce46fcd8f2aa793703d36d9af761e (patch) | |
tree | 303d381e95b7fefc1a4a521a822626b243d999ba /drivers/gpu/drm/meson | |
parent | 386d3299ef7298a3bc57e2ff3498ce41ac7f6184 (diff) |
drm/meson: Use crtc_state for hdisplay and fix atomic flush/enable sync for vsync commit
Clean the crtc_enable by using the proper crtc_state instead of the state
of the primary plane state data.
Also fix the dependency to commit the plane changes even if enable is called
after the flush.
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Diffstat (limited to 'drivers/gpu/drm/meson')
-rw-r--r-- | drivers/gpu/drm/meson/meson_crtc.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/meson/meson_crtc.c b/drivers/gpu/drm/meson/meson_crtc.c index 0fe49eccda65..c986eb03b9d9 100644 --- a/drivers/gpu/drm/meson/meson_crtc.c +++ b/drivers/gpu/drm/meson/meson_crtc.c | |||
@@ -82,11 +82,18 @@ static const struct drm_crtc_funcs meson_crtc_funcs = { | |||
82 | static void meson_crtc_enable(struct drm_crtc *crtc) | 82 | static void meson_crtc_enable(struct drm_crtc *crtc) |
83 | { | 83 | { |
84 | struct meson_crtc *meson_crtc = to_meson_crtc(crtc); | 84 | struct meson_crtc *meson_crtc = to_meson_crtc(crtc); |
85 | struct drm_plane *plane = meson_crtc->priv->primary_plane; | 85 | struct drm_crtc_state *crtc_state = crtc->state; |
86 | struct meson_drm *priv = meson_crtc->priv; | 86 | struct meson_drm *priv = meson_crtc->priv; |
87 | 87 | ||
88 | DRM_DEBUG_DRIVER("\n"); | ||
89 | |||
90 | if (!crtc_state) { | ||
91 | DRM_ERROR("Invalid crtc_state\n"); | ||
92 | return; | ||
93 | } | ||
94 | |||
88 | /* Enable VPP Postblend */ | 95 | /* Enable VPP Postblend */ |
89 | writel(plane->state->crtc_w, | 96 | writel(crtc_state->mode.hdisplay, |
90 | priv->io_base + _REG(VPP_POSTBLEND_H_SIZE)); | 97 | priv->io_base + _REG(VPP_POSTBLEND_H_SIZE)); |
91 | 98 | ||
92 | writel_bits_relaxed(VPP_POSTBLEND_ENABLE, VPP_POSTBLEND_ENABLE, | 99 | writel_bits_relaxed(VPP_POSTBLEND_ENABLE, VPP_POSTBLEND_ENABLE, |
@@ -101,6 +108,7 @@ static void meson_crtc_disable(struct drm_crtc *crtc) | |||
101 | struct meson_drm *priv = meson_crtc->priv; | 108 | struct meson_drm *priv = meson_crtc->priv; |
102 | 109 | ||
103 | priv->viu.osd1_enabled = false; | 110 | priv->viu.osd1_enabled = false; |
111 | priv->viu.osd1_commit = false; | ||
104 | 112 | ||
105 | /* Disable VPP Postblend */ | 113 | /* Disable VPP Postblend */ |
106 | writel_bits_relaxed(VPP_POSTBLEND_ENABLE, 0, | 114 | writel_bits_relaxed(VPP_POSTBLEND_ENABLE, 0, |
@@ -137,8 +145,7 @@ static void meson_crtc_atomic_flush(struct drm_crtc *crtc, | |||
137 | struct meson_crtc *meson_crtc = to_meson_crtc(crtc); | 145 | struct meson_crtc *meson_crtc = to_meson_crtc(crtc); |
138 | struct meson_drm *priv = meson_crtc->priv; | 146 | struct meson_drm *priv = meson_crtc->priv; |
139 | 147 | ||
140 | if (priv->viu.osd1_enabled) | 148 | priv->viu.osd1_commit = true; |
141 | priv->viu.osd1_commit = true; | ||
142 | } | 149 | } |
143 | 150 | ||
144 | static const struct drm_crtc_helper_funcs meson_crtc_helper_funcs = { | 151 | static const struct drm_crtc_helper_funcs meson_crtc_helper_funcs = { |