diff options
Diffstat (limited to 'drivers/gpu/drm/armada/armada_crtc.c')
-rw-r--r-- | drivers/gpu/drm/armada/armada_crtc.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index 7f7f21166488..3287b72e48cc 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c | |||
@@ -1123,12 +1123,16 @@ static const struct drm_crtc_funcs armada_crtc_funcs = { | |||
1123 | .disable_vblank = armada_drm_crtc_disable_vblank, | 1123 | .disable_vblank = armada_drm_crtc_disable_vblank, |
1124 | }; | 1124 | }; |
1125 | 1125 | ||
1126 | void armada_drm_crtc_plane_disable(struct armada_crtc *dcrtc, | 1126 | int armada_drm_plane_disable(struct drm_plane *plane, |
1127 | struct drm_plane *plane) | 1127 | struct drm_modeset_acquire_ctx *ctx) |
1128 | { | 1128 | { |
1129 | struct armada_plane *dplane = drm_to_armada_plane(plane); | 1129 | struct armada_plane *dplane = drm_to_armada_plane(plane); |
1130 | struct armada_crtc *dcrtc; | ||
1130 | u32 sram_para1, dma_ctrl0_mask; | 1131 | u32 sram_para1, dma_ctrl0_mask; |
1131 | 1132 | ||
1133 | if (!plane->crtc) | ||
1134 | return 0; | ||
1135 | |||
1132 | /* | 1136 | /* |
1133 | * Drop our reference on any framebuffer attached to this plane. | 1137 | * Drop our reference on any framebuffer attached to this plane. |
1134 | * We don't need to NULL this out as drm_plane_force_disable(), | 1138 | * We don't need to NULL this out as drm_plane_force_disable(), |
@@ -1150,6 +1154,8 @@ void armada_drm_crtc_plane_disable(struct armada_crtc *dcrtc, | |||
1150 | dma_ctrl0_mask = CFG_DMA_ENA; | 1154 | dma_ctrl0_mask = CFG_DMA_ENA; |
1151 | } | 1155 | } |
1152 | 1156 | ||
1157 | dcrtc = drm_to_armada_crtc(plane->crtc); | ||
1158 | |||
1153 | /* Wait for any preceding work to complete, but don't wedge */ | 1159 | /* Wait for any preceding work to complete, but don't wedge */ |
1154 | if (WARN_ON(!armada_drm_plane_work_wait(dplane, HZ))) | 1160 | if (WARN_ON(!armada_drm_plane_work_wait(dplane, HZ))) |
1155 | armada_drm_plane_work_cancel(dcrtc, dplane); | 1161 | armada_drm_plane_work_cancel(dcrtc, dplane); |
@@ -1159,22 +1165,13 @@ void armada_drm_crtc_plane_disable(struct armada_crtc *dcrtc, | |||
1159 | spin_unlock_irq(&dcrtc->irq_lock); | 1165 | spin_unlock_irq(&dcrtc->irq_lock); |
1160 | 1166 | ||
1161 | armada_updatel(sram_para1, 0, dcrtc->base + LCD_SPU_SRAM_PARA1); | 1167 | armada_updatel(sram_para1, 0, dcrtc->base + LCD_SPU_SRAM_PARA1); |
1162 | } | ||
1163 | |||
1164 | static int armada_drm_primary_disable(struct drm_plane *plane, | ||
1165 | struct drm_modeset_acquire_ctx *ctx) | ||
1166 | { | ||
1167 | if (plane->crtc) { | ||
1168 | struct armada_crtc *dcrtc = drm_to_armada_crtc(plane->crtc); | ||
1169 | 1168 | ||
1170 | armada_drm_crtc_plane_disable(dcrtc, plane); | ||
1171 | } | ||
1172 | return 0; | 1169 | return 0; |
1173 | } | 1170 | } |
1174 | 1171 | ||
1175 | static const struct drm_plane_funcs armada_primary_plane_funcs = { | 1172 | static const struct drm_plane_funcs armada_primary_plane_funcs = { |
1176 | .update_plane = drm_primary_helper_update, | 1173 | .update_plane = drm_primary_helper_update, |
1177 | .disable_plane = armada_drm_primary_disable, | 1174 | .disable_plane = armada_drm_plane_disable, |
1178 | .destroy = drm_primary_helper_destroy, | 1175 | .destroy = drm_primary_helper_destroy, |
1179 | }; | 1176 | }; |
1180 | 1177 | ||