From patchwork Tue Mar 25 17:24:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 14029300 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 A3683C3600B for ; Tue, 25 Mar 2025 17:24:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0338510E5CC; Tue, 25 Mar 2025 17:24:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="MGa6RKil"; dkim-atps=neutral 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 1611610E5C7 for ; Tue, 25 Mar 2025 17:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742923470; 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=fJiXdpIGTwXcm1LoDXxfl4Gs+ELqOtdGET7nsd9L1IM=; b=MGa6RKilODmNcX/0iGORY8S7DtjZz8HW5NEE5/4Y44RI04Bv1Qp8946qus78thHAoIxlwA E21WJdSaltLUZp7e71tNU0btyt7luFARXl6iFi4TNld2cO2UuYG24Vk2tm9dU457f+wMwf r7RbBzXtsmBPMKOjiURv39wEp4Nk5P4= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-311-N6ZnEp8WP4yQiY0w38hhAA-1; Tue, 25 Mar 2025 13:24:23 -0400 X-MC-Unique: N6ZnEp8WP4yQiY0w38hhAA-1 X-Mimecast-MFC-AGG-ID: N6ZnEp8WP4yQiY0w38hhAA_1742923462 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 14865180049D; Tue, 25 Mar 2025 17:24:22 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.186]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E5971180A802; Tue, 25 Mar 2025 17:24:19 +0000 (UTC) From: Anusha Srivatsa Date: Tue, 25 Mar 2025 13:24:10 -0400 Subject: [PATCH 3/5] drm/panel: get/put panel reference in drm_panel_add/remove() MIME-Version: 1.0 Message-Id: <20250325-b4-panel-refcounting-v1-3-4e2bf5d19c5d@redhat.com> References: <20250325-b4-panel-refcounting-v1-0-4e2bf5d19c5d@redhat.com> In-Reply-To: <20250325-b4-panel-refcounting-v1-0-4e2bf5d19c5d@redhat.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Luca Ceresoli , Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1742923451; l=1117; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=jaQNQ/kuDtEGuJTKiK0Rwf99pImE3NiWoOT21bZR5zA=; b=xeQemeTWiqshaEsVEFDP+ZHuaVq2kRHLh8DorV3VzuPa2lvVBlT+CaGhN568POE1NS8p1C/cT wwLahBqcoYZBat3s+c6Ls5f80RRtqhxNxIn8neEJF1gSOvedhJcHCgd X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Take the panel reference and put it back as required using the helpers introduced in previous patch. drm_panel_add() and drm_panel_remove() add a panel to the global registry and removes a panel respectively, use get() and put() helpers to keep up with refcounting. Signed-off-by: Anusha Srivatsa Reviewed-by: Luca Ceresoli --- drivers/gpu/drm/drm_panel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 079c3c666a2ddc99a0051d1a3c9ba65d986dd003..11a0415bc61f59190ef5eb378d1583c493265e6a 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -79,6 +79,7 @@ EXPORT_SYMBOL(drm_panel_init); */ void drm_panel_add(struct drm_panel *panel) { + drm_panel_get(panel); mutex_lock(&panel_lock); list_add_tail(&panel->list, &panel_list); mutex_unlock(&panel_lock); @@ -96,6 +97,7 @@ void drm_panel_remove(struct drm_panel *panel) mutex_lock(&panel_lock); list_del_init(&panel->list); mutex_unlock(&panel_lock); + drm_panel_put(panel); } EXPORT_SYMBOL(drm_panel_remove);