drm/i915: Move the code to populate ACPI device ID into intel_acpi
Subsystems (3)
PATCH v3 1/3 drm/i915: Move the code to populate ACPI device ID into intel_acpi
Move the code that populates the ACPI device ID for devices, into more appripriate intel_acpi.c. This is done in preparation for more users of this code (in next patch).
---
v3: * Renamed the function to intel_acpi_*
* Used forward declaration for structure instead of header file inclusion.
* Fix a typo
v2: v1 doesn't exist. Found existing code in i915 driver to assign the ACPI ID
which is what I plan to re-use.
drivers/gpu/drm/i915/display/intel_acpi.c | 89 +++++++++++++++++++ drivers/gpu/drm/i915/display/intel_acpi.h | 5 ++ drivers/gpu/drm/i915/display/intel_opregion.c | 80 +---------------- 3 files changed, 98 insertions(+), 76 deletions(-)
drivers/gpu/drm/i915/display/intel_acpi.c +89 -0
@@ -10,6 +10,7 @@#include "i915_drv.h" #include "intel_acpi.h" +#include "intel_display_types.h" #define INTEL_DSM_REVISION_ID 1/* For Calpella anyway... */ #define INTEL_DSM_FN_PLATFORM_MUX_INFO 1/* No args */
@@ -156,3 +157,91 @@ void intel_register_dsm_handler(void)void intel_unregister_dsm_handler (void ) { } + +/* +* ACPI Specification, Revision 5.0, Appendix B.3.2 _DOD (Enumerate All Devices +* Attached to the Display Adapter). +*/ +#define ACPI_DISPLAY_INDEX_SHIFT 0 +#define ACPI_DISPLAY_INDEX_MASK (0xf << 0) +#define ACPI_DISPLAY_PORT_ATTACHMENT_SHIFT 4 +#define ACPI_DISPLAY_PORT_ATTACHMENT_MASK (0xf << 4) +#define ACPI_DISPLAY_TYPE_SHIFT 8 +#define ACPI_DISPLAY_TYPE_MASK (0xf << 8) +#define ACPI_DISPLAY_TYPE_OTHER (0 << 8) +#define ACPI_DISPLAY_TYPE_VGA (1 << 8) +#define ACPI_DISPLAY_TYPE_TV (2 << 8) +#define ACPI_DISPLAY_TYPE_EXTERNAL_DIGITAL (3 << 8) +#define ACPI_DISPLAY_TYPE_INTERNAL_DIGITAL (4 << 8) +#define ACPI_VENDOR_SPECIFIC_SHIFT 12 +#define ACPI_VENDOR_SPECIFIC_MASK (0xf << 12) +#define ACPI_BIOS_CAN_DETECT (1 << 16) +#define ACPI_DEPENDS_ON_VGA (1 << 17) +#define ACPI_PIPE_ID_SHIFT 18 +#define ACPI_PIPE_ID_MASK (7 << 18) +#define ACPI_DEVICE_ID_SCHEME (1ULL << 31) + +static u32 acpi_display_type (struct intel_connector *connector) +{ +u32 display_type; + +switch (connector->base.connector_type) { +case DRM_MODE_CONNECTOR_VGA : +case DRM_MODE_CONNECTOR_DVIA : + display_type =ACPI_DISPLAY_TYPE_VGA ; +break ; +case DRM_MODE_CONNECTOR_Composite: +case DRM_MODE_CONNECTOR_SVIDEO : +case DRM_MODE_CONNECTOR_Component: +case DRM_MODE_CONNECTOR_9PinDIN: +case DRM_MODE_CONNECTOR_TV : + display_type =ACPI_DISPLAY_TYPE_TV ; +break ; +case DRM_MODE_CONNECTOR_DVII : +case DRM_MODE_CONNECTOR_DVID : +case DRM_MODE_CONNECTOR_DisplayPort: +case DRM_MODE_CONNECTOR_HDMIA : +case DRM_MODE_CONNECTOR_HDMIB : + display_type =ACPI_DISPLAY_TYPE_EXTERNAL_DIGITAL ; +break ; +case DRM_MODE_CONNECTOR_LVDS : +case DRM_MODE_CONNECTOR_eDP: +case DRM_MODE_CONNECTOR_DSI : + display_type =ACPI_DISPLAY_TYPE_INTERNAL_DIGITAL ; +break ; +case DRM_MODE_CONNECTOR_Unknown: +case DRM_MODE_CONNECTOR_VIRTUAL : + display_type =ACPI_DISPLAY_TYPE_OTHER ; +break ; +default : +MISSING_CASE (connector->base.connector_type); + display_type =ACPI_DISPLAY_TYPE_OTHER ; +break ; + } + +return display_type; +} + +void intel_acpi_device_id_update (struct drm_i915_private *dev_priv) +{ +struct drm_device *drm_dev = &dev_priv->drm; +struct intel_connector *connector; +struct drm_connector_list_iter conn_iter; +u8 display_index[16 ] = {}; + +/* Populate the ACPI IDs for all connectors for a given drm_device */ +drm_connector_list_iter_begin (drm_dev, &conn_iter); +for_each_intel_connector_iter (connector, &conn_iter) { +u32 device_id, type; + + device_id =acpi_display_type (connector); + +/* Use display type specific display index. */ + type = (device_id &ACPI_DISPLAY_TYPE_MASK ) + >>ACPI_DISPLAY_TYPE_SHIFT ; + device_id |= display_index[type]++ <<ACPI_DISPLAY_INDEX_SHIFT ; + + connector->acpi_device_id = device_id; + } +drm_connector_list_iter_end (&conn_iter); +}
drivers/gpu/drm/i915/display/intel_acpi.h +5 -0
@@ -6,12 +6,17 @@#ifndef __INTEL_ACPI_H__#define __INTEL_ACPI_H__ +struct drm_i915_private ; +#ifdef CONFIG_ACPI void intel_register_dsm_handler (void );void intel_unregister_dsm_handler (void ); +void intel_acpi_device_id_update (struct drm_i915_private *i915);#else static inline void intel_register_dsm_handler (void ) {return ; }static inline void intel_unregister_dsm_handler (void ) {return ; } +static inline +void intel_acpi_device_id_update (struct drm_i915_private *i915) {return ; }#endif /* CONFIG_ACPI */ #endif /* __INTEL_ACPI_H__ */
drivers/gpu/drm/i915/display/intel_opregion.c +4 -76
113 lines not on this page · raw message
Signature · 1 line
2.24.0.393.g34dc348eaf-goog
PATCH v3 2/3 drm/i915: Lookup and attach ACPI device node for connectors
Lookup and attach ACPI nodes for intel connectors. The lookup is done in compliance with ACPI Spec 6.3
https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf
(Ref: Pages 1119 - 1123).
This can be useful for any connector specific platform properties. (This will be used for privacy screen in next patch).
---
v3: fold the code into existing acpi_device_id_update() function
v2: formed by splitting the original patch into ACPI lookup, and privacy
screen property. Also move it into i915 now that I found existing code in i915 that can be re-used.
drivers/gpu/drm/i915/display/intel_acpi.c | 24 +++++++++++++++++++ .../drm/i915/display/intel_display_types.h | 3 +++ drivers/gpu/drm/i915/display/intel_dp.c | 3 +++ 3 files changed, 30 insertions(+)
drivers/gpu/drm/i915/display/intel_acpi.c +24 -0
@@ -222,11 +222,23 @@ static u32 acpi_display_type(struct intel_connector *connector)return display_type; } +/* +* Ref: ACPI Spec 6.3 +* https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf +* Pages 1119 - 1123 describe, what I believe, a standard way of +* identifying / addressing "display panels" in the ACPI. It provides +* a way for the ACPI to define devices for the display panels attached +* to the system. It thus provides a way for the BIOS to export any panel +* specific properties to the system via ACPI (like device trees). +*/ void intel_acpi_device_id_update (struct drm_i915_private *dev_priv) {struct drm_device *drm_dev = &dev_priv->drm;struct intel_connector *connector;struct drm_connector_list_iter conn_iter; +struct device *dev = &drm_dev->pdev->dev; +struct acpi_device *conn_dev; +u64 conn_addr;u8 display_index[16 ] = {};/* Populate the ACPI IDs for all connectors for a given drm_device */
@@ -242,6 +254,18 @@ void intel_acpi_device_id_update(struct drm_i915_private *dev_priv) device_id |= display_index[type]++ <<ACPI_DISPLAY_INDEX_SHIFT ; connector->acpi_device_id = device_id; + +/* Build the _ADR to look for */ + conn_addr = device_id |ACPI_DEVICE_ID_SCHEME | +ACPI_BIOS_CAN_DETECT ; + +DRM_DEV_INFO (dev,"Checking connector ACPI node at _ADR=%llX\n" , + conn_addr); + +/* Look up the connector device, under the PCI device */ + conn_dev =acpi_find_child_device (ACPI_COMPANION (dev), + conn_addr, false); + connector->acpi_handle = conn_dev ? conn_dev->handle :NULL ; }drm_connector_list_iter_end (&conn_iter); }
drivers/gpu/drm/i915/display/intel_display_types.h +3 -0
@@ -407,6 +407,9 @@ struct intel_connector {/* ACPI device id for ACPI and driver cooperation */ u32 acpi_device_id; +/* ACPI handle corresponding to this connector display, if found */ +void *acpi_handle; +/* Reads out the current hw, returning true if the connector is enabled * and active (i.e. dpms ON state). */ bool (*get_hw_state)(struct intel_connector *);
drivers/gpu/drm/i915/display/intel_dp.c +3 -0
@@ -45,6 +45,7 @@#include "i915_debugfs.h" #include "i915_drv.h" #include "i915_trace.h" +#include "intel_acpi.h" #include "intel_atomic.h" #include "intel_audio.h" #include "intel_connector.h"
@@ -6628,6 +6629,8 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect connector->state->scaling_mode =DRM_MODE_SCALE_ASPECT ; +/* Lookup the ACPI node corresponding to the connector */ +intel_acpi_device_id_update (dev_priv); } }
Signature · 1 line
2.24.0.393.g34dc348eaf-goog
PATCH v3 3/3 drm/i915: Add support for integrated privacy screens
In reply to Rajat JainCertain laptops now come with panels that have integrated privacy screens on them. This patch adds support for such panels by adding a privacy-screen property to the intel_connector for the panel, that the userspace can then use to control and check the status.
Identifying the presence of privacy screen, and controlling it, is done via ACPI _DSM methods.
Currently, this is done only for the Intel display ports. But in future, this can be done for any other ports if the hardware becomes available (e.g. external monitors supporting integrated privacy screens?).
---
v3: * Change license to GPL-2.0 OR MIT
* Move privacy screen enum from UAPI to intel_display_types.h
* Rename parameter name and some other minor changes.
v2: Formed by splitting the original patch into multiple patches.
- All code has been moved into i915 now.
- Privacy screen is a i915 property
- Have a local state variable to store the prvacy screen. Don't read it from hardware.
drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/display/intel_atomic.c | 13 +++- .../gpu/drm/i915/display/intel_connector.c | 35 +++++++++ .../gpu/drm/i915/display/intel_connector.h | 1 + .../drm/i915/display/intel_display_types.h | 18 +++++ drivers/gpu/drm/i915/display/intel_dp.c | 6 ++ .../drm/i915/display/intel_privacy_screen.c | 72 +++++++++++++++++++ .../drm/i915/display/intel_privacy_screen.h | 25 +++++++ 8 files changed, 169 insertions(+), 4 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/intel_privacy_screen.c create mode 100644 drivers/gpu/drm/i915/display/intel_privacy_screen.h
drivers/gpu/drm/i915/Makefile +2 -1
@@ -197,7 +197,8 @@ i915-y += \ display/intel_vga.o i915-$(CONFIG_ACPI) += \ display/intel_acpi.o \ - display/intel_opregion.o + display/intel_opregion.o \ + display/intel_privacy_screen.o i915-$(CONFIG_DRM_FBDEV_EMULATION) += \ display/intel_fbdev.o
drivers/gpu/drm/i915/display/intel_atomic.c +10 -3
@@ -37,6 +37,7 @@#include "intel_atomic.h" #include "intel_display_types.h" #include "intel_hdcp.h" +#include "intel_privacy_screen.h" #include "intel_sprite.h" /**
@@ -57,11 +58,14 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector,struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_digital_connector_state *intel_conn_state =to_intel_digital_connector_state (state); +struct intel_connector *intel_connector =to_intel_connector (connector);if (property == dev_priv->force_audio_property) *val = intel_conn_state->force_audio;else if (property == dev_priv->broadcast_rgb_property) *val = intel_conn_state->broadcast_rgb; +else if (property == intel_connector->privacy_screen_property) + *val = intel_conn_state->privacy_screen_status;else {DRM_DEBUG_ATOMIC ("Unknown property [PROP:%d:%s]\n" , property->base.id, property->name);
@@ -89,15 +93,18 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector,struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_digital_connector_state *intel_conn_state =to_intel_digital_connector_state (state); +struct intel_connector *intel_connector =to_intel_connector (connector);if (property == dev_priv->force_audio_property) { intel_conn_state->force_audio = val;return 0 ; - } - -if (property == dev_priv->broadcast_rgb_property) { + }else if (property == dev_priv->broadcast_rgb_property) { intel_conn_state->broadcast_rgb = val;return 0 ; + }else if (property == intel_connector->privacy_screen_property) { +intel_privacy_screen_set_val (intel_connector, val); + intel_conn_state->privacy_screen_status = val; +return 0 ; } DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
drivers/gpu/drm/i915/display/intel_connector.c +35 -0
@@ -296,3 +296,38 @@ intel_attach_colorspace_property(struct drm_connector *connector)drm_object_attach_property (&connector->base, connector->colorspace_property,0 ); } + +static const struct drm_prop_enum_list privacy_screen_enum[] = { + {PRIVACY_SCREEN_DISABLED ,"Disabled" }, + {PRIVACY_SCREEN_ENABLED ,"Enabled" }, +}; + +/** +* intel_attach_privacy_screen_property - +* create and attach the connecter's privacy-screen property. * +* @connector: connector for which to init the privacy-screen property +* +* This function creates and attaches the "privacy-screen" property to the +* connector. Initial state of privacy-screen is set to disabled. +*/ +void +intel_attach_privacy_screen_property (struct drm_connector *connector) +{ +struct intel_connector *intel_connector =to_intel_connector (connector); +struct drm_property *prop; + +if (!intel_connector->privacy_screen_property) { + prop =drm_property_create_enum (connector->dev, +DRM_MODE_PROP_ENUM , +"privacy-screen" , + privacy_screen_enum, +ARRAY_SIZE (privacy_screen_enum)); +if (!prop) +return ; + + intel_connector->privacy_screen_property = prop; + } + +drm_object_attach_property (&connector->base, prop, +PRIVACY_SCREEN_DISABLED ); +}
drivers/gpu/drm/i915/display/intel_connector.h +1 -0
@@ -31,5 +31,6 @@ void intel_attach_force_audio_property(struct drm_connector *connector);void intel_attach_broadcast_rgb_property (struct drm_connector *connector);void intel_attach_aspect_ratio_property (struct drm_connector *connector);void intel_attach_colorspace_property (struct drm_connector *connector); +void intel_attach_privacy_screen_property (struct drm_connector *connector);#endif /* __INTEL_CONNECTOR_H__ */
drivers/gpu/drm/i915/display/intel_display_types.h +18 -0
@@ -433,6 +433,23 @@ struct intel_connector {struct work_struct modeset_retry_work;struct intel_hdcp hdcp; + +/* Optional "privacy-screen" property for the connector panel */ +struct drm_property *privacy_screen_property; +}; + +/** +* enum intel_privacy_screen_status - privacy_screen status +* +* This enum is used to track and control the state of the integrated privacy +* screen present on some display panels, via the "privacy-screen" property. +* +* @PRIVACY_SCREEN_DISABLED: The privacy-screen on the panel is disabled +* @PRIVACY_SCREEN_ENABLED: The privacy-screen on the panel is enabled +**/ +enum intel_privacy_screen_status { +PRIVACY_SCREEN_DISABLED =0 , +PRIVACY_SCREEN_ENABLED =1 , };struct intel_digital_connector_state {
@@ -440,6 +457,7 @@ struct intel_digital_connector_state {enum hdmi_force_audio force_audio;int broadcast_rgb; +enum intel_privacy_screen_status privacy_screen_status; };#define to_intel_digital_connector_state (x) container_of(x, struct intel_digital_connector_state, base)
drivers/gpu/drm/i915/display/intel_dp.c +6 -0
@@ -62,6 +62,7 @@#include "intel_lspcon.h" #include "intel_lvds.h" #include "intel_panel.h" +#include "intel_privacy_screen.h" #include "intel_psr.h" #include "intel_sideband.h" #include "intel_tc.h"
@@ -6601,6 +6602,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect {struct drm_i915_private *dev_priv =to_i915 (connector->dev);enum port port =dp_to_dig_port (intel_dp)->base.port; +struct intel_connector *intel_connector =to_intel_connector (connector);if (!IS_G4X (dev_priv) && port !=PORT_A )intel_attach_force_audio_property (connector);
@@ -6631,6 +6633,10 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect/* Lookup the ACPI node corresponding to the connector */ intel_acpi_device_id_update (dev_priv); + +/* Check for integrated Privacy screen support */ +if (intel_privacy_screen_present (intel_connector)) +intel_attach_privacy_screen_property (connector); } }
drivers/gpu/drm/i915/display/intel_privacy_screen.c new file +72 -0
72 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_privacy_screen.h new file +25 -0
@@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* +* Copyright © 2019 Google Inc. +*/ + +#ifndef __DRM_PRIVACY_SCREEN_H__ +#define __DRM_PRIVACY_SCREEN_H__ + +#include "intel_display_types.h" + +#ifdef CONFIG_ACPI +bool intel_privacy_screen_present (struct intel_connector *connector); +void intel_privacy_screen_set_val (struct intel_connector *connector, +enum intel_privacy_screen_status val); +#else +bool intel_privacy_screen_present (struct intel_connector *connector); +{ +return false; +} +void intel_privacy_screen_set_val (struct intel_connector *connector, +enum intel_privacy_screen_status val) +{ } +#endif /* CONFIG_ACPI */ + +#endif /* __DRM_PRIVACY_SCREEN_H__ */
Signature · 1 line
2.24.0.393.g34dc348eaf-goog
Re: [PATCH v3 3/3] drm/i915: Add support for integrated privacy screens
Quoted 6 lines · Rajat Jain
Certain laptops now come with panels that have integrated privacy screens on them. This patch adds support for such panels by adding a privacy-screen property to the
intel_connectorfor the panel, that the userspace can then use to control and check the status.
Quoted 8 lines
Identifying the presence of privacy screen, and controlling it, is done via ACPI
_DSMmethods.Currently, this is done only for the Intel display ports. But in future, this can be done for any other ports if the hardware becomes available (e.g. external monitors supporting integrated privacy screens?).
Signed-off-by Rajat Jain <[email protected]>
Hi Jani,
Just checking to see if you got a chance to look at this...
Thanks,
Rajat
Quoted 318 lines
---
v3: * Change license to GPL-2.0 OR MIT
* Move privacy screen enum from UAPI tointel_display_types.h
* Rename parameter name and some other minor changes.
v2: Formed by splitting the original patch into multiple patches.
- All code has been moved into i915 now.
- Privacy screen is a i915 property
- Have a local state variable to store the prvacy screen. Don't read it from hardware.drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/display/intel_atomic.c | 13 +++- .../gpu/drm/i915/display/intel_connector.c | 35 +++++++++ .../gpu/drm/i915/display/intel_connector.h | 1 + .../drm/i915/display/intel_display_types.h | 18 +++++ drivers/gpu/drm/i915/display/intel_dp.c | 6 ++ .../drm/i915/display/intel_privacy_screen.c | 72 +++++++++++++++++++ .../drm/i915/display/intel_privacy_screen.h | 25 +++++++ 8 files changed, 169 insertions(+), 4 deletions(-) create mode 100644 drivers/gpu/drm/i915/display/intel_privacy_screen.c create mode 100644 drivers/gpu/drm/i915/display/intel_privacy_screen.hdrivers/gpu/drm/i915/Makefile +2
-1@@ -197,7 +197,8 @@ i915-y += \ display/intel_vga.o i915-$(CONFIG_ACPI) += \ display/intel_acpi.o \ - display/intel_opregion.o + display/intel_opregion.o \ + display/intel_privacy_screen.o i915-$(CONFIG_DRM_FBDEV_EMULATION) += \ display/intel_fbdev.odrivers/gpu/drm/i915/display/intel_atomic.c +10
-3@@ -37,6 +37,7 @@#include "intel_atomic.h" #include "intel_display_types.h" #include "intel_hdcp.h" +#include "intel_privacy_screen.h" #include "intel_sprite.h" /** @@ -57,11 +58,14 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector,struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_digital_connector_state *intel_conn_state =to_intel_digital_connector_state (state); +struct intel_connector *intel_connector =to_intel_connector (connector);if (property == dev_priv->force_audio_property) *val = intel_conn_state->force_audio;else if (property == dev_priv->broadcast_rgb_property) *val = intel_conn_state->broadcast_rgb; +else if (property == intel_connector->privacy_screen_property) + *val = intel_conn_state->privacy_screen_status;else {DRM_DEBUG_ATOMIC ("Unknown property [PROP:%d:%s]\n" , property->base.id, property->name);@@ -89,15 +93,18 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector,struct drm_i915_private *dev_priv =to_i915 (dev);struct intel_digital_connector_state *intel_conn_state =to_intel_digital_connector_state (state); +struct intel_connector *intel_connector =to_intel_connector (connector);if (property == dev_priv->force_audio_property) { intel_conn_state->force_audio = val;return 0 ; - } - -if (property == dev_priv->broadcast_rgb_property) { + }else if (property == dev_priv->broadcast_rgb_property) { intel_conn_state->broadcast_rgb = val;return 0 ; + }else if (property == intel_connector->privacy_screen_property) { +intel_privacy_screen_set_val (intel_connector, val); + intel_conn_state->privacy_screen_status = val; +return 0 ; } DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",drivers/gpu/drm/i915/display/intel_connector.c +35
-0@@ -296,3 +296,38 @@ intel_attach_colorspace_property(struct drm_connector *connector)drm_object_attach_property (&connector->base, connector->colorspace_property,0 ); } + +static const struct drm_prop_enum_list privacy_screen_enum[] = { + {PRIVACY_SCREEN_DISABLED ,"Disabled" }, + {PRIVACY_SCREEN_ENABLED ,"Enabled" }, +}; + +/** +* intel_attach_privacy_screen_property - +* create and attach the connecter's privacy-screen property. * +* @connector: connector for which to init the privacy-screen property +* +* This function creates and attaches the "privacy-screen" property to the +* connector. Initial state of privacy-screen is set to disabled. +*/ +void +intel_attach_privacy_screen_property (struct drm_connector *connector) +{ +struct intel_connector *intel_connector =to_intel_connector (connector); +struct drm_property *prop; + +if (!intel_connector->privacy_screen_property) { + prop =drm_property_create_enum (connector->dev, +DRM_MODE_PROP_ENUM , +"privacy-screen" , + privacy_screen_enum, +ARRAY_SIZE (privacy_screen_enum)); +if (!prop) +return ; + + intel_connector->privacy_screen_property = prop; + } + +drm_object_attach_property (&connector->base, prop, +PRIVACY_SCREEN_DISABLED ); +}drivers/gpu/drm/i915/display/intel_connector.h +1
-0@@ -31,5 +31,6 @@ void intel_attach_force_audio_property(struct drm_connector *connector);void intel_attach_broadcast_rgb_property (struct drm_connector *connector);void intel_attach_aspect_ratio_property (struct drm_connector *connector);void intel_attach_colorspace_property (struct drm_connector *connector); +void intel_attach_privacy_screen_property (struct drm_connector *connector);#endif /* __INTEL_CONNECTOR_H__ */ drivers/gpu/drm/i915/display/intel_display_types.h +18
-0@@ -433,6 +433,23 @@ struct intel_connector {struct work_struct modeset_retry_work;struct intel_hdcp hdcp; + +/* Optional "privacy-screen" property for the connector panel */ +struct drm_property *privacy_screen_property; +}; + +/** +* enum intel_privacy_screen_status - privacy_screen status +* +* This enum is used to track and control the state of the integrated privacy +* screen present on some display panels, via the "privacy-screen" property. +* +* @PRIVACY_SCREEN_DISABLED: The privacy-screen on the panel is disabled +* @PRIVACY_SCREEN_ENABLED: The privacy-screen on the panel is enabled +**/ +enum intel_privacy_screen_status { +PRIVACY_SCREEN_DISABLED =0 , +PRIVACY_SCREEN_ENABLED =1 , };struct intel_digital_connector_state {@@ -440,6 +457,7 @@ struct intel_digital_connector_state {enum hdmi_force_audio force_audio;int broadcast_rgb; +enum intel_privacy_screen_status privacy_screen_status; };#define to_intel_digital_connector_state (x) container_of(x, struct intel_digital_connector_state, base)drivers/gpu/drm/i915/display/intel_dp.c +6
-0@@ -62,6 +62,7 @@#include "intel_lspcon.h" #include "intel_lvds.h" #include "intel_panel.h" +#include "intel_privacy_screen.h" #include "intel_psr.h" #include "intel_sideband.h" #include "intel_tc.h" @@ -6601,6 +6602,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect {struct drm_i915_private *dev_priv =to_i915 (connector->dev);enum port port =dp_to_dig_port (intel_dp)->base.port; +struct intel_connector *intel_connector =to_intel_connector (connector);if (!IS_G4X (dev_priv) && port !=PORT_A )intel_attach_force_audio_property (connector);@@ -6631,6 +6633,10 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect/* Lookup the ACPI node corresponding to the connector */ intel_acpi_device_id_update (dev_priv); + +/* Check for integrated Privacy screen support */ +if (intel_privacy_screen_present (intel_connector)) +intel_attach_privacy_screen_property (connector); } }drivers/gpu/drm/i915/display/intel_privacy_screen.c new file +72
-0@@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* +* Intel ACPI privacy screen code +* +* Copyright © 2019 Google Inc. +*/ + +#include <linux/acpi.h> + +#include "intel_privacy_screen.h" + +#define CONNECTOR_DSM_REVID 1 + +#define CONNECTOR_DSM_FN_PRIVACY_ENABLE 2 +#define CONNECTOR_DSM_FN_PRIVACY_DISABLE 3 + +static const guid_t drm_conn_dsm_guid = +GUID_INIT (0xC7033113 ,0x8720 ,0x4CEB , +0x90 ,0x90 ,0x9D ,0x52 ,0xB3 ,0xE5 ,0x2D ,0x73 ); + +/* Makes _DSM call to set privacy screen status */ +static void acpi_privacy_screen_call_dsm (acpi_handle conn_handle,u64 func) +{ +union acpi_object *obj; + + obj =acpi_evaluate_dsm (conn_handle, &drm_conn_dsm_guid, +CONNECTOR_DSM_REVID , func,NULL ); +if (!obj) { +DRM_DEBUG_DRIVER ("failed to evaluate _DSM for fn %llx\n" , func); +return ; + } + +ACPI_FREE (obj); +} + +void intel_privacy_screen_set_val (struct intel_connector *connector, +enum intel_privacy_screen_status val) +{ +acpi_handle acpi_handle = connector->acpi_handle; + +if (!acpi_handle) +return ; + +if (val ==PRIVACY_SCREEN_DISABLED ) +acpi_privacy_screen_call_dsm (acpi_handle, +CONNECTOR_DSM_FN_PRIVACY_DISABLE ); +else if (val ==PRIVACY_SCREEN_ENABLED ) +acpi_privacy_screen_call_dsm (acpi_handle, +CONNECTOR_DSM_FN_PRIVACY_ENABLE ); +else +DRM_WARN ("%s: Cannot set privacy screen to invalid val %u\n" , +dev_name (connector->base.dev->dev), val); +} + +bool intel_privacy_screen_present (struct intel_connector *connector) +{ +acpi_handle handle = connector->acpi_handle; + +if (!handle) +return false; + +if (!acpi_check_dsm (handle, &drm_conn_dsm_guid, +CONNECTOR_DSM_REVID , +1 <<CONNECTOR_DSM_FN_PRIVACY_ENABLE | +1 <<CONNECTOR_DSM_FN_PRIVACY_DISABLE )) { +DRM_WARN ("%s: Odd, connector ACPI node but no privacy scrn?\n" , +dev_name (connector->base.dev->dev)); +return false; + } +DRM_DEV_INFO (connector->base.dev->dev,"supports privacy screen\n" ); +return true; +}drivers/gpu/drm/i915/display/intel_privacy_screen.h new file +25
-1@@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +/* +* Copyright © 2019 Google Inc. +*/ + +#ifndef __DRM_PRIVACY_SCREEN_H__ +#define __DRM_PRIVACY_SCREEN_H__ + +#include "intel_display_types.h" + +#ifdef CONFIG_ACPI +bool intel_privacy_screen_present (struct intel_connector *connector); +void intel_privacy_screen_set_val (struct intel_connector *connector, +enum intel_privacy_screen_status val); +#else +bool intel_privacy_screen_present (struct intel_connector *connector); +{ +return false; +} +void intel_privacy_screen_set_val (struct intel_connector *connector, +enum intel_privacy_screen_status val) +{ } +#endif /* CONFIG_ACPI */ + +#endif /* __DRM_PRIVACY_SCREEN_H__ */ --2.24.0.393.g34dc348eaf-goog
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [v3,1/3] drm/i915: Move the code to populate ACPI device ID into intel_acpi
In reply to Rajat Jain== Series Details ==
== Series Details ==
Series: series starting with [v3,1/3] drm/i915: Move the code to populate ACPI device ID into intel_acpi
URL : https://patchwork.freedesktop.org/series/70529/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 3fffa6401f4d drm/i915: Move the code to populate ACPI device ID into intel_acpi 976c313a4a61 drm/i915: Lookup and attach ACPI device node for connectors e074c1c4b656 drm/i915: Add support for integrated privacy screens -:205: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #205: new file mode 100644
-:307: CHECK:LINE_SPACING: Please use a blank line after function/struct/union/enum declarations #307: FILE: drivers/gpu/drm/i915/display/intel_privacy_screen.h:20:
+}
+void intel_privacy_screen_set_val(struct intel_connector *connector,
total: 0 errors, 1 warnings, 1 checks, 246 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [v3,1/3] drm/i915: Move the code to populate ACPI device ID into intel_acpi
In reply to Rajat Jain== Series Details ==
== Series Details ==
Series: series starting with [v3,1/3] drm/i915: Move the code to populate ACPI device ID into intel_acpi
URL : https://patchwork.freedesktop.org/series/70529/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_7494 -> Patchwork_15623
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_15623 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_15623, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_15623:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live_workarounds:
- fi-icl-guc: [PASS][1] -> [DMESG-FAIL][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-icl-guc/igt@i915_selftest@live_workarounds.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-icl-guc/igt@i915_selftest@live_workarounds.html
Known issues
------------
Here are the changes found in Patchwork_15623 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live_blt:
- fi-byt-j1900: [PASS][3] -> [DMESG-FAIL][4] ([i915#725])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-byt-j1900/igt@i915_selftest@live_blt.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-byt-j1900/igt@i915_selftest@live_blt.html
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [PASS][5] -> [FAIL][6] ([fdo#111407])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-kbl-7500u/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-kbl-7500u/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_parallel@basic:
- {fi-tgl-u}: [INCOMPLETE][7] ([i915#476]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-tgl-u/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-tgl-u/igt@[email protected]
- {fi-tgl-guc}: [INCOMPLETE][9] ([i915#476]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-tgl-guc/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-tgl-guc/igt@[email protected]
* igt@i915_pm_rpm@module-reload:
- fi-skl-6770hq: [FAIL][11] ([i915#178]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-skl-6770hq/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-skl-6770hq/igt@[email protected]
* igt@i915_selftest@live_blt:
- fi-ivb-3770: [DMESG-FAIL][13] ([i915#725]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-ivb-3770/igt@i915_selftest@live_blt.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-ivb-3770/igt@i915_selftest@live_blt.html
- fi-hsw-4770: [DMESG-FAIL][15] ([i915#553] / [i915#725]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-hsw-4770/igt@i915_selftest@live_blt.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-hsw-4770/igt@i915_selftest@live_blt.html
* igt@i915_selftest@live_gem_contexts:
- fi-byt-n2820: [DMESG-FAIL][17] ([i915#722]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-byt-n2820/igt@i915_selftest@live_gem_contexts.html
* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u2: [FAIL][19] ([i915#49]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-icl-u2/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-icl-u2/igt@[email protected]
#### Warnings ####
* igt@i915_selftest@live_gem_contexts:
- fi-hsw-peppy: [DMESG-FAIL][21] ([i915#722]) -> [INCOMPLETE][22] ([i915#694])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-hsw-peppy/igt@i915_selftest@live_gem_contexts.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-hsw-peppy/igt@i915_selftest@live_gem_contexts.html
* igt@kms_busy@basic-flip-pipe-b:
- fi-kbl-x1275: [DMESG-WARN][23] ([i915#62] / [i915#92]) -> [DMESG-WARN][24] ([i915#62] / [i915#92] / [i915#95]) +8 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-kbl-x1275/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-kbl-x1275/igt@[email protected]
* igt@kms_flip@basic-flip-vs-modeset:
- fi-kbl-x1275: [DMESG-WARN][25] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][26] ([i915#62] / [i915#92]) +5 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7494/fi-kbl-x1275/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/fi-kbl-x1275/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
[i915#178]: https://gitlab.freedesktop.org/drm/intel/issues/178
[i915#476]: https://gitlab.freedesktop.org/drm/intel/issues/476
[i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
[i915#553]: https://gitlab.freedesktop.org/drm/intel/issues/553
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#694]: https://gitlab.freedesktop.org/drm/intel/issues/694
[i915#722]: https://gitlab.freedesktop.org/drm/intel/issues/722
[i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (53 -> 46)
------------------------------
Additional (1): fi-bwr-2160
Missing (8): fi-hsw-4770r fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_7494 -> Patchwork_15623
CI-20190529: 20190529
CI_DRM_7494: 3f61a8ed20b643bafb1865f5dbae8640a79fee5e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5333: e08522bb09ff1b9720359b3867da7e4aca0bd5f1 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_15623: e074c1c4b6562796047e4a0b0c2742c6d85e6215 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
e074c1c4b656 drm/i915: Add support for integrated privacy screens 976c313a4a61 drm/i915: Lookup and attach ACPI device node for connectors 3fffa6401f4d drm/i915: Move the code to populate ACPI device ID into intel_acpi
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_15623/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx