Commit ae36ce07 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 2df4ee78 10855aeb
...@@ -315,6 +315,7 @@ int ast_framebuffer_init(struct drm_device *dev, ...@@ -315,6 +315,7 @@ int ast_framebuffer_init(struct drm_device *dev,
int ast_fbdev_init(struct drm_device *dev); int ast_fbdev_init(struct drm_device *dev);
void ast_fbdev_fini(struct drm_device *dev); void ast_fbdev_fini(struct drm_device *dev);
void ast_fbdev_set_suspend(struct drm_device *dev, int state); void ast_fbdev_set_suspend(struct drm_device *dev, int state);
void ast_fbdev_set_base(struct ast_private *ast, unsigned long gpu_addr);
struct ast_bo { struct ast_bo {
struct ttm_buffer_object bo; struct ttm_buffer_object bo;
......
...@@ -365,3 +365,10 @@ void ast_fbdev_set_suspend(struct drm_device *dev, int state) ...@@ -365,3 +365,10 @@ void ast_fbdev_set_suspend(struct drm_device *dev, int state)
drm_fb_helper_set_suspend(&ast->fbdev->helper, state); drm_fb_helper_set_suspend(&ast->fbdev->helper, state);
} }
void ast_fbdev_set_base(struct ast_private *ast, unsigned long gpu_addr)
{
ast->fbdev->helper.fbdev->fix.smem_start =
ast->fbdev->helper.fbdev->apertures->ranges[0].base + gpu_addr;
ast->fbdev->helper.fbdev->fix.smem_len = ast->vram_size - gpu_addr;
}
...@@ -448,6 +448,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -448,6 +448,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
dev->mode_config.min_height = 0; dev->mode_config.min_height = 0;
dev->mode_config.preferred_depth = 24; dev->mode_config.preferred_depth = 24;
dev->mode_config.prefer_shadow = 1; dev->mode_config.prefer_shadow = 1;
dev->mode_config.fb_base = pci_resource_start(ast->dev->pdev, 0);
if (ast->chip == AST2100 || if (ast->chip == AST2100 ||
ast->chip == AST2200 || ast->chip == AST2200 ||
......
...@@ -547,6 +547,8 @@ static int ast_crtc_do_set_base(struct drm_crtc *crtc, ...@@ -547,6 +547,8 @@ static int ast_crtc_do_set_base(struct drm_crtc *crtc,
ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap); ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap);
if (ret) if (ret)
DRM_ERROR("failed to kmap fbcon\n"); DRM_ERROR("failed to kmap fbcon\n");
else
ast_fbdev_set_base(ast, gpu_addr);
} }
ast_bo_unreserve(bo); ast_bo_unreserve(bo);
......
...@@ -133,18 +133,24 @@ gk20a_instobj_size(struct nvkm_memory *memory) ...@@ -133,18 +133,24 @@ gk20a_instobj_size(struct nvkm_memory *memory)
static void __iomem * static void __iomem *
gk20a_instobj_cpu_map_dma(struct nvkm_memory *memory) gk20a_instobj_cpu_map_dma(struct nvkm_memory *memory)
{ {
#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
struct gk20a_instobj_dma *node = gk20a_instobj_dma(memory); struct gk20a_instobj_dma *node = gk20a_instobj_dma(memory);
struct device *dev = node->base.imem->base.subdev.device->dev; struct device *dev = node->base.imem->base.subdev.device->dev;
int npages = nvkm_memory_size(memory) >> 12; int npages = nvkm_memory_size(memory) >> 12;
struct page *pages[npages]; struct page *pages[npages];
int i; int i;
/* we shouldn't see a gk20a on anything but arm/arm64 anyways */
/* phys_to_page does not exist on all platforms... */ /* phys_to_page does not exist on all platforms... */
pages[0] = pfn_to_page(dma_to_phys(dev, node->handle) >> PAGE_SHIFT); pages[0] = pfn_to_page(dma_to_phys(dev, node->handle) >> PAGE_SHIFT);
for (i = 1; i < npages; i++) for (i = 1; i < npages; i++)
pages[i] = pages[0] + i; pages[i] = pages[0] + i;
return vmap(pages, npages, VM_MAP, pgprot_writecombine(PAGE_KERNEL)); return vmap(pages, npages, VM_MAP, pgprot_writecombine(PAGE_KERNEL));
#else
BUG();
return NULL;
#endif
} }
static void __iomem * static void __iomem *
......
config DRM_VC4 config DRM_VC4
tristate "Broadcom VC4 Graphics" tristate "Broadcom VC4 Graphics"
depends on ARCH_BCM2835 || COMPILE_TEST depends on ARCH_BCM2835 || COMPILE_TEST
depends on DRM depends on DRM && HAVE_DMA_ATTRS
select DRM_KMS_HELPER select DRM_KMS_HELPER
select DRM_KMS_CMA_HELPER select DRM_KMS_CMA_HELPER
select DRM_GEM_CMA_HELPER
help help
Choose this option if you have a system that has a Broadcom Choose this option if you have a system that has a Broadcom
VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835. VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment