diff options
author | Dave Airlie <airlied@redhat.com> | 2019-05-08 21:03:54 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2019-05-08 21:04:00 -0400 |
commit | eb85d03e01c3e9f3b0ba7282b2e3515a635decb2 (patch) | |
tree | acffc7d52bae052a8181a81725f9c44c5e432ac9 | |
parent | f2e8d169b2b96d234be7f109f8222d7fa4612899 (diff) | |
parent | 15273ffd7efdf6e9f21c4e4beef6539229167343 (diff) |
Merge tag 'drm-misc-next-fixes-2019-05-08' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
- A handful of fixes from -next that just missed feature freeze
- More panfrost fixes that went directly in -misc-next-fixes (various)
- Fix searchpaths during build (Masahiro)
- msm patch to fix the driver for chips without zap shader (Rob)
- Fix freeing imported buffers in drm_gem_cma_free_object() (Noralf)
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Rob Clark <robdclark@chromium.org>
Cc: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Sean Paul <sean@poorly.run>
Link: https://patchwork.freedesktop.org/patch/msgid/20190508205153.GA91135@art_vandelay
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/Makefile | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/Makefile | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_connector.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_gem_cma_helper.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/gvt/Makefile | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/Makefile | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/Kbuild | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/panfrost/Kconfig | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_devfreq.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_device.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_device.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_drv.c | 47 | ||||
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_gem.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_gpu.c | 19 | ||||
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_job.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 9 |
17 files changed, 75 insertions, 48 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile index f8c58c425eb9..fdd0ca4b0f0b 100644 --- a/drivers/gpu/drm/amd/amdgpu/Makefile +++ b/drivers/gpu/drm/amd/amdgpu/Makefile | |||
@@ -23,7 +23,7 @@ | |||
23 | # Makefile for the drm device driver. This driver provides support for the | 23 | # Makefile for the drm device driver. This driver provides support for the |
24 | # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. | 24 | # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. |
25 | 25 | ||
26 | FULL_AMD_PATH=$(src)/.. | 26 | FULL_AMD_PATH=$(srctree)/$(src)/.. |
27 | DISPLAY_FOLDER_NAME=display | 27 | DISPLAY_FOLDER_NAME=display |
28 | FULL_AMD_DISPLAY_PATH = $(FULL_AMD_PATH)/$(DISPLAY_FOLDER_NAME) | 28 | FULL_AMD_DISPLAY_PATH = $(FULL_AMD_PATH)/$(DISPLAY_FOLDER_NAME) |
29 | 29 | ||
diff --git a/drivers/gpu/drm/arm/display/komeda/Makefile b/drivers/gpu/drm/arm/display/komeda/Makefile index 62bd1bff66a3..412eeba8c39f 100644 --- a/drivers/gpu/drm/arm/display/komeda/Makefile +++ b/drivers/gpu/drm/arm/display/komeda/Makefile | |||
@@ -1,8 +1,8 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | 2 | ||
3 | ccflags-y := \ | 3 | ccflags-y := \ |
4 | -I$(src)/../include \ | 4 | -I $(srctree)/$(src)/../include \ |
5 | -I$(src) | 5 | -I $(srctree)/$(src) |
6 | 6 | ||
7 | komeda-y := \ | 7 | komeda-y := \ |
8 | komeda_drv.o \ | 8 | komeda_drv.o \ |
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 2355124849db..b34c3d38bf15 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c | |||
@@ -1416,12 +1416,6 @@ EXPORT_SYMBOL(drm_mode_create_scaling_mode_property); | |||
1416 | * | 1416 | * |
1417 | * The driver may place further restrictions within these minimum | 1417 | * The driver may place further restrictions within these minimum |
1418 | * and maximum bounds. | 1418 | * and maximum bounds. |
1419 | * | ||
1420 | * The semantics for the vertical blank timestamp differ when | ||
1421 | * variable refresh rate is active. The vertical blank timestamp | ||
1422 | * is defined to be an estimate using the current mode's fixed | ||
1423 | * refresh rate timings. The semantics for the page-flip event | ||
1424 | * timestamp remain the same. | ||
1425 | */ | 1419 | */ |
1426 | 1420 | ||
1427 | /** | 1421 | /** |
diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c b/drivers/gpu/drm/drm_gem_cma_helper.c index cc26625b4b33..e01ceed09e67 100644 --- a/drivers/gpu/drm/drm_gem_cma_helper.c +++ b/drivers/gpu/drm/drm_gem_cma_helper.c | |||
@@ -186,13 +186,13 @@ void drm_gem_cma_free_object(struct drm_gem_object *gem_obj) | |||
186 | 186 | ||
187 | cma_obj = to_drm_gem_cma_obj(gem_obj); | 187 | cma_obj = to_drm_gem_cma_obj(gem_obj); |
188 | 188 | ||
189 | if (cma_obj->vaddr) { | 189 | if (gem_obj->import_attach) { |
190 | dma_free_wc(gem_obj->dev->dev, cma_obj->base.size, | ||
191 | cma_obj->vaddr, cma_obj->paddr); | ||
192 | } else if (gem_obj->import_attach) { | ||
193 | if (cma_obj->vaddr) | 190 | if (cma_obj->vaddr) |
194 | dma_buf_vunmap(gem_obj->import_attach->dmabuf, cma_obj->vaddr); | 191 | dma_buf_vunmap(gem_obj->import_attach->dmabuf, cma_obj->vaddr); |
195 | drm_prime_gem_destroy(gem_obj, cma_obj->sgt); | 192 | drm_prime_gem_destroy(gem_obj, cma_obj->sgt); |
193 | } else if (cma_obj->vaddr) { | ||
194 | dma_free_wc(gem_obj->dev->dev, cma_obj->base.size, | ||
195 | cma_obj->vaddr, cma_obj->paddr); | ||
196 | } | 196 | } |
197 | 197 | ||
198 | drm_gem_object_release(gem_obj); | 198 | drm_gem_object_release(gem_obj); |
diff --git a/drivers/gpu/drm/i915/gvt/Makefile b/drivers/gpu/drm/i915/gvt/Makefile index 271fb46d4dd0..ea8324abc784 100644 --- a/drivers/gpu/drm/i915/gvt/Makefile +++ b/drivers/gpu/drm/i915/gvt/Makefile | |||
@@ -5,5 +5,5 @@ GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o firmware.o \ | |||
5 | execlist.o scheduler.o sched_policy.o mmio_context.o cmd_parser.o debugfs.o \ | 5 | execlist.o scheduler.o sched_policy.o mmio_context.o cmd_parser.o debugfs.o \ |
6 | fb_decoder.o dmabuf.o page_track.o | 6 | fb_decoder.o dmabuf.o page_track.o |
7 | 7 | ||
8 | ccflags-y += -I$(src) -I$(src)/$(GVT_DIR) | 8 | ccflags-y += -I $(srctree)/$(src) -I $(srctree)/$(src)/$(GVT_DIR)/ |
9 | i915-y += $(addprefix $(GVT_DIR)/, $(GVT_SOURCE)) | 9 | i915-y += $(addprefix $(GVT_DIR)/, $(GVT_SOURCE)) |
diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile index 72d1bfcaab7a..7a05cbf2f820 100644 --- a/drivers/gpu/drm/msm/Makefile +++ b/drivers/gpu/drm/msm/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | ccflags-y := -Idrivers/gpu/drm/msm | 2 | ccflags-y := -I $(srctree)/$(src) |
3 | ccflags-y += -Idrivers/gpu/drm/msm/disp/dpu1 | 3 | ccflags-y += -I $(srctree)/$(src)/disp/dpu1 |
4 | ccflags-$(CONFIG_DRM_MSM_DSI) += -Idrivers/gpu/drm/msm/dsi | 4 | ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(srctree)/$(src)/dsi |
5 | 5 | ||
6 | msm-y := \ | 6 | msm-y := \ |
7 | adreno/adreno_device.o \ | 7 | adreno/adreno_device.o \ |
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index ec24508b9d68..e74dce474250 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c | |||
@@ -527,6 +527,7 @@ static int a6xx_hw_init(struct msm_gpu *gpu) | |||
527 | dev_warn_once(gpu->dev->dev, | 527 | dev_warn_once(gpu->dev->dev, |
528 | "Zap shader not enabled - using SECVID_TRUST_CNTL instead\n"); | 528 | "Zap shader not enabled - using SECVID_TRUST_CNTL instead\n"); |
529 | gpu_write(gpu, REG_A6XX_RBBM_SECVID_TRUST_CNTL, 0x0); | 529 | gpu_write(gpu, REG_A6XX_RBBM_SECVID_TRUST_CNTL, 0x0); |
530 | ret = 0; | ||
530 | } | 531 | } |
531 | 532 | ||
532 | out: | 533 | out: |
diff --git a/drivers/gpu/drm/nouveau/Kbuild b/drivers/gpu/drm/nouveau/Kbuild index 581404e6544d..378c5dd692b0 100644 --- a/drivers/gpu/drm/nouveau/Kbuild +++ b/drivers/gpu/drm/nouveau/Kbuild | |||
@@ -1,7 +1,7 @@ | |||
1 | ccflags-y += -I$(src)/include | 1 | ccflags-y += -I $(srctree)/$(src)/include |
2 | ccflags-y += -I$(src)/include/nvkm | 2 | ccflags-y += -I $(srctree)/$(src)/include/nvkm |
3 | ccflags-y += -I$(src)/nvkm | 3 | ccflags-y += -I $(srctree)/$(src)/nvkm |
4 | ccflags-y += -I$(src) | 4 | ccflags-y += -I $(srctree)/$(src) |
5 | 5 | ||
6 | # NVKM - HW resource manager | 6 | # NVKM - HW resource manager |
7 | #- code also used by various userspace tools/tests | 7 | #- code also used by various userspace tools/tests |
diff --git a/drivers/gpu/drm/panfrost/Kconfig b/drivers/gpu/drm/panfrost/Kconfig index 7f5e572daa2d..591611dc4e34 100644 --- a/drivers/gpu/drm/panfrost/Kconfig +++ b/drivers/gpu/drm/panfrost/Kconfig | |||
@@ -3,7 +3,7 @@ | |||
3 | config DRM_PANFROST | 3 | config DRM_PANFROST |
4 | tristate "Panfrost (DRM support for ARM Mali Midgard/Bifrost GPUs)" | 4 | tristate "Panfrost (DRM support for ARM Mali Midgard/Bifrost GPUs)" |
5 | depends on DRM | 5 | depends on DRM |
6 | depends on ARM || ARM64 || COMPILE_TEST | 6 | depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64) |
7 | depends on MMU | 7 | depends on MMU |
8 | select DRM_SCHED | 8 | select DRM_SCHED |
9 | select IOMMU_SUPPORT | 9 | select IOMMU_SUPPORT |
diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index a8121ae67ee3..238bd1d89d43 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/regulator/consumer.h> | 7 | #include <linux/regulator/consumer.h> |
8 | 8 | ||
9 | #include "panfrost_device.h" | 9 | #include "panfrost_device.h" |
10 | #include "panfrost_devfreq.h" | ||
10 | #include "panfrost_features.h" | 11 | #include "panfrost_features.h" |
11 | #include "panfrost_issues.h" | 12 | #include "panfrost_issues.h" |
12 | #include "panfrost_gpu.h" | 13 | #include "panfrost_gpu.h" |
diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c index 91e8fb0f2b25..970f669c6d29 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.c +++ b/drivers/gpu/drm/panfrost/panfrost_device.c | |||
@@ -98,6 +98,7 @@ int panfrost_device_init(struct panfrost_device *pfdev) | |||
98 | struct resource *res; | 98 | struct resource *res; |
99 | 99 | ||
100 | mutex_init(&pfdev->sched_lock); | 100 | mutex_init(&pfdev->sched_lock); |
101 | mutex_init(&pfdev->reset_lock); | ||
101 | INIT_LIST_HEAD(&pfdev->scheduled_jobs); | 102 | INIT_LIST_HEAD(&pfdev->scheduled_jobs); |
102 | 103 | ||
103 | spin_lock_init(&pfdev->hwaccess_lock); | 104 | spin_lock_init(&pfdev->hwaccess_lock); |
diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index 1ba48d105763..56f452dfb490 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h | |||
@@ -78,6 +78,7 @@ struct panfrost_device { | |||
78 | struct list_head scheduled_jobs; | 78 | struct list_head scheduled_jobs; |
79 | 79 | ||
80 | struct mutex sched_lock; | 80 | struct mutex sched_lock; |
81 | struct mutex reset_lock; | ||
81 | 82 | ||
82 | struct { | 83 | struct { |
83 | struct devfreq *devfreq; | 84 | struct devfreq *devfreq; |
diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index c06af78ab833..94b0819ad50b 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c | |||
@@ -3,8 +3,6 @@ | |||
3 | /* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */ | 3 | /* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */ |
4 | /* Copyright 2019 Collabora ltd. */ | 4 | /* Copyright 2019 Collabora ltd. */ |
5 | 5 | ||
6 | #include <linux/bitfield.h> | ||
7 | #include <linux/dma-mapping.h> | ||
8 | #include <linux/module.h> | 6 | #include <linux/module.h> |
9 | #include <linux/of_platform.h> | 7 | #include <linux/of_platform.h> |
10 | #include <linux/pagemap.h> | 8 | #include <linux/pagemap.h> |
@@ -172,13 +170,27 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data, | |||
172 | { | 170 | { |
173 | struct panfrost_device *pfdev = dev->dev_private; | 171 | struct panfrost_device *pfdev = dev->dev_private; |
174 | struct drm_panfrost_submit *args = data; | 172 | struct drm_panfrost_submit *args = data; |
175 | struct drm_syncobj *sync_out; | 173 | struct drm_syncobj *sync_out = NULL; |
176 | struct panfrost_job *job; | 174 | struct panfrost_job *job; |
177 | int ret = 0; | 175 | int ret = 0; |
178 | 176 | ||
177 | if (!args->jc) | ||
178 | return -EINVAL; | ||
179 | |||
180 | if (args->requirements && args->requirements != PANFROST_JD_REQ_FS) | ||
181 | return -EINVAL; | ||
182 | |||
183 | if (args->out_sync > 0) { | ||
184 | sync_out = drm_syncobj_find(file, args->out_sync); | ||
185 | if (!sync_out) | ||
186 | return -ENODEV; | ||
187 | } | ||
188 | |||
179 | job = kzalloc(sizeof(*job), GFP_KERNEL); | 189 | job = kzalloc(sizeof(*job), GFP_KERNEL); |
180 | if (!job) | 190 | if (!job) { |
181 | return -ENOMEM; | 191 | ret = -ENOMEM; |
192 | goto fail_out_sync; | ||
193 | } | ||
182 | 194 | ||
183 | kref_init(&job->refcount); | 195 | kref_init(&job->refcount); |
184 | 196 | ||
@@ -190,25 +202,24 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data, | |||
190 | 202 | ||
191 | ret = panfrost_copy_in_sync(dev, file, args, job); | 203 | ret = panfrost_copy_in_sync(dev, file, args, job); |
192 | if (ret) | 204 | if (ret) |
193 | goto fail; | 205 | goto fail_job; |
194 | 206 | ||
195 | ret = panfrost_lookup_bos(dev, file, args, job); | 207 | ret = panfrost_lookup_bos(dev, file, args, job); |
196 | if (ret) | 208 | if (ret) |
197 | goto fail; | 209 | goto fail_job; |
198 | 210 | ||
199 | ret = panfrost_job_push(job); | 211 | ret = panfrost_job_push(job); |
200 | if (ret) | 212 | if (ret) |
201 | goto fail; | 213 | goto fail_job; |
202 | 214 | ||
203 | /* Update the return sync object for the job */ | 215 | /* Update the return sync object for the job */ |
204 | sync_out = drm_syncobj_find(file, args->out_sync); | 216 | if (sync_out) |
205 | if (sync_out) { | ||
206 | drm_syncobj_replace_fence(sync_out, job->render_done_fence); | 217 | drm_syncobj_replace_fence(sync_out, job->render_done_fence); |
207 | drm_syncobj_put(sync_out); | ||
208 | } | ||
209 | 218 | ||
210 | fail: | 219 | fail_job: |
211 | panfrost_job_put(job); | 220 | panfrost_job_put(job); |
221 | fail_out_sync: | ||
222 | drm_syncobj_put(sync_out); | ||
212 | 223 | ||
213 | return ret; | 224 | return ret; |
214 | } | 225 | } |
@@ -384,16 +395,15 @@ static int panfrost_probe(struct platform_device *pdev) | |||
384 | 395 | ||
385 | err = panfrost_device_init(pfdev); | 396 | err = panfrost_device_init(pfdev); |
386 | if (err) { | 397 | if (err) { |
387 | dev_err(&pdev->dev, "Fatal error during GPU init\n"); | 398 | if (err != -EPROBE_DEFER) |
399 | dev_err(&pdev->dev, "Fatal error during GPU init\n"); | ||
388 | goto err_out0; | 400 | goto err_out0; |
389 | } | 401 | } |
390 | 402 | ||
391 | dma_set_mask_and_coherent(pfdev->dev, | ||
392 | DMA_BIT_MASK(FIELD_GET(0xff00, pfdev->features.mmu_features))); | ||
393 | |||
394 | err = panfrost_devfreq_init(pfdev); | 403 | err = panfrost_devfreq_init(pfdev); |
395 | if (err) { | 404 | if (err) { |
396 | dev_err(&pdev->dev, "Fatal error during devfreq init\n"); | 405 | if (err != -EPROBE_DEFER) |
406 | dev_err(&pdev->dev, "Fatal error during devfreq init\n"); | ||
397 | goto err_out1; | 407 | goto err_out1; |
398 | } | 408 | } |
399 | 409 | ||
@@ -410,6 +420,7 @@ static int panfrost_probe(struct platform_device *pdev) | |||
410 | err_out1: | 420 | err_out1: |
411 | panfrost_device_fini(pfdev); | 421 | panfrost_device_fini(pfdev); |
412 | err_out0: | 422 | err_out0: |
423 | pm_runtime_disable(pfdev->dev); | ||
413 | drm_dev_put(ddev); | 424 | drm_dev_put(ddev); |
414 | return err; | 425 | return err; |
415 | } | 426 | } |
diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index 8a0376283a21..a5528a360ef4 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c | |||
@@ -14,7 +14,7 @@ | |||
14 | /* Called DRM core on the last userspace/kernel unreference of the | 14 | /* Called DRM core on the last userspace/kernel unreference of the |
15 | * BO. | 15 | * BO. |
16 | */ | 16 | */ |
17 | void panfrost_gem_free_object(struct drm_gem_object *obj) | 17 | static void panfrost_gem_free_object(struct drm_gem_object *obj) |
18 | { | 18 | { |
19 | struct panfrost_gem_object *bo = to_panfrost_bo(obj); | 19 | struct panfrost_gem_object *bo = to_panfrost_bo(obj); |
20 | struct panfrost_device *pfdev = obj->dev->dev_private; | 20 | struct panfrost_device *pfdev = obj->dev->dev_private; |
diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index aceaf6e44a09..58ef25573cda 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c | |||
@@ -2,8 +2,10 @@ | |||
2 | /* Copyright 2018 Marty E. Plummer <hanetzer@startmail.com> */ | 2 | /* Copyright 2018 Marty E. Plummer <hanetzer@startmail.com> */ |
3 | /* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */ | 3 | /* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */ |
4 | /* Copyright 2019 Collabora ltd. */ | 4 | /* Copyright 2019 Collabora ltd. */ |
5 | #include <linux/bitfield.h> | ||
5 | #include <linux/bitmap.h> | 6 | #include <linux/bitmap.h> |
6 | #include <linux/delay.h> | 7 | #include <linux/delay.h> |
8 | #include <linux/dma-mapping.h> | ||
7 | #include <linux/interrupt.h> | 9 | #include <linux/interrupt.h> |
8 | #include <linux/io.h> | 10 | #include <linux/io.h> |
9 | #include <linux/iopoll.h> | 11 | #include <linux/iopoll.h> |
@@ -276,13 +278,13 @@ static void panfrost_gpu_init_features(struct panfrost_device *pfdev) | |||
276 | pfdev->features.hw_issues); | 278 | pfdev->features.hw_issues); |
277 | 279 | ||
278 | dev_info(pfdev->dev, "Features: L2:0x%08x Shader:0x%08x Tiler:0x%08x Mem:0x%0x MMU:0x%08x AS:0x%x JS:0x%x", | 280 | dev_info(pfdev->dev, "Features: L2:0x%08x Shader:0x%08x Tiler:0x%08x Mem:0x%0x MMU:0x%08x AS:0x%x JS:0x%x", |
279 | gpu_read(pfdev, GPU_L2_FEATURES), | 281 | pfdev->features.l2_features, |
280 | gpu_read(pfdev, GPU_CORE_FEATURES), | 282 | pfdev->features.core_features, |
281 | gpu_read(pfdev, GPU_TILER_FEATURES), | 283 | pfdev->features.tiler_features, |
282 | gpu_read(pfdev, GPU_MEM_FEATURES), | 284 | pfdev->features.mem_features, |
283 | gpu_read(pfdev, GPU_MMU_FEATURES), | 285 | pfdev->features.mmu_features, |
284 | gpu_read(pfdev, GPU_AS_PRESENT), | 286 | pfdev->features.as_present, |
285 | gpu_read(pfdev, GPU_JS_PRESENT)); | 287 | pfdev->features.js_present); |
286 | 288 | ||
287 | dev_info(pfdev->dev, "shader_present=0x%0llx l2_present=0x%0llx", | 289 | dev_info(pfdev->dev, "shader_present=0x%0llx l2_present=0x%0llx", |
288 | pfdev->features.shader_present, pfdev->features.l2_present); | 290 | pfdev->features.shader_present, pfdev->features.l2_present); |
@@ -332,6 +334,9 @@ int panfrost_gpu_init(struct panfrost_device *pfdev) | |||
332 | 334 | ||
333 | panfrost_gpu_init_features(pfdev); | 335 | panfrost_gpu_init_features(pfdev); |
334 | 336 | ||
337 | dma_set_mask_and_coherent(pfdev->dev, | ||
338 | DMA_BIT_MASK(FIELD_GET(0xff00, pfdev->features.mmu_features))); | ||
339 | |||
335 | irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "gpu"); | 340 | irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "gpu"); |
336 | if (irq <= 0) | 341 | if (irq <= 0) |
337 | return -ENODEV; | 342 | return -ENODEV; |
diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index 0a7ed04f7d52..a5716c8fe8b3 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c | |||
@@ -384,6 +384,8 @@ static void panfrost_job_timedout(struct drm_sched_job *sched_job) | |||
384 | job_read(pfdev, JS_TAIL_LO(js)), | 384 | job_read(pfdev, JS_TAIL_LO(js)), |
385 | sched_job); | 385 | sched_job); |
386 | 386 | ||
387 | mutex_lock(&pfdev->reset_lock); | ||
388 | |||
387 | for (i = 0; i < NUM_JOB_SLOTS; i++) | 389 | for (i = 0; i < NUM_JOB_SLOTS; i++) |
388 | drm_sched_stop(&pfdev->js->queue[i].sched); | 390 | drm_sched_stop(&pfdev->js->queue[i].sched); |
389 | 391 | ||
@@ -406,6 +408,8 @@ static void panfrost_job_timedout(struct drm_sched_job *sched_job) | |||
406 | /* restart scheduler after GPU is usable again */ | 408 | /* restart scheduler after GPU is usable again */ |
407 | for (i = 0; i < NUM_JOB_SLOTS; i++) | 409 | for (i = 0; i < NUM_JOB_SLOTS; i++) |
408 | drm_sched_start(&pfdev->js->queue[i].sched, true); | 410 | drm_sched_start(&pfdev->js->queue[i].sched, true); |
411 | |||
412 | mutex_unlock(&pfdev->reset_lock); | ||
409 | } | 413 | } |
410 | 414 | ||
411 | static const struct drm_sched_backend_ops panfrost_sched_ops = { | 415 | static const struct drm_sched_backend_ops panfrost_sched_ops = { |
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 8d7a634c12c2..cb938d3cd3c2 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c | |||
@@ -448,6 +448,14 @@ static int rockchip_drm_platform_remove(struct platform_device *pdev) | |||
448 | return 0; | 448 | return 0; |
449 | } | 449 | } |
450 | 450 | ||
451 | static void rockchip_drm_platform_shutdown(struct platform_device *pdev) | ||
452 | { | ||
453 | struct drm_device *drm = platform_get_drvdata(pdev); | ||
454 | |||
455 | if (drm) | ||
456 | drm_atomic_helper_shutdown(drm); | ||
457 | } | ||
458 | |||
451 | static const struct of_device_id rockchip_drm_dt_ids[] = { | 459 | static const struct of_device_id rockchip_drm_dt_ids[] = { |
452 | { .compatible = "rockchip,display-subsystem", }, | 460 | { .compatible = "rockchip,display-subsystem", }, |
453 | { /* sentinel */ }, | 461 | { /* sentinel */ }, |
@@ -457,6 +465,7 @@ MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ids); | |||
457 | static struct platform_driver rockchip_drm_platform_driver = { | 465 | static struct platform_driver rockchip_drm_platform_driver = { |
458 | .probe = rockchip_drm_platform_probe, | 466 | .probe = rockchip_drm_platform_probe, |
459 | .remove = rockchip_drm_platform_remove, | 467 | .remove = rockchip_drm_platform_remove, |
468 | .shutdown = rockchip_drm_platform_shutdown, | ||
460 | .driver = { | 469 | .driver = { |
461 | .name = "rockchip-drm", | 470 | .name = "rockchip-drm", |
462 | .of_match_table = rockchip_drm_dt_ids, | 471 | .of_match_table = rockchip_drm_dt_ids, |