From patchwork Thu Feb 22 11:15:33 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: 10235157 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 CEC2F605BA for ; Thu, 22 Feb 2018 11:15:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D314028B85 for ; Thu, 22 Feb 2018 11:15:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7E5328B8B; Thu, 22 Feb 2018 11:15:47 +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 5B16C28B8C for ; Thu, 22 Feb 2018 11:15:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C36C6ED34; Thu, 22 Feb 2018 11:15:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 815546ED34 for ; Thu, 22 Feb 2018 11:15:44 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id z9so2977659wmb.3 for ; Thu, 22 Feb 2018 03:15:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=CPsgA4tjs0EZeUzlhnixwqzNXbpERwyI6kQjmseAtMw=; b=bJI9/cT1EXppYF1BYZZOZEvPU14J6yNnY9viYvMd+1rJ4xNjn3yEyXS3Y+jaGpBf3q wgQUchC+wz/cs4gkWeR6sJl2xW5RJ3aaR+y3vu0kJgHfbic8L67uiuEDsBF5Jr1873um zJAblMOSEJgf/aSUj/xa5Cm/sVjoJyvoL9+8HkPOMU1ioP83lyPekpt3vs+dqHPmrJ8x bfvTJnmyrGqAWLUsBNU70At8jAz4ub4cr+GY4D4f4K0cSWWFD+1kByMda/mEBgjqgm1+ iyELJzrJjCjgPAgaKAP/gDDmu0I7FiMtRPtiP2PlqVA4MT9L8jIKdgIWm33q4p8zezio u9qQ== 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:mime-version :content-transfer-encoding; bh=CPsgA4tjs0EZeUzlhnixwqzNXbpERwyI6kQjmseAtMw=; b=ks3rIDNcsyC8QrFIrznMPnTnqB9i122dyA8QQmehoQyV60EMCl2mZX9dlXSFeJVutV 9kLyjaKDyNk0VonGjQszm6bGh15DspoDsYwuMOcer6GytY/0gRoXQYWzUohPdLHITCQt 0JLmpRozqEPUr536tQWOMFtFwdWGgJz/UX+Vvp/U2GouirAGoI7xSk7BSN1/UkKtJzFA uNDqLlCqc/AhSJDYaAhLbDJn837N4Y3MZM6EO1GtiKQ4DF23Y+CcxW5s5raPZrNTACgo ts05VBiGQit3S61+4PRf51zxwr2+05xcvFPCeJ7R9mAI5eIq6rg+ubh+zJelqls7DixY odhw== X-Gm-Message-State: APf1xPC6E8OOu8bJs15rx6z+3D+hcdB70DxWGahyCmYVKYj57PpesLbf svwb7yJ5LUF6/QACMXWV1CI53A== X-Google-Smtp-Source: AH8x224VcuVqz/Yx7gnKOWTUU2RVbXebuSma9+I+XG4vnELsFpO3WWQlWX6VxcXVQVIJnL7tvAS3Ow== X-Received: by 10.28.192.24 with SMTP id q24mr4855765wmf.91.1519298142605; Thu, 22 Feb 2018 03:15:42 -0800 (PST) Received: from baker.fritz.box ([2a02:908:1251:8fc0:88c:4715:87af:fa74]) by smtp.gmail.com with ESMTPSA id m71sm238696wmd.6.2018.02.22.03.15.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 03:15:41 -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 1/8] drm/ttm: add default implementations for ttm_tt_(un)populate Date: Thu, 22 Feb 2018 12:15:33 +0100 Message-Id: <20180222111540.43479-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.14.1 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 Use ttm_pool_populate/ttm_pool_unpopulate if the driver doesn't provide a function. Signed-off-by: Christian König Reviewed-by: Michel Dänzer --- drivers/gpu/drm/ttm/ttm_tt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 9fd7115a013a..65bf4eac184b 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -410,7 +410,10 @@ int ttm_tt_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx) if (ttm->state != tt_unpopulated) return 0; - ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx); + if (ttm->bdev->driver->ttm_tt_populate) + ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx); + else + ret = ttm_pool_populate(ttm, ctx); if (!ret) ttm_tt_add_mapping(ttm); return ret; @@ -436,5 +439,8 @@ void ttm_tt_unpopulate(struct ttm_tt *ttm) return; ttm_tt_clear_mapping(ttm); - ttm->bdev->driver->ttm_tt_unpopulate(ttm); + if (ttm->bdev->driver->ttm_tt_unpopulate) + ttm->bdev->driver->ttm_tt_unpopulate(ttm); + else + ttm_pool_unpopulate(ttm); }