summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/lima/lima_device.c
diff options
context:
space:
mode:
authorQiang Yu <yuq825@gmail.com>2020-03-07 21:44:23 +0800
committerQiang Yu <yuq825@gmail.com>2020-03-22 09:35:19 +0800
commitb78edd46f6a9eca23b4070166fe98264c07171cc (patch)
tree5133795b5582961b5757e7f8383be3c61e355028 /drivers/gpu/drm/lima/lima_device.c
parentc67a3d4f68c7cff39253e122d26a0152dbef37c8 (diff)
drm/lima: save task info dump when task fail
Save all information to start a task which can be exported to user for debug usage. Dump file data format is specified in lima_dump.h v2: Add include header to address build robot complain. Tested-by: Andreas Baierl <ichgeh@imkreisrum.de> Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Qiang Yu <yuq825@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200307134423.24329-1-yuq825@gmail.com
Diffstat (limited to 'drivers/gpu/drm/lima/lima_device.c')
-rw-r--r--drivers/gpu/drm/lima/lima_device.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/lima/lima_device.c b/drivers/gpu/drm/lima/lima_device.c
index 19829b543024..42a00171fea5 100644
--- a/drivers/gpu/drm/lima/lima_device.c
+++ b/drivers/gpu/drm/lima/lima_device.c
@@ -344,6 +344,12 @@ int lima_device_init(struct lima_device *ldev)
if (err)
goto err_out5;
+ ldev->dump.magic = LIMA_DUMP_MAGIC;
+ ldev->dump.version_major = LIMA_DUMP_MAJOR;
+ ldev->dump.version_minor = LIMA_DUMP_MINOR;
+ INIT_LIST_HEAD(&ldev->error_task_list);
+ mutex_init(&ldev->error_task_list_lock);
+
dev_info(ldev->dev, "bus rate = %lu\n", clk_get_rate(ldev->clk_bus));
dev_info(ldev->dev, "mod rate = %lu", clk_get_rate(ldev->clk_gpu));
@@ -370,6 +376,13 @@ err_out0:
void lima_device_fini(struct lima_device *ldev)
{
int i;
+ struct lima_sched_error_task *et, *tmp;
+
+ list_for_each_entry_safe(et, tmp, &ldev->error_task_list, list) {
+ list_del(&et->list);
+ kvfree(et);
+ }
+ mutex_destroy(&ldev->error_task_list_lock);
lima_fini_pp_pipe(ldev);
lima_fini_gp_pipe(ldev);