From patchwork Thu Sep 26 14:10:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiang Yu X-Patchwork-Id: 11162803 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1863213B1 for ; Thu, 26 Sep 2019 14:11:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00B52222C6 for ; Thu, 26 Sep 2019 14:11:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00B52222C6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 540176ED29; Thu, 26 Sep 2019 14:11:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F4576ED29; Thu, 26 Sep 2019 14:11:26 +0000 (UTC) Received: by mail-pl1-x644.google.com with SMTP id q15so1115969pll.11; Thu, 26 Sep 2019 07:11:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=r/6D0GMWgNqslpXv1q7faCjjUSVY8BftjhuplhunR5c=; b=iB6OeWq4AIl44ocUl68kmdED5wz+sDPHXfKVyNoW2LD8lOUgdEznb8w/5nISJ/qvtJ nicjCVFcbgzeFp5zwQrMh23MdubYC2ltTasKvKEMsFZ1909AGCM4MgIthAdwUD5VmfbF 7IdSlm38sb3xW8JZx4mCeom8y+ykdaD6O0aE8Kaxya/DfOulA0hS0skILj06k0Y53F3X DIISJYOOuFfY/jWHKMjVuJ7uAnIqcjqMjFyMuopIbM4+S17DTPABEQlJHAGuznVKyZ2+ 9MdKvT0Z5FQpM3Ffde4W1Yc/17bpkgSPnkVvUQni8uN3Dsm3Xakx0DI6Uk4twvWDX538 Vjdw== X-Gm-Message-State: APjAAAVs7DvZpcW20pNWdk4CqMQGcoJyoLjrzozvAsKhZuVqnrpnVlfw H3XZRZJK1rtW8NqZuuPyVzcZT4W6 X-Google-Smtp-Source: APXvYqyeAQboA4yB5RR/Z3y2+WCXZYsoWqVUXwrUcjn9GMpud5NskNXIxmGW3MChXMrLPeTzzWK0lA== X-Received: by 2002:a17:902:76c1:: with SMTP id j1mr4107898plt.270.1569507085818; Thu, 26 Sep 2019 07:11:25 -0700 (PDT) Received: from localhost.localdomain (ah.ptr230.ptrcloud.net. [153.122.161.8]) by smtp.gmail.com with ESMTPSA id w188sm2176740pgw.26.2019.09.26.07.11.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 07:11:25 -0700 (PDT) From: Qiang Yu To: dri-devel@lists.freedesktop.org Subject: [PATCH 0/6] drm/lima: simplify driver by using more drm helpers Date: Thu, 26 Sep 2019 22:10:38 +0800 Message-Id: <20190926141046.30758-1-yuq825@gmail.com> X-Mailer: git-send-email 2.17.1 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=r/6D0GMWgNqslpXv1q7faCjjUSVY8BftjhuplhunR5c=; b=rPizMRqABrG/q6lr2IbPCBXR11Y9meERg35+mKUYG4N2Eaj9RtUef742Ah5Vv2u2D0 xRkO1+dfQ3eRoWpIqnu9zqfPA7uQ/U+tmExPecxpc0jliSpTl2HbLiyO4H5Elox5Wi8n u/PkxMl3NQqOeHRx03PJtQsM6G/hPk/+mWf1WOreQl2kiwH+w3JSsPXgICMNx96PDd3z NfRqvfWSTkZEQo/IvTBWUo0EDGFUER/Iq/Ezn/zQSQnvjl0P3q7VTAwd66DJ04mJdrRk SlFtW405jPUBbF7sw7gcWMkqXP6wrA8D2T35GRPLTNkMY7UjTCKTiG9IX3dGZk2JG1d0 NZAA== 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: , Cc: lima@lists.freedesktop.org, Maxime Ripard , David Airlie , Qiang Yu , Sean Paul MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" By using shared drm helpers: 1. drm_gem_objects_lookup 2. drm_gem_(un)lock_reservations 3. drm_gem_shmem_helpers we can simplify lima driver a lot and benifit from updates to these functions. drm_gem_objects_lookup need a refine in order to be used by lima. Note: 1. changes to panfrost and v3d are just compile tested. 2. patch series is based on drm-misc-next branch Qiang Yu (6): drm/gem: refine drm_gem_objects_lookup drm/v3d: use drm_gem_objects_lookup drm/lima: use drm_gem_objects_lookup drm/lima: use drm_gem_shmem_helpers drm/lima: use drm_gem_(un)lock_reservations drm/lima: add __GFP_NOWARN flag to all dma_alloc_wc drivers/gpu/drm/drm_gem.c | 28 +-- drivers/gpu/drm/lima/Kconfig | 1 + drivers/gpu/drm/lima/Makefile | 4 +- drivers/gpu/drm/lima/lima_device.c | 2 +- drivers/gpu/drm/lima/lima_drv.c | 27 +-- drivers/gpu/drm/lima/lima_gem.c | 254 ++++++++++-------------- drivers/gpu/drm/lima/lima_gem.h | 32 ++- drivers/gpu/drm/lima/lima_gem_prime.c | 46 ----- drivers/gpu/drm/lima/lima_gem_prime.h | 13 -- drivers/gpu/drm/lima/lima_mmu.c | 1 - drivers/gpu/drm/lima/lima_object.c | 119 ----------- drivers/gpu/drm/lima/lima_object.h | 35 ---- drivers/gpu/drm/lima/lima_sched.c | 6 +- drivers/gpu/drm/lima/lima_vm.c | 87 ++++---- drivers/gpu/drm/panfrost/panfrost_drv.c | 23 ++- drivers/gpu/drm/v3d/v3d_gem.c | 35 +--- include/drm/drm_gem.h | 2 +- 17 files changed, 222 insertions(+), 493 deletions(-) delete mode 100644 drivers/gpu/drm/lima/lima_gem_prime.c delete mode 100644 drivers/gpu/drm/lima/lima_gem_prime.h delete mode 100644 drivers/gpu/drm/lima/lima_object.c delete mode 100644 drivers/gpu/drm/lima/lima_object.h