History

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>

Dave Airlie committed 7 years ago

Commit eb85d032 parents f2e8d16 15273ff17 files · +75 −48Browse files

Unified · Split

17 files
  1. drivers/gpu/drm/amd/amdgpu/Makefile +1 −1
  2. drivers/gpu/drm/arm/display/komeda/Makefile +2 −2
  3. drivers/gpu/drm/drm_connector.c +0 −6
  4. drivers/gpu/drm/drm_gem_cma_helper.c +4 −4
  5. drivers/gpu/drm/i915/gvt/Makefile +1 −1
  6. drivers/gpu/drm/msm/Makefile +3 −3
  7. drivers/gpu/drm/msm/adreno/a6xx_gpu.c +1 −0
  8. drivers/gpu/drm/nouveau/Kbuild +4 −4
  9. drivers/gpu/drm/panfrost/Kconfig +1 −1
  10. drivers/gpu/drm/panfrost/panfrost_devfreq.c +1 −0
  11. drivers/gpu/drm/panfrost/panfrost_device.c +1 −0
  12. drivers/gpu/drm/panfrost/panfrost_device.h +1 −0
  13. drivers/gpu/drm/panfrost/panfrost_drv.c +29 −18
  14. drivers/gpu/drm/panfrost/panfrost_gem.c +1 −1
  15. drivers/gpu/drm/panfrost/panfrost_gpu.c +12 −7
  16. drivers/gpu/drm/panfrost/panfrost_job.c +4 −0
  17. drivers/gpu/drm/rockchip/rockchip_drm_drv.c +9 −0
drivers/gpu/drm/amd/amdgpu/Makefile+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
23# Makefile for the drm device driver. This driver provides support for the23# 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
26FULL_AMD_PATH=$(src)/..26FULL_AMD_PATH=$(srctree)/$(src)/..
27DISPLAY_FOLDER_NAME=display27DISPLAY_FOLDER_NAME=display
28FULL_AMD_DISPLAY_PATH = $(FULL_AMD_PATH)/$(DISPLAY_FOLDER_NAME)28FULL_AMD_DISPLAY_PATH = $(FULL_AMD_PATH)/$(DISPLAY_FOLDER_NAME)
29 29
drivers/gpu/drm/arm/display/komeda/Makefile+2−2
@@ -1,8 +1,8 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2 2
3ccflags-y := \3ccflags-y := \
4 -I$(src)/../include \4 -I $(srctree)/$(src)/../include \
5 -I$(src)5 -I $(srctree)/$(src)
6 6
7komeda-y := \7komeda-y := \
8 komeda_drv.o \8 komeda_drv.o \
drivers/gpu/drm/drm_connector.c+0−6
@@ -1416,12 +1416,6 @@ EXPORT_SYMBOL(drm_mode_create_scaling_mode_property); · 1415 unmodified lines
1416 *1416 *
1417 * The driver may place further restrictions within these minimum1417 * 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/**
drivers/gpu/drm/drm_gem_cma_helper.c+4−4
@@ -186,13 +186,13 @@ void drm_gem_cma_free_object(struct drm_gem_object *gem_obj) · 185 unmodified lines
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);
drivers/gpu/drm/i915/gvt/Makefile+1−1
@@ -5,5 +5,5 @@ GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o firmware.o \ · 4 unmodified lines
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.o6 fb_decoder.o dmabuf.o page_track.o
7 7
8ccflags-y += -I$(src) -I$(src)/$(GVT_DIR)8ccflags-y += -I $(srctree)/$(src) -I $(srctree)/$(src)/$(GVT_DIR)/
9i915-y += $(addprefix $(GVT_DIR)/, $(GVT_SOURCE))9i915-y += $(addprefix $(GVT_DIR)/, $(GVT_SOURCE))
drivers/gpu/drm/msm/Makefile+3−3
@@ -1,7 +1,7 @@
1# SPDX-License-Identifier: GPL-2.01# SPDX-License-Identifier: GPL-2.0
2ccflags-y := -Idrivers/gpu/drm/msm2ccflags-y := -I $(srctree)/$(src)
3ccflags-y += -Idrivers/gpu/drm/msm/disp/dpu13ccflags-y += -I $(srctree)/$(src)/disp/dpu1
4ccflags-$(CONFIG_DRM_MSM_DSI) += -Idrivers/gpu/drm/msm/dsi4ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(srctree)/$(src)/dsi
5 5
6msm-y := \6msm-y := \
7 adreno/adreno_device.o \7 adreno/adreno_device.o \
drivers/gpu/drm/msm/adreno/a6xx_gpu.c+1−0
@@ -527,6 +527,7 @@ static int a6xx_hw_init(struct msm_gpu *gpu) · 526 unmodified lines
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
532out:533out:
drivers/gpu/drm/nouveau/Kbuild+4−4
@@ -1,7 +1,7 @@
1ccflags-y += -I$(src)/include1ccflags-y += -I $(srctree)/$(src)/include
2ccflags-y += -I$(src)/include/nvkm2ccflags-y += -I $(srctree)/$(src)/include/nvkm
3ccflags-y += -I$(src)/nvkm3ccflags-y += -I $(srctree)/$(src)/nvkm
4ccflags-y += -I$(src)4ccflags-y += -I $(srctree)/$(src)
5 5
6# NVKM - HW resource manager6# NVKM - HW resource manager
7#- code also used by various userspace tools/tests7#- code also used by various userspace tools/tests
drivers/gpu/drm/panfrost/Kconfig+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
3config DRM_PANFROST3config 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 DRM5 depends on DRM
6 depends on ARM || ARM64 || COMPILE_TEST6 depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
7 depends on MMU7 depends on MMU
8 select DRM_SCHED8 select DRM_SCHED
9 select IOMMU_SUPPORT9 select IOMMU_SUPPORT
drivers/gpu/drm/panfrost/panfrost_devfreq.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
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"
drivers/gpu/drm/panfrost/panfrost_device.c+1−0
@@ -98,6 +98,7 @@ int panfrost_device_init(struct panfrost_device *pfdev) · 97 unmodified lines
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);
drivers/gpu/drm/panfrost/panfrost_device.h+1−0
@@ -78,6 +78,7 @@ struct panfrost_device { · 77 unmodified lines
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;
drivers/gpu/drm/panfrost/panfrost_drv.c+29−18
@@ -3,8 +3,6 @@ · 2 unmodified lines
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, · 161 unmodified lines
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, · 5 unmodified lines
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
210fail:219fail_job:
211 panfrost_job_put(job);220 panfrost_job_put(job);
221fail_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) · 169 unmodified lines
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) · 10 unmodified lines
410err_out1:420err_out1:
411 panfrost_device_fini(pfdev);421 panfrost_device_fini(pfdev);
412err_out0:422err_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}
drivers/gpu/drm/panfrost/panfrost_gem.c+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
14/* Called DRM core on the last userspace/kernel unreference of the14/* Called DRM core on the last userspace/kernel unreference of the
15 * BO.15 * BO.
16 */16 */
17void panfrost_gem_free_object(struct drm_gem_object *obj)17static 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;
drivers/gpu/drm/panfrost/panfrost_gpu.c+12−7
@@ -2,8 +2,10 @@ · 1 unmodified line
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) · 266 unmodified lines
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) · 43 unmodified lines
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;
drivers/gpu/drm/panfrost/panfrost_job.c+4−0
@@ -384,6 +384,8 @@ static void panfrost_job_timedout(struct drm_sched_job *sched_job) · 383 unmodified lines
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) · 16 unmodified lines
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
411static const struct drm_sched_backend_ops panfrost_sched_ops = {415static const struct drm_sched_backend_ops panfrost_sched_ops = {
drivers/gpu/drm/rockchip/rockchip_drm_drv.c+9−0
@@ -448,6 +448,14 @@ static int rockchip_drm_platform_remove(struct platform_device *pdev) · 447 unmodified lines
448 return 0;448 return 0;
449}449}
450 450
451static 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
451static const struct of_device_id rockchip_drm_dt_ids[] = {459static 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); · 3 unmodified lines
457static struct platform_driver rockchip_drm_platform_driver = {465static 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,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t