devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/panel: simple: Support simple VGA panels
@ 2018-07-16  9:23 Linus Walleij
  2018-07-16 22:50 ` Rob Herring
  2018-07-17  7:05 ` Michal Vokáč
  0 siblings, 2 replies; 7+ messages in thread
From: Linus Walleij @ 2018-07-16  9:23 UTC (permalink / raw)
  To: Thierry Reding, dri-devel
  Cc: devicetree, Lorenzo Pieralisi, Liviu Dudau, Sudeep Holla,
	Robin Murphy

The need to support some straight-forward VGA panels that are
not adhering to any standard like DPI arise in the ARM RTSM VE
Real-Time Systems Model Virtual Executive. This emulator (which
is not QEMU) does not model any bridge or panel other than
displaying whatever the user defines that they have.

Currently a fake "DPI panel" is used for this with the old
FBDEV driver, but this is wrong as it is not conforming to any
MIPI DPI standards. However the resolution chosen there is
standard VGA, and we can cover this with the simple panel
by simply adding the most common VGA resolutions as a kind
of "simple panel".

In difference from other cases where "simple panel" might be
hiding something more complex (such as a panel driver or bridge)
this case is actually applicable, since we are running inside
a simulation with no real hardware on the output.

Cc: devicetree@vger.kernel.org
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 .../display/panel/video-graphics-array.txt    | 21 ++++++
 drivers/gpu/drm/panel/panel-simple.c          | 66 +++++++++++++++++++
 2 files changed, 87 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/panel/video-graphics-array.txt

diff --git a/Documentation/devicetree/bindings/display/panel/video-graphics-array.txt b/Documentation/devicetree/bindings/display/panel/video-graphics-array.txt
new file mode 100644
index 000000000000..193d24ebe052
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/video-graphics-array.txt
@@ -0,0 +1,21 @@
+Video Graphics Array
+
+This binding is for simple panels using the standardized VGA resolutions
+defined by de facto standards beginning with the IBM PS/2 in 1987.
+
+Required properties:
+- compatible: should be "video-graphics-array"
+
+This binding is compatible with the simple-panel binding, which is specified
+in simple-panel.txt in this directory.
+
+Example:
+
+panel {
+	compatible = "video-graphics-array";
+	port {
+		vga_panel_in: endpoint {
+			remote-endpoint = <&foo>;
+		};
+	};
+};
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index cbf1ab404ee7..db4db5a3f75e 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -2069,6 +2069,69 @@ static const struct panel_desc winstar_wf35ltiacd = {
 	.bus_format = MEDIA_BUS_FMT_RGB888_1X24,
 };
 
+static const struct drm_display_mode video_graphics_array_modes[] = {
+	{
+		/*
+		 * This is the most standardized "vanilla" VGA mode there is:
+		 * 640x480 @ 60 Hz
+		 */
+		.clock = 27175,
+		.hdisplay = 640,
+		.hsync_start = 640 + 16,
+		.hsync_end = 640 + 16 + 96,
+		.htotal = 640 + 16 + 96 + 48,
+		.vdisplay = 480,
+		.vsync_start = 480 + 10,
+		.vsync_end = 480 + 10 + 2,
+		.vtotal = 480 + 10 + 2 + 33,
+		.vrefresh = 60,
+		.flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
+	},
+	{
+		/* SVGA 800x600 @60 Hz */
+		.clock = 40000,
+		.hdisplay = 800,
+		.hsync_start = 800 + 40,
+		.hsync_end = 800 + 40 + 128,
+		.htotal = 800 + 40 + 128 + 88,
+		.vdisplay = 600,
+		.vsync_start = 600 + 1,
+		.vsync_end = 600 + 1 + 4,
+		.vtotal = 600 + 1 + 4 + 23,
+		.vrefresh = 60,
+		.flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
+	},
+	{
+		/* XGA 1024x768 @60 Hz */
+		.clock = 65000,
+		.hdisplay = 1024,
+		.hsync_start = 1024 + 24,
+		.hsync_end = 1024 + 24 + 136,
+		.htotal = 1024 + 24 + 136 + 160,
+		.vdisplay = 768,
+		.vsync_start = 768 + 3,
+		.vsync_end = 768 + 3 + 6,
+		.vtotal = 768 + 3 + 6 + 29,
+		.vrefresh = 60,
+		.flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
+	},
+};
+
+static const struct panel_desc video_graphics_array = {
+	.modes = video_graphics_array_modes,
+	.num_modes = ARRAY_SIZE(video_graphics_array_modes),
+	.bpc = 8,
+	/*
+	 * Some typical 4:3 aspect ratio VGA monitor surely has these dimensions
+	 * of 40x30 mm.
+	 */
+	.size = {
+		.width = 400,
+		.height = 300,
+	},
+	.bus_format = MEDIA_BUS_FMT_RGB888_1X24,
+};
+
 static const struct of_device_id platform_of_match[] = {
 	{
 		.compatible = "ampire,am-480272h3tmqw-t01h",
@@ -2286,6 +2349,9 @@ static const struct of_device_id platform_of_match[] = {
 	}, {
 		.compatible = "winstar,wf35ltiacd",
 		.data = &winstar_wf35ltiacd,
+	}, {
+		.compatible = "video-graphics-array",
+		.data = &video_graphics_array,
 	}, {
 		/* sentinel */
 	}
-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-07-29 19:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-16  9:23 [PATCH] drm/panel: simple: Support simple VGA panels Linus Walleij
2018-07-16 22:50 ` Rob Herring
2018-07-17  7:47   ` Linus Walleij
2018-07-17 14:02     ` Rob Herring
2018-07-18 13:21       ` Liviu Dudau
2018-07-29 19:36       ` Linus Walleij
2018-07-17  7:05 ` Michal Vokáč

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).