diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-10 23:37:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-10 23:37:28 -0500 |
commit | ae36ce07abbdde3521dc0ef7e32143b88718cd21 (patch) | |
tree | 197976433d076525dbb35f0a246d565787ed9c96 | |
parent | 2df4ee78d042ee3d17cbebd51e31b300286549dc (diff) | |
parent | 10855aeb1e78533c041065b33e34315e1f381c2e (diff) |
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie:
"Two build fixes, one for VC4, one for nouveau where the ARM only code
is doing something a bit strange. While people are discussing that,
just workaround it and fix the build for now. The code in question
will never get used on anything non-ARM anyways.
Also one fix for AST that SuSE had been hiding in their kernel, that
allows all fbdev apps to work on that driver"
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
drm/nouveau: fix build failures on all non ARM.
drm/ast: Initialized data needed to map fbdev memory
drm/vc4: Add dependency on HAVE_DMA_ATTRS, and select DRM_GEM_CMA_HELPER
-rw-r--r-- | drivers/gpu/drm/ast/ast_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/ast/ast_fb.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/ast/ast_main.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/ast/ast_mode.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/vc4/Kconfig | 3 |
6 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index 86205a28e56b..05f6522c0457 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h | |||
@@ -315,6 +315,7 @@ int ast_framebuffer_init(struct drm_device *dev, | |||
315 | int ast_fbdev_init(struct drm_device *dev); | 315 | int ast_fbdev_init(struct drm_device *dev); |
316 | void ast_fbdev_fini(struct drm_device *dev); | 316 | void ast_fbdev_fini(struct drm_device *dev); |
317 | void ast_fbdev_set_suspend(struct drm_device *dev, int state); | 317 | void ast_fbdev_set_suspend(struct drm_device *dev, int state); |
318 | void ast_fbdev_set_base(struct ast_private *ast, unsigned long gpu_addr); | ||
318 | 319 | ||
319 | struct ast_bo { | 320 | struct ast_bo { |
320 | struct ttm_buffer_object bo; | 321 | struct ttm_buffer_object bo; |
diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c index f31db28a684b..a37e7ea4a00c 100644 --- a/drivers/gpu/drm/ast/ast_fb.c +++ b/drivers/gpu/drm/ast/ast_fb.c | |||
@@ -365,3 +365,10 @@ void ast_fbdev_set_suspend(struct drm_device *dev, int state) | |||
365 | 365 | ||
366 | drm_fb_helper_set_suspend(&ast->fbdev->helper, state); | 366 | drm_fb_helper_set_suspend(&ast->fbdev->helper, state); |
367 | } | 367 | } |
368 | |||
369 | void ast_fbdev_set_base(struct ast_private *ast, unsigned long gpu_addr) | ||
370 | { | ||
371 | ast->fbdev->helper.fbdev->fix.smem_start = | ||
372 | ast->fbdev->helper.fbdev->apertures->ranges[0].base + gpu_addr; | ||
373 | ast->fbdev->helper.fbdev->fix.smem_len = ast->vram_size - gpu_addr; | ||
374 | } | ||
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index 838217f8ce7d..541a610667ad 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c | |||
@@ -448,6 +448,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags) | |||
448 | dev->mode_config.min_height = 0; | 448 | dev->mode_config.min_height = 0; |
449 | dev->mode_config.preferred_depth = 24; | 449 | dev->mode_config.preferred_depth = 24; |
450 | dev->mode_config.prefer_shadow = 1; | 450 | dev->mode_config.prefer_shadow = 1; |
451 | dev->mode_config.fb_base = pci_resource_start(ast->dev->pdev, 0); | ||
451 | 452 | ||
452 | if (ast->chip == AST2100 || | 453 | if (ast->chip == AST2100 || |
453 | ast->chip == AST2200 || | 454 | ast->chip == AST2200 || |
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index b7ee2634e47c..69d19f3304a5 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c | |||
@@ -547,6 +547,8 @@ static int ast_crtc_do_set_base(struct drm_crtc *crtc, | |||
547 | ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap); | 547 | ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap); |
548 | if (ret) | 548 | if (ret) |
549 | DRM_ERROR("failed to kmap fbcon\n"); | 549 | DRM_ERROR("failed to kmap fbcon\n"); |
550 | else | ||
551 | ast_fbdev_set_base(ast, gpu_addr); | ||
550 | } | 552 | } |
551 | ast_bo_unreserve(bo); | 553 | ast_bo_unreserve(bo); |
552 | 554 | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c index fc419bb8eab7..14107b5b7811 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c | |||
@@ -133,18 +133,24 @@ gk20a_instobj_size(struct nvkm_memory *memory) | |||
133 | static void __iomem * | 133 | static void __iomem * |
134 | gk20a_instobj_cpu_map_dma(struct nvkm_memory *memory) | 134 | gk20a_instobj_cpu_map_dma(struct nvkm_memory *memory) |
135 | { | 135 | { |
136 | #if defined(CONFIG_ARM) || defined(CONFIG_ARM64) | ||
136 | struct gk20a_instobj_dma *node = gk20a_instobj_dma(memory); | 137 | struct gk20a_instobj_dma *node = gk20a_instobj_dma(memory); |
137 | struct device *dev = node->base.imem->base.subdev.device->dev; | 138 | struct device *dev = node->base.imem->base.subdev.device->dev; |
138 | int npages = nvkm_memory_size(memory) >> 12; | 139 | int npages = nvkm_memory_size(memory) >> 12; |
139 | struct page *pages[npages]; | 140 | struct page *pages[npages]; |
140 | int i; | 141 | int i; |
141 | 142 | ||
143 | /* we shouldn't see a gk20a on anything but arm/arm64 anyways */ | ||
142 | /* phys_to_page does not exist on all platforms... */ | 144 | /* phys_to_page does not exist on all platforms... */ |
143 | pages[0] = pfn_to_page(dma_to_phys(dev, node->handle) >> PAGE_SHIFT); | 145 | pages[0] = pfn_to_page(dma_to_phys(dev, node->handle) >> PAGE_SHIFT); |
144 | for (i = 1; i < npages; i++) | 146 | for (i = 1; i < npages; i++) |
145 | pages[i] = pages[0] + i; | 147 | pages[i] = pages[0] + i; |
146 | 148 | ||
147 | return vmap(pages, npages, VM_MAP, pgprot_writecombine(PAGE_KERNEL)); | 149 | return vmap(pages, npages, VM_MAP, pgprot_writecombine(PAGE_KERNEL)); |
150 | #else | ||
151 | BUG(); | ||
152 | return NULL; | ||
153 | #endif | ||
148 | } | 154 | } |
149 | 155 | ||
150 | static void __iomem * | 156 | static void __iomem * |
diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig index e502802d74b6..2d7d115ddf3f 100644 --- a/drivers/gpu/drm/vc4/Kconfig +++ b/drivers/gpu/drm/vc4/Kconfig | |||
@@ -1,9 +1,10 @@ | |||
1 | config DRM_VC4 | 1 | config DRM_VC4 |
2 | tristate "Broadcom VC4 Graphics" | 2 | tristate "Broadcom VC4 Graphics" |
3 | depends on ARCH_BCM2835 || COMPILE_TEST | 3 | depends on ARCH_BCM2835 || COMPILE_TEST |
4 | depends on DRM | 4 | depends on DRM && HAVE_DMA_ATTRS |
5 | select DRM_KMS_HELPER | 5 | select DRM_KMS_HELPER |
6 | select DRM_KMS_CMA_HELPER | 6 | select DRM_KMS_CMA_HELPER |
7 | select DRM_GEM_CMA_HELPER | ||
7 | help | 8 | help |
8 | Choose this option if you have a system that has a Broadcom | 9 | Choose this option if you have a system that has a Broadcom |
9 | VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835. | 10 | VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835. |