From patchwork Tue Jun 23 15:58:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 11621015 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9D6E13B1 for ; Tue, 23 Jun 2020 15:59:59 +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 C8B1620780 for ; Tue, 23 Jun 2020 15:59:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=poorly.run header.i=@poorly.run header.b="cNcp9ivQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8B1620780 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 36C5C6E9F0; Tue, 23 Jun 2020 15:59:48 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 082DD6E9E1 for ; Tue, 23 Jun 2020 15:59:31 +0000 (UTC) Received: by mail-qv1-xf44.google.com with SMTP id t7so1038531qvl.8 for ; Tue, 23 Jun 2020 08:59:30 -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; bh=po396SUur7Ag9gV2dtCVz40SdlSEgGYjFmEg0HhFQpE=; b=cNcp9ivQznIVbPdxd+N0kAQoXXLz7UQMHOW9Zd1C/zCrvuSRyP+T3t+hicCfUHZH4L bLyoYIcrZv/lXi5618uydTJMzGmJZWb+WGOg4W8WqtvoFbgN+Ub8Vs+plgQHHRslUwJf foxxwfaW+Ojj4FRbj1n0PpEhTslDfe5niDUQfGFE0niUeBigBwQgX+DeEjpcmv+SuVbk 3cthOLVYn9JFR1qf7ipZtchkjoMFZrULynqlyfGghbPi18w61HIkW6n998876RhtHwsy 8aRcq/2jf9jQJsDERBm05KtrArtKBzpvIAf80B9fci8E+9b8RwbKtAhKKo2GvGJRppPd TlPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=po396SUur7Ag9gV2dtCVz40SdlSEgGYjFmEg0HhFQpE=; b=C3g0WoyZhKmP8Ri51KxTmZ2NVKVLYusUQYKMxM4DLPRlDDxr1zqp82hkkcV0Y2j23m D2ditzg1BVcE4tlnsB9q9cO4C0LRcmiZR7kCcVEPJjwllIbTCUNy/oMENIdQGzw8aaGF VXxAxbUhF5o0IoJWqbB1JW9btJFEXVIIrLETK/126YCzFC+NmNQxyx6+8BIGYIT3v1j0 piIauiSDkGP5Hc2PfgiRd1+YwpDdX+m5atqMI1SHxVZ19nQ2sfiwZYO6aXJXfiUnO2Hh Y524J9v2CLnOYVwFHzP19bAUZLHkC8LiI6qtprIjBcUgWS8Tw4Wt+GVihk/pfMKBQXtQ /LnQ== X-Gm-Message-State: AOAM533AaSUtATHyUMA4TXtRyg1nylnEsiG7GLCHfG3EBX/WXzz90xZp /h3YnNJCr14AoPMiVCxSv91DoA== X-Google-Smtp-Source: ABdhPJyZfdD0KasXmPQN/jSX0wIJPxYUCaU1k7ycvnkh+UHvAoAvGGTGMTXim9mihyusNMniGV/DyQ== X-Received: by 2002:a05:6214:10e1:: with SMTP id q1mr25693333qvt.78.1592927970138; Tue, 23 Jun 2020 08:59:30 -0700 (PDT) Received: from localhost ([166.137.96.174]) by smtp.gmail.com with ESMTPSA id r185sm894065qkb.39.2020.06.23.08.59.29 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jun 2020 08:59:29 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Date: Tue, 23 Jun 2020 11:58:58 -0400 Message-Id: <20200623155907.22961-9-sean@poorly.run> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200623155907.22961-1-sean@poorly.run> References: <20200623155907.22961-1-sean@poorly.run> Subject: [Intel-gfx] [PATCH v7 08/17] drm/i915: Clean up intel_hdcp_disable X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: daniel.vetter@ffwll.ch, Sean Paul MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Sean Paul Add an out label and un-indent hdcp disable in preparation for hdcp_mutex. No functional changes Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20200429195502.39919-9-sean@poorly.run #v6 Changes in v7: -Split into separate patch (Ramalingam) Reviewed-by: Anshuman Gupta Reviewed-by: Ramalingam C --- drivers/gpu/drm/i915/display/intel_hdcp.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c index 62cab3aea745..16bf0fbe5f17 100644 --- a/drivers/gpu/drm/i915/display/intel_hdcp.c +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c @@ -2113,16 +2113,17 @@ int intel_hdcp_disable(struct intel_connector *connector) mutex_lock(&hdcp->mutex); - if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) { - intel_hdcp_update_value(connector, - DRM_MODE_CONTENT_PROTECTION_UNDESIRED, - false); - if (hdcp->hdcp2_encrypted) - ret = _intel_hdcp2_disable(connector); - else if (hdcp->hdcp_encrypted) - ret = _intel_hdcp_disable(connector); - } + if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_UNDESIRED) + goto out; + intel_hdcp_update_value(connector, + DRM_MODE_CONTENT_PROTECTION_UNDESIRED, false); + if (hdcp->hdcp2_encrypted) + ret = _intel_hdcp2_disable(connector); + else if (hdcp->hdcp_encrypted) + ret = _intel_hdcp_disable(connector); + +out: mutex_unlock(&hdcp->mutex); cancel_delayed_work_sync(&hdcp->check_work); return ret;