Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gma500: kill virtual mapping support

This isn't actually usable - we simply don't have the vmap space on a 32bit
system to do this stunt. Instead we will rely on the low level drivers
limiting the console resolution as before.

The real fix is for someone to write a page table aware version of the
framebuffer console blit functions. Good university student project
perhaps..

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Alan Cox and committed by
Dave Airlie
dffc9ceb 838fa588

+8 -45
+8 -44
drivers/gpu/drm/gma500/framebuffer.c
··· 309 309 * 310 310 * Allocate the frame buffer. In the usual case we get a GTT range that 311 311 * is stolen memory backed and life is simple. If there isn't sufficient 312 - * stolen memory or the system has no stolen memory we allocate a range 313 - * and back it with a GEM object. 312 + * we fail as we don't have the virtual mapping space to really vmap it 313 + * and the kernel console code can't handle non linear framebuffers. 314 314 * 315 - * In this case the GEM object has no handle. 316 - * 317 - * FIXME: console speed up - allocate twice the space if room and use 318 - * hardware scrolling for acceleration. 315 + * Re-address this as and if the framebuffer layer grows this ability. 319 316 */ 320 317 static struct gtt_range *psbfb_alloc(struct drm_device *dev, int aligned_size) 321 318 { ··· 325 328 return backing; 326 329 psb_gtt_free_range(dev, backing); 327 330 } 328 - /* Next try using GEM host memory */ 329 - backing = psb_gtt_alloc_range(dev, aligned_size, "fb(gem)", 0); 330 - if (backing == NULL) 331 - return NULL; 332 - 333 - /* Now back it with an object */ 334 - if (drm_gem_object_init(dev, &backing->gem, aligned_size) != 0) { 335 - psb_gtt_free_range(dev, backing); 336 - return NULL; 337 - } 338 - return backing; 331 + return NULL; 339 332 } 340 333 341 334 /** ··· 409 422 info->fix.smem_start = dev->mode_config.fb_base; 410 423 info->fix.smem_len = size; 411 424 412 - if (backing->stolen) { 413 - /* Accessed stolen memory directly */ 414 - info->screen_base = (char *)dev_priv->vram_addr + 425 + /* Accessed stolen memory directly */ 426 + info->screen_base = (char *)dev_priv->vram_addr + 415 427 backing->offset; 416 - } else { 417 - /* Pin the pages into the GTT and create a mapping to them */ 418 - psb_gtt_pin(backing); 419 - info->screen_base = vm_map_ram(backing->pages, backing->npage, 420 - -1, PAGE_KERNEL); 421 - if (info->screen_base == NULL) { 422 - psb_gtt_unpin(backing); 423 - ret = -ENOMEM; 424 - goto out_unref; 425 - } 426 - psbfb->vm_map = 1; 427 - } 428 428 info->screen_size = size; 429 429 430 430 if (dev_priv->gtt.stolen_size) { ··· 445 471 out_unref: 446 472 if (backing->stolen) 447 473 psb_gtt_free_range(dev, backing); 448 - else { 449 - if (psbfb->vm_map) 450 - vm_unmap_ram(info->screen_base, backing->npage); 474 + else 451 475 drm_gem_object_unreference(&backing->gem); 452 - } 453 476 out_err1: 454 477 mutex_unlock(&dev->struct_mutex); 455 478 psb_gtt_free_range(dev, backing); ··· 520 549 521 550 if (fbdev->psb_fb_helper.fbdev) { 522 551 info = fbdev->psb_fb_helper.fbdev; 523 - 524 - /* If this is our base framebuffer then kill any virtual map 525 - for the framebuffer layer and unpin it */ 526 - if (psbfb->vm_map) { 527 - vm_unmap_ram(info->screen_base, psbfb->gtt->npage); 528 - psb_gtt_unpin(psbfb->gtt); 529 - } 530 552 unregister_framebuffer(info); 531 553 if (info->cmap.len) 532 554 fb_dealloc_cmap(&info->cmap); ··· 729 765 dev->mode_config.funcs = (void *) &psb_mode_funcs; 730 766 731 767 /* set memory base */ 732 - /* MRST and PSB should use BAR 2*/ 768 + /* Oaktrail and Poulsbo should use BAR 2*/ 733 769 pci_read_config_dword(dev->pdev, PSB_BSM, (u32 *) 734 770 &(dev->mode_config.fb_base)); 735 771
-1
drivers/gpu/drm/gma500/framebuffer.h
··· 32 32 struct address_space *addr_space; 33 33 struct fb_info *fbdev; 34 34 struct gtt_range *gtt; 35 - bool vm_map; /* True if we must undo a vm_map_ram */ 36 35 }; 37 36 38 37 struct psb_fbdev {