gpu: host1x: Drop unnecessary host1x argument
authorThierry Reding <treding@nvidia.com>
Wed, 16 May 2018 12:29:33 +0000 (14:29 +0200)
committerThierry Reding <treding@nvidia.com>
Fri, 18 May 2018 19:51:01 +0000 (21:51 +0200)
Functions taking a pointer to a host1x syncpoint as an argument don't
need to specify a pointer to a host1x instance because it can be
obtained from the syncpoint.

Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/host1x/hw/channel_hw.c
drivers/gpu/host1x/intr.c
drivers/gpu/host1x/intr.h
drivers/gpu/host1x/syncpt.c

index 4c9555038a9599dc1e321e264d6b529c1ce53b63..d188f9068b9109c707d7ec6b5d9f826e6e1fe11d 100644 (file)
@@ -164,7 +164,7 @@ static int channel_submit(struct host1x_job *job)
        trace_host1x_channel_submitted(dev_name(ch->dev), prev_max, syncval);
 
        /* schedule a submit complete interrupt */
-       err = host1x_intr_add_action(host, job->syncpt_id, syncval,
+       err = host1x_intr_add_action(host, sp, syncval,
                                     HOST1X_INTR_ACTION_SUBMIT_COMPLETE, ch,
                                     completed_waiter, NULL);
        completed_waiter = NULL;
index 6028cf7b681f19eb3061cb360204fb971a492848..9629c009d10f0e2ab6c57de9ea5f206802b7279d 100644 (file)
@@ -211,11 +211,11 @@ static void syncpt_thresh_work(struct work_struct *work)
                                host1x_syncpt_load(host->syncpt + id));
 }
 
-int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh,
-                          enum host1x_intr_action action, void *data,
-                          struct host1x_waitlist *waiter, void **ref)
+int host1x_intr_add_action(struct host1x *host, struct host1x_syncpt *syncpt,
+                          u32 thresh, enum host1x_intr_action action,
+                          void *data, struct host1x_waitlist *waiter,
+                          void **ref)
 {
-       struct host1x_syncpt *syncpt;
        int queue_was_empty;
 
        if (waiter == NULL) {
@@ -234,19 +234,17 @@ int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh,
        waiter->data = data;
        waiter->count = 1;
 
-       syncpt = host->syncpt + id;
-
        spin_lock(&syncpt->intr.lock);
 
        queue_was_empty = list_empty(&syncpt->intr.wait_head);
 
        if (add_waiter_to_queue(waiter, &syncpt->intr.wait_head)) {
                /* added at head of list - new threshold value */
-               host1x_hw_intr_set_syncpt_threshold(host, id, thresh);
+               host1x_hw_intr_set_syncpt_threshold(host, syncpt->id, thresh);
 
                /* added as first waiter - enable interrupt */
                if (queue_was_empty)
-                       host1x_hw_intr_enable_syncpt_intr(host, id);
+                       host1x_hw_intr_enable_syncpt_intr(host, syncpt->id);
        }
 
        spin_unlock(&syncpt->intr.lock);
index 1370c2bb75b810ff5e275cfbb3b8ef8edb459183..6db96af484fe118a0f0ee8984371697b020bbfd1 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/interrupt.h>
 #include <linux/workqueue.h>
 
+struct host1x_syncpt;
 struct host1x;
 
 enum host1x_intr_action {
@@ -75,9 +76,10 @@ struct host1x_waitlist {
  *
  * This is a non-blocking api.
  */
-int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh,
-       enum host1x_intr_action action, void *data,
-       struct host1x_waitlist *waiter, void **ref);
+int host1x_intr_add_action(struct host1x *host, struct host1x_syncpt *syncpt,
+                          u32 thresh, enum host1x_intr_action action,
+                          void *data, struct host1x_waitlist *waiter,
+                          void **ref);
 
 /*
  * Unreference an action submitted to host1x_intr_add_action().
index 088c05dd884c334b439b61a71af3576f69b244a0..a5dbf1ba4645bebb2b7b1ec422cb0adda63470ac 100644 (file)
@@ -255,7 +255,7 @@ int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout,
        }
 
        /* schedule a wakeup when the syncpoint value is reached */
-       err = host1x_intr_add_action(sp->host, sp->id, thresh,
+       err = host1x_intr_add_action(sp->host, sp, thresh,
                                     HOST1X_INTR_ACTION_WAKEUP_INTERRUPTIBLE,
                                     &wq, waiter, &ref);
        if (err)