From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E12F8C4363D for ; Fri, 2 Oct 2020 09:53:16 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 AE6F2206DD for ; Fri, 2 Oct 2020 09:53:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="NnPhOIiG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE6F2206DD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 386C78734D; Fri, 2 Oct 2020 09:53:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UdtMsevTPZYH; Fri, 2 Oct 2020 09:53:14 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 5F8B28733B; Fri, 2 Oct 2020 09:53:14 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 47286C0889; Fri, 2 Oct 2020 09:53:14 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id E9069C0051 for ; Fri, 2 Oct 2020 09:53:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CA8B420101 for ; Fri, 2 Oct 2020 09:53:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g+S4uE88kx2d for ; Fri, 2 Oct 2020 09:53:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by silver.osuosl.org (Postfix) with ESMTPS id 2DF801FEED for ; Fri, 2 Oct 2020 09:53:09 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id l24so1018856edj.8 for ; Fri, 02 Oct 2020 02:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XBKf5rCOPo4NoQKS2bCbn6OHpqMgKghSnuzncLMaEsg=; b=NnPhOIiGXFfvJWiXpwMfYCrlYJj3jSqwhM3Fr7FAFgDtN8+LWpUPVsY9CPqHheoz3s duOjN3dl7KGdJpPoH/Rn+jfMpp1zUc3mpthUjoLgdoNEYm7Fr4xKD3gS0xfEr0+XOfv6 XtSRuu65opavt6S+qKQAVPJTls41fPewz/rXA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=XBKf5rCOPo4NoQKS2bCbn6OHpqMgKghSnuzncLMaEsg=; b=jI6kFQ/QmTI3JWhDMs0rR4l0i+D+alAQR71ALY35C9SylSL7Tb3Ar/QX2j4pyvE97r sK9YBbqJm4dvM3zhXrL+KYqGCVXxjB3/l36VZ81xP1X9tW+PU13JWJrX/JZb+w9rrJWh a48crzBZtAn1ad6dnqyFLyIsPJ7EFAZ5ilbWlYkhvcjXh97r4boyNSX7kxa2bhC99NWA yxrr4UK8XtI7Gyf+zIxmeu+PqRzZ15QS1aJgHgv+aM2dArr5OSkBR72upTMmjZHCjoSX vgNYNC8WIGH7dGh9ejwRz/gliAPAfybrwm+QrTJ0S54uKRW8WZTHUbtWDqCV29GPm+M2 D/FA== X-Gm-Message-State: AOAM5306P12MFvdKI08LgHfNDXRqZMIKcAq+DU2onXiRiXi3ZMdF3zAH rr5rJZOEqi+YJ0HJqUcNtZEayGxOIUmBGmLP X-Google-Smtp-Source: ABdhPJwvtlXjY3abDVfehLG+NbtTw4ENbbSxjUqiw5J1WQgeZzduYuia7fGlp8u2Z6fywLN6MoeKFw== X-Received: by 2002:adf:fed1:: with SMTP id q17mr1966851wrs.85.1601632084874; Fri, 02 Oct 2020 02:48:04 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id k8sm1015650wrl.42.2020.10.02.02.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 02:48:03 -0700 (PDT) Date: Fri, 2 Oct 2020 11:48:00 +0200 From: Daniel Vetter To: Thomas Zimmermann Subject: Re: [PATCH v3 1/7] drm/vram-helper: Remove invariant parameters from internal kmap function Message-ID: <20201002094800.GG438822@phenom.ffwll.local> References: <20200929151437.19717-1-tzimmermann@suse.de> <20200929151437.19717-2-tzimmermann@suse.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200929151437.19717-2-tzimmermann@suse.de> X-Operating-System: Linux phenom 5.7.0-1-amd64 Cc: luben.tuikov@amd.com, heiko@sntech.de, airlied@linux.ie, nouveau@lists.freedesktop.org, linus.walleij@linaro.org, dri-devel@lists.freedesktop.org, chris@chris-wilson.co.uk, melissa.srw@gmail.com, eric@anholt.net, ray.huang@amd.com, sam@ravnborg.org, sumit.semwal@linaro.org, emil.velikov@collabora.com, robh@kernel.org, linux-samsung-soc@vger.kernel.org, jy0922.shim@samsung.com, lima@lists.freedesktop.org, oleksandr_andrushchenko@epam.com, krzk@kernel.org, steven.price@arm.com, linux-rockchip@lists.infradead.org, kgene@kernel.org, bskeggs@redhat.com, linux+etnaviv@armlinux.org.uk, spice-devel@lists.freedesktop.org, alyssa.rosenzweig@collabora.com, maarten.lankhorst@linux.intel.com, etnaviv@lists.freedesktop.org, mripard@kernel.org, inki.dae@samsung.com, hdegoede@redhat.com, christian.gmeiner@gmail.com, xen-devel@lists.xenproject.org, virtualization@lists.linux-foundation.org, sean@poorly.run, apaneers@amd.com, linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, tomeu.vizoso@collabora.com, sw0312.kim@samsung.com, hjc@rock-chips.com, kyungmin.park@samsung.com, miaoqinglang@huawei.com, yuq825@gmail.com, daniel@ffwll.ch, alexander.deucher@amd.com, linux-media@vger.kernel.org, christian.koenig@amd.com, l.stach@pengutronix.de X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Tue, Sep 29, 2020 at 05:14:31PM +0200, Thomas Zimmermann wrote: > The parameters map and is_iomem are always of the same value. Removed them > to prepares the function for conversion to struct dma_buf_map. > > Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Vetter > --- > drivers/gpu/drm/drm_gem_vram_helper.c | 17 ++++++----------- > 1 file changed, 6 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/drm_gem_vram_helper.c > index 3fe4b326e18e..256b346664f2 100644 > --- a/drivers/gpu/drm/drm_gem_vram_helper.c > +++ b/drivers/gpu/drm/drm_gem_vram_helper.c > @@ -382,16 +382,16 @@ int drm_gem_vram_unpin(struct drm_gem_vram_object *gbo) > } > EXPORT_SYMBOL(drm_gem_vram_unpin); > > -static void *drm_gem_vram_kmap_locked(struct drm_gem_vram_object *gbo, > - bool map, bool *is_iomem) > +static void *drm_gem_vram_kmap_locked(struct drm_gem_vram_object *gbo) > { > int ret; > struct ttm_bo_kmap_obj *kmap = &gbo->kmap; > + bool is_iomem; > > if (gbo->kmap_use_count > 0) > goto out; > > - if (kmap->virtual || !map) > + if (kmap->virtual) > goto out; > > ret = ttm_bo_kmap(&gbo->bo, 0, gbo->bo.num_pages, kmap); > @@ -399,15 +399,10 @@ static void *drm_gem_vram_kmap_locked(struct drm_gem_vram_object *gbo, > return ERR_PTR(ret); > > out: > - if (!kmap->virtual) { > - if (is_iomem) > - *is_iomem = false; > + if (!kmap->virtual) > return NULL; /* not mapped; don't increment ref */ > - } > ++gbo->kmap_use_count; > - if (is_iomem) > - return ttm_kmap_obj_virtual(kmap, is_iomem); > - return kmap->virtual; > + return ttm_kmap_obj_virtual(kmap, &is_iomem); > } > > static void drm_gem_vram_kunmap_locked(struct drm_gem_vram_object *gbo) > @@ -452,7 +447,7 @@ void *drm_gem_vram_vmap(struct drm_gem_vram_object *gbo) > ret = drm_gem_vram_pin_locked(gbo, 0); > if (ret) > goto err_ttm_bo_unreserve; > - base = drm_gem_vram_kmap_locked(gbo, true, NULL); > + base = drm_gem_vram_kmap_locked(gbo); > if (IS_ERR(base)) { > ret = PTR_ERR(base); > goto err_drm_gem_vram_unpin_locked; > -- > 2.28.0 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization