Skip to content

Commit 5756c29

Browse files
committed
Merge tag 'drm/tegra/for-5.19-rc1' of https://gitlab.freedesktop.org/drm/tegra into drm-next
drm/tegra: Changes for v5.19-rc1 Only a few fixes this time, and some debuggability improvements. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thierry Reding <thierry.reding@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220506164004.3922226-1-thierry.reding@gmail.com
2 parents f83493f + cb7e1ab commit 5756c29

5 files changed

Lines changed: 18 additions & 9 deletions

File tree

drivers/gpu/drm/tegra/gem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ static struct host1x_bo_mapping *tegra_bo_pin(struct device *dev, struct host1x_
8888
if (IS_ERR(map->sgt)) {
8989
dma_buf_detach(buf, map->attach);
9090
err = PTR_ERR(map->sgt);
91+
map->sgt = NULL;
9192
goto free;
9293
}
9394

drivers/gpu/drm/tegra/vic.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,8 @@ static int vic_remove(struct platform_device *pdev)
513513
}
514514

515515
static const struct dev_pm_ops vic_pm_ops = {
516-
SET_RUNTIME_PM_OPS(vic_runtime_suspend, vic_runtime_resume, NULL)
517-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
518-
pm_runtime_force_resume)
516+
RUNTIME_PM_OPS(vic_runtime_suspend, vic_runtime_resume, NULL)
517+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
519518
};
520519

521520
struct platform_driver tegra_vic_driver = {

drivers/gpu/host1x/debug.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static int show_channel(struct host1x_channel *ch, void *data, bool show_fifo)
7575
return 0;
7676
}
7777

78-
static void show_syncpts(struct host1x *m, struct output *o)
78+
static void show_syncpts(struct host1x *m, struct output *o, bool show_all)
7979
{
8080
struct list_head *pos;
8181
unsigned int i;
@@ -97,7 +97,10 @@ static void show_syncpts(struct host1x *m, struct output *o)
9797
waiters++;
9898
spin_unlock(&m->syncpt[i].intr.lock);
9999

100-
if (!min && !max && !waiters)
100+
if (!kref_read(&m->syncpt[i].ref))
101+
continue;
102+
103+
if (!show_all && !min && !max && !waiters)
101104
continue;
102105

103106
host1x_debug_output(o,
@@ -124,7 +127,7 @@ static void show_all(struct host1x *m, struct output *o, bool show_fifo)
124127
unsigned int i;
125128

126129
host1x_hw_show_mlocks(m, o);
127-
show_syncpts(m, o);
130+
show_syncpts(m, o, true);
128131
host1x_debug_output(o, "---- channels ----\n");
129132

130133
for (i = 0; i < m->info->nb_channels; ++i) {
@@ -241,5 +244,5 @@ void host1x_debug_dump_syncpts(struct host1x *host1x)
241244
.fn = write_to_printk
242245
};
243246

244-
show_syncpts(host1x, &o);
247+
show_syncpts(host1x, &o, false);
245248
}

drivers/gpu/host1x/job.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static unsigned int pin_job(struct host1x *host, struct host1x_job *job)
175175
goto unpin;
176176
}
177177

178-
map = host1x_bo_pin(dev, bo, direction, &client->cache);
178+
map = host1x_bo_pin(dev, bo, direction, NULL);
179179
if (IS_ERR(map)) {
180180
err = PTR_ERR(map);
181181
goto unpin;
@@ -222,7 +222,7 @@ static unsigned int pin_job(struct host1x *host, struct host1x_job *job)
222222
goto unpin;
223223
}
224224

225-
map = host1x_bo_pin(host->dev, g->bo, DMA_TO_DEVICE, &host->cache);
225+
map = host1x_bo_pin(host->dev, g->bo, DMA_TO_DEVICE, NULL);
226226
if (IS_ERR(map)) {
227227
err = PTR_ERR(map);
228228
goto unpin;

include/linux/host1x.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ u64 host1x_get_dma_mask(struct host1x *host1x);
3131
* struct host1x_bo_cache - host1x buffer object cache
3232
* @mappings: list of mappings
3333
* @lock: synchronizes accesses to the list of mappings
34+
*
35+
* Note that entries are not periodically evicted from this cache and instead need to be
36+
* explicitly released. This is used primarily for DRM/KMS where the cache's reference is
37+
* released when the last reference to a buffer object represented by a mapping in this
38+
* cache is dropped.
3439
*/
3540
struct host1x_bo_cache {
3641
struct list_head mappings;
@@ -81,6 +86,7 @@ struct host1x_client_ops {
8186
* @parent: pointer to parent structure
8287
* @usecount: reference count for this structure
8388
* @lock: mutex for mutually exclusive concurrency
89+
* @cache: host1x buffer object cache
8490
*/
8591
struct host1x_client {
8692
struct list_head list;

0 commit comments

Comments
 (0)