Skip to content

Commit

Permalink
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Nov 11, 2015
2 parents 2df4ee7 + 10855ae commit ae36ce0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/gpu/drm/ast/ast_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ int ast_framebuffer_init(struct drm_device *dev,
int ast_fbdev_init(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_base(struct ast_private *ast, unsigned long gpu_addr);

struct ast_bo {
struct ttm_buffer_object bo;
Expand Down
7 changes: 7 additions & 0 deletions drivers/gpu/drm/ast/ast_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,10 @@ void ast_fbdev_set_suspend(struct drm_device *dev, int 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;
}
1 change: 1 addition & 0 deletions drivers/gpu/drm/ast/ast_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
dev->mode_config.min_height = 0;
dev->mode_config.preferred_depth = 24;
dev->mode_config.prefer_shadow = 1;
dev->mode_config.fb_base = pci_resource_start(ast->dev->pdev, 0);

if (ast->chip == AST2100 ||
ast->chip == AST2200 ||
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/ast/ast_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (ret)
DRM_ERROR("failed to kmap fbcon\n");
else
ast_fbdev_set_base(ast, gpu_addr);
}
ast_bo_unreserve(bo);

Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,24 @@ gk20a_instobj_size(struct nvkm_memory *memory)
static void __iomem *
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 device *dev = node->base.imem->base.subdev.device->dev;
int npages = nvkm_memory_size(memory) >> 12;
struct page *pages[npages];
int i;

/* we shouldn't see a gk20a on anything but arm/arm64 anyways */
/* phys_to_page does not exist on all platforms... */
pages[0] = pfn_to_page(dma_to_phys(dev, node->handle) >> PAGE_SHIFT);
for (i = 1; i < npages; i++)
pages[i] = pages[0] + i;

return vmap(pages, npages, VM_MAP, pgprot_writecombine(PAGE_KERNEL));
#else
BUG();
return NULL;
#endif
}

static void __iomem *
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/vc4/Kconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
config DRM_VC4
tristate "Broadcom VC4 Graphics"
depends on ARCH_BCM2835 || COMPILE_TEST
depends on DRM
depends on DRM && HAVE_DMA_ATTRS
select DRM_KMS_HELPER
select DRM_KMS_CMA_HELPER
select DRM_GEM_CMA_HELPER
help
Choose this option if you have a system that has a Broadcom
VC4 GPU, such as the Raspberry Pi or other BCM2708/BCM2835.
Expand Down

0 comments on commit ae36ce0

Please sign in to comment.