diff mbox

[12/21] drm/omap: dss: Add device operations flags

Message ID 20180606093650.26034-13-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart June 6, 2018, 9:36 a.m. UTC
When an omap_dss_device operation can be implemented in multiple places
in a chain of devices, it is important to find out which device to
address to perfom the operation. This is currently done by calling the
operation on the display device at the end of the chain, and recursively
delagating the operation to the previous device if it can't be performed
locally. The drawback of this approach is an increased complexity in
omap_dss_device drivers.

In order to simplify the drivers, we will switch from a recursive model
to an interative model, centralizing the complexity in a single
location. This requires knowing which operations an omap_dss_device
supports at runtime. We can already test which operations are
implemented by checking the operation pointer, but implemented
operations can require resources whose availability varies between
systems. For instance a hot-plug signal from a connector can be wired to
a GPIO or to a bridge chip.

Add operation flags that can be set in the omap_dss_device structure by
drivers to signal support for operations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Sebastian Reichel June 11, 2018, 4:09 p.m. UTC | #1
Hi,

On Wed, Jun 06, 2018 at 12:36:41PM +0300, Laurent Pinchart wrote:
> When an omap_dss_device operation can be implemented in multiple places
> in a chain of devices, it is important to find out which device to
> address to perfom the operation. This is currently done by calling the
> operation on the display device at the end of the chain, and recursively
> delagating the operation to the previous device if it can't be performed
> locally. The drawback of this approach is an increased complexity in
> omap_dss_device drivers.
> 
> In order to simplify the drivers, we will switch from a recursive model
> to an interative model, centralizing the complexity in a single
> location. This requires knowing which operations an omap_dss_device
> supports at runtime. We can already test which operations are
> implemented by checking the operation pointer, but implemented
> operations can require resources whose availability varies between
> systems. For instance a hot-plug signal from a connector can be wired to
> a GPIO or to a bridge chip.
> 
> Add operation flags that can be set in the omap_dss_device structure by
> drivers to signal support for operations.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

-- Sebastian

>  drivers/gpu/drm/omapdrm/dss/omapdss.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> index 3a5ee897baf0..e9a47d8c0edc 100644
> --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> @@ -388,6 +388,18 @@ struct omap_dss_device_ops {
>  	};
>  };
>  
> +/**
> + * enum omap_dss_device_ops_flag - Indicates which device ops are supported
> + * @OMAP_DSS_DEVICE_OP_DETECT: The device supports output connection detection
> + * @OMAP_DSS_DEVICE_OP_HPD: The device supports all hot-plug-related operations
> + * @OMAP_DSS_DEVICE_OP_EDID: The device supports readind EDID
> + */
> +enum omap_dss_device_ops_flag {
> +	OMAP_DSS_DEVICE_OP_DETECT = BIT(0),
> +	OMAP_DSS_DEVICE_OP_HPD = BIT(1),
> +	OMAP_DSS_DEVICE_OP_EDID = BIT(2),
> +};
> +
>  struct omap_dss_device {
>  	struct kobject kobj;
>  	struct device *dev;
> @@ -416,6 +428,7 @@ struct omap_dss_device {
>  
>  	const struct omap_dss_driver *driver;
>  	const struct omap_dss_device_ops *ops;
> +	unsigned long ops_flags;
>  
>  	/* helper variable for driver suspend/resume */
>  	bool activate_after_resume;
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 3a5ee897baf0..e9a47d8c0edc 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -388,6 +388,18 @@  struct omap_dss_device_ops {
 	};
 };
 
+/**
+ * enum omap_dss_device_ops_flag - Indicates which device ops are supported
+ * @OMAP_DSS_DEVICE_OP_DETECT: The device supports output connection detection
+ * @OMAP_DSS_DEVICE_OP_HPD: The device supports all hot-plug-related operations
+ * @OMAP_DSS_DEVICE_OP_EDID: The device supports readind EDID
+ */
+enum omap_dss_device_ops_flag {
+	OMAP_DSS_DEVICE_OP_DETECT = BIT(0),
+	OMAP_DSS_DEVICE_OP_HPD = BIT(1),
+	OMAP_DSS_DEVICE_OP_EDID = BIT(2),
+};
+
 struct omap_dss_device {
 	struct kobject kobj;
 	struct device *dev;
@@ -416,6 +428,7 @@  struct omap_dss_device {
 
 	const struct omap_dss_driver *driver;
 	const struct omap_dss_device_ops *ops;
+	unsigned long ops_flags;
 
 	/* helper variable for driver suspend/resume */
 	bool activate_after_resume;