aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien DESSENNE <fabien.dessenne@st.com>2016-12-05 10:09:32 -0500
committerVincent Abriou <vincent.abriou@st.com>2017-01-06 09:12:03 -0500
commit49fb560a7bf5cd3d351c5a9ac945d9dc09b15d4e (patch)
tree0137507ee0197d88b9b889e2f8592ddb21efe22b
parentdd841870d0f5d170175b25083365e4e3024c2d3b (diff)
drm/sti: load XP70 firmware only once
When a plane is enabled, after having been disabled, do not reload XP70 firmware again, but only register VTG again Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
-rw-r--r--drivers/gpu/drm/sti/sti_hqvdp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index f88130f2eb48..a547723bc7d2 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -332,6 +332,7 @@ struct sti_hqvdp_cmd {
332 * @hqvdp_cmd_paddr: physical address of hqvdp_cmd 332 * @hqvdp_cmd_paddr: physical address of hqvdp_cmd
333 * @vtg: vtg for main data path 333 * @vtg: vtg for main data path
334 * @xp70_initialized: true if xp70 is already initialized 334 * @xp70_initialized: true if xp70 is already initialized
335 * @vtg_registered: true if registered to VTG
335 */ 336 */
336struct sti_hqvdp { 337struct sti_hqvdp {
337 struct device *dev; 338 struct device *dev;
@@ -347,6 +348,7 @@ struct sti_hqvdp {
347 u32 hqvdp_cmd_paddr; 348 u32 hqvdp_cmd_paddr;
348 struct sti_vtg *vtg; 349 struct sti_vtg *vtg;
349 bool xp70_initialized; 350 bool xp70_initialized;
351 bool vtg_registered;
350}; 352};
351 353
352#define to_sti_hqvdp(x) container_of(x, struct sti_hqvdp, plane) 354#define to_sti_hqvdp(x) container_of(x, struct sti_hqvdp, plane)
@@ -771,7 +773,7 @@ static void sti_hqvdp_disable(struct sti_hqvdp *hqvdp)
771 DRM_ERROR("XP70 could not revert to idle\n"); 773 DRM_ERROR("XP70 could not revert to idle\n");
772 774
773 hqvdp->plane.status = STI_PLANE_DISABLED; 775 hqvdp->plane.status = STI_PLANE_DISABLED;
774 hqvdp->xp70_initialized = false; 776 hqvdp->vtg_registered = false;
775} 777}
776 778
777/** 779/**
@@ -1064,10 +1066,11 @@ static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane,
1064 return -EINVAL; 1066 return -EINVAL;
1065 } 1067 }
1066 1068
1067 if (!hqvdp->xp70_initialized) { 1069 if (!hqvdp->xp70_initialized)
1068 /* Start HQVDP XP70 coprocessor */ 1070 /* Start HQVDP XP70 coprocessor */
1069 sti_hqvdp_start_xp70(hqvdp); 1071 sti_hqvdp_start_xp70(hqvdp);
1070 1072
1073 if (!hqvdp->vtg_registered) {
1071 /* Prevent VTG shutdown */ 1074 /* Prevent VTG shutdown */
1072 if (clk_prepare_enable(hqvdp->clk_pix_main)) { 1075 if (clk_prepare_enable(hqvdp->clk_pix_main)) {
1073 DRM_ERROR("Failed to prepare/enable pix main clk\n"); 1076 DRM_ERROR("Failed to prepare/enable pix main clk\n");
@@ -1081,6 +1084,7 @@ static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane,
1081 DRM_ERROR("Cannot register VTG notifier\n"); 1084 DRM_ERROR("Cannot register VTG notifier\n");
1082 return -EINVAL; 1085 return -EINVAL;
1083 } 1086 }
1087 hqvdp->vtg_registered = true;
1084 } 1088 }
1085 1089
1086 DRM_DEBUG_KMS("CRTC:%d (%s) drm plane:%d (%s)\n", 1090 DRM_DEBUG_KMS("CRTC:%d (%s) drm plane:%d (%s)\n",