diff mbox series

[v5,3/3] drm/privacy_screen_x86: Add entry for ChromeOS privacy-screen

Message ID 20220107190208.95479-3-rajatja@google.com (mailing list archive)
State Accepted, archived
Headers show
Series [v5,1/3] drm/privacy_screen: Add drvdata in drm_privacy_screen | expand

Commit Message

Rajat Jain Jan. 7, 2022, 7:02 p.m. UTC
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 <rajatja@google.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
v5: * Add Hans' "Reviewed by"
v4: * Simplify the detect_chromeos_privacy_screen() function
    * Don't change the existing print statement
v3: * Remove the pr_info() from detect_chromeos_privacy_screen(), instead
      enhance the one already present in drm_privacy_screen_lookup_init()
v2: * Use #if instead of #elif
    * Reorder the patches in the series.
    * Rebased on drm-tip

 drivers/gpu/drm/drm_privacy_screen_x86.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Benson Leung Jan. 7, 2022, 7:06 p.m. UTC | #1
Hi Rajat, 

Thanks for your changes here.

On Fri, Jan 07, 2022 at 11:02:08AM -0800, Rajat Jain wrote:
> 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 <rajatja@google.com>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Hi Hans,

Since this change depends on the privacy screen changes staged for v5.17,
I'm OK as platform/chrome maintainer to have this go through the drm tree.

Acked-By: Benson Leung <bleung@chromium.org>


> ---
> v5: * Add Hans' "Reviewed by"
> v4: * Simplify the detect_chromeos_privacy_screen() function
>     * Don't change the existing print statement
> v3: * Remove the pr_info() from detect_chromeos_privacy_screen(), instead
>       enhance the one already present in drm_privacy_screen_lookup_init()
> v2: * Use #if instead of #elif
>     * Reorder the patches in the series.
>     * Rebased on drm-tip
> 
>  drivers/gpu/drm/drm_privacy_screen_x86.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_privacy_screen_x86.c b/drivers/gpu/drm/drm_privacy_screen_x86.c
> index a2cafb294ca6..88802cd7a1ee 100644
> --- a/drivers/gpu/drm/drm_privacy_screen_x86.c
> +++ b/drivers/gpu/drm/drm_privacy_screen_x86.c
> @@ -47,6 +47,13 @@ static bool __init detect_thinkpad_privacy_screen(void)
>  }
>  #endif
>  
> +#if IS_ENABLED(CONFIG_CHROMEOS_PRIVACY_SCREEN)
> +static bool __init detect_chromeos_privacy_screen(void)
> +{
> +	return acpi_dev_present("GOOG0010", NULL, -1);
> +}
> +#endif
> +
>  static const struct arch_init_data arch_init_data[] __initconst = {
>  #if IS_ENABLED(CONFIG_THINKPAD_ACPI)
>  	{
> @@ -58,6 +65,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)
> -- 
> 2.34.1.575.g55b058a8bb-goog
>
Hans de Goede Jan. 8, 2022, 4:10 p.m. UTC | #2
Hi All,

On 1/7/22 20:06, Benson Leung wrote:
> Hi Rajat, 
> 
> Thanks for your changes here.
> 
> On Fri, Jan 07, 2022 at 11:02:08AM -0800, Rajat Jain wrote:
>> 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 <rajatja@google.com>
>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> 
> Hi Hans,
> 
> Since this change depends on the privacy screen changes staged for v5.17,
> I'm OK as platform/chrome maintainer to have this go through the drm tree.
> 
> Acked-By: Benson Leung <bleung@chromium.org>

Ok, I will merge this into drm-misc-next coming Monday.

Note I'm afraid that it is too late for 5.17, the drm-misc maintainers
have already created the final drm-misc tag for the 5.17 pull-req.

Regards,

Hans


> 
> 
>> ---
>> v5: * Add Hans' "Reviewed by"
>> v4: * Simplify the detect_chromeos_privacy_screen() function
>>     * Don't change the existing print statement
>> v3: * Remove the pr_info() from detect_chromeos_privacy_screen(), instead
>>       enhance the one already present in drm_privacy_screen_lookup_init()
>> v2: * Use #if instead of #elif
>>     * Reorder the patches in the series.
>>     * Rebased on drm-tip
>>
>>  drivers/gpu/drm/drm_privacy_screen_x86.c | 17 +++++++++++++++++
>>  1 file changed, 17 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_privacy_screen_x86.c b/drivers/gpu/drm/drm_privacy_screen_x86.c
>> index a2cafb294ca6..88802cd7a1ee 100644
>> --- a/drivers/gpu/drm/drm_privacy_screen_x86.c
>> +++ b/drivers/gpu/drm/drm_privacy_screen_x86.c
>> @@ -47,6 +47,13 @@ static bool __init detect_thinkpad_privacy_screen(void)
>>  }
>>  #endif
>>  
>> +#if IS_ENABLED(CONFIG_CHROMEOS_PRIVACY_SCREEN)
>> +static bool __init detect_chromeos_privacy_screen(void)
>> +{
>> +	return acpi_dev_present("GOOG0010", NULL, -1);
>> +}
>> +#endif
>> +
>>  static const struct arch_init_data arch_init_data[] __initconst = {
>>  #if IS_ENABLED(CONFIG_THINKPAD_ACPI)
>>  	{
>> @@ -58,6 +65,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)
>> -- 
>> 2.34.1.575.g55b058a8bb-goog
>>
>
Rajat Jain Jan. 8, 2022, 5:21 p.m. UTC | #3
On Sat, Jan 8, 2022 at 8:10 AM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi All,
>
> On 1/7/22 20:06, Benson Leung wrote:
> > Hi Rajat,
> >
> > Thanks for your changes here.
> >
> > On Fri, Jan 07, 2022 at 11:02:08AM -0800, Rajat Jain wrote:
> >> 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 <rajatja@google.com>
> >> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> >
> > Hi Hans,
> >
> > Since this change depends on the privacy screen changes staged for v5.17,
> > I'm OK as platform/chrome maintainer to have this go through the drm tree.
> >
> > Acked-By: Benson Leung <bleung@chromium.org>
>
> Ok, I will merge this into drm-misc-next coming Monday.

Thank you so much for your help!

>
> Note I'm afraid that it is too late for 5.17, the drm-misc maintainers
> have already created the final drm-misc tag for the 5.17 pull-req.

No problem, this works.

Thanks & Best Regards,

Rajat

>
> Regards,
>
> Hans
>
>
> >
> >
> >> ---
> >> v5: * Add Hans' "Reviewed by"
> >> v4: * Simplify the detect_chromeos_privacy_screen() function
> >>     * Don't change the existing print statement
> >> v3: * Remove the pr_info() from detect_chromeos_privacy_screen(), instead
> >>       enhance the one already present in drm_privacy_screen_lookup_init()
> >> v2: * Use #if instead of #elif
> >>     * Reorder the patches in the series.
> >>     * Rebased on drm-tip
> >>
> >>  drivers/gpu/drm/drm_privacy_screen_x86.c | 17 +++++++++++++++++
> >>  1 file changed, 17 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/drm_privacy_screen_x86.c b/drivers/gpu/drm/drm_privacy_screen_x86.c
> >> index a2cafb294ca6..88802cd7a1ee 100644
> >> --- a/drivers/gpu/drm/drm_privacy_screen_x86.c
> >> +++ b/drivers/gpu/drm/drm_privacy_screen_x86.c
> >> @@ -47,6 +47,13 @@ static bool __init detect_thinkpad_privacy_screen(void)
> >>  }
> >>  #endif
> >>
> >> +#if IS_ENABLED(CONFIG_CHROMEOS_PRIVACY_SCREEN)
> >> +static bool __init detect_chromeos_privacy_screen(void)
> >> +{
> >> +    return acpi_dev_present("GOOG0010", NULL, -1);
> >> +}
> >> +#endif
> >> +
> >>  static const struct arch_init_data arch_init_data[] __initconst = {
> >>  #if IS_ENABLED(CONFIG_THINKPAD_ACPI)
> >>      {
> >> @@ -58,6 +65,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)
> >> --
> >> 2.34.1.575.g55b058a8bb-goog
> >>
> >
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_privacy_screen_x86.c b/drivers/gpu/drm/drm_privacy_screen_x86.c
index a2cafb294ca6..88802cd7a1ee 100644
--- a/drivers/gpu/drm/drm_privacy_screen_x86.c
+++ b/drivers/gpu/drm/drm_privacy_screen_x86.c
@@ -47,6 +47,13 @@  static bool __init detect_thinkpad_privacy_screen(void)
 }
 #endif
 
+#if IS_ENABLED(CONFIG_CHROMEOS_PRIVACY_SCREEN)
+static bool __init detect_chromeos_privacy_screen(void)
+{
+	return acpi_dev_present("GOOG0010", NULL, -1);
+}
+#endif
+
 static const struct arch_init_data arch_init_data[] __initconst = {
 #if IS_ENABLED(CONFIG_THINKPAD_ACPI)
 	{
@@ -58,6 +65,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)