diff mbox

[v3,1/2] drm: introduce bus_flags in drm_display_info

Message ID 1461011895-23608-2-git-send-email-stefan@agner.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Agner April 18, 2016, 8:38 p.m. UTC
Introduce bus_flags to specify display bus properties like signal
polarities. This is useful for parallel display buses, e.g. to
specify the pixel clock or data enable polarity.

Suggested-by: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Manfred Schlaegl <manfred.schlaegl@gmx.at>
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 drivers/gpu/drm/panel/panel-simple.c | 2 ++
 include/drm/drm_crtc.h               | 9 +++++++++
 2 files changed, 11 insertions(+)

Comments

Daniel Vetter April 20, 2016, 11:19 a.m. UTC | #1
On Mon, Apr 18, 2016 at 01:38:14PM -0700, Stefan Agner wrote:
> Introduce bus_flags to specify display bus properties like signal
> polarities. This is useful for parallel display buses, e.g. to
> specify the pixel clock or data enable polarity.
> 
> Suggested-by: Thierry Reding <thierry.reding@gmail.com>
> Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
> Acked-by: Manfred Schlaegl <manfred.schlaegl@gmx.at>
> Signed-off-by: Stefan Agner <stefan@agner.ch>

Since I bikeshedded the old patches that used the display mode stuff to
death, and I think this makes a lot more sense:

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/panel/panel-simple.c | 2 ++
>  include/drm/drm_crtc.h               | 9 +++++++++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index ceb2048..77ae07f 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -72,6 +72,7 @@ struct panel_desc {
>  	} delay;
>  
>  	u32 bus_format;
> +	u32 bus_flags;
>  };
>  
>  struct panel_simple {
> @@ -144,6 +145,7 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
>  	if (panel->desc->bus_format)
>  		drm_display_info_set_bus_formats(&connector->display_info,
>  						 &panel->desc->bus_format, 1);
> +	connector->display_info.bus_flags = panel->desc->bus_flags;
>  
>  	return num;
>  }
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index e0170bf..f8b37be 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -126,6 +126,14 @@ enum subpixel_order {
>  #define DRM_COLOR_FORMAT_RGB444		(1<<0)
>  #define DRM_COLOR_FORMAT_YCRCB444	(1<<1)
>  #define DRM_COLOR_FORMAT_YCRCB422	(1<<2)
> +
> +#define DRM_BUS_FLAG_DE_LOW		(1<<0)
> +#define DRM_BUS_FLAG_DE_HIGH		(1<<1)
> +/* drive data on pos. edge */
> +#define DRM_BUS_FLAG_PIXDATA_POSEDGE	(1<<2)
> +/* drive data on neg. edge */
> +#define DRM_BUS_FLAG_PIXDATA_NEGEDGE	(1<<3)
> +
>  /*
>   * Describes a given display (e.g. CRT or flat panel) and its limitations.
>   */
> @@ -147,6 +155,7 @@ struct drm_display_info {
>  
>  	const u32 *bus_formats;
>  	unsigned int num_bus_formats;
> +	u32 bus_flags;
>  
>  	/* Mask of supported hdmi deep color modes */
>  	u8 edid_hdmi_dc_modes;
> -- 
> 2.7.4
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index ceb2048..77ae07f 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -72,6 +72,7 @@  struct panel_desc {
 	} delay;
 
 	u32 bus_format;
+	u32 bus_flags;
 };
 
 struct panel_simple {
@@ -144,6 +145,7 @@  static int panel_simple_get_fixed_modes(struct panel_simple *panel)
 	if (panel->desc->bus_format)
 		drm_display_info_set_bus_formats(&connector->display_info,
 						 &panel->desc->bus_format, 1);
+	connector->display_info.bus_flags = panel->desc->bus_flags;
 
 	return num;
 }
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index e0170bf..f8b37be 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -126,6 +126,14 @@  enum subpixel_order {
 #define DRM_COLOR_FORMAT_RGB444		(1<<0)
 #define DRM_COLOR_FORMAT_YCRCB444	(1<<1)
 #define DRM_COLOR_FORMAT_YCRCB422	(1<<2)
+
+#define DRM_BUS_FLAG_DE_LOW		(1<<0)
+#define DRM_BUS_FLAG_DE_HIGH		(1<<1)
+/* drive data on pos. edge */
+#define DRM_BUS_FLAG_PIXDATA_POSEDGE	(1<<2)
+/* drive data on neg. edge */
+#define DRM_BUS_FLAG_PIXDATA_NEGEDGE	(1<<3)
+
 /*
  * Describes a given display (e.g. CRT or flat panel) and its limitations.
  */
@@ -147,6 +155,7 @@  struct drm_display_info {
 
 	const u32 *bus_formats;
 	unsigned int num_bus_formats;
+	u32 bus_flags;
 
 	/* Mask of supported hdmi deep color modes */
 	u8 edid_hdmi_dc_modes;