From patchwork Fri Dec 17 20:28:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 12685659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DDAA8C433FE for ; Fri, 17 Dec 2021 20:29:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E44D910E5D1; Fri, 17 Dec 2021 20:28:59 +0000 (UTC) Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6387F10E5D1 for ; Fri, 17 Dec 2021 20:28:58 +0000 (UTC) Received: by mail-yb1-xb4a.google.com with SMTP id t184-20020a2546c1000000b006008b13c80bso7038879yba.1 for ; Fri, 17 Dec 2021 12:28:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=9buOhFi0q+Dx/OMfzTqRPp5hw+SV6/dM42HWcYuNNO8=; b=P66pa3NcByvXTlgt0CoajClGTkCuKScmYPVO/GC/7GIFd5e9PTTGrSSUBNkmJ1ONwy cNfw/vooGPmlxJPnexTZklmAoS/ED6I9WMdalVFo1INHssCF0H2R28H3qwssvKkvsM8K 7Yd2BA02rywzvDdUJN/uilAuPtQ5M9V1OWUmMX1r++HRUUy/o3CW+wm1avDI3lA3Qy3Z ApmTmui9Q8xAPo2rdMgV+lqRTIrSP1GvjyGwSrD0uo92aNkm0wd6sytsnLcdaNZ3guho XLeORcPpHY2FdkTIxm77R38sg5v7ZOZmksRBz+cvBtTKaNCbRLv7N2IdsCUqfmy1rLnE pSxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=9buOhFi0q+Dx/OMfzTqRPp5hw+SV6/dM42HWcYuNNO8=; b=G+gDXVwc8mluBmg85t0dzV2UYVXfBo1leTzQm7r8XlobvErkwkA1TOlX6t0Aki2TE/ sGraXQ6vDUTqcZ9ZzgUV+1YRzmzGbqrK0HnQZ6uIvd1WUOHoyRH8N/FDzYqeIo4TdZuN 52WmUx/6+Ge5ELRNVisSt6KaswxyGT/848lD/I4r/9e6/jg0QsJeqeDKzOgBWkXqPYXs rSi03Ks5xV6YWZerbYPF/m7MebM2hKarMUkfLkYCrqRDFmLNK8SPx2JOzXPjbtpXDasW HE3lBo27+L+uJnIXEJ4QiWdA/RW+E0R525uNZPwSBJRZXvEQcNkMo86NaEsGsicg/jhD +fRw== X-Gm-Message-State: AOAM531VRWefArcuFL3qrrEZ5dMSk1FP+HuPbV4vtLrQTGsOlb11M0Nv 9BRpd3eJt1fwfqDwHzBF3Ykjj13Yyv3S X-Google-Smtp-Source: ABdhPJxCNefaz2E9hWLS/2ohTOPd+lksZ93cTIt4DZZY2vVGhK/t8zXAXkUWbgXIDdW5t4c3oRMrMHeaWvZp X-Received: from rajat2.mtv.corp.google.com ([2620:15c:202:201:1bc7:219f:9362:ade9]) (user=rajatja job=sendgmr) by 2002:a5b:c4b:: with SMTP id d11mr6627318ybr.452.1639772937573; Fri, 17 Dec 2021 12:28:57 -0800 (PST) Date: Fri, 17 Dec 2021 12:28:50 -0800 In-Reply-To: <20211217202850.1967594-1-rajatja@google.com> Message-Id: <20211217202850.1967594-2-rajatja@google.com> Mime-Version: 1.0 References: <20211217202850.1967594-1-rajatja@google.com> X-Mailer: git-send-email 2.34.1.307.g9b7440fafd-goog Subject: [PATCH v2 2/2] drm/privacy_screen_x86: Add entry for ChromeOS privacy-screen From: Rajat Jain To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Hans de Goede , David Airlie , Daniel Vetter , Benson Leung , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, gwendal@google.com, seanpaul@google.com, marcheau@google.com, dtor@google.com 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: , Cc: Rajat Jain , rajatxjain@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add a static entry in the x86 table, to detect and wait for privacy-screen on some ChromeOS platforms. Please note that this means that if CONFIG_CHROMEOS_PRIVACY_SCREEN is enabled, and if "GOOG0010" device is found in ACPI, then the i915 probe shall return EPROBE_DEFER until a platform driver actually registers the privacy-screen: https://hansdegoede.livejournal.com/25948.html Signed-off-by: Rajat Jain --- v2: * Use #if instead of #elif * Reorder the patches in the series. * Rebased on drm-tip drivers/gpu/drm/drm_privacy_screen_x86.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/drm_privacy_screen_x86.c b/drivers/gpu/drm/drm_privacy_screen_x86.c index a2cafb294ca6..0c5699ad70a3 100644 --- a/drivers/gpu/drm/drm_privacy_screen_x86.c +++ b/drivers/gpu/drm/drm_privacy_screen_x86.c @@ -47,6 +47,18 @@ static bool __init detect_thinkpad_privacy_screen(void) } #endif +#if IS_ENABLED(CONFIG_CHROMEOS_PRIVACY_SCREEN) +static bool __init detect_chromeos_privacy_screen(void) +{ + if (!acpi_dev_present("GOOG0010", NULL, -1)) + return false; + + pr_info("%s: Need to wait for ChromeOS privacy-screen drvr", __func__); + return true; + +} +#endif + static const struct arch_init_data arch_init_data[] __initconst = { #if IS_ENABLED(CONFIG_THINKPAD_ACPI) { @@ -58,6 +70,16 @@ static const struct arch_init_data arch_init_data[] __initconst = { .detect = detect_thinkpad_privacy_screen, }, #endif +#if IS_ENABLED(CONFIG_CHROMEOS_PRIVACY_SCREEN) + { + .lookup = { + .dev_id = NULL, + .con_id = NULL, + .provider = "privacy_screen-GOOG0010:00", + }, + .detect = detect_chromeos_privacy_screen, + }, +#endif }; void __init drm_privacy_screen_lookup_init(void)