From patchwork Sat Oct 2 15:45:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532203 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AD93C433F5 for ; Sat, 2 Oct 2021 15:45:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C632461B1C for ; Sat, 2 Oct 2021 15:45:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C632461B1C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 404D189338; Sat, 2 Oct 2021 15:45:47 +0000 (UTC) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by gabe.freedesktop.org (Postfix) with ESMTPS id C13EC89338 for ; Sat, 2 Oct 2021 15:45:45 +0000 (UTC) Received: by mail-qt1-x82b.google.com with SMTP id f15so11929191qtv.9 for ; Sat, 02 Oct 2021 08:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N7nCMGTCgys5hRW4WhI1DxCYZ01ugVhghWDldMJPqiw=; b=ZeyVB3Ww5+MndgRRuyKNgtxr4Xg4kU888pfduDgU4Da9wYrVcs0RSOBDqA7sjnLbWF ntkU1BR9LIebqEuq3E1U4V6xFqsjmRBILGZTDWbHeIN1WaTIO6/dXDxrHhDoxUi4RVVw LUXKPw6ajDT4ZS9d34nTBdp6Xdp3U29OPq8Qj7fGhKE2/88OyYLs2xJzxLhrVMlysO3z DeMhm2a70aUOvJxZWZ9lr3QeewUwi630gffYiCOxs5ziujd7Jn5ROzdNl1lfUyz048lH OcZ1pqrskrkbuHq/b5f3VQIM2qb2WFeVbZ+pwoMf568DgTS4CZ7Ar7/+RKXIxGZQ4teS DxjQ== 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:mime-version :content-transfer-encoding; bh=N7nCMGTCgys5hRW4WhI1DxCYZ01ugVhghWDldMJPqiw=; b=zqnMcD9tiaggwaoNIJZ1ThCajHMDCiM2HF1J8q8nVSzF9I6Qm3HFmBMYA5wJkcLw3o pPUSq1XgccvJBzNOGAZK5qFyxzqGJGJV/n+cyip80Lu2YRqSgx7y90yiL4dS4/t0CGub HS9OMtPGArnZHjrTKsA5ZSwSrauxiOw/9aYOA8CCeHjhC8D5i8+SksjJc7XiHgzgZoDq x7HhsQ9e59scQGiHJoG/ccefIzSg74Ps3Qgn0g3HwZekZ5cP84auQxpt8pXAqb3cobE+ WcpctEZjbeJoHEBTzo2LEI9RsB5uDkZmAoc1d5glVFYE6rEAwFwKS2M4gcB8RBtn2819 EwVA== X-Gm-Message-State: AOAM533m3ORaLiRcPhcDKuCO1Dj+GdiE/i5EKM6iuHJO9foyMCTq75DX RmySO4/OjPPANiIxW1nuqzY12mJW+iM3DA== X-Google-Smtp-Source: ABdhPJz4Tta3xzWqk6v8cvex6TIIE1hil6jjUKR8RLxF+R9pJLP3Q6jwhOKiCY2c+h7VKis5wS51xg== X-Received: by 2002:aed:27c1:: with SMTP id m1mr4214009qtg.241.1633189544259; Sat, 02 Oct 2021 08:45:44 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id p9sm4682358qkm.23.2021.10.02.08.45.43 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:43 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 01/16] Revert "drm: cleanup: remove drm_modeset_(un)lock_all()" Date: Sat, 2 Oct 2021 11:45:27 -0400 Message-Id: <20211002154542.15800-1-sean@poorly.run> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 8d813d1a535c8c7503a5f4061654a73026be8c5e. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/drm_modeset_lock.c | 94 +++++++++++++++++++++++++++++- include/drm/drm_modeset_lock.h | 2 + 2 files changed, 93 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c index afd1351749a5..fcfe1a03c4a1 100644 --- a/drivers/gpu/drm/drm_modeset_lock.c +++ b/drivers/gpu/drm/drm_modeset_lock.c @@ -77,6 +77,93 @@ static DEFINE_WW_CLASS(crtc_ww_class); +/** + * drm_modeset_lock_all - take all modeset locks + * @dev: DRM device + * + * This function takes all modeset locks, suitable where a more fine-grained + * scheme isn't (yet) implemented. Locks must be dropped by calling the + * drm_modeset_unlock_all() function. + * + * This function is deprecated. It allocates a lock acquisition context and + * stores it in &drm_device.mode_config. This facilitate conversion of + * existing code because it removes the need to manually deal with the + * acquisition context, but it is also brittle because the context is global + * and care must be taken not to nest calls. New code should use the + * drm_modeset_lock_all_ctx() function and pass in the context explicitly. + */ +void drm_modeset_lock_all(struct drm_device *dev) +{ + struct drm_mode_config *config = &dev->mode_config; + struct drm_modeset_acquire_ctx *ctx; + int ret; + + ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL); + if (WARN_ON(!ctx)) + return; + + mutex_lock(&config->mutex); + + drm_modeset_acquire_init(ctx, 0); + +retry: + ret = drm_modeset_lock_all_ctx(dev, ctx); + if (ret < 0) { + if (ret == -EDEADLK) { + drm_modeset_backoff(ctx); + goto retry; + } + + drm_modeset_acquire_fini(ctx); + kfree(ctx); + return; + } + ww_acquire_done(&ctx->ww_ctx); + + WARN_ON(config->acquire_ctx); + + /* + * We hold the locks now, so it is safe to stash the acquisition + * context for drm_modeset_unlock_all(). + */ + config->acquire_ctx = ctx; + + drm_warn_on_modeset_not_all_locked(dev); +} +EXPORT_SYMBOL(drm_modeset_lock_all); + +/** + * drm_modeset_unlock_all - drop all modeset locks + * @dev: DRM device + * + * This function drops all modeset locks taken by a previous call to the + * drm_modeset_lock_all() function. + * + * This function is deprecated. It uses the lock acquisition context stored + * in &drm_device.mode_config. This facilitates conversion of existing + * code because it removes the need to manually deal with the acquisition + * context, but it is also brittle because the context is global and care must + * be taken not to nest calls. New code should pass the acquisition context + * directly to the drm_modeset_drop_locks() function. + */ +void drm_modeset_unlock_all(struct drm_device *dev) +{ + struct drm_mode_config *config = &dev->mode_config; + struct drm_modeset_acquire_ctx *ctx = config->acquire_ctx; + + if (WARN_ON(!ctx)) + return; + + config->acquire_ctx = NULL; + drm_modeset_drop_locks(ctx); + drm_modeset_acquire_fini(ctx); + + kfree(ctx); + + mutex_unlock(&dev->mode_config.mutex); +} +EXPORT_SYMBOL(drm_modeset_unlock_all); + /** * drm_warn_on_modeset_not_all_locked - check that all modeset locks are locked * @dev: device @@ -293,9 +380,10 @@ EXPORT_SYMBOL(drm_modeset_unlock); * This function takes all modeset locks, suitable where a more fine-grained * scheme isn't (yet) implemented. * - * It doesn't take the &drm_mode_config.mutex since that lock isn't required for - * modeset state changes. Callers which need to grab that lock too need to do so - * outside of the acquire context @ctx. + * Unlike drm_modeset_lock_all(), it doesn't take the &drm_mode_config.mutex + * since that lock isn't required for modeset state changes. Callers which + * need to grab that lock too need to do so outside of the acquire context + * @ctx. * * Locks acquired with this function should be released by calling the * drm_modeset_drop_locks() function on @ctx. diff --git a/include/drm/drm_modeset_lock.h b/include/drm/drm_modeset_lock.h index 865e64bcc4cb..aafd07388eb7 100644 --- a/include/drm/drm_modeset_lock.h +++ b/include/drm/drm_modeset_lock.h @@ -132,6 +132,8 @@ struct drm_device; struct drm_crtc; struct drm_plane; +void drm_modeset_lock_all(struct drm_device *dev); +void drm_modeset_unlock_all(struct drm_device *dev); void drm_warn_on_modeset_not_all_locked(struct drm_device *dev); int drm_modeset_lock_all_ctx(struct drm_device *dev, From patchwork Sat Oct 2 15:45:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532205 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64C10C433F5 for ; Sat, 2 Oct 2021 15:45:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2196A61B1E for ; Sat, 2 Oct 2021 15:45:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2196A61B1E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C0D9898C0; Sat, 2 Oct 2021 15:45:47 +0000 (UTC) Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by gabe.freedesktop.org (Postfix) with ESMTPS id A327989338 for ; Sat, 2 Oct 2021 15:45:46 +0000 (UTC) Received: by mail-qt1-x832.google.com with SMTP id e16so1494140qts.4 for ; Sat, 02 Oct 2021 08:45:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dwMVhoFInyVnI3TW4TkGjfHqsSj0JqYDKIPC7ghoVAs=; b=MZFb4tv7IcPwOHNq/md0S2hWf1r4x1gVKgOBPFc5YrLgSMqnh2ErTV2jRuYePnIH1D KDsDttFWJOhver2ZnFc6HClrvGvh1GXOOIEeaaQelnusqk5kFzFJta3V3Cytbk2xz2Mz 5OC6WM/3kXp/UuSrC44XMTUl+PHWBX3qhWTeg2btI1fWsOT/4wq5TVwHsO+hoAk/YdAP LcfCCxopS4EqCFLAekYzHBuWPXx1aIbAmC/QcXjhl6s7vCR4+lUq2XOYza2rfj/bo2XI iAaULxpMUOizn9SDTC6N4evSZtuc+ukV4uZa2ueRQxKYOGtJtAAezfp92igs14XgbjVf ealQ== 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=dwMVhoFInyVnI3TW4TkGjfHqsSj0JqYDKIPC7ghoVAs=; b=t+5Cjbvy17ZSXUovetnuqg/7WAQR3PHymB3ReQpxkFzXUMdZy0U/sBgGrUTtn9uUDC Y0HbVSUmqftdaJwPSY0pQFieIsEU4yY8zpbQdg7JqwZWAbi9CJb2y3iebaguGyjSB0zO TlSBB+xvF/b/bHgoHlMGL2DSKdJpEz6AXusF5UlENV1zlXRxVhS0cbrkmR6zhmHS8sHg 14jRtcOjql/pmCRQrPEV154/OKfoF1tpUZQQuTTPR94wEJR34Pkh5vJ39W9MVOpOXmat Y25KMPbY7OfG3HSBtevmHdvrt01QmcON4erFigLzeqEdUTwwAIxxVXWcXRvBGaMMBq+m ptCg== X-Gm-Message-State: AOAM533mmJoEQPbOSYeAQdMA7O6mtBqtjhz8Z64War8rlhcfnzr1No4C 02QiauTWKbEt3qG3Fz2yBdz8IqgaRQ5kfg== X-Google-Smtp-Source: ABdhPJwbzFcUlgAoIadyka6SmfLX4ye/FJaAm1u7fJIEPiuzzP7TxQlpIQYWfE2Jujmg6dvYY8gHuw== X-Received: by 2002:ac8:3e01:: with SMTP id z1mr4133408qtf.278.1633189545592; Sat, 02 Oct 2021 08:45:45 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id p201sm4902010qke.27.2021.10.02.08.45.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:45 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 02/16] Revert "drm/amd: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:28 -0400 Message-Id: <20211002154542.15800-2-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 299f040e855b69c29522cde446777902381a07f5. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 21 +++----- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 50 +++++++++---------- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 25 ++++------ 3 files changed, 43 insertions(+), 53 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index b07e845a2600..7a7316731911 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -40,7 +40,6 @@ #include #include #include -#include static void amdgpu_display_flip_callback(struct dma_fence *f, struct dma_fence_cb *cb) @@ -1544,21 +1543,16 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev) struct drm_crtc *crtc; struct drm_connector *connector; struct drm_connector_list_iter iter; - struct drm_modeset_acquire_ctx ctx; - int r, ret; + int r; /* turn off display hw */ - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); drm_connector_list_iter_begin(dev, &iter); drm_for_each_connector_iter(connector, &iter) drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); drm_connector_list_iter_end(&iter); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); - - if (ret) - return ret; - + drm_modeset_unlock_all(dev); /* unpin the front buffers and cursors */ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); @@ -1596,8 +1590,7 @@ int amdgpu_display_resume_helper(struct amdgpu_device *adev) struct drm_connector *connector; struct drm_connector_list_iter iter; struct drm_crtc *crtc; - struct drm_modeset_acquire_ctx ctx; - int r, ret; + int r; /* pin cursors */ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { @@ -1619,7 +1612,7 @@ int amdgpu_display_resume_helper(struct amdgpu_device *adev) drm_helper_resume_force_mode(dev); /* turn on display hw */ - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); drm_connector_list_iter_begin(dev, &iter); drm_for_each_connector_iter(connector, &iter) @@ -1627,8 +1620,8 @@ int amdgpu_display_resume_helper(struct amdgpu_device *adev) DRM_MODE_DPMS_ON); drm_connector_list_iter_end(&iter); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); - return ret; + return 0; } diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 5196c1d26f87..9b1fc54555ee 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -80,7 +80,6 @@ #include #include #include -#include #if defined(CONFIG_DRM_AMD_DC_DCN) #include "ivsrcid/dcn/irqsrcs_dcn_1_0.h" @@ -2622,9 +2621,6 @@ static void handle_hpd_irq(void *param) #ifdef CONFIG_DRM_AMD_DC_HDCP struct dm_connector_state *dm_con_state = to_dm_connector_state(connector->state); #endif - struct drm_modeset_acquire_ctx ctx; - int ret; - if (adev->dm.disable_hpd_irq) return; @@ -2650,6 +2646,14 @@ static void handle_hpd_irq(void *param) if (aconnector->base.force && new_connection_type == dc_connection_none) { emulated_link_detect(aconnector->dc_link); + + drm_modeset_lock_all(dev); + dm_restore_drm_connector_state(dev, connector); + drm_modeset_unlock_all(dev); + + if (aconnector->base.force == DRM_FORCE_UNSPECIFIED) + drm_kms_helper_hotplug_event(dev); + } else if (dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD)) { if (new_connection_type == dc_connection_none && aconnector->dc_link->type == dc_connection_none) @@ -2657,18 +2661,13 @@ static void handle_hpd_irq(void *param) amdgpu_dm_update_connector_after_detect(aconnector); - } else { - goto out; - } - - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); - dm_restore_drm_connector_state(dev, connector); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); - - if (aconnector->base.force == DRM_FORCE_UNSPECIFIED) - drm_kms_helper_hotplug_event(dev); + drm_modeset_lock_all(dev); + dm_restore_drm_connector_state(dev, connector); + drm_modeset_unlock_all(dev); -out: + if (aconnector->base.force == DRM_FORCE_UNSPECIFIED) + drm_kms_helper_hotplug_event(dev); + } mutex_unlock(&aconnector->hpd_lock); } @@ -2757,14 +2756,12 @@ static void handle_hpd_rx_irq(void *param) struct drm_connector *connector = &aconnector->base; struct drm_device *dev = connector->dev; struct dc_link *dc_link = aconnector->dc_link; - struct drm_modeset_acquire_ctx ctx; bool is_mst_root_connector = aconnector->mst_mgr.mst_state; bool result = false; enum dc_connection_type new_connection_type = dc_connection_none; struct amdgpu_device *adev = drm_to_adev(dev); union hpd_irq_data hpd_irq_data; bool lock_flag = 0; - int ret; memset(&hpd_irq_data, 0, sizeof(hpd_irq_data)); @@ -2831,6 +2828,12 @@ static void handle_hpd_rx_irq(void *param) amdgpu_dm_update_connector_after_detect(aconnector); + + drm_modeset_lock_all(dev); + dm_restore_drm_connector_state(dev, connector); + drm_modeset_unlock_all(dev); + + drm_kms_helper_hotplug_event(dev); } else if (dc_link_detect(dc_link, DETECT_REASON_HPDRX)) { if (aconnector->fake_enable) @@ -2838,17 +2841,14 @@ static void handle_hpd_rx_irq(void *param) amdgpu_dm_update_connector_after_detect(aconnector); - } else { - goto finish; - } - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); - dm_restore_drm_connector_state(dev, connector); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_lock_all(dev); + dm_restore_drm_connector_state(dev, connector); + drm_modeset_unlock_all(dev); - drm_kms_helper_hotplug_event(dev); + drm_kms_helper_hotplug_event(dev); + } } -finish: #ifdef CONFIG_DRM_AMD_DC_HDCP if (hpd_irq_data.bytes.device_service_irq.bits.CP_IRQ) { if (adev->dm.hdcp_workqueue) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c index fb7b56fa2673..87daa78a32b8 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -24,7 +24,6 @@ */ #include -#include #include "dc.h" #include "amdgpu.h" @@ -1192,14 +1191,12 @@ static ssize_t trigger_hotplug(struct file *f, const char __user *buf, struct drm_connector *connector = &aconnector->base; struct dc_link *link = NULL; struct drm_device *dev = connector->dev; - struct drm_modeset_acquire_ctx ctx; enum dc_connection_type new_connection_type = dc_connection_none; char *wr_buf = NULL; uint32_t wr_buf_size = 42; int max_param_num = 1; long param[1] = {0}; uint8_t param_nums = 0; - int ret; if (!aconnector || !aconnector->dc_link) return -EINVAL; @@ -1239,6 +1236,12 @@ static ssize_t trigger_hotplug(struct file *f, const char __user *buf, goto unlock; amdgpu_dm_update_connector_after_detect(aconnector); + + drm_modeset_lock_all(dev); + dm_restore_drm_connector_state(dev, connector); + drm_modeset_unlock_all(dev); + + drm_kms_helper_hotplug_event(dev); } else if (param[0] == 0) { if (!aconnector->dc_link) goto unlock; @@ -1256,18 +1259,12 @@ static ssize_t trigger_hotplug(struct file *f, const char __user *buf, amdgpu_dm_update_connector_after_detect(aconnector); - } else { - goto unlock; - } - - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); - dm_restore_drm_connector_state(dev, connector); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); - - if (ret) - return ret; + drm_modeset_lock_all(dev); + dm_restore_drm_connector_state(dev, connector); + drm_modeset_unlock_all(dev); - drm_kms_helper_hotplug_event(dev); + drm_kms_helper_hotplug_event(dev); + } unlock: mutex_unlock(&aconnector->hpd_lock); From patchwork Sat Oct 2 15:45:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532207 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A763C433EF for ; Sat, 2 Oct 2021 15:46:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5AD8661AFE for ; Sat, 2 Oct 2021 15:46:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5AD8661AFE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B9A789EB4; Sat, 2 Oct 2021 15:45:49 +0000 (UTC) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2F5A76E831 for ; Sat, 2 Oct 2021 15:45:48 +0000 (UTC) Received: by mail-qk1-x72f.google.com with SMTP id i132so12239993qke.1 for ; Sat, 02 Oct 2021 08:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=scxqgPmCF5BwnZ04IxRaI5D6qVw+TuBLKWOKYCisQ9Y=; b=DfsfK+EHdc+1+nEvdFePjkTst9sIfld/9zTB88XqsF6IHQ0PT7rsoQZAbZuSg92g/D 5j5o6VjAueRLqcWIJkUIRn3HPovBUMRe2PqgCWazAD+d88jceBPNnDTrWOk9QOUmIkGT a1XujwHJbxk86/edoWcJWWa3TRrPrxn81dtoYf8n33pS+rvht4oGLhnofBH6tRXyyW8z Ns4XlobOfClqXddFHLja44KFAFuhTNSbQdmAL5nd/UiWb6LbaAKCct5glXIkjI59zntv mWhKs0iVfLx0PCmnvRS4SGP4Ntxjh0Oyks/BnqQbXWf+DJBWqlHxrJBJkkqtGwK4QPEo uZHA== 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=scxqgPmCF5BwnZ04IxRaI5D6qVw+TuBLKWOKYCisQ9Y=; b=gg0XtuP7o+mBUa7bkIOFIgJlhxyGt9VWkhw0uU3v/3B5HBaU2pjvXUmZzm5/QrC6bl prQq10Y1f5E8Tf3yAiDpFEUJz+IavW7KTJVBHa429MsKWmGSiXZplCzVFia3RGYuOLzz j/K8nDZEFVsOXbGg1dhgXqs+VKYR7/R7igWNLtseT5r4FcROQbarL97ru1Dj+1W/jujU oSj5XRjJCks6ef2gZehv92nku7vxXUJL647SExB5TMYziyvoyewANBWwaVFlSH08khqg 2g2EjwfCVlVT0AyPVRjVcbBWSp6thTR3eo6Xendxk0tNiKeokYNgbd3jnEXcQnIUe3iH +CAw== X-Gm-Message-State: AOAM532LpuZEV7QHrm53QicOwexkn1kwlRACg845ModGYFds/1EZnaZ/ Mvtte6Z6TU4R4izp9ZP2Ld28cQ3wCO4m7A== X-Google-Smtp-Source: ABdhPJwCwg/8ZOzqgq1aHXMJbR/z5n5u5IrCqX/HWLUgwQZswXvRYY60SydOErdbYSGnFiAFrbldTw== X-Received: by 2002:a37:8ac6:: with SMTP id m189mr2970494qkd.66.1633189546997; Sat, 02 Oct 2021 08:45:46 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id m11sm4671601qkm.88.2021.10.02.08.45.46 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:46 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 03/16] Revert "drm/gma500: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:29 -0400 Message-Id: <20211002154542.15800-3-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 4f9e860e6ad65ff4ea8ce165a1407d96ff1b2211. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/gma500/psb_device.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/gma500/psb_device.c b/drivers/gpu/drm/gma500/psb_device.c index 021a7238508f..3030f18ba022 100644 --- a/drivers/gpu/drm/gma500/psb_device.c +++ b/drivers/gpu/drm/gma500/psb_device.c @@ -8,7 +8,6 @@ #include #include -#include #include "gma_device.h" #include "intel_bios.h" @@ -170,10 +169,8 @@ static int psb_save_display_registers(struct drm_device *dev) { struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct drm_crtc *crtc; - struct drm_modeset_acquire_ctx ctx; struct gma_connector *connector; struct psb_state *regs = &dev_priv->regs.psb; - int ret; /* Display arbitration control + watermarks */ regs->saveDSPARB = PSB_RVDC32(DSPARB); @@ -186,7 +183,7 @@ static int psb_save_display_registers(struct drm_device *dev) regs->saveCHICKENBIT = PSB_RVDC32(DSPCHICKENBIT); /* Save crtc and output state */ - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { if (drm_helper_crtc_in_use(crtc)) dev_priv->ops->save_crtc(crtc); @@ -196,9 +193,8 @@ static int psb_save_display_registers(struct drm_device *dev) if (connector->save) connector->save(&connector->base); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); - - return ret; + drm_modeset_unlock_all(dev); + return 0; } /** @@ -211,10 +207,8 @@ static int psb_restore_display_registers(struct drm_device *dev) { struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct drm_crtc *crtc; - struct drm_modeset_acquire_ctx ctx; struct gma_connector *connector; struct psb_state *regs = &dev_priv->regs.psb; - int ret; /* Display arbitration + watermarks */ PSB_WVDC32(regs->saveDSPARB, DSPARB); @@ -229,7 +223,7 @@ static int psb_restore_display_registers(struct drm_device *dev) /*make sure VGA plane is off. it initializes to on after reset!*/ PSB_WVDC32(0x80000000, VGACNTRL); - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) if (drm_helper_crtc_in_use(crtc)) dev_priv->ops->restore_crtc(crtc); @@ -238,8 +232,8 @@ static int psb_restore_display_registers(struct drm_device *dev) if (connector->restore) connector->restore(&connector->base); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); - return ret; + drm_modeset_unlock_all(dev); + return 0; } static int psb_power_down(struct drm_device *dev) From patchwork Sat Oct 2 15:45:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532209 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1572C433F5 for ; Sat, 2 Oct 2021 15:46:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B49F361B1C for ; Sat, 2 Oct 2021 15:46:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B49F361B1C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A9DF6E831; Sat, 2 Oct 2021 15:45:51 +0000 (UTC) Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by gabe.freedesktop.org (Postfix) with ESMTPS id ACAF76E831 for ; Sat, 2 Oct 2021 15:45:49 +0000 (UTC) Received: by mail-qv1-xf2f.google.com with SMTP id o13so1721694qvm.4 for ; Sat, 02 Oct 2021 08:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4gOYVh6Yva2alEH7ZGpOOHZ9N2b/UBMnX114WFSqsEk=; b=V/jgQoRV4RGYOWHs2+Gq4Oe+r7BvB1P55AMrEjzALOvS967ylGVeD7NzZMdFlf5i6h xclngoThNvtXbmw1VsM/FFmMxZwj2caxC/JyP9uwb+VnG9AR3VGwbNrT2q6bUXHGQcad eIkVuYwQiiXDQjX5rN9nnlrVWYA+xaNk7BNa/h+PWnAXkhs5Uvgpuyrv8Bwl2FRLOG7v 3NCKGqNUEaZ8pT/I2nv7OTHJkSvdOBDesC3NDNfH1Uq7l6OoawitdN7J245m/6EtMdfb WXLf4V/ptdc5vjlfBKni78019+Y5fKjg8kO4Q5+VybjS+zE1sw22uebEcXr59IgtZzig 4zMg== 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=4gOYVh6Yva2alEH7ZGpOOHZ9N2b/UBMnX114WFSqsEk=; b=4qjWyM1oZRTI/lV+9xK0exDQxtaF8SCA/b91+BDSWLTxD9HsYz5Jfw7VN4NxN/cddS oF9iZaFX7finNOSVm9PO5FWDMNVv56ktv0RzdG+nY5h1T74Qt8Mn2tUD8+2VnfG87F7j 0MFeBBNF2F7HC9MCaJlhQCercc5lWlqAd2pu75rfHDXUedhu7Oq91orbxpxiWhz+2S58 2N9YlkNkEWr9o0yUmVqDjXcH2IhNsD8cJXERg/eqipDu84a0srNwpjs3jf6lfv2sWpkY p7fzWPN3f8R/4yM3xaBtD90Jkfw5zglyCnllCXs43dl5g1nTnzCUnIio12GQTVC+5WDz kQbg== X-Gm-Message-State: AOAM530Nwa9Afrq6r3cWa+oZJkROU0ZwbtcHyZQA+DtdgFdJGLSQNcG3 VHrc7Q0UYAYfX+s3wN3iRvjzh7cEzWbtug== X-Google-Smtp-Source: ABdhPJzWnFP4rWeaYExIBXzFlmMX/X/61BBpsdiYJWY1FOcPnGx3lWZO3CAKo1uYvQHDAVtpyZuzAg== X-Received: by 2002:a0c:8e45:: with SMTP id w5mr14209532qvb.17.1633189548622; Sat, 02 Oct 2021 08:45:48 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id o21sm5384011qtq.43.2021.10.02.08.45.47 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:48 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 04/16] Revert "drm/i915: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN() part 2" Date: Sat, 2 Oct 2021 11:45:30 -0400 Message-Id: <20211002154542.15800-4-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 984c9949f1c4cf36c35aa2de5ee2b65c39379fd9. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/i915/display/intel_overlay.c | 40 ++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c index c623738c59c8..c0ee135e5499 100644 --- a/drivers/gpu/drm/i915/display/intel_overlay.c +++ b/drivers/gpu/drm/i915/display/intel_overlay.c @@ -1105,7 +1105,6 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data, struct drm_crtc *drmmode_crtc; struct intel_crtc *crtc; struct drm_i915_gem_object *new_bo; - struct drm_modeset_acquire_ctx ctx; int ret; overlay = dev_priv->overlay; @@ -1114,24 +1113,24 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data, return -ENODEV; } - if (params->flags & I915_OVERLAY_ENABLE) { - - drmmode_crtc = drm_crtc_find(dev, file_priv, params->crtc_id); - if (!drmmode_crtc) - return -ENOENT; - crtc = to_intel_crtc(drmmode_crtc); + if (!(params->flags & I915_OVERLAY_ENABLE)) { + drm_modeset_lock_all(dev); + ret = intel_overlay_switch_off(overlay); + drm_modeset_unlock_all(dev); - new_bo = i915_gem_object_lookup(file_priv, params->bo_handle); - if (!new_bo) - return -ENOENT; + return ret; } - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drmmode_crtc = drm_crtc_find(dev, file_priv, params->crtc_id); + if (!drmmode_crtc) + return -ENOENT; + crtc = to_intel_crtc(drmmode_crtc); - if (!(params->flags & I915_OVERLAY_ENABLE)) { - ret = intel_overlay_switch_off(overlay); - goto out_unlock; - } + new_bo = i915_gem_object_lookup(file_priv, params->bo_handle); + if (!new_bo) + return -ENOENT; + + drm_modeset_lock_all(dev); if (i915_gem_object_is_tiled(new_bo)) { drm_dbg_kms(&dev_priv->drm, @@ -1196,11 +1195,14 @@ int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data, if (ret != 0) goto out_unlock; -out_unlock: - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); + i915_gem_object_put(new_bo); + + return 0; - if (params->flags & I915_OVERLAY_ENABLE) - i915_gem_object_put(new_bo); +out_unlock: + drm_modeset_unlock_all(dev); + i915_gem_object_put(new_bo); return ret; } From patchwork Sat Oct 2 15:45:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532211 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5205C433F5 for ; Sat, 2 Oct 2021 15:46:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA8E261B1E for ; Sat, 2 Oct 2021 15:46:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AA8E261B1E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 22BBB6E84F; Sat, 2 Oct 2021 15:45:53 +0000 (UTC) Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 37E856E831 for ; Sat, 2 Oct 2021 15:45:51 +0000 (UTC) Received: by mail-qk1-x72e.google.com with SMTP id 138so12178530qko.10 for ; Sat, 02 Oct 2021 08:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Im77FkEBdvBs+lJqn2GDs31kJz+82SvHV8rNdwgMtt8=; b=VBUCmvF7/pvHHzJrOadItcfHABEFjgilEeGvGyokroouh9AAuLpgTH0BSfMF373sTC Wu2fZ3+vEwANsoJjnhBbkxuURWhivPkrA4/dk1XBV1A624pYSbLSph3Eb7t7nQCu0Jme mqiJBliQDoQ6kCoU+pzdqkABbukUVdOyKPqnoE+woaAcFsvn2OrrNj+NKyWXb8S4BGTQ 46jYomUmjHzDO3PSoGJJhiw8FrJ3vMdXizhBFDaLkW/TEHPJL12QBjcNmga+4oFDFa9h IrR8ApERJm3bdAh97Jw4Wxr/CHTf7zFIQ9S8+uR2VlwVMNs3nvthggMM+4aDu8QIinGL xFiw== 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=Im77FkEBdvBs+lJqn2GDs31kJz+82SvHV8rNdwgMtt8=; b=o2ap9XiNkfuX7fL7hvc+RlBJd1yXBaN3e35vym5OYFlBcY+ly+BYyC64kHaVQgygF7 Y2oXECSY9y463cIpZTXO8cizFCRTqFnM26XxMxVY1IfE19JXLv9m4+sQYAratm+c8o/b QxH7DjgW1XMz4r3WeEarx6Y8wC4vrKRaiqVvNT/2S+QtLtSZYG1MM/r10RFUoqK0wIO3 zBtrzPSlMWqmDLb56PtxlXzZqS7FWdseVOZLnH+URyUoGZkGSp0h3B+pCTNKShgGZpOP CK6pKOTTqPDL0642dQBjGKmJ0Q+7o7fq3o5W2E37qt8UgUEvRzjAZlTFIOWExI2Q16+J KRBg== X-Gm-Message-State: AOAM532yIXLp9IP+6JYa4DY1cT1oUMDxtbsTK1GJPXPlbgk/FwLAQYBb X5ffzVyeY1Dz80R1irn8FnEBllvW1WXkBg== X-Google-Smtp-Source: ABdhPJwOHEssmb/d29BxZY/0a8Fquf/K4TLnpsvKrNSgdAZJiFjNUXog4xKBkM9chLUo8WjH3RPG9g== X-Received: by 2002:ae9:e811:: with SMTP id a17mr3070180qkg.172.1633189549925; Sat, 02 Oct 2021 08:45:49 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id b17sm5284989qte.97.2021.10.02.08.45.49 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:49 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 05/16] Revert "drm/i915: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:31 -0400 Message-Id: <20211002154542.15800-5-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 746826bcf8fdf682668ff1c415d6b91dbf5858be. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/i915/display/intel_audio.c | 16 +++---- drivers/gpu/drm/i915/display/intel_display.c | 5 +- .../drm/i915/display/intel_display_debugfs.c | 46 +++++++------------ drivers/gpu/drm/i915/display/intel_overlay.c | 6 +-- drivers/gpu/drm/i915/display/intel_pipe_crc.c | 7 +-- drivers/gpu/drm/i915/i915_drv.c | 13 ++---- 6 files changed, 32 insertions(+), 61 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_audio.c b/drivers/gpu/drm/i915/display/intel_audio.c index c64f738cc062..532237588511 100644 --- a/drivers/gpu/drm/i915/display/intel_audio.c +++ b/drivers/gpu/drm/i915/display/intel_audio.c @@ -26,7 +26,6 @@ #include #include -#include #include "i915_drv.h" #include "intel_atomic.h" @@ -1215,8 +1214,7 @@ static int i915_audio_component_bind(struct device *i915_kdev, { struct i915_audio_component *acomp = data; struct drm_i915_private *dev_priv = kdev_to_i915(i915_kdev); - struct drm_modeset_acquire_ctx ctx; - int i, ret; + int i; if (drm_WARN_ON(&dev_priv->drm, acomp->base.ops || acomp->base.dev)) return -EEXIST; @@ -1226,16 +1224,16 @@ static int i915_audio_component_bind(struct device *i915_kdev, DL_FLAG_STATELESS))) return -ENOMEM; - DRM_MODESET_LOCK_ALL_BEGIN((&dev_priv->drm), ctx, 0, ret); + drm_modeset_lock_all(&dev_priv->drm); acomp->base.ops = &i915_audio_component_ops; acomp->base.dev = i915_kdev; BUILD_BUG_ON(MAX_PORTS != I915_MAX_PORTS); for (i = 0; i < ARRAY_SIZE(acomp->aud_sample_rate); i++) acomp->aud_sample_rate[i] = 0; dev_priv->audio_component = acomp; - DRM_MODESET_LOCK_ALL_END((&dev_priv->drm), ctx, ret); + drm_modeset_unlock_all(&dev_priv->drm); - return ret; + return 0; } static void i915_audio_component_unbind(struct device *i915_kdev, @@ -1243,14 +1241,12 @@ static void i915_audio_component_unbind(struct device *i915_kdev, { struct i915_audio_component *acomp = data; struct drm_i915_private *dev_priv = kdev_to_i915(i915_kdev); - struct drm_modeset_acquire_ctx ctx; - int ret; - DRM_MODESET_LOCK_ALL_BEGIN((&dev_priv->drm), ctx, 0, ret); + drm_modeset_lock_all(&dev_priv->drm); acomp->base.ops = NULL; acomp->base.dev = NULL; dev_priv->audio_component = NULL; - DRM_MODESET_LOCK_ALL_END((&dev_priv->drm), ctx, ret); + drm_modeset_unlock_all(&dev_priv->drm); device_link_remove(hda_kdev, i915_kdev); diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 297359411c5f..2bf01416d656 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -12512,7 +12512,6 @@ int intel_modeset_init_noirq(struct drm_i915_private *i915) int intel_modeset_init_nogem(struct drm_i915_private *i915) { struct drm_device *dev = &i915->drm; - struct drm_modeset_acquire_ctx ctx; enum pipe pipe; struct intel_crtc *crtc; int ret; @@ -12564,9 +12563,9 @@ int intel_modeset_init_nogem(struct drm_i915_private *i915) intel_vga_disable(i915); intel_setup_outputs(i915); - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); intel_modeset_setup_hw_state(dev, dev->mode_config.acquire_ctx); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); for_each_intel_crtc(dev, crtc) { struct intel_initial_plane_config plane_config = {}; diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c index e0a6837996e7..8fdacb252bb1 100644 --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c @@ -5,7 +5,6 @@ #include #include -#include #include "i915_debugfs.h" #include "intel_display_debugfs.h" @@ -1058,13 +1057,11 @@ static int i915_display_info(struct seq_file *m, void *unused) struct intel_crtc *crtc; struct drm_connector *connector; struct drm_connector_list_iter conn_iter; - struct drm_modeset_acquire_ctx ctx; intel_wakeref_t wakeref; - int ret; wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm); - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); seq_printf(m, "CRTC info\n"); seq_printf(m, "---------\n"); @@ -1079,21 +1076,20 @@ static int i915_display_info(struct seq_file *m, void *unused) intel_connector_info(m, connector); drm_connector_list_iter_end(&conn_iter); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref); - return ret; + return 0; } static int i915_shared_dplls_info(struct seq_file *m, void *unused) { struct drm_i915_private *dev_priv = node_to_i915(m->private); struct drm_device *dev = &dev_priv->drm; - struct drm_modeset_acquire_ctx ctx; - int i, ret; + int i; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); seq_printf(m, "PLL refclks: non-SSC: %d kHz, SSC: %d kHz\n", dev_priv->dpll.ref_clks.nssc, @@ -1136,9 +1132,9 @@ static int i915_shared_dplls_info(struct seq_file *m, void *unused) seq_printf(m, " mg_pll_tdc_coldst_bias: 0x%08x\n", pll->state.hw_state.mg_pll_tdc_coldst_bias); } - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); - return ret; + return 0; } static int i915_ipc_status_show(struct seq_file *m, void *data) @@ -1197,15 +1193,13 @@ static int i915_ddb_info(struct seq_file *m, void *unused) { struct drm_i915_private *dev_priv = node_to_i915(m->private); struct drm_device *dev = &dev_priv->drm; - struct drm_modeset_acquire_ctx ctx; struct skl_ddb_entry *entry; struct intel_crtc *crtc; - int ret; if (DISPLAY_VER(dev_priv) < 9) return -ENODEV; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); seq_printf(m, "%-15s%8s%8s%8s\n", "", "Start", "End", "Size"); @@ -1229,9 +1223,9 @@ static int i915_ddb_info(struct seq_file *m, void *unused) entry->end, skl_ddb_entry_size(entry)); } - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); - return ret; + return 0; } static void drrs_status_per_crtc(struct seq_file *m, @@ -1309,12 +1303,10 @@ static int i915_drrs_status(struct seq_file *m, void *unused) { struct drm_i915_private *dev_priv = node_to_i915(m->private); struct drm_device *dev = &dev_priv->drm; - struct drm_modeset_acquire_ctx ctx; struct intel_crtc *crtc; int active_crtc_cnt = 0; - int ret; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); for_each_intel_crtc(dev, crtc) { if (crtc->base.state->active) { active_crtc_cnt++; @@ -1323,7 +1315,7 @@ static int i915_drrs_status(struct seq_file *m, void *unused) drrs_status_per_crtc(m, dev, crtc); } } - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); if (!active_crtc_cnt) seq_puts(m, "No active crtc found\n"); @@ -1615,10 +1607,8 @@ static void wm_latency_show(struct seq_file *m, const u16 wm[8]) { struct drm_i915_private *dev_priv = m->private; struct drm_device *dev = &dev_priv->drm; - struct drm_modeset_acquire_ctx ctx; int level; int num_levels; - int ret; if (IS_CHERRYVIEW(dev_priv)) num_levels = 3; @@ -1629,7 +1619,7 @@ static void wm_latency_show(struct seq_file *m, const u16 wm[8]) else num_levels = ilk_wm_max_level(dev_priv) + 1; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); for (level = 0; level < num_levels; level++) { unsigned int latency = wm[level]; @@ -1650,7 +1640,7 @@ static void wm_latency_show(struct seq_file *m, const u16 wm[8]) level, wm[level], latency / 10, latency % 10); } - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); } static int pri_wm_latency_show(struct seq_file *m, void *data) @@ -1734,7 +1724,6 @@ static ssize_t wm_latency_write(struct file *file, const char __user *ubuf, struct seq_file *m = file->private_data; struct drm_i915_private *dev_priv = m->private; struct drm_device *dev = &dev_priv->drm; - struct drm_modeset_acquire_ctx ctx; u16 new[8] = { 0 }; int num_levels; int level; @@ -1764,15 +1753,12 @@ static ssize_t wm_latency_write(struct file *file, const char __user *ubuf, if (ret != num_levels) return -EINVAL; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); for (level = 0; level < num_levels; level++) wm[level] = new[level]; - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); - - if (ret) - return ret; + drm_modeset_unlock_all(dev); return len; } diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c index c0ee135e5499..7e3f5c6ca484 100644 --- a/drivers/gpu/drm/i915/display/intel_overlay.c +++ b/drivers/gpu/drm/i915/display/intel_overlay.c @@ -27,7 +27,6 @@ */ #include -#include #include "gem/i915_gem_pm.h" #include "gt/intel_gpu_commands.h" @@ -1264,7 +1263,6 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data, { struct drm_intel_overlay_attrs *attrs = data; struct drm_i915_private *dev_priv = to_i915(dev); - struct drm_modeset_acquire_ctx ctx; struct intel_overlay *overlay; int ret; @@ -1274,7 +1272,7 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data, return -ENODEV; } - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); ret = -EINVAL; if (!(attrs->flags & I915_OVERLAY_UPDATE_ATTRS)) { @@ -1331,7 +1329,7 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data, ret = 0; out_unlock: - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); return ret; } diff --git a/drivers/gpu/drm/i915/display/intel_pipe_crc.c b/drivers/gpu/drm/i915/display/intel_pipe_crc.c index d0bc74904b93..8ac263f471be 100644 --- a/drivers/gpu/drm/i915/display/intel_pipe_crc.c +++ b/drivers/gpu/drm/i915/display/intel_pipe_crc.c @@ -29,8 +29,6 @@ #include #include -#include - #include "intel_atomic.h" #include "intel_de.h" #include "intel_display_types.h" @@ -78,7 +76,6 @@ static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, enum intel_pipe_crc_source *source) { struct drm_device *dev = &dev_priv->drm; - struct drm_modeset_acquire_ctx ctx; struct intel_encoder *encoder; struct intel_crtc *crtc; struct intel_digital_port *dig_port; @@ -86,7 +83,7 @@ static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, *source = INTEL_PIPE_CRC_SOURCE_PIPE; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); for_each_intel_encoder(dev, encoder) { if (!encoder->base.crtc) continue; @@ -123,7 +120,7 @@ static int i9xx_pipe_crc_auto_source(struct drm_i915_private *dev_priv, break; } } - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); return ret; } diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index e7b763ca6d10..59fb4c710c8c 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -44,7 +44,6 @@ #include #include #include -#include #include "display/intel_acpi.h" #include "display/intel_bw.h" @@ -1010,35 +1009,31 @@ static void i915_driver_postclose(struct drm_device *dev, struct drm_file *file) static void intel_suspend_encoders(struct drm_i915_private *dev_priv) { struct drm_device *dev = &dev_priv->drm; - struct drm_modeset_acquire_ctx ctx; struct intel_encoder *encoder; - int ret; if (!HAS_DISPLAY(dev_priv)) return; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); for_each_intel_encoder(dev, encoder) if (encoder->suspend) encoder->suspend(encoder); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); } static void intel_shutdown_encoders(struct drm_i915_private *dev_priv) { struct drm_device *dev = &dev_priv->drm; - struct drm_modeset_acquire_ctx ctx; struct intel_encoder *encoder; - int ret; if (!HAS_DISPLAY(dev_priv)) return; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); for_each_intel_encoder(dev, encoder) if (encoder->shutdown) encoder->shutdown(encoder); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); } void i915_driver_shutdown(struct drm_i915_private *i915) From patchwork Sat Oct 2 15:45:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532213 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 398FDC433EF for ; Sat, 2 Oct 2021 15:46:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0577561B1E for ; Sat, 2 Oct 2021 15:46:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0577561B1E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 572A26E852; Sat, 2 Oct 2021 15:45:53 +0000 (UTC) Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 331C96E84F for ; Sat, 2 Oct 2021 15:45:52 +0000 (UTC) Received: by mail-qt1-x82d.google.com with SMTP id r1so11905636qta.12 for ; Sat, 02 Oct 2021 08:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yfwLzkt6Wj9LVEwuFs8Fztnt2JiRG84Pd19yKEZ5NUI=; b=RCjeOl3uXFKjeT5y8ChtMdFtoc/DemEDcrPtZjyyw3nZp9IvM0ANzEfPHeZ2+7hrde E2W3m+jQsxKA78uoct518AU8q7TcgqEzfsNwGbs1w95du2qCMiTiRHPTTMngFVVKvoIa /HMMWjTOSnTFyWq0cc8Ne2bbt6Vx6YQ3qJHoY9he8a9z6RCfrucHGqcNVv0/CjUf/Npn 3SlhZry9Js4sVqJZDoXp/RhqxbzSElC/pVkAs05zy+9Kh0qP2ql40s8tgxPussID3TGB 1NVHQ7hxMIPKRlT1hEAJoaYyb2OKrqAEQ/B4HnGNHAH/C1uPMkjfy9Au5G7xg6LnK1qE 52mQ== 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=yfwLzkt6Wj9LVEwuFs8Fztnt2JiRG84Pd19yKEZ5NUI=; b=RJbvQKFlQElFN+4Qlk1C8l34X0suXoZNj5vS8SAyj+e2MLxIwsl9lX2gMAL7Cvd3Qi Syar+Iz/QWj9gUgrcwIKk3p54Ex6j3x/BOEJrFljXtJZlUKalrr+XtiR43RFaGUyrUdK KG7WmYKhuuRg/RwpxMnB28um5nxv07JV2lZBWQXbTEiu9KwuM6vGgQ65f237b0y4RFR3 55xfvF/6/gNZyNaPLonaXFEkD4FxB8OTjfLZS2jvH+XiB0Lgu0F9ccGFahsJx0gELI4J O/UpDoldOqvy2BjpNcTOJpdNDtUu0e5wBhgK4U171HAeBWfQduON6DlCrzeX/qOt/3EC R2jQ== X-Gm-Message-State: AOAM533hLiAgBsgcxbJ5pqgD3mFytvu/LXLhcI6S2uaYpUWZ9hSv1hEN DL7cn+11T3pmwItnsbibR2GMjvPWTY2KuQ== X-Google-Smtp-Source: ABdhPJz106eerF7z8gUKBA67+OS+VuQpCvzdGUO3aRd9DlN+U5+r0o9iIJcTO3vlaomxElGm4YZNJg== X-Received: by 2002:ac8:514f:: with SMTP id h15mr2512036qtn.340.1633189551277; Sat, 02 Oct 2021 08:45:51 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id f83sm4733612qke.79.2021.10.02.08.45.50 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:51 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 06/16] Revert "drm/msm: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:32 -0400 Message-Id: <20211002154542.15800-6-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit fd49ef52e2db015ce69ad02bab0702489d141a41. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index b89687074890..768012243b44 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -18,7 +18,6 @@ #include #include #include -#include #include "dpu_kms.h" #include "dpu_hw_lm.h" @@ -1173,15 +1172,14 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) struct drm_display_mode *mode; struct drm_framebuffer *fb; struct drm_plane_state *state; - struct drm_modeset_acquire_ctx ctx; struct dpu_crtc_state *cstate; - int i, out_width, ret; + int i, out_width; dpu_crtc = s->private; crtc = &dpu_crtc->base; - DRM_MODESET_LOCK_ALL_BEGIN(crtc->dev, ctx, 0, ret); + drm_modeset_lock_all(crtc->dev); cstate = to_dpu_crtc_state(crtc->state); mode = &crtc->state->adjusted_mode; @@ -1265,9 +1263,9 @@ static int _dpu_debugfs_status_show(struct seq_file *s, void *data) dpu_crtc->vblank_cb_time = ktime_set(0, 0); } - DRM_MODESET_LOCK_ALL_END(crtc->dev, ctx, ret); + drm_modeset_unlock_all(crtc->dev); - return ret; + return 0; } DEFINE_SHOW_ATTRIBUTE(_dpu_debugfs_status); From patchwork Sat Oct 2 15:45:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532215 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 815DBC433EF for ; Sat, 2 Oct 2021 15:46:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4D4F561B1E for ; Sat, 2 Oct 2021 15:46:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4D4F561B1E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 479AC6E854; Sat, 2 Oct 2021 15:45:55 +0000 (UTC) Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by gabe.freedesktop.org (Postfix) with ESMTPS id BED7F6E854 for ; Sat, 2 Oct 2021 15:45:53 +0000 (UTC) Received: by mail-qv1-xf33.google.com with SMTP id a14so1161821qvb.6 for ; Sat, 02 Oct 2021 08:45:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a2Ksl/yOoIp9d1OfmREGTxDmv9OxtwgpQYto7KkqAUE=; b=cIObE4WkWyD8pPouOTW7Iw4yBHSPfpFXolJD4oWmPX2SabK/TngeUSnmXuUzie2Ws6 PAEu3B1TSEfKcnoe3SumgabPHNulKxHtSZ6pzaX3PuX8nGujccW8KFicWnf1ptp0k9Pa QHJQK+zM2pUEUochw4JdQNr2GUn3TolUHB8ThWboDyGXD2iOtgNzRNiNE2gSS3XWwHWm W9hja7+e33tYNqW/IVUTbjn6aZTXYp4TDO0KCjz6lAQ5zh43Mjw4N7PxlL9pv6bTVZu0 Disu0j1a+oC9Tts6d3MI58csxwjD6MIB2fEuq+/nZeG/I+FRj3PxYschZSZer3zrBS65 mvaA== 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=a2Ksl/yOoIp9d1OfmREGTxDmv9OxtwgpQYto7KkqAUE=; b=cFio5c/EgL3UJAh77P+6MRhwTQAiLbKEePyQcsyOWR3QPHKUZOVkw5JctmAgwlyYUv 0D+0l8x0kzPNFw2GL85J76xeNiQ+a1nsoQUE0UjblnXKFjZONjjZdcIXUvv8bWz8xcFB SDEwPEWDe6ztqWwy5ww9z+BvhYo6626QdH820B26GOgQx/8lHEHX4WwPLp2AWLHnbZF0 oZ84M/CaNqArJiBo18PJgNu8WxIAZW9EWyR99VHsdvcKLU6Ilbck+EK8Biy8RR+kLLll uJkbBrp5Ie4dLsz0zugvfVMQD9VV1KXpsJJAba5isoMRrdyU0K90eHko9EzAtkYTntIw idIQ== X-Gm-Message-State: AOAM533TZ5HP5PZeZAbaQ8C3G5ePhtG0EkxdxXz7e+JR3phkTwnfW9LT l3GuXjWu+CJtHO7b6dvi6EDY9wgHUk40XQ== X-Google-Smtp-Source: ABdhPJwS3cW7UXVVWqb4PZ/fMf6T6X9i1JVY0Hu/v/MPOjMbgD4vl1KrHfRmDch3jRF/8GmfZtxQHQ== X-Received: by 2002:ad4:4a32:: with SMTP id n18mr8135938qvz.29.1633189552821; Sat, 02 Oct 2021 08:45:52 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id a2sm4683296qkk.53.2021.10.02.08.45.52 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:52 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 07/16] Revert "drm/nouveau: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:33 -0400 Message-Id: <20211002154542.15800-7-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 6aa2daae589b63e8b39fe6f7f2b59fb3063efa05. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 86e18a844953..d7b9f7f8c9e3 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -42,7 +42,6 @@ #include #include #include -#include #include @@ -668,18 +667,16 @@ nv50_audio_component_bind(struct device *kdev, struct device *hda_kdev, struct drm_device *drm_dev = dev_get_drvdata(kdev); struct nouveau_drm *drm = nouveau_drm(drm_dev); struct drm_audio_component *acomp = data; - struct drm_modeset_acquire_ctx ctx; - int ret; if (WARN_ON(!device_link_add(hda_kdev, kdev, DL_FLAG_STATELESS))) return -ENOMEM; - DRM_MODESET_LOCK_ALL_BEGIN(drm_dev, ctx, 0, ret); + drm_modeset_lock_all(drm_dev); acomp->ops = &nv50_audio_component_ops; acomp->dev = kdev; drm->audio.component = acomp; - DRM_MODESET_LOCK_ALL_END(drm_dev, ctx, ret); - return ret; + drm_modeset_unlock_all(drm_dev); + return 0; } static void @@ -689,14 +686,12 @@ nv50_audio_component_unbind(struct device *kdev, struct device *hda_kdev, struct drm_device *drm_dev = dev_get_drvdata(kdev); struct nouveau_drm *drm = nouveau_drm(drm_dev); struct drm_audio_component *acomp = data; - struct drm_modeset_acquire_ctx ctx; - int ret; - DRM_MODESET_LOCK_ALL_BEGIN(drm_dev, ctx, 0, ret); + drm_modeset_lock_all(drm_dev); drm->audio.component = NULL; acomp->ops = NULL; acomp->dev = NULL; - DRM_MODESET_LOCK_ALL_END(drm_dev, ctx, ret); + drm_modeset_unlock_all(drm_dev); } static const struct component_ops nv50_audio_component_bind_ops = { From patchwork Sat Oct 2 15:45:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532217 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84EBFC433F5 for ; Sat, 2 Oct 2021 15:46:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4EB0761B1C for ; Sat, 2 Oct 2021 15:46:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4EB0761B1C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D3BC6F4A7; Sat, 2 Oct 2021 15:45:56 +0000 (UTC) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by gabe.freedesktop.org (Postfix) with ESMTPS id 30F1C6E850 for ; Sat, 2 Oct 2021 15:45:55 +0000 (UTC) Received: by mail-qk1-x735.google.com with SMTP id p4so12198005qki.3 for ; Sat, 02 Oct 2021 08:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=42uv3L3+Ft+iMj4lATxwGma/xF0ysXtqjFk2cOsXKzw=; b=USciYRwisAW766sCM0TG7kNejDCcbPuyt/AWuTa0YYjn2Vnde3TEhVZVJhwsyK7qGJ xfO3YyoCyBEgaeS4A12T5yuMlcTwWuP3frEVFJ6SDuFWpL5XZFuosKIFm6fKAT1m2xaS IcLoVgrYr/CfevmvXUtRO8nWFCe2WjHPsq7sV+Ub9FxU6BmZUA7G9HLEF21hvRQO97R8 JUSInSk2wNNVLQTuE/coD43ssb1Tkg5usxggc5eiw80M2ZO+VNEuAsdHj50/S3qJy3Ld khwnreHNXLlkNccNyuldPF4rb7rkVjlvwKZAq3JNIDaMcgboC4KPnOyr5RkOkGurZ3sL w3DQ== 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=42uv3L3+Ft+iMj4lATxwGma/xF0ysXtqjFk2cOsXKzw=; b=C+9Sgt2445hmS3cItXemtOD9nVO+TmOYyHLzyob820dGZC5Ale1IU4aVgt6Al6a+ga TkkJHBgK5W454rsqghPjvM7hT9sbevR4ZQFpDgNQPJJRyLepBicETeDuns/TvKBTzCmL y/JYEg++1XuCtHIs/Yjbag5zN30sDR/7fLLCB1tSH0oryZm6hIrh9ZQhfGwZs8tjhZbJ JS78dzyJMfeoBLSX/BcXUK+k072xgCTkwmxbl6C6sOSu7YOWsPp3yngQE6f30FzE3eyz 0r5gEGPrEbHQdUengee/ky1zEAIVLTFDKv7zHSl9BfCSqNhZ8SVc3uOhmje5BJTowTTT vTfA== X-Gm-Message-State: AOAM533SUIBFCZXyr2oHM8wgv9oKJWu3zY5dFimf9SelH4T54x3/TziX 6blm3wmIgFAWPhXWKuEdbKWIfktLbknvMA== X-Google-Smtp-Source: ABdhPJyFswN/003RNNRts2+Fs2np3FpnafbL9bH2BV2kFj+nR4cbXLKqTvdpw2suQnTcJJVKOOnKtw== X-Received: by 2002:ae9:ed82:: with SMTP id c124mr2918341qkg.275.1633189554141; Sat, 02 Oct 2021 08:45:54 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id v17sm5225833qkp.75.2021.10.02.08.45.53 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:53 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 08/16] Revert "drm/omapdrm: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:34 -0400 Message-Id: <20211002154542.15800-8-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 6067fddc1a4fdf155787ab6182c192e4b360b73c. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/omapdrm/omap_fb.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index fa7636c13c19..190afc564914 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c @@ -9,7 +9,6 @@ #include #include #include -#include #include "omap_dmm_tiler.h" #include "omap_drv.h" @@ -63,17 +62,15 @@ static int omap_framebuffer_dirty(struct drm_framebuffer *fb, unsigned num_clips) { struct drm_crtc *crtc; - struct drm_modeset_acquire_ctx ctx; - int ret; - DRM_MODESET_LOCK_ALL_BEGIN(fb->dev, ctx, 0, ret); + drm_modeset_lock_all(fb->dev); drm_for_each_crtc(crtc, fb->dev) omap_crtc_flush(crtc); - DRM_MODESET_LOCK_ALL_END(fb->dev, ctx, ret); + drm_modeset_unlock_all(fb->dev); - return ret; + return 0; } static const struct drm_framebuffer_funcs omap_framebuffer_funcs = { From patchwork Sat Oct 2 15:45:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532219 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EE78C433F5 for ; Sat, 2 Oct 2021 15:46:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3131861B1E for ; Sat, 2 Oct 2021 15:46:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3131861B1E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B07FD6F4AC; Sat, 2 Oct 2021 15:45:57 +0000 (UTC) Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F29F6E850 for ; Sat, 2 Oct 2021 15:45:56 +0000 (UTC) Received: by mail-qt1-x82f.google.com with SMTP id e16so1746663qte.13 for ; Sat, 02 Oct 2021 08:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FDvceVguI0F5WbEAgPtWBMOP0IoACmUbR9X5+cdnRJQ=; b=FvAB1XXrdYUw9xLJ4m5fX2HJeXzb96cXfVRDX7XkySzUSSafEg0ZoFfGLA6F6fG/ep zlu86cE360EDqdYq+FSHiX2i1gjgV/Qa5cRkbY1+diVWoEyDdnNXM82Yn1F7qeY/OVAL Yj0ButMrjX56BL1Nnx53+Q9jV2PE9odu8v6J1cRz14+sfB2iHsCBEE7e+eErFVdrpsmZ Gmhcb1dXfua8DucdhBNBEIPtRruszKRrUGRl6yUh1Ncq1mFLzwmdEde7PlGGDPHwEQ8d MpWNQHL5zaCBGGOMAMj+CrgQpAixBInazvSeONz/ET50ZsExuWYxfoi4JPKvEYsi7Yqj HcOQ== 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=FDvceVguI0F5WbEAgPtWBMOP0IoACmUbR9X5+cdnRJQ=; b=f0y7gCs0HUGiLgynGBUJSsguGJZS2WuruP5XYhc0SQKeS7jKcTHpBQfxjf+pWQPCdu jHHGQC/klMOLX87qrq9OaQ6JE3QgpaabkVPIBgaMlDp3CZp/DDoivKL05+ZV3T5olOxU v8/5dFVCzMop4VXmEsB4BY7cwQnoDDoJwGqKs9bRHVgpwaTGetAek0DhkYyvdiYwT1s5 sCqy1up/g1vwf6YA8hyjPH2TKhw1U5ySJ1/9gm6bwOLSNvU4B/6sC6f0nrkhBChcGa2L s91SSNAX++WepdkfVMLviPN9v5679bsidGxUc6+6oh2Dzqn/cqrcQw98OLXB2JOp9+7A Eu/w== X-Gm-Message-State: AOAM53200OzP1128vG/JLZyWhxr8v+4y9kETvG9sw1S0b3hI1JQb87jV pDuk4dOnU+mh/mF3KVpUbFX3jAGpZp00IQ== X-Google-Smtp-Source: ABdhPJw/G0R/d8NSUnHqeJ34mrQ8R6u8eT82m+zCjbWYiLnJ6OGAPrUFQ2FTQV/lPYCBm7jqm/yx7g== X-Received: by 2002:ac8:514f:: with SMTP id h15mr2512315qtn.340.1633189555601; Sat, 02 Oct 2021 08:45:55 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id m68sm4819961qkb.105.2021.10.02.08.45.55 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:55 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 09/16] Revert "drm/radeon: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:35 -0400 Message-Id: <20211002154542.15800-9-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 26723c3d6b930775f9a85521d09655c533a839e6. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/radeon/radeon_device.c | 21 ++++++--------------- drivers/gpu/drm/radeon/radeon_dp_mst.c | 10 ++++------ 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 7e31e5ce7f61..4f0fbf667431 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -1560,8 +1559,7 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend, struct pci_dev *pdev; struct drm_crtc *crtc; struct drm_connector *connector; - struct drm_modeset_acquire_ctx ctx; - int i, r, ret; + int i, r; if (dev == NULL || dev->dev_private == NULL) { return -ENODEV; @@ -1575,15 +1573,12 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend, drm_kms_helper_poll_disable(dev); - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); /* turn off display hw */ list_for_each_entry(connector, &dev->mode_config.connector_list, head) { drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF); } - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); - - if (ret) - return ret; + drm_modeset_unlock_all(dev); /* unpin the front buffers and cursors */ list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { @@ -1668,8 +1663,7 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon) struct radeon_device *rdev = dev->dev_private; struct pci_dev *pdev = to_pci_dev(dev->dev); struct drm_crtc *crtc; - struct drm_modeset_acquire_ctx ctx; - int r, ret; + int r; if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) return 0; @@ -1747,14 +1741,11 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon) if (fbcon) { drm_helper_resume_force_mode(dev); /* turn on display hw */ - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); list_for_each_entry(connector, &dev->mode_config.connector_list, head) { drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); } - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); - - if (ret) - return ret; + drm_modeset_unlock_all(dev); } drm_kms_helper_poll_enable(dev); diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c index 3f83ee75b100..ec867fa880a4 100644 --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c @@ -4,7 +4,6 @@ #include #include #include -#include #include "atom.h" #include "ni_reg.h" @@ -738,12 +737,11 @@ static int radeon_debugfs_mst_info_show(struct seq_file *m, void *unused) struct radeon_device *rdev = (struct radeon_device *)m->private; struct drm_device *dev = rdev->ddev; struct drm_connector *connector; - struct drm_modeset_acquire_ctx ctx; struct radeon_connector *radeon_connector; struct radeon_connector_atom_dig *dig_connector; - int i, ret; + int i; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); list_for_each_entry(connector, &dev->mode_config.connector_list, head) { if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort) continue; @@ -761,8 +759,8 @@ static int radeon_debugfs_mst_info_show(struct seq_file *m, void *unused) radeon_connector->cur_stream_attribs[i].fe, radeon_connector->cur_stream_attribs[i].slots); } - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); - return ret; + drm_modeset_unlock_all(dev); + return 0; } DEFINE_SHOW_ATTRIBUTE(radeon_debugfs_mst_info); From patchwork Sat Oct 2 15:45:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532221 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1060EC433FE for ; Sat, 2 Oct 2021 15:46:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D7DC761B23 for ; Sat, 2 Oct 2021 15:46:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D7DC761B23 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 51F106F4AD; Sat, 2 Oct 2021 15:45:59 +0000 (UTC) Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by gabe.freedesktop.org (Postfix) with ESMTPS id D81946E850 for ; Sat, 2 Oct 2021 15:45:57 +0000 (UTC) Received: by mail-qk1-x733.google.com with SMTP id 138so12178881qko.10 for ; Sat, 02 Oct 2021 08:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ft6d6TMpNghlCJqgeb5VMMaDDzmyvnIfsVFHrJe8ieI=; b=VE3LB29Jv917YOIrir+uSFIoUQYweZbx+g6iuzFqzIc6HJU54ZhSsMK+6hQXodB24H HSVgbE3dTKtF62Mw3p4h8uqAWuzsOyyz84o1CIzDVnn1tC5OILku/oiB7b04JTB8Mxf/ eWgp2u88nFOWcfJf9UfiIHbb3S48TzkT4gwXuFdmoLSylg/qadpPbLR/bspWNJ4TC+9x Ujy/6NVD/RyMXj/xmu8OfyGcy/Mgoif9lRwKFzDgx1Lf2dGbdQFHinqKqAvAKP5wEHjh +fcIIKhOxe+axUuW+YNIU8qs/p2C8IpfZJaOmlUOjvEGEuvPIrqjAPB8wozwCkyw5ZzT 3qJw== 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=Ft6d6TMpNghlCJqgeb5VMMaDDzmyvnIfsVFHrJe8ieI=; b=GP+3b3q8ytCxBMru+k18xeDUqkHR1Qrk2vzD8K7eBkcsGNead88ADpy77j688XhuUG ldQ14LVH4y/pWKR7xm74Bqe1KF7WTE/8q96e6x7Rb1AV1geC3Fz5i7mujrXWuWDXl5qY 6nvOgzbTIJzRGMEY8rwMrR8JrSZq1faNMuMGPmXw8F7V0bLDf0VQ01qeDf+AOO5MDzVe da9HCOcp72hZVYRQ7psWvfOSNznZUIkALn1FBXqEQUxcpFh768n9QPL/CiktMf2mDfK8 LsYCjY6gHXxJb+JxwUFIm70HgI5bOd5aaAphgPVfQQxNAhqMRbjX0oqsm//1inlVaEOI SWBQ== X-Gm-Message-State: AOAM533SdB2YqrJr6zQE5og6PIfWcEPgjgvMidbfYLGXvoT6TnyQaKdH mIf0t4uIW0GawX245yikhFnxNP4ftUDL3Q== X-Google-Smtp-Source: ABdhPJx5qn0blFTLrM3hcIwWgN6llR7cc8WaLkq61gRr8i/kieYWvcSI+mx3Txa761R0JiHcUJ3roQ== X-Received: by 2002:a05:620a:22e:: with SMTP id u14mr2970233qkm.101.1633189556898; Sat, 02 Oct 2021 08:45:56 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id d17sm6401870qte.0.2021.10.02.08.45.56 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:56 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 10/16] Revert "drm/shmobile: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:36 -0400 Message-Id: <20211002154542.15800-10-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 9b8c437ef1a5f34686fc96b391c201a80f1a2ea0. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c index 8ee215ab614e..7db01904d18d 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c @@ -156,12 +156,10 @@ static int shmob_drm_pm_suspend(struct device *dev) static int shmob_drm_pm_resume(struct device *dev) { struct shmob_drm_device *sdev = dev_get_drvdata(dev); - struct drm_modeset_acquire_ctx ctx; - int ret; - DRM_MODESET_LOCK_ALL_BEGIN(sdev->ddev, ctx, 0, ret); + drm_modeset_lock_all(sdev->ddev); shmob_drm_crtc_resume(&sdev->crtc); - DRM_MODESET_LOCK_ALL_END(sdev->ddev, ctx, ret); + drm_modeset_unlock_all(sdev->ddev); drm_kms_helper_poll_enable(sdev->ddev); return 0; From patchwork Sat Oct 2 15:45:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532223 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4A27C433F5 for ; Sat, 2 Oct 2021 15:46:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8450661B1C for ; Sat, 2 Oct 2021 15:46:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8450661B1C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 480FE6F4AE; Sat, 2 Oct 2021 15:46:00 +0000 (UTC) Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by gabe.freedesktop.org (Postfix) with ESMTPS id 38B716E850 for ; Sat, 2 Oct 2021 15:45:59 +0000 (UTC) Received: by mail-qt1-x831.google.com with SMTP id r16so11902432qtw.11 for ; Sat, 02 Oct 2021 08:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ezMr2w2ZTkQq7+S7EIPWLLppt85Jku/rY0PIAocDono=; b=UcvZi5N1QymT64iJW0mkbdAr/acdxd7hIzM21SbSpWGnMdl001xCySFRTuwt/11QHl Rlr8JHjYqyAViJ9VSKZHmSB8NxTmP779415WTUGQn5AEZ5JcOqpHbVNSgePZqb9UFJa2 ZYLdEbjURmKu2iMubis9YfNiRnq91A4eOMvk1NEpf23j8vhdIH1l0Oj8Q6ePu2xubrzZ cnwkv1J3WWMBqAt0IWgj+/B8NKgdcr3pAxZYiucJzi1BUd/E/Y/GCrnNo4QOiMfNglj9 VaR5z8jCdhxo6/byaG9494HHOp5jRVPN2tbgkHNEKXzNp8pT02rk/J35tfMfhEA9Cqsr iZaw== 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=ezMr2w2ZTkQq7+S7EIPWLLppt85Jku/rY0PIAocDono=; b=U//da6ONMmnw3rfa8tKhQBnRFjyZb0a9Mx87jm2O5osdvCCmd8CAwXq5ax6kx0wdQn aEmUAeMg66QC4psKMDHL4bKLbgtISVTDsye7+2NDhYQSqUm8ZbmAp7bqQcFZZlMebgeu 3mryWjD/6VR/3LcTb3Wn0Llhh1EwCIKmi0oLd5DZPTMEFUppc9+PZJ6vKFPZrONEuJ2S 4lZqkKL9uAStuLvg366xS3Rw2R17YG8jWcBOOvMNfA6ADXas9NMZSUUtrypoyDFak3Bs KOo2oPXwaXa88LWCAgiSM2SAr5smSw4Zwor44iFePFdBnb07stW/xmhuenokoZeI54Lf 59MQ== X-Gm-Message-State: AOAM533MFpFgE5FYwnA8t44jIcXK1JY2M2epeICM5Dgxg7+ADioMBd5w a2jCtX4s7jxsnxFAsntjVlvu8RLpMec/DQ== X-Google-Smtp-Source: ABdhPJxc1Krs3tV5A4zZMl53j7wmUJh6nWC4/Dwv4BicUeuDeNFlOJGVNLkyiPNjHPKJcpvs29CfLw== X-Received: by 2002:aed:2791:: with SMTP id a17mr4159427qtd.193.1633189558269; Sat, 02 Oct 2021 08:45:58 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id 18sm5710949qtz.49.2021.10.02.08.45.57 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:58 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 11/16] Revert "drm/tegra: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:37 -0400 Message-Id: <20211002154542.15800-11-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit a2cd9947d99b54c959fce20dc19d81af53f4674e. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/tegra/dsi.c | 6 ++---- drivers/gpu/drm/tegra/hdmi.c | 6 ++---- drivers/gpu/drm/tegra/sor.c | 11 ++++------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index 28050c188c1c..f46d377f0c30 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "dc.h" #include "drm.h" @@ -203,11 +202,10 @@ static int tegra_dsi_show_regs(struct seq_file *s, void *data) struct tegra_dsi *dsi = node->info_ent->data; struct drm_crtc *crtc = dsi->output.encoder.crtc; struct drm_device *drm = node->minor->dev; - struct drm_modeset_acquire_ctx ctx; unsigned int i; int err = 0; - DRM_MODESET_LOCK_ALL_BEGIN(drm, ctx, 0, err); + drm_modeset_lock_all(drm); if (!crtc || !crtc->state->active) { err = -EBUSY; @@ -222,7 +220,7 @@ static int tegra_dsi_show_regs(struct seq_file *s, void *data) } unlock: - DRM_MODESET_LOCK_ALL_END(drm, ctx, err); + drm_modeset_unlock_all(drm); return err; } diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index a62de7f92414..e5d2a4026028 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "hda.h" #include "hdmi.h" @@ -1032,11 +1031,10 @@ static int tegra_hdmi_show_regs(struct seq_file *s, void *data) struct tegra_hdmi *hdmi = node->info_ent->data; struct drm_crtc *crtc = hdmi->output.encoder.crtc; struct drm_device *drm = node->minor->dev; - struct drm_modeset_acquire_ctx ctx; unsigned int i; int err = 0; - DRM_MODESET_LOCK_ALL_BEGIN(drm, ctx, 0, err); + drm_modeset_lock_all(drm); if (!crtc || !crtc->state->active) { err = -EBUSY; @@ -1051,7 +1049,7 @@ static int tegra_hdmi_show_regs(struct seq_file *s, void *data) } unlock: - DRM_MODESET_LOCK_ALL_END(drm, ctx, err); + drm_modeset_unlock_all(drm); return err; } diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 3d1c8b3d1358..0ea320c1092b 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "dc.h" #include "dp.h" @@ -1491,11 +1490,10 @@ static int tegra_sor_show_crc(struct seq_file *s, void *data) struct tegra_sor *sor = node->info_ent->data; struct drm_crtc *crtc = sor->output.encoder.crtc; struct drm_device *drm = node->minor->dev; - struct drm_modeset_acquire_ctx ctx; int err = 0; u32 value; - DRM_MODESET_LOCK_ALL_BEGIN(drm, ctx, 0, err); + drm_modeset_lock_all(drm); if (!crtc || !crtc->state->active) { err = -EBUSY; @@ -1524,7 +1522,7 @@ static int tegra_sor_show_crc(struct seq_file *s, void *data) seq_printf(s, "%08x\n", value); unlock: - DRM_MODESET_LOCK_ALL_END(drm, ctx, err); + drm_modeset_unlock_all(drm); return err; } @@ -1654,11 +1652,10 @@ static int tegra_sor_show_regs(struct seq_file *s, void *data) struct tegra_sor *sor = node->info_ent->data; struct drm_crtc *crtc = sor->output.encoder.crtc; struct drm_device *drm = node->minor->dev; - struct drm_modeset_acquire_ctx ctx; unsigned int i; int err = 0; - DRM_MODESET_LOCK_ALL_BEGIN(drm, ctx, 0, err); + drm_modeset_lock_all(drm); if (!crtc || !crtc->state->active) { err = -EBUSY; @@ -1673,7 +1670,7 @@ static int tegra_sor_show_regs(struct seq_file *s, void *data) } unlock: - DRM_MODESET_LOCK_ALL_END(drm, ctx, err); + drm_modeset_unlock_all(drm); return err; } From patchwork Sat Oct 2 15:45:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532225 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 618A3C433F5 for ; Sat, 2 Oct 2021 15:46:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3363F61B1C for ; Sat, 2 Oct 2021 15:46:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3363F61B1C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B5316F4B2; Sat, 2 Oct 2021 15:46:03 +0000 (UTC) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8B99F6F4B0 for ; Sat, 2 Oct 2021 15:46:00 +0000 (UTC) Received: by mail-qk1-x72c.google.com with SMTP id i132so12240765qke.1 for ; Sat, 02 Oct 2021 08:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qygAcBAWFsoOhpHahIhQmNbnPqS/eGrHT7CMxH+Ayqw=; b=COBVGE27xTU+QE8WQmBhKLRmiBNgibqSp2qtJrQhCcxHMkQkjYyeyNlUdl6C+AQfu1 BcQE6uQfty834vUeGqdmq/HBMnIcUZ6VWPCwoeooMzZii7WKFYWgyEQzEUoI/u2Y9RQq ewAjO9gpuDXgNRJ/Ioyx2THP358a58QmsPki88noKirgQqlzLhShAbaaUxU7BQkPLZon si8IMaTm/akhBY3cJ+QtM/HLLzaHbC+uzG6T/GHPjvh7UVKRnbmQkvXUNIxkpALnAgHU xa4KsAs4oa9OMFQWOG1XN8SVZ0rutaAMBjncgerAVGtVgCfIlp6ZeC9tLvhm1aCHtgJE 2fCA== 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=qygAcBAWFsoOhpHahIhQmNbnPqS/eGrHT7CMxH+Ayqw=; b=gtaUwu0GLTbcU2g7mDtKOZq/2uXLRJ9zBXVDL8rmBWDcdpeInqqcXyfemOq3kO8xZ+ Z9+ONPXwJfiDFH7YxtM17UDY6qKeCVwy7rPT76sdCXOh+16e2gvLexS0qVRptv0IAIxi TCZjfUCVquQ4ebE9xSj/GuPtZ8H2YDD/fBH9dy378TTQ0Kccjo/pdPWnxqCkUeJVH2IC mjt5Hr1VgVyCQYAorgHJ5VjobbyrvCaI3ePyk9DUiOfBO7Nrlv8L7tjbWubK9R9+a6n4 7BuFsD4xoRUvIRNFJVT/X6tkqrQmYQOxh/bAaGkN9pHJ0MKtuhULAw1M6N9ib0wMv0Eo LDvQ== X-Gm-Message-State: AOAM532l0DjVKfFUAFpgmer5+K+3SRRduZJDU6NfiMTQzyW+qE/yqCcH al/ErgUc7+jUw7xtwa7dpESxVhKvNZIMTw== X-Google-Smtp-Source: ABdhPJwv1l3CExyL+wooUQcn8ZX5fAr3rg3gs7CqKxwLP1rzUdNcsOS4+oRtv5hxoil7py1dWGCldA== X-Received: by 2002:a37:a985:: with SMTP id s127mr2860534qke.214.1633189559583; Sat, 02 Oct 2021 08:45:59 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id u189sm4725214qkh.14.2021.10.02.08.45.59 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:45:59 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 12/16] Revert "drm/vmwgfx: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:38 -0400 Message-Id: <20211002154542.15800-12-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 6b92e77156c5adf6606c8ad825c71404417d88af. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 11 ++++------- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 12 ++++-------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index 7df35c6f1458..28af34ab6ed6 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c @@ -28,7 +28,6 @@ #include "vmwgfx_drv.h" #include "vmwgfx_devcaps.h" #include -#include #include "vmwgfx_kms.h" int vmw_getparam_ioctl(struct drm_device *dev, void *data, @@ -173,7 +172,6 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, struct drm_vmw_rect __user *clips_ptr; struct drm_vmw_rect *clips = NULL; struct drm_framebuffer *fb; - struct drm_modeset_acquire_ctx ctx; struct vmw_framebuffer *vfb; struct vmw_resource *res; uint32_t num_clips; @@ -205,7 +203,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, goto out_no_copy; } - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); fb = drm_framebuffer_lookup(dev, file_priv, arg->fb_id); if (!fb) { @@ -233,7 +231,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data, out_no_surface: drm_framebuffer_put(fb); out_no_fb: - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); out_no_copy: kfree(clips); out_clips: @@ -252,7 +250,6 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, struct drm_vmw_rect __user *clips_ptr; struct drm_vmw_rect *clips = NULL; struct drm_framebuffer *fb; - struct drm_modeset_acquire_ctx ctx; struct vmw_framebuffer *vfb; uint32_t num_clips; int ret; @@ -283,7 +280,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, goto out_no_copy; } - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); fb = drm_framebuffer_lookup(dev, file_priv, arg->fb_id); if (!fb) { @@ -306,7 +303,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data, out_no_ttm_lock: drm_framebuffer_put(fb); out_no_fb: - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); out_no_copy: kfree(clips); out_clips: diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 268095cb8c84..74fa41909213 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -33,7 +33,6 @@ #include #include #include -#include #include "vmwgfx_kms.h" @@ -244,17 +243,15 @@ void vmw_kms_legacy_hotspot_clear(struct vmw_private *dev_priv) struct drm_device *dev = &dev_priv->drm; struct vmw_display_unit *du; struct drm_crtc *crtc; - struct drm_modeset_acquire_ctx ctx; - int ret; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); drm_for_each_crtc(crtc, dev) { du = vmw_crtc_to_du(crtc); du->hotspot_x = 0; du->hotspot_y = 0; } - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); } void vmw_kms_cursor_post_execbuf(struct vmw_private *dev_priv) @@ -1015,10 +1012,9 @@ static int vmw_framebuffer_bo_dirty(struct drm_framebuffer *framebuffer, struct vmw_framebuffer_bo *vfbd = vmw_framebuffer_to_vfbd(framebuffer); struct drm_clip_rect norect; - struct drm_modeset_acquire_ctx ctx; int ret, increment = 1; - DRM_MODESET_LOCK_ALL_BEGIN((&dev_priv->drm), ctx, 0, ret); + drm_modeset_lock_all(&dev_priv->drm); if (!num_clips) { num_clips = 1; @@ -1044,7 +1040,7 @@ static int vmw_framebuffer_bo_dirty(struct drm_framebuffer *framebuffer, vmw_cmd_flush(dev_priv, false); - DRM_MODESET_LOCK_ALL_END((&dev_priv->drm), ctx, ret); + drm_modeset_unlock_all(&dev_priv->drm); return ret; } From patchwork Sat Oct 2 15:45:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532227 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA978C433EF for ; Sat, 2 Oct 2021 15:46:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BDA4B61B21 for ; Sat, 2 Oct 2021 15:46:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BDA4B61B21 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E651F6F4B0; Sat, 2 Oct 2021 15:46:03 +0000 (UTC) Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 180176F4B2 for ; Sat, 2 Oct 2021 15:46:02 +0000 (UTC) Received: by mail-qv1-xf2c.google.com with SMTP id n6so7447030qvp.7 for ; Sat, 02 Oct 2021 08:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OTNw2YMEXoH/mgbT1Zrk1/SV+kbOfqnN+Iv25LvBHNM=; b=YqVAvkIQhDYK4VlusHjndYDflqQ4aMDs5NidBExEBE9S6KoANwLaQqNMvkM4Iaj1xB vCiGBcEKbu5xaQh6VCODX7T5j8np3ThXAJCunr73KMvKT2JlpqfTS2WKM3ye8xRGGd4o dEMn96uVwHIxWlx19o0EG2sCk5+JodVbVBNxfUYX7PPf+GUV4Wz1TEozU2xdorQcjTkU YLuxj8fXPv2lM3p/Gh+L8Pe6XEuy0zGE2Jq/QYakrgUJSkVJRWowqqoIqbMf3It4hioy wBFDDSwxpstrUbzOlg/jZlGLTglh+Wvag78but/p8oq1BPAPGPcmcMc53Uir2QSySMxN GkxA== 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=OTNw2YMEXoH/mgbT1Zrk1/SV+kbOfqnN+Iv25LvBHNM=; b=14f/7KtVqr5AALdaYS0Z13qJq1/T9k0U9u+e173YwjGPgzIwoWVlSP7nW/uW7HcsGS 8vp9AaxdiLsrRzz3xNXpQiJnGA4kBDQiZZHJUb3V6sKvoK9fOUIh1LBfloD5GIorrRBh DlQWKGE4teDurg3MAfRFMvDFgWEubLadeWX7qlkOwU+Uogf5reYnb6myUh4ZYwB76BJb YRrRcsnpjyhHhvhVlpkTXTs+4RtPiz8kwE/ekiv+x+9ZrBrMpMwzjs3suFs1p8WCJ4J0 tx9dVyE+b1H5/thbeJIChNy6BImrjkaAeVTHbnGPNfPYH3ZEoY5Rkted8uzTQgo8mYIf njyg== X-Gm-Message-State: AOAM5337i+ChxQXgtAV8TpxGKlt19UhZC0ztZ4t1WQTT4Nal1J/ODc1v yGKDvlQI0yMXker83DFEvfP2UvwOFOn2LA== X-Google-Smtp-Source: ABdhPJw6AGwI0rWLODncQ//cViX0H50Cam+jcWxRoqKqeqJlfXwkJeyGv6X1Ua7mqk2Uwjv/lGHnJQ== X-Received: by 2002:a0c:e310:: with SMTP id s16mr2703038qvl.11.1633189560909; Sat, 02 Oct 2021 08:46:00 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id l7sm5456942qth.81.2021.10.02.08.46.00 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:46:00 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 13/16] Revert "drm: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:39 -0400 Message-Id: <20211002154542.15800-13-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 7c5f2eecc21f44fba1b1f13ce09c2533db9d781a. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/drm_client_modeset.c | 5 ++--- drivers/gpu/drm/drm_crtc_helper.c | 18 ++++++------------ drivers/gpu/drm/drm_fb_helper.c | 10 ++++------ drivers/gpu/drm/drm_framebuffer.c | 6 ++---- 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index 43f772543d2a..5f5184f071ed 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -1062,10 +1062,9 @@ static int drm_client_modeset_commit_legacy(struct drm_client_dev *client) struct drm_device *dev = client->dev; struct drm_mode_set *mode_set; struct drm_plane *plane; - struct drm_modeset_acquire_ctx ctx; int ret = 0; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); drm_for_each_plane(plane, dev) { if (plane->type != DRM_PLANE_TYPE_PRIMARY) drm_plane_force_disable(plane); @@ -1094,7 +1093,7 @@ static int drm_client_modeset_commit_legacy(struct drm_client_dev *client) goto out; } out: - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); return ret; } diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index f3ce073dff79..bff917531f33 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -218,14 +218,11 @@ static void __drm_helper_disable_unused_functions(struct drm_device *dev) */ void drm_helper_disable_unused_functions(struct drm_device *dev) { - struct drm_modeset_acquire_ctx ctx; - int ret; - WARN_ON(drm_drv_uses_atomic_modeset(dev)); - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); __drm_helper_disable_unused_functions(dev); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); } EXPORT_SYMBOL(drm_helper_disable_unused_functions); @@ -945,14 +942,12 @@ void drm_helper_resume_force_mode(struct drm_device *dev) struct drm_crtc *crtc; struct drm_encoder *encoder; const struct drm_crtc_helper_funcs *crtc_funcs; - struct drm_modeset_acquire_ctx ctx; int encoder_dpms; bool ret; - int err; WARN_ON(drm_drv_uses_atomic_modeset(dev)); - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, err); + drm_modeset_lock_all(dev); drm_for_each_crtc(crtc, dev) { if (!crtc->enabled) @@ -987,7 +982,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev) /* disable the unused connectors while restoring the modesetting */ __drm_helper_disable_unused_functions(dev); - DRM_MODESET_LOCK_ALL_END(dev, ctx, err); + drm_modeset_unlock_all(dev); } EXPORT_SYMBOL(drm_helper_resume_force_mode); @@ -1007,10 +1002,9 @@ EXPORT_SYMBOL(drm_helper_resume_force_mode); int drm_helper_force_disable_all(struct drm_device *dev) { struct drm_crtc *crtc; - struct drm_modeset_acquire_ctx ctx; int ret = 0; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); drm_for_each_crtc(crtc, dev) if (crtc->enabled) { struct drm_mode_set set = { @@ -1022,7 +1016,7 @@ int drm_helper_force_disable_all(struct drm_device *dev) goto out; } out: - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); return ret; } EXPORT_SYMBOL(drm_helper_force_disable_all); diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 6860223f0068..3ab078321045 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -940,11 +940,10 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) struct drm_fb_helper *fb_helper = info->par; struct drm_mode_set *modeset; struct drm_crtc *crtc; - struct drm_modeset_acquire_ctx ctx; u16 *r, *g, *b; int ret = 0; - DRM_MODESET_LOCK_ALL_BEGIN(fb_helper->dev, ctx, 0, ret); + drm_modeset_lock_all(fb_helper->dev); drm_client_for_each_modeset(modeset, &fb_helper->client) { crtc = modeset->crtc; if (!crtc->funcs->gamma_set || !crtc->gamma_size) { @@ -971,7 +970,7 @@ static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info) goto out; } out: - DRM_MODESET_LOCK_ALL_END(fb_helper->dev, ctx, ret); + drm_modeset_unlock_all(fb_helper->dev); return ret; } @@ -1442,11 +1441,10 @@ static int pan_display_legacy(struct fb_var_screeninfo *var, struct drm_fb_helper *fb_helper = info->par; struct drm_client_dev *client = &fb_helper->client; struct drm_mode_set *modeset; - struct drm_modeset_acquire_ctx ctx; int ret = 0; mutex_lock(&client->modeset_mutex); - DRM_MODESET_LOCK_ALL_BEGIN(fb_helper->dev, ctx, 0, ret); + drm_modeset_lock_all(fb_helper->dev); drm_client_for_each_modeset(modeset, client) { modeset->x = var->xoffset; modeset->y = var->yoffset; @@ -1459,7 +1457,7 @@ static int pan_display_legacy(struct fb_var_screeninfo *var, } } } - DRM_MODESET_LOCK_ALL_END(fb_helper->dev, ctx, ret); + drm_modeset_unlock_all(fb_helper->dev); mutex_unlock(&client->modeset_mutex); return ret; diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 205e9aa9a409..07f5abc875e9 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -1059,10 +1059,8 @@ static void legacy_remove_fb(struct drm_framebuffer *fb) struct drm_device *dev = fb->dev; struct drm_crtc *crtc; struct drm_plane *plane; - struct drm_modeset_acquire_ctx ctx; - int ret; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_lock_all(dev); /* remove from any CRTC */ drm_for_each_crtc(crtc, dev) { if (crtc->primary->fb == fb) { @@ -1084,7 +1082,7 @@ static void legacy_remove_fb(struct drm_framebuffer *fb) drm_plane_force_disable(plane); } } - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + drm_modeset_unlock_all(dev); } /** From patchwork Sat Oct 2 15:45:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532229 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 745D0C433FE for ; Sat, 2 Oct 2021 15:46:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F74061B1C for ; Sat, 2 Oct 2021 15:46:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3F74061B1C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E032B6F4B4; Sat, 2 Oct 2021 15:46:05 +0000 (UTC) Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 40CC26F4B0 for ; Sat, 2 Oct 2021 15:46:03 +0000 (UTC) Received: by mail-qv1-xf2a.google.com with SMTP id d1so836684qvl.12 for ; Sat, 02 Oct 2021 08:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cXCmTQVcRlhOzRrqQMTEyk3XlH7A4pvQkLIMcAdJ9A8=; b=StEZysN+dadV9HWL4sUcR9hsztIdc+4Dbz2OnIbhHVi/bCbph3w/MKfDWGOyZq2sE3 mqiXxxaoxotykxzcdyifwwvki9SaFWM+Gj0//o3wEHa8T+nAJ9R96Vf92X1WxQ2VlM7a aQ4d6za0GrrCpP5P5yeFchVnUc6LrJZYG89a51B5z+48ReheMfVxu/eMjp7KQsU3x/qL btDRCldir7ES3lHvz9F97nF4Sub3gJNPTnLRmxXwYlP0TiRq4vNo13kVBq/uNAC9ZwvU ORlGFHd6qpiQrXx11BR6D4ZCCSbrc1/GYL+DEU2EVB4nOIO+//r3iKYKtDvl/keLl9Vk l0EQ== 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=cXCmTQVcRlhOzRrqQMTEyk3XlH7A4pvQkLIMcAdJ9A8=; b=lqeL7EVLm7cLp9HCRqOVYAcgRAcLY2I/ceZhVVQ0uC1gXQB3Bk4/fvuP9GPWkKR8XX hUj6kLSTjQIopdY/SH9VYaebbUY7EkSZSvTDdUB4YHFgG6yjgopTIEmO9/EQC1BoJ/gY nQG/gWH6+xt9fshuFFlYWGr35OKN9boKWAUoY3dXxYq3PTA1vuiJtAnaMonemtiLkgBH VTGT3Bz1IoO8g31X+xr6oLqU8wtekHdvPdn7MszN6LaGfCMzg11/AURqOUC70/LIA8d/ /UN6JCek2gV71/5/xijNFoHtf8Szjb4jY1JAvniiC/wfVATh8OjdemAcGkV54qeZb4gp Jhxg== X-Gm-Message-State: AOAM530hMWMIDs/bB5R36xgIPLMt/Xmf2nECqihS3NnJUOgAobTOWszf nafey9kH/V4J1onOuPlrrX4xyk+zF0yORQ== X-Google-Smtp-Source: ABdhPJwOgYCaCyfZAV9Dg9YCSWbfGEN2QypPksS+v2dpgjgdhFcLtLMxzfeehRw3zgWe10WlX+lARA== X-Received: by 2002:a05:6214:1269:: with SMTP id r9mr14511937qvv.35.1633189562258; Sat, 02 Oct 2021 08:46:02 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id r10sm4861730qkk.95.2021.10.02.08.46.01 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:46:02 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 14/16] Revert "drm/msm: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:40 -0400 Message-Id: <20211002154542.15800-14-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 4c048437ef7adb2d81fe4ddc5c04179126eefcf2. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c index abda52f09b09..cabe15190ec1 100644 --- a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c +++ b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c @@ -5,8 +5,6 @@ #define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__ -#include - #include "msm_disp_snapshot.h" static void msm_disp_state_dump_regs(u32 **reg, u32 aligned_len, void __iomem *base_addr) @@ -101,18 +99,20 @@ static void msm_disp_capture_atomic_state(struct msm_disp_state *disp_state) { struct drm_device *ddev; struct drm_modeset_acquire_ctx ctx; - int ret; disp_state->timestamp = ktime_get(); ddev = disp_state->drm_dev; - DRM_MODESET_LOCK_ALL_BEGIN(ddev, ctx, 0, ret); + drm_modeset_acquire_init(&ctx, 0); + + while (drm_modeset_lock_all_ctx(ddev, &ctx) != 0) + drm_modeset_backoff(&ctx); disp_state->atomic_state = drm_atomic_helper_duplicate_state(ddev, &ctx); - - DRM_MODESET_LOCK_ALL_END(ddev, ctx, ret); + drm_modeset_drop_locks(&ctx); + drm_modeset_acquire_fini(&ctx); } void msm_disp_snapshot_capture_state(struct msm_disp_state *disp_state) From patchwork Sat Oct 2 15:45:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532231 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E35D0C433EF for ; Sat, 2 Oct 2021 15:46:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B719D61B1E for ; Sat, 2 Oct 2021 15:46:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B719D61B1E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C18536F4B3; Sat, 2 Oct 2021 15:46:05 +0000 (UTC) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 760E76F4B3 for ; Sat, 2 Oct 2021 15:46:04 +0000 (UTC) Received: by mail-qt1-x82b.google.com with SMTP id j13so11952213qtq.6 for ; Sat, 02 Oct 2021 08:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YGu7HS3q7vp4215UEX9eUXFM4TcIudbW7tcMBeFTMTk=; b=OiuRE/Ldo7Sd00BHfv4yswSuYIra/5ssuWXmZ08qWBEe5v4/rvaMh2/dnRsQzPbtu3 UaKegs/sVIlqdIC52+ckyvYEVHr2vWysIEqW/VmXDr11uqc0p/Kz+OPI1Y0SAaKxSu+s AoQaZfzxyezhLCVmmTyXoxQeu/gaOSLF0Y128nzlMkGQI3hhj/B/IKg56PD0rzzlI73c IVyR+EgMN1nYHtB7qWX6TBL3uAE4BT+kzuZPshUL3D8SqpDpQRr4nM3iq8dyI+bTgrq2 dV82pev/vtQesJG9VirdiXPTRAu3DaxVvrAn3bdZ0afh8kv3hkGOPY3yE3Dp/tdyKnxp S1ww== 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=YGu7HS3q7vp4215UEX9eUXFM4TcIudbW7tcMBeFTMTk=; b=z7yLH+3kUyJudKJhwRXiAbZo+PjkAzBdjDeYVrSpNFSOAMQ6m9P6+IBquVd52xTtnF 1zMFgvTAl4cNQYrAUjtx7saTZmWvjmHZxDwpt2MSQyYuZc3mUOJ/cpZ01oEqzbm0Zzhk r01GEZWbkyopBP69InI1IpPEE9oRnIEpzEmyXeHc0OgfggZ6U+xAynE1xvzUshz/AnRW RmmyYkcQIeTwxlZbYeaoNseVxrX1GG9ZmtHVg2JV61SEsP0Jv6RXqtJiVFx0LZa0Bw0g m/eyQ6We4z/M7TdVhqh3BouMTbJehZU9I3VJrRiq+51EgnPRuLc6kebfc88xR0Lv426B 0dcg== X-Gm-Message-State: AOAM530QPwLIs9Ne42Cknu1sqV7uiuvCG7SJ6COKmFH7O/GtkVzLOrgd 3fOc93keEbYC6uZz64ezqtv8rBkFztGLEw== X-Google-Smtp-Source: ABdhPJyllzgtupSol7d1am+p/lwxqMzKKFuFG6BCrF9JhkWq+0Hc0Qlqw217LTXy6Qg0tWjQLwd2FQ== X-Received: by 2002:ac8:4248:: with SMTP id r8mr4091878qtm.288.1633189563563; Sat, 02 Oct 2021 08:46:03 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id v201sm4836651qkb.29.2021.10.02.08.46.03 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:46:03 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 15/16] Revert "drm/i915: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:41 -0400 Message-Id: <20211002154542.15800-15-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 399190e70816886e2bca1f3f3bc3d9c544af88e7. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul Acked-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 2bf01416d656..134a6acbd8fb 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -43,7 +43,6 @@ #include #include #include -#include #include "display/intel_audio.h" #include "display/intel_crt.h" @@ -13477,13 +13476,22 @@ void intel_display_resume(struct drm_device *dev) if (state) state->acquire_ctx = &ctx; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); + drm_modeset_acquire_init(&ctx, 0); - ret = __intel_display_resume(dev, state, &ctx); + while (1) { + ret = drm_modeset_lock_all_ctx(dev, &ctx); + if (ret != -EDEADLK) + break; - intel_enable_ipc(dev_priv); + drm_modeset_backoff(&ctx); + } + + if (!ret) + ret = __intel_display_resume(dev, state, &ctx); - DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); + intel_enable_ipc(dev_priv); + drm_modeset_drop_locks(&ctx); + drm_modeset_acquire_fini(&ctx); if (ret) drm_err(&dev_priv->drm, From patchwork Sat Oct 2 15:45:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 12532233 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EDDEC433F5 for ; Sat, 2 Oct 2021 15:46:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E83661B1E for ; Sat, 2 Oct 2021 15:46:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1E83661B1E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 875BC6F4B9; Sat, 2 Oct 2021 15:46:08 +0000 (UTC) Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 142716F4B5 for ; Sat, 2 Oct 2021 15:46:06 +0000 (UTC) Received: by mail-qv1-xf2f.google.com with SMTP id x8so7474913qvp.1 for ; Sat, 02 Oct 2021 08:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w1vz8fSO77bQeX6N4IZds+BsV7GNUQEtmOFqElpsOpQ=; b=YW7EpHqLqB7sWdf9Bt2OVhybWZ3OlpQQ2d692kdivtauWqCJZTOL26SgNMbpc5aiB6 aorOS1qfPAYeiq/vdRJ+i3AE8CEwoywSLZgvbJ4n/d/wtsWsCO4xbqTnqLaVaWB8oqcv cKJm1d9ZvHeCcEySyZHMn6oO7xWtc+JqCGMnt3IfUYeJFULzlSmfZeNvpEljCALYfKXE rk65eS1dpgisCcRvUFMVwoOuBZ2+pFgHt4+NmDYfjFuHRJVapUWiEZV3B96ck2R3DpgQ PC1B/h/FUbZkD1SozVuTBxxYu7mdLxShRv2J0iZvmJaY7ukuTuk9t/vd/SPWuHyk0N58 Lgsw== 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=w1vz8fSO77bQeX6N4IZds+BsV7GNUQEtmOFqElpsOpQ=; b=yPqk3fibEgesNho6/WWk+xuOHIjqlmbqCNx9Ul17A9LTJpOb7JpOpLbqJEEYSYULip PjTvvHEfSU+dpR0CV5vrkv3DDIXsJL7e+5RV4M+nxNwtCOYdFSPluW1UmIRoDuC0bG5h eoLyBXSfhPb6nbVmyncMUrkJYI2zs55UCFhuN06Eu8k7E/5mzpDlRhA2sK9C8Y1pYauP XcwQooybu8TgUJ0jdC7afjwv/B+fZ7wRhXpQu5/qTqZLiBlgx/C5khgvRZt3HJNHDfFp yNYTPmetC+14XwBTCwSqvIE4900lcA1qAD8YvTkhwch5R3V984LkDBuLDVWaxCeM/kI0 cT/g== X-Gm-Message-State: AOAM531SdHzb0Qou+PzXhIgWPyrfgG7NRWm/Ch7zda7JHFY4u6qc/SSA tyqljI8IVn9NMm8YJw9KfNBCZaIIHeOiPw== X-Google-Smtp-Source: ABdhPJyx7YAkLllNGmz+gWG1sZDNUG4A0kbtSqk7aTBUV53mX9rwqhV/g4pZ9r/RzIQIBk4Ju10tmg== X-Received: by 2002:a0c:912b:: with SMTP id q40mr8009221qvq.9.1633189565158; Sat, 02 Oct 2021 08:46:05 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id x6sm5181145qts.79.2021.10.02.08.46.04 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Oct 2021 08:46:04 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org Cc: Sean Paul , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Fernando Ramos Subject: [PATCH 16/16] Revert "drm: cleanup: drm_modeset_lock_all_ctx() --> DRM_MODESET_LOCK_ALL_BEGIN()" Date: Sat, 2 Oct 2021 11:45:42 -0400 Message-Id: <20211002154542.15800-16-sean@poorly.run> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20211002154542.15800-1-sean@poorly.run> References: <20211002154542.15800-1-sean@poorly.run> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Sean Paul This reverts commit 21dde40902d2636f70766b3154931de57e1215e9. This patchset breaks on intel platforms and was previously NACK'd by Ville. Cc: Ville Syrjälä Cc: Fernando Ramos Signed-off-by: Sean Paul --- drivers/gpu/drm/drm_client_modeset.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c index 5f5184f071ed..ced09c7c06f9 100644 --- a/drivers/gpu/drm/drm_client_modeset.c +++ b/drivers/gpu/drm/drm_client_modeset.c @@ -574,7 +574,6 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, int num_connectors_detected = 0; int num_tiled_conns = 0; struct drm_modeset_acquire_ctx ctx; - int err; if (!drm_drv_uses_atomic_modeset(dev)) return false; @@ -586,7 +585,10 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, if (!save_enabled) return false; - DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, err); + drm_modeset_acquire_init(&ctx, 0); + + while (drm_modeset_lock_all_ctx(dev, &ctx) != 0) + drm_modeset_backoff(&ctx); memcpy(save_enabled, enabled, count); mask = GENMASK(count - 1, 0); @@ -741,7 +743,8 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, ret = false; } - DRM_MODESET_LOCK_ALL_END(dev, ctx, err); + drm_modeset_drop_locks(&ctx); + drm_modeset_acquire_fini(&ctx); kfree(save_enabled); return ret;