From patchwork Fri Sep 27 13:46:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiang Yu X-Patchwork-Id: 11164535 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 CE778924 for ; Fri, 27 Sep 2019 13:46:58 +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 B5EAB217D7 for ; Fri, 27 Sep 2019 13:46:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5EAB217D7 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 0424C6E153; Fri, 27 Sep 2019 13:46:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 99CD16E14F; Fri, 27 Sep 2019 13:46:56 +0000 (UTC) Received: by mail-pf1-x441.google.com with SMTP id q21so1617432pfn.11; Fri, 27 Sep 2019 06:46:56 -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=C/ds6p8Co/3yoC3Gx9T6VFw2lfvFYrffpSmoNcSQPEM=; b=a1nq76MkTIE+kAKfrrOQBH/rWD/xoTp1t6F6KjritwQ0e/rnq5ZUPhA/QFUveqcg/q i8zHPgesNtHcwX2C7pJXfJSs0QbpnL/ywqlol6RI9s2nbDfy9mp9764bxcASnVX+UIH1 AW7+1R6c5hY61I9qA4G/dFsaJ11p4BBaaXjOALDDeopAO+SV3ouV8rLGKcY9ODFIKNeU +2uRcX/O5aMe/Na5VGbA62KIses5gPVWsebMuUua3m1Gg8uOPhM3NoFWeGIv4GakB7ue BsEuYy1o5d5xu4WDH+0Lzf6yWI/ib3psv6j7khdM5TPl+O4IDPWqk2GSwaBTJgD76ZLu wIOQ== X-Gm-Message-State: APjAAAX1JQPTLMO7W0fNAhnII3oAOY8tklJddswotF1u7jO1XH2xl241 nAQLUfMW5MYmlkdr1Cxl1wvj8er8yvw= X-Google-Smtp-Source: APXvYqzMGjuhbePP+vF9V7TBfABoBMxJTrlFlTEpMqitk0m0KMD+Aidku1kIKBD5NruDBo/1BjGwOA== X-Received: by 2002:a63:78cf:: with SMTP id t198mr9477305pgc.227.1569592016000; Fri, 27 Sep 2019 06:46:56 -0700 (PDT) Received: from localhost.localdomain (ah.ptr230.ptrcloud.net. [153.122.161.8]) by smtp.gmail.com with ESMTPSA id q71sm5608860pjb.26.2019.09.27.06.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 06:46:55 -0700 (PDT) From: Qiang Yu To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 0/6] drm/lima: simplify driver by using more drm helpers Date: Fri, 27 Sep 2019 21:46:10 +0800 Message-Id: <20190927134616.21899-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=C/ds6p8Co/3yoC3Gx9T6VFw2lfvFYrffpSmoNcSQPEM=; b=gzCtKjT9lyU2NKmymeBsnUx3aNo+xjA73WPeTvloYYNPUAGuI2Vxhe4tjZhkEGfMd0 lTukcNmgVpib4nth90WIYnLaYXzBo0QtJgGqGupDIG2hEuXKy6brvO6GWVVI3eoza+Mm vc0E4yArZ54lXHAfUPYcqaACj9BPh3pfjJKEi/498/TV6ZWIjTJ/aZ1zlNnMJ3k6CXbN 2qZD8pEvlutjxmRw3fuIgK4Zt3MMDPeSpUXYsrLOvn4lzLFHnEAt/yhOpU2W82tSD1b5 OGN9NVjCrbTbiH44ya2kQ7iQBtKDu09Ty6jOT4U+FF24MtinCsbPop9WW8ihOCtlJGj8 XdCQ== 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 v2: Add drm_gem_objects_lookup_user and use it for driver which pass user GEM handles in contious array. Qiang Yu (6): drm/gem: refine drm_gem_objects_lookup drm/v3d: use drm_gem_objects_lookup_user 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 | 57 ++++-- 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 | 6 +- drivers/gpu/drm/v3d/v3d_gem.c | 49 +---- include/drm/drm_gem.h | 4 +- 17 files changed, 239 insertions(+), 504 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