From patchwork Thu Feb 22 15:02:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 10235703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4890060224 for ; Thu, 22 Feb 2018 15:02:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 410E428BF2 for ; Thu, 22 Feb 2018 15:02:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 356A828C15; Thu, 22 Feb 2018 15:02:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 21D4628BF2 for ; Thu, 22 Feb 2018 15:02:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6623B6EE2A; Thu, 22 Feb 2018 15:02:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC02A6EE24 for ; Thu, 22 Feb 2018 15:02:26 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id z12so10900821wrg.4 for ; Thu, 22 Feb 2018 07:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=IVbulZmkPH3LRfxaVHxkDwCPhGtbIef2G0HNhGUIclQ=; b=ckhaL4Hro1h4/T786jGMD6Bzqq6v7bA5DPVhwZJnUevol23ucDpXnZD9MtdZW/Tl7F 7TkSAdxm0li+rSHwOKKYTSb8JOS+xeAFjj8h8Cbid0N0rM4qnjjMeuOb/qGEXzld9OEB LrfcbxbbRso5ajvrAd4FsEhm4Nw7lz+QOseDQbbqZrDLB7TZ3JJkSBxteaWOWej4NWKE Jo6Mkuvghp+32EFJM509heK3Yq8owhu/hjKujs1yaUFoOD9mDp2oyeeHANHmxg9NyDsz UU8Wn4tig3K4xVf6nbPJUHq/7TB9AwPZtIDQ0YWScNJGOobYgZQY54LB8XnV55laEaSq vNiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IVbulZmkPH3LRfxaVHxkDwCPhGtbIef2G0HNhGUIclQ=; b=R+hxWHpbxQfflPBrd/gzz7ykkt5n2j0ycGrX+LQBX3T65ouJuGaW78rSnEymY02I1z YHPb0K4LlxI3MZJcPxWV6i8owg9ami4o3ZXnHNDC1Ho6nXDk9XocO+SiGI+GMV+SzZg2 SdQPKY7QRwl+zGSujQBXkFFcx0L06m71SVnANL1pdsHIcVigxiL5sGGPGAbd/htII49x wx8UI+hgdxJuInivSqse9KPNqNQfMq1rf6c2ueHJbUla/Z+YvgMOg7Ju0gFdxaRUNJhr iZQj1+7NvsS+a9dJ1C0KBbKcxQfwHNSgdo16O7gMxgdo7sk4nN18oHZ6nX4ouvmH020W OU3Q== X-Gm-Message-State: APf1xPCZUmImoWYfdNaA9ZnflyUfi4p8Lg4pSCZ3M2OwdYvj21/TMzET 8Dy8oyJdbJ8zp1IAYORt+RH2Dw== X-Google-Smtp-Source: AH8x225FYFPYylV78ieg2suUlNUhbIdP6n3zNYAzqMu9CUO3KbKg0yHcoICnNsfq1qUX2rDXN7mzoQ== X-Received: by 10.223.165.145 with SMTP id g17mr6554080wrc.169.1519311744874; Thu, 22 Feb 2018 07:02:24 -0800 (PST) Received: from baker.fritz.box ([2a02:908:1251:8fc0:88c:4715:87af:fa74]) by smtp.gmail.com with ESMTPSA id v63sm424613wrc.69.2018.02.22.07.02.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 07:02:24 -0800 (PST) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/6] drm/ttm: drop ttm->dummy_read_page Date: Thu, 22 Feb 2018 16:02:17 +0100 Message-Id: <20180222150220.8702-3-christian.koenig@amd.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180222150220.8702-1-christian.koenig@amd.com> References: <20180222150220.8702-1-christian.koenig@amd.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Only used by the AGP backend and there it can be easily accessed using ttm->bdev->glob. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 ++--- drivers/gpu/drm/ast/ast_ttm.c | 5 ++--- drivers/gpu/drm/bochs/bochs_mm.c | 5 ++--- drivers/gpu/drm/cirrus/cirrus_ttm.c | 5 ++--- drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 5 ++--- drivers/gpu/drm/mgag200/mgag200_ttm.c | 5 ++--- drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++--- drivers/gpu/drm/nouveau/nouveau_sgdma.c | 5 ++--- drivers/gpu/drm/nouveau/nouveau_ttm.h | 3 +-- drivers/gpu/drm/qxl/qxl_ttm.c | 6 ++---- drivers/gpu/drm/radeon/radeon_ttm.c | 7 +++---- drivers/gpu/drm/ttm/ttm_agp_backend.c | 8 ++++---- drivers/gpu/drm/ttm/ttm_bo.c | 6 ++---- drivers/gpu/drm/ttm/ttm_tt.c | 8 ++------ drivers/gpu/drm/virtio/virtgpu_ttm.c | 6 ++---- drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c | 9 +++------ drivers/staging/vboxvideo/vbox_ttm.c | 5 ++--- include/drm/ttm/ttm_bo_driver.h | 17 ++++------------- 18 files changed, 42 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index b372d8d650a5..e38e6db8f760 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -969,8 +969,7 @@ static struct ttm_backend_func amdgpu_backend_func = { }; static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page) + unsigned long size, uint32_t page_flags) { struct amdgpu_device *adev; struct amdgpu_ttm_tt *gtt; @@ -983,7 +982,7 @@ static struct ttm_tt *amdgpu_ttm_tt_create(struct ttm_bo_device *bdev, } gtt->ttm.ttm.func = &amdgpu_backend_func; gtt->adev = adev; - if (ttm_dma_tt_init(>t->ttm, bdev, size, page_flags, dummy_read_page)) { + if (ttm_dma_tt_init(>t->ttm, bdev, size, page_flags)) { kfree(gtt); return NULL; } diff --git a/drivers/gpu/drm/ast/ast_ttm.c b/drivers/gpu/drm/ast/ast_ttm.c index 68b9c5522eaa..77d2035dc7b7 100644 --- a/drivers/gpu/drm/ast/ast_ttm.c +++ b/drivers/gpu/drm/ast/ast_ttm.c @@ -200,8 +200,7 @@ static struct ttm_backend_func ast_tt_backend_func = { static struct ttm_tt *ast_ttm_tt_create(struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page) + unsigned long size, uint32_t page_flags) { struct ttm_tt *tt; @@ -209,7 +208,7 @@ static struct ttm_tt *ast_ttm_tt_create(struct ttm_bo_device *bdev, if (tt == NULL) return NULL; tt->func = &ast_tt_backend_func; - if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { + if (ttm_tt_init(tt, bdev, size, page_flags)) { kfree(tt); return NULL; } diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c index 5525b6660340..96edf005bfea 100644 --- a/drivers/gpu/drm/bochs/bochs_mm.c +++ b/drivers/gpu/drm/bochs/bochs_mm.c @@ -178,8 +178,7 @@ static struct ttm_backend_func bochs_tt_backend_func = { static struct ttm_tt *bochs_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size, - uint32_t page_flags, - struct page *dummy_read_page) + uint32_t page_flags) { struct ttm_tt *tt; @@ -187,7 +186,7 @@ static struct ttm_tt *bochs_ttm_tt_create(struct ttm_bo_device *bdev, if (tt == NULL) return NULL; tt->func = &bochs_tt_backend_func; - if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { + if (ttm_tt_init(tt, bdev, size, page_flags)) { kfree(tt); return NULL; } diff --git a/drivers/gpu/drm/cirrus/cirrus_ttm.c b/drivers/gpu/drm/cirrus/cirrus_ttm.c index 33798c76a64b..3413389c0fbe 100644 --- a/drivers/gpu/drm/cirrus/cirrus_ttm.c +++ b/drivers/gpu/drm/cirrus/cirrus_ttm.c @@ -200,8 +200,7 @@ static struct ttm_backend_func cirrus_tt_backend_func = { static struct ttm_tt *cirrus_ttm_tt_create(struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page) + unsigned long size, uint32_t page_flags) { struct ttm_tt *tt; @@ -209,7 +208,7 @@ static struct ttm_tt *cirrus_ttm_tt_create(struct ttm_bo_device *bdev, if (tt == NULL) return NULL; tt->func = &cirrus_tt_backend_func; - if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { + if (ttm_tt_init(tt, bdev, size, page_flags)) { kfree(tt); return NULL; } diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c index 0c93349fbacf..50e317a2a4ca 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c @@ -202,8 +202,7 @@ static struct ttm_backend_func hibmc_tt_backend_func = { static struct ttm_tt *hibmc_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size, - u32 page_flags, - struct page *dummy_read_page) + u32 page_flags) { struct ttm_tt *tt; int ret; @@ -214,7 +213,7 @@ static struct ttm_tt *hibmc_ttm_tt_create(struct ttm_bo_device *bdev, return NULL; } tt->func = &hibmc_tt_backend_func; - ret = ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page); + ret = ttm_tt_init(tt, bdev, size, page_flags); if (ret) { DRM_ERROR("failed to initialize ttm_tt: %d\n", ret); kfree(tt); diff --git a/drivers/gpu/drm/mgag200/mgag200_ttm.c b/drivers/gpu/drm/mgag200/mgag200_ttm.c index 26e5f14645c5..cd55ff5f0f0a 100644 --- a/drivers/gpu/drm/mgag200/mgag200_ttm.c +++ b/drivers/gpu/drm/mgag200/mgag200_ttm.c @@ -200,8 +200,7 @@ static struct ttm_backend_func mgag200_tt_backend_func = { static struct ttm_tt *mgag200_ttm_tt_create(struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page) + unsigned long size, uint32_t page_flags) { struct ttm_tt *tt; @@ -209,7 +208,7 @@ static struct ttm_tt *mgag200_ttm_tt_create(struct ttm_bo_device *bdev, if (tt == NULL) return NULL; tt->func = &mgag200_tt_backend_func; - if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { + if (ttm_tt_init(tt, bdev, size, page_flags)) { kfree(tt); return NULL; } diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index ce328edee7a1..d3c98a70936d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -604,18 +604,18 @@ nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val) static struct ttm_tt * nouveau_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size, - uint32_t page_flags, struct page *dummy_read) + uint32_t page_flags) { #if IS_ENABLED(CONFIG_AGP) struct nouveau_drm *drm = nouveau_bdev(bdev); if (drm->agp.bridge) { return ttm_agp_tt_create(bdev, drm->agp.bridge, size, - page_flags, dummy_read); + page_flags); } #endif - return nouveau_sgdma_create_ttm(bdev, size, page_flags, dummy_read); + return nouveau_sgdma_create_ttm(bdev, size, page_flags); } static int diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c index 11f6ca89769b..87b030437f4d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c +++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c @@ -83,8 +83,7 @@ static struct ttm_backend_func nv50_sgdma_backend = { struct ttm_tt * nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page) + unsigned long size, uint32_t page_flags) { struct nouveau_drm *drm = nouveau_bdev(bdev); struct nouveau_sgdma_be *nvbe; @@ -98,7 +97,7 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev, else nvbe->ttm.ttm.func = &nv50_sgdma_backend; - if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page)) + if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags)) /* * A failing ttm_dma_tt_init() will call ttm_tt_destroy() * and thus our nouveau_sgdma_destroy() hook, so we don't need diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.h b/drivers/gpu/drm/nouveau/nouveau_ttm.h index 96082b696420..64e484ee5ef1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ttm.h +++ b/drivers/gpu/drm/nouveau/nouveau_ttm.h @@ -13,8 +13,7 @@ extern const struct ttm_mem_type_manager_func nouveau_gart_manager; extern const struct ttm_mem_type_manager_func nv04_gart_manager; struct ttm_tt *nouveau_sgdma_create_ttm(struct ttm_bo_device *, - unsigned long size, u32 page_flags, - struct page *dummy_read_page); + unsigned long size, u32 page_flags); int nouveau_ttm_init(struct nouveau_drm *drm); void nouveau_ttm_fini(struct nouveau_drm *drm); diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index 07d4f3fde6c1..2ad70eb96207 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b/drivers/gpu/drm/qxl/qxl_ttm.c @@ -292,8 +292,7 @@ static struct ttm_backend_func qxl_backend_func = { }; static struct ttm_tt *qxl_ttm_tt_create(struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page) + unsigned long size, uint32_t page_flags) { struct qxl_device *qdev; struct qxl_ttm_tt *gtt; @@ -304,8 +303,7 @@ static struct ttm_tt *qxl_ttm_tt_create(struct ttm_bo_device *bdev, return NULL; gtt->ttm.ttm.func = &qxl_backend_func; gtt->qdev = qdev; - if (ttm_dma_tt_init(>t->ttm, bdev, size, page_flags, - dummy_read_page)) { + if (ttm_dma_tt_init(>t->ttm, bdev, size, page_flags)) { kfree(gtt); return NULL; } diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index c50620aadbd0..009f55a2bbf9 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -687,8 +687,7 @@ static struct ttm_backend_func radeon_backend_func = { }; static struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page) + unsigned long size, uint32_t page_flags) { struct radeon_device *rdev; struct radeon_ttm_tt *gtt; @@ -697,7 +696,7 @@ static struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev, #if IS_ENABLED(CONFIG_AGP) if (rdev->flags & RADEON_IS_AGP) { return ttm_agp_tt_create(bdev, rdev->ddev->agp->bridge, - size, page_flags, dummy_read_page); + size, page_flags); } #endif @@ -707,7 +706,7 @@ static struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev, } gtt->ttm.ttm.func = &radeon_backend_func; gtt->rdev = rdev; - if (ttm_dma_tt_init(>t->ttm, bdev, size, page_flags, dummy_read_page)) { + if (ttm_dma_tt_init(>t->ttm, bdev, size, page_flags)) { kfree(gtt); return NULL; } diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c index 3e795a099d06..f7c2aefbec7c 100644 --- a/drivers/gpu/drm/ttm/ttm_agp_backend.c +++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c @@ -50,6 +50,7 @@ struct ttm_agp_backend { static int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem) { struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); + struct page *dummy_read_page = ttm->bdev->glob->dummy_read_page; struct drm_mm_node *node = bo_mem->mm_node; struct agp_memory *mem; int ret, cached = (bo_mem->placement & TTM_PL_FLAG_CACHED); @@ -64,7 +65,7 @@ static int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem) struct page *page = ttm->pages[i]; if (!page) - page = ttm->dummy_read_page; + page = dummy_read_page; mem->pages[mem->page_count++] = page; } @@ -111,8 +112,7 @@ static struct ttm_backend_func ttm_agp_func = { struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, struct agp_bridge_data *bridge, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page) + unsigned long size, uint32_t page_flags) { struct ttm_agp_backend *agp_be; @@ -124,7 +124,7 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, agp_be->bridge = bridge; agp_be->ttm.func = &ttm_agp_func; - if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags, dummy_read_page)) { + if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags)) { kfree(agp_be); return NULL; } diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index fe4aef6b1a7a..55028745214b 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -228,7 +228,6 @@ EXPORT_SYMBOL(ttm_bo_move_to_lru_tail); static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc) { struct ttm_bo_device *bdev = bo->bdev; - struct ttm_bo_global *glob = bdev->glob; int ret = 0; uint32_t page_flags = 0; @@ -247,14 +246,13 @@ static int ttm_bo_add_ttm(struct ttm_buffer_object *bo, bool zero_alloc) page_flags |= TTM_PAGE_FLAG_ZERO_ALLOC; case ttm_bo_type_kernel: bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << PAGE_SHIFT, - page_flags, glob->dummy_read_page); + page_flags); if (unlikely(bo->ttm == NULL)) ret = -ENOMEM; break; case ttm_bo_type_sg: bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << PAGE_SHIFT, - page_flags | TTM_PAGE_FLAG_SG, - glob->dummy_read_page); + page_flags | TTM_PAGE_FLAG_SG); if (unlikely(bo->ttm == NULL)) { ret = -ENOMEM; break; diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 5d8f7f9b84b1..f93cd108b19d 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -191,14 +191,12 @@ void ttm_tt_destroy(struct ttm_tt *ttm) } int ttm_tt_init(struct ttm_tt *ttm, struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page) + unsigned long size, uint32_t page_flags) { ttm->bdev = bdev; ttm->num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; ttm->caching_state = tt_cached; ttm->page_flags = page_flags; - ttm->dummy_read_page = dummy_read_page; ttm->state = tt_unpopulated; ttm->swap_storage = NULL; @@ -219,8 +217,7 @@ void ttm_tt_fini(struct ttm_tt *ttm) EXPORT_SYMBOL(ttm_tt_fini); int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page) + unsigned long size, uint32_t page_flags) { struct ttm_tt *ttm = &ttm_dma->ttm; @@ -228,7 +225,6 @@ int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev, ttm->num_pages = (size + PAGE_SIZE - 1) >> PAGE_SHIFT; ttm->caching_state = tt_cached; ttm->page_flags = page_flags; - ttm->dummy_read_page = dummy_read_page; ttm->state = tt_unpopulated; ttm->swap_storage = NULL; diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c index 1cde060602aa..ee9839fbae66 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ttm.c +++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c @@ -326,8 +326,7 @@ static struct ttm_backend_func virtio_gpu_backend_func = { static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size, - uint32_t page_flags, - struct page *dummy_read_page) + uint32_t page_flags) { struct virtio_gpu_device *vgdev; struct virtio_gpu_ttm_tt *gtt; @@ -338,8 +337,7 @@ static struct ttm_tt *virtio_gpu_ttm_tt_create(struct ttm_bo_device *bdev, return NULL; gtt->ttm.ttm.func = &virtio_gpu_backend_func; gtt->vgdev = vgdev; - if (ttm_dma_tt_init(>t->ttm, bdev, size, page_flags, - dummy_read_page)) { + if (ttm_dma_tt_init(>t->ttm, bdev, size, page_flags)) { kfree(gtt); return NULL; } diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c index 22231bc9e845..fead3f2dbb46 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c @@ -694,8 +694,7 @@ static struct ttm_backend_func vmw_ttm_func = { }; static struct ttm_tt *vmw_ttm_tt_create(struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page) + unsigned long size, uint32_t page_flags) { struct vmw_ttm_tt *vmw_be; int ret; @@ -709,11 +708,9 @@ static struct ttm_tt *vmw_ttm_tt_create(struct ttm_bo_device *bdev, vmw_be->mob = NULL; if (vmw_be->dev_priv->map_mode == vmw_dma_alloc_coherent) - ret = ttm_dma_tt_init(&vmw_be->dma_ttm, bdev, size, page_flags, - dummy_read_page); + ret = ttm_dma_tt_init(&vmw_be->dma_ttm, bdev, size, page_flags); else - ret = ttm_tt_init(&vmw_be->dma_ttm.ttm, bdev, size, page_flags, - dummy_read_page); + ret = ttm_tt_init(&vmw_be->dma_ttm.ttm, bdev, size, page_flags); if (unlikely(ret != 0)) goto out_no_init; diff --git a/drivers/staging/vboxvideo/vbox_ttm.c b/drivers/staging/vboxvideo/vbox_ttm.c index c4b7a6b9abd5..d1a211b61718 100644 --- a/drivers/staging/vboxvideo/vbox_ttm.c +++ b/drivers/staging/vboxvideo/vbox_ttm.c @@ -195,8 +195,7 @@ static struct ttm_backend_func vbox_tt_backend_func = { static struct ttm_tt *vbox_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size, - u32 page_flags, - struct page *dummy_read_page) + u32 page_flags) { struct ttm_tt *tt; @@ -205,7 +204,7 @@ static struct ttm_tt *vbox_ttm_tt_create(struct ttm_bo_device *bdev, return NULL; tt->func = &vbox_tt_backend_func; - if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { + if (ttm_tt_init(tt, bdev, size, page_flags)) { kfree(tt); return NULL; } diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 0e4ae26da093..b338dd0ea038 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -100,7 +100,6 @@ enum ttm_caching_state { * @bdev: Pointer to a struct ttm_bo_device. * @func: Pointer to a struct ttm_backend_func that describes * the backend methods. - * @dummy_read_page: Page to map where the ttm_tt page array contains a NULL * pointer. * @pages: Array of pages backing the data. * @num_pages: Number of pages in the page array. @@ -118,7 +117,6 @@ enum ttm_caching_state { struct ttm_tt { struct ttm_bo_device *bdev; struct ttm_backend_func *func; - struct page *dummy_read_page; struct page **pages; uint32_t page_flags; unsigned long num_pages; @@ -331,7 +329,6 @@ struct ttm_bo_driver { * @bdev: pointer to a struct ttm_bo_device: * @size: Size of the data needed backing. * @page_flags: Page flags as identified by TTM_PAGE_FLAG_XX flags. - * @dummy_read_page: See struct ttm_bo_device. * * Create a struct ttm_tt to back data with system memory pages. * No pages are actually allocated. @@ -340,8 +337,7 @@ struct ttm_bo_driver { */ struct ttm_tt *(*ttm_tt_create)(struct ttm_bo_device *bdev, unsigned long size, - uint32_t page_flags, - struct page *dummy_read_page); + uint32_t page_flags); /** * ttm_tt_populate @@ -621,7 +617,6 @@ ttm_flag_masked(uint32_t *old, uint32_t new, uint32_t mask) * @bdev: pointer to a struct ttm_bo_device: * @size: Size of the data needed backing. * @page_flags: Page flags as identified by TTM_PAGE_FLAG_XX flags. - * @dummy_read_page: See struct ttm_bo_device. * * Create a struct ttm_tt to back data with system memory pages. * No pages are actually allocated. @@ -629,11 +624,9 @@ ttm_flag_masked(uint32_t *old, uint32_t new, uint32_t mask) * NULL: Out of memory. */ int ttm_tt_init(struct ttm_tt *ttm, struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page); + unsigned long size, uint32_t page_flags); int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page); + unsigned long size, uint32_t page_flags); /** * ttm_tt_fini @@ -1080,7 +1073,6 @@ extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; * @bridge: The agp bridge this device is sitting on. * @size: Size of the data needed backing. * @page_flags: Page flags as identified by TTM_PAGE_FLAG_XX flags. - * @dummy_read_page: See struct ttm_bo_device. * * * Create a TTM backend that uses the indicated AGP bridge as an aperture @@ -1089,8 +1081,7 @@ extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; */ struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, struct agp_bridge_data *bridge, - unsigned long size, uint32_t page_flags, - struct page *dummy_read_page); + unsigned long size, uint32_t page_flags); int ttm_agp_tt_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx); void ttm_agp_tt_unpopulate(struct ttm_tt *ttm); #endif