From patchwork Mon Jan 16 20:58:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13103688 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 02D4BC46467 for ; Mon, 16 Jan 2023 20:59:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D343710E4D0; Mon, 16 Jan 2023 20:59:10 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2B6EE10E4D0 for ; Mon, 16 Jan 2023 20:59:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6vtZ2dhit4YIV0BW8xpsm1HI6evGTR9S+h1Hyo/oL7c=; b=pRfUtyGnpyn0wZsbstsvNQj8oF XUAVOci1gEmUM9tq8LSlnFrSlrdxp4VrUw7DxeKkE9XHO8NhtHkxs7r8lEsukghLTnFJBFC3kKVf+ NjgBMzuHmcMiEBIIZ920LAvNsYYD85qKUFszYcMwTuHhRGzkhmat4o9WFU80SNPLNhQT7On7iPj4/ TCKMTS+obCElMmthzjuOrNrIW5M6DcRcYPlvdWFCs4BD+rayQbUpppL05Fif90xHcv64Dwy2DM/yH ehEpu1VtVn4UCRvkhd9rXaykNa3tg4S+2cu9WzzjPdw9TzeBGntJXCVKU35LRgO5IFEOSSO0TZLc4 WoSJOggw==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pHWZK-00A7qv-Ri; Mon, 16 Jan 2023 21:59:03 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Rodrigo Siqueira , Melissa Wen , Haneen Mohammed , Daniel Vetter , David Airlie Subject: [PATCH 1/2] drm/vkms: Use drmm_crtc_init_with_planes() Date: Mon, 16 Jan 2023 17:58:00 -0300 Message-Id: <20230116205800.1266227-1-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 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: Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , =?utf-8?q?Andr=C3=A9_Alme?= =?utf-8?q?ida?= , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use drmm_crtc_init_with_planes() instead of drm_crtc_init_with_planes() to get rid of the explicit destroy hook in struct drm_crtc_funcs. Signed-off-by: Maíra Canal Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/vkms/vkms_crtc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c index 57bbd32e9beb..515f6772b866 100644 --- a/drivers/gpu/drm/vkms/vkms_crtc.c +++ b/drivers/gpu/drm/vkms/vkms_crtc.c @@ -161,7 +161,6 @@ static void vkms_atomic_crtc_reset(struct drm_crtc *crtc) static const struct drm_crtc_funcs vkms_crtc_funcs = { .set_config = drm_atomic_helper_set_config, - .destroy = drm_crtc_cleanup, .page_flip = drm_atomic_helper_page_flip, .reset = vkms_atomic_crtc_reset, .atomic_duplicate_state = vkms_atomic_crtc_duplicate_state, @@ -282,8 +281,8 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, struct vkms_output *vkms_out = drm_crtc_to_vkms_output(crtc); int ret; - ret = drm_crtc_init_with_planes(dev, crtc, primary, cursor, - &vkms_crtc_funcs, NULL); + ret = drmm_crtc_init_with_planes(dev, crtc, primary, cursor, + &vkms_crtc_funcs, NULL); if (ret) { DRM_ERROR("Failed to init CRTC\n"); return ret; From patchwork Mon Jan 16 20:58:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 13103689 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 5A15DC54EBE for ; Mon, 16 Jan 2023 20:59:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D94210E4D3; Mon, 16 Jan 2023 20:59:14 +0000 (UTC) Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 140A410E4D0 for ; Mon, 16 Jan 2023 20:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=P/a98Y1hiLgZoKaWu2srN8xeCFZMSmpCw+x/OXnrcVM=; b=jB/TV8QOlm4RTc7m2DliB9Vjzz LrgoJ6bt+IHDVDElu5GovqJcK43TsrBUXX7pMUE8+48rbn3oujg6HzNoAE2eKSmg3gNU29hux8T9q 4ThVNfQ7byvPDg2yP11jq3haZxD1U/olw4RP1zR+7YzgR2ztfUKGIuzFzvFzcSAk4mwkhUqJ8zkdV w/EkuElpUGjIyNhjmKLq1wZlLOD8xLxZp6TGcZ6pMwOMt7siiFDaJg83L8bq1ch2Mt2B/DtT4OicH llakCIBGcslYzhJ3lYd5FaP91ASuMcfKLPg4/S5i6BE6nERtElWMBJVMCM9E6xRGS4V47a66TzjfD LPjlBqXA==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pHWZO-00A7qv-KE; Mon, 16 Jan 2023 21:59:07 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Rodrigo Siqueira , Melissa Wen , Haneen Mohammed , Daniel Vetter , David Airlie Subject: [PATCH 2/2] drm/vkms: Use drmm_mode_config_init() Date: Mon, 16 Jan 2023 17:58:01 -0300 Message-Id: <20230116205800.1266227-2-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116205800.1266227-1-mcanal@igalia.com> References: <20230116205800.1266227-1-mcanal@igalia.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: Melissa Wen , =?utf-8?q?Ma=C3=ADra_Canal?= , =?utf-8?q?Andr=C3=A9_Alme?= =?utf-8?q?ida?= , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use drmm_mode_config_init() instead of drm_mode_config_init(), as it allows us to assure that the resource will be properly cleaned. Signed-off-by: Maíra Canal Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/vkms/vkms_drv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c index 6d3a2d57d992..e3c9c9571c8d 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -133,8 +133,12 @@ static const struct drm_mode_config_helper_funcs vkms_mode_config_helpers = { static int vkms_modeset_init(struct vkms_device *vkmsdev) { struct drm_device *dev = &vkmsdev->drm; + int ret; + + ret = drmm_mode_config_init(dev); + if (ret) + return ret; - drm_mode_config_init(dev); dev->mode_config.funcs = &vkms_mode_funcs; dev->mode_config.min_width = XRES_MIN; dev->mode_config.min_height = YRES_MIN;