aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2016-06-23 05:19:00 -0400
committerThierry Reding <treding@nvidia.com>2016-06-23 05:59:24 -0400
commit5c0d8d386ba67ce07bfddcebf05233e8606771ff (patch)
tree1ff111f24857adecf28ec2c3bd80ea1d77e7c922 /drivers/gpu/host1x
parent14c95fc896e1d3929abde448fd86c07bdbae56d5 (diff)
gpu: host1x: Use unsigned int consistently for IDs
IDs can never be negative so use unsigned int. In some instances an explicitly sized type (such as u32) was used for no particular reason, so turn those into unsigned int as well for consistency. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r--drivers/gpu/host1x/dev.h23
-rw-r--r--drivers/gpu/host1x/hw/cdma_hw.c6
-rw-r--r--drivers/gpu/host1x/hw/channel_hw.c3
-rw-r--r--drivers/gpu/host1x/hw/debug_hw.c4
-rw-r--r--drivers/gpu/host1x/hw/intr_hw.c9
-rw-r--r--drivers/gpu/host1x/intr.c8
-rw-r--r--drivers/gpu/host1x/intr.h4
-rw-r--r--drivers/gpu/host1x/job.c2
-rw-r--r--drivers/gpu/host1x/syncpt.c6
-rw-r--r--drivers/gpu/host1x/syncpt.h2
10 files changed, 36 insertions, 31 deletions
diff --git a/drivers/gpu/host1x/dev.h b/drivers/gpu/host1x/dev.h
index e3fd1f0694c6..5220510f39da 100644
--- a/drivers/gpu/host1x/dev.h
+++ b/drivers/gpu/host1x/dev.h
@@ -45,7 +45,7 @@ struct host1x_cdma_ops {
45 void (*start)(struct host1x_cdma *cdma); 45 void (*start)(struct host1x_cdma *cdma);
46 void (*stop)(struct host1x_cdma *cdma); 46 void (*stop)(struct host1x_cdma *cdma);
47 void (*flush)(struct host1x_cdma *cdma); 47 void (*flush)(struct host1x_cdma *cdma);
48 int (*timeout_init)(struct host1x_cdma *cdma, u32 syncpt_id); 48 int (*timeout_init)(struct host1x_cdma *cdma, unsigned int syncpt);
49 void (*timeout_destroy)(struct host1x_cdma *cdma); 49 void (*timeout_destroy)(struct host1x_cdma *cdma);
50 void (*freeze)(struct host1x_cdma *cdma); 50 void (*freeze)(struct host1x_cdma *cdma);
51 void (*resume)(struct host1x_cdma *cdma, u32 getptr); 51 void (*resume)(struct host1x_cdma *cdma, u32 getptr);
@@ -82,9 +82,9 @@ struct host1x_intr_ops {
82 int (*init_host_sync)(struct host1x *host, u32 cpm, 82 int (*init_host_sync)(struct host1x *host, u32 cpm,
83 void (*syncpt_thresh_work)(struct work_struct *work)); 83 void (*syncpt_thresh_work)(struct work_struct *work));
84 void (*set_syncpt_threshold)( 84 void (*set_syncpt_threshold)(
85 struct host1x *host, u32 id, u32 thresh); 85 struct host1x *host, unsigned int id, u32 thresh);
86 void (*enable_syncpt_intr)(struct host1x *host, u32 id); 86 void (*enable_syncpt_intr)(struct host1x *host, unsigned int id);
87 void (*disable_syncpt_intr)(struct host1x *host, u32 id); 87 void (*disable_syncpt_intr)(struct host1x *host, unsigned int id);
88 void (*disable_all_syncpt_intrs)(struct host1x *host); 88 void (*disable_all_syncpt_intrs)(struct host1x *host);
89 int (*free_syncpt_irq)(struct host1x *host); 89 int (*free_syncpt_irq)(struct host1x *host);
90}; 90};
@@ -182,19 +182,20 @@ static inline int host1x_hw_intr_init_host_sync(struct host1x *host, u32 cpm,
182} 182}
183 183
184static inline void host1x_hw_intr_set_syncpt_threshold(struct host1x *host, 184static inline void host1x_hw_intr_set_syncpt_threshold(struct host1x *host,
185 u32 id, u32 thresh) 185 unsigned int id,
186 u32 thresh)
186{ 187{
187 host->intr_op->set_syncpt_threshold(host, id, thresh); 188 host->intr_op->set_syncpt_threshold(host, id, thresh);
188} 189}
189 190
190static inline void host1x_hw_intr_enable_syncpt_intr(struct host1x *host, 191static inline void host1x_hw_intr_enable_syncpt_intr(struct host1x *host,
191 u32 id) 192 unsigned int id)
192{ 193{
193 host->intr_op->enable_syncpt_intr(host, id); 194 host->intr_op->enable_syncpt_intr(host, id);
194} 195}
195 196
196static inline void host1x_hw_intr_disable_syncpt_intr(struct host1x *host, 197static inline void host1x_hw_intr_disable_syncpt_intr(struct host1x *host,
197 u32 id) 198 unsigned int id)
198{ 199{
199 host->intr_op->disable_syncpt_intr(host, id); 200 host->intr_op->disable_syncpt_intr(host, id);
200} 201}
@@ -211,9 +212,9 @@ static inline int host1x_hw_intr_free_syncpt_irq(struct host1x *host)
211 212
212static inline int host1x_hw_channel_init(struct host1x *host, 213static inline int host1x_hw_channel_init(struct host1x *host,
213 struct host1x_channel *channel, 214 struct host1x_channel *channel,
214 int chid) 215 unsigned int id)
215{ 216{
216 return host->channel_op->init(channel, host, chid); 217 return host->channel_op->init(channel, host, id);
217} 218}
218 219
219static inline int host1x_hw_channel_submit(struct host1x *host, 220static inline int host1x_hw_channel_submit(struct host1x *host,
@@ -242,9 +243,9 @@ static inline void host1x_hw_cdma_flush(struct host1x *host,
242 243
243static inline int host1x_hw_cdma_timeout_init(struct host1x *host, 244static inline int host1x_hw_cdma_timeout_init(struct host1x *host,
244 struct host1x_cdma *cdma, 245 struct host1x_cdma *cdma,
245 u32 syncpt_id) 246 unsigned int syncpt)
246{ 247{
247 return host->cdma_op->timeout_init(cdma, syncpt_id); 248 return host->cdma_op->timeout_init(cdma, syncpt);
248} 249}
249 250
250static inline void host1x_hw_cdma_timeout_destroy(struct host1x *host, 251static inline void host1x_hw_cdma_timeout_destroy(struct host1x *host,
diff --git a/drivers/gpu/host1x/hw/cdma_hw.c b/drivers/gpu/host1x/hw/cdma_hw.c
index 233246e1235a..e0db00613bca 100644
--- a/drivers/gpu/host1x/hw/cdma_hw.c
+++ b/drivers/gpu/host1x/hw/cdma_hw.c
@@ -213,7 +213,7 @@ static void cdma_resume(struct host1x_cdma *cdma, u32 getptr)
213 u32 cmdproc_stop; 213 u32 cmdproc_stop;
214 214
215 dev_dbg(host1x->dev, 215 dev_dbg(host1x->dev,
216 "resuming channel (id %d, DMAGET restart = 0x%x)\n", 216 "resuming channel (id %u, DMAGET restart = 0x%x)\n",
217 ch->id, getptr); 217 ch->id, getptr);
218 218
219 cmdproc_stop = host1x_sync_readl(host1x, HOST1X_SYNC_CMDPROC_STOP); 219 cmdproc_stop = host1x_sync_readl(host1x, HOST1X_SYNC_CMDPROC_STOP);
@@ -277,7 +277,7 @@ static void cdma_timeout_handler(struct work_struct *work)
277 return; 277 return;
278 } 278 }
279 279
280 dev_warn(host1x->dev, "%s: timeout: %d (%s), HW thresh %d, done %d\n", 280 dev_warn(host1x->dev, "%s: timeout: %u (%s), HW thresh %d, done %d\n",
281 __func__, cdma->timeout.syncpt->id, cdma->timeout.syncpt->name, 281 __func__, cdma->timeout.syncpt->id, cdma->timeout.syncpt->name,
282 syncpt_val, cdma->timeout.syncpt_val); 282 syncpt_val, cdma->timeout.syncpt_val);
283 283
@@ -291,7 +291,7 @@ static void cdma_timeout_handler(struct work_struct *work)
291/* 291/*
292 * Init timeout resources 292 * Init timeout resources
293 */ 293 */
294static int cdma_timeout_init(struct host1x_cdma *cdma, u32 syncpt_id) 294static int cdma_timeout_init(struct host1x_cdma *cdma, unsigned int syncpt)
295{ 295{
296 INIT_DELAYED_WORK(&cdma->timeout.wq, cdma_timeout_handler); 296 INIT_DELAYED_WORK(&cdma->timeout.wq, cdma_timeout_handler);
297 cdma->timeout.initialized = true; 297 cdma->timeout.initialized = true;
diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c
index 946c332c3906..f359b7ec5e3c 100644
--- a/drivers/gpu/host1x/hw/channel_hw.c
+++ b/drivers/gpu/host1x/hw/channel_hw.c
@@ -75,7 +75,8 @@ static inline void synchronize_syncpt_base(struct host1x_job *job)
75{ 75{
76 struct host1x *host = dev_get_drvdata(job->channel->dev->parent); 76 struct host1x *host = dev_get_drvdata(job->channel->dev->parent);
77 struct host1x_syncpt *sp = host->syncpt + job->syncpt_id; 77 struct host1x_syncpt *sp = host->syncpt + job->syncpt_id;
78 u32 id, value; 78 unsigned int id;
79 u32 value;
79 80
80 value = host1x_syncpt_read_max(sp); 81 value = host1x_syncpt_read_max(sp);
81 id = sp->base->id; 82 id = sp->base->id;
diff --git a/drivers/gpu/host1x/hw/debug_hw.c b/drivers/gpu/host1x/hw/debug_hw.c
index 81e94fef5e42..47da9a62ff7e 100644
--- a/drivers/gpu/host1x/hw/debug_hw.c
+++ b/drivers/gpu/host1x/hw/debug_hw.c
@@ -191,7 +191,7 @@ static void host1x_debug_show_channel_cdma(struct host1x *host,
191 cbread = host1x_sync_readl(host, HOST1X_SYNC_CBREAD(ch->id)); 191 cbread = host1x_sync_readl(host, HOST1X_SYNC_CBREAD(ch->id));
192 cbstat = host1x_sync_readl(host, HOST1X_SYNC_CBSTAT(ch->id)); 192 cbstat = host1x_sync_readl(host, HOST1X_SYNC_CBSTAT(ch->id));
193 193
194 host1x_debug_output(o, "%d-%s: ", ch->id, dev_name(ch->dev)); 194 host1x_debug_output(o, "%u-%s: ", ch->id, dev_name(ch->dev));
195 195
196 if (HOST1X_CHANNEL_DMACTRL_DMASTOP_V(dmactrl) || 196 if (HOST1X_CHANNEL_DMACTRL_DMASTOP_V(dmactrl) ||
197 !ch->cdma.push_buffer.mapped) { 197 !ch->cdma.push_buffer.mapped) {
@@ -237,7 +237,7 @@ static void host1x_debug_show_channel_fifo(struct host1x *host,
237 u32 val, rd_ptr, wr_ptr, start, end; 237 u32 val, rd_ptr, wr_ptr, start, end;
238 unsigned int data_count = 0; 238 unsigned int data_count = 0;
239 239
240 host1x_debug_output(o, "%d: fifo:\n", ch->id); 240 host1x_debug_output(o, "%u: fifo:\n", ch->id);
241 241
242 val = host1x_ch_readl(ch, HOST1X_CHANNEL_FIFOSTAT); 242 val = host1x_ch_readl(ch, HOST1X_CHANNEL_FIFOSTAT);
243 host1x_debug_output(o, "FIFOSTAT %08x\n", val); 243 host1x_debug_output(o, "FIFOSTAT %08x\n", val);
diff --git a/drivers/gpu/host1x/hw/intr_hw.c b/drivers/gpu/host1x/hw/intr_hw.c
index cf49d72fb172..f50c68957c12 100644
--- a/drivers/gpu/host1x/hw/intr_hw.c
+++ b/drivers/gpu/host1x/hw/intr_hw.c
@@ -107,18 +107,21 @@ static int _host1x_intr_init_host_sync(struct host1x *host, u32 cpm,
107} 107}
108 108
109static void _host1x_intr_set_syncpt_threshold(struct host1x *host, 109static void _host1x_intr_set_syncpt_threshold(struct host1x *host,
110 u32 id, u32 thresh) 110 unsigned int id,
111 u32 thresh)
111{ 112{
112 host1x_sync_writel(host, thresh, HOST1X_SYNC_SYNCPT_INT_THRESH(id)); 113 host1x_sync_writel(host, thresh, HOST1X_SYNC_SYNCPT_INT_THRESH(id));
113} 114}
114 115
115static void _host1x_intr_enable_syncpt_intr(struct host1x *host, u32 id) 116static void _host1x_intr_enable_syncpt_intr(struct host1x *host,
117 unsigned int id)
116{ 118{
117 host1x_sync_writel(host, BIT_MASK(id), 119 host1x_sync_writel(host, BIT_MASK(id),
118 HOST1X_SYNC_SYNCPT_THRESH_INT_ENABLE_CPU0(BIT_WORD(id))); 120 HOST1X_SYNC_SYNCPT_THRESH_INT_ENABLE_CPU0(BIT_WORD(id)));
119} 121}
120 122
121static void _host1x_intr_disable_syncpt_intr(struct host1x *host, u32 id) 123static void _host1x_intr_disable_syncpt_intr(struct host1x *host,
124 unsigned int id)
122{ 125{
123 host1x_sync_writel(host, BIT_MASK(id), 126 host1x_sync_writel(host, BIT_MASK(id),
124 HOST1X_SYNC_SYNCPT_THRESH_INT_DISABLE(BIT_WORD(id))); 127 HOST1X_SYNC_SYNCPT_THRESH_INT_DISABLE(BIT_WORD(id)));
diff --git a/drivers/gpu/host1x/intr.c b/drivers/gpu/host1x/intr.c
index 81de286a2f60..c85ca44ff461 100644
--- a/drivers/gpu/host1x/intr.c
+++ b/drivers/gpu/host1x/intr.c
@@ -209,7 +209,7 @@ static void syncpt_thresh_work(struct work_struct *work)
209 host1x_syncpt_load(host->syncpt + id)); 209 host1x_syncpt_load(host->syncpt + id));
210} 210}
211 211
212int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh, 212int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh,
213 enum host1x_intr_action action, void *data, 213 enum host1x_intr_action action, void *data,
214 struct host1x_waitlist *waiter, void **ref) 214 struct host1x_waitlist *waiter, void **ref)
215{ 215{
@@ -254,7 +254,7 @@ int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh,
254 return 0; 254 return 0;
255} 255}
256 256
257void host1x_intr_put_ref(struct host1x *host, u32 id, void *ref) 257void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref)
258{ 258{
259 struct host1x_waitlist *waiter = ref; 259 struct host1x_waitlist *waiter = ref;
260 struct host1x_syncpt *syncpt; 260 struct host1x_syncpt *syncpt;
@@ -285,7 +285,7 @@ int host1x_intr_init(struct host1x *host, unsigned int irq_sync)
285 INIT_LIST_HEAD(&syncpt->intr.wait_head); 285 INIT_LIST_HEAD(&syncpt->intr.wait_head);
286 snprintf(syncpt->intr.thresh_irq_name, 286 snprintf(syncpt->intr.thresh_irq_name,
287 sizeof(syncpt->intr.thresh_irq_name), 287 sizeof(syncpt->intr.thresh_irq_name),
288 "host1x_sp_%02d", id); 288 "host1x_sp_%02u", id);
289 } 289 }
290 290
291 host1x_intr_start(host); 291 host1x_intr_start(host);
@@ -338,7 +338,7 @@ void host1x_intr_stop(struct host1x *host)
338 if (!list_empty(&syncpt[id].intr.wait_head)) { 338 if (!list_empty(&syncpt[id].intr.wait_head)) {
339 /* output diagnostics */ 339 /* output diagnostics */
340 mutex_unlock(&host->intr_mutex); 340 mutex_unlock(&host->intr_mutex);
341 pr_warn("%s cannot stop syncpt intr id=%d\n", 341 pr_warn("%s cannot stop syncpt intr id=%u\n",
342 __func__, id); 342 __func__, id);
343 return; 343 return;
344 } 344 }
diff --git a/drivers/gpu/host1x/intr.h b/drivers/gpu/host1x/intr.h
index 2b8adf016a05..1370c2bb75b8 100644
--- a/drivers/gpu/host1x/intr.h
+++ b/drivers/gpu/host1x/intr.h
@@ -75,7 +75,7 @@ struct host1x_waitlist {
75 * 75 *
76 * This is a non-blocking api. 76 * This is a non-blocking api.
77 */ 77 */
78int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh, 78int host1x_intr_add_action(struct host1x *host, unsigned int id, u32 thresh,
79 enum host1x_intr_action action, void *data, 79 enum host1x_intr_action action, void *data,
80 struct host1x_waitlist *waiter, void **ref); 80 struct host1x_waitlist *waiter, void **ref);
81 81
@@ -84,7 +84,7 @@ int host1x_intr_add_action(struct host1x *host, u32 id, u32 thresh,
84 * You must call this if you passed non-NULL as ref. 84 * You must call this if you passed non-NULL as ref.
85 * @ref the ref returned from host1x_intr_add_action() 85 * @ref the ref returned from host1x_intr_add_action()
86 */ 86 */
87void host1x_intr_put_ref(struct host1x *host, u32 id, void *ref); 87void host1x_intr_put_ref(struct host1x *host, unsigned int id, void *ref);
88 88
89/* Initialize host1x sync point interrupt */ 89/* Initialize host1x sync point interrupt */
90int host1x_intr_init(struct host1x *host, unsigned int irq_sync); 90int host1x_intr_init(struct host1x *host, unsigned int irq_sync);
diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c
index b4515d544039..626707585d9b 100644
--- a/drivers/gpu/host1x/job.c
+++ b/drivers/gpu/host1x/job.c
@@ -161,7 +161,7 @@ static int do_waitchks(struct host1x_job *job, struct host1x *host,
161 161
162 if (host1x_syncpt_is_expired(sp, wait->thresh)) { 162 if (host1x_syncpt_is_expired(sp, wait->thresh)) {
163 dev_dbg(host->dev, 163 dev_dbg(host->dev,
164 "drop WAIT id %d (%s) thresh 0x%x, min 0x%x\n", 164 "drop WAIT id %u (%s) thresh 0x%x, min 0x%x\n",
165 wait->syncpt_id, sp->name, wait->thresh, 165 wait->syncpt_id, sp->name, wait->thresh,
166 host1x_syncpt_read_min(sp)); 166 host1x_syncpt_read_min(sp));
167 167
diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c
index e2c499aa33e1..3e9119301f6c 100644
--- a/drivers/gpu/host1x/syncpt.c
+++ b/drivers/gpu/host1x/syncpt.c
@@ -73,7 +73,7 @@ static struct host1x_syncpt *host1x_syncpt_alloc(struct host1x *host,
73 return NULL; 73 return NULL;
74 } 74 }
75 75
76 name = kasprintf(GFP_KERNEL, "%02d-%s", sp->id, 76 name = kasprintf(GFP_KERNEL, "%02u-%s", sp->id,
77 dev ? dev_name(dev) : NULL); 77 dev ? dev_name(dev) : NULL);
78 if (!name) 78 if (!name)
79 return NULL; 79 return NULL;
@@ -255,7 +255,7 @@ int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout,
255 timeout -= check; 255 timeout -= check;
256 if (timeout && check_count <= MAX_STUCK_CHECK_COUNT) { 256 if (timeout && check_count <= MAX_STUCK_CHECK_COUNT) {
257 dev_warn(sp->host->dev, 257 dev_warn(sp->host->dev,
258 "%s: syncpoint id %d (%s) stuck waiting %d, timeout=%ld\n", 258 "%s: syncpoint id %u (%s) stuck waiting %d, timeout=%ld\n",
259 current->comm, sp->id, sp->name, 259 current->comm, sp->id, sp->name,
260 thresh, timeout); 260 thresh, timeout);
261 261
@@ -447,7 +447,7 @@ unsigned int host1x_syncpt_nb_mlocks(struct host1x *host)
447 return host->info->nb_mlocks; 447 return host->info->nb_mlocks;
448} 448}
449 449
450struct host1x_syncpt *host1x_syncpt_get(struct host1x *host, u32 id) 450struct host1x_syncpt *host1x_syncpt_get(struct host1x *host, unsigned int id)
451{ 451{
452 if (host->info->nb_pts < id) 452 if (host->info->nb_pts < id)
453 return NULL; 453 return NULL;
diff --git a/drivers/gpu/host1x/syncpt.h b/drivers/gpu/host1x/syncpt.h
index 6916feff0c29..f719205105ac 100644
--- a/drivers/gpu/host1x/syncpt.h
+++ b/drivers/gpu/host1x/syncpt.h
@@ -37,7 +37,7 @@ struct host1x_syncpt_base {
37}; 37};
38 38
39struct host1x_syncpt { 39struct host1x_syncpt {
40 int id; 40 unsigned int id;
41 atomic_t min_val; 41 atomic_t min_val;
42 atomic_t max_val; 42 atomic_t max_val;
43 u32 base_val; 43 u32 base_val;