summaryrefslogtreecommitdiff
path: root/linux-core/Makefile
AgeCommit message (Expand)Author
2008-06-22NV50: Initial import of kernel modesetting.Maarten Maathuis
2008-05-29modeset: disable radeon ms by defaultDave Airlie
2008-04-28Merge branch 'master' into modesetting-101Thomas Hellstrom
2008-04-22linux-core Makefile: add GIT_REVISIONPekka Paalanen
2008-01-18Made radeon_ms not always compileJakob Bornecrantz
2007-12-04radeon_ms: radeon modesetting first commit.Jerome Glisse
2007-10-17Revert "Remove the pinned buffer from the LRU when pinning."Thomas Hellstrom
2007-09-29Don't build without any optimization on Linux.Michel Dänzer
2007-09-26Allow parallel module compileKeith Packard
2007-09-19Merge branch 'origin' into bo-set-pinEric Anholt
2007-08-02Remove the pinned buffer from the LRU when pinning.Eric Anholt
2007-07-19Initial pass at converting driver to DRM infrastructure.Ian Romanick
2007-06-26Add XGI driver to Makefiles.Ian Romanick
2007-05-17nouveau: don't build the module by defaultStephane Marchesin
2007-04-07fixup install target, not sure what I was smokin...Dave Airlie
2007-04-05add an install target to the drm modules makefileDave Airlie
2007-03-19Remove old i830 kernel driver.Alan Hourihane
2006-12-20Merge branch 'nouveau-1'Dave Airlie
2006-12-20fixup symlinks via MakefileDave Airlie
2006-12-19drm: remove all 2.4 support for drm development tree.Dave Airlie
2006-12-01Track linux-core symlinks in git.Michel Dänzer
2006-10-15Merge branch 'master' of git://anongit.freedesktop.org/git/mesa/drm into nouv...Stephane Marchesin
2006-09-28Add support for tracking drawable information to coreMichel Dänzer
2006-08-27initial import of nouveau code from nouveau CVSDave Airlie
2006-06-06Merge in the drm-sman-branchThomas Hellstrom
2006-02-18major realigment of DRM CVS with kernel code, makes integration much easierDave Airlie
2005-10-06Skeleton nv drm driver, to enable DMA in EXA. (Lars Knoll, minor updates byAdam Jackson
2005-09-11fix makefile bugDave Airlie
2005-07-20Add latest r300 support from r300.sf.net CVS. Patch submitted by volodya,Eric Anholt
2005-06-29Remove the AGP requirement from Makefile and Kconfig for MGA. Remove theIan Romanick
2005-06-29Move to linux specific directoryAlan Hourihane
2005-05-17Savage doesn't require AGP any more. Enable build even without CONFIG_AGP.Felix Kuehling
2005-03-28Via updates:Thomas Hellstrom
2005-01-19Fix cut & paste problemAlan Hourihane
2005-01-07via updates: moved the verifier state struct to dev_priv. Implemented AGPThomas Hellstrom
2005-01-01Completeley rewritten Savage DRM which can be considered secure (moduloFelix Kuehling
2004-12-03Added 3D functionality to the via command verifier. Modified the viaThomas Hellstrom
2004-09-30Remove unused drm_module.hJon Smirl
2004-09-27First check in for DRM that splits core from personality modulesJon Smirl
2004-09-27Flip the 2.4 check so that it looks for 2.6 instead. This will allow buildsJon Smirl
2004-09-24Makefile reminder to build in 2.6 when on 2.6Jon Smirl
2004-09-24Create new linux-2.6 build. Move all gpl files into the 2.6 build. If youJon Smirl
2004-09-231) switches from class_sysfs to drm sysfs implementation to allowJon Smirl
2004-08-29fix up some small things ffb (no idea if it works or not ..)Dave Airlie
2004-08-29Drop GAMMA DRM from a great height ...Dave Airlie
2004-08-24Merged drmfntbl-0-0-2Dave Airlie
2004-08-24This patch adds three new ioctl's to the VIA Unichrome/Pro DRM driver:Erdi Chen
2004-08-172.6.8.1 has changed the links in /lib/modulesDave Airlie
2004-07-14allow O= usage for Linux 2.6 kernel building in another directoryDave Airlie
2004-07-08Add two items to Makefile clean XFree86 bug: Reported by: Submitted by:Jon Smirl
n class="hl kwd">on_each_cpu(drm_ttm_ipi_handler, NULL, 1, 1) != 0) DRM_ERROR("Timed out waiting for drm cache flush.\n"); } /* * Use kmalloc if possible. Otherwise fall back to vmalloc. */ static void ttm_alloc_pages(drm_ttm_t *ttm) { unsigned long size = ttm->num_pages * sizeof(*ttm->pages); ttm->pages = NULL; if (drm_alloc_memctl(size)) return; if (size <= PAGE_SIZE) { ttm->pages = drm_calloc(1, size, DRM_MEM_TTM); } if (!ttm->pages) { ttm->pages = vmalloc_user(size); if (ttm->pages) ttm->page_flags |= DRM_TTM_PAGE_VMALLOC; } if (!ttm->pages) { drm_free_memctl(size); } } static void ttm_free_pages(drm_ttm_t *ttm) { unsigned long size = ttm->num_pages * sizeof(*ttm->pages); if (ttm->page_flags & DRM_TTM_PAGE_VMALLOC) { vfree(ttm->pages); ttm->page_flags &= ~DRM_TTM_PAGE_VMALLOC; } else { drm_free(ttm->pages, size, DRM_MEM_TTM); } drm_free_memctl(size); ttm->pages = NULL; } struct page *drm_ttm_alloc_page(void) { struct page *page; if (drm_alloc_memctl(PAGE_SIZE)) { return NULL; } page = alloc_page(GFP_KERNEL | __GFP_ZERO | GFP_DMA32); if (!page) { drm_free_memctl(PAGE_SIZE); return NULL; } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) SetPageLocked(page); #else SetPageReserved(page); #endif return page; } /* * Change caching policy for the linear kernel map * for range of pages in a ttm. */ static int drm_set_caching(drm_ttm_t * ttm, int noncached) { int i; struct page **cur_page; int do_tlbflush = 0; if ((ttm->page_flags & DRM_TTM_PAGE_UNCACHED) == noncached) return 0; if (noncached) drm_ttm_cache_flush(); for (i = 0; i < ttm->num_pages; ++i) { cur_page = ttm->pages + i; if (*cur_page) { if (!PageHighMem(*cur_page)) { if (noncached) { map_page_into_agp(*cur_page); } else { unmap_page_from_agp(*cur_page); } do_tlbflush = 1; } } } if (do_tlbflush) flush_agp_mappings(); DRM_MASK_VAL(ttm->page_flags, DRM_TTM_PAGE_UNCACHED, noncached); return 0; } /* * Free all resources associated with a ttm. */ int drm_destroy_ttm(drm_ttm_t * ttm) { int i; struct page **cur_page; drm_ttm_backend_t *be; if (!ttm) return 0; be = ttm->be; if (be) { be->destroy(be); ttm->be = NULL; } if (ttm->pages) { drm_buffer_manager_t *bm = &ttm->dev->bm; if (ttm->page_flags & DRM_TTM_PAGE_UNCACHED) drm_set_caching(ttm, 0); for (i = 0; i < ttm->num_pages; ++i) { cur_page = ttm->pages + i; if (*cur_page) { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)) unlock_page(*cur_page); #else ClearPageReserved(*cur_page); #endif if (page_count(*cur_page) != 1) { DRM_ERROR("Erroneous page count. " "Leaking pages.\n"); } if (page_mapped(*cur_page)) { DRM_ERROR("Erroneous map count. " "Leaking page mappings.\n"); } __free_page(*cur_page); drm_free_memctl(PAGE_SIZE); --bm->cur_pages; } } ttm_free_pages(ttm); } drm_ctl_free(ttm, sizeof(*ttm), DRM_MEM_TTM); return 0; } static int drm_ttm_populate(drm_ttm_t * ttm) { struct page *page; unsigned long i; drm_buffer_manager_t *bm; drm_ttm_backend_t *be; if (ttm->state != ttm_unpopulated) return 0; bm = &ttm->dev->bm; be = ttm->be; for (i = 0; i < ttm->num_pages; ++i) { page = ttm->pages[i]; if (!page) { page = drm_ttm_alloc_page(); if (!page) return -ENOMEM; ttm->pages[i] = page; ++bm->cur_pages; } } be->populate(be, ttm->num_pages, ttm->pages); ttm->state = ttm_unbound; return 0; } /* * Initialize a ttm. */ drm_ttm_t *drm_ttm_init(struct drm_device *dev, unsigned long size) { drm_bo_driver_t *bo_driver = dev->driver->bo_driver; drm_ttm_t *ttm; if (!bo_driver) return NULL; ttm = drm_ctl_calloc(1, sizeof(*ttm), DRM_MEM_TTM); if (!ttm) return NULL; ttm->dev = dev; atomic_set(&ttm->vma_count, 0); ttm->destroy = 0; ttm->num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; ttm->page_flags = 0; /* * Account also for AGP module memory usage. */ ttm_alloc_pages(ttm); if (!ttm->pages) { drm_destroy_ttm(ttm); DRM_ERROR("Failed allocating page table\n"); return NULL; } ttm->be = bo_driver->create_ttm_backend_entry(dev); if (!ttm->be) { drm_destroy_ttm(ttm); DRM_ERROR("Failed creating ttm backend entry\n"); return NULL; } ttm->state = ttm_unpopulated; return ttm; } /* * Unbind a ttm region from the aperture. */ void drm_ttm_evict(drm_ttm_t * ttm) { drm_ttm_backend_t *be = ttm->be; int ret; if (ttm->state == ttm_bound) { ret = be->unbind(be); BUG_ON(ret); } ttm->state = ttm_evicted; } void drm_ttm_fixup_caching(drm_ttm_t * ttm) { if (ttm->state == ttm_evicted) { drm_ttm_backend_t *be = ttm->be; if (be->needs_ub_cache_adjust(be)) { drm_set_caching(ttm, 0); } ttm->state = ttm_unbound; } } void drm_ttm_unbind(drm_ttm_t * ttm) { if (ttm->state == ttm_bound) drm_ttm_evict(ttm); drm_ttm_fixup_caching(ttm); } int drm_bind_ttm(drm_ttm_t * ttm, int cached, unsigned long aper_offset) { int ret = 0; drm_ttm_backend_t *be; if (!ttm) return -EINVAL; if (ttm->state == ttm_bound) return 0; be = ttm->be; ret = drm_ttm_populate(ttm); if (ret) return ret; if (ttm->state == ttm_unbound && !cached) { drm_set_caching(ttm, DRM_TTM_PAGE_UNCACHED); } if ((ret = be->bind(be, aper_offset, cached))) { ttm->state = ttm_evicted; DRM_ERROR("Couldn't bind backend.\n"); return ret; } ttm->aper_offset = aper_offset; ttm->state = ttm_bound; return 0; }