From patchwork Fri May 15 09:50:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550877 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 CA0D6739 for ; Fri, 15 May 2020 09:54:11 +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 A84772074D for ; Fri, 15 May 2020 09:54:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mmk7Qrl6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A84772074D 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 7DCC46EC33; Fri, 15 May 2020 09:54:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7BA0989798 for ; Fri, 15 May 2020 09:54:04 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id z72so1960348wmc.2 for ; Fri, 15 May 2020 02:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=c8SKLOOah6qSVSrH1aA7D5ryFBzonDZwW2dVBIsTM5A=; b=mmk7Qrl6M2xo5jxNW0veqISDJi2Rsm0L6t1q7yQBrvhlv8/b29Q4mK8Hixpi91/Twt kWE4D7fn5s6elkKkm6fUB/CL7+3GMyc66BV14coxnn8q8msMj15EkVqyN88JfJSh3hRu pEwgxhyxsmVjYcINtxNZ631YJti3ylTG2VT7I5WccyxnSB0JUWwTZhancuWGFTo+QlmK txjV4fRFKQi5r8ywfxsb+8MvVLED1be7/1Wd9ZbMMZH0GPlUcwc5dDpEZKAK1knCQh17 s4B+gzVMa5zdSldfhPL6KxW5FXynbVuYcKdB8il5tzmqVG1yvUaJX5HNIYqE5kG0E1cO t3Wg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=c8SKLOOah6qSVSrH1aA7D5ryFBzonDZwW2dVBIsTM5A=; b=YL9psV1HBOh5i3Jjodi14pH5C0MEar9IeqkgXYmuc3sgQnsyJ+4q+pIYjx04iaK3yM jC3IQi2wMWQFUt1kS3UOdAn+YDTi/uCatmFgC23trcb4x3J3tVcP8G04EUjTdFyIx46q AjyUNPTj8lLA+MH8HaBY9RqY/i49SOvnH5JHj7sR9E236ZnO6saIIf9qOSMY5MwM4VvC 4WJAfBjkopOwPwtrLLlQ4Zgcv13AMEut9D23CCZZXuuETKG4pO2A6+vJvM+wbYhNzmON V2PtswRVVyUibQW1PB8h4hvjob0/qeyBbbGeoRpd8XjLqQ6qxtFpWcUDb3EZEKeciH2K N7tw== X-Gm-Message-State: AOAM531clVrNkj8u6u94h88p2vc8XBoe1dpphaoPSbUJdmJCPGBvClqI 0AjW36/aNg+yu2dcclj04cs3OvkC X-Google-Smtp-Source: ABdhPJwCE5PnKIN3zFt8iUmjwgOhzeEiLFeb0Ow8K81xhdf323uP4lTXvv2DXYRJ8KkgD742L26gHw== X-Received: by 2002:a1c:1b96:: with SMTP id b144mr3144782wmb.6.1589536442948; Fri, 15 May 2020 02:54:02 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:02 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 01/38] drm: remove unused drm_gem.h include Date: Fri, 15 May 2020 10:50:41 +0100 Message-Id: <20200515095118.2743122-2-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Reviewed-by: Thomas Zimmermann --- drivers/gpu/drm/drm_vm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/drm_vm.c b/drivers/gpu/drm/drm_vm.c index 56197ae0b2f9..954baa8a2a8f 100644 --- a/drivers/gpu/drm/drm_vm.c +++ b/drivers/gpu/drm/drm_vm.c @@ -51,7 +51,6 @@ #include #include #include -#include #include #include "drm_internal.h" From patchwork Fri May 15 09:50:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550879 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 66D0090 for ; Fri, 15 May 2020 09:54:14 +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 45F4520709 for ; Fri, 15 May 2020 09:54:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KoRo6X1g" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 45F4520709 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 343F16E132; Fri, 15 May 2020 09:54:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D4076E132 for ; Fri, 15 May 2020 09:54:05 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id k13so687750wrx.3 for ; Fri, 15 May 2020 02:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NGjkB69rZt1YfL3vw1rxVZRUy8g5GzWLcHW/iygcNUU=; b=KoRo6X1g0gYhKEjc+XGV+oDRuAv9mav7cq3ZNp28nNAG3lrqqhiI7CFBreeyVHO1RC CCxZLS0BtKzTgu6M9yoK8MXFZ+Ipw3SjJlIwrRz9aWys2ZOQ8BGrXXR8+afb2yFuvECB s0DLQKJlK6dgcq98G1PbMbbdqEfyN2UO9vU1XXyPi9lXxCCO64kmsnr5mRoflefJz/Ce 54EgU/PQHeZr4bquFUbFBYJBShoF9Y6EEODn90cn8zQbgqONQxBauz82kK1eMtTdVn2I NhVdaSXYpl02ZVbC5W62dN1iPQxegzDkf3mA+hrH299i9pRKQaxroQpRArPZT1t1mopz u9gA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=NGjkB69rZt1YfL3vw1rxVZRUy8g5GzWLcHW/iygcNUU=; b=rDJoXSqSFY99CjcLc7e2i9Ew/PWon74zJwIlh0P8fQ5wgJb2lIwDRuA8IX/zOzmltu p0RClkzOHnrarxkSLK2PH0a6b2AmhX95NGwVH+5CSqXy/smaG1cYQX44ibTOJR6pYFd1 FoZwzk/sftEi6AGMu2xi8TcyFbWYvSIUJSoNWcc21un+1uP8+a1Z16czfsVbZWTV3zcb RyqkMTbN7+5cN1SHNLPChh5oow+qRhj9C3FNuAWF4EYmytIzRsumAZ+FoGAFLRhNuKzw nLmKRvP1Hhz6CSbd4rhrszbCmp1ivbfuFuAOeEdkvlH7gtx/fu1buJXRarP1/diP+JX9 rV6g== X-Gm-Message-State: AOAM532kfFAHc3OlTgz90jmbUQnp9axWK0BTIRQPH6z6Hey+G0aVwQ3K s+ByVtRgrGxH4r/tYKJ0/m7buRbn X-Google-Smtp-Source: ABdhPJxYBYbA0DrwHn1auYonTEHUpiFpuMuBeJF70AMiYaLFUNy/CTCgoIul23D9U3XvDGYc5XfDJA== X-Received: by 2002:adf:f38b:: with SMTP id m11mr3292145wro.65.1589536443894; Fri, 15 May 2020 02:54:03 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:03 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 02/38] drm/gem: use _unlocked reference in drm_gem_objects_lookup docs Date: Fri, 15 May 2020 10:50:42 +0100 Message-Id: <20200515095118.2743122-3-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Use the drm_gem_object_put_unlocked in the documentation for drm_gem_objects_lookup. The locked version of the helper should be used solely by people who know exactly what they are doing. Should prevent issues like ones adddressed with the next patch. Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 7bf628e13023..918d1ba25f63 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -690,7 +690,7 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count, * Returns: * * @objs filled in with GEM object pointers. Returned GEM objects need to be - * released with drm_gem_object_put(). -ENOENT is returned on a lookup + * released with drm_gem_object_put_unlocked(). -ENOENT is returned on a lookup * failure. 0 is returned on success. * */ From patchwork Fri May 15 09:50:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550883 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 4D66814C0 for ; Fri, 15 May 2020 09:54:17 +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 2C4C020709 for ; Fri, 15 May 2020 09:54:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jlxmajnv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C4C020709 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 B27AB6EC34; Fri, 15 May 2020 09:54:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id EAB2D6E132 for ; Fri, 15 May 2020 09:54:06 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id z72so1960467wmc.2 for ; Fri, 15 May 2020 02:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KQyxdAeLrtrj7Dvj11uWd2+1qx/CRyBNW+gNIqlp2ZY=; b=jlxmajnv/2iFVmbsGBVNR4iZdbztJ5xXoh5WtiYN7PGpUtv1i+AU/YRW0URLvQGwji PeX6mNRwjeCnQ1O2wGXhfDP8hH0TuQsUhrD5dXMshNTFkrt7wjyCedjJsDVQDOWGWmaP 3Z2c5eDaZFhJfDKXSTXUrjshvZC8klAvlv1UjTJa27FIs0JhXniF5gze8OuisarAamzJ 5hfkGd9430K4nSiW82ny8JriXuLyb4W/Eh+t2/V8CijnevtsUxMkIhMZChqXq2UEEmHm lNSfnyu4veh4QjHa4DeNc5vWEKHEu07F97u8Eb5a2ZnKiRo+qUr3fQ3AyIRNyD4ONFlW Fajg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=KQyxdAeLrtrj7Dvj11uWd2+1qx/CRyBNW+gNIqlp2ZY=; b=A8SX3CNJB4Gj5lHkmU/Lpk/+Nee9A3xNSwW/LivAvdEmLjwPR9hGrqUnYn8ZoLSfT7 4sg9X/pLy+txYmnt6vyZ1ZuR4V2nXzl0xDXFG+crLNtJnypbwIC1vd7jXvpeBMDoPE+P zTnj8yrp1tpmg9h0pk4TBsIF5eqrb9anNA8XHwCoVaDUZY7HcZrm5cE7neE2OTtfYsQx By0P6uDTFYUd7FMh3zlZ51qwarmMBnfbmWqDFdP2/ltMkpsoH8fe89o19ikTNFjm8CI/ MLuwOEn4sqJVyICmXLNJHhX0nSdlXji3OAOeZ0E6DIgXmH5yZhpPI3DSWKjojPZD5wAM MNBA== X-Gm-Message-State: AOAM5335n+ewYo+a2jgESk2g1sgnka/SCCVx3DPTznidYhv/xZwMPLPq KX+0iSFWSdWSlOLicOfFvV32bctk X-Google-Smtp-Source: ABdhPJxwSRR/trmsaFyboRrU9+m3MO47OvN0fc9/M0nBFp3LJ9a0eYPuK9wLnBVLxMepmzz4CfpibQ== X-Received: by 2002:a7b:c7d5:: with SMTP id z21mr3021949wmk.112.1589536445391; Fri, 15 May 2020 02:54:05 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:04 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 03/38] drm/todo: mention i915 in the struct_mutex section Date: Fri, 15 May 2020 10:50:43 +0100 Message-Id: <20200515095118.2743122-4-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Reviewed-by: Daniel Vetter --- Documentation/gpu/todo.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 658b52f7ffc6..2ce52c5917f8 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -157,8 +157,8 @@ private lock. The tricky part is the BO free functions, since those can't reliably take that lock any more. Instead state needs to be protected with suitable subordinate locks or some cleanup work pushed to a worker thread. For performance-critical drivers it might also be better to go with a more -fine-grained per-buffer object and per-context lockings scheme. Currently only the -``msm`` driver still use ``struct_mutex``. +fine-grained per-buffer object and per-context lockings scheme. Currently only +the ``msm`` and `i915` drivers use ``struct_mutex``. Contact: Daniel Vetter, respective driver maintainers From patchwork Fri May 15 09:50:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550885 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 612BE90 for ; Fri, 15 May 2020 09:54:19 +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 3B3EF20709 for ; Fri, 15 May 2020 09:54:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gFmeOSl0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B3EF20709 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 3E6146EC35; Fri, 15 May 2020 09:54:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD5956E132 for ; Fri, 15 May 2020 09:54:07 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id g14so16401300wme.1 for ; Fri, 15 May 2020 02:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yhU0WAgVuh2mQLezKk0xjB0ftL5UowR2T8i3Pd0JNi8=; b=gFmeOSl0SMHJGLGXFEt1OT8JsDbDt8B4qrVEoDE2rNvnuNjv4xxYaIkPQQxnYYwdor PMIAfEFf2zVGcb9KmhqU8+p038xv6l2moO1F7+MRpVHHvXzLYd++fgyT8hrob6I9Zehd B1YcOzcK4V/jC2r5F6WmixgE0hhuDk+GL5nuieTM+L//XSz9l7jO7j9YHhCLY8fNZ/+i uqeIeV3qiOedu+VZLnN5x5B2E+RKmMn/H8VhDBpuP21mWdaY7xHMu5NdMy9oSCSJVQG7 1I0in6K02jBtimcPCnqD05E7ffqkTn+56hI19PQJzyqE/37AP+Wjm2jHJCkY8c0PwAWh Fong== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=yhU0WAgVuh2mQLezKk0xjB0ftL5UowR2T8i3Pd0JNi8=; b=prLx27CbcobC9I3TAziYQqikiX66qadePRedcRO0OpoqOMQkHs/hi/iqoeYZCf9PSZ T+hi5mI1AmUs1pFd11ph8rMrul0A46f5Q++dMPSDsdRoNP1PGHvqV3693RCEpIZZ3+eH tqwsz4pgyEQWDLACynyJ/MLvQOG5uOlGcW2D9wZXJBlquPqyWkLl2Q3gTbKL7/NbbPqy 0NicSN+0XoPdn3izAh129GYOHR7xrHwNZ/62KxFlRwcewH1NO0moXawmPz5zsA5tWZE7 YzkhFXTfOy5z/YQlCxgStqiEQgqmxsWNbWf9vwYMQrClrS3gNp2T6R3XF50+0yn8o/DC y2gQ== X-Gm-Message-State: AOAM533b18lqvbzo8zBvhL00TqrbHmGkfiCcFcyEp+giUrApHvrHT3jv Rg4Sl0dmxhycp+Wxyjs83H/7Z8lL X-Google-Smtp-Source: ABdhPJz3YoIEm0CHD9omBfww6Bd+gPKdMg1Qlva8xvDgz7lgFjx1dEw4X5L68CT+SfQqCXNvmqa/fQ== X-Received: by 2002:a1c:a54c:: with SMTP id o73mr3077505wme.74.1589536446335; Fri, 15 May 2020 02:54:06 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:05 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 04/38] drm/doc: drop struct_mutex references Date: Fri, 15 May 2020 10:50:44 +0100 Message-Id: <20200515095118.2743122-5-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov There's little point in providing partial and ancient information about the struct_mutex. Some drivers are using it, new ones should not. As-it this only provides for confusion. Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Reviewed-by: Daniel Vetter --- Documentation/gpu/drm-mm.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst index 1839762044be..5ba2ead8f317 100644 --- a/Documentation/gpu/drm-mm.rst +++ b/Documentation/gpu/drm-mm.rst @@ -178,11 +178,8 @@ GEM Objects Lifetime -------------------- All GEM objects are reference-counted by the GEM core. References can be -acquired and release by calling drm_gem_object_get() and drm_gem_object_put() -respectively. The caller must hold the :c:type:`struct drm_device ` -struct_mutex lock when calling drm_gem_object_get(). As a convenience, GEM -provides drm_gem_object_put_unlocked() functions that can be called without -holding the lock. +acquired and release by calling drm_gem_object_get() and drm_gem_object_put_unlocked() +respectively. When the last reference to a GEM object is released the GEM core calls the :c:type:`struct drm_driver ` gem_free_object_unlocked From patchwork Fri May 15 09:50:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550887 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 BAB3D90 for ; Fri, 15 May 2020 09:54:21 +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 99E6720709 for ; Fri, 15 May 2020 09:54:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uO39bj4P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99E6720709 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 9FE036EC38; Fri, 15 May 2020 09:54:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE6EF6E132 for ; Fri, 15 May 2020 09:54:08 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id m12so1685121wmc.0 for ; Fri, 15 May 2020 02:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UgKCP0E66GrIssr4PSamPr7IwENtNcpBp6wlTsjszoo=; b=uO39bj4PKYS2NEzcyP6/0Y5vJSSSyAai9wN0X1f9+yrz5/f6mU9Ada2vk0gJuY9uNr INjNrRYFfW9/EA3dTJs6uS4bG43KyNbjkvU/BRvBl/Mw3v6ufZDq4VzRbATRY98I6MB4 3WwpgDlGwFI7abb/fP0sGJWQfRvKx67gBsvBa8fxoEh0bFQPU3tOBdTwvUrydT+f80mg xebHpVZtkoBbEDuFFUqyWLc/p8lNYD5p4jO+/7nAij4tnXKys3CZGqLpIUG/piaq9nV0 vQpHj9D1Dv8F4r7YjFGROdW2G10JLQwATRo2RETKd4uDAcq+ReV1enSNT0KEIFdfTRYE 3lzw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=UgKCP0E66GrIssr4PSamPr7IwENtNcpBp6wlTsjszoo=; b=hW31l7zJy8++omErRRJ5FDdk4k/MJzddZx5xJn+PkgkizCHbVvLWVU+21z+vhP/Y5Z Z1qFg2xxaTinxuIGc0R2h64xY3hhpY6S3W0T6AE2kkkZGTWyNjO0CegjRESEL7aChklr 2Ncp3gwrmRfN/jShdHP1bf0kS9m56+hZrXYalJpixBtlNJx7CZIS4P3QHrapYWSLiPPD t9Kw1J/rTCgEyP8X1B65UCY+4KQBs8NDYi1u+WIV6hYAIx7I1Uy3lpXmR6RtEmrV0SWC zC91/vonxBI6Ma7wYPiz5u/aWByK23HpsXCvQ/barh+yeiuJk4qDitkoS1kAw+DEERzU NwRA== X-Gm-Message-State: AOAM533hs6Z1WvQcoEFXYvQq/se6wwk06h8VBZwrjLvN/AkFzSTPVt3Y 533P6o4l0Wcep2ft7TBglE+sedSw X-Google-Smtp-Source: ABdhPJwTFglqnCJfE2KMz60BQeTVykFZPBU/sf3S5ZJC2+Au++YjY/CwuxqdrQhuNWWHB4AJmZpZZQ== X-Received: by 2002:a7b:c84b:: with SMTP id c11mr3055049wml.19.1589536447238; Fri, 15 May 2020 02:54:07 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:06 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 05/38] drm/doc: add WARNING for drm_device::struct_mutex Date: Fri, 15 May 2020 10:50:45 +0100 Message-Id: <20200515095118.2743122-6-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov The mutex should be used, only by legacy drivers. Add a big warning to deter people from using it. Suggested-by: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Emil Velikov --- include/drm/drm_device.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h index a55874db9dd4..0988351d743c 100644 --- a/include/drm/drm_device.h +++ b/include/drm/drm_device.h @@ -146,6 +146,9 @@ struct drm_device { * @struct_mutex: * * Lock for others (not &drm_minor.master and &drm_file.is_master) + * + * WARNING: + * Only drivers annotated with DRIVER_LEGACY should be using this. */ struct mutex struct_mutex; From patchwork Fri May 15 09:50:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550893 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 4C5FD739 for ; Fri, 15 May 2020 09:54:27 +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 2B86020709 for ; Fri, 15 May 2020 09:54:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cM9Uap9I" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B86020709 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 78ED36EC3C; Fri, 15 May 2020 09:54:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 10A0C6EC35 for ; Fri, 15 May 2020 09:54:10 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id f134so1679001wmf.1 for ; Fri, 15 May 2020 02:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L457CX6UVQaxlohMgQyzShKgxDOsXvqdnSjPGTeCXxU=; b=cM9Uap9I7AVnVFSfXD7uUk3YFoBd1IOIVgb5T8cc4JDSF6ZqhEYGn7WyQoHGGD05LV rLWIXwtRupRNBWkf9aYFvG8pLI+vQ+fLGdzzVMO4FpiiFeNGXV0nvEm2pwNBzuZfjvTx DwnmZTKhd04NHpTVfwtmzMJXzwty5eV5fK/NPj3q2ybxqeLeS/cCYlvHqTwevalBiaug BCBI3EFDFO/BwEoyGZUBBKp8+j7+Z/2SLRSfVwBoUNzbkhbnrS1c6Ace7nZmWyRMAhsD FT9/RL0nduVomUqJzi3OxnE1qeSOroGHv2AKT+K+7fRlX6avbwJA6Nx/G+hIhJZvBd4t Nktg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=L457CX6UVQaxlohMgQyzShKgxDOsXvqdnSjPGTeCXxU=; b=GWMOM7BXSGNEFN3mSKx7zZdzQHprrBsXLSz1IkN+foVaR1e35B08d8OQ0WqifXrYEI HbAu5s+uH2utnE+2jZO0iiuaGTQuZXLv6D5fcK08k6tpROjj0GryHqkj0E6dz5Q5TO1S oxx17NNmjOU70vvpxmjF19kV5veUs5NEj4Zn/GLT3zikRR3917rKAQzvTFaS9SRhwIcn rbyBQ3mE4szgFx3lhUwRzIib8IcR3s54VvkOwW1jEg9H+Xvh/5vfA/asoXOR02jgvNrc TpkZ+/f+Cpv7Gmf4Rk5yOUPPgWq3+V6+VSBsOMPZ+4H0tNi+526WwTw/O4PDdGyKklz1 iQyg== X-Gm-Message-State: AOAM531XO+PPN85ewQsIesJkWvnhyVpwqdmxzNwzVFhtE1KE/5UShrvh TBjGafNqgUxxdSPhsZHI5rtnFp/L X-Google-Smtp-Source: ABdhPJxcosVrxKMWJpr5ix4vf99opIgKEhHpBHvC1+4K3D2bukPTM9qkJIAfyLscRc6jTcHKGAcvJQ== X-Received: by 2002:a7b:c24b:: with SMTP id b11mr3087144wmj.101.1589536448449; Fri, 15 May 2020 02:54:08 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:07 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 06/38] drm/doc: drop struct_mutex reference for drm_gem_object_free Date: Fri, 15 May 2020 10:50:46 +0100 Message-Id: <20200515095118.2743122-7-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov The comment that struct_mutex must be held is misleading. It is only required when .gem_free_object() is used. Since that one is going with the next patches, drop the reference. Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_gem.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 918d1ba25f63..12fa121d0966 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -965,7 +965,6 @@ EXPORT_SYMBOL(drm_gem_object_release); * @kref: kref of the object to free * * Called after the last reference to the object has been lost. - * Must be called holding &drm_device.struct_mutex. * * Frees the object */ From patchwork Fri May 15 09:50:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550891 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 B70F890 for ; Fri, 15 May 2020 09:54:25 +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 9632E2074D for ; Fri, 15 May 2020 09:54:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X0h5Z+wn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9632E2074D 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 D2CAD6EC39; Fri, 15 May 2020 09:54:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 259046EC35; Fri, 15 May 2020 09:54:11 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id z72so1960682wmc.2; Fri, 15 May 2020 02:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LUExjU2XTxgqMjmujYynjDialW7+jMU42M0B+uiUV/Y=; b=X0h5Z+wnnFQqU6TpwFt8Qf61V+AHZDickaWHmnAHSyFr6KI8IhuKs62GnZReh6xCV8 ssPiGBYonSSQhW9Yf314A6TlNm3al4GgLEoj2FOeRTYH2R71X8O/TxJG8rXALCBnRB3Q WH17mTvM/JpboS8M0vRzAfh8RVTJSoB6SMabBqdKwdCXB+TJQvh3XqDqxLcfUT0xUM1r RvcfI3NDRUW03mdCec7PK7rkZlPU8lNVeZ6SI7pZVkw+186zmPn3UFni5VmZUiXZDU2U Yllv1Nsgk17LvhbzjZDrRkfkGN/KY1LbHLIBxcrJjQbWNTqioMVLSbZNhJxogOVmZ47C zBYQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=LUExjU2XTxgqMjmujYynjDialW7+jMU42M0B+uiUV/Y=; b=cq2az1PvTEc+t7IUPYQz+HsobA8Nq8xYIzA0PFAqbEgjIRERpO1vmtk22I2kVT4zcZ yE8K1UDymn//kjiuOxRK60WJarfnQU0/07CmEJZHp8L/7xrMuE8jTERivM7VZxPjUNds E3fgcfONxU3bXnisWy0xP7x4WDpqkhdHTsK4nqjlr7oouXsoTf8YPDmfYidr0iM28RYA UgcS4qvAzazOcosI5a/ALn24wAk7zhf4JvwAfJfCKnkVT0nY5xvbZ5/FAePhIQbTSD94 tLkfdwW+nonMavte4cT75CKumYi/pr0o5R9nZo5zYBIcugicpKiBd6Dlbqsp9Ovv3SFu 8rMA== X-Gm-Message-State: AOAM530o4YutJTb2ZWy7809l/ReE5RbAxkTHvRW41AW70rMsIlbqWae8 zRVoRSxVSoxG+2jthO2ZDZNVCS6q X-Google-Smtp-Source: ABdhPJwAtrlk+4xfJhh48GTLeoCeohdKmJ8CEoVKH2zYdsQM7LHT16itLvMNHM2FrOQLj29OSvANkw== X-Received: by 2002:a05:600c:2299:: with SMTP id 25mr3171519wmf.138.1589536449567; Fri, 15 May 2020 02:54:09 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:09 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 07/38] drm/amdgpu: use the unlocked drm_gem_object_put Date: Fri, 15 May 2020 10:50:47 +0100 Message-Id: <20200515095118.2743122-8-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , emil.l.velikov@gmail.com, =?utf-8?q?Christian_K=C3=B6nig?= , amd-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov The driver does not hold struct_mutex, thus using the locked version of the helper is incorrect. Cc: Alex Deucher Cc: Christian König Cc: amd-gfx@lists.freedesktop.org Fixes: a39414716ca0 ("drm/amdgpu: add independent DMA-buf import v9"): Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c index 43d8ed7dbd00..652c57a3b847 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c @@ -587,7 +587,7 @@ struct drm_gem_object *amdgpu_gem_prime_import(struct drm_device *dev, attach = dma_buf_dynamic_attach(dma_buf, dev->dev, &amdgpu_dma_buf_attach_ops, obj); if (IS_ERR(attach)) { - drm_gem_object_put(obj); + drm_gem_object_put_unlocked(obj); return ERR_CAST(attach); } From patchwork Fri May 15 09:50:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550889 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 84F7990 for ; Fri, 15 May 2020 09:54:23 +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 63A4420709 for ; Fri, 15 May 2020 09:54:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hHuHdjuf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63A4420709 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 DFAE76EC3A; Fri, 15 May 2020 09:54:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6DD356EC35 for ; Fri, 15 May 2020 09:54:12 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id f134so1679103wmf.1 for ; Fri, 15 May 2020 02:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gJhPGZFo6yQauL1OgVWozjoNA81pY8H8RIemQ11igo4=; b=hHuHdjufFaoqO7s1OPjO+kOhipZ9+cdDo9oJr5iTOwc9DNaAo5P0q96M4xKv2YHyav FbqInA3mCUQ+apbd2UzzPEir9Bh6WDWzGXM26Q3tLfMcKiMSeV3uMd2GhaaH6YUAit2v zAQ0QpSpXfj2165qEDJQWqKAfCA6AnsZlFdCKmM1Hapg4IUEAiVTSK9Inp0CxldqeBCp SSfWE7/Pu6IVgCLQsRi8p1gMcbHc2rXlQZkyQXnQY5ePLpCmuP7dkV070pn2qnhwR295 yHt5m357OLNv4uuKAFliqrwt88vfey2biuYvEPNjdYw2BPleGRieyuBTiuqvYBkanW6z ypWA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=gJhPGZFo6yQauL1OgVWozjoNA81pY8H8RIemQ11igo4=; b=HbhzQpYotETUIwTZyFvV3dVQx2CWMCCyHSy2P3VhACsBG+pmKTAvfaWHN42IkXDVdJ wFf0ayXVYsJERhg7DOEHcIIhuyGZgh8lvdOlwNagQwd4mPunSYnmOeAbA0lgoi8+THEr Z8PZg2tiiX9JiIIO0ljUdzUtrM9QgSWFJZqHefb2CKHV3q0ai0g9+31DnQyxBI/B3i/J r/3TaHZmdZy3JVVVeIPf1UCydjJrGgmjDyE2lzuj9wS0FbyCqD2uTxbwn8rXuocrqEHx h1JPcM6iAUqHOjN06a/iaN/8nINXGh3WphvZaBwd6hCXQWC0uGnrZsC5ceCDsE1P+Y9Y SAOA== X-Gm-Message-State: AOAM533JDEWNiSNieSSy4cba1pLqezXxKDZYsxagUY9F7tWVfTJ+Pzih V1P5z9MJ3H26zNGL9N3GBzKTNoGO X-Google-Smtp-Source: ABdhPJziqgckZcbAYrwBD42yFqqQnr9zkuS3qv+aqq8haGrfOSaeIpCAq/iIvH8jPlAjzrkVnPecfw== X-Received: by 2002:a1c:a952:: with SMTP id s79mr3035759wme.153.1589536450823; Fri, 15 May 2020 02:54:10 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:10 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 08/38] drm/gma500: Use lockless gem BO free callback Date: Fri, 15 May 2020 10:50:48 +0100 Message-Id: <20200515095118.2743122-9-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov No dev->struct_mutex anywhere to be seen. Cc: Patrik Jakobsson Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Reviewed-by: Thomas Zimmermann --- drivers/gpu/drm/gma500/psb_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index 2411eb9827b8..34b4aae9a15e 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -507,7 +507,7 @@ static struct drm_driver driver = { .irq_uninstall = psb_irq_uninstall, .irq_handler = psb_irq_handler, - .gem_free_object = psb_gem_free_object, + .gem_free_object_unlocked = psb_gem_free_object, .gem_vm_ops = &psb_gem_vm_ops, .dumb_create = psb_gem_dumb_create, From patchwork Fri May 15 09:50:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550911 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 2A38690 for ; Fri, 15 May 2020 09:54:44 +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 07C9B2074D for ; Fri, 15 May 2020 09:54:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bWcM5CsD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07C9B2074D 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 03ACA6EC49; Fri, 15 May 2020 09:54:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 70E456EC37 for ; Fri, 15 May 2020 09:54:13 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id w64so1947481wmg.4 for ; Fri, 15 May 2020 02:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C72pARwKzjXLQykIC6Vzm26mksDc4097B9kvNeRj2lQ=; b=bWcM5CsDk794wqVx0bpSBzlfNFSUDUV61J7u5+/ewaXeC3gvaqF8isnld4kjSB/Z5y +nhEbrdoSf6NIyTFUUNYTf/Gfl6VK5ZeZB6R4+s1Pd9U3k+7ApEojDoDAoWtvQZ2L7g0 x+qGmBDhSovCD7TOYFT3xuceghhUhcDzgpeuaKSotEKcot7IweD/bVh/LoDcSDgIaZk+ JIQQybxU4pUxVcBiqzXPcHHQyLlnkeigsC1nQ7SJpFYw3SzGNQh6XGnEV8Tt5oILK4SA ML1Ii/yUQKAKYyyXNbZpWayUx8BAMRo9DvZJHGzVYnzrFfGoubBUi0KeUMKWay9JwKkM Rq7g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=C72pARwKzjXLQykIC6Vzm26mksDc4097B9kvNeRj2lQ=; b=Ls+PN4roTcilDuAv8y++z9olhi7PzLqQhkxZJMrEu7v3yvoloFKUiVCp1HOcmbHr4E FdPvsvrgl2QA+UKlQYw8Uw+rbLSmj7EM+aUz5KXysxupE6NW6kPwG/Kl+slV0WHDDN07 XCJEzddcbnREzNPqq7E7omEf7mtG/MeKY28Axx94nhZ0eIPsQbxz4l7NsABJ2kZmLMXs sVCeavDT7WlbKjxzm4KbiP7FQA5RXAtAhjKt0WJzRlbad/jKgPdpZaoaI/eeyVnf8kPM JaOAzt5EX/i+TC+Up5DquUfeaCmNkbpM0ICwjtMtALtWKK6yh4aI1em3txwivA7u4q3e t6Hg== X-Gm-Message-State: AOAM531uwZdaN0cqMqnFhUDrvOJN32zhLL637C/dAWRcV0MRdI0sMk5q tfuaMBcBWl8ftroI6cwNC7dGw74v X-Google-Smtp-Source: ABdhPJz+k4vP2BdAa6279uhlUEjN/D0s8KFoxLAA/P6ttFzNdaaAo2Yn1TyKWS2LMTi4NLPGyTUlEQ== X-Received: by 2002:a7b:cb96:: with SMTP id m22mr3032944wmi.164.1589536451853; Fri, 15 May 2020 02:54:11 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:11 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 09/38] drm: remove drm_driver::gem_free_object Date: Fri, 15 May 2020 10:50:49 +0100 Message-Id: <20200515095118.2743122-10-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov No drivers set the callback, so remove it all together. Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Reviewed-by: Thomas Zimmermann Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_gem.c | 22 +++------------------- include/drm/drm_drv.h | 8 -------- include/drm/drm_gem.h | 5 +++-- 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 12fa121d0966..dab8763b2e73 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -975,15 +975,10 @@ drm_gem_object_free(struct kref *kref) container_of(kref, struct drm_gem_object, refcount); struct drm_device *dev = obj->dev; - if (obj->funcs) { + if (obj->funcs) obj->funcs->free(obj); - } else if (dev->driver->gem_free_object_unlocked) { + else if (dev->driver->gem_free_object_unlocked) dev->driver->gem_free_object_unlocked(obj); - } else if (dev->driver->gem_free_object) { - WARN_ON(!mutex_is_locked(&dev->struct_mutex)); - - dev->driver->gem_free_object(obj); - } } EXPORT_SYMBOL(drm_gem_object_free); @@ -999,21 +994,10 @@ EXPORT_SYMBOL(drm_gem_object_free); void drm_gem_object_put_unlocked(struct drm_gem_object *obj) { - struct drm_device *dev; - if (!obj) return; - dev = obj->dev; - - if (dev->driver->gem_free_object) { - might_lock(&dev->struct_mutex); - if (kref_put_mutex(&obj->refcount, drm_gem_object_free, - &dev->struct_mutex)) - mutex_unlock(&dev->struct_mutex); - } else { - kref_put(&obj->refcount, drm_gem_object_free); - } + kref_put(&obj->refcount, drm_gem_object_free); } EXPORT_SYMBOL(drm_gem_object_put_unlocked); diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index 6d457652f199..e6eff508f687 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -327,14 +327,6 @@ struct drm_driver { */ void (*debugfs_init)(struct drm_minor *minor); - /** - * @gem_free_object: deconstructor for drm_gem_objects - * - * This is deprecated and should not be used by new drivers. Use - * &drm_gem_object_funcs.free instead. - */ - void (*gem_free_object) (struct drm_gem_object *obj); - /** * @gem_free_object_unlocked: deconstructor for drm_gem_objects * diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 0b375069cd48..ec2d24a60a76 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -272,8 +272,9 @@ struct drm_gem_object { * attachment point for the device. This is invariant over the lifetime * of a gem object. * - * The &drm_driver.gem_free_object callback is responsible for cleaning - * up the dma_buf attachment and references acquired at import time. + * The &drm_driver.gem_free_object_unlocked callback is responsible for + * cleaning up the dma_buf attachment and references acquired at import + * time. * * Note that the drm gem/prime core does not depend upon drivers setting * this field any more. So for drivers where this doesn't make sense From patchwork Fri May 15 09:50:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550909 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 F0FB590 for ; Fri, 15 May 2020 09:54:41 +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 CFD7820709 for ; Fri, 15 May 2020 09:54:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KsrryXrm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFD7820709 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 73F916EC44; Fri, 15 May 2020 09:54:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 40F906EC3C for ; Fri, 15 May 2020 09:54:14 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id h4so1665510wmb.4 for ; Fri, 15 May 2020 02:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=64gLYirqv0dQ+6oXmKSs0A/wPzHi1OC+l9qUxVLvJNM=; b=KsrryXrm8AmMnHijI7MZT3+FevQXhSFlIUeGqmAAIma9dNQ6s3+wLeTojlvEc5+g93 UB9k17LaQSc0/3TJVh4NU9nJ3DDhwJKlICZTe04boNrEoZJkwbD8mJYikJFbeajreGBd OEgu2JLW+q3SCqcrXjdIKUxi+6Xy4IgWksnk+JLRlnSAU/aSQBnG/ynv8HPumCeMK+eg kqFYqSKUUCY6jOpkHO/SO8hznsYbGRV+RYl0sdmPR721wJgQZhHOOFiBDILVa/pa346M 6RDqKpDBa/bVhkpJovuYndJRwKAGo8zWuegz/2f59C8G8usASA9oVnbg5TO4p4Qj66Ac +7Ig== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=64gLYirqv0dQ+6oXmKSs0A/wPzHi1OC+l9qUxVLvJNM=; b=hNqoOpsV0F/HwA/h9szz956261VhIgxeZk4M5IPDbtaI3GxlPxBPOR5lcLLeZehcnH 99ALSQuJ6dt7DyFLl5b6DMVH0jElraz+1c/vo7g0bY6CBwrvfvk4UHYyEogYrTTi31fL vYTFzbiBPOj/riyxsiPd+bbnopUmmCMOUp95H9Ya2pOUL7Ip6diQ7E+2/p49XeIy4PGQ kN5ycVLuVseDs5Nv6V7wS3uo7KTQtAqyVJbfkx/Z+MIlyB7WnU51ScrxWZpy9ilMlawg Ea1y5xdUMWF9QDSJ7K7hx1hgiC42EbPxIPwBLadb+1yNhv7jxtg/SeCEzIM0yWTfyewJ YlHA== X-Gm-Message-State: AOAM5330P45xpw8kANo9uHOeEAcF+qxMsYLOc4GgBc+HVQMMRaDgKhDE kJNs5bC8NNp1CHu5K88owMVz7uum X-Google-Smtp-Source: ABdhPJxP7abb4ZvANeEw/bPXg/CS2FYYD7xbfzXezytHqY7rOgAWPVAgiSi4cgnEBQn9CcGW7bhfug== X-Received: by 2002:a7b:c3da:: with SMTP id t26mr2966451wmj.146.1589536452626; Fri, 15 May 2020 02:54:12 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:12 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 10/38] drm/gem: fold drm_gem_object_put_unlocked and __drm_gem_object_put() Date: Fri, 15 May 2020 10:50:50 +0100 Message-Id: <20200515095118.2743122-11-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov With earlier patch we removed the overhead so now we can lift the helper into the header effectively folding it with __drm_object_put. v2: drop struct_mutex references (Daniel) Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg (v1) Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_gem.c | 19 ------------------- drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 +- include/drm/drm_drv.h | 2 -- include/drm/drm_gem.h | 16 +++------------- 4 files changed, 4 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index dab8763b2e73..599d5ff53b73 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -982,25 +982,6 @@ drm_gem_object_free(struct kref *kref) } EXPORT_SYMBOL(drm_gem_object_free); -/** - * drm_gem_object_put_unlocked - drop a GEM buffer object reference - * @obj: GEM buffer object - * - * This releases a reference to @obj. Callers must not hold the - * &drm_device.struct_mutex lock when calling this function. - * - * See also __drm_gem_object_put(). - */ -void -drm_gem_object_put_unlocked(struct drm_gem_object *obj) -{ - if (!obj) - return; - - kref_put(&obj->refcount, drm_gem_object_free); -} -EXPORT_SYMBOL(drm_gem_object_put_unlocked); - /** * drm_gem_object_put - release a GEM buffer object reference * @obj: GEM buffer object diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h index 2faa481cc18f..41351cbf31b5 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h @@ -105,7 +105,7 @@ __attribute__((nonnull)) static inline void i915_gem_object_put(struct drm_i915_gem_object *obj) { - __drm_gem_object_put(&obj->base); + drm_gem_object_put_unlocked(&obj->base); } #define assert_object_held(obj) dma_resv_assert_held((obj)->base.resv) diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index e6eff508f687..bb924cddc09c 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -332,8 +332,6 @@ struct drm_driver { * * This is deprecated and should not be used by new drivers. Use * &drm_gem_object_funcs.free instead. - * Compared to @gem_free_object this is not encumbered with - * &drm_device.struct_mutex legacy locking schemes. */ void (*gem_free_object_unlocked) (struct drm_gem_object *obj); diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index ec2d24a60a76..c3bdade093ae 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -364,27 +364,17 @@ static inline void drm_gem_object_get(struct drm_gem_object *obj) } /** - * __drm_gem_object_put - raw function to release a GEM buffer object reference + * drm_gem_object_put_unlocked - drop a GEM buffer object reference * @obj: GEM buffer object * - * This function is meant to be used by drivers which are not encumbered with - * &drm_device.struct_mutex legacy locking and which are using the - * gem_free_object_unlocked callback. It avoids all the locking checks and - * locking overhead of drm_gem_object_put() and drm_gem_object_put_unlocked(). - * - * Drivers should never call this directly in their code. Instead they should - * wrap it up into a ``driver_gem_object_put(struct driver_gem_object *obj)`` - * wrapper function, and use that. Shared code should never call this, to - * avoid breaking drivers by accident which still depend upon - * &drm_device.struct_mutex locking. + * This releases a reference to @obj. */ static inline void -__drm_gem_object_put(struct drm_gem_object *obj) +drm_gem_object_put_unlocked(struct drm_gem_object *obj) { kref_put(&obj->refcount, drm_gem_object_free); } -void drm_gem_object_put_unlocked(struct drm_gem_object *obj); void drm_gem_object_put(struct drm_gem_object *obj); int drm_gem_handle_create(struct drm_file *file_priv, From patchwork Fri May 15 09:50:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550895 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 1671A739 for ; Fri, 15 May 2020 09:54:29 +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 E9B6B2074D for ; Fri, 15 May 2020 09:54:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VT8pZrQv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E9B6B2074D 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 CB6356EC3B; Fri, 15 May 2020 09:54:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 527BA6EC3B for ; Fri, 15 May 2020 09:54:15 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id f13so1653315wmc.5 for ; Fri, 15 May 2020 02:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pwU/wisbWvtnL0ExISojz061I/zbSm6+OfW/pn/qPv8=; b=VT8pZrQv9L/v44rQ5g6+ppwsDvaeZJ/BJgrdBPvQvwCsh6k4NbS7CeFO60jkDHADlu RPJzr8/Fvrtn1CabeVx/7apyN+CViCk52GBLPvXD6LgT+j4MHDmlIADgFN9ZkC8RJXU5 t0GvcOeMtqziTyslOsZJ0jwsQMbE5wpbiTIHBst8MOGDvySOzSqTjMa+WIJRus+7p2af 5bqqooE7Qd9jdsGtCxX7o+TJU1ubVz1PICRLH+oxFl2XAhsTItJ/CXTo3olK0jWQXtd+ XN9iOj9xvxaSgx+MuQxSbtM5yuCs53pG/sZjwE85ZV6/05o+MjLshg03H3JvNhOT0I6y bJ3g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=pwU/wisbWvtnL0ExISojz061I/zbSm6+OfW/pn/qPv8=; b=JeVGa4Koo89SbGn96KfZgN7M+OnvhBgHFJ9P1CoYfOWwA2U+NCa/f+NgQbp4HG/z8w OuJ0Qkuad6SOk1Y0rgQJOrmRmxZmcyx4XaRadlLLGP+h6Kfezrs1jmWxX6ZaQek+bcho +qyC5bo/XB/lP5o+Y9rh3yq43aVQ3YhsgszFwc6gRO0UptA5IW9U0X06TVdy447laYq5 i0sqOJwJrke6n3ffpzQyCYiCFRIEsdt7/Wq2qSt1ptT2EyTP2djeXWbTz4hs2ju3QQvE PHvZKGIBUrQWKnKA1/VvrirJvROr12sUH0oRyNOmyN/bgKvEtoSDDKZntcWZwbGnE8f7 Nb6Q== X-Gm-Message-State: AOAM532vvduQ6zcqO6KRaDhvQgpCARpKdgnzk7Sdel9/U3d/D0qHUvTV 9IF324C+mwemvBEsJ4xaW/Knf3GW X-Google-Smtp-Source: ABdhPJw43GYZ4RhxCmjG6hYZ7LAF2oDyfSfLYVeQY6Sv38DGSJtlRMj2i2bAqqEkVjRLWPGYaVo0Aw== X-Received: by 2002:a05:600c:4151:: with SMTP id h17mr3013749wmm.173.1589536453735; Fri, 15 May 2020 02:54:13 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:13 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 11/38] drm/gem: add _locked suffix to drm_object_put Date: Fri, 15 May 2020 10:50:51 +0100 Message-Id: <20200515095118.2743122-12-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Paul , emil.l.velikov@gmail.com, linux-arm-msm@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Vast majority of DRM (core and drivers) are struct_mutex free. As such we have only a handful of cases where the locked helper should be used. Make that stand out a little bit better. Done via the following script: __from=drm_gem_object_put __to=drm_gem_object_put_locked for __file in $(git grep --name-only --word-regexp $__from); do sed -i "s/\<$__from\>/$__to/g" $__file; done Cc: Rob Clark Cc: Sean Paul Cc: linux-arm-msm@vger.kernel.org Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Reviewed-By: Steven Price --- drivers/gpu/drm/drm_gem.c | 6 +++--- drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 4 ++-- drivers/gpu/drm/msm/msm_drv.c | 2 +- drivers/gpu/drm/msm/msm_gem.c | 6 +++--- drivers/gpu/drm/msm/msm_gem_submit.c | 2 +- drivers/gpu/drm/msm/msm_gpu.c | 2 +- include/drm/drm_gem.h | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 599d5ff53b73..f21327ebc562 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -983,7 +983,7 @@ drm_gem_object_free(struct kref *kref) EXPORT_SYMBOL(drm_gem_object_free); /** - * drm_gem_object_put - release a GEM buffer object reference + * drm_gem_object_put_locked - release a GEM buffer object reference * @obj: GEM buffer object * * This releases a reference to @obj. Callers must hold the @@ -994,7 +994,7 @@ EXPORT_SYMBOL(drm_gem_object_free); * drm_gem_object_put_unlocked() instead. */ void -drm_gem_object_put(struct drm_gem_object *obj) +drm_gem_object_put_locked(struct drm_gem_object *obj) { if (obj) { WARN_ON(!mutex_is_locked(&obj->dev->struct_mutex)); @@ -1002,7 +1002,7 @@ drm_gem_object_put(struct drm_gem_object *obj) kref_put(&obj->refcount, drm_gem_object_free); } } -EXPORT_SYMBOL(drm_gem_object_put); +EXPORT_SYMBOL(drm_gem_object_put_locked); /** * drm_gem_vm_open - vma->ops->open implementation for GEM diff --git a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c index 8cae2ca4af6b..68eddac7771c 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_debugfs.c @@ -124,13 +124,13 @@ reset_set(void *data, u64 val) if (a5xx_gpu->pm4_bo) { msm_gem_unpin_iova(a5xx_gpu->pm4_bo, gpu->aspace); - drm_gem_object_put(a5xx_gpu->pm4_bo); + drm_gem_object_put_locked(a5xx_gpu->pm4_bo); a5xx_gpu->pm4_bo = NULL; } if (a5xx_gpu->pfp_bo) { msm_gem_unpin_iova(a5xx_gpu->pfp_bo, gpu->aspace); - drm_gem_object_put(a5xx_gpu->pfp_bo); + drm_gem_object_put_locked(a5xx_gpu->pfp_bo); a5xx_gpu->pfp_bo = NULL; } diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 29295dee2a2e..6baed5b43ea3 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -932,7 +932,7 @@ static int msm_ioctl_gem_madvise(struct drm_device *dev, void *data, ret = 0; } - drm_gem_object_put(obj); + drm_gem_object_put_locked(obj); unlock: mutex_unlock(&dev->struct_mutex); diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 5a6a79fbc9d6..8696c405f709 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -879,7 +879,7 @@ void msm_gem_describe_objects(struct list_head *list, struct seq_file *m) } #endif -/* don't call directly! Use drm_gem_object_put() and friends */ +/* don't call directly! Use drm_gem_object_put_locked() and friends */ void msm_gem_free_object(struct drm_gem_object *obj) { struct msm_gem_object *msm_obj = to_msm_bo(obj); @@ -1183,7 +1183,7 @@ static void *_msm_gem_kernel_new(struct drm_device *dev, uint32_t size, return vaddr; err: if (locked) - drm_gem_object_put(obj); + drm_gem_object_put_locked(obj); else drm_gem_object_put_unlocked(obj); @@ -1215,7 +1215,7 @@ void msm_gem_kernel_put(struct drm_gem_object *bo, msm_gem_unpin_iova(bo, aspace); if (locked) - drm_gem_object_put(bo); + drm_gem_object_put_locked(bo); else drm_gem_object_put_unlocked(bo); } diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 385d4965a8d0..8f450a245cfb 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -387,7 +387,7 @@ static void submit_cleanup(struct msm_gem_submit *submit) struct msm_gem_object *msm_obj = submit->bos[i].obj; submit_unlock_unpin_bo(submit, i, false); list_del_init(&msm_obj->submit_entry); - drm_gem_object_put(&msm_obj->base); + drm_gem_object_put_locked(&msm_obj->base); } } diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 615c5cda5389..86a68f96c48d 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -694,7 +694,7 @@ static void retire_submit(struct msm_gpu *gpu, struct msm_ringbuffer *ring, /* move to inactive: */ msm_gem_move_to_inactive(&msm_obj->base); msm_gem_unpin_iova(&msm_obj->base, submit->aspace); - drm_gem_object_put(&msm_obj->base); + drm_gem_object_put_locked(&msm_obj->base); } pm_runtime_mark_last_busy(&gpu->pdev->dev); diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index c3bdade093ae..a231a2b3f5ac 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -187,7 +187,7 @@ struct drm_gem_object { * * Reference count of this object * - * Please use drm_gem_object_get() to acquire and drm_gem_object_put() + * Please use drm_gem_object_get() to acquire and drm_gem_object_put_locked() * or drm_gem_object_put_unlocked() to release a reference to a GEM * buffer object. */ @@ -375,7 +375,7 @@ drm_gem_object_put_unlocked(struct drm_gem_object *obj) kref_put(&obj->refcount, drm_gem_object_free); } -void drm_gem_object_put(struct drm_gem_object *obj); +void drm_gem_object_put_locked(struct drm_gem_object *obj); int drm_gem_handle_create(struct drm_file *file_priv, struct drm_gem_object *obj, From patchwork Fri May 15 09:50:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550907 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 5E9D390 for ; Fri, 15 May 2020 09:54:40 +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 3D86420709 for ; Fri, 15 May 2020 09:54:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qMwWTnNz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D86420709 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 84DCF6EC45; Fri, 15 May 2020 09:54:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B8EF6EC37 for ; Fri, 15 May 2020 09:54:16 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id y3so2838681wrt.1 for ; Fri, 15 May 2020 02:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LfFvPJ7pXwtA5cPhABg9tYPk+MM7W9vY3Izm7D3H0WI=; b=qMwWTnNzfjHCRddFCdsruIr22+A1m/WvQf2ogdZPkyf28tUVwxZ1jn4NtOe3KKNg0Q c+ESnrUmWIM5wmizdyW54uMQNjMIvZReHFVNPDhFDfmeXwVooJcDvsX5qHYAgjbLiCBK CLSImvi5P+HpOrCFxdVSK/pkThFqgtHDg8A4Z2xAym07b7OPuqNbjULze77VooLyxaqP 860KtnN3/9s57irCs5+FV5yPDVRVicKjps1FWznYLs/FtWIHs+Im4Ce2gvAtu68x4/nQ kEHEubYkVjolcAtXlo6b4uCPjSg0geLL2k139/Pd2iMFhDmM9j730qoQfjmc48GeCNAS E7Ng== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=LfFvPJ7pXwtA5cPhABg9tYPk+MM7W9vY3Izm7D3H0WI=; b=J2mKgBPbdCAt4D5cHrIgC3hPreQ+2IW+Zl186KuzlRdN59o249Np6ERLUcpwFm+OiZ 9kDeHYTNWtWx07LWbVTP9Uzcc3PhJo4npacY6wg1psz7EXKJ4lGGRKBC9flwUT6oPrO1 g5yf44zdE14UfRvkZiV8YvuY3HzyQ5BoSp74OAs0pkxDKnrRbZgG2KwYdSZGSdZLIqtB F0HGSqLaY0huPEtcWUQol1oPSyJq15kKZc4FNJ+rxaHQICevl6nkk0Dh1EdWHUfAmhoU 58AWqvWzv77B+Wq9IYpANdB2JARwvCU3N7FgwI4+DOM377C7KxxJgpq9MCJvLXy2+F9G IrTA== X-Gm-Message-State: AOAM533TKQhf/dWbxUNgF0v6ja+kftifLeSyDNSwn0Mhl52cD3+qa3ah ig364ReKaw40jgv7BXzO6bc4/9qJ X-Google-Smtp-Source: ABdhPJwvtkL4Ia3DWhFVW+83cWSr2A58IH+9Mo/cZvuYyWvB5hJwdYTj+s7l6+Rd6If2s6PpCYchsg== X-Received: by 2002:a5d:65ce:: with SMTP id e14mr3333808wrw.314.1589536454699; Fri, 15 May 2020 02:54:14 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:14 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 12/38] drm/gem: add drm_object_put helper Date: Fri, 15 May 2020 10:50:52 +0100 Message-Id: <20200515095118.2743122-13-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Add helper, which will allow us to transition the drivers one by one, dropping the suffix. v2: add missing space after function name (Jani) Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg (v1) Reviewed-by: Steven Price --- include/drm/drm_gem.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index a231a2b3f5ac..2f7b86c0649c 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -364,17 +364,19 @@ static inline void drm_gem_object_get(struct drm_gem_object *obj) } /** - * drm_gem_object_put_unlocked - drop a GEM buffer object reference + * drm_gem_object_put - drop a GEM buffer object reference * @obj: GEM buffer object * * This releases a reference to @obj. */ static inline void -drm_gem_object_put_unlocked(struct drm_gem_object *obj) +drm_gem_object_put(struct drm_gem_object *obj) { kref_put(&obj->refcount, drm_gem_object_free); } +#define drm_gem_object_put_unlocked drm_gem_object_put + void drm_gem_object_put_locked(struct drm_gem_object *obj); int drm_gem_handle_create(struct drm_file *file_priv, From patchwork Fri May 15 09:50:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550903 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 18A01739 for ; Fri, 15 May 2020 09:54:37 +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 EBB0620709 for ; Fri, 15 May 2020 09:54:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LPXkG9rO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBB0620709 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 17A646EC40; Fri, 15 May 2020 09:54:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id A41656EC37 for ; Fri, 15 May 2020 09:54:17 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id h17so2774366wrc.8 for ; Fri, 15 May 2020 02:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iP4HCCJA8AjIGmXzX15rGbOZS7T6ghNvHmXRpTbnWg0=; b=LPXkG9rOHYxlqP1E2ctzwa+/yE1lx87P4o7AmIRIk68+L/S1KVATl2ahAYtRbSprQr 7GsN+OJFHEXW+IwVN2CQrAzyrestL4uf2c3Puz09MknAn0QPJ2XrqJO5QhNKoGxkZAVR 1Y/HUm6rjvNrqEUo4OWRlsLoRElItUJCVLa8wp52PkDFSxocordBDDh8lh2iwIXgqY7P XzXNcfo+ZwvvSWkFpiR6jK/9FNKb4r0Ybf4wiieikZleWomDCPEaDeUikDRZs9jYMKH0 lTGpPj3ZkvidJwE6eCSFaZAZo+8wwQAKLjEVTxlnu1/4YTtVkkDaG5gO5FtWOsxS7NgD 26ag== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=iP4HCCJA8AjIGmXzX15rGbOZS7T6ghNvHmXRpTbnWg0=; b=ZY99Wxq58tu/VDgSy6dxu8hYE0ECj+DazuksNfYe1ICqHhcwrNweE/mzblKU+1naSA SfQoy9zVjuKuyEueZ2yzbISEpbysDeqsbvxDVZptSgiLmA1obvHcQT5iNxOCKjUN4r+y 4PRzY0qUTS1DMYzgZ1ZzTlCBAT3Hj9PKYfXoKQgv98X96QVnAKfgTbI/ePG4YLM0bx+d xbfyf/iAkmA0o9DAoevgwKZO4ZoijdLXEfObbrc0R/MqdsGVAzYbB7NXAqiMhdeJhk6z zNsyL0wN3ScwKwwusrmDVkOJldrU4CU0xmVllNcTjlQMwPh4NkBVfp4daPZ8yuyGZ8O5 cwnQ== X-Gm-Message-State: AOAM5305KhDgKr6JXF5rpbmHmzhPJEfoXNDuQTewOuqh5KbFATN9NFwc 8bDigC9ntC2XBaqR7CeuO/sPqkBH X-Google-Smtp-Source: ABdhPJxAdR2LXLXbZN1K6wNH52Ul4O2em3t1bCcdOlFIik+NEkH+E0CE1BTQnwo0IklefeHr9I+yAw== X-Received: by 2002:adf:f487:: with SMTP id l7mr3175226wro.381.1589536455703; Fri, 15 May 2020 02:54:15 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:15 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 13/38] drm: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:50:53 +0100 Message-Id: <20200515095118.2743122-14-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Pay special attention to the compat #define v2: keep sed and #define removal separate Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg (v1) Reviewed-by: Steven Price --- Documentation/gpu/drm-mm.rst | 2 +- drivers/gpu/drm/drm_client.c | 2 +- drivers/gpu/drm/drm_gem.c | 26 ++++++++++---------- drivers/gpu/drm/drm_gem_cma_helper.c | 8 +++--- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 6 ++--- drivers/gpu/drm/drm_gem_shmem_helper.c | 4 +-- drivers/gpu/drm/drm_gem_ttm_helper.c | 2 +- drivers/gpu/drm/drm_gem_vram_helper.c | 10 ++++---- drivers/gpu/drm/drm_prime.c | 6 ++--- include/drm/drm_gem.h | 2 +- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst index 5ba2ead8f317..8c8540ee859c 100644 --- a/Documentation/gpu/drm-mm.rst +++ b/Documentation/gpu/drm-mm.rst @@ -178,7 +178,7 @@ GEM Objects Lifetime -------------------- All GEM objects are reference-counted by the GEM core. References can be -acquired and release by calling drm_gem_object_get() and drm_gem_object_put_unlocked() +acquired and release by calling drm_gem_object_get() and drm_gem_object_put() respectively. When the last reference to a GEM object is released the GEM core calls diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c index 8cb93f5209a4..536a22747b51 100644 --- a/drivers/gpu/drm/drm_client.c +++ b/drivers/gpu/drm/drm_client.c @@ -237,7 +237,7 @@ static void drm_client_buffer_delete(struct drm_client_buffer *buffer) drm_gem_vunmap(buffer->gem, buffer->vaddr); if (buffer->gem) - drm_gem_object_put_unlocked(buffer->gem); + drm_gem_object_put(buffer->gem); if (buffer->handle) drm_mode_destroy_dumb(dev, buffer->handle, buffer->client->file); diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index f21327ebc562..ae02b3842c90 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -235,7 +235,7 @@ drm_gem_object_handle_put_unlocked(struct drm_gem_object *obj) mutex_unlock(&dev->object_name_lock); if (final) - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); } /* @@ -331,7 +331,7 @@ int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, *offset = drm_vma_node_offset_addr(&obj->vma_node); out: - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -690,7 +690,7 @@ static int objects_lookup(struct drm_file *filp, u32 *handle, int count, * Returns: * * @objs filled in with GEM object pointers. Returned GEM objects need to be - * released with drm_gem_object_put_unlocked(). -ENOENT is returned on a lookup + * released with drm_gem_object_put(). -ENOENT is returned on a lookup * failure. 0 is returned on success. * */ @@ -785,7 +785,7 @@ long drm_gem_dma_resv_wait(struct drm_file *filep, u32 handle, else if (ret > 0) ret = 0; - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -860,7 +860,7 @@ drm_gem_flink_ioctl(struct drm_device *dev, void *data, err: mutex_unlock(&dev->object_name_lock); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -898,7 +898,7 @@ drm_gem_open_ioctl(struct drm_device *dev, void *data, /* drm_gem_handle_create_tail unlocks dev->object_name_lock. */ ret = drm_gem_handle_create_tail(file_priv, obj, &handle); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); if (ret) return ret; @@ -991,7 +991,7 @@ EXPORT_SYMBOL(drm_gem_object_free); * driver doesn't use &drm_device.struct_mutex for anything. * * For drivers not encumbered with legacy locking use - * drm_gem_object_put_unlocked() instead. + * drm_gem_object_put() instead. */ void drm_gem_object_put_locked(struct drm_gem_object *obj) @@ -1030,7 +1030,7 @@ void drm_gem_vm_close(struct vm_area_struct *vma) { struct drm_gem_object *obj = vma->vm_private_data; - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); } EXPORT_SYMBOL(drm_gem_vm_close); @@ -1079,7 +1079,7 @@ int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size, if (obj->funcs && obj->funcs->mmap) { ret = obj->funcs->mmap(obj, vma); if (ret) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } WARN_ON(!(vma->vm_flags & VM_DONTEXPAND)); @@ -1089,7 +1089,7 @@ int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size, else if (dev->driver->gem_vm_ops) vma->vm_ops = dev->driver->gem_vm_ops; else { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return -EINVAL; } @@ -1155,13 +1155,13 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) return -EINVAL; if (!drm_vma_node_is_allowed(node, priv)) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return -EACCES; } if (node->readonly) { if (vma->vm_flags & VM_WRITE) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return -EINVAL; } @@ -1171,7 +1171,7 @@ int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) ret = drm_gem_mmap_obj(obj, drm_vma_node_size(node) << PAGE_SHIFT, vma); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c b/drivers/gpu/drm/drm_gem_cma_helper.c index 12e98fb28229..b3db3ca7bd7a 100644 --- a/drivers/gpu/drm/drm_gem_cma_helper.c +++ b/drivers/gpu/drm/drm_gem_cma_helper.c @@ -114,7 +114,7 @@ struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm, return cma_obj; error: - drm_gem_object_put_unlocked(&cma_obj->base); + drm_gem_object_put(&cma_obj->base); return ERR_PTR(ret); } EXPORT_SYMBOL_GPL(drm_gem_cma_create); @@ -156,7 +156,7 @@ drm_gem_cma_create_with_handle(struct drm_file *file_priv, */ ret = drm_gem_handle_create(file_priv, gem_obj, handle); /* drop reference from allocate - handle holds it now. */ - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); if (ret) return ERR_PTR(ret); @@ -380,13 +380,13 @@ unsigned long drm_gem_cma_get_unmapped_area(struct file *filp, return -EINVAL; if (!drm_vma_node_is_allowed(node, priv)) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return -EACCES; } cma_obj = to_drm_gem_cma_obj(obj); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return cma_obj->vaddr ? (unsigned long)cma_obj->vaddr : -EINVAL; } diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index ccc2c71fa491..109d11fb4cd4 100644 --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -95,7 +95,7 @@ void drm_gem_fb_destroy(struct drm_framebuffer *fb) int i; for (i = 0; i < 4; i++) - drm_gem_object_put_unlocked(fb->obj[i]); + drm_gem_object_put(fb->obj[i]); drm_framebuffer_cleanup(fb); kfree(fb); @@ -175,7 +175,7 @@ int drm_gem_fb_init_with_funcs(struct drm_device *dev, + mode_cmd->offsets[i]; if (objs[i]->size < min_size) { - drm_gem_object_put_unlocked(objs[i]); + drm_gem_object_put(objs[i]); ret = -EINVAL; goto err_gem_object_put; } @@ -189,7 +189,7 @@ int drm_gem_fb_init_with_funcs(struct drm_device *dev, err_gem_object_put: for (i--; i >= 0; i--) - drm_gem_object_put_unlocked(objs[i]); + drm_gem_object_put(objs[i]); return ret; } diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index df31e5782eed..339eee79ea52 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -360,7 +360,7 @@ drm_gem_shmem_create_with_handle(struct drm_file *file_priv, */ ret = drm_gem_handle_create(file_priv, &shmem->base, handle); /* drop reference from allocate - handle holds it now. */ - drm_gem_object_put_unlocked(&shmem->base); + drm_gem_object_put(&shmem->base); if (ret) return ERR_PTR(ret); @@ -684,7 +684,7 @@ drm_gem_shmem_prime_import_sg_table(struct drm_device *dev, err_free_array: kvfree(shmem->pages); err_free_gem: - drm_gem_object_put_unlocked(&shmem->base); + drm_gem_object_put(&shmem->base); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/drm_gem_ttm_helper.c b/drivers/gpu/drm/drm_gem_ttm_helper.c index 605a8a3da7f9..892b2288a104 100644 --- a/drivers/gpu/drm/drm_gem_ttm_helper.c +++ b/drivers/gpu/drm/drm_gem_ttm_helper.c @@ -74,7 +74,7 @@ int drm_gem_ttm_mmap(struct drm_gem_object *gem, * ttm has its own object refcounting, so drop gem reference * to avoid double accounting counting. */ - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return 0; } diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c index 8b2d5c945c95..0023ce1d2cf7 100644 --- a/drivers/gpu/drm/drm_gem_vram_helper.c +++ b/drivers/gpu/drm/drm_gem_vram_helper.c @@ -618,9 +618,9 @@ int drm_gem_vram_fill_create_dumb(struct drm_file *file, ret = drm_gem_handle_create(file, &gbo->bo.base, &handle); if (ret) - goto err_drm_gem_object_put_unlocked; + goto err_drm_gem_object_put; - drm_gem_object_put_unlocked(&gbo->bo.base); + drm_gem_object_put(&gbo->bo.base); args->pitch = pitch; args->size = size; @@ -628,8 +628,8 @@ int drm_gem_vram_fill_create_dumb(struct drm_file *file, return 0; -err_drm_gem_object_put_unlocked: - drm_gem_object_put_unlocked(&gbo->bo.base); +err_drm_gem_object_put: + drm_gem_object_put(&gbo->bo.base); return ret; } EXPORT_SYMBOL(drm_gem_vram_fill_create_dumb); @@ -737,7 +737,7 @@ int drm_gem_vram_driver_dumb_mmap_offset(struct drm_file *file, gbo = drm_gem_vram_of_gem(gem); *offset = drm_gem_vram_mmap_offset(gbo); - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return 0; } diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 282774e469ac..bbfc713bfdc3 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -270,7 +270,7 @@ void drm_gem_dmabuf_release(struct dma_buf *dma_buf) struct drm_device *dev = obj->dev; /* drop the reference on the export fd holds */ - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); drm_dev_put(dev); } @@ -329,7 +329,7 @@ int drm_gem_prime_fd_to_handle(struct drm_device *dev, /* _handle_create_tail unconditionally unlocks dev->object_name_lock. */ ret = drm_gem_handle_create_tail(file_priv, obj, handle); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); if (ret) goto out_put; @@ -500,7 +500,7 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev, fail_put_dmabuf: dma_buf_put(dmabuf); out: - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); out_unlock: mutex_unlock(&file_priv->prime.lock); diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 2f7b86c0649c..10c5d561eb18 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -188,7 +188,7 @@ struct drm_gem_object { * Reference count of this object * * Please use drm_gem_object_get() to acquire and drm_gem_object_put_locked() - * or drm_gem_object_put_unlocked() to release a reference to a GEM + * or drm_gem_object_put() to release a reference to a GEM * buffer object. */ struct kref refcount; From patchwork Fri May 15 09:50:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550905 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 A596F739 for ; Fri, 15 May 2020 09:54:38 +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 8463320709 for ; Fri, 15 May 2020 09:54:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NH3BKSKl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8463320709 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 78DC26EC41; Fri, 15 May 2020 09:54:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 90CAB6EC37 for ; Fri, 15 May 2020 09:54:19 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id l18so2794310wrn.6 for ; Fri, 15 May 2020 02:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lqpj4NNdgUNumzCeY85kPOZ58nQ5tEaO/ei5PoeNh7w=; b=NH3BKSKlT6nQ6dO2WYnfQxWnOxpTD4rnahdOxdHMx385hdUgO1/w1784RhWc/2Ou90 /I9BGISWkibUhVKn7v365r7ZaWyRE+hxVFWH4nleRNxvbaNk8eYnm+PQfV+SDZiuozyL xqO3+5ci6d6jJmljOmygLwAB/oSV2QED5X02Ta/OWhlaVFp4sih+F0bNSvYZR3ChdXUp XMnPr96v5J1wOjbw6DNQ/33MbYZrBKmV6QdBRUYZIA1h1kPBYVHHm+P/kUXAdvJatqkk xvm1E3CRjpf7KyWdgtFqciK6A6YVb6JBj18AfNUh1dBUxQdUCHhSDweMPhtEDKNUaI+J NmIg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=lqpj4NNdgUNumzCeY85kPOZ58nQ5tEaO/ei5PoeNh7w=; b=VGpA28O8AKSXV9YJqnDhkOd58xJsBXTSQ1Seg1/4/BsFzsNEEE4bwhrZeTmxb6xNPB 6ptN6yTHLr+Azp6FnjXngn68QIj0N9y8bpkzTOQ3EzQUhEF2Nk20YqHmdXxEXBTnNtGo mN/WcuqQ+bwSvEq9A0zvwYD7qlyDrBN0rnAr6WbJ+ewLQ/OCjhODgYKZkRjMd84JI/aI Jz3KX3Y6g6OBl285syLVztWl6FKbG6CpqKYSks5TnDPOhqEZ1lpxfnviLkxCZDS0hNkY TpgR7kIOdi1iAiz5F5/JcISiGw6mnDv6UAO8zkvllY7fvrnjJKwUWMC9r4iXTFOmOwH5 gyEw== X-Gm-Message-State: AOAM532xdYhBj7dpUakaU57GZgSDAIiw3KBYgJHXyRGJGvxTk+eOiysO ov8jLQnFd/m9A1N4mDDzMY1OUFQe X-Google-Smtp-Source: ABdhPJzM5KbtL1Kaou05L/1y4/OvRvACAk0VmZbwJssxMVs/I5p/AMW64/bncRB1Gw5zTOuYoDnsNQ== X-Received: by 2002:a05:6000:1150:: with SMTP id d16mr3344277wrx.197.1589536457867; Fri, 15 May 2020 02:54:17 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:16 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 14/38] drm/amd: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:50:54 +0100 Message-Id: <20200515095118.2743122-15-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , emil.l.velikov@gmail.com, =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Alex Deucher Cc: "Christian König" Cc: "David (ChunMing) Zhou" Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 20 ++++++++++---------- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 6 +++--- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 6 +++--- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c index 85b0515c0fdc..4053597b3af2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c @@ -102,7 +102,7 @@ int amdgpu_bo_list_create(struct amdgpu_device *adev, struct drm_file *filp, } bo = amdgpu_bo_ref(gem_to_amdgpu_bo(gobj)); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); usermm = amdgpu_ttm_tt_get_usermm(bo->tbo.ttm); if (usermm) { diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index af91627b19b0..76ea245f2106 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -57,7 +57,7 @@ static int amdgpu_cs_user_fence_chunk(struct amdgpu_cs_parser *p, /* One for TTM and one for the CS job */ p->uf_entry.tv.num_shared = 2; - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); size = amdgpu_bo_size(bo); if (size != PAGE_SIZE || (data->offset + 8) > size) { diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 84cee27cd7ef..de9b62e2800a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -575,14 +575,14 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, amdgpu_fb = kzalloc(sizeof(*amdgpu_fb), GFP_KERNEL); if (amdgpu_fb == NULL) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ERR_PTR(-ENOMEM); } ret = amdgpu_display_framebuffer_init(dev, amdgpu_fb, mode_cmd, obj); if (ret) { kfree(amdgpu_fb); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c index 652c57a3b847..43d8ed7dbd00 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c @@ -587,7 +587,7 @@ struct drm_gem_object *amdgpu_gem_prime_import(struct drm_device *dev, attach = dma_buf_dynamic_attach(dma_buf, dev->dev, &amdgpu_dma_buf_attach_ops, obj); if (IS_ERR(attach)) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ERR_CAST(attach); } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c index 9ae7b61f696a..ca5dde4ec47d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c @@ -114,7 +114,7 @@ static void amdgpufb_destroy_pinned_object(struct drm_gem_object *gobj) amdgpu_bo_unpin(abo); amdgpu_bo_unreserve(abo); } - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); } static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, @@ -279,7 +279,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper, } if (fb && ret) { - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); drm_framebuffer_unregister_private(fb); drm_framebuffer_cleanup(fb); kfree(fb); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index e42608115c99..8c0597f306ec 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -106,7 +106,7 @@ void amdgpu_gem_force_release(struct amdgpu_device *adev) spin_lock(&file->table_lock); idr_for_each_entry(&file->object_idr, gobj, handle) { WARN_ONCE(1, "And also active allocations!\n"); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); } idr_destroy(&file->object_idr); spin_unlock(&file->table_lock); @@ -272,7 +272,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data, r = drm_gem_handle_create(filp, gobj, &handle); /* drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); if (r) return r; @@ -356,7 +356,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, amdgpu_ttm_tt_get_user_pages_done(bo->tbo.ttm); release_object: - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return r; } @@ -375,11 +375,11 @@ int amdgpu_mode_dumb_mmap(struct drm_file *filp, robj = gem_to_amdgpu_bo(gobj); if (amdgpu_ttm_tt_get_usermm(robj->tbo.ttm) || (robj->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)) { - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return -EPERM; } *offset_p = amdgpu_bo_mmap_offset(robj); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return 0; } @@ -449,7 +449,7 @@ int amdgpu_gem_wait_idle_ioctl(struct drm_device *dev, void *data, } else r = ret; - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return r; } @@ -492,7 +492,7 @@ int amdgpu_gem_metadata_ioctl(struct drm_device *dev, void *data, unreserve: amdgpu_bo_unreserve(robj); out: - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return r; } @@ -691,7 +691,7 @@ int amdgpu_gem_va_ioctl(struct drm_device *dev, void *data, ttm_eu_backoff_reservation(&ticket, &list); error_unref: - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return r; } @@ -767,7 +767,7 @@ int amdgpu_gem_op_ioctl(struct drm_device *dev, void *data, } out: - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return r; } @@ -804,7 +804,7 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv, r = drm_gem_handle_create(file_priv, gobj, &handle); /* drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); if (r) { return r; } diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c index 2512e7ebfedf..47a6e3d0aa96 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c @@ -2404,7 +2404,7 @@ static int dce_v10_0_crtc_cursor_set2(struct drm_crtc *crtc, aobj = gem_to_amdgpu_bo(obj); ret = amdgpu_bo_reserve(aobj, false); if (ret != 0) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -2412,7 +2412,7 @@ static int dce_v10_0_crtc_cursor_set2(struct drm_crtc *crtc, amdgpu_bo_unreserve(aobj); if (ret) { DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj); @@ -2447,7 +2447,7 @@ static int dce_v10_0_crtc_cursor_set2(struct drm_crtc *crtc, amdgpu_bo_unpin(aobj); amdgpu_bo_unreserve(aobj); } - drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo); + drm_gem_object_put(amdgpu_crtc->cursor_bo); } amdgpu_crtc->cursor_bo = obj; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c index 0dde22db9848..7d16fb5a9482 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c @@ -2483,7 +2483,7 @@ static int dce_v11_0_crtc_cursor_set2(struct drm_crtc *crtc, aobj = gem_to_amdgpu_bo(obj); ret = amdgpu_bo_reserve(aobj, false); if (ret != 0) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -2491,7 +2491,7 @@ static int dce_v11_0_crtc_cursor_set2(struct drm_crtc *crtc, amdgpu_bo_unreserve(aobj); if (ret) { DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj); @@ -2526,7 +2526,7 @@ static int dce_v11_0_crtc_cursor_set2(struct drm_crtc *crtc, amdgpu_bo_unpin(aobj); amdgpu_bo_unreserve(aobj); } - drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo); + drm_gem_object_put(amdgpu_crtc->cursor_bo); } amdgpu_crtc->cursor_bo = obj; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c index 84219534bd38..1ab33aa3980e 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c @@ -2299,7 +2299,7 @@ static int dce_v6_0_crtc_cursor_set2(struct drm_crtc *crtc, aobj = gem_to_amdgpu_bo(obj); ret = amdgpu_bo_reserve(aobj, false); if (ret != 0) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -2307,7 +2307,7 @@ static int dce_v6_0_crtc_cursor_set2(struct drm_crtc *crtc, amdgpu_bo_unreserve(aobj); if (ret) { DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj); @@ -2342,7 +2342,7 @@ static int dce_v6_0_crtc_cursor_set2(struct drm_crtc *crtc, amdgpu_bo_unpin(aobj); amdgpu_bo_unreserve(aobj); } - drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo); + drm_gem_object_put(amdgpu_crtc->cursor_bo); } amdgpu_crtc->cursor_bo = obj; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c index 3a640702d7d1..8a8f1aa49212 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c @@ -2305,7 +2305,7 @@ static int dce_v8_0_crtc_cursor_set2(struct drm_crtc *crtc, aobj = gem_to_amdgpu_bo(obj); ret = amdgpu_bo_reserve(aobj, false); if (ret != 0) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -2313,7 +2313,7 @@ static int dce_v8_0_crtc_cursor_set2(struct drm_crtc *crtc, amdgpu_bo_unreserve(aobj); if (ret) { DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj); @@ -2348,7 +2348,7 @@ static int dce_v8_0_crtc_cursor_set2(struct drm_crtc *crtc, amdgpu_bo_unpin(aobj); amdgpu_bo_unreserve(aobj); } - drm_gem_object_put_unlocked(amdgpu_crtc->cursor_bo); + drm_gem_object_put(amdgpu_crtc->cursor_bo); } amdgpu_crtc->cursor_bo = obj; From patchwork Fri May 15 09:50:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550899 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 D1272739 for ; Fri, 15 May 2020 09:54:33 +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 AF44320709 for ; Fri, 15 May 2020 09:54:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KOVy+6Bu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF44320709 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 B22C66EC37; Fri, 15 May 2020 09:54:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 87F106EC37 for ; Fri, 15 May 2020 09:54:20 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id i15so2752987wrx.10 for ; Fri, 15 May 2020 02:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PasN3W+D2oQqot5e26TwMNatIzqzako2o4xSnkb4yyE=; b=KOVy+6BuuQhwNc3+thbObORaoaD52Frv+Wua2mM8Ftt5/b0MTsxAIIroHpfysWACCH pgdLxICASyfIUgs+MI7J966a3vmmC+Oz8wF7NqkEsXXZGp3PEnM7va0F1kzZwBTBdOOy E3X1q4g0A57iPckmglLi7RPmM0c0+dIaTxC0tA/cNRgx4Y9fpNqybzRL9iRCJC4dT2S8 qyHFvj8ny0RUo4g4ptpc0uWvfRLLM1RQraUA6fY9ZeqgOkhJVSBllCXKsqrGI8IOFMIf QCxkIkAwkjf/wD0gHbdcxqdrknl1WUIB9jpaLLnhxYLgnWUCImz/SJ/a4L1eojVT30/j hUXQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=PasN3W+D2oQqot5e26TwMNatIzqzako2o4xSnkb4yyE=; b=Jb5tipDYq98nxntuL2w+XyLYUBX4QYOYfHKPygVxEHOAC7j6CDAOkxssKcLAyaodRa 5PptWFoi1Nv+mU9VXjf30E5SK24cd1iSQb7oHnG4UU5mXsrgStWh5duBDJdYtxX5Fzgh 0qHk5X2jYFLqv6obQY6CtZS1UNXE41pmga1b2lCaz2xaWFj3OCwYzIHK/DcXn9UJ+9lG 2GNHr1RB6O15qQSoLuQN9k4qU6vXZWWmvGxA5j2coVAq6+XjQLBYG8eJsI7JmR2xGMxa kJ61w+PoFqnx+7w7vennE9XshsV/lK2wG7N0GrUMYn61LfdmPQR1+iaP3dRcWUDG8MTf et2Q== X-Gm-Message-State: AOAM53002MNjcobUAC6Z+XGw31j8Wchm3GZeNVPhbmtFPi6AM34Z7ziB OuVl6uq3AiiB2tghEksA3v3iG9n5 X-Google-Smtp-Source: ABdhPJy6whfnAu7ss2H/eEo6S/KzQKTd7exeSLiHy0qZa5Ulbvmas1hPATFMMXyi5p7sKXR7MXls9g== X-Received: by 2002:adf:9d91:: with SMTP id p17mr3242727wre.119.1589536459006; Fri, 15 May 2020 02:54:19 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:18 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 15/38] drm/arm: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:50:55 +0100 Message-Id: <20200515095118.2743122-16-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Liviu Dudau , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Liviu Dudau Cc: Brian Starkey Cc: David Airlie Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Acked-by: Liviu Dudau --- drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c | 6 +++--- drivers/gpu/drm/arm/malidp_drv.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c index 1b01a625f40e..170f9dc8ec19 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c @@ -19,7 +19,7 @@ static void komeda_fb_destroy(struct drm_framebuffer *fb) u32 i; for (i = 0; i < fb->format->num_planes; i++) - drm_gem_object_put_unlocked(fb->obj[i]); + drm_gem_object_put(fb->obj[i]); drm_framebuffer_cleanup(fb); kfree(kfb); @@ -103,7 +103,7 @@ komeda_fb_afbc_size_check(struct komeda_fb *kfb, struct drm_file *file, return 0; check_failed: - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return -EINVAL; } @@ -199,7 +199,7 @@ komeda_fb_create(struct drm_device *dev, struct drm_file *file, err_cleanup: for (i = 0; i < kfb->base.format->num_planes; i++) - drm_gem_object_put_unlocked(kfb->base.obj[i]); + drm_gem_object_put(kfb->base.obj[i]); kfree(kfb); return ERR_PTR(ret); diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index def8c9ffafca..c2507b7d8512 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -349,11 +349,11 @@ malidp_verify_afbc_framebuffer_size(struct drm_device *dev, if (objs->size < afbc_size) { DRM_DEBUG_KMS("buffer size (%zu) too small for AFBC buffer size = %u\n", objs->size, afbc_size); - drm_gem_object_put_unlocked(objs); + drm_gem_object_put(objs); return false; } - drm_gem_object_put_unlocked(objs); + drm_gem_object_put(objs); return true; } From patchwork Fri May 15 09:50:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550897 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 2E02E90 for ; Fri, 15 May 2020 09:54:32 +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 0D4322074D for ; Fri, 15 May 2020 09:54:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dlxaXdIZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D4322074D 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 09EA56EC3D; Fri, 15 May 2020 09:54:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id BFB4E6EC37 for ; Fri, 15 May 2020 09:54:21 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id d207so13467063wmd.0 for ; Fri, 15 May 2020 02:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tbvgcgkzORSo0eJN5X1CBpl4ptTJHT4taFqxeXu2zWg=; b=dlxaXdIZYgsKFuoob89jMzOspwGGWf0T5XGgk5Z+wv7QmAAifmDwqmVhdDxr4iI3Hp 4zq4/etSiZgG9U4UWLe0WamGLFWhenSVYcu4riUoG40LAVPusgdoskZSTdM8FvPayRXk /1UtcByNH751r0NBWUFLqW4CHcDtb35LkcEoyO+5D9HQryIAHoWW/hiL+otzGNsR7u71 HkzQKfv/mloyjefMPrMpw67V5+5vbbSWvQbALoSxvU0i7NXwsgt9iRFS6QegGJaejE60 G/4I/qslWztff6w2P6q6RlSYjMAyC6x5NmlrmSpnq/UOAWgIy2mO8CmxqcLlPageqGtN 8wtQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=tbvgcgkzORSo0eJN5X1CBpl4ptTJHT4taFqxeXu2zWg=; b=Zlujp21IwsXZtCv7fWNG1YLUtRAZWtWRiZNkF36t5g331kf9gWIfTsJeEkz2LCTQuV P69Jse/PcedzBh2E19aruO2nxOxmYXVcy0eWqR5n1M/A5X7Qpn3Uf2BM7Zdx/Vuwsoww 6OVnNhWLezltYo8HT3+FYI+/w+uOvZcappnsfd2Ku9LA3KIX0Ervb9jfuzzO16SWZv2M a9qiXMM8oO69e9+MODpmb0FtBjcqzWtyAOur78CqPFbd+9tJiO8o7IejA9JijepbLHzk 5yrMKCWSCVxy0uhGrvxKzaYBQAtzy9WzdTUXiKfQqRu5zsTNS6IzHHmJbQ6wICLWjaZS MsMA== X-Gm-Message-State: AOAM532ABPSzJmRc71MnHq/dOdO23cuo5H/sC/QUxitt2eczg54m6eTi 98jK4VKZh+8H/+vFVvMU5MqMviRr X-Google-Smtp-Source: ABdhPJyuJIhqxRIizGivbu09ouNf1vnXXPVLuGO724EUPW6Np14pd+iKmEzo5Cb8GVq0bnsLNXmJDA== X-Received: by 2002:a7b:c4cc:: with SMTP id g12mr3098019wmk.168.1589536460094; Fri, 15 May 2020 02:54:20 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:19 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 16/38] drm/armada: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:50:56 +0100 Message-Id: <20200515095118.2743122-17-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com, Russell King Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Russell King Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/armada/armada_crtc.c | 8 ++++---- drivers/gpu/drm/armada/armada_fb.c | 4 ++-- drivers/gpu/drm/armada/armada_fbdev.c | 6 +++--- drivers/gpu/drm/armada/armada_gem.c | 10 +++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index c2b92acd1e9a..38dfaa46d306 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -710,13 +710,13 @@ static int armada_drm_crtc_cursor_set(struct drm_crtc *crtc, /* Must be a kernel-mapped object */ if (!obj->addr) { - drm_gem_object_put_unlocked(&obj->obj); + drm_gem_object_put(&obj->obj); return -EINVAL; } if (obj->obj.size < w * h * 4) { DRM_ERROR("buffer is too small\n"); - drm_gem_object_put_unlocked(&obj->obj); + drm_gem_object_put(&obj->obj); return -ENOMEM; } } @@ -724,7 +724,7 @@ static int armada_drm_crtc_cursor_set(struct drm_crtc *crtc, if (dcrtc->cursor_obj) { dcrtc->cursor_obj->update = NULL; dcrtc->cursor_obj->update_data = NULL; - drm_gem_object_put_unlocked(&dcrtc->cursor_obj->obj); + drm_gem_object_put(&dcrtc->cursor_obj->obj); } dcrtc->cursor_obj = obj; dcrtc->cursor_w = w; @@ -760,7 +760,7 @@ static void armada_drm_crtc_destroy(struct drm_crtc *crtc) struct armada_private *priv = crtc->dev->dev_private; if (dcrtc->cursor_obj) - drm_gem_object_put_unlocked(&dcrtc->cursor_obj->obj); + drm_gem_object_put(&dcrtc->cursor_obj->obj); priv->dcrtc[dcrtc->num] = NULL; drm_crtc_cleanup(&dcrtc->crtc); diff --git a/drivers/gpu/drm/armada/armada_fb.c b/drivers/gpu/drm/armada/armada_fb.c index 426ca383d696..b87c71703c85 100644 --- a/drivers/gpu/drm/armada/armada_fb.c +++ b/drivers/gpu/drm/armada/armada_fb.c @@ -129,12 +129,12 @@ struct drm_framebuffer *armada_fb_create(struct drm_device *dev, goto err; } - drm_gem_object_put_unlocked(&obj->obj); + drm_gem_object_put(&obj->obj); return &dfb->fb; err_unref: - drm_gem_object_put_unlocked(&obj->obj); + drm_gem_object_put(&obj->obj); err: DRM_ERROR("failed to initialize framebuffer: %d\n", ret); return ERR_PTR(ret); diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c index f2dc371bd8e5..0c4601275507 100644 --- a/drivers/gpu/drm/armada/armada_fbdev.c +++ b/drivers/gpu/drm/armada/armada_fbdev.c @@ -51,13 +51,13 @@ static int armada_fbdev_create(struct drm_fb_helper *fbh, ret = armada_gem_linear_back(dev, obj); if (ret) { - drm_gem_object_put_unlocked(&obj->obj); + drm_gem_object_put(&obj->obj); return ret; } ptr = armada_gem_map_object(dev, obj); if (!ptr) { - drm_gem_object_put_unlocked(&obj->obj); + drm_gem_object_put(&obj->obj); return -ENOMEM; } @@ -67,7 +67,7 @@ static int armada_fbdev_create(struct drm_fb_helper *fbh, * A reference is now held by the framebuffer object if * successful, otherwise this drops the ref for the error path. */ - drm_gem_object_put_unlocked(&obj->obj); + drm_gem_object_put(&obj->obj); if (IS_ERR(dfb)) return PTR_ERR(dfb); diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c index 976685f2939e..8005614d2e6b 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c @@ -256,7 +256,7 @@ int armada_gem_dumb_create(struct drm_file *file, struct drm_device *dev, /* drop reference from allocate - handle holds it now */ DRM_DEBUG_DRIVER("obj %p size %zu handle %#x\n", dobj, size, handle); err: - drm_gem_object_put_unlocked(&dobj->obj); + drm_gem_object_put(&dobj->obj); return ret; } @@ -288,7 +288,7 @@ int armada_gem_create_ioctl(struct drm_device *dev, void *data, /* drop reference from allocate - handle holds it now */ DRM_DEBUG_DRIVER("obj %p size %zu handle %#x\n", dobj, size, handle); err: - drm_gem_object_put_unlocked(&dobj->obj); + drm_gem_object_put(&dobj->obj); return ret; } @@ -305,13 +305,13 @@ int armada_gem_mmap_ioctl(struct drm_device *dev, void *data, return -ENOENT; if (!dobj->obj.filp) { - drm_gem_object_put_unlocked(&dobj->obj); + drm_gem_object_put(&dobj->obj); return -EINVAL; } addr = vm_mmap(dobj->obj.filp, 0, args->size, PROT_READ | PROT_WRITE, MAP_SHARED, args->offset); - drm_gem_object_put_unlocked(&dobj->obj); + drm_gem_object_put(&dobj->obj); if (IS_ERR_VALUE(addr)) return addr; @@ -366,7 +366,7 @@ int armada_gem_pwrite_ioctl(struct drm_device *dev, void *data, } unref: - drm_gem_object_put_unlocked(&dobj->obj); + drm_gem_object_put(&dobj->obj); return ret; } From patchwork Fri May 15 09:50:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550915 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 1337290 for ; Fri, 15 May 2020 09:54:47 +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 E62C120709 for ; Fri, 15 May 2020 09:54:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="s573uDUl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E62C120709 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 7DB816EC47; Fri, 15 May 2020 09:54:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA8F06EC37 for ; Fri, 15 May 2020 09:54:22 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id i15so2753127wrx.10 for ; Fri, 15 May 2020 02:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Lx4fAyASncse6GRQGzx5wh1kAFnQoIwQ5biN6ma9HAg=; b=s573uDUlkzT/1Ip0w5FxR+Nor4wOufYmfvCCNk+kZeAxeSyNURmm+X9qiPYb4xJ5Wq UvvAmSHN4YYzgW3pXGlSIaf6XGc0N6yhnr741KcmLeeKNcwkqzP1Gv52QZJVDwntfite 5t3jZI6DqBcocNPmWyjGk4qClrtyRHNPRv1zG03XiYzVir+pWWFSoBXOPKiT2fg4Gg4p DZ4ipaM5susb/zQz4ANKPkC9mBsIgetVQolDub5j5wmwUbaojxKaSBk4wB/VDTulWYTA g5s7/xPzI9LcvA6JfAj9drDpEmizkG2SCGwXA1h1m4RhlwwbuNrFAG9nFYMSP4gvGFmM fYdw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Lx4fAyASncse6GRQGzx5wh1kAFnQoIwQ5biN6ma9HAg=; b=Xj9ZWGqjSYMn+eHaQb27Qm/zbLoGaBwRv3nn5XKzbJ7XvZYhh5ropy9/ViUEU7XmUw /wXpXKs0y5ErEbmTEhu4CRf9L4QUw9g6gifTduZzCe2SpMr3okavCrsg7Kb5cwV9Q+Dn Z51hnem2lLPckh9dPbk5lE9RQ/veVD2OClFRRZSFiSYDxu5iLJQTv2mJZ66j/3wRNhZM 781FNynVij1C2DqJBtCsIHwYetuuz8hSWBPlvEIWNwXT9zcjaHRoVQUV0TU7ya848iZ4 xjHkaXlSfTqPOD+cGmlUqs59zj6Hh+jxoDElq77lDl2cwclJY5W7lOLhe7ovPSiBES74 4S3g== X-Gm-Message-State: AOAM532CtA+n164q9u7b1EQ2axL6lMUdG26VLeZYuXKax7/zK6t3/2bl pt/h6rTX5WAs0QpN3Ay+iSGL9rFA X-Google-Smtp-Source: ABdhPJzbLxd+Gg/5qbYT6eVu2A1cBhNjjE6XZ3t+uPzricqJDhgO9oClSFjCUo8W4uQbsjMUOX5fHw== X-Received: by 2002:a5d:560c:: with SMTP id l12mr3268610wrv.309.1589536461156; Fri, 15 May 2020 02:54:21 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:20 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 17/38] drm/etnaviv: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:50:57 +0100 Message-Id: <20200515095118.2743122-18-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Lucas Stach Cc: Russell King Cc: Christian Gmeiner Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 8 ++++---- drivers/gpu/drm/etnaviv/etnaviv_gem.c | 6 +++--- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 27c948f5dfeb..a2b649a8248e 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -289,7 +289,7 @@ static int etnaviv_ioctl_gem_cpu_prep(struct drm_device *dev, void *data, ret = etnaviv_gem_cpu_prep(obj, args->op, &args->timeout); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -310,7 +310,7 @@ static int etnaviv_ioctl_gem_cpu_fini(struct drm_device *dev, void *data, ret = etnaviv_gem_cpu_fini(obj); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -330,7 +330,7 @@ static int etnaviv_ioctl_gem_info(struct drm_device *dev, void *data, return -ENOENT; ret = etnaviv_gem_mmap_offset(obj, &args->offset); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -413,7 +413,7 @@ static int etnaviv_ioctl_gem_wait(struct drm_device *dev, void *data, ret = etnaviv_gem_wait_bo(gpu, obj, timeout); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index dc9ef302f517..b9bfb50ce7ee 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -244,7 +244,7 @@ void etnaviv_gem_mapping_unreference(struct etnaviv_vram_mapping *mapping) mapping->use -= 1; mutex_unlock(&etnaviv_obj->lock); - drm_gem_object_put_unlocked(&etnaviv_obj->base); + drm_gem_object_put(&etnaviv_obj->base); } struct etnaviv_vram_mapping *etnaviv_gem_mapping_get( @@ -633,7 +633,7 @@ int etnaviv_gem_new_handle(struct drm_device *dev, struct drm_file *file, /* drop reference from allocate - handle holds it now */ fail: - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -742,6 +742,6 @@ int etnaviv_gem_new_userptr(struct drm_device *dev, struct drm_file *file, ret = drm_gem_handle_create(file, &etnaviv_obj->base, handle); /* drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(&etnaviv_obj->base); + drm_gem_object_put(&etnaviv_obj->base); return ret; } diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c index f24dd21c2363..6d9e5c3c4dd5 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c @@ -136,7 +136,7 @@ struct drm_gem_object *etnaviv_gem_prime_import_sg_table(struct drm_device *dev, return &etnaviv_obj->base; fail: - drm_gem_object_put_unlocked(&etnaviv_obj->base); + drm_gem_object_put(&etnaviv_obj->base); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c index 3b0afa156d92..1b12b57d2406 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem_submit.c @@ -396,7 +396,7 @@ static void submit_cleanup(struct kref *kref) /* if the GPU submit failed, objects might still be locked */ submit_unlock_object(submit, i); - drm_gem_object_put_unlocked(&etnaviv_obj->base); + drm_gem_object_put(&etnaviv_obj->base); } wake_up_all(&submit->gpu->fence_event); From patchwork Fri May 15 09:50:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550943 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 7D12090 for ; Fri, 15 May 2020 09:55:10 +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 5BE4820760 for ; Fri, 15 May 2020 09:55:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pV9+9H65" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5BE4820760 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 03B3D6EC55; Fri, 15 May 2020 09:55:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id B14126EC37 for ; Fri, 15 May 2020 09:54:23 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id m12so1685824wmc.0 for ; Fri, 15 May 2020 02:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s2z1DGx1GMlBzAmB3eSUZWfOTFeI6iBgho5FbisW/Pw=; b=pV9+9H655kpvsuLfsiErghRSOSMM4nrcS1E1qcDDPx+AUeV/TQlmfPhLHR8Ruln3EJ UhIAZfsbDNCYKCGUlDRzAd++m2Cmc9p5XcLRuGTNo1LNPzNO4bX/DXM2GiYuO0z9I/La SzzfRHCUrMLyeJj0iFCykw4xiKYa2KqxAiahTCzaC1ceIMyqiMn4O2L6ydO4DMpzCvOV CXNX8PMO0WBt3mixQw9zBFjgl3+nBRA2Sym0lz+iwRHON3Tuqa9854cKBugGi4haEWDn MoK3NkhYOyRvEn+NYnPyWmiM3TX3cpLaIB6s03DUNU+Aq83z+hr/nKdCNHYACB/MDZA1 i8XA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=s2z1DGx1GMlBzAmB3eSUZWfOTFeI6iBgho5FbisW/Pw=; b=i7R3RMtXo+LwF+Vt6ZhoQ6y8cdNiaS6RQhUshS8PqZZZoRz8DdjmjsSYD6k/LenSg1 E/zgF0jYWc3PciFzc6ovNYB5RE0KYDldECYrfNq7jNnHBQjGBcbIjway/OkVtBCAqr3u iaE7e8B/dRArdu2TtDw/Wm00lGy5LczpFxYLo3Gkpw19P1aEX1JlXlXGhu0RD2goSGo5 VjePTTIW2wFxO2ARldK0skSBj6tzZSobmzGGSB7TN7rUipnlPZNr4B0qLnt3cD8wzYmH DPcOAOzGWPGI/KSO6FnGbhm90cL9o7u0mozfHXd3126l50Y6nNZZZDFUfqAzN4RRyroH tN/w== X-Gm-Message-State: AOAM530LlTK//vB4DjPpdzPHtfYghrf5T+1M2on2eRvfmbYYBQhZQVSe OmgGP5dJYy7gnAc90/cwD/2OQwa7 X-Google-Smtp-Source: ABdhPJwOaX7AIaImM5J2f6DeNpLzuygVGRzkmnzOaUCbySkzwdtAuHVNw4u4ynjvfTlMM3+xCXPwzw== X-Received: by 2002:a05:600c:206:: with SMTP id 6mr3155974wmi.170.1589536462169; Fri, 15 May 2020 02:54:22 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:21 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 18/38] drm/exynos: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:50:58 +0100 Message-Id: <20200515095118.2743122-19-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Seung-Woo Kim , emil.l.velikov@gmail.com, Joonyoung Shim Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_gem.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index d734d9d51762..642a276e869b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -139,7 +139,7 @@ static int exynos_drm_gem_handle_create(struct drm_gem_object *obj, DRM_DEV_DEBUG_KMS(to_dma_dev(obj->dev), "gem handle = 0x%x\n", *handle); /* drop reference from allocate - handle holds it now. */ - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return 0; } @@ -333,7 +333,7 @@ int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data, args->flags = exynos_gem->flags; args->size = exynos_gem->size; - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return 0; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.h b/drivers/gpu/drm/exynos/exynos_drm_gem.h index 42ec67bc262d..0e8d2306c08a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.h +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.h @@ -86,7 +86,7 @@ struct exynos_drm_gem *exynos_drm_gem_get(struct drm_file *filp, */ static inline void exynos_drm_gem_put(struct exynos_drm_gem *exynos_gem) { - drm_gem_object_put_unlocked(&exynos_gem->base); + drm_gem_object_put(&exynos_gem->base); } /* get buffer information to memory region allocated by gem. */ From patchwork Fri May 15 09:50:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550901 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 6A52890 for ; Fri, 15 May 2020 09:54:35 +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 468CA20760 for ; Fri, 15 May 2020 09:54:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BEr8TyK6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 468CA20760 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 3B58C6EC43; Fri, 15 May 2020 09:54:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id C3B9F6EC3E for ; Fri, 15 May 2020 09:54:24 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id i15so2753234wrx.10 for ; Fri, 15 May 2020 02:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=58auif6URxwzpvANMDQsAuUmxd1R8EWV4uHUiihpz2k=; b=BEr8TyK6w1C3XnaaBo4uTyCxpwx2Y/O3wl7OkU5VaI5pfHU2qo6VQpotbq9dGRgkN8 mYwCkmDx/dffKBxB1QG4CXTRxt5gNe5P1QMSTPh28SBS9ZZjA1pC43HFlZCayepaYgVB TwLj3+gv+UpRGY7mylPH+vjTOocPXVhkG3uz7XsFEMaqc5dLHMXTRlNihOfXqfn4LIBN k+K93kRZU+0A11wtpS94wl5toPQ9ujoE3nC8YyGzWFPSVfu36fS1SJxKAz2dGViJG0ut Z4ANQx/mM1zrb1LIvzKKLGbD6Jsy8J2tQ47uKqD8VMigeS5wjdY3SA+ILwHMIuVDRcpB EaYA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=58auif6URxwzpvANMDQsAuUmxd1R8EWV4uHUiihpz2k=; b=OXhJLhzrthIzWycBpXy2r67Y1208+s7Dul1MGZYqNdDoFSSUpAWzawI3vNF/96KL9B PWTpiDudsd/T0EeJbFUwi6sXOOz314R+V00y0ZPgjzv9yTIl21XxdzcIM8xULPPBCM8C LgA1oQw75hn6TsKImnNib9s2GLzor3IJUVNMS8G2E0xWcGNvbj8bSRzHG/MExN79xVUF K1GiK7uGLceD3dR08NscW9RwS6xmm0T3k7dSQzLAkR6ZQTJZlp3uoMj3k39RIYlaiV/x sUhTQYNMUlu67g7YCr4QBhoT25CoLWi0y8t8racY9pB+wDbMo/8jeabwwuVYQModJXDA gYJA== X-Gm-Message-State: AOAM5331ii2zNNYlhJMXLGfLXDC1oxWXm8mgAd8HIhOR2sTyUIwOBfV9 R/gNQIvf9TOE8zZtH5GmEu3rqdET X-Google-Smtp-Source: ABdhPJxETSC9+4HLu3ZVDDmu7XJixMvTOvIeSjmMtYtO4ocODr3X1v3KMepytcr/07ydvVgoCgLJxA== X-Received: by 2002:a5d:444c:: with SMTP id x12mr3283414wrr.406.1589536463221; Fri, 15 May 2020 02:54:23 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:22 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 19/38] drm/gma500: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:50:59 +0100 Message-Id: <20200515095118.2743122-20-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Patrik Jakobsson Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/gma500/framebuffer.c | 2 +- drivers/gpu/drm/gma500/gem.c | 2 +- drivers/gpu/drm/gma500/gma_display.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 23a78d755382..da02d7e8a8f5 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -491,7 +491,7 @@ static int psb_fbdev_destroy(struct drm_device *dev, drm_framebuffer_cleanup(fb); if (fb->obj[0]) - drm_gem_object_put_unlocked(fb->obj[0]); + drm_gem_object_put(fb->obj[0]); kfree(fb); return 0; diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c index 83ee86f70b89..f9c4b1d76f56 100644 --- a/drivers/gpu/drm/gma500/gem.c +++ b/drivers/gpu/drm/gma500/gem.c @@ -82,7 +82,7 @@ int psb_gem_create(struct drm_file *file, struct drm_device *dev, u64 size, return ret; } /* We have the initial and handle reference but need only one now */ - drm_gem_object_put_unlocked(&r->gem); + drm_gem_object_put(&r->gem); *handlep = handle; return 0; } diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c index 17f136985d21..3df6d6e850f5 100644 --- a/drivers/gpu/drm/gma500/gma_display.c +++ b/drivers/gpu/drm/gma500/gma_display.c @@ -351,7 +351,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem); psb_gtt_unpin(gt); - drm_gem_object_put_unlocked(gma_crtc->cursor_obj); + drm_gem_object_put(gma_crtc->cursor_obj); gma_crtc->cursor_obj = NULL; } return 0; @@ -427,7 +427,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, if (gma_crtc->cursor_obj) { gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem); psb_gtt_unpin(gt); - drm_gem_object_put_unlocked(gma_crtc->cursor_obj); + drm_gem_object_put(gma_crtc->cursor_obj); } gma_crtc->cursor_obj = obj; @@ -435,7 +435,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, return ret; unref_cursor: - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } From patchwork Fri May 15 09:51:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550913 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 9F4FD90 for ; Fri, 15 May 2020 09:54:45 +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 7DFAD2074D for ; Fri, 15 May 2020 09:54:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bMo6nfNp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DFAD2074D 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 5D9C86EC46; Fri, 15 May 2020 09:54:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id 109516EC3E for ; Fri, 15 May 2020 09:54:26 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id n5so1977955wmd.0 for ; Fri, 15 May 2020 02:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iceSFEjYsMgoMc2AYqn40F50DO/8wmn0G0OUIX+s0uY=; b=bMo6nfNpzofIY5dEo8bNRJRm30NG65+hUtAQ332Gk+X0O4JuYbwfgLycwqYWsRKHDH /m3TcI+9uE/8VsXp6K3WGH0KGD4Ez61J//xozhuFReZTX2FrEVjFU6RL3zJPd4cWm7lf Vc6w9nkXHdGWiiO5r6XKuEoPA03gKFe1Vq7QNnRcW/bATHGwB/gVTyy4HMNo2nvySYBO O7kKVuyPfTUqZeh0H0FUFRxx2Nfb50DcDuuEGD94Ev+3J32/rAUNZZnucBbpqWXu2OT+ +B5pZmoM8bGfswyfHkv4yY5mw2dKHIAyLAotXBIt8toJmG2MVH/FMvTKoRFUmikU9thE TlYw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=iceSFEjYsMgoMc2AYqn40F50DO/8wmn0G0OUIX+s0uY=; b=fLV9Hu6FJjyBz1EwAnEeDQP/auB/CPfBHmZW54fl/9QRd2mGRWYxHDSnRJ0iwtdpS4 UzEB8hY5aYLeQ0+/WePxEyw2y7Z1zoXvf2vHnOAXxvor3uBfX2KKf/8hHIDN42AoMKjz z7hYbc0ZNW3gZ6GPb1shn+Nnti2F6vP4nd6R4yaOC8e5J+taDhu+TDyUd8KtF69sMf8N vYAzJe8ltnSWGpONEIxbuem2vyKEV3JXOJU1t5+vz8/3+RAfaENncKTrL6gBK685z83u UzH5vXSZsIGlzFQNsejLBnHBuoLQA8t1HtwSYC96YKns4dU7lxw/R/dbjYf6JtW/JpBd yxJA== X-Gm-Message-State: AOAM531ZCQTIFgrgLtSBOmviteL8tJLgUlx0xTgh6d3OZH/clrSOBPS5 UgIihEwVI30mxBXEZ7SMYWPEYH0u X-Google-Smtp-Source: ABdhPJwXEWb0Jm4aH72BhZHvYn1NMiCPKKfowjY46J9RV11L80MDNpC87ZTyZ+f/s3qvHCuCNXOTBw== X-Received: by 2002:a1c:9e45:: with SMTP id h66mr3161331wme.106.1589536464391; Fri, 15 May 2020 02:54:24 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:23 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 20/38] drm/i915: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:00 +0100 Message-Id: <20200515095118.2743122-21-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com, Rodrigo Vivi Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h index 41351cbf31b5..aba7517c2837 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h @@ -105,7 +105,7 @@ __attribute__((nonnull)) static inline void i915_gem_object_put(struct drm_i915_gem_object *obj) { - drm_gem_object_put_unlocked(&obj->base); + drm_gem_object_put(&obj->base); } #define assert_object_held(obj) dma_resv_assert_held((obj)->base.resv) From patchwork Fri May 15 09:51:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550917 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 4D5EF739 for ; Fri, 15 May 2020 09:54:48 +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 2C3EA20709 for ; Fri, 15 May 2020 09:54:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gpAleM7X" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C3EA20709 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 3CD696EC4A; Fri, 15 May 2020 09:54:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 33C7B6EC42 for ; Fri, 15 May 2020 09:54:27 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id f13so1653882wmc.5 for ; Fri, 15 May 2020 02:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JAIXTkR0UxzL/YJ0vaCb8ggiV3isdKW1wP+cuDhL8YY=; b=gpAleM7XTumyRfGNVwMWWvdeCP9nsmINXbzJvodFtBWr+9rcVpo6Q1LRIgK9/cZG0f hb5SfL6KC5Y//4MaFKW6w1gNBtG1yIxUcv7oJL3igK4vh/jCrG0LCEs8W0ed2/xmZYeO rn45EnBAawM76x2x0uCD2UjtJM2uSN9BP+wI2t5svn8I8upFfZLkuiyBwOAtPMcILRPw C5cr0Qkv+zb0KDUlGKpS0+K1BkDHocvgq4HbAW/oifKPn+TfHIUpItg96vm446pIUvvY 9u4EGH76yJcBQRQGAZlhOMsyIt/Upflk4DFCPki6HbTPEiytGaERQ6hZcR1Y8S7MEy2N BTDw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=JAIXTkR0UxzL/YJ0vaCb8ggiV3isdKW1wP+cuDhL8YY=; b=cZEtBB5vELvMbAmwG+gR+fol1ahaygwwp6KSyy6rCYvzSkXH0mnt5h85G35wSmKSwg Mh3SP6vRcaZ+nMlE2kPGkO4Bw9dBK4Y4Ayulr+wdriCKEDtpHkY5xkHQUS4fcIYoVT2t gWFtS4DVBKuC0fp3hd85+4a1ahW8XFG+li/ixoNimwdrsjRdZOi/bAt8EK4mwUaMSidE omdg0/02Ok2TTciH2T35fjAvOlofD7uMk2uSRs12QxEkSMa4x7ckCraMjkNDhfi0shQn puARE7GI3MyJqija8sykAyr9uQn+bkN1bdwxvuP760Y9oilej/Y9PVpNEfEa91CM8yDl n46w== X-Gm-Message-State: AOAM530t/VrSfbMfMMWn+RgA+rjYB4Wz/zoEbsHYqIrX7ru9FeDgJBJg stBeNIKFwQkRosPXKVC7qTwnxnL6 X-Google-Smtp-Source: ABdhPJzGRap487iObvgxfqu6wiOFrEjcFntpxKZp2MmFr1vHzqpsUaf8rQmP+SV7B3QtmXFeGkQgyQ== X-Received: by 2002:a7b:cd04:: with SMTP id f4mr3030852wmj.3.1589536465619; Fri, 15 May 2020 02:54:25 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:25 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 21/38] drm/lima: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:01 +0100 Message-Id: <20200515095118.2743122-22-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com, Qiang Yu Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Qiang Yu Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/lima/lima_gem.c | 10 +++++----- drivers/gpu/drm/lima/lima_sched.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/lima/lima_gem.c b/drivers/gpu/drm/lima/lima_gem.c index 5404e0d668db..155f2b4b4030 100644 --- a/drivers/gpu/drm/lima/lima_gem.c +++ b/drivers/gpu/drm/lima/lima_gem.c @@ -134,7 +134,7 @@ int lima_gem_create_handle(struct drm_device *dev, struct drm_file *file, out: /* drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return err; } @@ -243,7 +243,7 @@ int lima_gem_get_info(struct drm_file *file, u32 handle, u32 *va, u64 *offset) *offset = drm_vma_node_offset_addr(&obj->vma_node); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return 0; } @@ -323,7 +323,7 @@ int lima_gem_submit(struct drm_file *file, struct lima_submit *submit) */ err = lima_vm_bo_add(vm, bo, false); if (err) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); goto err_out0; } @@ -368,7 +368,7 @@ int lima_gem_submit(struct drm_file *file, struct lima_submit *submit) submit->nr_bos, &ctx); for (i = 0; i < submit->nr_bos; i++) - drm_gem_object_put_unlocked(&bos[i]->base.base); + drm_gem_object_put(&bos[i]->base.base); if (out_sync) { drm_syncobj_replace_fence(out_sync, fence); @@ -389,7 +389,7 @@ int lima_gem_submit(struct drm_file *file, struct lima_submit *submit) if (!bos[i]) break; lima_vm_bo_del(vm, bos[i]); - drm_gem_object_put_unlocked(&bos[i]->base.base); + drm_gem_object_put(&bos[i]->base.base); } if (out_sync) drm_syncobj_put(out_sync); diff --git a/drivers/gpu/drm/lima/lima_sched.c b/drivers/gpu/drm/lima/lima_sched.c index e6cefda00279..64ced6d0e6cf 100644 --- a/drivers/gpu/drm/lima/lima_sched.c +++ b/drivers/gpu/drm/lima/lima_sched.c @@ -151,7 +151,7 @@ void lima_sched_task_fini(struct lima_sched_task *task) if (task->bos) { for (i = 0; i < task->num_bos; i++) - drm_gem_object_put_unlocked(&task->bos[i]->base.base); + drm_gem_object_put(&task->bos[i]->base.base); kfree(task->bos); } From patchwork Fri May 15 09:51:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550935 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 F22A290 for ; Fri, 15 May 2020 09:55:01 +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 D07B720709 for ; Fri, 15 May 2020 09:55:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mlPrrJ41" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D07B720709 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 2F4976EC4F; Fri, 15 May 2020 09:54:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id B1E086EC42 for ; Fri, 15 May 2020 09:54:28 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id g12so1955226wmh.3 for ; Fri, 15 May 2020 02:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rs1sPOFZLvwe+OYscCrv3EkrjqZEk5qakgv4PiQKNeA=; b=mlPrrJ41b466Uwib6Z+KUNde0nauQ7RjKrsbxmN0Bb8ohnfFclxRK1HirnHimHwMZC GiWBfYgU8cNChk+UiIDXRMNZttDLaFQhoTJ9OAOTmq2cd4cz4i9hbeKRREPZbMun0exC ncrsUOrK61dZpUpakNMX/xxHHMvgjhRF0kHhT6t8LP8OdCye+NZqrUk8afmc2Os+h0sn kTMImXLF1VqdRRlDVsnafW6CcnCpRCljpzcqSkNR78lFOu/0U728iBMm94Z4tMO2hU2v nRamszXuTkH1tCxrRiA/Zmjhx5/Axn+5GUzUG7MKJUgl0z/WYx/n7jZVjsurCHbHh/Al 037w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=rs1sPOFZLvwe+OYscCrv3EkrjqZEk5qakgv4PiQKNeA=; b=GRSdeaVu78LMFTtMVcXQQvC5eWrAy+NIRHOPukdektpB40NKWez8JAXm1b6H9e8na4 8qAFkl9trAv9nE1yNJNP2Rfw+AcPGz0DE8d1VSsyZ0115/M28i0A9WIg/GG6jGHXTZCf sXCUr4pESeNm5Jss+URRdCKQz+7VoelXn2vo3kNBXomX9+4WhT26GxdeSd0as+yl5glt MLV+iHhhd4rL9MyWf6SuA7n+BxyptJmR3ZSoWeHWO7VBU9kYq4mb5OM+Hx2Z+VddJ6BS P2A+teKMqowDFsuOtwqM0lZ9ayHLxvXv6zjzWKIaMEGRKNoRXxgRTb/QApIBipOcMZ/0 eLdg== X-Gm-Message-State: AOAM5315fnxGhIo2dTb/nwKAQ7RfyB+TorYyoMVqiIPeeo7uMl8/0aP1 VVmkn29/TI2UOMX2za/M7MHsML0x X-Google-Smtp-Source: ABdhPJzBDGfRE9v30bOml9LjRmG7nf3RUPOxA+BpeldE46gmLULLrk/a0ZVU4fFGhotqPZvd+/Eubw== X-Received: by 2002:a7b:c3da:: with SMTP id t26mr2967429wmj.146.1589536466889; Fri, 15 May 2020 02:54:26 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:26 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 22/38] drm/mediatek: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:02 +0100 Message-Id: <20200515095118.2743122-23-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Chun-Kuang Hu , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: David Airlie Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Acked-by: Chun-Kuang Hu --- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index b04a3c2b111e..fcb81f354224 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -117,7 +117,7 @@ int mtk_drm_gem_dumb_create(struct drm_file *file_priv, struct drm_device *dev, goto err_handle_create; /* drop reference from allocate - handle holds it now. */ - drm_gem_object_put_unlocked(&mtk_gem->base); + drm_gem_object_put(&mtk_gem->base); return 0; From patchwork Fri May 15 09:51:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550919 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 189EB739 for ; Fri, 15 May 2020 09:54:50 +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 EBACE20709 for ; Fri, 15 May 2020 09:54:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WhtOt1Za" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBACE20709 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 8DEA16EC4C; Fri, 15 May 2020 09:54:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id CEF6D6EC47 for ; Fri, 15 May 2020 09:54:29 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id z4so507596wmi.2 for ; Fri, 15 May 2020 02:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uYxU0sVB7JLDlLEDa5kZGpU1Yn8cbvlsGZ3jNXb2NIY=; b=WhtOt1Za8i21jfoG76/5yUZaKMTridARfpIeuDD5utC+FT2+ehF0pGa98/rKyvAUUV u3I4VD62dS/VHMmuLAFcM2jNXTLUDypm2M67M3kAqzLngbwrLfiBTykOCdVuwxZu52N7 Jd2KUuGcgB3aOlylsg8ffalR99mtUPTfXV4OQEnczrrgyX4YUjR9npsbFjpBt3JXilLu brk99SpYj0hvaLWHqK+PNQ70XOQzkiFgqazJHn9ksFZ+Za8lEP12DdAhSFj4sCUoF21h grDpU7my+/X/Iph0IGNsG1PpwgcnTmQrfPxJbYYpX/gZuXI1ME4TqdcfNrPG6SAyquT7 /4Wg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=uYxU0sVB7JLDlLEDa5kZGpU1Yn8cbvlsGZ3jNXb2NIY=; b=OgEfGhq/O+TbmJxUVV1TBZIAcuOBPbWELLPzPUUPY84S3Bz5RhNTw/dPgdAsqNE/3i VC3c/2NxLab1qcmogsBi3XiivI7icGhWkXiFah9Is5/GRAnlW/W2AwgMnf0EALkCMBcQ 1kHtz9bjndJ1j9FtxNVSZy6r1JamaH9kyfn8MvtM/JstOeJKbrhkjzQ/j6HuUIubim43 t2cU0nPHjdhQaKTrhi3fb+ukU8Qn69C4Iivq/7MaxshM5jLKxEsH55ir9m8YqYDafH2f gHt4rgS+NsHDEMkzSUV2XqCNDmfWs/PYddf1F2ERBEmq0Q6Xe5QdZ+ED1WY1syjJlZ2F 6GAg== X-Gm-Message-State: AOAM530Bi/PI3Alb8IlyAYZgIp1H5IIqPPXhms926qBMLa0b5qgqrHmg jVyJBg/5ENtMw915fy0W7X1FKFXw X-Google-Smtp-Source: ABdhPJzV+8/UBUnwPG7X7COkpNZ3a7KNQ5pBWd+n1GbNAoP8Um/XvLwl3+9ix/yGr4Vy1yEDL6ObpA== X-Received: by 2002:a05:600c:2043:: with SMTP id p3mr3020728wmg.187.1589536468132; Fri, 15 May 2020 02:54:28 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:27 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 23/38] drm/mgag200: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:03 +0100 Message-Id: <20200515095118.2743122-24-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Dave Airlie , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Dave Airlie Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Reviewed-by: Thomas Zimmermann --- drivers/gpu/drm/mgag200/mgag200_cursor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c index aebc9ce43d55..c6932dc8acf2 100644 --- a/drivers/gpu/drm/mgag200/mgag200_cursor.c +++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c @@ -286,7 +286,7 @@ int mgag200_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, ret = PTR_ERR(src); dev_err(&dev->pdev->dev, "failed to map user buffer updates\n"); - goto err_drm_gem_object_put_unlocked; + goto err_drm_gem_object_put; } ret = mgag200_show_cursor(mdev, src, width, height); @@ -295,13 +295,13 @@ int mgag200_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, /* Now update internal buffer pointers */ drm_gem_vram_vunmap(gbo, src); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return 0; err_drm_gem_vram_vunmap: drm_gem_vram_vunmap(gbo, src); -err_drm_gem_object_put_unlocked: - drm_gem_object_put_unlocked(obj); +err_drm_gem_object_put: + drm_gem_object_put(obj); return ret; } From patchwork Fri May 15 09:51:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550923 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 EB849739 for ; Fri, 15 May 2020 09:54:53 +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 CA1AB20709 for ; Fri, 15 May 2020 09:54:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SCM2XBk7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA1AB20709 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 F34046EC48; Fri, 15 May 2020 09:54:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3D43A6EC50 for ; Fri, 15 May 2020 09:54:31 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id l17so2808471wrr.4 for ; Fri, 15 May 2020 02:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h0Cdv2h0VvRtyqLcdCOK7RJ32Y/OXxo7kkqjkNh0f08=; b=SCM2XBk7I05dMYUPM9ggNi/EGx9D5Ldw49vje54Ym1zF5oHHbQ7wKrBluBMCnBRW+N Edy7BPu856cU3sp4p10x352CKuZ9XurW00YV8kNiLI0dz1atcromJMfig+pBCwIhFNIC R3aSEbOBSSc5gZiNunEAHJORfpiK6XIdCD1tO43ZhdzBczgklJKV0SM432oQ4ZIG7YoG O8/EYutTCRVyshoPuZOorefiDoAss1cABSZhSdn+PKWGwx2yihuhZOPWcGNNLa7KRnSh WSMJ+vhHlnYGn00g2T/VDm2Wj2GSXrM2kV6YAy9b5KQhoKYkX6Isbedhi9QQ1carbHdU oIIA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=h0Cdv2h0VvRtyqLcdCOK7RJ32Y/OXxo7kkqjkNh0f08=; b=Labg9ZY3RE3GCMK1/IsRHk4drqnI7xQjV3pDxL9Az9x0cjuWsvuvJTvNOwks4oMJ/u Fk7I75BJl6frkzMGgE6yocJy32WZTBNca1L+NS12bJybMo51VCJB7DLO+cG1s0tSuf7h Cg2a63ug9+Frips+FrNHBOeNyBdiuZ7DhPmerHMzE0FxCxDyLbxrUNLghAWkq5uO2vg6 +8SaEN3zwqxHI++s/9BE6TZbPDzHvzLfx/Ro50KOn8ZarI4Q0Cz/zC0X24NOK0xTVexA J/okc4OLTHMkCX14C0qG+aG/01b6CFSjAff01dn+rw6g4IZOhDypLnyzdWhdpOpTEp5I SGFA== X-Gm-Message-State: AOAM531MML9z/xoqlEtJgQU8NzITnbJ/NK7qQW/jUw7MYp3KXqXpYUnq qHc4CpOFcLtbkLJXJ/izPAP0LaQ7 X-Google-Smtp-Source: ABdhPJzOPBEokC+BWWjRk5IJ7r5BE+wSk4IGCVszg75pzffrRM6gdJiTNiRLyb0sqY2tWanqhX/LYQ== X-Received: by 2002:a5d:526f:: with SMTP id l15mr3282909wrc.367.1589536469631; Fri, 15 May 2020 02:54:29 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:28 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 24/38] drm/msm: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:04 +0100 Message-Id: <20200515095118.2743122-25-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Sean Paul , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Rob Clark Cc: Sean Paul Cc: David Airlie Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 6 +++--- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 2 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 4 ++-- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 2 +- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- drivers/gpu/drm/msm/msm_drv.c | 6 +++--- drivers/gpu/drm/msm/msm_fb.c | 4 ++-- drivers/gpu/drm/msm/msm_gem.c | 12 ++++++------ 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index 724024a2243a..ad41ff023a1a 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -804,17 +804,17 @@ static void a5xx_destroy(struct msm_gpu *gpu) if (a5xx_gpu->pm4_bo) { msm_gem_unpin_iova(a5xx_gpu->pm4_bo, gpu->aspace); - drm_gem_object_put_unlocked(a5xx_gpu->pm4_bo); + drm_gem_object_put(a5xx_gpu->pm4_bo); } if (a5xx_gpu->pfp_bo) { msm_gem_unpin_iova(a5xx_gpu->pfp_bo, gpu->aspace); - drm_gem_object_put_unlocked(a5xx_gpu->pfp_bo); + drm_gem_object_put(a5xx_gpu->pfp_bo); } if (a5xx_gpu->gpmu_bo) { msm_gem_unpin_iova(a5xx_gpu->gpmu_bo, gpu->aspace); - drm_gem_object_put_unlocked(a5xx_gpu->gpmu_bo); + drm_gem_object_put(a5xx_gpu->gpmu_bo); } adreno_gpu_cleanup(adreno_gpu); diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 68af24150de5..34b85aaec747 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -795,7 +795,7 @@ static void a6xx_destroy(struct msm_gpu *gpu) if (a6xx_gpu->sqe_bo) { msm_gem_unpin_iova(a6xx_gpu->sqe_bo, gpu->aspace); - drm_gem_object_put_unlocked(a6xx_gpu->sqe_bo); + drm_gem_object_put(a6xx_gpu->sqe_bo); } a6xx_gmu_remove(a6xx_gpu); diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c index c9239b07fe4f..a0253297bc76 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c @@ -119,7 +119,7 @@ static void unref_cursor_worker(struct drm_flip_work *work, void *val) struct msm_kms *kms = &mdp4_kms->base.base; msm_gem_unpin_iova(val, kms->aspace); - drm_gem_object_put_unlocked(val); + drm_gem_object_put(val); } static void mdp4_crtc_destroy(struct drm_crtc *crtc) @@ -452,7 +452,7 @@ static int mdp4_crtc_cursor_set(struct drm_crtc *crtc, return 0; fail: - drm_gem_object_put_unlocked(cursor_bo); + drm_gem_object_put(cursor_bo); return ret; } diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c index dda05436f716..243584d4b1d7 100644 --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c @@ -165,7 +165,7 @@ static void mdp4_destroy(struct msm_kms *kms) if (mdp4_kms->blank_cursor_iova) msm_gem_unpin_iova(mdp4_kms->blank_cursor_bo, kms->aspace); - drm_gem_object_put_unlocked(mdp4_kms->blank_cursor_bo); + drm_gem_object_put(mdp4_kms->blank_cursor_bo); if (aspace) { aspace->mmu->funcs->detach(aspace->mmu); diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index 998bef1190a3..ca3368c828d0 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -166,7 +166,7 @@ static void unref_cursor_worker(struct drm_flip_work *work, void *val) struct msm_kms *kms = &mdp5_kms->base.base; msm_gem_unpin_iova(val, kms->aspace); - drm_gem_object_put_unlocked(val); + drm_gem_object_put(val); } static void mdp5_crtc_destroy(struct drm_crtc *crtc) diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index 11ae5b8444c3..66ca0c009cfa 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1132,7 +1132,7 @@ static void dsi_tx_buf_free(struct msm_dsi_host *msm_host) priv = dev->dev_private; if (msm_host->tx_gem_obj) { msm_gem_unpin_iova(msm_host->tx_gem_obj, priv->kms->aspace); - drm_gem_object_put_unlocked(msm_host->tx_gem_obj); + drm_gem_object_put(msm_host->tx_gem_obj); msm_host->tx_gem_obj = NULL; } diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 6baed5b43ea3..bc28df4eedeb 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -757,7 +757,7 @@ static int msm_ioctl_gem_cpu_prep(struct drm_device *dev, void *data, ret = msm_gem_cpu_prep(obj, args->op, &timeout); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -775,7 +775,7 @@ static int msm_ioctl_gem_cpu_fini(struct drm_device *dev, void *data, ret = msm_gem_cpu_fini(obj); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -867,7 +867,7 @@ static int msm_ioctl_gem_info(struct drm_device *dev, void *data, break; } - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } diff --git a/drivers/gpu/drm/msm/msm_fb.c b/drivers/gpu/drm/msm/msm_fb.c index 37674e886e99..d42f0665359a 100644 --- a/drivers/gpu/drm/msm/msm_fb.c +++ b/drivers/gpu/drm/msm/msm_fb.c @@ -123,7 +123,7 @@ struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev, out_unref: for (i = 0; i < n; i++) - drm_gem_object_put_unlocked(bos[i]); + drm_gem_object_put(bos[i]); return ERR_PTR(ret); } @@ -238,7 +238,7 @@ msm_alloc_stolen_fb(struct drm_device *dev, int w, int h, int p, uint32_t format /* note: if fb creation failed, we can't rely on fb destroy * to unref the bo: */ - drm_gem_object_put_unlocked(bo); + drm_gem_object_put(bo); return ERR_CAST(fb); } diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index 8696c405f709..46e78993b69c 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -543,7 +543,7 @@ int msm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, *offset = msm_gem_mmap_offset(obj); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); fail: return ret; @@ -970,7 +970,7 @@ int msm_gem_new_handle(struct drm_device *dev, struct drm_file *file, ret = drm_gem_handle_create(file, obj, handle); /* drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -1089,7 +1089,7 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev, return obj; fail: - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ERR_PTR(ret); } @@ -1149,7 +1149,7 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev, return obj; fail: - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ERR_PTR(ret); } @@ -1185,7 +1185,7 @@ static void *_msm_gem_kernel_new(struct drm_device *dev, uint32_t size, if (locked) drm_gem_object_put_locked(obj); else - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ERR_PTR(ret); @@ -1217,7 +1217,7 @@ void msm_gem_kernel_put(struct drm_gem_object *bo, if (locked) drm_gem_object_put_locked(bo); else - drm_gem_object_put_unlocked(bo); + drm_gem_object_put(bo); } void msm_gem_object_set_name(struct drm_gem_object *bo, const char *fmt, ...) From patchwork Fri May 15 09:51:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550939 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 5C22714C0 for ; Fri, 15 May 2020 09:55:06 +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 3A520207C3 for ; Fri, 15 May 2020 09:55:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="If45eOZF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A520207C3 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 9A4876EC54; Fri, 15 May 2020 09:54:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 438626EC42 for ; Fri, 15 May 2020 09:54:32 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id z72so1961927wmc.2 for ; Fri, 15 May 2020 02:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IbeD/pOtVnygiMHzpgtvsl1p60gZ2SFlG7qeBUkjkBk=; b=If45eOZFTGlfiBMHSoPGXx4Jj2dsXMlSuK7Y65m2cZZAaay5F9bVMm6ky+VlCbK+mD vvev5oQvdj/plzfjNtPppCjlcAqlRcXKScoiGpkda6HYJx9l6yB3vS/KvcQe+qJv7AhM POjEAvLg2SkbeetNCl8qh1mK/6BEdnCGXBlfPfl3myVEZ3O35LOp4Noi4ZVDbe/VEIYt v8W0qVfbuWhE1sAYg4sd8KRRKNP70M+8CVfq4F8+3LWPebWyvsq3WCMf6IpO3vxpce38 s6nsafJ43NKnBRmQNNCuEwwAlPYFuoXzaSRWL3xX15vEGytdaGI57T6UQa31/JLb1Oqr 4ddA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=IbeD/pOtVnygiMHzpgtvsl1p60gZ2SFlG7qeBUkjkBk=; b=N1l848ZIkItUY6sQBUscdDFldDPoClO4IFYpJrSonKN6dwjMYvr2ku+gwv3dNMNdaP xWsCry4HzrPnFzAEEyTCg2nrzawcwxoTJQM6xKxOkMW8HroIthA5a3dahnCN+bpoup58 YdGJEqq/s1vfKxsacbdAvFzAHf1Frel2plNhoVAn1BaJ5HNNe4cyjs8E+tUo+LTe3led /loVdGDfh7EDENuF/7lr8CrXRAKfF31WISTpX5P0xawmX46CXDggOeBE6+Pef+zN+0jS T9WWWLRMZYh7RFo4fSHLfzIWOHQhQrIq7qR3aYuv5BKwRHu96C97NZHNaBuJzMyEnolX Szdg== X-Gm-Message-State: AOAM533ldf/SjkpNbLsk2PNQX9WqV68rPep5yqY8Uv0vReTH23K3xw+r AGCYrsFaweTseNH1EcR61qkPdRcv X-Google-Smtp-Source: ABdhPJxN9K7Wv6ng2FQWCWwf0tW2ZFivad5CPUHsMm0+xUlVnsWDV1MlWyvu0APtaLK1uk0/mgkE2A== X-Received: by 2002:a1c:9e52:: with SMTP id h79mr3178934wme.84.1589536470714; Fri, 15 May 2020 02:54:30 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:30 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 25/38] drm/nouveau: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:05 +0100 Message-Id: <20200515095118.2743122-26-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com, Ben Skeggs Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 2 +- drivers/gpu/drm/nouveau/nouveau_abi16.c | 2 +- drivers/gpu/drm/nouveau/nouveau_display.c | 8 ++++---- drivers/gpu/drm/nouveau/nouveau_gem.c | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c index 1f08de4241e0..27f511b9987b 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c @@ -1017,7 +1017,7 @@ nv04_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, nv_crtc->cursor.set_offset(nv_crtc, nv_crtc->cursor.offset); nv_crtc->cursor.show(nv_crtc, true); out: - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return ret; } diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c index e2bae1424502..72c91991b96a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c @@ -139,7 +139,7 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16, if (chan->ntfy) { nouveau_vma_del(&chan->ntfy_vma); nouveau_bo_unpin(chan->ntfy); - drm_gem_object_put_unlocked(&chan->ntfy->bo.base); + drm_gem_object_put(&chan->ntfy->bo.base); } if (chan->heap.block_size) diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 700817dc4fa0..60bef0ad028d 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -185,7 +185,7 @@ nouveau_user_framebuffer_destroy(struct drm_framebuffer *drm_fb) struct nouveau_framebuffer *fb = nouveau_framebuffer(drm_fb); if (fb->nvbo) - drm_gem_object_put_unlocked(&fb->nvbo->bo.base); + drm_gem_object_put(&fb->nvbo->bo.base); drm_framebuffer_cleanup(drm_fb); kfree(fb); @@ -267,7 +267,7 @@ nouveau_user_framebuffer_create(struct drm_device *dev, if (ret == 0) return &fb->base; - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return ERR_PTR(ret); } @@ -648,7 +648,7 @@ nouveau_display_dumb_create(struct drm_file *file_priv, struct drm_device *dev, return ret; ret = drm_gem_handle_create(file_priv, &bo->bo.base, &args->handle); - drm_gem_object_put_unlocked(&bo->bo.base); + drm_gem_object_put(&bo->bo.base); return ret; } @@ -663,7 +663,7 @@ nouveau_display_dumb_map_offset(struct drm_file *file_priv, if (gem) { struct nouveau_bo *bo = nouveau_gem_object(gem); *poffset = drm_vma_node_offset_addr(&bo->bo.base.vma_node); - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return 0; } diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index f5ece1f94973..5631c484d10f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -279,7 +279,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, } /* drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(&nvbo->bo.base); + drm_gem_object_put(&nvbo->bo.base); return ret; } @@ -358,7 +358,7 @@ validate_fini_no_ticket(struct validate_op *op, struct nouveau_channel *chan, list_del(&nvbo->entry); nvbo->reserved_by = NULL; ttm_bo_unreserve(&nvbo->bo); - drm_gem_object_put_unlocked(&nvbo->bo.base); + drm_gem_object_put(&nvbo->bo.base); } } @@ -405,14 +405,14 @@ validate_init(struct nouveau_channel *chan, struct drm_file *file_priv, nvbo = nouveau_gem_object(gem); if (nvbo == res_bo) { res_bo = NULL; - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); continue; } if (nvbo->reserved_by && nvbo->reserved_by == file_priv) { NV_PRINTK(err, cli, "multiple instances of buffer %d on " "validation list\n", b->handle); - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); ret = -EINVAL; break; } @@ -929,7 +929,7 @@ nouveau_gem_ioctl_cpu_prep(struct drm_device *dev, void *data, ret = lret; nouveau_bo_sync_for_cpu(nvbo); - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return ret; } @@ -948,7 +948,7 @@ nouveau_gem_ioctl_cpu_fini(struct drm_device *dev, void *data, nvbo = nouveau_gem_object(gem); nouveau_bo_sync_for_device(nvbo); - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return 0; } @@ -965,7 +965,7 @@ nouveau_gem_ioctl_info(struct drm_device *dev, void *data, return -ENOENT; ret = nouveau_gem_info(file_priv, gem, req); - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return ret; } From patchwork Fri May 15 09:51:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550949 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 B0EE090 for ; Fri, 15 May 2020 09:55:14 +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 8FEDB20709 for ; Fri, 15 May 2020 09:55:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="enGEsmtT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FEDB20709 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 0E3C26EC5D; Fri, 15 May 2020 09:55:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC5B76EC42 for ; Fri, 15 May 2020 09:54:33 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id n5so1978385wmd.0 for ; Fri, 15 May 2020 02:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zo3GRMIgUgW0k33peBbf1+hk6O9D0vN3oHTJ7W8hmp8=; b=enGEsmtTrGzEWKERWmQ7KSv+1Yc+S+wfGYfKDdLmwAMP6QZmzQcQXW4PCsILrsRBc4 zC3fmxMq2kGtkDgJsnmmkama2rEIPxZwum/uDjbGnBmCTk5ANnTxzUrV7eX0kAHc9eQ2 vdG8yfY9+wWLfAev2UOOFB28KQnjXFb0a2i+lBdTLmuWgExpLb5rfAXY5lq/j2tr/Kys IN0zv81fSJ5tx2JT2nkMN7qF5ufCMpMaIyyRQKxRGvEX2sGYpzdCHmohsVVhhjaGiGE3 YLoyL+EzKaTqC6uobMt1N2MB+6hI2e6WkiBjTz6VhjGAWJjH3uv6kBjkfiGENSkr3/e4 9dIw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zo3GRMIgUgW0k33peBbf1+hk6O9D0vN3oHTJ7W8hmp8=; b=mcSicFkEjtidqFLYqokHE6IfVkaubeLHDlyKfJztT6pCCEMjg4mF7XyYBJ6i1PjIMw TQupYHK2faWplEO09Sa28zao6eqSw1aj2egq4GCHjoNcpxL4E1a+HhNuTXZ/vcyP+u4K ARNxYGP02s7g4EktUOMgXNB6wG42oXvF4qCldzKFpje0a6gBgUZQTIbdfAnKE2pms/rX EJKnCqeQA+SrPzWEFzO2juP+s36KGQ/mnYDS9iql5KnGrA5beFFwhxmTB0eq1KmuLIGr tk8BBOlE3x3Ox3sK5mU62pFehnHREJiU9Mc1bRKNYQopcoVZsscIT4+wJ4/Oo6JWh8KC bDtQ== X-Gm-Message-State: AOAM533WUfxe7eSAOsRkc3C0VuhSpevyfmc8e7wpeN5KFi3PCrQpu1pr 8hZf3FFsTVz2fqVtt/snEc7u2C65 X-Google-Smtp-Source: ABdhPJxkGyLYqUJb87cdbnuRbH2TZ6WDMH39nabrwM6O0m5T3XTFVYU7Qga1AntUJhCMcXKFzSdf9g== X-Received: by 2002:a7b:c62a:: with SMTP id p10mr2912768wmk.143.1589536471903; Fri, 15 May 2020 02:54:31 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:31 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 26/38] drm/omapdrm: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:06 +0100 Message-Id: <20200515095118.2743122-27-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Tomi Valkeinen , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Tomi Valkeinen Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/omapdrm/omap_drv.c | 2 +- drivers/gpu/drm/omapdrm/omap_fb.c | 2 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index cdafd7ef1c32..242d28281784 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -503,7 +503,7 @@ static int ioctl_gem_info(struct drm_device *dev, void *data, args->size = omap_gem_mmap_size(obj); args->offset = omap_gem_mmap_offset(obj); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index 9aeab81dfb90..05f30e2618c9 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -326,7 +326,7 @@ struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev, error: while (--i >= 0) - drm_gem_object_put_unlocked(bos[i]); + drm_gem_object_put(bos[i]); return fb; } diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index 09a84919ef73..3f6cfc24fb64 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c @@ -140,7 +140,7 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, /* note: if fb creation failed, we can't rely on fb destroy * to unref the bo: */ - drm_gem_object_put_unlocked(fbdev->bo); + drm_gem_object_put(fbdev->bo); ret = PTR_ERR(fb); goto fail; } diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index d08ae95ecc0a..d0d12d5dd76c 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c @@ -629,7 +629,7 @@ int omap_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, *offset = omap_gem_mmap_offset(obj); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); fail: return ret; @@ -1348,7 +1348,7 @@ int omap_gem_new_handle(struct drm_device *dev, struct drm_file *file, } /* drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return 0; } From patchwork Fri May 15 09:51:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550927 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 5FFBD90 for ; Fri, 15 May 2020 09:54:56 +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 3E3F120709 for ; Fri, 15 May 2020 09:54:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RTFVJyxx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E3F120709 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 5710D6EC50; Fri, 15 May 2020 09:54:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id A2B1E6EC48 for ; Fri, 15 May 2020 09:54:34 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id h17so2775417wrc.8 for ; Fri, 15 May 2020 02:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NuyLRSf69UU50l4L98gC8To1wJQExKPi2eBLW+xIT7s=; b=RTFVJyxxJxnBsntgxFy/oa5MBo28yn0LCcKEzEODESN6A9Lw9PWXdQ6iIlMQ5YV+NE j2Bg+ptHdhvpFFfHnMe7t/SZFUGmd4Zb4le75Q8FpwXiNArFrSa23yIEqZ90tUxTP9Ym VZ/cTbW8eA9Slr2GzuUGcpQTi/N/GLIn1/Rw2g5IBZDCFa2awoUlYYfh3CFRD1YdC+Pk rOpkdplGqguJKMfUpMczNZk4GBmMaOPTKwAIbnIyCFUzcMwII2XDbnIYyiJPoBTPihxy BTVtRqXN6K+xeCGMB5ciISnAsTJqFt/JEjsPNpAzHShahDZ9Ai6nnzCCCgjAwHUvtwJ6 V5tg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=NuyLRSf69UU50l4L98gC8To1wJQExKPi2eBLW+xIT7s=; b=M4iYp8CxjnOrEiZH2jfexIv7BF3pQ6fIvVssxoQePXaOtad0qd8CoBm82dyWrdEmgE ltDSKyy2tacKrXyLLUx/iShRSYLcRMcosW9/81P16vzH0ap12BI5u+/xML4prCmjQO15 r2BkpXt4wo6tiqyhUnUtAdMofuCE3vF3vzk+LZnwm44i90P67r7/RDMmZQ3HWYI/XLuL uEtic5cIREOAOLJYeFAgDjsfUIRI14Pe+U2n323hKpS11KPczjEbmV0yxK9+8uk7jqX3 8EWpuo3LZuIpO/EMCzvLVtV5WZw+aKicHQM+pfL1n8HJ1fHLGih90YgVnCRkzs67Bwfj zz+A== X-Gm-Message-State: AOAM5322fSlBcADhUR90X9RX9GSTRcsWTAm/nCOP+wcxe9mVZfH8wqUF sjNPIx5x0mk7zg4271H8c2RSrSkt X-Google-Smtp-Source: ABdhPJyS0dmJKKbNtpVmKANzosmTZy5GMs+XmXVeUDB5m3fmVupuGCjTskEOOM3NMKiu9IwRQAulSQ== X-Received: by 2002:a5d:534e:: with SMTP id t14mr3293354wrv.15.1589536473102; Fri, 15 May 2020 02:54:33 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:32 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 27/38] drm/panfrost: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:07 +0100 Message-Id: <20200515095118.2743122-28-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com, Tomeu Vizoso , Steven Price Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Rob Herring Cc: Tomeu Vizoso Cc: Steven Price Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 10 +++++----- drivers/gpu/drm/panfrost/panfrost_gem.c | 4 ++-- drivers/gpu/drm/panfrost/panfrost_job.c | 2 +- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- drivers/gpu/drm/panfrost/panfrost_perfcnt.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 882fecc33fdb..ada51df9a7a3 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -99,7 +99,7 @@ static int panfrost_ioctl_create_bo(struct drm_device *dev, void *data, mapping = panfrost_gem_mapping_get(bo, priv); if (!mapping) { - drm_gem_object_put_unlocked(&bo->base.base); + drm_gem_object_put(&bo->base.base); return -EINVAL; } @@ -317,7 +317,7 @@ panfrost_ioctl_wait_bo(struct drm_device *dev, void *data, if (!ret) ret = timeout ? -ETIMEDOUT : -EBUSY; - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); return ret; } @@ -351,7 +351,7 @@ static int panfrost_ioctl_mmap_bo(struct drm_device *dev, void *data, args->offset = drm_vma_node_offset_addr(&gem_obj->vma_node); out: - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); return ret; } @@ -372,7 +372,7 @@ static int panfrost_ioctl_get_bo_offset(struct drm_device *dev, void *data, bo = to_panfrost_bo(gem_obj); mapping = panfrost_gem_mapping_get(bo, priv); - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); if (!mapping) return -EINVAL; @@ -438,7 +438,7 @@ static int panfrost_ioctl_madvise(struct drm_device *dev, void *data, mutex_unlock(&bo->mappings.lock); mutex_unlock(&pfdev->shrinker_lock); - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); return ret; } diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index 17b654e1eb94..ac5d0aa80276 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c @@ -93,7 +93,7 @@ static void panfrost_gem_mapping_release(struct kref *kref) mapping = container_of(kref, struct panfrost_gem_mapping, refcount); panfrost_gem_teardown_mapping(mapping); - drm_gem_object_put_unlocked(&mapping->obj->base.base); + drm_gem_object_put(&mapping->obj->base.base); kfree(mapping); } @@ -261,7 +261,7 @@ panfrost_gem_create_with_handle(struct drm_file *file_priv, */ ret = drm_gem_handle_create(file_priv, &shmem->base, handle); /* drop reference from allocate - handle holds it now. */ - drm_gem_object_put_unlocked(&shmem->base); + drm_gem_object_put(&shmem->base); if (ret) return ERR_PTR(ret); diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index 7914b1570841..b2f09c038d35 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c @@ -281,7 +281,7 @@ static void panfrost_job_cleanup(struct kref *ref) if (job->bos) { for (i = 0; i < job->bo_count; i++) - drm_gem_object_put_unlocked(job->bos[i]); + drm_gem_object_put(job->bos[i]); kvfree(job->bos); } diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index ed28aeba6d59..0a339c6fbfaa 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -538,7 +538,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as, err_pages: drm_gem_shmem_put_pages(&bo->base); err_bo: - drm_gem_object_put_unlocked(&bo->base.base); + drm_gem_object_put(&bo->base.base); return ret; } diff --git a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c index 6913578d5aa7..ec4695cf3caf 100644 --- a/drivers/gpu/drm/panfrost/panfrost_perfcnt.c +++ b/drivers/gpu/drm/panfrost/panfrost_perfcnt.c @@ -156,7 +156,7 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev, gpu_write(pfdev, GPU_PRFCNT_TILER_EN, 0xffffffff); /* The BO ref is retained by the mapping. */ - drm_gem_object_put_unlocked(&bo->base); + drm_gem_object_put(&bo->base); return 0; @@ -167,7 +167,7 @@ static int panfrost_perfcnt_enable_locked(struct panfrost_device *pfdev, err_close_bo: panfrost_gem_close(&bo->base, file_priv); err_put_bo: - drm_gem_object_put_unlocked(&bo->base); + drm_gem_object_put(&bo->base); return ret; } From patchwork Fri May 15 09:51:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550921 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 5AEE290 for ; Fri, 15 May 2020 09:54:52 +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 39EA920709 for ; Fri, 15 May 2020 09:54:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ejhlZ4Tz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39EA920709 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 312FB6EC4B; Fri, 15 May 2020 09:54:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id AFF9C6EC42 for ; Fri, 15 May 2020 09:54:35 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id n5so1978537wmd.0 for ; Fri, 15 May 2020 02:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=838UsG6rWT4O2J3Z5jDg+ZkYllHdrsvdz2WgI2eN1dw=; b=ejhlZ4Tzwj/eQwh2ThnsR3P7iV6DW91Q4U9DFm0f443wzkp30sitmp5GInc8W+H2PE q9mMQ2zzSkVntVSQL//16wyWSpACd/GYvJsj6wxnQvdrTcy3B3bnS/DM629Ij3ejbzoD OD1npvRGOgrBsW7ZvuSVePuvJyjXivCyQLb5AR5fxWv1jQ+2KSPqQBzGaKy9fDd8PYOA 7UO8OWQ+E0V9rxJ6bL6243EbgOPQFASFKUeXvy5PQYZ22GKGX6R8bbqr2qcvKO3rPnrP 7tnDEIU5P3j4h69EyiTZgzrx3d7zmD6HqZDhP+MXOQzM+lVM98ieyIdGRoBp1SbqoT5i OSpw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=838UsG6rWT4O2J3Z5jDg+ZkYllHdrsvdz2WgI2eN1dw=; b=R8dMIdjhKxB1POeY82Qxq5Tkj76+abLzObbauf0uTk8i30CwhaULXsEUllEGIgyLPH in8l89o2ss33yfziNAicrwfddrasM3CNlVEVjvghgWd2Ao+AOUS+haqSazKuJ9GKIyOZ i3JWd5YiV2QNq0P32WqcVX3iQKeXkMMXKszbTGhDHTYZc85fY4Rte2rdi/grFpqQDjpR e6CStLej9bqoe3FG27dwIXFroLee1LWSCCqU6igBvrwdHxB1P+IcJtUBmKulqbB2d+y8 JtrTiSzab5eYnrpzAnIujrkQ65OSu61gIyq754XbvDpmA9zuxtznik+WuEV1j5wuzVJi iaeQ== X-Gm-Message-State: AOAM531MhQ6oBLpBnWOncA//ybTFCoL2J2w67BRV4sPLFdyljgRHFf9x 1Z+afXgOJ8zVbvDlD+e5wQSmwInV X-Google-Smtp-Source: ABdhPJwTvH2JbLpV2CFOJE8STDpZg148hb0NMZ+kVuIN6Yjrg8Pr1b5EtyYdEnHGVwBXMmIwwQ32Zg== X-Received: by 2002:a7b:cb88:: with SMTP id m8mr3039707wmi.37.1589536474112; Fri, 15 May 2020 02:54:34 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:33 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 28/38] drm/qxl: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:08 +0100 Message-Id: <20200515095118.2743122-29-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Dave Airlie , emil.l.velikov@gmail.com, Gerd Hoffmann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Dave Airlie Cc: Gerd Hoffmann Cc: David Airlie Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_cmd.c | 2 +- drivers/gpu/drm/qxl/qxl_display.c | 6 +++--- drivers/gpu/drm/qxl/qxl_dumb.c | 2 +- drivers/gpu/drm/qxl/qxl_gem.c | 2 +- drivers/gpu/drm/qxl/qxl_ioctl.c | 4 ++-- drivers/gpu/drm/qxl/qxl_object.c | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/drivers/gpu/drm/qxl/qxl_cmd.c index d1086b2a6892..3104af3d86b8 100644 --- a/drivers/gpu/drm/qxl/qxl_cmd.c +++ b/drivers/gpu/drm/qxl/qxl_cmd.c @@ -377,7 +377,7 @@ void qxl_io_destroy_primary(struct qxl_device *qdev) { wait_for_io_cmd(qdev, 0, QXL_IO_DESTROY_PRIMARY_ASYNC); qdev->primary_bo->is_primary = false; - drm_gem_object_put_unlocked(&qdev->primary_bo->tbo.base); + drm_gem_object_put(&qdev->primary_bo->tbo.base); qdev->primary_bo = NULL; } diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 1082cd5d2fd4..e403b37118d1 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -783,7 +783,7 @@ static int qxl_plane_prepare_fb(struct drm_plane *plane, qdev->dumb_shadow_bo->surf.width != surf.width || qdev->dumb_shadow_bo->surf.height != surf.height) { if (qdev->dumb_shadow_bo) { - drm_gem_object_put_unlocked + drm_gem_object_put (&qdev->dumb_shadow_bo->tbo.base); qdev->dumb_shadow_bo = NULL; } @@ -793,7 +793,7 @@ static int qxl_plane_prepare_fb(struct drm_plane *plane, } if (user_bo->shadow != qdev->dumb_shadow_bo) { if (user_bo->shadow) { - drm_gem_object_put_unlocked + drm_gem_object_put (&user_bo->shadow->tbo.base); user_bo->shadow = NULL; } @@ -828,7 +828,7 @@ static void qxl_plane_cleanup_fb(struct drm_plane *plane, qxl_bo_unpin(user_bo); if (old_state->fb != plane->state->fb && user_bo->shadow) { - drm_gem_object_put_unlocked(&user_bo->shadow->tbo.base); + drm_gem_object_put(&user_bo->shadow->tbo.base); user_bo->shadow = NULL; } } diff --git a/drivers/gpu/drm/qxl/qxl_dumb.c b/drivers/gpu/drm/qxl/qxl_dumb.c index 24e903383aa1..c04cd5a2553c 100644 --- a/drivers/gpu/drm/qxl/qxl_dumb.c +++ b/drivers/gpu/drm/qxl/qxl_dumb.c @@ -83,6 +83,6 @@ int qxl_mode_dumb_mmap(struct drm_file *file_priv, return -ENOENT; qobj = gem_to_qxl_bo(gobj); *offset_p = qxl_bo_mmap_offset(qobj); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return 0; } diff --git a/drivers/gpu/drm/qxl/qxl_gem.c b/drivers/gpu/drm/qxl/qxl_gem.c index 5ff6fa9b799c..48e096285b4c 100644 --- a/drivers/gpu/drm/qxl/qxl_gem.c +++ b/drivers/gpu/drm/qxl/qxl_gem.c @@ -97,7 +97,7 @@ int qxl_gem_object_create_with_handle(struct qxl_device *qdev, return r; /* drop reference from allocate - handle holds it now */ *qobj = gem_to_qxl_bo(gobj); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return 0; } diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c index d9a583966949..5dc78990990a 100644 --- a/drivers/gpu/drm/qxl/qxl_ioctl.c +++ b/drivers/gpu/drm/qxl/qxl_ioctl.c @@ -125,7 +125,7 @@ static int qxlhw_handle_to_bo(struct drm_file *file_priv, uint64_t handle, qobj = gem_to_qxl_bo(gobj); ret = qxl_release_list_add(release, qobj); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); if (ret) return ret; @@ -347,7 +347,7 @@ static int qxl_update_area_ioctl(struct drm_device *dev, void *data, qxl_bo_unreserve(qobj); out: - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return ret; } diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index edc8a9916872..80e7a17aaddd 100644 --- a/drivers/gpu/drm/qxl/qxl_object.c +++ b/drivers/gpu/drm/qxl/qxl_object.c @@ -224,7 +224,7 @@ void qxl_bo_unref(struct qxl_bo **bo) if ((*bo) == NULL) return; - drm_gem_object_put_unlocked(&(*bo)->tbo.base); + drm_gem_object_put(&(*bo)->tbo.base); *bo = NULL; } @@ -326,7 +326,7 @@ void qxl_bo_force_delete(struct qxl_device *qdev) list_del_init(&bo->list); mutex_unlock(&qdev->gem.mutex); /* this should unref the ttm bo */ - drm_gem_object_put_unlocked(&bo->tbo.base); + drm_gem_object_put(&bo->tbo.base); } } From patchwork Fri May 15 09:51:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550947 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 4FCF7739 for ; Fri, 15 May 2020 09:55:13 +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 2E3C720709 for ; Fri, 15 May 2020 09:55:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="McdhUT55" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E3C720709 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 4C2E26EC59; Fri, 15 May 2020 09:55:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4C21B6EC42 for ; Fri, 15 May 2020 09:54:37 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id u188so1968053wmu.1 for ; Fri, 15 May 2020 02:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GD9osV8uspo5pUTGLNtvRlUq4aia92LgZG4KmTpIKeU=; b=McdhUT55E/kf2UDI3x06lIamTbDEeBVR9bv7sdv4xyQFcTc2Q4ik5qrtVsjh5/tUnV okUHzoULIczGT6MfTboqmqLLsEO1jTX4hPUwtOiXzQ8w0mz9MKNdQgDtUVcmdSwVOspw cm+mYXH+2QMAA1fU8Q6K9XSY5MYX9Ld05bYwxyL7A9OajAapbKL8T0YYpi2cs/8urUi5 Z73BZao6EJXaV4p+Pm/5HnS+fLqcTMPDeh+Ozz2ubiDzNBZr/ga+cojvMpQ46SMJF/US HlWAwwOdOkE4/Vf4K/CFjdlsdv/+F+0iebH6o0W3elbX3bggH0pQ3YCoDUjtQAP1N2Ux my/Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=GD9osV8uspo5pUTGLNtvRlUq4aia92LgZG4KmTpIKeU=; b=qNNtfwqVsgl1bIhEVPMzCFUNG+ft/UNuPMZQGiAtYqvOD5pIkTlqGIGHpLFfH8+6I1 OTnnCI0gOuCmCzDIKb7fYeVMN1z85/eRfaPoSfL5OyRKGVW20bvN9n0YiLaLbcqUTljf 9OCBeh4iUhvOELbU/eipibUXezhVa10KpFOM6oipoyrmQ0lOb35lypvOHIKsKWvjePCR bPeI/FO8Wnhl/M4Pq0ohdukbBz+ZZHPjEekO1MELUIIGORcegrpJ2hxI/rLfNOTUTwu6 v5i1Di2WN+/0Y4P0fHejTerxrhybA8SpjLtokCsMb8GyI978lx7EcN7dM5CaFMXnc8NH 1BuQ== X-Gm-Message-State: AOAM533S/NQs2nFF4P3IVB5XBRFKIjuXBvGC3KTAqWbTczNSXI93SkoZ 1opawD90V9ayLw2Vl7BR5SRszC53 X-Google-Smtp-Source: ABdhPJztmq//c4t0a5kH8A65QAeUOAVYEsGa6fQ3zaZFt/oDRA8GAcEZKm+Rrrlgo5ERW2IyGgqE5w== X-Received: by 2002:a1c:4c13:: with SMTP id z19mr3152148wmf.8.1589536475659; Fri, 15 May 2020 02:54:35 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:34 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 29/38] drm/radeon: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:09 +0100 Message-Id: <20200515095118.2743122-30-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , emil.l.velikov@gmail.com, =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Alex Deucher Cc: "Christian König" Cc: "David (ChunMing) Zhou" Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/radeon/radeon_cs.c | 2 +- drivers/gpu/drm/radeon/radeon_cursor.c | 6 ++--- drivers/gpu/drm/radeon/radeon_display.c | 8 +++---- drivers/gpu/drm/radeon/radeon_fb.c | 4 ++-- drivers/gpu/drm/radeon/radeon_gem.c | 30 ++++++++++++------------- drivers/gpu/drm/radeon/radeon_object.c | 2 +- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 0d0ab8e0ff3b..af0bf78314e2 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -443,7 +443,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error, bo if (bo == NULL) continue; - drm_gem_object_put_unlocked(&bo->tbo.base); + drm_gem_object_put(&bo->tbo.base); } } kfree(parser->track); diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c index 9180bb51b913..3507805b34bc 100644 --- a/drivers/gpu/drm/radeon/radeon_cursor.c +++ b/drivers/gpu/drm/radeon/radeon_cursor.c @@ -309,7 +309,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, robj = gem_to_radeon_bo(obj); ret = radeon_bo_reserve(robj, false); if (ret != 0) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } /* Only 27 bit offset for legacy cursor */ @@ -319,7 +319,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, radeon_bo_unreserve(robj); if (ret) { DRM_ERROR("Failed to pin new cursor BO (%d)\n", ret); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } @@ -354,7 +354,7 @@ int radeon_crtc_cursor_set2(struct drm_crtc *crtc, radeon_bo_unpin(robj); radeon_bo_unreserve(robj); } - drm_gem_object_put_unlocked(radeon_crtc->cursor_bo); + drm_gem_object_put(radeon_crtc->cursor_bo); } radeon_crtc->cursor_bo = obj; diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 35db79a168bf..6222bdb74825 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -281,7 +281,7 @@ static void radeon_unpin_work_func(struct work_struct *__work) } else DRM_ERROR("failed to reserve buffer after flip\n"); - drm_gem_object_put_unlocked(&work->old_rbo->tbo.base); + drm_gem_object_put(&work->old_rbo->tbo.base); kfree(work); } @@ -613,7 +613,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, radeon_bo_unreserve(new_rbo); cleanup: - drm_gem_object_put_unlocked(&work->old_rbo->tbo.base); + drm_gem_object_put(&work->old_rbo->tbo.base); dma_fence_put(work->fence); kfree(work); return r; @@ -1337,14 +1337,14 @@ radeon_user_framebuffer_create(struct drm_device *dev, fb = kzalloc(sizeof(*fb), GFP_KERNEL); if (fb == NULL) { - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ERR_PTR(-ENOMEM); } ret = radeon_framebuffer_init(dev, fb, mode_cmd, obj); if (ret) { kfree(fb); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ERR_PTR(ret); } diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index cf3156a65fc1..fc4212633bdf 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c @@ -119,7 +119,7 @@ static void radeonfb_destroy_pinned_object(struct drm_gem_object *gobj) radeon_bo_unpin(rbo); radeon_bo_unreserve(rbo); } - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); } static int radeonfb_create_pinned_object(struct radeon_fbdev *rfbdev, @@ -298,7 +298,7 @@ static int radeonfb_create(struct drm_fb_helper *helper, } if (fb && ret) { - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); drm_framebuffer_unregister_private(fb); drm_framebuffer_cleanup(fb); kfree(fb); diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 068c3e5da173..03640e3840be 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -275,7 +275,7 @@ int radeon_gem_create_ioctl(struct drm_device *dev, void *data, } r = drm_gem_handle_create(filp, gobj, &handle); /* drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); if (r) { up_read(&rdev->exclusive_lock); r = radeon_gem_handle_lockup(rdev, r); @@ -359,7 +359,7 @@ int radeon_gem_userptr_ioctl(struct drm_device *dev, void *data, r = drm_gem_handle_create(filp, gobj, &handle); /* drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); if (r) goto handle_lockup; @@ -368,7 +368,7 @@ int radeon_gem_userptr_ioctl(struct drm_device *dev, void *data, return 0; release_object: - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); handle_lockup: up_read(&rdev->exclusive_lock); @@ -402,7 +402,7 @@ int radeon_gem_set_domain_ioctl(struct drm_device *dev, void *data, r = radeon_gem_set_domain(gobj, args->read_domains, args->write_domain); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); up_read(&rdev->exclusive_lock); r = radeon_gem_handle_lockup(robj->rdev, r); return r; @@ -421,11 +421,11 @@ int radeon_mode_dumb_mmap(struct drm_file *filp, } robj = gem_to_radeon_bo(gobj); if (radeon_ttm_tt_has_userptr(robj->tbo.ttm)) { - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return -EPERM; } *offset_p = radeon_bo_mmap_offset(robj); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return 0; } @@ -460,7 +460,7 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data, cur_placement = READ_ONCE(robj->tbo.mem.mem_type); args->domain = radeon_mem_type_to_domain(cur_placement); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return r; } @@ -492,7 +492,7 @@ int radeon_gem_wait_idle_ioctl(struct drm_device *dev, void *data, if (rdev->asic->mmio_hdp_flush && radeon_mem_type_to_domain(cur_placement) == RADEON_GEM_DOMAIN_VRAM) robj->rdev->asic->mmio_hdp_flush(rdev); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); r = radeon_gem_handle_lockup(rdev, r); return r; } @@ -511,7 +511,7 @@ int radeon_gem_set_tiling_ioctl(struct drm_device *dev, void *data, return -ENOENT; robj = gem_to_radeon_bo(gobj); r = radeon_bo_set_tiling_flags(robj, args->tiling_flags, args->pitch); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return r; } @@ -534,7 +534,7 @@ int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data, radeon_bo_get_tiling_flags(rbo, &args->tiling_flags, &args->pitch); radeon_bo_unreserve(rbo); out: - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return r; } @@ -668,14 +668,14 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data, r = radeon_bo_reserve(rbo, false); if (r) { args->operation = RADEON_VA_RESULT_ERROR; - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return r; } bo_va = radeon_vm_bo_find(&fpriv->vm, rbo); if (!bo_va) { args->operation = RADEON_VA_RESULT_ERROR; radeon_bo_unreserve(rbo); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return -ENOENT; } @@ -702,7 +702,7 @@ int radeon_gem_va_ioctl(struct drm_device *dev, void *data, args->operation = RADEON_VA_RESULT_ERROR; } out: - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return r; } @@ -743,7 +743,7 @@ int radeon_gem_op_ioctl(struct drm_device *dev, void *data, radeon_bo_unreserve(robj); out: - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return r; } @@ -769,7 +769,7 @@ int radeon_mode_dumb_create(struct drm_file *file_priv, r = drm_gem_handle_create(file_priv, gobj, &handle); /* drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); if (r) { return r; } diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 140d94cc080d..f3dee01250da 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -448,7 +448,7 @@ void radeon_bo_force_delete(struct radeon_device *rdev) list_del_init(&bo->list); mutex_unlock(&bo->rdev->gem.mutex); /* this should unref the ttm bo */ - drm_gem_object_put_unlocked(&bo->tbo.base); + drm_gem_object_put(&bo->tbo.base); } } From patchwork Fri May 15 09:51:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550925 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 0639390 for ; Fri, 15 May 2020 09:54:55 +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 D8CF720709 for ; Fri, 15 May 2020 09:54:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K5no6ytI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8CF720709 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 31FCD6EC4D; Fri, 15 May 2020 09:54:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 395816EC42 for ; Fri, 15 May 2020 09:54:38 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id w64so1948885wmg.4 for ; Fri, 15 May 2020 02:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pNLF3OezzIDx+6Z3gzM02gmKo66FU8kqpI8uLC6WUCE=; b=K5no6ytI+zaq7ed6Ziz2Zp/Tn/2PiZFYGy7KOG3EHrDLYWx8r0ExgW8Vg6rZ0fcEsQ eKPdU/eW7ZA2AJUuIw6SYICzAh1+H84B6+Aa9lldM9xRQK9LnGBpCT54F1WY0+ImbQ2k muWhZEKwltqL91T771UtGHFhrBXWj21Qva7vUjcCi0GHCduzBANLd9cUGS3PQZpHjyjF y7+VGaU1eOHbEuNjWSDRonSM/43A4pvUXqeN1m2bqYR/ASw1yUDjWqJHj/CEs6UWSrZH alRmOwlGB7Wp5tu5YIa5K2cfxhkuESrqS7YOpUTcO38uElVfOUpXXxSjvre4/Or2AMd7 TcTg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=pNLF3OezzIDx+6Z3gzM02gmKo66FU8kqpI8uLC6WUCE=; b=iEwdRGYUtqzGUb0u5fztYiY5YdUutG431IaIRpz579JiexvPjdovga0GUlig/lKjp8 uSTOkwFGI4Ob0oTe2yzL8Two5NfL+fZ3KT35rpbTzhxfbtRZ0JaEaa+khjSp0e3WVxGC nyVyDOAN9htle8K7R/UWbsGnWi9Jdh/MMzocyXQbtXdq6isCZqNLlbXRolotDd1GigDq X/8+VbTcZFCIr5E+r0D+34+mwrVWNw5BgAlXV4Fae1qtBKptpxmqqlNwBALs7EITSZHJ 4fK5bV62b4OtIuXU6ZjArkwcKpRllUpxGdrTgBIGHBSvIm3PU4vMU7ME6c7dr5AG/CJQ /7Eg== X-Gm-Message-State: AOAM5304bPh6ztV2g9tjagNyPlDAXBvn2vpQEcB9tJZl8R8rpYF/9TaR xnc0iSzXeHhnZocxlwNBJNkU1YPR X-Google-Smtp-Source: ABdhPJzeqijflI2tVTENtHMws/xjTVmY8yaUzbMFBT0wI74jlCYCx9MUFNaoqaaySXb7K6ib9jR6Ew== X-Received: by 2002:a7b:c7d5:: with SMTP id z21mr3024101wmk.112.1589536476602; Fri, 15 May 2020 02:54:36 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:36 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 30/38] drm/rockchip: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:10 +0100 Message-Id: <20200515095118.2743122-31-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com, Sandy Huang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Sandy Huang Cc: "Heiko Stübner" Cc: David Airlie Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Acked-by: Heiko Stuebner --- drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c index 9b13c784b347..3aa37e177667 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c @@ -88,7 +88,7 @@ rockchip_fb_create(struct drm_device *dev, struct drm_file *file, struct drm_gem_object **obj = afbc_fb->base.obj; for (i = 0; i < info->num_planes; ++i) - drm_gem_object_put_unlocked(obj[i]); + drm_gem_object_put(obj[i]); kfree(afbc_fb); return ERR_PTR(ret); diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index 0d1884684dcb..b9275ba7c5a5 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -392,7 +392,7 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv, goto err_handle_create; /* drop reference from allocate - handle holds it now. */ - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return rk_obj; From patchwork Fri May 15 09:51:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550945 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 AD958739 for ; Fri, 15 May 2020 09:55:11 +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 8BABF2074D for ; Fri, 15 May 2020 09:55:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pz0QUgq6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BABF2074D 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 492C76EC57; Fri, 15 May 2020 09:55:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7A42A6EC4B for ; Fri, 15 May 2020 09:54:39 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id 50so2751905wrc.11 for ; Fri, 15 May 2020 02:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uXSokitOb4mqZMpIxKyK3nwkjsOeIwUipJwMxA5Ussc=; b=pz0QUgq6QJTaV127c7f+athygQ03Zm2pA2WobwxMCLEuGonyl6xX0eMwsKZL2vNRTx YXoQj2Flr3xsxBZu7hAhmpK08nA3B5bNcpl+I4LMi8nROhPzscYUtSO5JLFBHltuyCVm j7l4lMtmJhn+w8YVdROhijg+n9KxIujt7MTiF/lCI6eSFiOc1cqaVJuJlS6fahy1RJaM Uo9xswCSRfBhpIZ874VtZEK6ceg+GMRMIh0j2yrzjoNNq7ZD7lY5i1ikh8edPbk5Oz5D 7IGT08Hz4RjNGN+8uCT3NVOx7wwhWFsQUok8GMuToDcJtbGWxo1S0wzsonwEH/rxW6Su hR3Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=uXSokitOb4mqZMpIxKyK3nwkjsOeIwUipJwMxA5Ussc=; b=J2KapFR6GrGHw6bGL4oU5I7HmkgIayRGeZ6TDEO7A6nqcWDtDYtOE+Np+HVSg0CHi5 OoS/5IchYDZiIsNbER2uwMHsQz4A5+b8nOKAmmZhUWLInPDjucw2iCor9po/Dh5d+5iW gGK0QkMqS62MLudCDI1eU9vVnKNgGTEBHMJzO3L/iAoz97sAmcrbd6faFO0uHgNi+C4W J6rn85qOhCoqn4P7Pk2LXWtvOit4h74fFUk9gFN86fZEqa9TjG15hfgjBmsyOqO/PmsR LjRM2Utzx3foIwpu9OXow7Y4wjsRM0c5fK+qwc5aYUXRZyaJ9c4ONLVvObAQFuB3njer +gwg== X-Gm-Message-State: AOAM5339pT6piTsHou6gBIR2N4dUrWdmGwjzB2wH7oK/v5c8Lv3FWzyH ldWvJFcij+zZ5kFPjTSQTWqa7eCL X-Google-Smtp-Source: ABdhPJzep3KID1Jfjb7oxQEimpWdmGaTLXti6Pg/ayobCAsFWorAO19jHhIgXeZv0MEzoqD5BNMabA== X-Received: by 2002:a5d:5706:: with SMTP id a6mr3201080wrv.141.1589536477779; Fri, 15 May 2020 02:54:37 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:37 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 31/38] drm/tegra: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:11 +0100 Message-Id: <20200515095118.2743122-32-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Thierry Reding , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Thierry Reding Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Acked-by: Thierry Reding --- drivers/gpu/drm/tegra/drm.c | 12 ++++++------ drivers/gpu/drm/tegra/fb.c | 6 +++--- drivers/gpu/drm/tegra/gem.c | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index d4f51b5c7ee5..09d71c94985c 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -328,7 +328,7 @@ int tegra_drm_submit(struct tegra_drm_context *context, fail: while (num_refs--) - drm_gem_object_put_unlocked(refs[num_refs]); + drm_gem_object_put(refs[num_refs]); kfree(refs); @@ -368,7 +368,7 @@ static int tegra_gem_mmap(struct drm_device *drm, void *data, args->offset = drm_vma_node_offset_addr(&bo->gem.vma_node); - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return 0; } @@ -636,7 +636,7 @@ static int tegra_gem_set_tiling(struct drm_device *drm, void *data, bo->tiling.mode = mode; bo->tiling.value = value; - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return 0; } @@ -676,7 +676,7 @@ static int tegra_gem_get_tiling(struct drm_device *drm, void *data, break; } - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return err; } @@ -701,7 +701,7 @@ static int tegra_gem_set_flags(struct drm_device *drm, void *data, if (args->flags & DRM_TEGRA_GEM_BOTTOM_UP) bo->flags |= TEGRA_BO_BOTTOM_UP; - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return 0; } @@ -723,7 +723,7 @@ static int tegra_gem_get_flags(struct drm_device *drm, void *data, if (bo->flags & TEGRA_BO_BOTTOM_UP) args->flags |= DRM_TEGRA_GEM_BOTTOM_UP; - drm_gem_object_put_unlocked(gem); + drm_gem_object_put(gem); return 0; } diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c index 2b0666ac681b..01939c57fc74 100644 --- a/drivers/gpu/drm/tegra/fb.c +++ b/drivers/gpu/drm/tegra/fb.c @@ -171,7 +171,7 @@ struct drm_framebuffer *tegra_fb_create(struct drm_device *drm, unreference: while (i--) - drm_gem_object_put_unlocked(&planes[i]->gem); + drm_gem_object_put(&planes[i]->gem); return ERR_PTR(err); } @@ -235,7 +235,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper, info = drm_fb_helper_alloc_fbi(helper); if (IS_ERR(info)) { dev_err(drm->dev, "failed to allocate framebuffer info\n"); - drm_gem_object_put_unlocked(&bo->gem); + drm_gem_object_put(&bo->gem); return PTR_ERR(info); } @@ -244,7 +244,7 @@ static int tegra_fbdev_probe(struct drm_fb_helper *helper, err = PTR_ERR(fbdev->fb); dev_err(drm->dev, "failed to allocate DRM framebuffer: %d\n", err); - drm_gem_object_put_unlocked(&bo->gem); + drm_gem_object_put(&bo->gem); return PTR_ERR(fbdev->fb); } diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 623768100c6a..723df142a981 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -24,7 +24,7 @@ static void tegra_bo_put(struct host1x_bo *bo) { struct tegra_bo *obj = host1x_to_tegra_bo(bo); - drm_gem_object_put_unlocked(&obj->gem); + drm_gem_object_put(&obj->gem); } /* XXX move this into lib/scatterlist.c? */ @@ -385,7 +385,7 @@ struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file, return ERR_PTR(err); } - drm_gem_object_put_unlocked(&bo->gem); + drm_gem_object_put(&bo->gem); return bo; } From patchwork Fri May 15 09:51:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550933 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 3895C90 for ; Fri, 15 May 2020 09:55:00 +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 1728D20709 for ; Fri, 15 May 2020 09:55:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zb4jWxyS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1728D20709 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 8F3626EC52; Fri, 15 May 2020 09:54:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id A24576EC4E for ; Fri, 15 May 2020 09:54:40 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id i15so2754189wrx.10 for ; Fri, 15 May 2020 02:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g0LkSFX4xUa/Now8wz5B/tkjASecL8HvKLerInAze+A=; b=Zb4jWxySF4pdXNARSWgKEpxkFyhzJiFj8kHxjCOkN4pkixCiU7SB2sw92t4p4Fv/eP yGEqxiBQBy0vMVrkHpdTkMf1Eqh+dZxsratPx1fL14QTp6MBezhmr8t+ZWKmYHFrAYAs VPmnDRaMnPxHSKBKPFzpvtQ7AYQ1MQwGsqp7VLCg7COFWd06yemBz7aB4s0QpXK0I/L0 lha7mmNkcfdSXqz4geArXSDwaiDM75EdNSEdqeHxTagzpbyZpdCFdW9tlD9TS2FoA9wR 5gbZZu+4nt3wkCAICOtmV1RPt25viSYFV/sCJ37kYWuVRlQCD37yx5cKMv7DvQQPIx+7 aG4w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=g0LkSFX4xUa/Now8wz5B/tkjASecL8HvKLerInAze+A=; b=TeYUrSc/vuX7v5Wme2/zac72URqVQcOlCsokueQf2X/jvAoqtJgK6/048sgapt9/Y/ 2ceIEVWS9Su8LeObddrObq6FXkBY63Hr7w4QQ/vXm+Aksg9zc4iHNB8jvm30mnr0zHW/ uySL+H+08qNZeFmJv4w5xIOyr80Fgja5Fg6H1r3l0gCoYsgUfn92XFvV0YLyNywQTTEz 5RqF1XSK9GV5jZtPrRr4WEGXYHYdRNgElhy1JebX2xO9Zc6/IKHASvLEmSLqKFzX+kKT F/iuErKcXUeovmcoxf0mRTg4qweeWY0psvLIVLfa7/RD1XNILNr04q6vgSC1Q2jwQci5 bocg== X-Gm-Message-State: AOAM533Gf8vi6AA1lIei7/KPcwcWxLc6pI1iye+Lji/6sAs9+xPZZw7p naQZ2t1uHRyBdx09ED7B1t/dJ9yJ X-Google-Smtp-Source: ABdhPJyLrUkyx/VB4wWSMSumlZusI3pZa4BvePH45InOCtZTXXG1jqNN78FWChV9yWlVJv7de2rHow== X-Received: by 2002:adf:fe07:: with SMTP id n7mr3295060wrr.259.1589536479112; Fri, 15 May 2020 02:54:39 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:38 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 32/38] drm/v3d: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:12 +0100 Message-Id: <20200515095118.2743122-33-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Eric Anholt Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/v3d/v3d_bo.c | 6 +++--- drivers/gpu/drm/v3d/v3d_gem.c | 4 ++-- drivers/gpu/drm/v3d/v3d_irq.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/v3d/v3d_bo.c b/drivers/gpu/drm/v3d/v3d_bo.c index edd299ab53d8..8b52cb25877c 100644 --- a/drivers/gpu/drm/v3d/v3d_bo.c +++ b/drivers/gpu/drm/v3d/v3d_bo.c @@ -185,7 +185,7 @@ int v3d_create_bo_ioctl(struct drm_device *dev, void *data, args->offset = bo->node.start << PAGE_SHIFT; ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle); - drm_gem_object_put_unlocked(&bo->base.base); + drm_gem_object_put(&bo->base.base); return ret; } @@ -208,7 +208,7 @@ int v3d_mmap_bo_ioctl(struct drm_device *dev, void *data, } args->offset = drm_vma_node_offset_addr(&gem_obj->vma_node); - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); return 0; } @@ -229,6 +229,6 @@ int v3d_get_bo_offset_ioctl(struct drm_device *dev, void *data, args->offset = bo->node.start << PAGE_SHIFT; - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); return 0; } diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c index 09a7639cf161..915f8bfdb58c 100644 --- a/drivers/gpu/drm/v3d/v3d_gem.c +++ b/drivers/gpu/drm/v3d/v3d_gem.c @@ -358,7 +358,7 @@ v3d_job_free(struct kref *ref) for (i = 0; i < job->bo_count; i++) { if (job->bo[i]) - drm_gem_object_put_unlocked(job->bo[i]); + drm_gem_object_put(job->bo[i]); } kvfree(job->bo); @@ -384,7 +384,7 @@ v3d_render_job_free(struct kref *ref) struct v3d_bo *bo, *save; list_for_each_entry_safe(bo, save, &job->unref_list, unref_head) { - drm_gem_object_put_unlocked(&bo->base.base); + drm_gem_object_put(&bo->base.base); } v3d_job_free(ref); diff --git a/drivers/gpu/drm/v3d/v3d_irq.c b/drivers/gpu/drm/v3d/v3d_irq.c index 51b65263c657..c88686489b88 100644 --- a/drivers/gpu/drm/v3d/v3d_irq.c +++ b/drivers/gpu/drm/v3d/v3d_irq.c @@ -72,7 +72,7 @@ v3d_overflow_mem_work(struct work_struct *work) V3D_CORE_WRITE(0, V3D_PTB_BPOS, obj->size); out: - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); } static irqreturn_t From patchwork Fri May 15 09:51:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550937 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 CB6DA739 for ; Fri, 15 May 2020 09:55:05 +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 A8E0820787 for ; Fri, 15 May 2020 09:55:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Iar7vmcL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8E0820787 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 594326EC53; Fri, 15 May 2020 09:54:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id B91986EC4F for ; Fri, 15 May 2020 09:54:41 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id z72so1962497wmc.2 for ; Fri, 15 May 2020 02:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xfCroSTVpF6iqsTWX85rQcAiNx8SYDcdR9BmtPebrZ8=; b=Iar7vmcLsp3Ud6DAHBtaU4TNh6tCTDxA8DxHBo5FkECpHsFOq7A/LPLzkEqopFvfxM Qz8aalPTj3llvvINZ10D0gpai1EqVJD62eQkWLoDaLvUfaLr5gnEE9bbvk3+PP0+GjzU 83ZUkUqgiSMyHaD95Q+UtcxbPkzvgIVpwOYBhhCBGdpMC3eAnrhyEcg597HlHStApnKR d4qJlFF8LsY/A7/ahCsLuVReYoHbxok1C+WdFrs3A1Omx3/la0kiPc6V/+zgYDIRRXJM fFVBo44Lmfqp9hKfZKL4e4kw850j5/kQj63iQSbea9E7Zo28ZIcSAJNHZLQk5fgT9/x2 AXYA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xfCroSTVpF6iqsTWX85rQcAiNx8SYDcdR9BmtPebrZ8=; b=gT6xKfnhGVoDFPPdY2e+MPfkH8rk0f/Yq9+nVj1gmTFKna5kWe3iE4/CvoBpeUWw3j eeT3XA4/ZfJlf3KIOV24eYWeDi2sH8/X2zGHTqR37whymdGmWLhu7vmKn3Q+/AVau+oN 55SJ34sQCO5+VPqJJOJdjGO6dnzzy8SRZQdF8i/qWACNCAWsBJARoS8FKm9LZ6oUHqeu xJuFZG6LRmSNjvpBb3p3MJgHg4aMI2v3utwlBwIxxUgqgBy1u17HEGIItm6eVk3J8yc2 Tp+TwbLEsd50ez3gpVmdtEFAAmb9K/iaSkcMRBd0k1hW24z6Hg8ChNbtcIf9VgAb8RCw iECg== X-Gm-Message-State: AOAM530QZBHLlg62YKVtUK+KQQ4iRBYGlwr3+B0s5wsXSjPSz+Av0djH YmY/zq96l4PQX+GmlN5wkUtwJPJ/ X-Google-Smtp-Source: ABdhPJzBnBflI4imsb/dxI/8Jyb+MtUgW/Cg08yY9OTWBmYMLlWrODw9qT/jlDqJTxlD9bKjDWZdmg== X-Received: by 2002:a05:600c:206:: with SMTP id 6mr3157316wmi.170.1589536480120; Fri, 15 May 2020 02:54:40 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:39 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 33/38] drm/vc4: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:13 +0100 Message-Id: <20200515095118.2743122-34-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Eric Anholt Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg --- drivers/gpu/drm/vc4/vc4_bo.c | 14 +++++++------- drivers/gpu/drm/vc4/vc4_gem.c | 14 +++++++------- drivers/gpu/drm/vc4/vc4_kms.c | 2 +- drivers/gpu/drm/vc4/vc4_v3d.c | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 72d30d90b856..74ceebd62fbc 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c @@ -490,7 +490,7 @@ int vc4_dumb_create(struct drm_file *file_priv, bo->madv = VC4_MADV_WILLNEED; ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle); - drm_gem_object_put_unlocked(&bo->base.base); + drm_gem_object_put(&bo->base.base); return ret; } @@ -834,7 +834,7 @@ int vc4_create_bo_ioctl(struct drm_device *dev, void *data, bo->madv = VC4_MADV_WILLNEED; ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle); - drm_gem_object_put_unlocked(&bo->base.base); + drm_gem_object_put(&bo->base.base); return ret; } @@ -854,7 +854,7 @@ int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data, /* The mmap offset was set up at BO allocation time. */ args->offset = drm_vma_node_offset_addr(&gem_obj->vma_node); - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); return 0; } @@ -918,7 +918,7 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle); fail: - drm_gem_object_put_unlocked(&bo->base.base); + drm_gem_object_put(&bo->base.base); return ret; } @@ -965,7 +965,7 @@ int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, bo = to_vc4_bo(gem_obj); bo->t_format = t_format; - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); return 0; } @@ -1000,7 +1000,7 @@ int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, else args->modifier = DRM_FORMAT_MOD_NONE; - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); return 0; } @@ -1091,7 +1091,7 @@ int vc4_label_bo_ioctl(struct drm_device *dev, void *data, ret = -ENOMEM; mutex_unlock(&vc4->bo_lock); - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); return ret; } diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c index e1cfc3ccd05a..9f01ddd5b932 100644 --- a/drivers/gpu/drm/vc4/vc4_gem.c +++ b/drivers/gpu/drm/vc4/vc4_gem.c @@ -58,7 +58,7 @@ vc4_free_hang_state(struct drm_device *dev, struct vc4_hang_state *state) unsigned int i; for (i = 0; i < state->user_state.bo_count; i++) - drm_gem_object_put_unlocked(state->bo[i]); + drm_gem_object_put(state->bo[i]); kfree(state); } @@ -808,7 +808,7 @@ vc4_cl_lookup_bos(struct drm_device *dev, fail_put_bo: /* Release any reference to acquired objects. */ for (i = 0; i < exec->bo_count && exec->bo[i]; i++) - drm_gem_object_put_unlocked(&exec->bo[i]->base); + drm_gem_object_put(&exec->bo[i]->base); fail: kvfree(handles); @@ -957,7 +957,7 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) struct vc4_bo *bo = to_vc4_bo(&exec->bo[i]->base); vc4_bo_dec_usecnt(bo); - drm_gem_object_put_unlocked(&exec->bo[i]->base); + drm_gem_object_put(&exec->bo[i]->base); } kvfree(exec->bo); } @@ -966,7 +966,7 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) struct vc4_bo *bo = list_first_entry(&exec->unref_list, struct vc4_bo, unref_head); list_del(&bo->unref_head); - drm_gem_object_put_unlocked(&bo->base.base); + drm_gem_object_put(&bo->base.base); } /* Free up the allocation of any bin slots we used. */ @@ -1107,7 +1107,7 @@ vc4_wait_bo_ioctl(struct drm_device *dev, void *data, ret = vc4_wait_for_seqno_ioctl_helper(dev, bo->seqno, &args->timeout_ns); - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); return ret; } @@ -1301,7 +1301,7 @@ vc4_gem_destroy(struct drm_device *dev) * the overflow allocation registers. Now free the object. */ if (vc4->bin_bo) { - drm_gem_object_put_unlocked(&vc4->bin_bo->base.base); + drm_gem_object_put(&vc4->bin_bo->base.base); vc4->bin_bo = NULL; } @@ -1382,7 +1382,7 @@ int vc4_gem_madvise_ioctl(struct drm_device *dev, void *data, ret = 0; out_put_gem: - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); return ret; } diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 78d4fb0499e3..08318e69061b 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -330,7 +330,7 @@ static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, mode_cmd_local.modifier[0] = DRM_FORMAT_MOD_NONE; } - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); mode_cmd = &mode_cmd_local; } diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c index cea77a21b205..f7ab979721b3 100644 --- a/drivers/gpu/drm/vc4/vc4_v3d.c +++ b/drivers/gpu/drm/vc4/vc4_v3d.c @@ -308,7 +308,7 @@ static int bin_bo_alloc(struct vc4_dev *vc4) struct vc4_bo, unref_head); list_del(&bo->unref_head); - drm_gem_object_put_unlocked(&bo->base.base); + drm_gem_object_put(&bo->base.base); } return ret; @@ -344,7 +344,7 @@ static void bin_bo_release(struct kref *ref) if (WARN_ON_ONCE(!vc4->bin_bo)) return; - drm_gem_object_put_unlocked(&vc4->bin_bo->base.base); + drm_gem_object_put(&vc4->bin_bo->base.base); vc4->bin_bo = NULL; } From patchwork Fri May 15 09:51:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550951 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 E88E890 for ; Fri, 15 May 2020 09:55:15 +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 C75C120709 for ; Fri, 15 May 2020 09:55:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HtUMBBgZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C75C120709 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 AABFE6EC5C; Fri, 15 May 2020 09:55:01 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id D22FB6EC4F for ; Fri, 15 May 2020 09:54:42 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id u188so1968339wmu.1 for ; Fri, 15 May 2020 02:54:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W98MEwuMPsDJPuQXd5YbYpNnxp1KJi16qnc4ceqsWuw=; b=HtUMBBgZpyTjkl7jD1ee3MriqZZdIvhw2jPrDYEYD8Lirot12rkWErWaroGawtAZuQ P4PeGFMWOpx7CI0V8iBQFsZwHRn+P0gb+x36DD0oJoBpSl06xqOb2BUIXwrBRxtqCSZF CTdfScqvnSVanPyYS4X+tvaaX/wbZA4nVBAi+u5YSB8nBcGofnR8+eIvLqL10IIOXOtJ 9acIlQ0zk8CVvu49KU58X6EED+zF/N4+eM+O4vtss1zAczv/p0DtZdl8ztAprgh1CpTt Rea0qByII1OqZLF2mwcpoWniCdVC+wDJk14kx/6Jbf3rRYEoZ2RKsg+XrIFE2mVIrk10 3mnQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=W98MEwuMPsDJPuQXd5YbYpNnxp1KJi16qnc4ceqsWuw=; b=W7H5hbaSf70m76ktX5FEYALlybYzLBLYFdJIjIKfnLP0uKtP7UrCu0wOSVBXFBsBSF /jhQ5SOsVhFg7LsUo8hDovbXjABCSDAZznizE/viHO+TGHlJa6poGWsna2C74QglmOwf gb2T0mpkPab2LOSQF3P3iTQ1n+X1opTmy1ycmYu1xDqNfwnER9clU3sN89umU2F2F/nQ n+dACWmnKThfzI+jWAGJDNQTZEQQgyyWuPnOlz9PN7q+11sx6WLd6oTX7tNAN8uDLDkM KGrD3t1qc0nxCKuZrSmmfSKN/bU/BsqysuLvaDjolT5hntamd8pa9Jdq8I1FNsTknIjn lOwQ== X-Gm-Message-State: AOAM533IlO8hoCNOLZdc6La+AfFEv8bsw7gwH6H6it8MoiWW2X5iEOLD lFVVc3KHDUDjYz23ey7qsMhUB9ER X-Google-Smtp-Source: ABdhPJwwvU2VFsYRBf3u9tsvN+7x3jXy43f06aWmu6E6zq5xn4mnb+/pxykaVp2mrnMwDWuuKnOXfA== X-Received: by 2002:a7b:c62a:: with SMTP id p10mr2913444wmk.143.1589536481335; Fri, 15 May 2020 02:54:41 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:40 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 34/38] drm/vgem: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:14 +0100 Message-Id: <20200515095118.2743122-35-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com, Emil Velikov Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: David Airlie Cc: Daniel Vetter Cc: Emil Velikov Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Reviewed-by: Daniel Vetter --- drivers/gpu/drm/vgem/vgem_drv.c | 6 +++--- drivers/gpu/drm/vgem/vgem_fence.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index ec1a8ebb6f1b..e4dc7b267a0b 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -198,7 +198,7 @@ static struct drm_gem_object *vgem_gem_create(struct drm_device *dev, ret = drm_gem_handle_create(file, &obj->base, handle); if (ret) { - drm_gem_object_put_unlocked(&obj->base); + drm_gem_object_put(&obj->base); return ERR_PTR(ret); } @@ -223,7 +223,7 @@ static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev, args->size = gem_object->size; args->pitch = pitch; - drm_gem_object_put_unlocked(gem_object); + drm_gem_object_put(gem_object); DRM_DEBUG("Created object of size %llu\n", args->size); @@ -251,7 +251,7 @@ static int vgem_gem_dumb_map(struct drm_file *file, struct drm_device *dev, *offset = drm_vma_node_offset_addr(&obj->vma_node); unref: - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c index 9268f6fc3f66..17f32f550dd9 100644 --- a/drivers/gpu/drm/vgem/vgem_fence.c +++ b/drivers/gpu/drm/vgem/vgem_fence.c @@ -182,7 +182,7 @@ int vgem_fence_attach_ioctl(struct drm_device *dev, dma_fence_put(fence); } err: - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } From patchwork Fri May 15 09:51:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550953 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 5630A739 for ; Fri, 15 May 2020 09:55:17 +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 34E8620709 for ; Fri, 15 May 2020 09:55:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Oe/Vn3tI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34E8620709 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 D57C36EC5B; Fri, 15 May 2020 09:55:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 25EE76EC51 for ; Fri, 15 May 2020 09:54:44 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id y3so2840319wrt.1 for ; Fri, 15 May 2020 02:54:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=48BeOr4AUwywCq8MKGtX+OvfvETXdI5v2ppv/DdJJrA=; b=Oe/Vn3tI191Dit2PYvYDf8RHTOl0gXPQCh1yLvIqGW0txXICvdj2lydAEc9ALldprg SDLyoK7PdNwALFTrdfjoakFPccAVZeXznLjq7EQu5FDOgYyXlqlBQC0WYhS3XFsEQzoE 0atVq52XJvzx17IKy3oK3rQB7a7RmVpjyEU2CWB4xcKyDqoOoEiSg1NeaMakE2z+QMho hYKZr+4+R4DziC24g6khkfQ4/9KoIuSbSgLQ9giQ5Ul+uhskng2PEZVRrmjY3pnL2dR6 P2TpITaQ52ATdUfQCPXWO5nhcj1GI5HQk8RU3paI9vn7m45vDh133pq710h5KlZUQ3Mv 38Uw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=48BeOr4AUwywCq8MKGtX+OvfvETXdI5v2ppv/DdJJrA=; b=XgJcteikUy+24JbOoaAFCFurJbo7Pr36nAzNDKx2tydmetaj/jQzHQbCgv4BBt+SiS Xz0bNKIAE8GGWwkY2FnkVG1mgGEha1OYLb9oswdoJp7206UpD+ZFaLi1+oNUR4KQOOqD T/IUz52USPrt3Xfp/4Nomypj51xHn/rsOsmnYwai+kFd9OuXT9ZMtMCHNxr0QbdQNJyf qjxUxLHo9cnB0oQweeLGsSAvascprsxZzlEnPI2f1enkmKDW9EYYNWromX3QfNdhhD25 +4C5S1zpMFT6YZtvMK8OGInYSZtkfO4I/iEjVeIllS/AYSZi8tzP1SxiKcq6K/Ds9vMj 3Q4g== X-Gm-Message-State: AOAM532DJy+GQvCKTVPzNKvIOa1i+zSpA/y677gaKYLssgl+gGN+umu1 KC3c4ETvqvuFbTPchgEnxG6SZPAx X-Google-Smtp-Source: ABdhPJw9WNuvBK7tkU3wyVXsC8BrGyzIqr9HdQ7CPoB4g+0z+efRkHBQvbL6Pf8qkfC0RNqLLhNYmA== X-Received: by 2002:a5d:526f:: with SMTP id l15mr3283862wrc.367.1589536482423; Fri, 15 May 2020 02:54:42 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:41 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 35/38] drm/virtio: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:15 +0100 Message-Id: <20200515095118.2743122-36-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com, Gerd Hoffmann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: David Airlie Cc: Gerd Hoffmann Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Acked-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- drivers/gpu/drm/virtio/virtgpu_gem.c | 6 +++--- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index cc7fd957a307..f3ce49c5a34c 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -307,7 +307,7 @@ virtio_gpu_user_framebuffer_create(struct drm_device *dev, ret = virtio_gpu_framebuffer_init(dev, virtio_gpu_fb, mode_cmd, obj); if (ret) { kfree(virtio_gpu_fb); - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return NULL; } diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c index 1025658be4df..3dcd61aa6649 100644 --- a/drivers/gpu/drm/virtio/virtgpu_gem.c +++ b/drivers/gpu/drm/virtio/virtgpu_gem.c @@ -52,7 +52,7 @@ static int virtio_gpu_gem_create(struct drm_file *file, *obj_p = &obj->base.base; /* drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(&obj->base.base); + drm_gem_object_put(&obj->base.base); *handle_p = handle; return 0; @@ -102,7 +102,7 @@ int virtio_gpu_mode_dumb_mmap(struct drm_file *file_priv, if (gobj == NULL) return -ENOENT; *offset_p = drm_vma_node_offset_addr(&gobj->vma_node); - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return 0; } @@ -237,7 +237,7 @@ void virtio_gpu_array_put_free(struct virtio_gpu_object_array *objs) u32 i; for (i = 0; i < objs->nents; i++) - drm_gem_object_put_unlocked(objs->objs[i]); + drm_gem_object_put(objs->objs[i]); virtio_gpu_array_free(objs); } diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 867c5e239d55..584766be8d64 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -278,7 +278,7 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data, drm_gem_object_release(obj); return ret; } - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); rc->res_handle = qobj->hw_res_handle; /* similiar to a VM address */ rc->bo_handle = handle; @@ -300,7 +300,7 @@ static int virtio_gpu_resource_info_ioctl(struct drm_device *dev, void *data, ri->size = qobj->base.base.size; ri->res_handle = qobj->hw_res_handle; - drm_gem_object_put_unlocked(gobj); + drm_gem_object_put(gobj); return 0; } @@ -417,7 +417,7 @@ static int virtio_gpu_wait_ioctl(struct drm_device *dev, void *data, else if (ret > 0) ret = 0; - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return ret; } From patchwork Fri May 15 09:51:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550931 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 047F114C0 for ; Fri, 15 May 2020 09:54:59 +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 D789F20709 for ; Fri, 15 May 2020 09:54:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XkQsWQaz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D789F20709 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 CA30189798; Fri, 15 May 2020 09:54:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4C4C26EC4F for ; Fri, 15 May 2020 09:54:45 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id 50so2752272wrc.11 for ; Fri, 15 May 2020 02:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9KaeRqZl4451HA4G/q1pCxkOJiAUpEliJAh03Golzf0=; b=XkQsWQazQj7pyqXKcnR6eN6Mrpyja6/4aM1Xe8o+3bcUYpASkoNRdHqBy6NujlBtej +m0b98ZG6ZiP/suaeCLZxMTl8QK1p2YDPMCuJXTaOwMMRLeOQVBbm0Hlt08fLw7DuXF5 nER80OR+RdWSJ6S/8Tj0nGqyEtx+7sISQImGOnpyQb/FXVE/IwAScqyYEz+iXE1GPqzO cAtHDAzwjQinnx4KtBzjpDBWUqKo3zDdAuyrOiX+LbUsw2F6Wd6e3aq0ErBH9DypzwJm CJj5ILLZjcb4mzitxDPtdY/5gJnQ/DkyLlaEFkkpWGFaofJkAwzgwIW1YSXfgbvItAqf 8DKg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=9KaeRqZl4451HA4G/q1pCxkOJiAUpEliJAh03Golzf0=; b=qGyf2aD+o3uT2XNdVGPLwp+uqxg42/sYteBgq2vCPzb7WaGWc5Kl5Z65s8cNv6lbSB 49QRX275JgRt42a5BuueIwQLQBthN/sddMNXaMj1OP7TZ3vtMKbYFWhF7z3GgQSL0cvJ qt6TySsmN5gQlmEXfzB0a7PqI9Qaj9/2TQQV5hRWVn2zZocftaKrByQeWJloiFDR2RYP l2di4LTi+10lpdUsy1oCu/RirH3HZzQO0eB8QRf0uwrb05RCmeA6XYr4LSSMJFQlyvAf imwg1/bWdLS26X+OrexaUnRycVBy1pKArjLNWbjV7suOayT5vgmqdV9yGBue02r76Fwv p5Ug== X-Gm-Message-State: AOAM530ADyC7SfPbRr3bpSCaE0BkM1YAVxjWR24PyuWAL6OGnDtBo+ZT eYOyhwiWTexu4x1QEDRpoDO6GAdK X-Google-Smtp-Source: ABdhPJxPxMm/XfV2PxLVDQfFH9pPtPAxkkovo9OZUlJH0AzulnSQpyNHOkfmWI1LNKRHtYREUkKaiA== X-Received: by 2002:adf:e802:: with SMTP id o2mr3333374wrm.110.1589536483612; Fri, 15 May 2020 02:54:43 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:43 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 36/38] drm/vkms: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:16 +0100 Message-Id: <20200515095118.2743122-37-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Haneen Mohammed , emil.l.velikov@gmail.com, Rodrigo Siqueira Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done v2: - Rebase Cc: Rodrigo Siqueira Cc: Haneen Mohammed Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg (v1) Reviewed-by: Daniel Vetter --- drivers/gpu/drm/vkms/vkms_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/vkms_gem.c b/drivers/gpu/drm/vkms/vkms_gem.c index c541fec57566..a017fc59905e 100644 --- a/drivers/gpu/drm/vkms/vkms_gem.c +++ b/drivers/gpu/drm/vkms/vkms_gem.c @@ -141,7 +141,7 @@ int vkms_dumb_create(struct drm_file *file, struct drm_device *dev, args->size = gem_obj->size; args->pitch = pitch; - drm_gem_object_put_unlocked(gem_obj); + drm_gem_object_put(gem_obj); DRM_DEBUG_DRIVER("Created object of size %lld\n", size); From patchwork Fri May 15 09:51:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550941 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 7E2E190 for ; Fri, 15 May 2020 09:55:09 +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 584FD207D0 for ; Fri, 15 May 2020 09:55:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TE84JCbE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 584FD207D0 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 821A96EC5A; Fri, 15 May 2020 09:54:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 659A16EC4E for ; Fri, 15 May 2020 09:54:46 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id l18so2795818wrn.6 for ; Fri, 15 May 2020 02:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P3gtOJfa2YZz/FqZXXwOZAucaU5gEqRStJz3hrmVJMU=; b=TE84JCbErXdjPh7jCtfphunyTTcvE6p1lGojqnajL72wM/ZXU+CgXBRIGG1G8S3LIS 3rRS9Mdg+mbKKBnzx/UpNwDgQl5Z22m1C00zzJ4Pm18vLkf59v17q8x+WrYk4NCpB9Ls TtzMjpsVnasoBtg2d17slfecyvr9Lpx/cG7r+d6MFtjfYIHA8C+tDtBlXGsyT5PsDV+B Xb3l7xjX0UUB8JRQoFdqedVB8pUFDpCtwNQtevFykcu4VBLrpXnEb50gghjpvzAcCA4l BRrIwjuh9uOYvhc6dv72AxKD8JWemdzIAuf0+kdaaVsOu3xacDyrQogRi//mgoQG6A2H 4xdw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=P3gtOJfa2YZz/FqZXXwOZAucaU5gEqRStJz3hrmVJMU=; b=Tbj2otKviy2tQOqqdMLhrhyTmbRam7FeGDK9sO3+wRLjmsLgxqwjgA+Qko49XKUN/N lws4TfinVJwoRo3y6wWjlL1rM6dOBw8xkUwpVe1vcIbojVbJVPscqXZ1iNxVpx65GSd8 hIPuCedzd4caGONDBqGZiPHfM9ou6Akli/Rj04sXnEiihswnZgRIZtSjg1TGDT0OphHJ whDJcFGYcvwo0CRW5dY3FTAu+MUy/LoFzTLVCIrV/L+2a0K+6IGmVLfAEVTYMF+T1FwG SF/JPnv3YhtB1JWk9K8e3n1uBLZSFSLCUE8p23C0tIwZC4pmFyZhEGCvblbU2+7JPGz8 oqgA== X-Gm-Message-State: AOAM530nGGecQt1IsGI4LruxBZjEdYSz0aKShX19Ssre3j1V66WCd4ep udXFEAA5rcIQ4onRZO8PHRxSCj4Y X-Google-Smtp-Source: ABdhPJz0lK1oUGp3qbQzbxgiDZOZ0rXqSEWgyuRU9Gk9qX9N4ivTK2oL2JFwgdaFIx4iYSVP98J48w== X-Received: by 2002:adf:9d91:: with SMTP id p17mr3244654wre.119.1589536484735; Fri, 15 May 2020 02:54:44 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:44 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 37/38] drm/xen: remove _unlocked suffix in drm_object_put_unlocked Date: Fri, 15 May 2020 10:51:17 +0100 Message-Id: <20200515095118.2743122-38-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com, Oleksandr Andrushchenko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov Spelling out _unlocked for each and every driver is a annoying. Especially if we consider how many drivers, do not know (or need to) about the horror stories involving struct_mutex. Just drop the suffix. It makes the API cleaner. Done via the following script: __from=drm_gem_object_put_unlocked __to=drm_gem_object_put for __file in $(git grep --name-only $__from); do sed -i "s/$__from/$__to/g" $__file; done Cc: Oleksandr Andrushchenko Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg Acked-by: Oleksandr Andrushchenko --- drivers/gpu/drm/xen/xen_drm_front.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c index 1fd458e877ca..3e660fb111b3 100644 --- a/drivers/gpu/drm/xen/xen_drm_front.c +++ b/drivers/gpu/drm/xen/xen_drm_front.c @@ -419,7 +419,7 @@ static int xen_drm_drv_dumb_create(struct drm_file *filp, goto fail_handle; /* Drop reference from allocate - handle holds it now */ - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); return 0; fail_handle: @@ -427,7 +427,7 @@ static int xen_drm_drv_dumb_create(struct drm_file *filp, xen_drm_front_dbuf_to_cookie(obj)); fail_backend: /* drop reference from allocate */ - drm_gem_object_put_unlocked(obj); + drm_gem_object_put(obj); fail: DRM_ERROR("Failed to create dumb buffer: %d\n", ret); return ret; From patchwork Fri May 15 09:51:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11550929 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 B6829739 for ; Fri, 15 May 2020 09:54:57 +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 9520C20709 for ; Fri, 15 May 2020 09:54:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lvxjbktC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9520C20709 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 746946EC51; Fri, 15 May 2020 09:54:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 619D56EC4F for ; Fri, 15 May 2020 09:54:47 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id j5so2826383wrq.2 for ; Fri, 15 May 2020 02:54:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2hpR5BlKVrSL8pXvdb6OTJd7fNOfL1/0b/Uy+6KfHds=; b=lvxjbktC3EgRszLqHdH/mNl+iP9qoI5NFi5aMNpTEVQ0GxK0LYfpDX2kM7aBbtu3p5 w9ZypiEW1GISvhKxADZ+y+w02gav8WCewdeqdRbfxz5Eo03NPrnZ+lCKZ+o5EWTLWcwm BteM0sZjnTDNEyW0rQY9KnOC2hPh83HtE45btFJhgJ8TahFzqlNlZeN+/5SV67fyov0A lJ6lnH8SB8UlyRbtyr9H3M5qi1E64O0qNHTcldvAbK6IqqJ2SNuXt2fosoDkXTRr4DOE cYIvsHCVy/rfYPrEI0s1s4lpWnlw8G0YcZq41V7tr5nfNeKVo3nZMMD9Cg6PsghNGTBa aktw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=2hpR5BlKVrSL8pXvdb6OTJd7fNOfL1/0b/Uy+6KfHds=; b=k6xMJTx4zdkUwRZn+rkrTExuY/yumWf/8m9UOHvrbQuTK99W6YBlJcAibDO4ywpZll whbsWqU2E/1AyrSHakZRU4mEfxqEK9MUfgzEy+0n81653B4VHh6rr65G49Dz5rlqJmCL bObVhc9fn2mJ2qJDRlcoMaCF79sNDc8zXx3M8JmXlXuZDXdlnCusoII4lpMPEXl8Uoo7 H7A2Pl7FaCCTObUlkrqEHsyHYg7l5j/MPP7nfi9LDEf9qfQ43chiKfVRpMpyL1qu26r9 zrZNpr6CaKjEJv4+nBYOPUwtbVoZoet4GW8I8HDomsSI0Db7uFLikFJ9fBWkG/HvwBvF V6jQ== X-Gm-Message-State: AOAM533/K/+beDgY7w1B+GCaxdoEhJoPUpCpKwF1cJipyVds7rtzQ5F2 qmQHhq+6HmEitaE+NhJl5GD/MVeQ X-Google-Smtp-Source: ABdhPJytT/2e/Em5GeNTfM0XvZuqegJyjKmxCZCclpU0YfIGJ3hzFS4F1z2XxLmaNEMVUx2T/c4OGA== X-Received: by 2002:adf:fec9:: with SMTP id q9mr3237375wrs.181.1589536485817; Fri, 15 May 2020 02:54:45 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id s12sm2705817wmc.7.2020.05.15.02.54.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 02:54:45 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 38/38] drm: remove transient drm_object_put_unlocked() Date: Fri, 15 May 2020 10:51:18 +0100 Message-Id: <20200515095118.2743122-39-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200515095118.2743122-1-emil.l.velikov@gmail.com> References: <20200515095118.2743122-1-emil.l.velikov@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , emil.l.velikov@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov As of last commit, all the drivers have been updated away from the _unlocked helper. As such we can now remove the transient #define. v2: keep sed and #define removal separate Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Emil Velikov Acked-by: Sam Ravnborg (v1) --- include/drm/drm_gem.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h index 10c5d561eb18..52173abdf500 100644 --- a/include/drm/drm_gem.h +++ b/include/drm/drm_gem.h @@ -375,8 +375,6 @@ drm_gem_object_put(struct drm_gem_object *obj) kref_put(&obj->refcount, drm_gem_object_free); } -#define drm_gem_object_put_unlocked drm_gem_object_put - void drm_gem_object_put_locked(struct drm_gem_object *obj); int drm_gem_handle_create(struct drm_file *file_priv,