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); } }