From patchwork Fri Apr 29 18:51:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12832612 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 6FB75C433F5 for ; Fri, 29 Apr 2022 18:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+S5WtozZkzuWpXpjQxXJQ/zyGb4yoSMbOlRYcbvsT6M=; b=Y96j0hRI3Vgses mcRe4puauU3v8e93/+XpNp8SLd5f6bKNRUKfFKcdoEirT0W0TQdqcdtIMKOcFMZLQICRhDDlaVGMx jtxHYKWxL5F6cbtqIQhwIWnnJgYt/p9gijt5yODXai7Ivb8SA+0zXqkSAFSgIFUyogJTx9Km01PxN OGHhqISckdeQLZwGMNWfw0YWxj/imsLNF96DNdInk3m4xvDwhSoIXdnBw5q3bILx3bHWU86Vu3wvN 6agFhwaYeb097/nyViWAF/8EEilZbFn9WHjYtDqI+8BpYHIcKeB7dchFQdZiadQR8VZWVeBUN+amt oJmrAIFDMr6jXMLJAG5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVjP-00CF97-Jv; Fri, 29 Apr 2022 18:52:43 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVis-00CEyJ-Fm for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2022 18:52:14 +0000 Received: by mail-lf1-x12d.google.com with SMTP id p10so15563047lfa.12 for ; Fri, 29 Apr 2022 11:52:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=egoM2XNXIqCFT4+22sOj5Td+05iys3AKcQL89KtNa7Y=; b=skwtRUUkWT/EYLdN443is8LXG02fqfEXAigHCT4YqvC/QvQc0HjYZKLkJHNxf1V9QV jP6pCTYXh9TTvGYLBRzsUanMufNk1twjqWHMNyKtXDiKWKGkY3jDz6+OZDGypy/TJTqa +fDQN6wPUEU4PAxtUbg4jb0C1ylEo6KsPEOoKOSOX3paEMpfsT9/guSG9JBnDhYxwHOg ITKXhlGnYZvGD3GdaZM8SB6YHUj+Jka06c4nrqf1R7siWQq1v3NSWNQzHfesx9+JM5P4 6b/48SP2xRRbHdZQNdhRZStKmFm2v/lCdUnFSehFsx11G2lAbChaAo5GrJj78ulN/Lxu eQfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=egoM2XNXIqCFT4+22sOj5Td+05iys3AKcQL89KtNa7Y=; b=a9fEIU33csJ0N3tvP7YPYEbXpBCc2W4B8wjsGSL/b+HmOmjA6c0AeFhiDegKW/RuHx ka+0z5VGg7sLQ50gt91nN9lhgk2INiWpM/qGC/5uHhvXfqLasU93Js7Bd/r7cu+I62Rt cVYiChHaCph8R+l30/NiR0VGTpZ2aMloXJNHeakN5KIXA46Wqfd9EJidFqTB/4HYkXQT ngrk9QgJ5uyQjVX3bMhHG1fWKY5aVAeuuPjfbt4oUIXYBtjjc2Xbrct2yX68CWjDLrbC Mr0W3TX5W/LqvilsiSPACyBQnNwImTbYR3bZ3qoL3uNFxuLxjOQgNW+XRSC403n3uFCS /uRw== X-Gm-Message-State: AOAM5305okGrMXvgOpO3m2bzB3Xnei76Ura908qZxM9C2Z3jZPDybEU9 Gnm80aSlb4vl3yCVMQWxdnyT0A== X-Google-Smtp-Source: ABdhPJyjCsbQEtPyBhi3kbQoUQtQQ4PYG8E9Jw9FZt0MDn+fGgl5lwgg1u2usJx/LpkmGJqDdvO7ag== X-Received: by 2002:a05:6512:3290:b0:472:b9c:751 with SMTP id p16-20020a056512329000b004720b9c0751mr394067lfe.591.1651258320849; Fri, 29 Apr 2022 11:52:00 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id z25-20020a19e219000000b00472230888a5sm295313lfg.121.2022.04.29.11.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 11:52:00 -0700 (PDT) From: Dmitry Baryshkov To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurentiu Palcu , Lucas Stach , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Clark , Sean Paul , Abhinav Kumar , Tomi Valkeinen Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH v1 1/7] drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini() Date: Fri, 29 Apr 2022 21:51:51 +0300 Message-Id: <20220429185157.3673633-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> References: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220429_115210_578676_EEC735EC X-CRM114-Status: GOOD ( 11.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Merge drm_kms_helper_poll_disable() and drm_kms_helper_poll_fini() code into a common helper function. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_probe_helper.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 682359512996..204f6999113f 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -754,6 +754,17 @@ bool drm_kms_helper_is_poll_worker(void) } EXPORT_SYMBOL(drm_kms_helper_is_poll_worker); +static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini) +{ + if (!dev->mode_config.poll_enabled) + return; + + if (fini) + dev->mode_config.poll_enabled = false; + + cancel_delayed_work_sync(&dev->mode_config.output_poll_work); +} + /** * drm_kms_helper_poll_disable - disable output polling * @dev: drm_device @@ -770,9 +781,7 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker); */ void drm_kms_helper_poll_disable(struct drm_device *dev) { - if (!dev->mode_config.poll_enabled) - return; - cancel_delayed_work_sync(&dev->mode_config.output_poll_work); + drm_kms_helper_poll_disable_fini(dev, false); } EXPORT_SYMBOL(drm_kms_helper_poll_disable); @@ -810,11 +819,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_init); */ void drm_kms_helper_poll_fini(struct drm_device *dev) { - if (!dev->mode_config.poll_enabled) - return; - - dev->mode_config.poll_enabled = false; - cancel_delayed_work_sync(&dev->mode_config.output_poll_work); + drm_kms_helper_poll_disable_fini(dev, true); } EXPORT_SYMBOL(drm_kms_helper_poll_fini); From patchwork Fri Apr 29 18:51:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12832614 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 11F12C433F5 for ; Fri, 29 Apr 2022 18:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nkHr0V8APdIvWbk+RiLG3BFQMO6lYmbkotE/iYErhrg=; b=xboj36NT781ik5 CQsDithoQYQe1cTM1HSIWKEIl+c8zbU3mN0NN+15eG6UHXR1neXYzjjKqrV8pVigRjKEyr6fRUNot oiwOtTj22XYD/GeJzVrBl8JPi92rb+bKd+5igTrwUgWn1q+boFNQ7kWFUxS5HYKCEVoQSq+te5uen NFS4+h3sk6Gh8wE5UwXDW9t4gpj/in8MraoxHZvbOdPjHc23MNbkf3yR218HG3Ya1IWyqkcgJTj9H JSw3qU3qzS1a/AE7OrH/0awcSJBYks9aocCTWYNiQE4jCRe9OjhZ24ehdsOppxCcoaqEYhWazc8LE ZdPevxdXjIaWROEK/ddg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVjr-00CFIM-85; Fri, 29 Apr 2022 18:53:11 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVis-00CEyK-Pe for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2022 18:52:15 +0000 Received: by mail-lf1-x131.google.com with SMTP id p10so15563127lfa.12 for ; Fri, 29 Apr 2022 11:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mNmsSu5EFMsnDMxNTzSovNKF0T/u6pITv3O7/Fgf9Jc=; b=McZLPyglK/9tU+mYeWuO/1tmJahwwBbj4r7sgq0WslepjKDaME/CtmzyGsyk/VBQNu NaLRMyuLPEsgsYFDvZJ3N8sm1P99XtaZgTGrTECvw4GLONdP13VhuY6RRhH3ahExtPho PnHgPwe3N6BvUL5LV4le75QjdS0lbr0Ua+9uHg0koB0pLNOPJleIXBDx5G57ncei+eF8 F7zDQMb7Imr9GBi19tFIM6D3LSKFp1lk1PS1Yy1oYl3Sde6d/HQeaDodZ8NEfYVPY1VQ tZHjvz4JnoFMUPlYB4uBZR0fcEV6Gmrh3mNPd4DfmZhqAMr1DWwsjULDLGoF5WXvnCOQ HXgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mNmsSu5EFMsnDMxNTzSovNKF0T/u6pITv3O7/Fgf9Jc=; b=SPGMkenN+8DEc/3mxK0wIaQ4zzl4mcjpVrMJeWLyXA3MEaz1M5SWRputGYi46db8ly ibAJ2Gt8J2SHR621YklyYv90snhEMtqEDEsoyMfjgVgalVx9uv40oi2EUAOdhTBqb9RG whp2XZno+M1/MMOVYQhwHgk+jZ9hHJj0DvxvVaJminsn6r6CF1PT9yvNJeQ+KB/aM56b tGUMbyN81XdCp+dlpsfr8ggBSAaaL19NDHtC1x4x0KAdVNyAoSviljPL6CjM5A4q/Ut4 wJ00UKjeXaXtWqUed5xKksQtlzqLXTZsMcSCvbyhQbCIDL/YKoNk0DrWUByXgbIQVo+O 3aZw== X-Gm-Message-State: AOAM5332kU2GGcTqMuZUF48JKOuji3iQsuxZjj6446TDCb/otndmsLzP 3KpXXWJywwB0DasqZQ7U94eIHA== X-Google-Smtp-Source: ABdhPJytbJr6ns9XOXOBR4HEVk85eizRt7BmJyw1M+DX9Ve/Bpz0VhLYSogBpCzoLFACGwmxzaJ6vg== X-Received: by 2002:a05:6512:3c86:b0:472:1ea6:52bb with SMTP id h6-20020a0565123c8600b004721ea652bbmr440553lfv.334.1651258321866; Fri, 29 Apr 2022 11:52:01 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id z25-20020a19e219000000b00472230888a5sm295313lfg.121.2022.04.29.11.52.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 11:52:01 -0700 (PDT) From: Dmitry Baryshkov To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurentiu Palcu , Lucas Stach , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Clark , Sean Paul , Abhinav Kumar , Tomi Valkeinen Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH v1 2/7] drm/probe-helper: enable and disable HPD on connectors Date: Fri, 29 Apr 2022 21:51:52 +0300 Message-Id: <20220429185157.3673633-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> References: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220429_115210_894079_1F006876 X-CRM114-Status: GOOD ( 13.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Intruct two drm_connector_helper_funcs: enable_hpd() and disable_hpd(). They are called by drm_kms_helper_poll_enable() and drm_kms_helper_poll_disable() (and thus drm_kms_helper_poll_init() and drm_kms_helper_poll_fini()) respectively. This allows drivers to rely on drm_kms_helper_poll for enabling and disabling HPD detection rather than doing that manually. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_probe_helper.c | 19 +++++++++++++++++++ include/drm/drm_modeset_helper_vtables.h | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 204f6999113f..7fef16cd80ff 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -251,6 +251,12 @@ void drm_kms_helper_poll_enable(struct drm_device *dev) drm_connector_list_iter_begin(dev, &conn_iter); drm_for_each_connector_iter(connector, &conn_iter) { + const struct drm_connector_helper_funcs *funcs = + connector->helper_private; + + if (funcs && funcs->enable_hpd) + funcs->enable_hpd(connector); + if (connector->polled & (DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT)) poll = true; @@ -756,12 +762,25 @@ EXPORT_SYMBOL(drm_kms_helper_is_poll_worker); static void drm_kms_helper_poll_disable_fini(struct drm_device *dev, bool fini) { + struct drm_connector *connector; + struct drm_connector_list_iter conn_iter; + if (!dev->mode_config.poll_enabled) return; if (fini) dev->mode_config.poll_enabled = false; + drm_connector_list_iter_begin(dev, &conn_iter); + drm_for_each_connector_iter(connector, &conn_iter) { + const struct drm_connector_helper_funcs *funcs = + connector->helper_private; + + if (funcs && funcs->disable_hpd) + funcs->disable_hpd(connector); + } + drm_connector_list_iter_end(&conn_iter); + cancel_delayed_work_sync(&dev->mode_config.output_poll_work); } diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index fdfa9f37ce05..7fa67017d303 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h @@ -1143,6 +1143,28 @@ struct drm_connector_helper_funcs { */ void (*cleanup_writeback_job)(struct drm_writeback_connector *connector, struct drm_writeback_job *job); + + /** + * @enable_hpd: + * + * Enable hot-plug detection for the connector. + * + * This operation is optional. + * + * This callback is used by the drm_kms_helper_poll_enable() helpers. + */ + void (*enable_hpd)(struct drm_connector *connector); + + /** + * @disable_hpd: + * + * Disable hot-plug detection for the connector. + * + * This operation is optional. + * + * This callback is used by the drm_kms_helper_poll_disable() helpers. + */ + void (*disable_hpd)(struct drm_connector *connector); }; /** From patchwork Fri Apr 29 18:51:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12832609 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D168EC433EF for ; Fri, 29 Apr 2022 18:53:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dU6fZmvof9f/ge3+7soiKElnGxSVaZg0a7zGtYGqZqg=; b=BZ1uOxoPJEOyBA 0+oK5iBRxfq7iaQR/86trxQ5UyLgsJIW5aNTr3EiXyZfRkd/J252o4g6ylPv00n+dAgyjgROP3TsA oaoixN8wV/RPGEpG+hz7OD0Fu1GBAcaZ1m6q/K9bDjgvH6ytZiphdbs66ev+4J4O+GH5oGvnn4PRr jrOirgQagQE33V517gDYA0UsGSkEWpjEhI35NlsjzzLr1XuJ+zUYsu9VFOKz7PQF0k+vZmGPFZ96Q OBnKmJ8ibehxvUFDppWmzANtiYl1eku55ukatei/KSxCtjPPIcZoXe8QOhMa3i3Egfq/fhrIjPyWO yAnSFFaCYZSdfOiQ8qTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkViw-00CF1v-4P; Fri, 29 Apr 2022 18:52:14 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVis-00CEyL-4R for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2022 18:52:11 +0000 Received: by mail-lf1-x12a.google.com with SMTP id w1so15596142lfa.4 for ; Fri, 29 Apr 2022 11:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0sz6Xf+FMEM6Pg9TYenwhocv3Ys8GJokg7Junnjnvhs=; b=P3bH5SyuxOC+W7nJIP8uFiQe8mfa57voGW/CujGwdt+uWBwVjW1y5jIQ0qwioyG8a5 z0XoyCQTmflVsbpvWWmnfyZSoAUrVOBSz+OUilUPh+oJKepu6NMiasv4yoF+Luv0X4eY sIoQZYtzjlcbAcsQ4ks5JVCZIexkyadB/BGybVVYx8pNJaZC6briTt4ejRa8N1hqiOeZ x06azzmpObZd/gZfhoKiqr4FhF8MqvQ6WRZpgNQUlgDauqHAlU+wTWl5BldqUvIpf7ZO VSwKGHeA8tVyaASkzh3ReNiFVS7G7nwLykrIYgBkZmuAuWsl0A/v/Z9QwOacS3xoIF9U k8lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0sz6Xf+FMEM6Pg9TYenwhocv3Ys8GJokg7Junnjnvhs=; b=VGE+SlrO4v5rZ/cjoygeXyUFvZxUM6qOOaKtdWL3PQhetwKfKmgTNYNzQ8pxp4OO3o E44LmcH9J1DvCGoM0BqpkjFaTE5OY1x0JxLUUytWGr2zRlCKQ8IRKEyvkSXykqup/c9L Pu/c8rS2R1bWJsoTOIzxRkkh6B0+xa8CKaIrHNrsMCaBQ78B0Wl/wSOudcOPBB/DHGPp N6N6YUxvrAEMm+gr10sWkLPldnFXn9fogb3h5DV877Mk6qrbbilFpUfXLt7nd7dEaxFa XJIPwTUicWaj+gXJl41krG8fiDWN0dXI8uyJEf2zWWX2Y7gWLVfrLv4PgzcDQ8y+y+kY 7ADQ== X-Gm-Message-State: AOAM532o9rEsTy49hC5x1xzVFvsztIWwLl3qLze1bSryjNg20xqd5vVo 3YjjDLBKGhAnJAybF3nFcs99Yg== X-Google-Smtp-Source: ABdhPJyFf6J2Z655udBCglne4L6bEQy6aXnOSp8JiHE9dIuE3sE2sj/KEZZXkudFN4tE22D7lR+/zQ== X-Received: by 2002:ac2:5d6a:0:b0:464:efd7:f964 with SMTP id h10-20020ac25d6a000000b00464efd7f964mr433509lft.70.1651258322849; Fri, 29 Apr 2022 11:52:02 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id z25-20020a19e219000000b00472230888a5sm295313lfg.121.2022.04.29.11.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 11:52:02 -0700 (PDT) From: Dmitry Baryshkov To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurentiu Palcu , Lucas Stach , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Clark , Sean Paul , Abhinav Kumar , Tomi Valkeinen Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH v1 3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement Date: Fri, 29 Apr 2022 21:51:53 +0300 Message-Id: <20220429185157.3673633-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> References: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220429_115210_233737_BE0CFF37 X-CRM114-Status: GOOD ( 13.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use drm_connector's helpers enable_hpd and disable_hpd to enable and disable HPD automatically by the means of drm_kms_helper_poll_* functions. As the drm_bridge_connector_enable_hpd() and drm_bridge_connector_disable_hpd() functions are now unused, replace them with stubs to ease driver migration. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_bridge_connector.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c index 60923cdfe8e1..1592da3b9403 100644 --- a/drivers/gpu/drm/drm_bridge_connector.c +++ b/drivers/gpu/drm/drm_bridge_connector.c @@ -136,6 +136,11 @@ static void drm_bridge_connector_hpd_cb(void *cb_data, * This is typically used by display drivers in their resume handler. */ void drm_bridge_connector_enable_hpd(struct drm_connector *connector) +{ +} +EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd); + +static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector) { struct drm_bridge_connector *bridge_connector = to_drm_bridge_connector(connector); @@ -145,7 +150,6 @@ void drm_bridge_connector_enable_hpd(struct drm_connector *connector) drm_bridge_hpd_enable(hpd, drm_bridge_connector_hpd_cb, bridge_connector); } -EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd); /** * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the @@ -156,6 +160,11 @@ EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd); * This is typically used by display drivers in their suspend handler. */ void drm_bridge_connector_disable_hpd(struct drm_connector *connector) +{ +} +EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd); + +static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector) { struct drm_bridge_connector *bridge_connector = to_drm_bridge_connector(connector); @@ -164,7 +173,6 @@ void drm_bridge_connector_disable_hpd(struct drm_connector *connector) if (hpd) drm_bridge_hpd_disable(hpd); } -EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd); /* ----------------------------------------------------------------------------- * Bridge Connector Functions @@ -305,6 +313,8 @@ static int drm_bridge_connector_get_modes(struct drm_connector *connector) static const struct drm_connector_helper_funcs drm_bridge_connector_helper_funcs = { .get_modes = drm_bridge_connector_get_modes, /* No need for .mode_valid(), the bridges are checked by the core. */ + .enable_hpd = _drm_bridge_connector_enable_hpd, + .disable_hpd = _drm_bridge_connector_disable_hpd, }; /* ----------------------------------------------------------------------------- From patchwork Fri Apr 29 18:51:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12832610 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 DFD23C433F5 for ; Fri, 29 Apr 2022 18:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zC608i8iNUirtJNGIvufshDVLcz44N2psqvMBEtXgmM=; b=rZCfvPWa9ZmCxW N3LXv7kux3rIEIDfDgVynPGbJLSCg13XqOE7CH8IMZAyZYA/w6bDFs9pmnc79H2TKkeZIMVn2jVE5 Pym6ECdfVQY8b+oKDIX+okhzroY6hGk6QmU23iihWMe0vq7oJkmTivq+hbk5/d/VzDsHySQhLK40i odfpBgr3JhYLYUayASPgo+/IYoItqZNkD9J9eulLOETTymEwmd+9tfXt0ReORwh9G61OMaep+Utca 5lA2T7KwLC/iYxzpXum6nKD8Vg4pkYVhNmo05DZrEzWiu0YE4CIRxSYjBEBFZoqRqEXmLQLsSuHj5 ApwCF5ufqj52om+w/Wbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVj7-00CF5p-TY; Fri, 29 Apr 2022 18:52:26 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVis-00CEyQ-4U for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2022 18:52:14 +0000 Received: by mail-lj1-x232.google.com with SMTP id l19so11556324ljb.7 for ; Fri, 29 Apr 2022 11:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AyU7BonIGwyxpeC2bOo+UtiaB+LwIrj5CM8fTIllsQE=; b=P92cNaj0ZHc/r99hsBpAnOLZGkmzH1bBE9tBUT1eqad0V6Fma0kGCy/grop1zEbclq WYpxnm+PON4K2dLSohp8oXPqt4qJuAbccZrNj19cNjvyhzLHshfECAZjbCdzYNOCpZdL rz1ZktAIHbvYOtTHuR7Hp2VkGVWnEjzVQL7LJBL/NwDLFkHArFChkCWTFC01UlBpEKt0 27Xfh0xECWPOU/TwlI7ghByATy3l5HvYvdl+45uNfFZUftr4xkXKUK3OC2Xwqq6tH1rf d/LbG6Q1ISIfO69URuzNhPM2PUAgekJLwr8+ZLzzgqVm2V5VJwA6cirRR4YCFs87d+c3 0Lgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AyU7BonIGwyxpeC2bOo+UtiaB+LwIrj5CM8fTIllsQE=; b=IEVeJkM5D16MvMjw0ZntoB3KJjUUZbZkEMdza1qv+6UImQo9nWbw6pORJ2ukWEPiih qyJZeITl5RcPPpQAim1oNWzOVhOKirlLnodBwz7/Y5NZnYqZidfz5uAinMktL7KOC1fR 01ZhJz3LNz7L68rd/4+AwbuRbTejJh75LoKyf8oTo99dwPJ89B/b1TlvtDgMP0Wu+s0s VGqWrWKW/rz3hZpJxlUNFE0+HLmMwplsXebT2NcwWbmgw2kMtyH4vMIz3vfqK5BDs6GP /N8md0uBZixO5Bz4K/bzibNlxswr2H/Ln9WqiSB2fxQGl3+dewk1Q8bDgvzPsBJ3+i/i wt8Q== X-Gm-Message-State: AOAM5324K33+N/U51JiM5rBvYm2fh0VgPMnl/iPIM9iJ0F6GUACIdetx +MQsu8Smho6eYAs+zHfilpTg/A== X-Google-Smtp-Source: ABdhPJyZHl0WHe7eWa5m4Kb1bDgSwHmoXE/Zb1qZAcNGCEnxYagQPlTox6AC3dQdDtaeyeq6dSzjGQ== X-Received: by 2002:a2e:8917:0:b0:24f:3bb6:b399 with SMTP id d23-20020a2e8917000000b0024f3bb6b399mr382679lji.246.1651258324208; Fri, 29 Apr 2022 11:52:04 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id z25-20020a19e219000000b00472230888a5sm295313lfg.121.2022.04.29.11.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 11:52:03 -0700 (PDT) From: Dmitry Baryshkov To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurentiu Palcu , Lucas Stach , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Clark , Sean Paul , Abhinav Kumar , Tomi Valkeinen Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH v1 4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd() Date: Fri, 29 Apr 2022 21:51:54 +0300 Message-Id: <20220429185157.3673633-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> References: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220429_115210_254954_7737E8F2 X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The functionality of drm_bridge_connector_enable_hpd() and drm_bridge_connector_disable_hpd() is provided automatically by the drm_kms_poll helpers. Stop calling these functions manually. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/imx/dcss/dcss-dev.c | 4 ---- drivers/gpu/drm/imx/dcss/dcss-kms.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c index c849533ca83e..62c5f7cd5906 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-dev.c +++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c @@ -254,8 +254,6 @@ int dcss_dev_suspend(struct device *dev) struct dcss_kms_dev *kms = container_of(ddev, struct dcss_kms_dev, base); int ret; - drm_bridge_connector_disable_hpd(kms->connector); - drm_mode_config_helper_suspend(ddev); if (pm_runtime_suspended(dev)) @@ -289,8 +287,6 @@ int dcss_dev_resume(struct device *dev) drm_mode_config_helper_resume(ddev); - drm_bridge_connector_enable_hpd(kms->connector); - return 0; } #endif /* CONFIG_PM_SLEEP */ diff --git a/drivers/gpu/drm/imx/dcss/dcss-kms.c b/drivers/gpu/drm/imx/dcss/dcss-kms.c index 9b84df34a6a1..614073eb70b0 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-kms.c +++ b/drivers/gpu/drm/imx/dcss/dcss-kms.c @@ -142,8 +142,6 @@ struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss) drm_kms_helper_poll_init(drm); - drm_bridge_connector_enable_hpd(kms->connector); - ret = drm_dev_register(drm, 0); if (ret) goto cleanup_crtc; @@ -153,7 +151,6 @@ struct dcss_kms_dev *dcss_kms_attach(struct dcss_dev *dcss) return kms; cleanup_crtc: - drm_bridge_connector_disable_hpd(kms->connector); drm_kms_helper_poll_fini(drm); dcss_crtc_deinit(crtc, drm); @@ -169,7 +166,6 @@ void dcss_kms_detach(struct dcss_kms_dev *kms) struct drm_device *drm = &kms->base; drm_dev_unregister(drm); - drm_bridge_connector_disable_hpd(kms->connector); drm_kms_helper_poll_fini(drm); drm_atomic_helper_shutdown(drm); drm_crtc_vblank_off(&kms->crtc.base); From patchwork Fri Apr 29 18:51:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12832615 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E83F2C433FE for ; Fri, 29 Apr 2022 18:54:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W8rcQIjyZc2EJSfLHaBmnL2tBNiZSJ+MgRN2rUcdwwg=; b=vCG4ACfXdKFlBO dSvevRuV8eavoy6GtyF2hyk2qJU0Grd/uOUkDmE3AoIhaclKrxGaWn4mmd4WpkgoP4oU7dMJTvP2Y i0KZC8Z7NPg62Qi70EU4eNoUxmaT5JVVPGCGpeH79xioZOer9h0qBb67KGujy69c0my7v8zQ61GP7 LP5xnVz9hFtiWQKxNpWc1Q1Q27PaZNYDDTw2iFJX+WmfJMcHEQk0jAPc9/0q/FY8cVlIoFhksj+uj 2oREa333blQbMY6a8It4veKdE8oNr2NGxuLvr60i1SFcAIZQ4K3jWdzw+j72WcrRxhQ36bhalU5AX nwHBS9E86am6Kt/SI+3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVkI-00CFV9-6C; Fri, 29 Apr 2022 18:53:38 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVis-00CEyR-Qx for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2022 18:52:15 +0000 Received: by mail-lf1-x134.google.com with SMTP id h29so8336197lfj.2 for ; Fri, 29 Apr 2022 11:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hjSZhFhF/WBNlx59PX4NcX4slNS4MZfzeRNT5ytZejs=; b=k7YLfZxbvtM5355pTD0NC0W3r4ppNFyePl/eewijAPJmmPuRZOuf01TBxYpR4jnWx3 o2I7fMHX55U5QFrUI5pAtWxayXrJwzIq0eM5rj8COJ3eN4ijcxrW90QD33kJpDS48V7a K2R7RBXdGjG281Y6ScUOryRfql9Z86/0OISsB8lxF44gU10f3CapzB+FRCIcODZE/tg0 4uve+Q+kV5xReWjP+2miP9fTdYh0/Wwcf/or5NFbfZqo8OJumuXlYlXbCegGluZkwaAj +IchpppaHq9FhQ8LuTy6T80SMqJNME9hcJVTl6r9F4W72EuFdPPGCdPpXqHCR2/LOC26 YY7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hjSZhFhF/WBNlx59PX4NcX4slNS4MZfzeRNT5ytZejs=; b=1pBYPtg9t5bhMyzS1vvMn2iJzfE3rvVvj26zS9ZFuBj3jMT5YluVAGUbtfbNv4+DQB /n8CcKeesXDzyvx70HnB9U4Q7FmHT2h1BYj+Z5KO7AFccVFBIv1X/VYYDoVdzhDhUwMH w3Veg1RQJj5jrKTRB16YXqmMAYGp0rDqVZBPsg8P9tq7MjWaoMjuZxcMkcsovV+kBrot 4rj2xhHkrTwuuvcd6n3ZRKnk10tm8fWmw2vNNyzgK/TBqvJV/AzD62EC3ib3p1z6SS4k yx6BpEIug4GoYW0hbCAE+6CjDp2NxNlfzWy1BKQ3VGDiQ4DrOnTHHD9olpkpXuVagPeq HyjQ== X-Gm-Message-State: AOAM5302S9DMb3BoM0DqpBDtNB5sYptxk0uIAnae7vuLcF96KA8Q8nfc fUWR2LDltAN0i563gfHFC/F6Wg== X-Google-Smtp-Source: ABdhPJzzf2Gqpio3FiOmbjIAFCoKFglhxH/wJqpGfDRxpm4zP2G1J1gbWPGUhYrluI3eZC4OE/CZ4A== X-Received: by 2002:a05:6512:3b2a:b0:472:2c74:2b48 with SMTP id f42-20020a0565123b2a00b004722c742b48mr420328lfv.277.1651258325147; Fri, 29 Apr 2022 11:52:05 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id z25-20020a19e219000000b00472230888a5sm295313lfg.121.2022.04.29.11.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 11:52:04 -0700 (PDT) From: Dmitry Baryshkov To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurentiu Palcu , Lucas Stach , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Clark , Sean Paul , Abhinav Kumar , Tomi Valkeinen Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH v1 5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd() Date: Fri, 29 Apr 2022 21:51:55 +0300 Message-Id: <20220429185157.3673633-6-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> References: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220429_115210_911449_E271FD24 X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The functionality of drm_bridge_connector_enable_hpd() and drm_bridge_connector_disable_hpd() is provided automatically by the drm_kms_poll helpers. Stop calling these functions manually. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/hdmi/hdmi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index cf24e68864ba..da889175dd86 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -317,8 +317,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi, goto fail; } - drm_bridge_connector_enable_hpd(hdmi->connector); - ret = msm_hdmi_hpd_enable(hdmi->bridge); if (ret < 0) { DRM_DEV_ERROR(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret); From patchwork Fri Apr 29 18:51:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12832616 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 28EEAC433EF for ; Fri, 29 Apr 2022 18:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=irNAMdAEFgazFzkQin0m+/ywRz1Eon7ncSGShNloRO8=; b=Nshr+sjUGVD8T1 l7DYwLLDsW8KQD3MuCntf/BJ/aQpO8E5YuuzE+uxL4yf3Vlrwfm451icmOiLhuITMtI4iynMqg5JL CKN1ADHMYxC4kxPA7IRAJSUCcVkWNjZgFlwg3kMKhir38GFOpCphLDfERyowwyBSLys8CfY96xRwF 6tFEBcSWpsUt/ksMMkV70M7SbbrRnxLv585pu7/m4G6YIHxKFOOXd9H3FsIVI3CnPQshthVnyBGe5 UikAE6nBKIPqKG33fCt4wxOen/iR4qY7U1qFHpFqLZxtSZo43CU0PUEtXRtD9zO1kew+eGAlkZ509 sbT6xm1IB4SVabSJZFGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVkb-00CFe6-Pv; Fri, 29 Apr 2022 18:53:57 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVit-00CEyc-Bu for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2022 18:52:16 +0000 Received: by mail-lf1-x130.google.com with SMTP id j4so15581262lfh.8 for ; Fri, 29 Apr 2022 11:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lqeu0gWL+fbuCou+DZo8aED2KhTyfiRcmIANTVXwORA=; b=F3fxtRfDEpSVXHZlP/WwK/IVfVqcq/oG9b9SN8h1W8LtnEJd3SM2+7KX3sB4vO1dUx fQEA2lTPMWME+JsnR0jbrqc/ctTE7cn8U71pSe7k9OyXsgA3OSD5Ae1vrfquhu6eBrES OqI6ACqg2WYTibjed7me1Cxpa+yWlA+E+7V+giepGgw/ynsOm1O3i2Y8ifWhwmukGNcz NYmNDlEmtQAoTJmZ2OqeP+H/EGgEPzkn+Ruum//XDh6H1PfwZsLtq2WJQYPf/XgoHdJ7 9Ed83Eic/hdHtb+ThZ2xuF+jUFKtlSEfOXCJVE341ecOpcRjjDTt6eTzWryIjmSFNZAY jgWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lqeu0gWL+fbuCou+DZo8aED2KhTyfiRcmIANTVXwORA=; b=Ook3ffC6o4Y8bRv1lY54nliw/PR1bIYdrQbjH+CWVvVoAbzuJ82KDtCtiUobfERs5o ZE0qpmw9Hfh29Lk/hIM0+oFIOehbgqcwAUsqe/qZR+aoTIFMxehENI2nME9v8H2HYzaD zaA9Y79kqnXgzK6mX5nvW7Tfi7g7xLg1Pcs7jwm8wZwZKWyhGqnjNO5O+Wl0l/JvKgCE U1m8M4pUy+NGB6N4WNfwKtmZTIt+H/AvfSfYWTKQvYkyTIa1z1Q/kYbccxaE3zCPSNtQ 5TwzqNz/ISCcMpodei+7kr9CFdi/Afz5J3MqESbeeSH+/7hkAf2ihtKnk3rgi7BlVFeC vVJQ== X-Gm-Message-State: AOAM531NI5DyfF2RpcbVSHidjt+vHpgiwzBsBXoFhZmYC6PB5WP/f4By k7vmjPXQR89aooowqjKUwDkYFg== X-Google-Smtp-Source: ABdhPJypKbEZWtx1y5Anvfkf2zXysSjtu5YU/Qrc3Zglyg4silcqJGbTm6SvkihY4hifXkIzm6xk+g== X-Received: by 2002:a05:6512:39c1:b0:471:b37e:fe5a with SMTP id k1-20020a05651239c100b00471b37efe5amr388736lfu.527.1651258325946; Fri, 29 Apr 2022 11:52:05 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id z25-20020a19e219000000b00472230888a5sm295313lfg.121.2022.04.29.11.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 11:52:05 -0700 (PDT) From: Dmitry Baryshkov To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurentiu Palcu , Lucas Stach , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Clark , Sean Paul , Abhinav Kumar , Tomi Valkeinen Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH v1 6/7] drm/omap: stop using drm_bridge_connector_en/disable_hpd() Date: Fri, 29 Apr 2022 21:51:56 +0300 Message-Id: <20220429185157.3673633-7-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> References: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220429_115211_447975_868418B0 X-CRM114-Status: GOOD ( 12.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The functionality of drm_bridge_connector_enable_hpd() and drm_bridge_connector_disable_hpd() is provided automatically by the drm_kms_poll helpers. Stop calling these functions manually. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/omapdrm/omap_drv.c | 41 ------------------------------ 1 file changed, 41 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index eaf67b9e5f12..699ed814e021 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -545,44 +545,6 @@ static void omap_modeset_fini(struct drm_device *ddev) drm_mode_config_cleanup(ddev); } -/* - * Enable the HPD in external components if supported - */ -static void omap_modeset_enable_external_hpd(struct drm_device *ddev) -{ - struct omap_drm_private *priv = ddev->dev_private; - unsigned int i; - - for (i = 0; i < priv->num_pipes; i++) { - struct drm_connector *connector = priv->pipes[i].connector; - - if (!connector) - continue; - - if (priv->pipes[i].output->bridge) - drm_bridge_connector_enable_hpd(connector); - } -} - -/* - * Disable the HPD in external components if supported - */ -static void omap_modeset_disable_external_hpd(struct drm_device *ddev) -{ - struct omap_drm_private *priv = ddev->dev_private; - unsigned int i; - - for (i = 0; i < priv->num_pipes; i++) { - struct drm_connector *connector = priv->pipes[i].connector; - - if (!connector) - continue; - - if (priv->pipes[i].output->bridge) - drm_bridge_connector_disable_hpd(connector); - } -} - /* * drm ioctl funcs */ @@ -782,7 +744,6 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) omap_fbdev_init(ddev); drm_kms_helper_poll_init(ddev); - omap_modeset_enable_external_hpd(ddev); /* * Register the DRM device with the core and the connectors with @@ -795,7 +756,6 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) return 0; err_cleanup_helpers: - omap_modeset_disable_external_hpd(ddev); drm_kms_helper_poll_fini(ddev); omap_fbdev_fini(ddev); @@ -822,7 +782,6 @@ static void omapdrm_cleanup(struct omap_drm_private *priv) drm_dev_unregister(ddev); - omap_modeset_disable_external_hpd(ddev); drm_kms_helper_poll_fini(ddev); omap_fbdev_fini(ddev); From patchwork Fri Apr 29 18:51:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 12832613 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E32D9C433EF for ; Fri, 29 Apr 2022 18:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oFY3PV8XVICxBTMsvA/4zg9LOgkOOsEXkW8IjY7WsQc=; b=wC2yT1rbf3QHQ+ 8qSyWmG2KHoQxKUG+KDwkAKCgf+fqBawzWHhdnFbUCa8pnJWzjN1njcO7XJvyFdHFSdQ3lGPnGbX+ SsbxGI1XTylb+yyCgCKbW25C51YDp72jK8B5pPEKEbNFiPJ7sIqr0oEbKW/n5rJ2J9lmw4Ddy/tGe 3+1mvyioP+0hlcB8HRm/IANwA3Vpp7r61lF992xyIPsw9nFt/ziuDAjr6F8t0EgCP2pN44MVRlwKV C4liAu92aheZfcAHJSBVV23UVGf281RHh/6GaR8VEmVim5ODiyE1xK5Ml7jzDMRJZvbFqBqIi64fi FoythXNnXj4+GXgWjIoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVjZ-00CFBh-C4; Fri, 29 Apr 2022 18:52:53 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkVis-00CEyi-Pa for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2022 18:52:15 +0000 Received: by mail-lf1-x131.google.com with SMTP id bu29so15669154lfb.0 for ; Fri, 29 Apr 2022 11:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UcCYVcTme16+uWpUP90xtTFpl/uKSWYcTwwPaiNEnH4=; b=qM8Xa/+knMRPfLTwlN+fR5Ci35dl6BlRHNoNMYX0hVxDfbUjon+grBnYTYSLc3wpKT x4zV6cHCKHtbc51lv2Ah2HUBs9k2H86hvUof04MJ+L1RWBgmtKiX1u9XICgIb4T3AWaJ m4FUPRzbY7leMHH75zT6l4BjTs5XX2FRI5CUANIwhQ7zdCt+NFhKOGFTpqUu6dfyHv6E E4XiPnOg22O0wCoqh1noIhgC01FYKxIVgoGqmFMWCxjXFP/2gHCiaRjXcYzL5MMYMF4x ymA6+KoQHsW5hk1e2FGsMk1QRstd2BiHSgXf9rG9TiNHEwN6aK1f8PzkltynBJS2R4sG ms2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UcCYVcTme16+uWpUP90xtTFpl/uKSWYcTwwPaiNEnH4=; b=mKfjIRhIxqUx4GCsIvAb/vtW0qzwYYbXDeIMQQv4EWkJQ+O5Te7+kmY80KDLCgN5EX 0MyBB4/W0otHSXNZUpKDyoRgKlb7KcKvgp73ALK5zjn4qu4jKqbso5ZtyPia7se9Kdon rJ5IwuDjdxHRBxGpKMLaH2DkKeZt1ovs6zyaaNG4MPgO3GqAf1cIyuaUvGqKb9kJ4BHn 0F6F2nzkk75SY3DSY43O1i4az0Eu7i9OO1tQKbWQzWiLaTdN+u+kf5tcx1RyH5aN/OIg KnGiP8qKt2JJ6P/nmB4I62ifnTbnr2fey+jCa94OV8byOFjW308JBkvTPdFSxfLNUgVl /H8g== X-Gm-Message-State: AOAM533SFMPj0cCa2TbDLA55AtbVT2+0VSAHUQuRlcSjGQql4tWZk2mt o39aShpKjRUJX1gPUEqZm5AArA== X-Google-Smtp-Source: ABdhPJxDM1J9ZFOYujHwlnlADYTDFV6bTMCQTzicA80l40xvHlgv3/pXMH1AjfPq7g134d5qn59tqw== X-Received: by 2002:ac2:52b4:0:b0:445:ba75:7513 with SMTP id r20-20020ac252b4000000b00445ba757513mr442866lfm.248.1651258326717; Fri, 29 Apr 2022 11:52:06 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id z25-20020a19e219000000b00472230888a5sm295313lfg.121.2022.04.29.11.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Apr 2022 11:52:06 -0700 (PDT) From: Dmitry Baryshkov To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Laurentiu Palcu , Lucas Stach , Philipp Zabel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rob Clark , Sean Paul , Abhinav Kumar , Tomi Valkeinen Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: [PATCH v1 7/7] drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd() Date: Fri, 29 Apr 2022 21:51:57 +0300 Message-Id: <20220429185157.3673633-8-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> References: <20220429185157.3673633-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220429_115210_889380_55F027CF X-CRM114-Status: GOOD ( 11.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now as all drivers stopped calling drm_bridge_connector_enable_hpd() and drm_bridge_connector_disable_hpd() it is safe to remove them complelely. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_bridge_connector.c | 25 ------------------------- include/drm/drm_bridge_connector.h | 2 -- 2 files changed, 27 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c index 1592da3b9403..d9c1f61b6fb6 100644 --- a/drivers/gpu/drm/drm_bridge_connector.c +++ b/drivers/gpu/drm/drm_bridge_connector.c @@ -128,18 +128,6 @@ static void drm_bridge_connector_hpd_cb(void *cb_data, drm_kms_helper_hotplug_event(dev); } -/** - * drm_bridge_connector_enable_hpd - Enable hot-plug detection for the connector - * @connector: The DRM bridge connector - * - * This function enables hot-plug detection for the given bridge connector. - * This is typically used by display drivers in their resume handler. - */ -void drm_bridge_connector_enable_hpd(struct drm_connector *connector) -{ -} -EXPORT_SYMBOL_GPL(drm_bridge_connector_enable_hpd); - static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector) { struct drm_bridge_connector *bridge_connector = @@ -151,19 +139,6 @@ static void _drm_bridge_connector_enable_hpd(struct drm_connector *connector) bridge_connector); } -/** - * drm_bridge_connector_disable_hpd - Disable hot-plug detection for the - * connector - * @connector: The DRM bridge connector - * - * This function disables hot-plug detection for the given bridge connector. - * This is typically used by display drivers in their suspend handler. - */ -void drm_bridge_connector_disable_hpd(struct drm_connector *connector) -{ -} -EXPORT_SYMBOL_GPL(drm_bridge_connector_disable_hpd); - static void _drm_bridge_connector_disable_hpd(struct drm_connector *connector) { struct drm_bridge_connector *bridge_connector = diff --git a/include/drm/drm_bridge_connector.h b/include/drm/drm_bridge_connector.h index 33f6c3bbdb4a..69630815fb09 100644 --- a/include/drm/drm_bridge_connector.h +++ b/include/drm/drm_bridge_connector.h @@ -10,8 +10,6 @@ struct drm_connector; struct drm_device; struct drm_encoder; -void drm_bridge_connector_enable_hpd(struct drm_connector *connector); -void drm_bridge_connector_disable_hpd(struct drm_connector *connector); struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, struct drm_encoder *encoder);