From patchwork Wed Nov 2 18:06:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 620888 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54C37C433FE for ; Wed, 2 Nov 2022 18:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230121AbiKBSHK (ORCPT ); Wed, 2 Nov 2022 14:07:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230518AbiKBSHJ (ORCPT ); Wed, 2 Nov 2022 14:07:09 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FBD72EF2E for ; Wed, 2 Nov 2022 11:07:08 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id g12so29557284lfh.3 for ; Wed, 02 Nov 2022 11:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I3be5trhw3wsDg3ozZhQ1oc92P/aiH8PmAIGusb2quw=; b=U1V1Ie1snUM8Z8kW5FbPB+Uxui9aHzWBAvoKIzPL5WQtt7r1fbJDtKZfYL0BvXjZAX pJXlM3cUhAHFVupb1uRPIy1ukhaIzZwAyJB4gdhhGcw8JI31vp2Na7Z3w8CO8QhTzR9R KvUPtk1lO6e50dKm5UdWhcexeNthTu3tdl2sTg0S9cJJb0qQ29mQaq7fEiKOijMTBq78 AJjAm41uNWULtKqI30GYst1N49ngizQQX8dCwb9yXGsU8VHccitTrRtFDC0ASm442BuI o39Z887V1sbVS7fCnHaPRg7YhrxZEF1JL7e/zjTrWzvEQM+tv70DuSnESXnFQKx4s7ga TX3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I3be5trhw3wsDg3ozZhQ1oc92P/aiH8PmAIGusb2quw=; b=b/d5iqBe7rawq4o3vocFBtRgHYTgkyFKh/q5k5eCzBs9L0Hh0zqMrEhirSGyQYvOh2 cehyI5Cn+Fjk2G7mO5z2Y5nlWve4YxIDXOIAnHWc+cydJKtOWUCpxthrcxZD3uHwskKz iHHvQUXqWk8eOu/+BtfYHZq2WkgkngpLDohDZmMcJeuz8XtJ3qRnKYiQF2qH/bfXFVP3 AZhpQoyB9d3TlbjlH4j9mvisKKXmMDTPe46ISCtXqpOKHKBRue/TPPuan+aj43OZRQ8b pb1nud6np+eHZljFeiRCq7D8IdcMUL6RUdU3HeLOMsGs6hrOlANQOQ2hC0mwh0bJAdrN mUNg== X-Gm-Message-State: ACrzQf0hbqWBPLYOVkShXNrUNd1gtA2bjsHtu1UlKfdZ0h0MBEi/j/4S gjzaFIOwGl2Yf+dRjWSsKPjcHA== X-Google-Smtp-Source: AMsMyM73Sw3dwb1cK+9rqJCeye4EQEf8Qh00yXAocdLw3KYHslx7r/wcJUC94neRnIpmMp6sND42Rg== X-Received: by 2002:a05:6512:3085:b0:4a2:7d80:d4b4 with SMTP id z5-20020a056512308500b004a27d80d4b4mr10523057lfd.534.1667412426862; Wed, 02 Nov 2022 11:07:06 -0700 (PDT) Received: from eriador.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id r15-20020ac24d0f000000b00485caa0f5dfsm2085232lfi.44.2022.11.02.11.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 11:07: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 v3 1/7] drm/poll-helper: merge drm_kms_helper_poll_disable() and _fini() Date: Wed, 2 Nov 2022 21:06:59 +0300 Message-Id: <20221102180705.459294-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> References: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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 69b0b2b9cc1c..f97fda3b1d34 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -803,6 +803,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 @@ -819,9 +830,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); @@ -859,11 +868,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 Wed Nov 2 18:07:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 621483 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 177EEC43219 for ; Wed, 2 Nov 2022 18:07:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231153AbiKBSHL (ORCPT ); Wed, 2 Nov 2022 14:07:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbiKBSHK (ORCPT ); Wed, 2 Nov 2022 14:07:10 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 519BA23BF8 for ; Wed, 2 Nov 2022 11:07:09 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id t10so2437008ljj.0 for ; Wed, 02 Nov 2022 11:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/zQozVl2HAGAn3My7u0ClWj7r5VwxG7XjUAjm2DzSHA=; b=yNFT78R6jUf4odwN4fOLdPnR3jqScnZmrHHxBcb8tvCfWVowil5fAX181SBFAuq5sy F1HNTPYtKGKnkU9I+7Z6p0VFuuUuEFU+V3YRR0a1Pu5dbN42W7V/CLLIeFJQAdZTuFhd Lx/bS/4GuWX5Rf6h3HU96F2ZBYK9knVQyZQXNoP52UHKKDpmkB5gWhhV6/eu+Vq+txLk GWjtYuB7qJSLQBOKXJc+IrHXzo8G5eaZte4AkykQrSRus3EhJQfS7hVpeSUUGqJNKlEx xy1aYDw1z++kkISNNOVQlXZijyH7JM7ronJsulgrEPpu+casFreo2dpyeJoHv0P57rpJ wSRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/zQozVl2HAGAn3My7u0ClWj7r5VwxG7XjUAjm2DzSHA=; b=J0qilEn7U66gYM/TivZH/TBWz7b+nZNsFGTMSa5xE/K1dLnnpWqORJwb6pG3Q0O5Cj L87qbWwHsx8oQo2pMy6XtajlI/8efTeQs30/Kn6lu1T0bzvk4OnRKGuvnPP6eog9G4T2 +6Bctce6S9eEtvkyC+8L+Rrw7yhY8IeOQVaHUG1MHt7s41Putw7d5fmQwxxOQIrVY7W9 GvOLAQIiK7tpy2TCB2NyKPHI0+cVBakGM1WtELSfLTkU4XfKEY81wm5azo/TlMyp/beE Acy/NzWv2Lx+wJDa8OhXBBqz9VzeOXCJB648IpYzencmLChJ/HG97apiDcUajkwZT+Wi pdLA== X-Gm-Message-State: ACrzQf2PSBkJgLIslgZCwuR38kpBQ7apbBHHSYCy5QRCHHm6TZMfQvE6 rmDH2m0CnUYkFab3atvTsl996A== X-Google-Smtp-Source: AMsMyM7OUsAVZk+yxxSO7NSMN9dJ3hYR1adlrIR6L7lRTjEYtcDDrXn2OJsFtXpfh8DXNQH/0CFqCg== X-Received: by 2002:a05:651c:1241:b0:261:9313:9cb9 with SMTP id h1-20020a05651c124100b0026193139cb9mr9965492ljh.213.1667412427676; Wed, 02 Nov 2022 11:07:07 -0700 (PDT) Received: from eriador.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id r15-20020ac24d0f000000b00485caa0f5dfsm2085232lfi.44.2022.11.02.11.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 11:07:07 -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 v3 2/7] drm/probe-helper: enable and disable HPD on connectors Date: Wed, 2 Nov 2022 21:07:00 +0300 Message-Id: <20221102180705.459294-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> References: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Introduce 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 DRM 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 f97fda3b1d34..a7b4590d8ec1 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; @@ -805,12 +811,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 fafa70ac1337..7aa1f01223f9 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 Wed Nov 2 18:07:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 620887 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B29E0C43217 for ; Wed, 2 Nov 2022 18:07:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbiKBSHM (ORCPT ); Wed, 2 Nov 2022 14:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230518AbiKBSHL (ORCPT ); Wed, 2 Nov 2022 14:07:11 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B6522E696 for ; Wed, 2 Nov 2022 11:07:10 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id d6so29510711lfs.10 for ; Wed, 02 Nov 2022 11:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=njFUM8grNBCWhY7+2MQ0vp+r8NhDVi4GL0ALpm64CQc=; b=FnZf6NTADaSe0PkC86OPtYawsEUrWL0oiGDdYkE/H6elSvrKnb3/EXr4SBV9nhl+7A B5f1pZMFNNNOb76MlRM+I2gpUlRPwrKIN+epl1/zpPwcKw18qsIMMW3AZDokb4FPt/eb 9H4/C5Ates7fv/Uq6bjTt+gMEdsRYFnSauejLx1eYDLHOAjNjuU5DP4F3BWp4YKrV6Yv tLJLJXOhaKGOUELcx5E9ykC31Mw66jfIHCBr4zydP8DKjy18pH45hDjckSQavtVdtnGc MkCoafW8sPaYFOOSJsMw+RoEpvA2dFQiTfy2QboDWlELd0XAKjqpd9w03ts6YhRq9AbF z12Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=njFUM8grNBCWhY7+2MQ0vp+r8NhDVi4GL0ALpm64CQc=; b=OyoEHKhZlVfNUyQeyFDaFDZB/DJblzH1Q36CfjyM1GxcbOYzYxTVO4VDlIqOcn9Flf SovfKwqKQ3R9K2hPa/fgQiP1FFHkNnEPBef3hX1CGE6sg1N0Qz84L1C262Avr8umMFG1 7Pnhr06fIjjwTr7xnYF+fT9aottTzpAFCkuROjy+J0OJnpJdguJm1iaWSvU0oBpM/71l c7nIx8WU0tgcfzUpUobW2h0KVUkCs9bCGCL+iXC/9GDWKJBIyKHFngSPBVC+O7vr11Ze zrWDeUuLXC64eaQlRo9JgBfJY+q8+PPE/1vxgpnTKpx9nnFlbmzlWACTvA8ODCNzCTOi X7ug== X-Gm-Message-State: ACrzQf0Eyg9cGWG89sbu6/Tnrg8PtaNygKGePblrdScvdMGZV9Ef4M5H MLEg+fjyhzIFjdvMmOeLvLfHHA== X-Google-Smtp-Source: AMsMyM5/YWavo37aOvKzpmvgdmkVEaZu35sKTu0ADp1oLjSun+G/nXyR+D74r6QrPi65ndlPWZjeQw== X-Received: by 2002:a05:6512:308d:b0:4a2:33d3:b8f1 with SMTP id z13-20020a056512308d00b004a233d3b8f1mr10157528lfd.133.1667412428417; Wed, 02 Nov 2022 11:07:08 -0700 (PDT) Received: from eriador.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id r15-20020ac24d0f000000b00485caa0f5dfsm2085232lfi.44.2022.11.02.11.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 11:07:08 -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 v3 3/7] drm/bridge_connector: rely on drm_kms_helper_poll_* for HPD enablement Date: Wed, 2 Nov 2022 21:07:01 +0300 Message-Id: <20221102180705.459294-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> References: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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. Enabling the HPD from drm_bridge_connector_init() can happen too early, before the driver is prepared to handle HPD events. As the drm_bridge_connector_enable_hpd() is empty anyway, drop this call anyway. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_bridge_connector.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c index 1c7d936523df..0e13bc87a6ac 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, }; /* ----------------------------------------------------------------------------- @@ -387,10 +397,8 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, connector_type, ddc); drm_connector_helper_add(connector, &drm_bridge_connector_helper_funcs); - if (bridge_connector->bridge_hpd) { + if (bridge_connector->bridge_hpd) connector->polled = DRM_CONNECTOR_POLL_HPD; - drm_bridge_connector_enable_hpd(connector); - } else if (bridge_connector->bridge_detect) connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; From patchwork Wed Nov 2 18:07:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 621482 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8F3BC4321E for ; Wed, 2 Nov 2022 18:07:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230518AbiKBSHM (ORCPT ); Wed, 2 Nov 2022 14:07:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229880AbiKBSHL (ORCPT ); Wed, 2 Nov 2022 14:07:11 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E238D23BF8 for ; Wed, 2 Nov 2022 11:07:10 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id p8so29457160lfu.11 for ; Wed, 02 Nov 2022 11:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=caH8bf8ljAti3Iqn2/ffUusX7mem9lzX4QuF6rv2l+k=; b=M4Miu7t/weJqZa+rd0xqd/pvcKbBCL+CCFLSP5Gjj8AhcAVtRTWLjFllOFGwdAFauW VOYUlzQNHwWOYbXn3BbKjqXiu9BUHPcHJ82nuCi1vrytWgsoB/iPcUeBeTRHh6DurOYv ay88f/dVrfXfDo1NQWpElH9L7eSqIfdZLZwcA2C00ABgDbqJr6vFiQVr66UpfemGOrc+ aumehGsCwdJ+hadRYcvG3Bguw9C0uGigVJRtmW3Hi1nOTw6fQqWMUrUbk2QSdz0vUgOl q0nunDf0CWd8i9JP5HAXrwyiZ+O8iLx8svQNbjo60cv1xQIVOwDYbnzHSYdlI8aoRNVo EfGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=caH8bf8ljAti3Iqn2/ffUusX7mem9lzX4QuF6rv2l+k=; b=mZcYCh6ChEHVsWo6vHo7p+asK1dRODL2gduHVfmjrLhVtfXpU46EQ7uVsaC3SBs1Zj 9sTDrYW2g8SY8UB+p5qjFcIxW508HOIKh5IZyg1T95xbKG+qIb00SrNBgqz0Fojn0Hze LOXa34On8su8ztqrQTf5KRY6IL5Vip/ygS9Zg08yAs8A4jGMTo64GzM2+o9/4L10oUbp 3/aTt1S54NN36C5AiHBhyadovT0hKzg5z7FWaaDkZ7KwW3GMmZMBMzsRiQXifhOPwo7t scsGsR9NfH6XrCrtT5bwMfFw2OtL7dd3azhpAYgTaydPMId2V0g8wGmhNdA31dY3hE2j 9CzQ== X-Gm-Message-State: ACrzQf0J0+Qn3FKPCo7WUMPR2a9fA0NbLmb/crWoFkVZ1GPyTOwJ5BOr 1zLo2Tgd23jNSJAeGZD9PbWT2g== X-Google-Smtp-Source: AMsMyM7lr3pt+hR6OTjw8GGDV87W40UMzCRnSnEMVhQ6Wvq7PxsdKmr0R33IAhL2J5nDdfBpBa493Q== X-Received: by 2002:a05:6512:10c6:b0:4a2:abd1:868c with SMTP id k6-20020a05651210c600b004a2abd1868cmr10081673lfg.454.1667412429244; Wed, 02 Nov 2022 11:07:09 -0700 (PDT) Received: from eriador.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id r15-20020ac24d0f000000b00485caa0f5dfsm2085232lfi.44.2022.11.02.11.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 11:07:08 -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 v3 4/7] drm/imx/dcss: stop using drm_bridge_connector_en/disable_hpd() Date: Wed, 2 Nov 2022 21:07:02 +0300 Message-Id: <20221102180705.459294-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> References: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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 | 2 -- 2 files changed, 6 deletions(-) diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c index 3f5750cc2673..0d8e44f20ec4 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-dev.c +++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c @@ -257,8 +257,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)) @@ -292,8 +290,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 b4f82ebca532..16ef8aa6da37 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-kms.c +++ b/drivers/gpu/drm/imx/dcss/dcss-kms.c @@ -151,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); @@ -167,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 Wed Nov 2 18:07:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 620886 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E86FBC43217 for ; Wed, 2 Nov 2022 18:07:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231215AbiKBSHN (ORCPT ); Wed, 2 Nov 2022 14:07:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbiKBSHM (ORCPT ); Wed, 2 Nov 2022 14:07:12 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD6AC2EF58 for ; Wed, 2 Nov 2022 11:07:11 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id o12so29512612lfq.9 for ; Wed, 02 Nov 2022 11:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jshUQGH4UtEAs7tQmmFEpIMJkGozvqVnz1M3FYmS5xY=; b=Z8ogY1BJAIZ4+jO969Bq/HqGLXfZ/qg7CSEPRxvkwtsP87akwunEvyOSrm8L+2yemH lNdPn9rkx15SNRnA0f2F/9U+hUoAKzSyUrmSjn2nI6ZAT72r8KnN/j03CKH8N8l2SZNP Jvec9DTHGEYzMnrvU8zuSD95wSEitdcT21OtZ+j0Lj+rt2BILRWlELLl5mxeGTTlrAVF XASkeYu4M/xCyVkCNcx3WW73hiYCe2QgPKbu9+mdtcRRIZDrwXGhWRWTMC0ja61V/j0i V5jVrOPCaX7wKOwdgfjfSm23hZJMkMFGrFraKemBTmdmNJaxYEPY3LBjyFEVqoJhxRFA draw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jshUQGH4UtEAs7tQmmFEpIMJkGozvqVnz1M3FYmS5xY=; b=QZMFQyPa1/x9EYWWwr0aZBD8oC9h02/cUMYpOAaQrhq8VagxBebyQkC0fcGBSnVLzq BlWL7Zui2/vu/vjspq8/ZztpdL3/ZHVZVcsMV5ncU09ikT1BmxP9GbjIgLSH2yOl+uCZ 0765D6fbZVScGGqb8fRyvLUfEd4mM79ZCa33Gf6yiyp3EFQaM8/YEAouJP2zQS8zIeZC xwlCauS397fiRL1278bK5JBGvpeZazAR1dS/a8x8y+Tm18NPKtomlKFJTCDTCNWooJW/ OgssugAOZ2pikyGAEjKvs3QJmJiA5UibOfynFMbLUiHQLlBwru+s/tXy0kBaX3OfiuS+ OZ7w== X-Gm-Message-State: ACrzQf35rI4+5djRdoA9Jg/OtJtqlWJzm7nvL0zTIfNTqGZA72WKv4JV 1P2ZFnqyED5HTPnEhskZSc4uLA== X-Google-Smtp-Source: AMsMyM6OCSRVaMGSi8KIwIUfDuj88MqMcv8eYzHtBW28QWceUSqNJcenRHrHsMPUtNRwVRLuuQtxnQ== X-Received: by 2002:a19:5e4e:0:b0:4b0:1305:7cb8 with SMTP id z14-20020a195e4e000000b004b013057cb8mr10702352lfi.290.1667412430002; Wed, 02 Nov 2022 11:07:10 -0700 (PDT) Received: from eriador.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id r15-20020ac24d0f000000b00485caa0f5dfsm2085232lfi.44.2022.11.02.11.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 11:07:09 -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 v3 5/7] drm/msm/hdmi: stop using drm_bridge_connector_en/disable_hpd() Date: Wed, 2 Nov 2022 21:07:03 +0300 Message-Id: <20221102180705.459294-6-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> References: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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 93fe61b86967..a540c45d4fd3 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -348,8 +348,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 Wed Nov 2 18:07:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 621481 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD59DC4332F for ; Wed, 2 Nov 2022 18:07:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbiKBSHP (ORCPT ); Wed, 2 Nov 2022 14:07:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbiKBSHN (ORCPT ); Wed, 2 Nov 2022 14:07:13 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 653E02EF5E for ; Wed, 2 Nov 2022 11:07:12 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id x21so24703328ljg.10 for ; Wed, 02 Nov 2022 11:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lqeu0gWL+fbuCou+DZo8aED2KhTyfiRcmIANTVXwORA=; b=t2RcjNYTLDH6G78x+NZ2p6zgnvooU9KdaYMHPzhTzG+QrfQ9aus4ImJHAmAeQtvgGh qKC2LALtusMvGxhmfQCMZqSOg4uRh2afE1d8a9y3EzNX+sZ6qwfvU/gxdHcQOSL4nJuY sMBzc+0iGcfX22fJxRcyg5GwONyU6kK7+OphLJ7BTpQSmnzMdP0dm8HNvCNQfhGsRhQP qaxCANSNkBZoZJOuWVqS60H3l5Zf/u5KNeWowbLH7AXmPuMy77FbGdi55E8QW/0sbDQi q9jyNG94WoEJEbKCHTNhZc8I9wTY4Ih8XQr87XS/hx3F6LyDLcR/vNOAu1bEsL/832oX 3L0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lqeu0gWL+fbuCou+DZo8aED2KhTyfiRcmIANTVXwORA=; b=APHYanePkIlmykvSssNIhGdsMyRHXqtittqmxDwcHjmyb37ujMOobKy+hd6WV2BjmR QeDvgbrI+FJWINp3nFa/I/LjMzG9xGcsdvRkKPBWg84dnuP315UhdJGQOka2tIwzUw0/ kGCu/9zIhPjxzZeATh8tqH9JkrleuNnorjEOcZ0XGoj+74dRCGkiJKJqqCQeweUNNhQq oBEvL444PQp6T7RLwShLJAD+mmftsDA8u/36JASnpJ6EF6tU/UXdaFDVyD8VNbvgXs8E clDvUzdi96AaksKjv8Ep7nTM9r4WChsyKQ5tG9Fa5Vlzs9Yo90xraUi3LxlDR2Iq4UMm NDNA== X-Gm-Message-State: ACrzQf1dMGfhmV4qbMBh13CLvLYaXi9JqAJHiSGFhgd0+Tv5GVD87JZa i43/RgDNK5TdVKncXE4LEUa0Ug== X-Google-Smtp-Source: AMsMyM4OqI2jkXW6iTpHuMDg1nyD49qN0z0iiKU9ce9bf5kWHoJd0Kfpkz+Hb68JXqo3KUiQHQ9igg== X-Received: by 2002:a2e:1f09:0:b0:277:d94:93af with SMTP id f9-20020a2e1f09000000b002770d9493afmr9944985ljf.454.1667412430761; Wed, 02 Nov 2022 11:07:10 -0700 (PDT) Received: from eriador.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id r15-20020ac24d0f000000b00485caa0f5dfsm2085232lfi.44.2022.11.02.11.07.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 11:07:10 -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 v3 6/7] drm/omap: stop using drm_bridge_connector_en/disable_hpd() Date: Wed, 2 Nov 2022 21:07:04 +0300 Message-Id: <20221102180705.459294-7-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> References: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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 Wed Nov 2 18:07:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 620885 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD9BBC43217 for ; Wed, 2 Nov 2022 18:07:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231180AbiKBSHQ (ORCPT ); Wed, 2 Nov 2022 14:07:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231217AbiKBSHO (ORCPT ); Wed, 2 Nov 2022 14:07:14 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B27E2EF69 for ; Wed, 2 Nov 2022 11:07:13 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id j4so29584445lfk.0 for ; Wed, 02 Nov 2022 11:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XIWyUY4t9cfdrarJHXAihf6iaXZwwU1KNPGYvwDevnI=; b=i3xbLMfpo4u/j3vNZgefupyMkFAAbJ96c/pOf24fBNy7HrB/ysVdgzBAXPVzzHlx9j P+5miB9oSd646vEYdznGFwq4V/Tp/sSlSu1Wce/hZOWOzyI+WMsLAPAIXEgjZyItq1sV 4Dl2jrhU1whajHLdxFLsBIF9nJI21BLhUqh14i9PNDrYXT+/OCgE9OU6jj1jsiI8osXh b9oCInof8Ky9g0oy3MtJ1FWowD8Yh2yKyz72kFLkcOCO0vSmmElhraj3Pi9bN8f5obSk AEccIEkuCF0+WjoIqE26i7p8WsgF+w+Lhs4nGpM5RJ/atOlrW2yXtYlOwPfZSf0JA95N QirQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XIWyUY4t9cfdrarJHXAihf6iaXZwwU1KNPGYvwDevnI=; b=RjAHFuzgGi1gDee2T6wJqMqSf/lhR/TJprGBcyIjLcH4nJtsD5/usPvrwvszd9rw7e gN0KdmayIrnr1BDDXJs4RHyTkxx4SwhVvUVEMepVCG7XEURvWK/nq28QJnFYnavryrA2 22Mnv00XTTS7hS+4d0SLioCfSu9jYD9HLBErHa00wE1T4KAAjUqpXNae/F21gSs/l/N7 MiDoScSDOPtKjNJ4iAf3c/v4ad8hSVWD8iQrTTOh8l57XCmnQiW07Xmz0Ji7LjV3Ja7A /Zav68qZBt3A0bvPN1H1epCbWjJx3aB+oTnmGOQ9++DaeC+6XXiRZPesofFun1bKz0Kg pgvg== X-Gm-Message-State: ACrzQf3q6hrFy75xVEhqV7xeTJ9nJbC6j/h/+a0UqvNnogK+NtsJqOtH boCSIY+IggE1arIncFncYqoh1Q== X-Google-Smtp-Source: AMsMyM7/ORTdXneoE6DaN9PIj1JPI/RyzxtgQE2m3Ivv/Jm4Eq/tj5/cUKwkaFcOmUugbOJSqvxr9A== X-Received: by 2002:a05:6512:1156:b0:4a2:7e73:1f28 with SMTP id m22-20020a056512115600b004a27e731f28mr10847502lfg.38.1667412431525; Wed, 02 Nov 2022 11:07:11 -0700 (PDT) Received: from eriador.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id r15-20020ac24d0f000000b00485caa0f5dfsm2085232lfi.44.2022.11.02.11.07.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 11:07:11 -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 v3 7/7] drm/bridge_connector: drop drm_bridge_connector_en/disable_hpd() Date: Wed, 2 Nov 2022 21:07:05 +0300 Message-Id: <20221102180705.459294-8-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> References: <20221102180705.459294-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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. Rename our internal helpers to remove the underscore prefix. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/drm_bridge_connector.c | 33 ++++---------------------- include/drm/drm_bridge_connector.h | 2 -- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c index 0e13bc87a6ac..19ae4a177ac3 100644 --- a/drivers/gpu/drm/drm_bridge_connector.c +++ b/drivers/gpu/drm/drm_bridge_connector.c @@ -128,19 +128,7 @@ 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) +static void drm_bridge_connector_enable_hpd(struct drm_connector *connector) { struct drm_bridge_connector *bridge_connector = to_drm_bridge_connector(connector); @@ -151,20 +139,7 @@ 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) +static void drm_bridge_connector_disable_hpd(struct drm_connector *connector) { struct drm_bridge_connector *bridge_connector = to_drm_bridge_connector(connector); @@ -313,8 +288,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, + .enable_hpd = drm_bridge_connector_enable_hpd, + .disable_hpd = drm_bridge_connector_disable_hpd, }; /* ----------------------------------------------------------------------------- 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);