summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/lima
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/lima')
-rw-r--r--drivers/gpu/drm/lima/lima_drv.c21
-rw-r--r--drivers/gpu/drm/lima/lima_drv.h5
-rw-r--r--drivers/gpu/drm/lima/lima_gem.c2
-rw-r--r--drivers/gpu/drm/lima/lima_trace.h2
4 files changed, 25 insertions, 5 deletions
diff --git a/drivers/gpu/drm/lima/lima_drv.c b/drivers/gpu/drm/lima/lima_drv.c
index 10fd9154cc..739c865b55 100644
--- a/drivers/gpu/drm/lima/lima_drv.c
+++ b/drivers/gpu/drm/lima/lima_drv.c
@@ -371,6 +371,7 @@ static int lima_pdev_probe(struct platform_device *pdev)
{
struct lima_device *ldev;
struct drm_device *ddev;
+ const struct lima_compatible *comp;
int err;
err = lima_sched_slab_init();
@@ -384,7 +385,13 @@ static int lima_pdev_probe(struct platform_device *pdev)
}
ldev->dev = &pdev->dev;
- ldev->id = (enum lima_gpu_id)of_device_get_match_data(&pdev->dev);
+ comp = of_device_get_match_data(&pdev->dev);
+ if (!comp) {
+ err = -ENODEV;
+ goto err_out0;
+ }
+
+ ldev->id = comp->id;
platform_set_drvdata(pdev, ldev);
@@ -459,9 +466,17 @@ static void lima_pdev_remove(struct platform_device *pdev)
lima_sched_slab_fini();
}
+static const struct lima_compatible lima_mali400_data = {
+ .id = lima_gpu_mali400,
+};
+
+static const struct lima_compatible lima_mali450_data = {
+ .id = lima_gpu_mali450,
+};
+
static const struct of_device_id dt_match[] = {
- { .compatible = "arm,mali-400", .data = (void *)lima_gpu_mali400 },
- { .compatible = "arm,mali-450", .data = (void *)lima_gpu_mali450 },
+ { .compatible = "arm,mali-400", .data = &lima_mali400_data },
+ { .compatible = "arm,mali-450", .data = &lima_mali450_data },
{}
};
MODULE_DEVICE_TABLE(of, dt_match);
diff --git a/drivers/gpu/drm/lima/lima_drv.h b/drivers/gpu/drm/lima/lima_drv.h
index c738d28854..6706c19b16 100644
--- a/drivers/gpu/drm/lima/lima_drv.h
+++ b/drivers/gpu/drm/lima/lima_drv.h
@@ -7,6 +7,7 @@
#include <drm/drm_file.h>
#include "lima_ctx.h"
+#include "lima_device.h"
extern int lima_sched_timeout_ms;
extern uint lima_heap_init_nr_pages;
@@ -39,6 +40,10 @@ struct lima_submit {
struct lima_sched_task *task;
};
+struct lima_compatible {
+ enum lima_gpu_id id;
+};
+
static inline struct lima_drm_priv *
to_lima_drm_priv(struct drm_file *file)
{
diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c
index 7ea244d876..9bb997dbb4 100644
--- a/drivers/gpu/drm/lima/lima_gem.c
+++ b/drivers/gpu/drm/lima/lima_gem.c
@@ -185,7 +185,7 @@ static int lima_gem_pin(struct drm_gem_object *obj)
if (bo->heap_size)
return -EINVAL;
- return drm_gem_shmem_pin(&bo->base);
+ return drm_gem_shmem_pin_locked(&bo->base);
}
static int lima_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map)
diff --git a/drivers/gpu/drm/lima/lima_trace.h b/drivers/gpu/drm/lima/lima_trace.h
index 494b9790b1..3a349d1030 100644
--- a/drivers/gpu/drm/lima/lima_trace.h
+++ b/drivers/gpu/drm/lima/lima_trace.h
@@ -24,7 +24,7 @@ DECLARE_EVENT_CLASS(lima_task,
__entry->task_id = task->base.id;
__entry->context = task->base.s_fence->finished.context;
__entry->seqno = task->base.s_fence->finished.seqno;
- __assign_str(pipe, task->base.sched->name);
+ __assign_str(pipe);
),
TP_printk("task=%llu, context=%u seqno=%u pipe=%s",