summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-11-15 10:42:47 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-11-15 10:42:47 +0100
commitd1b0258b32ad2af99f3aff4f0aedea676d0ff421 (patch)
tree7ad39b748396e0ccbf12043c0a8f879b4f9e6503
parentca499f4d14ae29159f13957f2adc0536c71bf6d4 (diff)
parent6206091e5f300616c27dc834922f2976d97f72d4 (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
-rw-r--r--linux-core/drm_bo.c8
-rw-r--r--linux-core/drm_objects.h1
-rw-r--r--linux-core/drm_ttm.c16
3 files changed, 6 insertions, 19 deletions
diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c
index a2918757..e912eb21 100644
--- a/linux-core/drm_bo.c
+++ b/linux-core/drm_bo.c
@@ -2213,9 +2213,7 @@ int drm_bo_driver_finish(struct drm_device *dev)
if (list_empty(&bm->unfenced))
DRM_DEBUG("Unfenced list was clean\n");
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15))
- unlock_page(bm->dummy_read_page);
-#else
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
ClearPageReserved(bm->dummy_read_page);
#endif
__free_page(bm->dummy_read_page);
@@ -2251,9 +2249,7 @@ int drm_bo_driver_init(struct drm_device *dev)
goto out_unlock;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15))
- SetPageLocked(bm->dummy_read_page);
-#else
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
SetPageReserved(bm->dummy_read_page);
#endif
diff --git a/linux-core/drm_objects.h b/linux-core/drm_objects.h
index e7730c99..394a2721 100644
--- a/linux-core/drm_objects.h
+++ b/linux-core/drm_objects.h
@@ -278,7 +278,6 @@ struct drm_ttm_backend {
};
struct drm_ttm {
- struct mm_struct *user_mm;
struct page *dummy_read_page;
struct page **pages;
uint32_t page_flags;
diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c
index 1a61ef62..777dd2ca 100644
--- a/linux-core/drm_ttm.c
+++ b/linux-core/drm_ttm.c
@@ -92,9 +92,7 @@ static struct page *drm_ttm_alloc_page(void)
drm_free_memctl(PAGE_SIZE);
return NULL;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15))
- SetPageLocked(page);
-#else
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
SetPageReserved(page);
#endif
return page;
@@ -141,7 +139,6 @@ static int drm_set_caching(struct drm_ttm *ttm, int noncached)
static void drm_ttm_free_user_pages(struct drm_ttm *ttm)
{
- struct mm_struct *mm = ttm->user_mm;
int write;
int dirty;
struct page *page;
@@ -151,7 +148,6 @@ static void drm_ttm_free_user_pages(struct drm_ttm *ttm)
write = ((ttm->page_flags & DRM_TTM_PAGE_USER_WRITE) != 0);
dirty = ((ttm->page_flags & DRM_TTM_PAGE_USER_DIRTY) != 0);
- down_read(&mm->mmap_sem);
for (i = 0; i < ttm->num_pages; ++i) {
page = ttm->pages[i];
if (page == NULL)
@@ -163,12 +159,11 @@ static void drm_ttm_free_user_pages(struct drm_ttm *ttm)
}
if (write && dirty && !PageReserved(page))
- SetPageDirty(page);
+ set_page_dirty_lock(page);
ttm->pages[i] = NULL;
- page_cache_release(page);
+ put_page(page);
}
- up_read(&mm->mmap_sem);
}
static void drm_ttm_free_alloced_pages(struct drm_ttm *ttm)
@@ -180,9 +175,7 @@ static void drm_ttm_free_alloced_pages(struct drm_ttm *ttm)
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
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
ClearPageReserved(*cur_page);
#endif
if (page_count(*cur_page) != 1)
@@ -262,7 +255,6 @@ int drm_ttm_set_user(struct drm_ttm *ttm,
BUG_ON(num_pages != ttm->num_pages);
- ttm->user_mm = mm;
ttm->dummy_read_page = dummy_read_page;
ttm->page_flags |= DRM_TTM_PAGE_USER |
((write) ? DRM_TTM_PAGE_USER_WRITE : 0);