OSDN Git Service

drm: msm: Hot plug cpu1 once early domain is finished
authorVivek Kumar <vivekuma@codeaurora.org>
Tue, 3 Jul 2018 14:53:57 +0000 (20:23 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Tue, 17 Jul 2018 04:41:39 +0000 (21:41 -0700)
Early domain services run on cpu1 in LK, so hotplug
cpu1 once early domain services are finished.

Change-Id: I23b57b8b7460c5740083b27af72251b2fad78ed4
Signed-off-by: Vivek Kumar <vivekuma@codeaurora.org>
drivers/gpu/drm/msm/sde/sde_connector.c

index 1bc3d0a..a986f5d 100644 (file)
@@ -17,6 +17,8 @@
 #include "sde_connector.h"
 #include "sde_backlight.h"
 #include "sde_splash.h"
+#include <linux/workqueue.h>
+#include <linux/atomic.h>
 
 #define SDE_DEBUG_CONN(c, fmt, ...) SDE_DEBUG("conn%d " fmt,\
                (c) ? (c)->base.base.id : -1, ##__VA_ARGS__)
@@ -51,6 +53,8 @@ static const struct drm_prop_enum_list hpd_clock_state[] = {
        {SDE_MODE_HPD_OFF,     "OFF"},
 };
 
+static struct work_struct cpu_up_work;
+
 int sde_connector_get_info(struct drm_connector *connector,
                struct msm_display_info *info)
 {
@@ -568,11 +572,18 @@ void sde_connector_prepare_fence(struct drm_connector *connector)
        sde_fence_prepare(&to_sde_connector(connector)->retire_fence);
 }
 
+static void wake_up_cpu(struct work_struct *work)
+{
+       if (!cpu_up(1))
+               pr_info("cpu1 is online\n");
+}
+
 void sde_connector_complete_commit(struct drm_connector *connector)
 {
        struct drm_device *dev;
        struct msm_drm_private *priv;
        struct sde_connector *c_conn;
+       static atomic_t cpu_up_scheduled = ATOMIC_INIT(0);
 
        if (!connector) {
                SDE_ERROR("invalid connector\n");
@@ -587,7 +598,8 @@ void sde_connector_complete_commit(struct drm_connector *connector)
 
        /*
         * After LK totally exits, LK's early splash resource
-        * should be released.
+        * should be released, cpu1 is hot-plugged in case LK's
+        * early domain has reserved it.
         */
        if (sde_splash_get_lk_complete_status(priv->kms)) {
                c_conn = to_sde_connector(connector);
@@ -595,8 +607,11 @@ void sde_connector_complete_commit(struct drm_connector *connector)
                sde_splash_free_resource(priv->kms, &priv->phandle,
                                        c_conn->connector_type,
                                        c_conn->display);
+               if (atomic_add_unless(&cpu_up_scheduled, 1, 1)) {
+                       INIT_WORK(&cpu_up_work, wake_up_cpu);
+                       schedule_work(&cpu_up_work);
+               }
        }
-
 }
 
 static int sde_connector_dpms(struct drm_connector *connector,