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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 30F10C27C76 for ; Wed, 25 Jan 2023 09:18:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8497C10E0DC; Wed, 25 Jan 2023 09:18:53 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id DEC6410E760 for ; Wed, 25 Jan 2023 09:18:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674638331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a55Ot/a9auPBUYlSWbJ1dfW1qxB2YBfP2IFn3I6erq0=; b=i4Bk1y7wEjdMmMlZ1aCRAaXrIgNNDoJu/09QznCK3ylbnGmubRdovTo0Ywcdada44NpZ9U UwhC6iHScBw1Vq5yJg2+kt0pKMHEmmoiiXxrcVw+4pPrXJ/sTl/pXcTOGktAlnPNkR+0Mn nB0AH/6isoe37VrZhf6uPfi0NwEHSnY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-283-6r9N9_VFPzCz5uVCNkix_g-1; Wed, 25 Jan 2023 04:18:49 -0500 X-MC-Unique: 6r9N9_VFPzCz5uVCNkix_g-1 Received: by mail-wm1-f72.google.com with SMTP id fl5-20020a05600c0b8500b003db12112fdeso10641583wmb.5 for ; Wed, 25 Jan 2023 01:18:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a55Ot/a9auPBUYlSWbJ1dfW1qxB2YBfP2IFn3I6erq0=; b=zIA3S/U+AcS7j09ZhBPCHAF5TXYxgvEM4yn3qXkerQ42y1xVoCS+s8+47OYrp5k6sq CDslBPBlNnHT/H2SdkDcbumidaQ2vb5g0BHD4XSVSgR1BbJoy7MYe2zG+TJE6CrwBx8B v69KbrPALRmYrEeZrlNScx3ISHPXM0lFAKRAizU6oBtrs4CffZkJrHVDO7qJYMo1gipk 4enriW66y85rGTHc+fRUeHcYwE3vike+FOBuH5Nyg+yjGtHinoz07ln6MN6ujjPZ+KVI J8zN8xxD9PaLkgb3tMCVe5Sigmaa35vp2X+YWgz5qWxbGgUwYbaU4PF+74iNu9ZwtQLO UT/A== X-Gm-Message-State: AFqh2kqXV+r1G4UK833Kdcsvtd6nMDIw72hbp7JAN2LBPsPmSWq+VoVx gZuU8in+iSnOx9vYURBN4P9PdFRs3y0RbYFPN4lx4a050w4Z7ujlpLVEbO0x8+9Rkaf2laSEcL+ DpbLngvgwe/QTOK0BsqIXTYzM+QgU X-Received: by 2002:adf:feca:0:b0:2bf:9582:1378 with SMTP id q10-20020adffeca000000b002bf95821378mr16119708wrs.37.1674638328234; Wed, 25 Jan 2023 01:18:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXsMVsply5zUceDY+rfGRdP7xOLgJXzgPpsW/TV5uP5Pe3bOpgzxt5mZhJQXuF/HpRE9cQuOiw== X-Received: by 2002:adf:feca:0:b0:2bf:9582:1378 with SMTP id q10-20020adffeca000000b002bf95821378mr16119688wrs.37.1674638328019; Wed, 25 Jan 2023 01:18:48 -0800 (PST) Received: from [192.168.1.130] (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id bj7-20020a0560001e0700b002bfb5618ee7sm2235669wrb.91.2023.01.25.01.18.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Jan 2023 01:18:47 -0800 (PST) Message-ID: <2a007c84-1dd6-ed8a-39ac-8c7c070513f3@redhat.com> Date: Wed, 25 Jan 2023 10:18:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 To: Thomas Zimmermann , airlied@gmail.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org References: <20230124134010.30263-1-tzimmermann@suse.de> <20230124134010.30263-4-tzimmermann@suse.de> From: Javier Martinez Canillas In-Reply-To: <20230124134010.30263-4-tzimmermann@suse.de> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Intel-gfx] [PATCH v2 03/10] drm/fb-helper: Introduce drm_fb_helper_unprepare() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, freedreno@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 1/24/23 14:40, Thomas Zimmermann wrote: > Move the fb-helper clean-up code into drm_fb_helper_unprepare(). No > functional changes. > > v2: > * declare as static inline (kernel test robot) > > Signed-off-by: Thomas Zimmermann > --- > drivers/gpu/drm/drm_fb_helper.c | 14 +++++++++++++- > include/drm/drm_fb_helper.h | 5 +++++ > 2 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index c5c13e192b64..4379bcd7718b 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -435,6 +435,18 @@ void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, > } > EXPORT_SYMBOL(drm_fb_helper_prepare); > > +/** > + * drm_fb_helper_unprepare - clean up a drm_fb_helper structure > + * @fb_helper: driver-allocated fbdev helper structure to set up > + * > + * Cleans up the framebuffer helper. Inverse of drm_fb_helper_prepare(). > + */ > +void drm_fb_helper_unprepare(struct drm_fb_helper *fb_helper) > +{ > + mutex_destroy(&fb_helper->lock); > +} I like that we have an _unprepare that is the inverse of the _prepare, but since is only destroying the mutex, maybe is an unneeded indirection level? Or do you plan to add more cleanup to that _unprepare function? Otherwise I would just make it an inline function. > +EXPORT_SYMBOL(drm_fb_helper_unprepare); > + Does it have to be an exported symbol? AFAICT the only user for now is the drm_fb_helper_fini() function, so the function could be a static inline. [...] > diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h > index f443e1f11654..39710c570a04 100644 > --- a/include/drm/drm_fb_helper.h > +++ b/include/drm/drm_fb_helper.h > @@ -230,6 +230,7 @@ drm_fb_helper_from_client(struct drm_client_dev *client) > #ifdef CONFIG_DRM_FBDEV_EMULATION > void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, > const struct drm_fb_helper_funcs *funcs); > +void drm_fb_helper_unprepare(struct drm_fb_helper *fb_helper); > int drm_fb_helper_init(struct drm_device *dev, struct drm_fb_helper *helper); > void drm_fb_helper_fini(struct drm_fb_helper *helper); > int drm_fb_helper_blank(int blank, struct fb_info *info); > @@ -296,6 +297,10 @@ static inline void drm_fb_helper_prepare(struct drm_device *dev, > { > } > > +static inline void drm_fb_helper_unprepare(struct drm_fb_helper *fb_helper) > +{ > +} > + And you should be able to remove this stub if you limit the scope of the helper. No strong opinion though. So if you prefer to keep it as is, feel free to add: Reviewed-by: Javier Martinez Canillas -- Best regards, Javier Martinez Canillas Core Platforms Red Hat