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
2323 # Makefile for the drm device driver. This driver provides support for the
2424 # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
2525
26−FULL_AMD_PATH=$(src)/..
26+FULL_AMD_PATH=$(srctree)/$(src)/..
2727 DISPLAY_FOLDER_NAME=display
2828 FULL_AMD_DISPLAY_PATH = $(FULL_AMD_PATH)/$(DISPLAY_FOLDER_NAME)
2929
drivers/gpu/drm/arm/display/komeda/Makefile+2−2
@@ -1,8 +1,8 @@
11 # SPDX-License-Identifier: GPL-2.0
22
33 ccflags-y := \
4− -I$(src)/../include \
5− -I$(src)
4+ -I $(srctree)/$(src)/../include \
5+ -I $(srctree)/$(src)
66
77 komeda-y := \
88 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
14161416 *
14171417 * The driver may place further restrictions within these minimum
14181418 * 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.
14251419 */
14261420
14271421 /**
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
186186
187187 cma_obj = to_drm_gem_cma_obj(gem_obj);
188188
189− if (cma_obj->vaddr) {
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) {
189+ if (gem_obj->import_attach) {
193190 if (cma_obj->vaddr)
194191 dma_buf_vunmap(gem_obj->import_attach->dmabuf, cma_obj->vaddr);
195192 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);
196196 }
197197
198198 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
55 execlist.o scheduler.o sched_policy.o mmio_context.o cmd_parser.o debugfs.o \
66 fb_decoder.o dmabuf.o page_track.o
77
8−ccflags-y += -I$(src) -I$(src)/$(GVT_DIR)
8+ccflags-y += -I $(srctree)/$(src) -I $(srctree)/$(src)/$(GVT_DIR)/
99 i915-y += $(addprefix $(GVT_DIR)/, $(GVT_SOURCE))
drivers/gpu/drm/msm/Makefile+3−3
@@ -1,7 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0
2−ccflags-y := -Idrivers/gpu/drm/msm
3−ccflags-y += -Idrivers/gpu/drm/msm/disp/dpu1
4−ccflags-$(CONFIG_DRM_MSM_DSI) += -Idrivers/gpu/drm/msm/dsi
2+ccflags-y := -I $(srctree)/$(src)
3+ccflags-y += -I $(srctree)/$(src)/disp/dpu1
4+ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(srctree)/$(src)/dsi
55
66 msm-y := \
77 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
527527 dev_warn_once(gpu->dev->dev,
528528 "Zap shader not enabled - using SECVID_TRUST_CNTL instead\n");
529529 gpu_write(gpu, REG_A6XX_RBBM_SECVID_TRUST_CNTL, 0x0);
530+ ret = 0;
530531 }
531532
532533 out:
drivers/gpu/drm/nouveau/Kbuild+4−4
@@ -1,7 +1,7 @@
1−ccflags-y += -I$(src)/include
2−ccflags-y += -I$(src)/include/nvkm
3−ccflags-y += -I$(src)/nvkm
4−ccflags-y += -I$(src)
1+ccflags-y += -I $(srctree)/$(src)/include
2+ccflags-y += -I $(srctree)/$(src)/include/nvkm
3+ccflags-y += -I $(srctree)/$(src)/nvkm
4+ccflags-y += -I $(srctree)/$(src)
55
66 # NVKM - HW resource manager
77 #- code also used by various userspace tools/tests
drivers/gpu/drm/panfrost/Kconfig+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 config DRM_PANFROST
44 tristate "Panfrost (DRM support for ARM Mali Midgard/Bifrost GPUs)"
55 depends on DRM
6− depends on ARM || ARM64 || COMPILE_TEST
6+ depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
77 depends on MMU
88 select DRM_SCHED
99 select IOMMU_SUPPORT
drivers/gpu/drm/panfrost/panfrost_devfreq.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <linux/regulator/consumer.h>
88
99 #include "panfrost_device.h"
10+#include "panfrost_devfreq.h"
1011 #include "panfrost_features.h"
1112 #include "panfrost_issues.h"
1213 #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
9898 struct resource *res;
9999
100100 mutex_init(&pfdev->sched_lock);
101+ mutex_init(&pfdev->reset_lock);
101102 INIT_LIST_HEAD(&pfdev->scheduled_jobs);
102103
103104 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
7878 struct list_head scheduled_jobs;
7979
8080 struct mutex sched_lock;
81+ struct mutex reset_lock;
8182
8283 struct {
8384 struct devfreq *devfreq;
drivers/gpu/drm/panfrost/panfrost_drv.c+29−18
@@ -3,8 +3,6 @@ · 2 unmodified lines
33 /* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */
44 /* Copyright 2019 Collabora ltd. */
55
6−#include <linux/bitfield.h>
7−#include <linux/dma-mapping.h>
86 #include <linux/module.h>
97 #include <linux/of_platform.h>
108 #include <linux/pagemap.h>
@@ -172,13 +170,27 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data, · 161 unmodified lines
172170 {
173171 struct panfrost_device *pfdev = dev->dev_private;
174172 struct drm_panfrost_submit *args = data;
175− struct drm_syncobj *sync_out;
173+ struct drm_syncobj *sync_out = NULL;
176174 struct panfrost_job *job;
177175 int ret = 0;
178176
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+
179189 job = kzalloc(sizeof(*job), GFP_KERNEL);
180− if (!job)
181− return -ENOMEM;
190+ if (!job) {
191+ ret = -ENOMEM;
192+ goto fail_out_sync;
193+ }
182194
183195 kref_init(&job->refcount);
184196
@@ -190,25 +202,24 @@ static int panfrost_ioctl_submit(struct drm_device *dev, void *data, · 5 unmodified lines
190202
191203 ret = panfrost_copy_in_sync(dev, file, args, job);
192204 if (ret)
193− goto fail;
205+ goto fail_job;
194206
195207 ret = panfrost_lookup_bos(dev, file, args, job);
196208 if (ret)
197− goto fail;
209+ goto fail_job;
198210
199211 ret = panfrost_job_push(job);
200212 if (ret)
201− goto fail;
213+ goto fail_job;
202214
203215 /* Update the return sync object for the job */
204− sync_out = drm_syncobj_find(file, args->out_sync);
205− if (sync_out) {
216+ if (sync_out)
206217 drm_syncobj_replace_fence(sync_out, job->render_done_fence);
207− drm_syncobj_put(sync_out);
208− }
209218
210−fail:
219+fail_job:
211220 panfrost_job_put(job);
221+fail_out_sync:
222+ drm_syncobj_put(sync_out);
212223
213224 return ret;
214225 }
@@ -384,16 +395,15 @@ static int panfrost_probe(struct platform_device *pdev) · 169 unmodified lines
384395
385396 err = panfrost_device_init(pfdev);
386397 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");
388400 goto err_out0;
389401 }
390402
391− dma_set_mask_and_coherent(pfdev->dev,
392− DMA_BIT_MASK(FIELD_GET(0xff00, pfdev->features.mmu_features)));
393−
394403 err = panfrost_devfreq_init(pfdev);
395404 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");
397407 goto err_out1;
398408 }
399409
@@ -410,6 +420,7 @@ static int panfrost_probe(struct platform_device *pdev) · 10 unmodified lines
410420 err_out1:
411421 panfrost_device_fini(pfdev);
412422 err_out0:
423+ pm_runtime_disable(pfdev->dev);
413424 drm_dev_put(ddev);
414425 return err;
415426 }
drivers/gpu/drm/panfrost/panfrost_gem.c+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 /* Called DRM core on the last userspace/kernel unreference of the
1515 * BO.
1616 */
17−void panfrost_gem_free_object(struct drm_gem_object *obj)
17+static void panfrost_gem_free_object(struct drm_gem_object *obj)
1818 {
1919 struct panfrost_gem_object *bo = to_panfrost_bo(obj);
2020 struct panfrost_device *pfdev = obj->dev->dev_private;
drivers/gpu/drm/panfrost/panfrost_gpu.c+12−7
@@ -2,8 +2,10 @@ · 1 unmodified line
22 /* Copyright 2018 Marty E. Plummer <hanetzer@startmail.com> */
33 /* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */
44 /* Copyright 2019 Collabora ltd. */
5+#include <linux/bitfield.h>
56 #include <linux/bitmap.h>
67 #include <linux/delay.h>
8+#include <linux/dma-mapping.h>
79 #include <linux/interrupt.h>
810 #include <linux/io.h>
911 #include <linux/iopoll.h>
@@ -276,13 +278,13 @@ static void panfrost_gpu_init_features(struct panfrost_device *pfdev) · 266 unmodified lines
276278 pfdev->features.hw_issues);
277279
278280 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),
280− gpu_read(pfdev, GPU_CORE_FEATURES),
281− gpu_read(pfdev, GPU_TILER_FEATURES),
282− gpu_read(pfdev, GPU_MEM_FEATURES),
283− gpu_read(pfdev, GPU_MMU_FEATURES),
284− gpu_read(pfdev, GPU_AS_PRESENT),
285− gpu_read(pfdev, GPU_JS_PRESENT));
281+ pfdev->features.l2_features,
282+ pfdev->features.core_features,
283+ pfdev->features.tiler_features,
284+ pfdev->features.mem_features,
285+ pfdev->features.mmu_features,
286+ pfdev->features.as_present,
287+ pfdev->features.js_present);
286288
287289 dev_info(pfdev->dev, "shader_present=0x%0llx l2_present=0x%0llx",
288290 pfdev->features.shader_present, pfdev->features.l2_present);
@@ -332,6 +334,9 @@ int panfrost_gpu_init(struct panfrost_device *pfdev) · 43 unmodified lines
332334
333335 panfrost_gpu_init_features(pfdev);
334336
337+ dma_set_mask_and_coherent(pfdev->dev,
338+ DMA_BIT_MASK(FIELD_GET(0xff00, pfdev->features.mmu_features)));
339+
335340 irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "gpu");
336341 if (irq <= 0)
337342 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
384384 job_read(pfdev, JS_TAIL_LO(js)),
385385 sched_job);
386386
387+ mutex_lock(&pfdev->reset_lock);
388+
387389 for (i = 0; i < NUM_JOB_SLOTS; i++)
388390 drm_sched_stop(&pfdev->js->queue[i].sched);
389391
@@ -406,6 +408,8 @@ static void panfrost_job_timedout(struct drm_sched_job *sched_job) · 16 unmodified lines
406408 /* restart scheduler after GPU is usable again */
407409 for (i = 0; i < NUM_JOB_SLOTS; i++)
408410 drm_sched_start(&pfdev->js->queue[i].sched, true);
411+
412+ mutex_unlock(&pfdev->reset_lock);
409413 }
410414
411415 static 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
448448 return 0;
449449 }
450450
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+
451459 static const struct of_device_id rockchip_drm_dt_ids[] = {
452460 { .compatible = "rockchip,display-subsystem", },
453461 { /* sentinel */ },
@@ -457,6 +465,7 @@ MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ids); · 3 unmodified lines
457465 static struct platform_driver rockchip_drm_platform_driver = {
458466 .probe = rockchip_drm_platform_probe,
459467 .remove = rockchip_drm_platform_remove,
468+ .shutdown = rockchip_drm_platform_shutdown,
460469 .driver = {
461470 .name = "rockchip-drm",
462471 .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